Skip to Content
CheckoutAPI ReferenceSubscriptionsOverview

Subscriptions

A Subscription is the on-chain record of an active recurring stablecoin agreement. It is materialized by the indexer when a customer completes a subscription checkout and the first subscribeAndCharge transaction confirms on-chain. For a chargeless checkout (initial_charge: false), the customer signs subscribe instead, and the transaction emits SubscriptionCreated only.

Creation

Subscriptions are not created via a direct API call. To start one:

  1. Call POST /subscription-checkouts to create an intent.
  2. Redirect the customer to the returned checkout_url.
  3. The customer signs subscribeAndCharge from their wallet. For a chargeless checkout (initial_charge: false), the customer signs subscribe with no charge, and the transaction emits SubscriptionCreated only.
  4. The indexer materializes the Subscription and dispatches the subscription.created and subscription.charge_succeeded webhooks. A chargeless checkout sends no subscription.charge_succeeded at this step.

Pricing

A plan’s recurring price is price, declared on the originating subscription checkout. Every plan created today sets price_currency, and price is an integer in that currency’s ISO 4217 minor units ("150000" is 1,500.00 ARS; CLP has no minor unit, so "15000" is CLP 15,000). Subscriptions predating fiat-only pricing can still carry price_currency: null, with price in the settlement token’s smallest units instead; they keep charging on those terms. The per-charge amount is dynamic: at each charge the merchant chooses the amount, signs it with signCharge, and submits it in the request body — bounded by cap_amount per call and by the per-window budget. Simple plans quote the subscription’s price and pass the quoted amount; metered billing may charge several times within one window.

Fiat-priced plans convert the fiat price, or an ad-hoc fiat amount passed in the quote body, to a token amount at quote time via POST /subscriptions/:id/charge-quote, then pass the quoted amount and quote code to charge. The quote mechanism depends on settlement type: a fiat-settled business gets a settlement-provider-minted price lock (price_lock_code), redeemed at ramp-off after the charge; a crypto-settled business gets an Exodus-minted reference quote (refq_ code, 120s TTL) that only proves the charged amount matched what the subscriber was shown — funds stay in stablecoin, nothing converts, no settlement configuration needed.

Merchant-Driven Actions

After creation, the merchant drives all subsequent state changes via the API. Each action is a signed request: the merchant uses @exodus/checkout-signer to produce a signature, posts it to the Exodus API, and Exodus submits the on-chain transaction.

ActionSigner helperEndpoint
Charge a subscriber for a cyclesignChargePOST /subscriptions/:id/charge
Cancel a subscriptionsignCancelSubscriptionPOST /subscriptions/:id/cancel
🔐

All merchant actions require a signing key. See Signed Requests for setup, and the per-action pages for the exact signer call and request body.

Raising the cap is subscriber-authorized — the subscriber calls updateCap on-chain (observed by the indexer as the subscription.cap_updated webhook). A merchant key can only charge within the subscriber’s cap and budget, and cancel; it can never raise either ceiling.

Merchant Cancel

POST /subscriptions/:id/cancel answers 200 with status: "cancelling" and the tx_hash of the cancel transaction. When Exodus sent the cancel but could not confirm it in time, the response is the same 200 cancelling with tx_hash. Exodus follows the cancel until it takes effect, so you do not need to send it again. subscription.cancelled fires when the cancel takes effect, and subscription.cancel_failed fires when it can no longer go through.

  • The signed deadline must be at most 7 days after the request. A later deadline gets a 400 validation_error with param: "deadline", and Exodus sends nothing. A cancel that does not take effect can keep the subscription in cancelling until its deadline passes, and charges are refused during that time. A shorter deadline shortens that wait.
  • A first cancel can also answer 200 with status: "cancelled" and its tx_hash, when Exodus recorded the cancel as final before it answered. subscription.cancelled still fires for it.
  • A cancel on a subscription that is already cancelled answers 200 with status: "cancelled" and tx_hash: null.
  • A retry while the subscription is cancelling sends nothing new. It returns 200 cancelling with the tx_hash Exodus holds for the cancel, or null when it holds none.
  • A retry signed with a later deadline replaces the signature Exodus holds. Exodus uses the newer signature if it has to send the cancel again. A retry with the same or an earlier deadline changes nothing. A retry with a later deadline whose signature does not verify gets a 401 Invalid merchant signature and changes nothing.
  • A 503 with the message Service is temporarily unavailable. means Exodus sent nothing. Retry with the same signature until its deadline passes. A 503 with code: subscription_manager_paused is the exception: a retry does not succeed until the subscription manager is unpaused.
  • In a rare case, Exodus sent the cancel but could not record it. The response is then a 504 with code: tx_pending, and data carries subscription_id and tx_hash (null when this request sent nothing new). The subscription can stay active, so charges can still go through. Retry the same request with the same signature. The retry returns the subscription’s current state: 200 cancelling or cancelled once Exodus records the cancel, or the error a first cancel gets when the cancel did not take effect.

