Skip to Content
CheckoutAPI ReferenceSubscriptionsUpdate a subscription charge's metadata

Update a subscription charge's metadata

PATCH/merchants/{merchantId}/charges/{chargeId}

Replace the metadata object on a subscription charge. Use this to attach a reconciliation reference (invoice, order, or ledger id) after the fact — in particular when a charge relay request failed after the on-chain charge settled, so the metadata never persisted. Discover the charge via the list endpoint (filter by subscription_id, match on charge_nonce or tx_hash). The metadata is replaced wholesale, not merged; send { "metadata": {} } to clear it.

Headers

HeaderDescriptionRequired
AuthorizationBearer token with your secret API keyyes

Path Parameters

NameTypeRequiredDescription
merchantIdstringyes
chargeIdstringyes

Request Body

FieldTypeRequiredDescription
metadataobjectyesFlat 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/merchants/<merchantId>/charges/<chargeId>', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxx',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "metadata": {
      "invoice_id": "inv_202605"
    }
  }),
});

Responses

StatusDescription
200The charge with its updated metadata.
400Validation error
401Missing or invalid authentication
403API key lacks the required scope
404Resource not found

Response body

FieldTypeRequiredDescription
objectenum: subscription_chargeyes
idstringyes
subscription_idstringyes
subscriberstringyes
amountstringyes
feestringyes
tx_hashstring | nullyes
chainstringyes
charge_noncenumberyes
charged_atstringyes
statusenum: succeeded | failedyes
failure_reasonstring | nullyes
block_numberstringyes
metadataobject | nullyes
created_atstringyes

Example Response

{
  "object": "subscription_charge",
  "id": "subc_6789abcdef012345",
  "subscription_id": "0x9f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a",
  "subscriber": "0x742d35Cc6634C0532925a3b844Bc9e7595f8fE21",
  "amount": "9990000",
  "fee": "0",
  "tx_hash": "0x8a9c67b2d1e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9",
  "chain": "eip155:1",
  "charge_nonce": 3,
  "charged_at": "2026-05-19T12:02:18Z",
  "status": "succeeded",
  "failure_reason": null,
  "block_number": "12346789",
  "metadata": {
    "invoice_id": "inv_202605"
  },
  "created_at": "2026-05-19T12:02:18Z"
}

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