Skip to Content
CheckoutAPI ReferenceSubscriptionsQuote the next charge for a subscription

Quote the next charge for a subscription

POST/subscriptions/{subscriptionId}/charge-quote

Quote the next charge for a subscription. Crypto-priced plans return the fixed amount; fiat-priced plans return a locked rate and a price_lock_code to submit with the charge.

Headers

HeaderDescriptionRequired
AuthorizationBearer token with your secret API keyyes

Path Parameters

NameTypeRequiredDescription
subscriptionIdstringyes

Example Request

Request

const response = await fetch('https://checkout-api.exodus-int.com/subscriptions/<subscriptionId>/charge-quote', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxx',
  },
});

Responses

StatusDescription
200The charge quote, including any locked rate.
400Validation error
401Missing or invalid authentication
404Resource not found

Response body

FieldTypeRequiredDescription
objectenum: subscription_charge_quoteyes
subscription_idstringyes
amountstringyes
price_lock_codestring | nullyes
ratestring | nullyes
expires_atstring | nullyes

Example Response

{
  "object": "subscription_charge_quote",
  "subscription_id": "0x9f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a",
  "amount": "9990000",
  "price_lock_code": null,
  "rate": null,
  "expires_at": null
}

Error Response

Error (e.g. 400)

{
  "error": {
    "type": "validation_error",
    "message": "amount must be a positive number",
    "param": "amount"
  }
}

Quote Semantics

No request body and no signature — this call moves no funds.

  • Token-priced plans (price_currency: null) echo the plan’s price as amount, with price_lock_code, rate, and expires_at all null. You can skip the quote entirely and sign price directly.
  • Fiat-priced plans (price_currency set) convert the fiat price to a settlement-token amount at the live rate and lock that rate: pass the returned amount and price_lock_code to POST /subscriptions/:id/charge before expires_at.

The subscription id is the on-chain bytes32 hex id — obtain it from GET /merchants/:merchantId/subscriptions, the subscription.created webhook, or the subscription_checkout.completed webhook.

The quote binds the price_lock_code to the exact amount it returned. Charging a different amount under that lock is rejected with quote_amount_mismatch; charging after expires_at is rejected with quote_expired — re-quote and re-sign.

Errors

StatusTypeDescription
400invalid_requestFiat-priced plan on a business without a fiat settlement configuration (“Charge quote is only available for fiat settlements”).
404not_foundSubscription ID does not exist or belongs to another merchant.
502invalid_requestThe settlement provider failed to create the price lock. Retry.

Token-priced plans never fail on settlement configuration — the quote is a passthrough of price.

Start building

XO

Request Demo

Schedule a call with our team

Select a product
Arrow right

Start building
Grateful

Contact Us

We're here to help