Customer-Initiated Cancel

Customers cancel their own subscriptions from a hosted page:

https://checkout.exodus.com/cancel/:subscription_id

The page reads the on-chain subscription_id, requires the customer’s subscribing wallet to be connected, and lets them sign cancel(subscriptionId) directly. Surface this URL in your customer account UI for self-service cancellation. The customer pays the on-chain gas.

If the customer has lost access to their subscribing wallet, the page surfaces a “Lost wallet?” link. Exodus does not perform key recovery — recovery routes back to the merchant via the intent’s cancel_url, and the merchant cancels via POST /subscriptions/:id/cancel.

Statuses

StatusDescription
activeSubscription is live. Eligible for charge within the window’s remaining budget.
cancellingCancel transaction has been submitted on-chain. It is either confirmed, or sent and not yet confirmed. No further charges are eligible. Transitions to cancelled once the indexer ingests the SubscriptionCancelled event. Goes back to active when the signed cancel can no longer go through, and fires subscription.cancel_failed.
cancelledSubscription cancelled on-chain. No further charges possible.

paused (deprecated)

Subscriptions still carry a paused: boolean field, but it is deprecated and always false. A failed charge does not pause the subscription, and Exodus never blocks the next charge because of an earlier failure. The field will be removed from subscription responses, webhook payloads, and the subscription CSV report in a future release. The ?paused= filter on GET /merchants/:merchantId/subscriptions is deprecated with it. Do not build retry or dunning logic on paused.

To decide whether to retry a failed charge, read its failure_reason (see Retry Guidance). Recurring charges are merchant-driven (POST /subscriptions/:id/charge), so the retry schedule is yours.

Cap Semantics

Every subscription has a cap_amount — the on-chain maximum the contract will allow per call. The merchant declares it as the intent’s cap in fiat (defaulting to budget when omitted); at subscribe time the quote converts it to the settlement token’s smallest units at the same rate as the charge amount, and the subscriber signs that converted figure. cap_amount is therefore always a token amount, fixed at subscribe and unaffected by later rate moves. After that it cannot be raised by the merchant — only the subscriber can change it, via the on-chain updateCap.

  • charge enforces amount <= cap_amount per call. The API preflight rejects an over-cap charge with amount_exceeds_cap; one that races past the preflight reverts on-chain with ChargeAmountExceedsCap. Either way nothing is pulled until the subscriber raises the cap.
  • The cap is the subscriber’s security dial: a per-charge amount past it is rejected rather than silently pulling more.

A merchant who wants headroom for future price increases should declare a generous cap (a multiple of price) at intent creation — its converted value is what the subscriber signs, and it cannot be raised afterwards. Headroom also absorbs adverse rate moves: the fiat price converts at the live rate on every charge, while cap_amount stays pinned at the rate that applied when the subscriber signed.

Budget Semantics

