list_billing_products
Arguments:{}. Reads active paid consumer offers available to the account and
country without creating a payment.
Returns products and amountUnit: "currency_minor_unit". Each offer contains:
A null
purchaseAmount means the estimate is unavailable or inapplicable;
it does not remove the offer. Discounts and the final payable amount are
calculated when the shared payment service executes the action. Do not equate
an estimate with the final charge.
get_billing_account
Arguments:{}. Returns subscriptions from owned current subscription items.
Each entry contains subscriptionId, status, productId, priceId,
quantity, nullable effectiveAt, and nullable expiresAt. Dates are Unix
timestamps in seconds.
prepare_billing_action
purchase_one_time requires a one-time offer. Subscription operations require a
recurring offer. upgrade_subscription requires one owned current subscription
item; the shared service decides permitted upgrades, downgrades, replacements,
proration, and billing-cycle changes.
After the user approves the purchase, replace the synthetic catalog IDs below
with a matching current product and price:
requestId, operation, orderId, isNewOrder,
paymentStatus, immediateCharge (an integer charge amount), chargeInCurrency,
and status. Payment status can be success, partial_success, or failure.
If payment needs Checkout, it also returns checkoutSessionId, checkoutUrl,
expiresAt (Unix seconds), and status: "awaiting_payment". Open the returned
Checkout URL and use get_billing_action to read its synchronized status.
get_billing_action
Required: nonblank ownedcheckoutSessionId, at most 200 characters, without
surrounding whitespace. Reads synchronized Checkout/webhook records; it does
not create a purchase or charge.
Returns checkoutSessionId, status, checkoutStatus, paymentStatus,
paymentReceived, fulfillmentStatus: "managed_by_webhooks", and orderId
when linked. status can be:
payment_received and paymentReceived: true confirm the recorded payment
state, not entitlement fulfillment. Check the account’s subscription/credits
through the application after fulfillment. Immediate-charge actions without
a Checkout session have no Checkout status to poll.
Billing failures
Errors includeINVALID_ARGUMENTS, BILLING_PRODUCT_UNAVAILABLE,
BILLING_UPGRADE_UNSUPPORTED, BILLING_ACTION_NOT_FOUND,
BILLING_ACTION_UNCONFIRMED, and BILLING_REQUEST_FAILED. Do not automatically
retry billing mutations, including after a failed or uncertain response.
Read-only catalog/account/Checkout lookups can be repeated without purchasing.