Skip to Content

Charge a subscription

POST/subscriptions/{subscriptionId}/charge

Charge an active subscription. Sign the charge amount together with the subscription's current charge_nonce; Exodus submits the on-chain charge and pays the gas. Each charge is bounded by the per-call cap_amount and the per-cycle budget, so multiple charges may run within a period until the budget is exhausted. Succeeded charges are recorded in the charges ledger and dispatched via the subscription.charge_succeeded webhook.

Headers

HeaderDescriptionRequired
AuthorizationBearer token with your secret API keyyes

Path Parameters

NameTypeRequiredDescription
subscriptionIdstringyes

Request Body

FieldTypeRequiredDescription
amountstringyes
price_lock_codestring
metadataobjectFlat map of merchant-defined references. Up to 50 keys; keys up to 40 characters; values are strings up to 500 characters (nested values are rejected).

Example Request

Request

const response = await fetch('https://checkout-api.exodus-int.com/subscriptions/<subscriptionId>/charge', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxx',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "amount": "9990000",
    "metadata": {
      "invoice_id": "inv_202605"
    }
  }),
});

Responses

StatusDescription
200The charge result — `status` is always `succeeded` on a 200 (failures throw error responses). Fetch the subscription for the updated budget and scheduling state.
400Validation error
401Missing or invalid authentication
403API key lacks the required scope
404Resource not found

Response body

FieldTypeRequiredDescription
subscription_idstringyes
charge_noncenumberyes
amountstringyes
tx_hashstringyes
statusenum: succeededyes
metadataobject | nullyes

Example Response

{
  "subscription_id": "0x9f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a",
  "charge_nonce": 3,
  "amount": "9990000",
  "tx_hash": "0x7e81c228fc4fcf0372a86ce6f8bbc457210a8b51fc30dee5557280e5153c9f06",
  "status": "succeeded",
  "metadata": {
    "invoice_id": "inv_202605"
  }
}

Error Response

Error (e.g. 400)

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

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