Beyond the per-call cap_amount, every subscription carries a per-cycle budget — the maximum a merchant may charge in total within one billing window. This is what lets one subscription support multiple charges per cycle (metered usage, threshold reloads, mid-cycle add-ons) instead of a single fixed pull. GET /subscriptions/:id surfaces the ceiling and its running totals as budget, spent_this_period, and remaining_budget.

  • The window is tumbling, anchored to the subscription’s immutable on-chain start (startedAt): currentWindow = floor((now - startedAt) / period_duration) (integer division — same as the contract). It is never anchored to last_charged_at — re-anchoring to the merchant-movable last-charge time would let a merchant collapse two windows and pull 2 x budget on demand.
  • cap_amount bounds each individual charge; budget bounds the sum of charges within a window. Both ceilings are enforced: a charge reverts if its amount exceeds cap_amount, or if it would push spent_this_period past budget.
  • remaining_budget = budget - spent_this_period. spent_this_period resets to 0 at each window boundary.
  • budget is subscriber-sovereign: the merchant declares it as the intent’s budget in fiat, the quote converts it to token units at the same rate as cap_amount, the customer signs that converted figure at subscribe, and can lower it anytime via the on-chain updateBudget (observed as the subscription.budget_updated webhook). The merchant can never raise it — same security dial as cap_amount.

The residual exposure is a single-boundary straddle: at most 2 x budget across one real window boundary, once per period_duration — irreducible for any tumbling window. A compromised merchant key is bounded by budget x periods-until-cancel, with cap_amount bounding any single pull and subscriber cancel / updateBudget as the escape.

Subscription Charges

A SubscriptionCharge is the per-attempt record of a charge against a subscription. Both succeeded and failed charges are persisted — failed attempts include a typed failure_reason for dunning, analytics, and CSV exports.

FieldDescription
idsubc_... resource id, stable across redeliveries.
subscription_idThe parent subscription’s on-chain id (bytes32 hex).
subscriberOn-chain subscriber address (denormalized for filtering).
amountCharged amount in token’s smallest unit. For failed charges this is the attempted amount.
feeNetwork fee deducted, in token’s smallest unit. "0" on failed charges (no fee was collected).
tx_hashOn-chain transaction hash. null when the transaction was never broadcast (the contract rejected the charge at simulation, or the API refused it with TokenNotSettleableOnChain on a fiat-priced plan of a fiat-settled business — the failed attempt is still persisted with its typed failure_reason).
chainCAIP-2 identifier (e.g. eip155:1).
charge_nonceMonotonic per-subscription counter. 0 for the first charge from subscribeAndCharge, incremented by each charge.
charged_atBlock timestamp on success; API submission time on failure.
block_numberBlock number the charge was included in, as a string. "0" on failed charges (never mined).
created_atISO 8601 timestamp of when the row was written to the ledger.
statussucceeded or failed.
failure_reasonTyped contract error name on failure (e.g. InsufficientBalance, ChargeAmountExceedsCap, BudgetExceeded), or TokenNotSettleableOnChain when, on a fiat-priced plan of a fiat-settled business, the settlement provider cannot settle the subscription’s chain and token. null on success.
fiat_amountThe fiat amount this charge was quoted for, in fiat_currency’s minor units ("1250000" is 12,500.00 when fiat_currency is ARS; the currency is whatever the plan is priced in, not necessarily ARS). It is the plan’s price, or the ad-hoc amount passed to the quote for this charge — not a market rate, and not a confirmed payout (see settlement_status). null on a plan that is not fiat-priced, on failed and reverted charges, and on a charge made outside the charge and subscribe endpoints — see the callout below.
fiat_currencyISO-4217 code fiat_amount is denominated in. null whenever fiat_amount is null.
settlement_statuspending, delayed, completed, or failed for the fiat payout leg; delayed and failed each come with a settlement webhook — failed always carries the reason, delayed only when the reason is already known. null when the business settles in crypto (fiat_amount is then a price with no payout behind it), when the plan is not fiat-priced, on failed and reverted charges, and on a charge made outside the charge and subscribe endpoints.
metadataYour own key-value references for this charge (see Charge Metadata). null when the charge was sent without metadata, on failed and reverted charges, and when the charge request did not finish (a 504 tx_pending or a 500 charge_persist_failed), even if the request sent metadata.
⚠️

A non-null fiat_amount is not money received. On a crypto-settling business it is the charge’s fiat price with no conversion and no payout behind it, and settlement_status is null to say so. Only read fiat_amount as money received once settlement_status is completed — subscription.charge_settled fires when it gets there, so you do not have to poll for it.

Nor is it present on every charge of a fiat-priced plan. Failed and reverted charges carry null for all three fields, and so does a charge submitted to the contract directly rather than through POST /subscriptions/:id/charge or POST /subscription-checkouts/:id/subscribe. A charge made through those endpoints carries them even when its transaction confirms after the request returned. Reconcile on the fields being present, not on the plan being fiat-priced. subscription.charge_succeeded does not carry them, so read them off the charge.

On ARS settlement, a late or retried settlement runs at a new rate. When the settlement starts after the price lock expired, or is retried, the payout runs at a new price lock taken at that point, not at the rate you quoted. If the rate moved against you, the deposit no longer covers the fiat amount and the settlement fails when its 72-hour window closes, with subscription.charge_settlement_failed.

The same charge can be written by two paths — the API write path (POST /subscriptions/:id/charge persists the receipt synchronously; POST /subscription-checkouts/:id/subscribe does the same for a subscription’s first charge) and the indexer backup path (the indexer ingests the on-chain SubscriptionCharged event). Rows are deduplicated by tx_hash. After receiving a subscription.charge_succeeded or subscription.charge_failed webhook, an immediate GET /merchants/:id/charges is guaranteed to include the new row.

API-side preflight rejections are NOT persisted as charges. When the API rejects a call with subscription_cancelled, amount_exceeds_cap, budget_exceeded, missing_budget_state, a quote binding error, or a signature failure, no on-chain transaction is submitted and no SubscriptionCharge row is written. Track these in your scheduler logs.

The one exception is TokenNotSettleableOnChain, which only applies to a fiat-priced plan of a fiat-settled business. Nothing is submitted, but the API writes a failed charge and fires subscription.charge_failed (see Failed Charges).

Charge Metadata

Pass metadata on POST /subscriptions/:id/charge to attach your own references to one charge, for example the invoice or ledger id for that billing period. Exodus saves it on the charge when the charge succeeds. Charge metadata belongs to that one charge. It is separate from the metadata on the subscription checkout, and a charge never inherits it. To link a charge to your plan or customer, use its subscription_id.

Read charge metadata from the charge object: the POST /subscriptions/:id/charge response, GET /merchants/:id/charges, and the subscription charges CSV export. The subscription.charge_succeeded webhook does not carry it.

To add or replace metadata on an existing charge, use PATCH /merchants/:merchantId/charges/:chargeId. It replaces the whole metadata object. Use it in these cases:

  • The charge response shows metadata: null after you sent metadata. The charge succeeded, but Exodus could not save the metadata.
  • The charge request returned a 500 with code: charge_persist_failed. The charge went through on-chain, so do not send it again. The charge appears once Exodus indexes it. Find it with GET /merchants/:id/charges?subscription_id=... and match on the tx_hash from the error’s data. Do not match on charge_nonce alone: a failed attempt does not advance the nonce, so a failed row can share it.
⚠️

On a fiat-priced plan of a fiat-settled business, the charge metadata endpoint only updates the metadata. It does not start or complete the fiat settlement of the charge.

Failed Charges

The Exodus API persists every charge that reached the chain boundary — succeeded, receipt-reverted, or rejected by the contract simulation (persisted with tx_hash: null) — in the subscription charges ledger above. A replay of the same UnknownRevert in the same clock hour is not persisted; see Retry Guidance. On a fiat-priced plan of a fiat-settled business, it also persists a charge it refuses with TokenNotSettleableOnChain (with tx_hash: null), because the business’s settlement provider cannot settle the subscription’s chain and token. The other API-side preflight rejections (subscription_cancelled, amount_exceeds_cap, budget_exceeded, quote binding errors, signature failures) return a 4xx response and are not persisted. Common failure_reason values:

failure_reasonCause
InsufficientBalanceCustomer’s wallet balance is below amount.
InsufficientAllowanceCustomer revoked the ERC-20 allowance to the SubscriptionManager.
ChargeAmountExceedsCapThe charged amount exceeded cap_amount.
BudgetExceededThe charge would have pushed the window’s total past budget.
SubscriptionNotActiveSubscription is no longer active on-chain.
TokenNotSettleableOnChainFiat-priced plans settled in fiat only: the business’s settlement provider cannot settle the subscription’s chain and token. The charge was not broadcast.
UnknownRevertThe contract rejected the charge before broadcast with a revert Exodus cannot name. The charge was not broadcast.

Succeeded charges fire the subscription.charge_succeeded webhook; failed charge attempts — simulation rejections and TokenNotSettleableOnChain refusals included — fire subscription.charge_failed. A replay of the same UnknownRevert in the same clock hour fires no subscription.charge_failed; see Retry Guidance. A failed on-chain nonce read after a rejection answers 503 instead, with no failed charge and no subscription.charge_failed; see retrying a charge. Failed attempts are also visible via GET /merchants/:id/charges with status=failed for dunning and analytics.

Retry Guidance

Exodus does not retry a failed charge for you. A failed charge does not use up the subscription’s charge_nonce or the window’s budget. Use failure_reason to decide what to do next. This table is guidance; the API does not return a retry flag.

Groupfailure_reasonWhat to do
Retry later, a different outcome is possibleInsufficientBalance, InsufficientAllowance, BudgetExceeded, OnChainRevertRetry on your schedule. Balance and allowance codes can succeed once the subscriber acts. BudgetExceeded can succeed in the next window, but only when the amount fits within budget; a larger amount fails in every window, so lower it.
Fix the request, then retryInvalidSignature, ChargeAmountExceedsCapRe-read the subscription, re-sign with the current nonce and the registered signer, or lower the amount. A new amount needs a new signature and, on a fiat-priced plan, a new quote. Normally a signature problem is rejected with a 401 and never recorded; InvalidSignature appears only when the contract rejects the charge at simulation. A charge signed at a charge_nonce already used on-chain is normally not recorded as failed (see retrying a charge).
Stop chargingSubscriptionNotActive, SubscriptionNotFoundThe subscription can no longer be charged. Stop your schedule for it; a new subscription is needed to resume billing.
Do not retry, contact supportTokenNotSettleableOnChainThe same request fails again until the settlement provider adds the pair; contact support.
Do not retry, contact supportUnknownRevertThe contract rejected the charge with a revert Exodus cannot name, and the same request is likely to fail again. Contact support with the subscription ID and the time of the attempt.

Each TokenNotSettleableOnChain attempt records another failed charge and fires another subscription.charge_failed. This includes a replay of the same signed request and a retry with a new quote. After expires_at, a replay is refused with 409 quote_expired, or 422 quote_not_found once the quote is purged, and records nothing.

An UnknownRevert answers 422 with code: UnknownRevert, records a failed charge and fires subscription.charge_failed. On a fiat-priced plan the quote is released, so the same signed request can be replayed until expires_at. Exodus records at most one UnknownRevert failed charge and one subscription.charge_failed per subscription, charge_nonce and revert (its selector, plus its message for a require revert) in each clock hour (UTC). A replay inside that hour gets the same 422 and records nothing. A revert the node returns when Exodus sends the signed charge answers 500 and records no failed charge. A chain error with no revert data, or an EnforcedPause revert while the manager reads as unpaused, still returns a 500 with no failed charge. An empty revert can answer 422 or 500 depending on whether the chain’s RPC returns revert data.

Three codes are not in the table because a charge never records them. SubscriptionAlreadyExists and ChargeAmountExceedsBudget only apply to a subscribe. SignatureExpired only applies to a signature with a deadline, and a charge signature has none.

Available Endpoints

See also: Subscription Checkouts for the intent that creates a subscription.

Start building

XO

Request Demo

Schedule a call with our team

Select a productArrow right

Start building
Grateful

Contact Us

We're here to help