Skip to content
OnCharge.io
View as Markdown
Developer docs

API reference

Every endpoint of the OnCharge merchant API, generated from the OpenAPI 3.1 spec (version 1.0.0). The base URL is https://app.oncharge.io. Every request is signed as described in Authentication & signing: the X-Oncharge-Key, X-Oncharge-Timestamp and X-Oncharge-Signature headers are required on every call and are not repeated below.

  • Amounts are integers in minor units; currencies are ISO 4217 codes.
  • Errors are JSON { "error": "<code>", "message": "<text>" }. Every endpoint can also return 401 (authentication: missing_auth, invalid_timestamp, timestamp_expired, invalid_key, invalid_signature), 403 (store_inactive: the store is pending or suspended; domain_mismatch), 429 (rate_limited), 500 (internal_error) and 503 (service_unavailable); see Errors. Endpoint tables below list only the other statuses.
  • Every endpoint accepts an optional X-Store-Domain header; if a request carries Origin, Referer or X-Store-Domain, one of them must match a registered store domain.
  • Send Idempotency-Key on session creation, cancellation and refunds.

Checkout sessions#

Start a payment and show OnCharge's hosted or embedded checkout.

Create a checkout session#

HTTP
POST /api/v1/checkout/sessions

Creates a checkout session for one order or cart. Show the shopper the returned iframe_url (a path on https://app.oncharge.io), either embedded in an iframe on one of your registered domains or as a full-page redirect.

return_url must be on one of the store's registered domains. Sessions expire 30 minutes after creation.

Send an Idempotency-Key to make retries safe: while a session created with the same key is still open (created or pending) and less than 50 minutes old, the same session is returned with status 200 instead of a new one.

For physical goods, send shipping: OnCharge releases the payout after the carrier confirms delivery to this address, and the address cannot be changed later. When the session is for an existing order (order_id is given) and the order ships by carrier, shipping is required (422 shipping_address_required). A session created from a cart, before the order exists, may attach the address later with POST /api/v1/checkout/sessions/{session_id}/order; such a response carries shipping_required: true, and tracking for the order is refused until the address is on file.

Card payments are accepted in USD only for now (400 currency_not_supported).

On a store that sells both shipped and unshipped things, set requires_shipping on each line item: an order with a shipped item is paid out after carrier-confirmed delivery, one without it 7 days after payment.

A store closed to new payments answers 403 store_checkout_closed; a session that is already open can then no longer be paid (the checkout shows an error).

ParameterInTypeRequiredDescription
Idempotency-KeyheaderstringNoA unique key (up to 255 characters is safe) that makes retries of this request safe.

Request body (application/json)

FieldTypeRequiredDescription
amountinteger (≥ 1)YesAmount in the currency's minor unit (cents for USD).
currencystring (min 3 chars, max 3 chars)YesISO 4217 currency code.
referencestring (min 1 chars, max 255 chars)YesYour reference for this payment (order number or cart ID). Returned in webhooks.
return_urlstring (uri)YesWhere the shopper is sent after checkout. Must be on a registered store domain.
order_idstring (max 255 chars)NoYour order ID, if the order already exists. Otherwise attach it later.
customer_emailstring (email)No
customer_phonestringNoE.164 format recommended (+15551234567).
metadataobjectNoYour own key-value data, stored with the session.
shippingobjectNoWhere the order ships. OnCharge matches the carrier's delivery location against postal_code (US, first five digits) or city + state. Send at least postal_code or city.
shipping.namestring (max 200 chars)No
shipping.line1string (max 300 chars)No
shipping.line2string (max 300 chars)No
shipping.citystring (max 120 chars)No
shipping.statestring (max 120 chars)No
shipping.postal_codestring (max 20 chars)No
shipping.countrystring (max 60 chars)NoISO 3166-1 alpha-2 code recommended (US).
line_itemsarray of objectNo
line_items[].descriptionstringYes
line_items[].quantityinteger (≥ 1)Yes
line_items[].amount_including_taxinteger (≥ 0)YesLine amount in minor units, tax included.
line_items[].requires_shippingbooleanNoWhether this item is shipped. On a store that sells both shipped and unshipped things, an order with any shipped item is paid out after carrier-confirmed delivery; one whose items all say false, 7 days after payment. Without it, the order is decided by whether it has a shipping address.
line_items[].tax_categoryone of general_goods, nontaxable, services, electronic_services, clothing, software_download, saas, books, ebooks, music_download, dietary_supplements, otc_drugs, cosmetics, candy, groceries, prepared_food, pet_food, gift_cardsNoAn OnCharge product tax category.
customer_idstring (uuid)NoYour OnCharge customer (POST /api/v1/customers): the payment is theirs, and a card they choose to save is saved for them.
save_cardbooleanNoOffer the shopper to save their card for your store: a box they must tick (card payments on stores with their own card account). Charge the saved card later with POST /api/v1/customers/{customer_id}/charges. Needs customer_id or customer_email. Default false.
taxobjectNoSales tax for this payment, when your store has it on (Settings → Sales tax). With enabled, amount is the order as you list it (before tax, unless your store lists prices with tax included); line items (amount_including_tax is then each line's total as listed) and shipping_amount must add up to it. Tax is calculated for the shipping address, or billing_address when nothing ships. See /docs/sales-tax.
tax.enabledbooleanYesCalculate sales tax. Store plugins that already add their platform's tax should leave this off.
tax.shipping_amountinteger (≥ 0)NoThe shipping charge inside amount, minor units: taxed as shipping.
tax.billing_addressobjectNo
tax.billing_address.line1string (max 300 chars)No
tax.billing_address.line2string (max 300 chars)No
tax.billing_address.citystring (max 120 chars)No
tax.billing_address.statestring (max 120 chars)NoTwo-letter US state (or its name).
tax.billing_address.postal_codestring (max 20 chars)YesFive-digit US ZIP code (ZIP+4 accepted).
tax.billing_address.countrystring (max 60 chars)NoUS only for now. Defaults to US.
Request
{
  "amount": 4900,
  "currency": "USD",
  "reference": "order-1001",
  "return_url": "https://shop.example.com/checkout/complete?order=1001",
  "order_id": "1001",
  "customer_email": "shopper@example.com",
  "shipping": {
    "name": "Alex Rivera",
    "line1": "500 Market St",
    "city": "San Francisco",
    "state": "CA",
    "postal_code": "94105",
    "country": "US"
  },
  "line_items": [
    {
      "description": "Example product",
      "quantity": 1,
      "amount_including_tax": 4900
    }
  ]
}

Response 201

FieldTypeAlways presentDescription
session_idstring (uuid)Yes
statusone of created, pending, authorized, captured, refused, cancelled, error, expiredYescreated (waiting for the shopper), pending (the shopper must complete a step), authorized (approved, not yet captured), captured (paid), refused (declined), cancelled, error, expired (not paid within 30 minutes).
iframe_urlstringYesPath of the checkout page relative to https://app.oncharge.io, including the pay token. Prefix it with the API base URL to get the full checkout URL.
pay_tokenstringYesShort-lived token (30 minutes) that authorizes the checkout page. Already included in iframe_url.
created_atstring (date-time)Yes
expires_atstring (date-time)Yes
shipping_requiredbooleanNoPresent (true) when the order ships by carrier and has no shipping address yet. Attach it with POST /api/v1/checkout/sessions/{session_id}/order; tracking is refused until it is on file.
amountintegerNoWith sales tax: what the shopper pays (the calculated total, once the address is known).
taxobject or nullNoSales tax on a payment; null when it is not taxed.
tax.statusone of awaiting_address, calculated, pending, failed, collected, partly_refunded, refundedYesawaiting_address: no address yet, the payment waits. calculated: not paid yet. pending: tax included, charged while the calculation was unavailable; worked out shortly. failed: the calculation failed (error), the payment waits. collected, partly_refunded, refunded: paid, and how much of the tax was given back.
tax.inclusivebooleanYestrue when the listed prices include the tax.
tax.currencystring or nullYes
tax.subtotalinteger or nullYesBefore tax, minor units.
tax.amountinteger or nullYesThe tax, minor units.
tax.totalinteger or nullYesWhat the customer pays, minor units.
tax.shippingintegerYesThe shipping charge inside the total, minor units.
tax.jurisdictionsarray of objectYes
tax.jurisdictions[].statestring or nullNo
tax.jurisdictions[].ratestringNoCombined percent, e.g. "8.25".
tax.jurisdictions[].amountintegerNo
tax.refundedintegerYesTax given back so far with refunds and lost disputes, minor units.
tax.errorstring or nullYestax_address_invalid or tax_unavailable when status is failed.
Response
{
  "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "status": "created",
  "iframe_url": "/checkout/8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11?token=pt_eyJzZXNzaW9uSWQiOi4uLn0.3f9c",
  "pay_token": "pt_eyJzZXNzaW9uSWQiOi4uLn0.3f9c",
  "created_at": "2026-01-01T00:00:00.000Z",
  "expires_at": "2026-01-01T00:30:00.000Z"
}
StatusMeaning
200Idempotent replay: an open session created with the same Idempotency-Key within the last 50 minutes. A fresh pay_token is issued.
201Session created.
400validation_error, invalid_json, invalid_return_url (the return URL is not on a registered store domain), no_domains (the store has no registered domain) or currency_not_supported (card payments are accepted in USD only).
403store_inactive (the store is not active yet, for example while its processing account is being opened, or it is suspended), store_checkout_closed (OnCharge has closed the store to new payments, for example while the account is being offboarded; shipments and refunds still work), domain_mismatch, or global_ban (the shopper's email or phone is blocked across OnCharge; show the message to the shopper and do not retry).
422shipping_address_required: the order ships by carrier and order_id was given, but no shipping address (postal code or city). The order is paid out only after the carrier confirms delivery to that address. Show the message to the shopper.

Retrieve a checkout session#

HTTP
GET /api/v1/checkout/sessions/{session_id}

Returns the session's current status. Use it to confirm a payment server-side (for example when the shopper lands on your return_url) in addition to webhooks.

ParameterInTypeRequiredDescription
session_idpathstring (uuid)YesThe checkout session ID returned when the session was created.

Response 200

FieldTypeAlways presentDescription
session_idstring (uuid)Yes
store_idstring (uuid)Yes
order_idstring or nullNo
amountinteger (≥ 1)YesAmount in the currency's minor unit (cents for USD).
currencystring (min 3 chars, max 3 chars)YesISO 4217 currency code.
statusone of created, pending, authorized, captured, refused, cancelled, error, expiredYescreated (waiting for the shopper), pending (the shopper must complete a step), authorized (approved, not yet captured), captured (paid), refused (declined), cancelled, error, expired (not paid within 30 minutes).
payment_referencestringYesOnCharge's reference for the payment: ocpay_ and the session id in lowercase hex without dashes, for every session. Never a payment processor id.
psp_referencestring or nullNoKept with its meaning for existing integrations: for a session created before the reference cutoff (2026-12-01T00:00:00Z by default; see the OnCharge references guide), its original payment reference (null before payment); for a session created at or after it, the same ocpay_ reference as payment_reference. New integrations should read payment_reference. Deprecated.
payment_methodone of card, bank_debit, cash_app_pay, klarna, affirm, afterpay, or nullNoHow the shopper paid: card, or a way to pay beyond cards the store turned on (bank debit, Cash App Pay, Klarna, Affirm, Afterpay; see the Payment methods guide). Null for crypto.
settlementone of verify_deposits, processing, settled, or nullNoA bank debit's collection: verify_deposits while the shopper confirms their account with the test deposits, processing while the debit is collected (up to 4 business days), settled once it cleared. Null for every other method. Ship once status is captured.
risk_decisionone of accept, review, reject, or nullNoOutcome of the checkout risk check.
risk_scorenumber or nullNoRisk score 0–100.
created_atstring (date-time)Yes
updated_atstring (date-time)Yes
expires_atstring (date-time)Yes
taxobject or nullNoSales tax on a payment; null when it is not taxed.
tax.statusone of awaiting_address, calculated, pending, failed, collected, partly_refunded, refundedYesawaiting_address: no address yet, the payment waits. calculated: not paid yet. pending: tax included, charged while the calculation was unavailable; worked out shortly. failed: the calculation failed (error), the payment waits. collected, partly_refunded, refunded: paid, and how much of the tax was given back.
tax.inclusivebooleanYestrue when the listed prices include the tax.
tax.currencystring or nullYes
tax.subtotalinteger or nullYesBefore tax, minor units.
tax.amountinteger or nullYesThe tax, minor units.
tax.totalinteger or nullYesWhat the customer pays, minor units.
tax.shippingintegerYesThe shipping charge inside the total, minor units.
tax.jurisdictionsarray of objectYes
tax.jurisdictions[].statestring or nullNo
tax.jurisdictions[].ratestringNoCombined percent, e.g. "8.25".
tax.jurisdictions[].amountintegerNo
tax.refundedintegerYesTax given back so far with refunds and lost disputes, minor units.
tax.errorstring or nullYestax_address_invalid or tax_unavailable when status is failed.
Response
{
  "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "order_id": "string",
  "amount": 4900,
  "currency": "USD",
  "status": "created",
  "payment_reference": "ocpay_3f2a9c1e0b7d4e6f8a1b2c3d4e5f6a7b",
  "psp_reference": "string",
  "payment_method": "card",
  "settlement": "verify_deposits",
  "risk_decision": "accept",
  "risk_score": 0,
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "expires_at": "2026-01-01T00:00:00.000Z",
  "tax": {
    "status": "awaiting_address",
    "inclusive": true,
    "currency": "string",
    "subtotal": 0,
    "amount": 0,
    "total": 0,
    "shipping": 0,
    "jurisdictions": [
      {
        "state": "string",
        "rate": "string",
        "amount": 0
      }
    ],
    "refunded": 0,
    "error": "string"
  }
}
StatusMeaning
200The session.
404not_found: the object does not exist or belongs to another store.

Attach your order to a session#

HTTP
POST /api/v1/checkout/sessions/{session_id}/order

For sessions created from a cart before your order existed: records your order_id and the shipping destination. Each value is set once; later calls do not overwrite it.

The shipping address is recorded only if the session has none yet, no tracking number has been reported, and the session is less than 24 hours old. Check shipping_recorded and shipping_on_file in the response.

An order that ships by carrier is paid out only after delivery to its shipping address. If it is attached without one and none is on file, the order_id is still recorded and the response is 422 shipping_address_required.

ParameterInTypeRequiredDescription
session_idpathstring (uuid)YesThe checkout session ID returned when the session was created.

Request body (application/json)

FieldTypeRequiredDescription
order_idstring (min 1 chars, max 255 chars)No
shippingobjectNoWhere the order ships. OnCharge matches the carrier's delivery location against postal_code (US, first five digits) or city + state. Send at least postal_code or city.
shipping.namestring (max 200 chars)No
shipping.line1string (max 300 chars)No
shipping.line2string (max 300 chars)No
shipping.citystring (max 120 chars)No
shipping.statestring (max 120 chars)No
shipping.postal_codestring (max 20 chars)No
shipping.countrystring (max 60 chars)NoISO 3166-1 alpha-2 code recommended (US).
Request
{
  "order_id": "1001",
  "shipping": {
    "name": "Alex Rivera",
    "line1": "500 Market St",
    "city": "San Francisco",
    "state": "CA",
    "postal_code": "94105",
    "country": "US"
  }
}

Response 200

FieldTypeAlways presentDescription
session_idstring (uuid)Yes
order_idstring or nullYes
shipping_recordedbooleanYestrue if this call recorded the shipping address.
shipping_on_filebooleanYestrue if the session has a shipping destination (from this or an earlier call).
amountintegerNoWith sales tax: the total now that the address is known.
taxobject or nullNoSales tax on a payment; null when it is not taxed.
tax.statusone of awaiting_address, calculated, pending, failed, collected, partly_refunded, refundedYesawaiting_address: no address yet, the payment waits. calculated: not paid yet. pending: tax included, charged while the calculation was unavailable; worked out shortly. failed: the calculation failed (error), the payment waits. collected, partly_refunded, refunded: paid, and how much of the tax was given back.
tax.inclusivebooleanYestrue when the listed prices include the tax.
tax.currencystring or nullYes
tax.subtotalinteger or nullYesBefore tax, minor units.
tax.amountinteger or nullYesThe tax, minor units.
tax.totalinteger or nullYesWhat the customer pays, minor units.
tax.shippingintegerYesThe shipping charge inside the total, minor units.
tax.jurisdictionsarray of objectYes
tax.jurisdictions[].statestring or nullNo
tax.jurisdictions[].ratestringNoCombined percent, e.g. "8.25".
tax.jurisdictions[].amountintegerNo
tax.refundedintegerYesTax given back so far with refunds and lost disputes, minor units.
tax.errorstring or nullYestax_address_invalid or tax_unavailable when status is failed.
Response
{
  "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "order_id": "string",
  "shipping_recorded": true,
  "shipping_on_file": true,
  "amount": 0,
  "tax": {
    "status": "awaiting_address",
    "inclusive": true,
    "currency": "string",
    "subtotal": 0,
    "amount": 0,
    "total": 0,
    "shipping": 0,
    "jurisdictions": [
      {
        "state": "string",
        "rate": "string",
        "amount": 0
      }
    ],
    "refunded": 0,
    "error": "string"
  }
}
StatusMeaning
200What is on file for the session now.
400validation_error (the message lists each invalid field) or invalid_json.
404session_not_found: no such session for this store.
422shipping_address_required: the order ships by carrier and no shipping address is on file (none was sent, or it can no longer be recorded).

Cancel an authorized payment#

HTTP
POST /api/v1/checkout/sessions/{session_id}/cancel

Cancels a payment that is authorized but not yet captured. Captured payments must be refunded instead. Send an empty body ("") and sign it as such.

ParameterInTypeRequiredDescription
session_idpathstring (uuid)YesThe checkout session ID returned when the session was created.
Idempotency-KeyheaderstringNoA unique key (up to 255 characters is safe) that makes retries of this request safe.

No request body. Sign it as an empty body.

Response 200

FieldTypeAlways presentDescription
session_idstring (uuid)Yes
status"cancelled"Yes
psp_referencestringNoOpaque reference of the cancellation.
Response
{
  "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "status": "cancelled",
  "psp_reference": "string"
}
StatusMeaning
200The payment was cancelled.
404not_found: the object does not exist or belongs to another store.
409invalid_state (only authorized sessions can be cancelled) or missing_psp_ref.
502provider_error or provider_unavailable: the payment network did not accept the request. Retry later.

Shipments#

Report carrier tracking so delivered orders are paid out.

Report tracking numbers for a paid order#

HTTP
POST /api/v1/shipments

Reports the carrier and tracking number(s) a paid order shipped with. OnCharge confirms delivery with the carrier and pays the order out once every package is delivered to the order's shipping address.

Identify the order by session_id or by your order_id (the latest captured session with that order ID). Supported carriers: USPS, UPS, FedEx and DHL Express, by name or by the codes shipping tools use (e.g. ups_walleted, stamps_com, fedex_ground). carrier may be omitted, or be one OnCharge does not recognise, when the tracking number's format identifies the carrier (UPS 1Z…, USPS IMpb/S10; FedEx and DHL Express numbers when no carrier is given). Reporting a number that is already on the order again is harmless. Each tracking number is accepted or rejected individually.

To replace a tracking number (the package was lost, returned, or the label cancelled, and the order was shipped again), name it in replaces. Without replaces, a new number replaces every package of the order that has a problem. A replaced number stays tied to the order.

An order that is not confirmed delivered is refunded to the shopper automatically: 30 days after payment with no tracking, 45 days with no confirmed delivery (delivery.auto_refund_at).

Request body (application/json)

FieldTypeRequiredDescription
session_idstring (uuid)No
order_idstring (min 1 chars, max 255 chars)No
shipmentsarray of object (≥ 1 items, ≤ 10 items)Yes
shipments[].carrierstring or null (max 60 chars)NoUSPS, UPS, FedEx or DHL Express, or a shipping tool's code for one. Optional when the tracking number format identifies the carrier.
shipments[].tracking_numberstring (min 1 chars, max 80 chars)YesSpaces and dashes are ignored; 8–40 letters and digits after normalization.
shipments[].replacesstring or null (max 80 chars)NoThe tracking number (or shipment id) on this order that this one replaces.
Request
{
  "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "shipments": [
    {
      "carrier": "ups",
      "tracking_number": "1Z999AA10123456784"
    }
  ]
}

Response 200

FieldTypeAlways presentDescription
session_idstring (uuid)Yes
shipmentsarray of objectYes
shipments[].tracking_numberstringYes
shipments[].carrierone of usps, ups, fedex, dhl_expressNoNormalized carrier. Common spellings are accepted on input (USPS, United States Postal Service, UPS, FedEx, FedEx Ground, DHL, DHL Express, …).
shipments[].statusone of accepted, rejectedYes
shipments[].errorone of carrier_not_supported, tracking_number_invalid, carrier_mismatch, tracking_number_in_use, too_many_shipments, replacement_not_found, replacement_not_allowedNo
shipments[].messagestringNo
shipments[].replacedarray of stringNoTracking numbers this one replaced.
deliveryobjectYes
delivery.stateone of not_tracked, awaiting_shipment, in_transit, delivered, on_hold, refundedYesnot_tracked (no delivery tracking for this order, e.g. digital goods, or not paid yet), awaiting_shipment, in_transit, delivered (confirmed; payout released on schedule), on_hold (see hold_reason), refunded.
delivery.hold_reasonstring or nullYes
Response
{
  "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "shipments": [
    {
      "tracking_number": "1Z999AA10123456784",
      "carrier": "ups",
      "status": "accepted"
    }
  ],
  "delivery": {
    "state": "in_transit",
    "hold_reason": null
  }
}
StatusMeaning
200Per-number results and the order's delivery state.
400validation_error (the message lists each invalid field) or invalid_json.
404session_not_found: no such order for this store.
409order_not_paid: tracking can be added once the order has been paid. order_refunded: the order was refunded in full.
422shipping_address_missing: the order ships by carrier but has no shipping address, so its delivery cannot be confirmed.

Get an order's delivery status#

HTTP
GET /api/v1/shipments

The order's delivery state and every reported tracking number with the carrier's result. The query string is not part of the signature: sign the path /api/v1/shipments.

ParameterInTypeRequiredDescription
session_idquerystring (uuid)YesThe checkout session ID.

Response 200

FieldTypeAlways presentDescription
session_idstring (uuid)Yes
deliveryobjectYes
delivery.stateone of not_tracked, awaiting_shipment, in_transit, delivered, on_hold, refundedYesnot_tracked (no delivery tracking for this order, e.g. digital goods, or not paid yet), awaiting_shipment, in_transit, delivered (confirmed; payout released on schedule), on_hold (see hold_reason), refunded.
delivery.hold_reasonstring or nullYesPlain-language reason when state is on_hold.
delivery.delivered_atstring (date-time) or nullYesWhen the last package was confirmed delivered.
delivery.shipmentsarray of objectYes
delivery.shipments[].idstring (uuid)Yes
delivery.shipments[].carrierone of usps, ups, fedex, dhl_expressYesNormalized carrier. Common spellings are accepted on input (USPS, United States Postal Service, UPS, FedEx, FedEx Ground, DHL, DHL Express, …).
delivery.shipments[].carrier_labelstringYes
delivery.shipments[].tracking_numberstringYes
delivery.shipments[].statusone of pending, pre_transit, in_transit, out_for_delivery, delivered, available_for_pickup, return_to_sender, failure, cancelled, unknownYesLatest carrier status.
delivery.shipments[].resultone of checking, confirmed, problem, replacedYesconfirmed when delivery to the order address is verified; problem lists reasons in problems (re-ship and replace the number, or refund); replaced when another number took its place.
delivery.shipments[].problemsarray of stringYes
delivery.shipments[].delivered_atstring (date-time) or nullNo
delivery.shipments[].delivered_tostring or nullNoCity, state and postal code the carrier reported.
delivery.shipments[].notestring or nullNo
delivery.shipments[].removablebooleanYes
delivery.shipments[].created_atstring (date-time)Yes
delivery.shipments[].replaceablebooleanNo
delivery.shipments[].replaced_bystring (uuid) or nullNo
delivery.action_requiredstring or nullNoWhat to do now, if anything (add tracking, re-ship or refund).
delivery.auto_refund_atstring (date-time) or nullNoWhen the shopper is refunded in full automatically if the order is still not confirmed delivered.
delivery.can_add_trackingbooleanNo
delivery.shipping_address_missingbooleanNo
Response
{
  "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "delivery": {
    "state": "not_tracked",
    "hold_reason": "string",
    "delivered_at": "2026-01-01T00:00:00.000Z",
    "shipments": [
      {
        "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
        "carrier": "usps",
        "carrier_label": "UPS",
        "tracking_number": "string",
        "status": "pending",
        "result": "checking",
        "problems": [
          null
        ],
        "delivered_at": "2026-01-01T00:00:00.000Z",
        "delivered_to": "string",
        "note": "string",
        "removable": true,
        "created_at": "2026-01-01T00:00:00.000Z",
        "replaceable": true,
        "replaced_by": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11"
      }
    ],
    "action_required": "string",
    "auto_refund_at": "2026-01-01T00:00:00.000Z",
    "can_add_tracking": true,
    "shipping_address_missing": true
  }
}
StatusMeaning
200Delivery status.
400invalid_request: session_id is missing or not a UUID.
404session_not_found: no such order for this store.

Refunds#

Refund captured payments.

Refund a captured payment#

HTTP
POST /api/v1/refunds

Refunds all or part of a captured payment. Always send an Idempotency-Key (for example your refund ID) so a retried request cannot refund twice: a repeat with the same key returns the first refund with idempotent: true.

The final outcome arrives as a refund.succeeded webhook.

ParameterInTypeRequiredDescription
Idempotency-KeyheaderstringNoA unique key (up to 255 characters is safe) that makes retries of this request safe.

Request body (application/json)

FieldTypeRequiredDescription
session_idstring (uuid)Yes
amountinteger (≥ 1)YesAmount in the currency's minor unit (cents for USD).
currencystring (min 3 chars, max 3 chars)YesISO 4217 currency code.
referencestring (max 255 chars)NoYour reference for the refund.
Request
{
  "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "amount": 1500,
  "currency": "USD",
  "reference": "refund-1001-1"
}

Response 201

FieldTypeAlways presentDescription
refund_idstringYes
session_idstring (uuid)Yes
statusone of refund_requested, refundedYesrefunded if already complete, otherwise refund_requested until the refund.succeeded webhook.
amountinteger (≥ 1)YesAmount in the currency's minor unit (cents for USD).
currencystring (min 3 chars, max 3 chars)YesISO 4217 currency code.
Response
{
  "refund_id": "string",
  "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "status": "refund_requested",
  "amount": 4900,
  "currency": "USD"
}
StatusMeaning
200Idempotent replay of an earlier refund with the same Idempotency-Key.
201Refund requested.
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.
409invalid_state: only captured payments can be refunded (cancel authorized ones), or missing_psp_ref.
502provider_error or provider_unavailable: the payment network did not accept the request. Retry later.

Disputes#

Read and respond to disputes (chargebacks).

List disputes#

HTTP
GET /api/v1/disputes

The store's 50 most recent disputes, newest first.

Newest first, paged by cursor: pass next_cursor back as cursor. Filters are optional.

ParameterInTypeRequiredDescription
statusqueryone of open, won, lostNo
reasonqueryone of fraudulent, product_not_received, product_unacceptable, duplicate, subscription_canceled, credit_not_processed, unrecognized, generalNo
due_beforequerystring (date)NoEvidence due on or before this day (UTC).
fromquerystring (date)NoOpened on or after this day (UTC).
toquerystring (date)NoOpened on or before this day (UTC).
minquerystringNoSmallest amount, in major units.
maxquerystringNoLargest amount, in major units.
qquerystringNoA dispute or payment reference, a dispute id, or an order number.
limitqueryintegerNo
cursorquerystringNonext_cursor of the previous page.

Response 200

FieldTypeAlways presentDescription
disputesarray of objectYes
disputes[].idstring (uuid)Yes
disputes[].referencestringNoOnCharge's reference for the dispute (ocdsp_ and its id in hex).
disputes[].store_idstring (uuid)Yes
disputes[].session_idstring (uuid) or nullYesThe checkout session of the disputed payment.
disputes[].merchant_referencestring or nullYesYour own order reference.
disputes[].payment_referencestring or nullYesKept with its meaning for existing integrations: for a payment created before the reference cutoff (2026-12-01T00:00:00Z by default; see the OnCharge references guide), the payment reference this field always carried; for a payment created at or after it, the payment's ocpay_ reference. New integrations should read oncharge_payment_reference.
disputes[].oncharge_payment_referencestring or nullNoThe disputed payment's OnCharge reference (ocpay_…), for every dispute; the same as the checkout session's payment_reference. Null when no payment is linked.
disputes[].original_amountinteger or nullYesAmount of the original payment, minor units.
disputes[].dispute_amountinteger or nullYesDisputed amount, minor units.
disputes[].currencystring or nullYes
disputes[].reasonstring or nullYes
disputes[].reason_labelstringNoThe reason in plain words.
disputes[].reason_codestring or nullYes
disputes[].statusone of notification_of_chargeback, chargeback, second_chargeback, prearbitration, defense_pending, defended, accepted, won, lostYes
disputes[].status_labelstringNoThe status in plain words.
disputes[].defense_deadlinestring (date-time) or nullYesWhen evidence must be in.
disputes[].evidence_submitted_atstring (date-time) or nullYes
disputes[].closed_atstring (date-time) or nullYes
disputes[].responded_byone of oncharge, merchantYesoncharge: the OnCharge team submits the response using the evidence you upload; defend, accept and auto-defend return 409 responded_by_oncharge. merchant: you can defend or accept it through the API.
disputes[].created_atstring (date-time)Yes
disputes[].updated_atstring (date-time)Yes
next_cursorstring or nullNoPass as cursor for the next page; null on the last page.
Response
{
  "disputes": [
    {
      "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "reference": "string",
      "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "merchant_reference": "string",
      "payment_reference": "string",
      "oncharge_payment_reference": "string",
      "original_amount": 0,
      "dispute_amount": 0,
      "currency": "string",
      "reason": "string",
      "reason_label": "string",
      "reason_code": "string",
      "status": "notification_of_chargeback",
      "status_label": "string",
      "defense_deadline": "2026-01-01T00:00:00.000Z",
      "evidence_submitted_at": "2026-01-01T00:00:00.000Z",
      "closed_at": "2026-01-01T00:00:00.000Z",
      "responded_by": "oncharge",
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "next_cursor": "string"
}
StatusMeaning
200Disputes.

Retrieve a dispute#

HTTP
GET /api/v1/disputes/{dispute_id}

A dispute with the evidence files uploaded for it.

ParameterInTypeRequiredDescription
dispute_idpathstring (uuid)Yes

Response 200

FieldTypeAlways presentDescription
disputeobjectYesA dispute (chargeback) on one of your payments.
dispute.idstring (uuid)Yes
dispute.referencestringNoOnCharge's reference for the dispute (ocdsp_ and its id in hex).
dispute.store_idstring (uuid)Yes
dispute.session_idstring (uuid) or nullYesThe checkout session of the disputed payment.
dispute.merchant_referencestring or nullYesYour own order reference.
dispute.payment_referencestring or nullYesKept with its meaning for existing integrations: for a payment created before the reference cutoff (2026-12-01T00:00:00Z by default; see the OnCharge references guide), the payment reference this field always carried; for a payment created at or after it, the payment's ocpay_ reference. New integrations should read oncharge_payment_reference.
dispute.oncharge_payment_referencestring or nullNoThe disputed payment's OnCharge reference (ocpay_…), for every dispute; the same as the checkout session's payment_reference. Null when no payment is linked.
dispute.original_amountinteger or nullYesAmount of the original payment, minor units.
dispute.dispute_amountinteger or nullYesDisputed amount, minor units.
dispute.currencystring or nullYes
dispute.reasonstring or nullYes
dispute.reason_labelstringNoThe reason in plain words.
dispute.reason_codestring or nullYes
dispute.statusone of notification_of_chargeback, chargeback, second_chargeback, prearbitration, defense_pending, defended, accepted, won, lostYes
dispute.status_labelstringNoThe status in plain words.
dispute.defense_deadlinestring (date-time) or nullYesWhen evidence must be in.
dispute.evidence_submitted_atstring (date-time) or nullYes
dispute.closed_atstring (date-time) or nullYes
dispute.responded_byone of oncharge, merchantYesoncharge: the OnCharge team submits the response using the evidence you upload; defend, accept and auto-defend return 409 responded_by_oncharge. merchant: you can defend or accept it through the API.
dispute.created_atstring (date-time)Yes
dispute.updated_atstring (date-time)Yes
evidencearray of objectYes
evidence[].idstring (uuid)Yes
evidence[].doc_typestringYes
evidence[].filenamestring or nullYes
evidence[].uploaded_atstring (date-time)Yes
Response
{
  "dispute": {
    "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
    "reference": "string",
    "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
    "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
    "merchant_reference": "string",
    "payment_reference": "string",
    "oncharge_payment_reference": "string",
    "original_amount": 0,
    "dispute_amount": 0,
    "currency": "string",
    "reason": "string",
    "reason_label": "string",
    "reason_code": "string",
    "status": "notification_of_chargeback",
    "status_label": "string",
    "defense_deadline": "2026-01-01T00:00:00.000Z",
    "evidence_submitted_at": "2026-01-01T00:00:00.000Z",
    "closed_at": "2026-01-01T00:00:00.000Z",
    "responded_by": "oncharge",
    "created_at": "2026-01-01T00:00:00.000Z",
    "updated_at": "2026-01-01T00:00:00.000Z"
  },
  "evidence": [
    {
      "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "doc_type": "string",
      "filename": "string",
      "uploaded_at": "2026-01-01T00:00:00.000Z"
    }
  ]
}
StatusMeaning
200The dispute.
404not_found: the object does not exist or belongs to another store.

Upload dispute evidence#

HTTP
POST /api/v1/disputes/{dispute_id}/evidence

Uploads one evidence document as multipart/form-data. Sign this request with an empty body: the body hash in the signing string is the SHA-256 of the empty string (e3b0c442…b855), not of the multipart payload.

Upload evidence for every dispute, including those the OnCharge team responds to (responded_by: "oncharge"): the team uses your uploads.

ParameterInTypeRequiredDescription
dispute_idpathstring (uuid)Yes

Request body (multipart/form-data)

FieldTypeRequiredDescription
filestring (binary)YesThe document (PDF or image).
doc_typestringYesWhat the document is.

Response 201

FieldTypeAlways presentDescription
evidenceobjectYes
evidence.idstring (uuid)Yes
evidence.doc_typestringYes
evidence.filenamestring or nullYes
evidence.uploaded_atstring (date-time)Yes
Response
{
  "evidence": {
    "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
    "doc_type": "string",
    "filename": "string",
    "uploaded_at": "2026-01-01T00:00:00.000Z"
  }
}
StatusMeaning
201Evidence stored.
400missing_field: file and doc_type are required.
404not_found: the object does not exist or belongs to another store.

Accept a dispute#

HTTP
POST /api/v1/disputes/{dispute_id}/accept

Concedes the dispute. The disputed amount is not contested. Send an empty body. Disputes with responded_by: "oncharge" are answered by the OnCharge team: this returns 409 responded_by_oncharge.

ParameterInTypeRequiredDescription
dispute_idpathstring (uuid)Yes

No request body. Sign it as an empty body.

Response 200

FieldTypeAlways presentDescription
dispute_idstring (uuid)Yes
acceptedbooleanYes
Response
{
  "dispute_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "accepted": true
}
StatusMeaning
200Result.
404not_found: the object does not exist or belongs to another store.
409responded_by_oncharge: the OnCharge team responds to this dispute for you; upload your evidence before the deadline instead. missing_ref: the dispute cannot be answered yet.
502dispute_action_failed: the action could not be completed right now. Retry later or contact support.

Submit a dispute defense#

HTTP
POST /api/v1/disputes/{dispute_id}/defend

Submits the defense with the evidence already uploaded. Send an empty body. Disputes with responded_by: "oncharge" are answered by the OnCharge team: this returns 409 responded_by_oncharge.

ParameterInTypeRequiredDescription
dispute_idpathstring (uuid)Yes

No request body. Sign it as an empty body.

Response 200

FieldTypeAlways presentDescription
dispute_idstring (uuid)Yes
defendedbooleanYes
Response
{
  "dispute_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "defended": true
}
StatusMeaning
200Result.
404not_found: the object does not exist or belongs to another store.
409responded_by_oncharge: the OnCharge team responds to this dispute for you; upload your evidence before the deadline instead. missing_ref: the dispute cannot be answered yet.
502dispute_action_failed: the action could not be completed right now. Retry later or contact support.

Build and submit a defense automatically#

HTTP
POST /api/v1/disputes/{dispute_id}/auto-defend

Builds an evidence packet from the order's checkout records and uploaded evidence and submits the defense. Send an empty body. Disputes with responded_by: "oncharge" are answered by the OnCharge team: this returns 409 responded_by_oncharge.

ParameterInTypeRequiredDescription
dispute_idpathstring (uuid)Yes

No request body. Sign it as an empty body.

Response 200

FieldTypeAlways presentDescription
dispute_idstring (uuid)Yes
successbooleanYes
messagestringNoDefence submitted. on success, otherwise a neutral explanation.
evidence_countintegerNo
defense_text_previewstringNo
win_probabilitynumber or nullNo
ai_recommendationstring or nullNo
Response
{
  "dispute_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "success": true,
  "message": "string",
  "evidence_count": 0,
  "defense_text_preview": "string",
  "win_probability": 0,
  "ai_recommendation": "string"
}
StatusMeaning
200Result.
404not_found: the object does not exist or belongs to another store.
409responded_by_oncharge: the OnCharge team responds to this dispute for you; upload your evidence before the deadline instead. missing_ref: the dispute cannot be answered yet.
500build_failed (the evidence packet could not be built) or internal_error.

Customers#

Your store's customers and the cards they saved with you, and charges to a saved card while the customer is away.

List customers#

HTTP
GET /api/v1/customers

Your store's customers, newest first, with their totals.

ParameterInTypeRequiredDescription
qquerystringNoAn OnCharge customer ID, or part of an email, name, phone or your reference.
emailquerystring (email)No
referencequerystringNo
limitqueryintegerNo
cursorquerystringNonext_cursor of the previous page.

Response 200

FieldTypeAlways presentDescription
object"list"Yes
dataarray of objectYes
data[].idstring (uuid)Yes
data[].object"customer"Yes
data[].store_idstring (uuid)Yes
data[].emailstring or nullYes
data[].namestring or nullYes
data[].phonestring or nullYes
data[].referencestring or nullYesYour own ID for this customer.
data[].metadataobjectYes
data[].sourcestringYesHow OnCharge first met the customer, in plain words.
data[].created_atstring (date-time)Yes
data[].totalsobjectYes
data[].totals.paymentsintegerYesPaid payments.
data[].totals.lifetime_valuearray of objectYesWhat the customer paid, less refunds, per currency.
data[].totals.refundedarray of objectYes
data[].totals.disputesintegerYes
data[].totals.last_payment_atstring (date-time) or nullYes
data[].payment_methodsarray of objectNoOn a single customer: the saved cards that can be charged.
data[].payment_methods[].idstring (uuid)Yes
data[].payment_methods[].object"payment_method"Yes
data[].payment_methods[].type"card"Yes
data[].payment_methods[].brandstringYes
data[].payment_methods[].last4stringYes
data[].payment_methods[].exp_monthinteger (≥ 1, ≤ 12)Yes
data[].payment_methods[].exp_yearintegerYes
data[].payment_methods[].fundingone of credit, debit, prepaid, unknown, or nullNo
data[].payment_methods[].countrystring or nullNo
data[].payment_methods[].walletstring or nullNoApple Pay or Google Pay when the card was saved from one.
data[].payment_methods[].is_defaultbooleanYes
data[].payment_methods[].statusone of active, removedYes
data[].payment_methods[].expiredbooleanYes
data[].payment_methods[].saved_viaone of checkout, save_card_pageYes
data[].payment_methods[].created_atstring (date-time)Yes
data[].payment_methods[].last_used_atstring (date-time) or nullNo
data[].payment_methods[].updated_by_card_network_atstring (date-time) or nullNoWhen the card network last sent new details for this card (a renewed or replaced card).
data[].payment_methods[].removed_atstring (date-time) or nullNo
data[].saved_cardsintegerNoIn lists: how many saved cards the customer has.
next_cursorstring or nullYes
Response
{
  "object": "list",
  "data": [
    {
      "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "object": "customer",
      "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "email": "string",
      "name": "string",
      "phone": "string",
      "reference": "string",
      "metadata": {},
      "source": "string",
      "created_at": "2026-01-01T00:00:00.000Z",
      "totals": {
        "payments": 0,
        "lifetime_value": [
          null
        ],
        "refunded": [
          null
        ],
        "disputes": 0,
        "last_payment_at": "2026-01-01T00:00:00.000Z"
      },
      "payment_methods": [
        {
          "id": null,
          "object": null,
          "type": null,
          "brand": null,
          "last4": null,
          "exp_month": null,
          "exp_year": null,
          "funding": null,
          "country": null,
          "wallet": null,
          "is_default": null,
          "status": null,
          "expired": null,
          "saved_via": null,
          "created_at": null,
          "last_used_at": null,
          "updated_by_card_network_at": null,
          "removed_at": null
        }
      ],
      "saved_cards": 0
    }
  ],
  "next_cursor": "string"
}
StatusMeaning
200A page of customers.
400validation_error (the message lists each invalid field) or invalid_json.

Add a customer#

HTTP
POST /api/v1/customers

Adds a customer to your store. One email, and one reference, is one customer of a store: a second is refused with 409 customer_exists and the existing customer's ID in customer_id.

Request body (application/json)

FieldTypeRequiredDescription
emailstring (email) (max 320 chars)No
namestring (max 200 chars)No
phonestring (max 40 chars)No
referencestring (max 255 chars)No
metadataobjectNo
Request
{
  "email": "ann@example.com",
  "name": "Ann Smith",
  "reference": "crm-1042",
  "metadata": {
    "tier": "gold"
  }
}

Response 201

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"customer"Yes
store_idstring (uuid)Yes
emailstring or nullYes
namestring or nullYes
phonestring or nullYes
referencestring or nullYesYour own ID for this customer.
metadataobjectYes
sourcestringYesHow OnCharge first met the customer, in plain words.
created_atstring (date-time)Yes
totalsobjectYes
totals.paymentsintegerYesPaid payments.
totals.lifetime_valuearray of objectYesWhat the customer paid, less refunds, per currency.
totals.lifetime_value[].currencystring (min 3 chars, max 3 chars)YesISO 4217 currency code.
totals.lifetime_value[].amountintegerYesMinor units.
totals.refundedarray of objectYes
totals.refunded[].currencystring (min 3 chars, max 3 chars)YesISO 4217 currency code.
totals.refunded[].amountintegerYesMinor units.
totals.disputesintegerYes
totals.last_payment_atstring (date-time) or nullYes
payment_methodsarray of objectNoOn a single customer: the saved cards that can be charged.
payment_methods[].idstring (uuid)Yes
payment_methods[].object"payment_method"Yes
payment_methods[].type"card"Yes
payment_methods[].brandstringYes
payment_methods[].last4stringYes
payment_methods[].exp_monthinteger (≥ 1, ≤ 12)Yes
payment_methods[].exp_yearintegerYes
payment_methods[].fundingone of credit, debit, prepaid, unknown, or nullNo
payment_methods[].countrystring or nullNo
payment_methods[].walletstring or nullNoApple Pay or Google Pay when the card was saved from one.
payment_methods[].is_defaultbooleanYes
payment_methods[].statusone of active, removedYes
payment_methods[].expiredbooleanYes
payment_methods[].saved_viaone of checkout, save_card_pageYes
payment_methods[].created_atstring (date-time)Yes
payment_methods[].last_used_atstring (date-time) or nullNo
payment_methods[].updated_by_card_network_atstring (date-time) or nullNoWhen the card network last sent new details for this card (a renewed or replaced card).
payment_methods[].removed_atstring (date-time) or nullNo
saved_cardsintegerNoIn lists: how many saved cards the customer has.
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "customer",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "email": "string",
  "name": "string",
  "phone": "string",
  "reference": "string",
  "metadata": {},
  "source": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "totals": {
    "payments": 0,
    "lifetime_value": [
      {
        "currency": "USD",
        "amount": 0
      }
    ],
    "refunded": [
      {
        "currency": "USD",
        "amount": 0
      }
    ],
    "disputes": 0,
    "last_payment_at": "2026-01-01T00:00:00.000Z"
  },
  "payment_methods": [
    {
      "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "object": "payment_method",
      "type": "card",
      "brand": "Visa",
      "last4": "string",
      "exp_month": 1,
      "exp_year": 0,
      "funding": "credit",
      "country": "string",
      "wallet": "string",
      "is_default": true,
      "status": "active",
      "expired": true,
      "saved_via": "checkout",
      "created_at": "2026-01-01T00:00:00.000Z",
      "last_used_at": "2026-01-01T00:00:00.000Z",
      "updated_by_card_network_at": "2026-01-01T00:00:00.000Z",
      "removed_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "saved_cards": 0
}
StatusMeaning
201Customer added.
400validation_error (the message lists each invalid field) or invalid_json.
409customer_exists: the store already has a customer with that email or reference (customer_id).

Retrieve a customer#

HTTP
GET /api/v1/customers/{customer_id}

One of your store's customers, with totals and saved cards. Another store's customer answers 404.

ParameterInTypeRequiredDescription
customer_idpathstring (uuid)YesAn OnCharge customer ID of your store.

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"customer"Yes
store_idstring (uuid)Yes
emailstring or nullYes
namestring or nullYes
phonestring or nullYes
referencestring or nullYesYour own ID for this customer.
metadataobjectYes
sourcestringYesHow OnCharge first met the customer, in plain words.
created_atstring (date-time)Yes
totalsobjectYes
totals.paymentsintegerYesPaid payments.
totals.lifetime_valuearray of objectYesWhat the customer paid, less refunds, per currency.
totals.lifetime_value[].currencystring (min 3 chars, max 3 chars)YesISO 4217 currency code.
totals.lifetime_value[].amountintegerYesMinor units.
totals.refundedarray of objectYes
totals.refunded[].currencystring (min 3 chars, max 3 chars)YesISO 4217 currency code.
totals.refunded[].amountintegerYesMinor units.
totals.disputesintegerYes
totals.last_payment_atstring (date-time) or nullYes
payment_methodsarray of objectNoOn a single customer: the saved cards that can be charged.
payment_methods[].idstring (uuid)Yes
payment_methods[].object"payment_method"Yes
payment_methods[].type"card"Yes
payment_methods[].brandstringYes
payment_methods[].last4stringYes
payment_methods[].exp_monthinteger (≥ 1, ≤ 12)Yes
payment_methods[].exp_yearintegerYes
payment_methods[].fundingone of credit, debit, prepaid, unknown, or nullNo
payment_methods[].countrystring or nullNo
payment_methods[].walletstring or nullNoApple Pay or Google Pay when the card was saved from one.
payment_methods[].is_defaultbooleanYes
payment_methods[].statusone of active, removedYes
payment_methods[].expiredbooleanYes
payment_methods[].saved_viaone of checkout, save_card_pageYes
payment_methods[].created_atstring (date-time)Yes
payment_methods[].last_used_atstring (date-time) or nullNo
payment_methods[].updated_by_card_network_atstring (date-time) or nullNoWhen the card network last sent new details for this card (a renewed or replaced card).
payment_methods[].removed_atstring (date-time) or nullNo
saved_cardsintegerNoIn lists: how many saved cards the customer has.
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "customer",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "email": "string",
  "name": "string",
  "phone": "string",
  "reference": "string",
  "metadata": {},
  "source": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "totals": {
    "payments": 0,
    "lifetime_value": [
      {
        "currency": "USD",
        "amount": 0
      }
    ],
    "refunded": [
      {
        "currency": "USD",
        "amount": 0
      }
    ],
    "disputes": 0,
    "last_payment_at": "2026-01-01T00:00:00.000Z"
  },
  "payment_methods": [
    {
      "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "object": "payment_method",
      "type": "card",
      "brand": "Visa",
      "last4": "string",
      "exp_month": 1,
      "exp_year": 0,
      "funding": "credit",
      "country": "string",
      "wallet": "string",
      "is_default": true,
      "status": "active",
      "expired": true,
      "saved_via": "checkout",
      "created_at": "2026-01-01T00:00:00.000Z",
      "last_used_at": "2026-01-01T00:00:00.000Z",
      "updated_by_card_network_at": "2026-01-01T00:00:00.000Z",
      "removed_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "saved_cards": 0
}
StatusMeaning
200The customer.
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.

List saved cards#

HTTP
GET /api/v1/customers/{customer_id}/payment-methods
ParameterInTypeRequiredDescription
customer_idpathstring (uuid)YesAn OnCharge customer ID of your store.

Response 200

FieldTypeAlways presentDescription
object"list"Yes
dataarray of objectYes
data[].idstring (uuid)Yes
data[].object"payment_method"Yes
data[].type"card"Yes
data[].brandstringYes
data[].last4stringYes
data[].exp_monthinteger (≥ 1, ≤ 12)Yes
data[].exp_yearintegerYes
data[].fundingone of credit, debit, prepaid, unknown, or nullNo
data[].countrystring or nullNo
data[].walletstring or nullNoApple Pay or Google Pay when the card was saved from one.
data[].is_defaultbooleanYes
data[].statusone of active, removedYes
data[].expiredbooleanYes
data[].saved_viaone of checkout, save_card_pageYes
data[].created_atstring (date-time)Yes
data[].last_used_atstring (date-time) or nullNo
data[].updated_by_card_network_atstring (date-time) or nullNoWhen the card network last sent new details for this card (a renewed or replaced card).
data[].removed_atstring (date-time) or nullNo
Response
{
  "object": "list",
  "data": [
    {
      "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "object": "payment_method",
      "type": "card",
      "brand": "Visa",
      "last4": "string",
      "exp_month": 1,
      "exp_year": 0,
      "funding": "credit",
      "country": "string",
      "wallet": "string",
      "is_default": true,
      "status": "active",
      "expired": true,
      "saved_via": "checkout",
      "created_at": "2026-01-01T00:00:00.000Z",
      "last_used_at": "2026-01-01T00:00:00.000Z",
      "updated_by_card_network_at": "2026-01-01T00:00:00.000Z",
      "removed_at": "2026-01-01T00:00:00.000Z"
    }
  ]
}
StatusMeaning
200The customer's saved cards that can be charged.
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.

Create a save-card page#

HTTP
POST /api/v1/customers/{customer_id}/payment-methods

Creates a page where the customer saves a card without paying. Send them to url: it shows the consent text first and the card form only after they agree; the card is saved for your store only. The same Idempotency-Key returns the same page.

ParameterInTypeRequiredDescription
Idempotency-KeyheaderstringNoA unique key (up to 255 characters is safe) that makes retries of this request safe.
customer_idpathstring (uuid)YesAn OnCharge customer ID of your store.

Request body (application/json)

FieldTypeRequiredDescription
return_urlstring (uri)Nohttps, on one of your store's domains: where the customer returns once the card is saved.
metadataobjectNo
expires_in_hoursinteger (≥ 1, ≤ 72)NoDefault 24.
Request
{
  "return_url": "https://shop.example.com/account"
}

Response 201

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"setup_session"Yes
customer_idstring (uuid)Yes
statusone of open, succeeded, failed, expiredYes
urlstring (uri)YesSend the customer here.
return_urlstring or nullNo
expires_atstring (date-time)Yes
payment_method_idstring (uuid) or nullNoThe card saved, once the customer saved one.
metadataobjectNo
created_atstring (date-time)Yes
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "setup_session",
  "customer_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "status": "open",
  "url": "string",
  "return_url": "string",
  "expires_at": "2026-01-01T00:00:00.000Z",
  "payment_method_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "metadata": {},
  "created_at": "2026-01-01T00:00:00.000Z"
}
StatusMeaning
200The page created earlier with this Idempotency-Key.
201Page created.
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.
409saved_cards_unavailable: card payments are not set up on this store.

Remove a saved card#

HTTP
DELETE /api/v1/customers/{customer_id}/payment-methods/{payment_method_id}

Removes a saved card for good: it is detached at the processor and can never be charged again. Removing a card that is already removed answers the same. If it cannot be removed right now (502 try_again) nothing changed.

ParameterInTypeRequiredDescription
customer_idpathstring (uuid)YesAn OnCharge customer ID of your store.
payment_method_idpathstring (uuid)YesA saved card's ID.

No request body. Sign it as an empty body.

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"payment_method"Yes
deletedtrueYes
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "payment_method",
  "deleted": true
}
StatusMeaning
200Removed.
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.
502try_again: the card could not be removed right now; nothing changed.

Charge a saved card#

HTTP
POST /api/v1/customers/{customer_id}/charges

Charges a customer's saved card while they are away. Use it only for what the customer agreed to when they saved the card. Always send an Idempotency-Key: a retry returns the same charge and never charges twice.

It is a payment like any checkout payment: same fee, same delivery-gated payout (card payments on these stores are USD; an order that ships by carrier needs shipping with order_id), same payment.* webhooks, and it appears under Payments.

When the customer's bank asks them to confirm the payment, the status is requires_authentication and OnCharge emails them a link to confirm it.

ParameterInTypeRequiredDescription
Idempotency-KeyheaderstringNoA unique key (up to 255 characters is safe) that makes retries of this request safe.
customer_idpathstring (uuid)YesAn OnCharge customer ID of your store.

Request body (application/json)

FieldTypeRequiredDescription
amountinteger (≥ 1)YesAmount in the currency's minor unit (cents for USD).
currencystring (min 3 chars, max 3 chars)YesISO 4217 currency code.
payment_method_idstring (uuid)NoA saved card of this customer. The default card when omitted.
referencestring (max 255 chars)No
order_idstring (max 255 chars)No
descriptionstring (max 500 chars)No
shippingobjectNoWhere the order ships. OnCharge matches the carrier's delivery location against postal_code (US, first five digits) or city + state. Send at least postal_code or city.
shipping.namestring (max 200 chars)No
shipping.line1string (max 300 chars)No
shipping.line2string (max 300 chars)No
shipping.citystring (max 120 chars)No
shipping.statestring (max 120 chars)No
shipping.postal_codestring (max 20 chars)No
shipping.countrystring (max 60 chars)NoISO 3166-1 alpha-2 code recommended (US).
line_itemsarray of object (≤ 500 items)No
line_items[].descriptionstringYes
line_items[].quantityinteger (≥ 1)Yes
line_items[].amount_including_taxinteger (≥ 0)YesLine amount in minor units, tax included.
line_items[].requires_shippingbooleanNoWhether this item is shipped. On a store that sells both shipped and unshipped things, an order with any shipped item is paid out after carrier-confirmed delivery; one whose items all say false, 7 days after payment. Without it, the order is decided by whether it has a shipping address.
line_items[].tax_categoryone of general_goods, nontaxable, services, electronic_services, clothing, software_download, saas, books, ebooks, music_download, dietary_supplements, otc_drugs, cosmetics, candy, groceries, prepared_food, pet_food, gift_cardsNoAn OnCharge product tax category.
metadataobjectNo
taxobjectNoSales tax for this payment, when your store has it on (Settings → Sales tax). With enabled, amount is the order as you list it (before tax, unless your store lists prices with tax included); line items (amount_including_tax is then each line's total as listed) and shipping_amount must add up to it. Tax is calculated for the shipping address, or billing_address when nothing ships. See /docs/sales-tax.
tax.enabledbooleanYesCalculate sales tax. Store plugins that already add their platform's tax should leave this off.
tax.shipping_amountinteger (≥ 0)NoThe shipping charge inside amount, minor units: taxed as shipping.
tax.billing_addressobjectNo
tax.billing_address.line1string (max 300 chars)No
tax.billing_address.line2string (max 300 chars)No
tax.billing_address.citystring (max 120 chars)No
tax.billing_address.statestring (max 120 chars)NoTwo-letter US state (or its name).
tax.billing_address.postal_codestring (max 20 chars)YesFive-digit US ZIP code (ZIP+4 accepted).
tax.billing_address.countrystring (max 60 chars)NoUS only for now. Defaults to US.
Request
{
  "amount": 2900,
  "currency": "USD",
  "reference": "subscription-2026-12"
}

Response 201

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"charge"Yes
session_idstring (uuid)YesThe payment, as for a checkout session: refunds, shipments and webhooks use it.
payment_referencestringYes
statusone of succeeded, processing, requires_authentication, declined, failedYessucceeded: paid. processing: the bank has not answered yet; a payment webhook follows. requires_authentication: the customer's bank wants them to confirm it; OnCharge emailed them a link to confirm it (authentication.emailed). declined: see decline.
amountintegerYes
currencystringYes
customer_idstring (uuid)Yes
payment_method_idstring (uuid)Yes
order_idstring or nullNo
created_atstring (date-time)Yes
declineobject or nullYes
decline.reasonone of insufficient_funds, expired_card, incorrect_details, authentication_required, card_not_supported, try_again_later, suspected_fraud, card_declined, limit_exceededYes
decline.messagestringYesWhat happened and what to do, in plain words.
authenticationobject or nullYes
authentication.emailedbooleanYesOnCharge emailed the customer a link to its page where they confirm the payment (valid 7 days). false when the customer has no email: ask them to pay through checkout instead. The link goes to the customer only, so the cardholder confirms it.
shipping_requiredtrueNoThe order ships by carrier and has no address yet: attach it with POST /api/v1/checkout/sessions/{session_id}/order.
idempotenttrueNoA retry with the same Idempotency-Key returned the first charge.
taxobject or nullNoSales tax on a payment; null when it is not taxed.
tax.statusone of awaiting_address, calculated, pending, failed, collected, partly_refunded, refundedYesawaiting_address: no address yet, the payment waits. calculated: not paid yet. pending: tax included, charged while the calculation was unavailable; worked out shortly. failed: the calculation failed (error), the payment waits. collected, partly_refunded, refunded: paid, and how much of the tax was given back.
tax.inclusivebooleanYestrue when the listed prices include the tax.
tax.currencystring or nullYes
tax.subtotalinteger or nullYesBefore tax, minor units.
tax.amountinteger or nullYesThe tax, minor units.
tax.totalinteger or nullYesWhat the customer pays, minor units.
tax.shippingintegerYesThe shipping charge inside the total, minor units.
tax.jurisdictionsarray of objectYes
tax.jurisdictions[].statestring or nullNo
tax.jurisdictions[].ratestringNoCombined percent, e.g. "8.25".
tax.jurisdictions[].amountintegerNo
tax.refundedintegerYesTax given back so far with refunds and lost disputes, minor units.
tax.errorstring or nullYestax_address_invalid or tax_unavailable when status is failed.
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "charge",
  "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "payment_reference": "string",
  "status": "succeeded",
  "amount": 0,
  "currency": "string",
  "customer_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "payment_method_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "order_id": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "decline": {
    "reason": "insufficient_funds",
    "message": "string"
  },
  "authentication": {
    "emailed": true
  },
  "shipping_required": true,
  "idempotent": true,
  "tax": {
    "status": "awaiting_address",
    "inclusive": true,
    "currency": "string",
    "subtotal": 0,
    "amount": 0,
    "total": 0,
    "shipping": 0,
    "jurisdictions": [
      {
        "state": "string",
        "rate": "string",
        "amount": 0
      }
    ],
    "refunded": 0,
    "error": "string"
  }
}
StatusMeaning
200The charge made earlier with this Idempotency-Key (idempotent: true).
201Charge made: succeeded, processing or requires_authentication.
400validation_error (the message lists each invalid field) or invalid_json.
402Declined: decline.reason and decline.message say why in plain words. limit_exceeded: the charge would go over a limit OnCharge set for the store (for example a daily volume cap); nothing was sent to the bank. Charge again with a new Idempotency-Key once the limit allows it.
404not_found: the object does not exist or belongs to another store.
409no_saved_card, payment_method_unusable (the card was removed, also when resuming a charge started with it), charge_not_completed (an interrupted charge more than 20 hours old), idempotency_conflict or saved_cards_unavailable.
502try_again: the outcome is not known yet. Retry with the same Idempotency-Key (within 20 hours); the card is never charged twice. After that the charge answers 409 charge_not_completed: start a new one with a new key.

Risk#

Read risk decisions and manage the store's risk policy.

List risk decisions#

HTTP
GET /api/v1/risk/decisions

Risk decisions made at checkout for the store, newest first.

ParameterInTypeRequiredDescription
fromquerystring (date-time)NoEarliest created_at (ISO 8601).
toquerystring (date-time)NoLatest created_at (ISO 8601).
decisionqueryone of allow, deny, review, step_upNo
limitqueryintegerNo
offsetqueryintegerNo

Response 200

FieldTypeAlways presentDescription
decisionsarray of objectYes
decisions[].idstring (uuid)No
decisions[].session_idstring (uuid)No
decisions[].decisionone of allow, deny, review, step_upNo
decisions[].scoreinteger (≥ 0, ≤ 100)No
decisions[].actionsarray of stringNoStep-up actions, e.g. require_sms_otp, require_terms, require_signature, force_3ds.
decisions[].reasonsarray of objectNo
decisions[].reasons[].codestringNo
decisions[].reasons[].severityone of info, warn, blockNo
decisions[].reasons[].explainstringNo
decisions[].explain_shortstring or nullNo
decisions[].model_versionstringNo
decisions[].created_atstring (date-time)No
totalintegerYes
limitintegerYes
offsetintegerYes
Response
{
  "decisions": [
    {
      "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "decision": "allow",
      "score": 0,
      "actions": [
        "string"
      ],
      "reasons": [
        {
          "code": null,
          "severity": null,
          "explain": null
        }
      ],
      "explain_short": "string",
      "model_version": "string",
      "created_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "total": 0,
  "limit": 0,
  "offset": 0
}
StatusMeaning
200A page of decisions.

Retrieve a risk decision#

HTTP
GET /api/v1/risk/decisions/{decision_id}
ParameterInTypeRequiredDescription
decision_idpathstring (uuid)Yes

Response 200

FieldTypeAlways presentDescription
idstring (uuid)No
session_idstring (uuid)No
decisionone of allow, deny, review, step_upNo
scoreinteger (≥ 0, ≤ 100)No
actionsarray of stringNoStep-up actions, e.g. require_sms_otp, require_terms, require_signature, force_3ds.
reasonsarray of objectNo
reasons[].codestringNo
reasons[].severityone of info, warn, blockNo
reasons[].explainstringNo
explain_shortstring or nullNo
model_versionstringNo
created_atstring (date-time)No
feature_snapshotobjectNo
policy_versionstring or nullNo
labelobject or nullNo
label.paidboolean or nullNo
label.refundedboolean or nullNo
label.chargebackboolean or nullNo
label.dispute_openedboolean or nullNo
label.label_sourcestring or nullNo
label.occurred_atstring (date-time) or nullNo
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "decision": "allow",
  "score": 0,
  "actions": [
    "string"
  ],
  "reasons": [
    {
      "code": "string",
      "severity": "info",
      "explain": "string"
    }
  ],
  "explain_short": "string",
  "model_version": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "feature_snapshot": {},
  "policy_version": "string",
  "label": {
    "paid": true,
    "refunded": true,
    "chargeback": true,
    "dispute_opened": true,
    "label_source": "string",
    "occurred_at": "2026-01-01T00:00:00.000Z"
  }
}
StatusMeaning
200The decision with its feature snapshot and outcome label, if any.
404not_found: the object does not exist or belongs to another store.

Label the outcome of a risk decision#

HTTP
POST /api/v1/risk/feedback

Tells OnCharge how an order turned out, to improve future decisions.

Request body (application/json)

FieldTypeRequiredDescription
session_idstring (uuid)Yes
labelone of fraud_confirmed, false_positive, legitimate, chargebackYes
notesstring (max 1000 chars)No
Request
{
  "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "label": "fraud_confirmed",
  "notes": "string"
}

Response 200

FieldTypeAlways presentDescription
status"ok"Yes
labelstringYes
Response
{
  "status": "ok",
  "label": "string"
}
StatusMeaning
200Recorded.
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.

Get the store's risk policy#

HTTP
GET /api/v1/risk/policies

The store's policy, or the defaults (is_default: true) if none was saved.

Response 200

FieldTypeAlways presentDescription
modeone of monitor, enforceNo
thresholdsobjectNo
thresholds.score_allowinteger (≥ 0, ≤ 100)Yes
thresholds.score_reviewinteger (≥ 0, ≤ 100)Yes
thresholds.score_denyinteger (≥ 0, ≤ 100)Yes
step_up_rulesobjectNo
step_up_rules.require_otp_on_reviewbooleanYes
step_up_rules.require_signaturebooleanYes
step_up_rules.require_termsbooleanYes
step_up_rules.force_3ds_aboveinteger (≥ 0, ≤ 100)Yes
blocksobjectNo
blocks.vpn_torone of allow, step_up, denyYes
blocks.datacenter_asnone of allow, step_up, denyYes
blocks.disposable_emailone of allow, step_up, denyYes
blocks.voip_phoneone of allow, step_up, denyYes
blocks.high_risk_countriesarray of stringYesISO country codes.
blocks.headless_browserone of allow, step_up, denyYes
velocity_limitsobjectNo
velocity_limits.ip_5minteger (≥ 0)Yes
velocity_limits.ip_1hinteger (≥ 0)Yes
velocity_limits.ip_24hinteger (≥ 0)Yes
velocity_limits.email_5minteger (≥ 0)Yes
velocity_limits.email_1hinteger (≥ 0)Yes
velocity_limits.email_24hinteger (≥ 0)Yes
idstring (uuid)No
store_idstring (uuid)Yes
is_defaultbooleanYestrue when no policy has been saved and these are the defaults.
created_atstring (date-time)No
updated_atstring (date-time)No
Response
{
  "mode": "monitor",
  "thresholds": {
    "score_allow": 0,
    "score_review": 0,
    "score_deny": 0
  },
  "step_up_rules": {
    "require_otp_on_review": true,
    "require_signature": true,
    "require_terms": true,
    "force_3ds_above": 0
  },
  "blocks": {
    "vpn_tor": "allow",
    "datacenter_asn": "allow",
    "disposable_email": "allow",
    "voip_phone": "allow",
    "high_risk_countries": [
      "string"
    ],
    "headless_browser": "allow"
  },
  "velocity_limits": {
    "ip_5m": 0,
    "ip_1h": 0,
    "ip_24h": 0,
    "email_5m": 0,
    "email_1h": 0,
    "email_24h": 0
  },
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "is_default": true,
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}
StatusMeaning
200The policy.

Create or update the store's risk policy#

HTTP
PUT /api/v1/risk/policies

Each top-level section you send replaces that section; sections you omit are unchanged. Thresholds must satisfy score_allow < score_review < score_deny. In monitor mode decisions are recorded but never block a payment.

Request body (application/json)

FieldTypeRequiredDescription
modeone of monitor, enforceNo
thresholdsobjectNo
thresholds.score_allowinteger (≥ 0, ≤ 100)Yes
thresholds.score_reviewinteger (≥ 0, ≤ 100)Yes
thresholds.score_denyinteger (≥ 0, ≤ 100)Yes
step_up_rulesobjectNo
step_up_rules.require_otp_on_reviewbooleanYes
step_up_rules.require_signaturebooleanYes
step_up_rules.require_termsbooleanYes
step_up_rules.force_3ds_aboveinteger (≥ 0, ≤ 100)Yes
blocksobjectNo
blocks.vpn_torone of allow, step_up, denyYes
blocks.datacenter_asnone of allow, step_up, denyYes
blocks.disposable_emailone of allow, step_up, denyYes
blocks.voip_phoneone of allow, step_up, denyYes
blocks.high_risk_countriesarray of stringYesISO country codes.
blocks.headless_browserone of allow, step_up, denyYes
velocity_limitsobjectNo
velocity_limits.ip_5minteger (≥ 0)Yes
velocity_limits.ip_1hinteger (≥ 0)Yes
velocity_limits.ip_24hinteger (≥ 0)Yes
velocity_limits.email_5minteger (≥ 0)Yes
velocity_limits.email_1hinteger (≥ 0)Yes
velocity_limits.email_24hinteger (≥ 0)Yes
Request
{
  "mode": "monitor",
  "thresholds": {
    "score_allow": 0,
    "score_review": 0,
    "score_deny": 0
  },
  "step_up_rules": {
    "require_otp_on_review": true,
    "require_signature": true,
    "require_terms": true,
    "force_3ds_above": 0
  },
  "blocks": {
    "vpn_tor": "allow",
    "datacenter_asn": "allow",
    "disposable_email": "allow",
    "voip_phone": "allow",
    "high_risk_countries": [
      "string"
    ],
    "headless_browser": "allow"
  },
  "velocity_limits": {
    "ip_5m": 0,
    "ip_1h": 0,
    "ip_24h": 0,
    "email_5m": 0,
    "email_1h": 0,
    "email_24h": 0
  }
}

Response 201

FieldTypeAlways presentDescription
modeone of monitor, enforceNo
thresholdsobjectNo
thresholds.score_allowinteger (≥ 0, ≤ 100)Yes
thresholds.score_reviewinteger (≥ 0, ≤ 100)Yes
thresholds.score_denyinteger (≥ 0, ≤ 100)Yes
step_up_rulesobjectNo
step_up_rules.require_otp_on_reviewbooleanYes
step_up_rules.require_signaturebooleanYes
step_up_rules.require_termsbooleanYes
step_up_rules.force_3ds_aboveinteger (≥ 0, ≤ 100)Yes
blocksobjectNo
blocks.vpn_torone of allow, step_up, denyYes
blocks.datacenter_asnone of allow, step_up, denyYes
blocks.disposable_emailone of allow, step_up, denyYes
blocks.voip_phoneone of allow, step_up, denyYes
blocks.high_risk_countriesarray of stringYesISO country codes.
blocks.headless_browserone of allow, step_up, denyYes
velocity_limitsobjectNo
velocity_limits.ip_5minteger (≥ 0)Yes
velocity_limits.ip_1hinteger (≥ 0)Yes
velocity_limits.ip_24hinteger (≥ 0)Yes
velocity_limits.email_5minteger (≥ 0)Yes
velocity_limits.email_1hinteger (≥ 0)Yes
velocity_limits.email_24hinteger (≥ 0)Yes
idstring (uuid)No
store_idstring (uuid)No
created_atstring (date-time)No
updated_atstring (date-time)No
Response
{
  "mode": "monitor",
  "thresholds": {
    "score_allow": 0,
    "score_review": 0,
    "score_deny": 0
  },
  "step_up_rules": {
    "require_otp_on_review": true,
    "require_signature": true,
    "require_terms": true,
    "force_3ds_above": 0
  },
  "blocks": {
    "vpn_tor": "allow",
    "datacenter_asn": "allow",
    "disposable_email": "allow",
    "voip_phone": "allow",
    "high_risk_countries": [
      "string"
    ],
    "headless_browser": "allow"
  },
  "velocity_limits": {
    "ip_5m": 0,
    "ip_1h": 0,
    "ip_24h": 0,
    "email_5m": 0,
    "email_1h": 0,
    "email_24h": 0
  },
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}
StatusMeaning
200Policy updated.
201Policy created.
400validation_error, invalid_json or invalid_thresholds.

Replay a decision under a different policy#

HTTP
POST /api/v1/risk/simulate

Shows what a past decision would have been with the policy you send. Nothing is saved.

Request body (application/json)

FieldTypeRequiredDescription
decision_idstring (uuid)Yes
policyobjectYes
policy.modeone of monitor, enforceNo
policy.thresholdsobjectNo
policy.thresholds.score_allowinteger (≥ 0, ≤ 100)Yes
policy.thresholds.score_reviewinteger (≥ 0, ≤ 100)Yes
policy.thresholds.score_denyinteger (≥ 0, ≤ 100)Yes
policy.step_up_rulesobjectNo
policy.step_up_rules.require_otp_on_reviewbooleanYes
policy.step_up_rules.require_signaturebooleanYes
policy.step_up_rules.require_termsbooleanYes
policy.step_up_rules.force_3ds_aboveinteger (≥ 0, ≤ 100)Yes
policy.blocksobjectNo
policy.blocks.vpn_torone of allow, step_up, denyYes
policy.blocks.datacenter_asnone of allow, step_up, denyYes
policy.blocks.disposable_emailone of allow, step_up, denyYes
policy.blocks.voip_phoneone of allow, step_up, denyYes
policy.blocks.high_risk_countriesarray of stringYesISO country codes.
policy.blocks.headless_browserone of allow, step_up, denyYes
policy.velocity_limitsobjectNo
policy.velocity_limits.ip_5minteger (≥ 0)Yes
policy.velocity_limits.ip_1hinteger (≥ 0)Yes
policy.velocity_limits.ip_24hinteger (≥ 0)Yes
policy.velocity_limits.email_5minteger (≥ 0)Yes
policy.velocity_limits.email_1hinteger (≥ 0)Yes
policy.velocity_limits.email_24hinteger (≥ 0)Yes
Request
{
  "decision_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "policy": {
    "mode": "monitor",
    "thresholds": {
      "score_allow": 0,
      "score_review": 0,
      "score_deny": 0
    },
    "step_up_rules": {
      "require_otp_on_review": true,
      "require_signature": true,
      "require_terms": true,
      "force_3ds_above": 0
    },
    "blocks": {
      "vpn_tor": "allow",
      "datacenter_asn": "allow",
      "disposable_email": "allow",
      "voip_phone": "allow",
      "high_risk_countries": [
        "string"
      ],
      "headless_browser": "allow"
    },
    "velocity_limits": {
      "ip_5m": 0,
      "ip_1h": 0,
      "ip_24h": 0,
      "email_5m": 0,
      "email_1h": 0,
      "email_24h": 0
    }
  }
}

Response 200

FieldTypeAlways presentDescription
simulationtrueNo
originalobjectNo
original.decisionone of allow, deny, review, step_upNo
original.scoreintegerNo
original.explain_shortstring or nullNo
simulatedobjectNo
simulated.decisionone of allow, deny, review, step_upNo
simulated.scoreintegerNo
simulated.actionsarray of stringNo
simulated.reasonsarray of objectNo
simulated.reasons[].codestringNo
simulated.reasons[].severityone of info, warn, blockNo
simulated.reasons[].explainstringNo
simulated.explain_shortstring or nullNo
policy_testedobjectNo
policy_tested.modeone of monitor, enforceNo
policy_tested.thresholdsobjectNo
policy_tested.thresholds.score_allowinteger (≥ 0, ≤ 100)Yes
policy_tested.thresholds.score_reviewinteger (≥ 0, ≤ 100)Yes
policy_tested.thresholds.score_denyinteger (≥ 0, ≤ 100)Yes
policy_tested.step_up_rulesobjectNo
policy_tested.step_up_rules.require_otp_on_reviewbooleanYes
policy_tested.step_up_rules.require_signaturebooleanYes
policy_tested.step_up_rules.require_termsbooleanYes
policy_tested.step_up_rules.force_3ds_aboveinteger (≥ 0, ≤ 100)Yes
policy_tested.blocksobjectNo
policy_tested.blocks.vpn_torone of allow, step_up, denyYes
policy_tested.blocks.datacenter_asnone of allow, step_up, denyYes
policy_tested.blocks.disposable_emailone of allow, step_up, denyYes
policy_tested.blocks.voip_phoneone of allow, step_up, denyYes
policy_tested.blocks.high_risk_countriesarray of stringYesISO country codes.
policy_tested.blocks.headless_browserone of allow, step_up, denyYes
policy_tested.velocity_limitsobjectNo
policy_tested.velocity_limits.ip_5minteger (≥ 0)Yes
policy_tested.velocity_limits.ip_1hinteger (≥ 0)Yes
policy_tested.velocity_limits.ip_24hinteger (≥ 0)Yes
policy_tested.velocity_limits.email_5minteger (≥ 0)Yes
policy_tested.velocity_limits.email_1hinteger (≥ 0)Yes
policy_tested.velocity_limits.email_24hinteger (≥ 0)Yes
Response
{
  "simulation": true,
  "original": {
    "decision": "allow",
    "score": 0,
    "explain_short": "string"
  },
  "simulated": {
    "decision": "allow",
    "score": 0,
    "actions": [
      "string"
    ],
    "reasons": [
      {
        "code": "string",
        "severity": "info",
        "explain": "string"
      }
    ],
    "explain_short": "string"
  },
  "policy_tested": {
    "mode": "monitor",
    "thresholds": {
      "score_allow": 0,
      "score_review": 0,
      "score_deny": 0
    },
    "step_up_rules": {
      "require_otp_on_review": true,
      "require_signature": true,
      "require_terms": true,
      "force_3ds_above": 0
    },
    "blocks": {
      "vpn_tor": "allow",
      "datacenter_asn": "allow",
      "disposable_email": "allow",
      "voip_phone": "allow",
      "high_risk_countries": [
        "string"
      ],
      "headless_browser": "allow"
    },
    "velocity_limits": {
      "ip_5m": 0,
      "ip_1h": 0,
      "ip_24h": 0,
      "email_5m": 0,
      "email_1h": 0,
      "email_24h": 0
    }
  }
}
StatusMeaning
200The original and simulated outcomes.
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.

Recurring#

Merchant-initiated charges on a saved card.

Charge a saved card#

HTTP
POST /api/v1/recurring/charge

A merchant-initiated charge on a card the shopper saved during an earlier OnCharge checkout (subscriptions, installments). Availability depends on your account configuration; ask OnCharge support before relying on it. Uses the shopper's most recent saved card unless stored_card_id is given.

On a store with its own card account the shopper is your customer with that email and stored_card_id one of their saved cards: it charges through POST /api/v1/customers/{customer_id}/charges, which new integrations should use instead.

Request body (application/json)

FieldTypeRequiredDescription
shopper_emailstring (email)Yes
amountinteger (≥ 1)YesAmount in the currency's minor unit (cents for USD).
currencystring (min 3 chars, max 3 chars)YesISO 4217 currency code.
referencestring (min 1 chars, max 255 chars)Yes
recurring_modelone of Subscription, UnscheduledCardOnFileNoDefault "Subscription".
stored_card_idstring (uuid)No
Request
{
  "shopper_email": "string",
  "amount": 4900,
  "currency": "USD",
  "reference": "string",
  "recurring_model": "Subscription",
  "stored_card_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11"
}

Response 201

FieldTypeAlways presentDescription
session_idstring (uuid)Yes
statusone of authorized, refused, pendingYes
result_codestringNoRaw authorization result. Use status instead.
psp_referencestringNoOpaque payment reference.
Response
{
  "session_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "status": "authorized",
  "result_code": "string",
  "psp_reference": "string"
}
StatusMeaning
201Charge attempted. Check status.
400validation_error (the message lists each invalid field) or invalid_json.
404no_shopper, card_not_found or no_cards.
502provider_error or provider_unavailable: the payment network did not accept the request. Retry later.

Catalog#

Send your products to OnCharge for shopping ads on Google Merchant Center and the Meta catalog. The whole catalog is sent and each ad platform reviews it against its own policies; only products that name a controlled substance, and products you exclude, are stored but not sent.

Add, update and remove catalog products#

HTTP
POST /api/v1/catalog/products/batch

Sends up to 500 products and deletes to the store's advertising catalog, which OnCharge sends to Google Merchant Center and the Meta catalog. Products are matched by id; sending a product again updates it, and an identical product is not rewritten (unchanged). Deletes remove the product from ad platforms.

OnCharge sends the whole catalog to the ad platforms, which review each product against their own policies. ruo: true is a label only. Products that name a controlled substance, and products with no image, no price, an http link or excluded: true, are stored but not sent. Each result says whether the product is advertisable and why not. The WooCommerce plugin (1.5.0+) calls this for you.

Request body (application/json)

FieldTypeRequiredDescription
itemsarray of object (≤ 500 items)NoProducts to add or update.
items[].idstring (min 1 chars, max 50 chars)YesYour product ID (WooCommerce: the product or variation ID). Unique per store.
items[].item_group_idstring or null (max 50 chars)NoGroups the variants of one product (WooCommerce: the parent product ID).
items[].titlestring (min 1 chars, max 1000 chars)YesProduct name. Stored cut to 150 characters.
items[].descriptionstring or null (max 20000 chars)NoPlain text or HTML (tags and shortcodes are removed). Stored cut to 5,000 characters.
items[].linkstring (uri) (max 2048 chars)YesProduct page. Must be https; a product with an http link is rejected (or, if already stored, excluded).
items[].image_linkstring (uri) or null (max 2048 chars)NoMain image. Products without one are stored but not advertised.
items[].additional_image_linksarray of string (uri) (≤ 20 items)NoMore images; at most 10 are kept.
items[].price_minorinteger (≥ 0)YesRegular price in minor units, as shown in your store.
items[].sale_price_minorinteger or null (≥ 0)NoCurrent sale price in minor units. Ignored unless lower than price_minor.
items[].currencystring (min 3 chars, max 3 chars)YesISO 4217 currency code.
items[].availabilityone of in_stock, out_of_stock, preorder, backorderNoDefault "in_stock".
items[].conditionone of new, refurbished, usedNoDefault "new".
items[].brandstring or null (max 200 chars)No
items[].gtinstring or null (max 50 chars)NoUPC, EAN, ISBN or ITF-14. Kept only when it is 8–14 digits.
items[].mpnstring or null (max 100 chars)No
items[].google_product_categorystring or null (max 500 chars)NoGoogle's product category ID or path, if you know it.
items[].product_typestring or null (max 750 chars)NoYour own category path, e.g. Apparel > Shirts.
items[].attributesobjectNoVariant attributes such as {"Color": "Blue", "Size": "M"}. At most 30.
items[].ruobooleanNotrue for research-use-only (RUO) products. A label only: the product is sent to the ad platforms like any other, and each platform reviews it against its own policies.
items[].excludedbooleanNotrue to keep the product out of advertising.
deletesarray of string (≤ 500 items)NoIDs of products to remove.
Request
{
  "items": [
    {
      "id": "205",
      "item_group_id": "200",
      "title": "Linen shirt - Blue, M",
      "description": "Soft linen shirt.",
      "link": "https://shop.example.com/product/linen-shirt/?attribute_pa_color=blue&attribute_pa_size=m",
      "image_link": "https://shop.example.com/wp-content/uploads/linen-shirt-blue.jpg",
      "price_minor": 4900,
      "sale_price_minor": 3900,
      "currency": "USD",
      "availability": "in_stock",
      "brand": "Acme",
      "gtin": "0012345678905",
      "product_type": "Apparel > Shirts",
      "attributes": {
        "Color": "Blue",
        "Size": "M"
      }
    }
  ],
  "deletes": [
    "198"
  ]
}

Response 200

FieldTypeAlways presentDescription
resultsarray of objectYesOne per product, then one per delete, in request order.
results[].idstringYes
results[].statusone of created, updated, unchanged, deleted, not_found, rejectedYesunchanged: identical to what OnCharge already has (nothing written). not_found: a delete for an ID OnCharge never had.
results[].advertisablebooleanNoFor stored products: may be sent to ad platforms.
results[].ruobooleanNo
results[].excluded_reasonone of merchant_excluded, controlled_substance, insecure_link, missing_image, zero_price, or nullNoWhy the product is not advertised, or null. merchant_excluded: you sent excluded: true. controlled_substance: the product names a controlled substance (U.S. DEA schedules I to V), which is never sent to an ad platform. insecure_link: the link is not https. missing_image: no image_link. zero_price: price_minor is 0.
results[].warningsarray of one of title_truncated, gtin_invalid, sale_price_ignored, additional_images_truncated, link_not_storedNo
results[].errorstringNoFor rejected: the error code, e.g. insecure_link.
results[].messagestringNo
countsobjectYes
counts.createdintegerYes
counts.updatedintegerYes
counts.unchangedintegerYes
counts.deletedintegerYes
counts.not_foundintegerYes
counts.rejectedintegerYes
Response
{
  "results": [
    {
      "id": "205",
      "status": "created",
      "advertisable": true,
      "ruo": false,
      "excluded_reason": null
    },
    {
      "id": "198",
      "status": "deleted"
    }
  ],
  "counts": {
    "created": 1,
    "updated": 0,
    "unchanged": 0,
    "deleted": 1,
    "not_found": 0,
    "rejected": 0
  }
}
StatusMeaning
200Per-product results and counts.
400validation_error (the message lists each invalid field) or invalid_json.
413payload_too_large: more than 5 MB. Send smaller batches.

List catalog products#

HTTP
GET /api/v1/catalog/products

The store's catalog, oldest first. Use it to find products you no longer sell and remove them. Sign an empty body.

ParameterInTypeRequiredDescription
limitqueryintegerNo
offsetqueryintegerNo
include_deletedquerybooleanNoAlso list removed products.
updated_sincequerystring (date-time)NoOnly products changed at or after this time (ISO 8601).

Response 200

FieldTypeAlways presentDescription
productsarray of objectYes
products[].idstringYes
products[].item_group_idstring or nullNo
products[].titlestringYes
products[].linkstring (uri)Yes
products[].image_linkstring (uri) or nullNo
products[].price_minorintegerYes
products[].sale_price_minorinteger or nullNo
products[].currencystring (min 3 chars, max 3 chars)YesISO 4217 currency code.
products[].availabilityone of in_stock, out_of_stock, preorder, backorderYes
products[].ruobooleanYes
products[].excluded_reasonone of merchant_excluded, controlled_substance, insecure_link, missing_image, zero_price, or nullYesWhy the product is not advertised, or null. merchant_excluded: you sent excluded: true. controlled_substance: the product names a controlled substance (U.S. DEA schedules I to V), which is never sent to an ad platform. insecure_link: the link is not https. missing_image: no image_link. zero_price: price_minor is 0.
products[].advertisablebooleanYesNot removed and not excluded.
products[].deletedbooleanYesRemoved (only listed with include_deleted=true).
products[].content_hashstringYesChanges whenever anything OnCharge stores for the product changes.
products[].updated_atstring (date-time)Yes
totalintegerYes
limitintegerYes
offsetintegerYes
Response
{
  "products": [
    {
      "id": "string",
      "item_group_id": "string",
      "title": "string",
      "link": "string",
      "image_link": "string",
      "price_minor": 0,
      "sale_price_minor": 0,
      "currency": "USD",
      "availability": "in_stock",
      "ruo": true,
      "excluded_reason": "merchant_excluded",
      "advertisable": true,
      "deleted": true,
      "content_hash": "string",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "total": 0,
  "limit": 0,
  "offset": 0
}
StatusMeaning
200A page of products.
400validation_error (the message lists each invalid field) or invalid_json.

Events#

Every webhook event of the last 30 days, and sending one to an endpoint again.

List events#

HTTP
GET /api/v1/events

The store's events from the last 30 days, newest first, each exactly as its webhook endpoints received it (data.rail included). Use it to catch up on events your server missed. Paged by cursor.

ParameterInTypeRequiredDescription
typequerystringNoAn event type (payment.captured) or a group (payout.*).
fromquerystring (date)NoCreated on or after this day (UTC).
toquerystring (date)NoCreated on or before this day (UTC).
limitqueryintegerNo
cursorquerystringNonext_cursor of the previous page, sent with the same filters.

Response 200

FieldTypeAlways presentDescription
eventsarray of objectYes
events[].idstringYesEvent ID (evt_…), the same as the OnCharge-Event-Id header.
events[].typeone of payment.pending, payment.authorized, payment.captured, payment.under_review, payment.refused, payment.cancelled, payment.expired, payment.capture_failed, refund.succeeded, refund.failed, chargeback.opened, dispute.evidence_due, chargeback.won, chargeback.lost, fraud_warning.received, delivery.confirmed, payout.paid, payout.failed, payout.returned, account.updated, account.requirements_due, account.restricted, swap.created, swap.completed, swap.failed, swap.refunded, swap.expired, subscription.created, subscription.updated, subscription.trial_will_end, subscription.past_due, subscription.paused, subscription.resumed, subscription.canceled, subscription.period.paid, subscription.period.payment_failed, support.conversation.created, support.message.received, support.conversation.closedYesEvery event type. Payments on every rail use the same payment.* types (data.rail says which). Handle the types you need and acknowledge (2xx) any others; new types may be added.
events[].createdintegerYesUnix time (seconds) the event was created.
events[].livemodebooleanYesfalse for events from test payments.
events[].dataobjectYesFor payment events from a checkout, the fields below. Crypto and Card to Crypto paid to your wallet carry session_id: null with payment_id, source, method, coin, coin_amount, wallet and transaction hashes; every other event its own fields. All of them carry rail.
events[].data.session_idstring or nullNoThe checkout session; null for a payment paid straight to your wallet.
events[].data.order_idstring or nullNoYour order ID, if known.
events[].data.referencestring or nullNoThe reference you sent when creating the session.
events[].data.amountinteger or nullNoMinor units. For refund.succeeded, the total refunded so far.
events[].data.currencystring or nullNoISO 4217 code.
events[].data.statusstring or nullNoThe order's payment status after the event (for example captured, refunded).
events[].data.railone of card, crypto, card_to_cryptoYesThe rail an event or payment is on: card checkout; crypto (crypto checkout, or a coin paid straight to your wallet through the plugin or the gateway API); or Card to Crypto (card, Cash App or Venmo paid out to your wallet in USDC).
events[].data.payment_referencestring or nullNoOnCharge's reference for the payment (ocpay_…).
events[].data.payment_link_idstring (uuid) or nullNoThe payment link the checkout was made from (/api/v1/payment-links), or null.
events[].data.invoice_idstring (uuid)NoOnly on a payment for an OnCharge invoice: the invoice's id (see Invoices).
events[].data.payment_methodone of card, bank_debit, cash_app_pay, klarna, affirm, afterpay, or nullNoHow the shopper paid: card, or a way to pay beyond cards the store turned on (bank debit, Cash App Pay, Klarna, Affirm, Afterpay; see the Payment methods guide). Null for crypto.
events[].data.taxobject or nullNoSales tax on the payment, on payment, refund and chargeback events of a taxed payment only.
events[].data.reasonone of limit_exceededNoOnly on payment.refused when OnCharge refused the payment itself: limit_exceeded (the store reached a limit OnCharge set on its account, such as a daily volume cap). Absent when the bank declined it.
events[].eventone of payment.pending, payment.authorized, payment.captured, payment.under_review, payment.refused, payment.cancelled, payment.expired, payment.capture_failed, refund.succeeded, refund.failed, chargeback.opened, dispute.evidence_due, chargeback.won, chargeback.lost, fraud_warning.received, delivery.confirmed, payout.paid, payout.failed, payout.returned, account.updated, account.requirements_due, account.restricted, swap.created, swap.completed, swap.failed, swap.refunded, swap.expired, subscription.created, subscription.updated, subscription.trial_will_end, subscription.past_due, subscription.paused, subscription.resumed, subscription.canceled, subscription.period.paid, subscription.period.payment_failed, support.conversation.created, support.message.received, support.conversation.closedNoSame as type. Kept for older plugins; only on payment events from a checkout. Deprecated.
events[].statusstring or nullNoSame as data.status. Kept for older plugins; only on payment events from a checkout. Deprecated.
events[].psp_referencestring or nullNoKept for older plugins, which store it as the order's transaction id: a payment made before 2026-12-01 keeps its original value here; from 2026-12-01 on it is the payment's OnCharge reference (ocpay_…, the same as data.payment_reference). Only on payment events from a checkout. Deprecated.
next_cursorstring or nullYesPass as cursor for the next page; null on the last page.
Response
{
  "events": [
    {
      "id": "string",
      "type": "payment.pending",
      "created": 0,
      "livemode": true,
      "data": {
        "session_id": "string",
        "order_id": "string",
        "reference": "string",
        "amount": 0,
        "currency": "string",
        "status": "string",
        "rail": "card",
        "payment_reference": "string",
        "payment_link_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
        "invoice_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
        "payment_method": "card",
        "tax": {
          "status": null,
          "inclusive": null,
          "currency": null,
          "subtotal": null,
          "amount": null,
          "total": null,
          "shipping": null,
          "jurisdictions": null,
          "refunded": null,
          "error": null
        },
        "reason": "limit_exceeded"
      },
      "event": "payment.pending",
      "status": "string",
      "psp_reference": "string"
    }
  ],
  "next_cursor": "string"
}
StatusMeaning
200Events.
400validation_error (the message lists each invalid field) or invalid_json.

Retrieve an event#

HTTP
GET /api/v1/events/{event_id}

One event from the last 30 days, exactly as your endpoints received it. An older event or another store's answers 404.

ParameterInTypeRequiredDescription
event_idpathstringYesAn event id (evt_…).

Response 200

FieldTypeAlways presentDescription
idstringYesEvent ID (evt_…), the same as the OnCharge-Event-Id header.
typeone of payment.pending, payment.authorized, payment.captured, payment.under_review, payment.refused, payment.cancelled, payment.expired, payment.capture_failed, refund.succeeded, refund.failed, chargeback.opened, dispute.evidence_due, chargeback.won, chargeback.lost, fraud_warning.received, delivery.confirmed, payout.paid, payout.failed, payout.returned, account.updated, account.requirements_due, account.restricted, swap.created, swap.completed, swap.failed, swap.refunded, swap.expired, subscription.created, subscription.updated, subscription.trial_will_end, subscription.past_due, subscription.paused, subscription.resumed, subscription.canceled, subscription.period.paid, subscription.period.payment_failed, support.conversation.created, support.message.received, support.conversation.closedYesEvery event type. Payments on every rail use the same payment.* types (data.rail says which). Handle the types you need and acknowledge (2xx) any others; new types may be added.
createdintegerYesUnix time (seconds) the event was created.
livemodebooleanYesfalse for events from test payments.
dataobjectYesFor payment events from a checkout, the fields below. Crypto and Card to Crypto paid to your wallet carry session_id: null with payment_id, source, method, coin, coin_amount, wallet and transaction hashes; every other event its own fields. All of them carry rail.
data.session_idstring or nullNoThe checkout session; null for a payment paid straight to your wallet.
data.order_idstring or nullNoYour order ID, if known.
data.referencestring or nullNoThe reference you sent when creating the session.
data.amountinteger or nullNoMinor units. For refund.succeeded, the total refunded so far.
data.currencystring or nullNoISO 4217 code.
data.statusstring or nullNoThe order's payment status after the event (for example captured, refunded).
data.railone of card, crypto, card_to_cryptoYesThe rail an event or payment is on: card checkout; crypto (crypto checkout, or a coin paid straight to your wallet through the plugin or the gateway API); or Card to Crypto (card, Cash App or Venmo paid out to your wallet in USDC).
data.payment_referencestring or nullNoOnCharge's reference for the payment (ocpay_…).
data.payment_link_idstring (uuid) or nullNoThe payment link the checkout was made from (/api/v1/payment-links), or null.
data.invoice_idstring (uuid)NoOnly on a payment for an OnCharge invoice: the invoice's id (see Invoices).
data.payment_methodone of card, bank_debit, cash_app_pay, klarna, affirm, afterpay, or nullNoHow the shopper paid: card, or a way to pay beyond cards the store turned on (bank debit, Cash App Pay, Klarna, Affirm, Afterpay; see the Payment methods guide). Null for crypto.
data.taxobject or nullNoSales tax on the payment, on payment, refund and chargeback events of a taxed payment only.
data.tax.statusone of awaiting_address, calculated, pending, failed, collected, partly_refunded, refundedYesawaiting_address: no address yet, the payment waits. calculated: not paid yet. pending: tax included, charged while the calculation was unavailable; worked out shortly. failed: the calculation failed (error), the payment waits. collected, partly_refunded, refunded: paid, and how much of the tax was given back.
data.tax.inclusivebooleanYestrue when the listed prices include the tax.
data.tax.currencystring or nullYes
data.tax.subtotalinteger or nullYesBefore tax, minor units.
data.tax.amountinteger or nullYesThe tax, minor units.
data.tax.totalinteger or nullYesWhat the customer pays, minor units.
data.tax.shippingintegerYesThe shipping charge inside the total, minor units.
data.tax.jurisdictionsarray of objectYes
data.tax.refundedintegerYesTax given back so far with refunds and lost disputes, minor units.
data.tax.errorstring or nullYestax_address_invalid or tax_unavailable when status is failed.
data.reasonone of limit_exceededNoOnly on payment.refused when OnCharge refused the payment itself: limit_exceeded (the store reached a limit OnCharge set on its account, such as a daily volume cap). Absent when the bank declined it.
eventone of payment.pending, payment.authorized, payment.captured, payment.under_review, payment.refused, payment.cancelled, payment.expired, payment.capture_failed, refund.succeeded, refund.failed, chargeback.opened, dispute.evidence_due, chargeback.won, chargeback.lost, fraud_warning.received, delivery.confirmed, payout.paid, payout.failed, payout.returned, account.updated, account.requirements_due, account.restricted, swap.created, swap.completed, swap.failed, swap.refunded, swap.expired, subscription.created, subscription.updated, subscription.trial_will_end, subscription.past_due, subscription.paused, subscription.resumed, subscription.canceled, subscription.period.paid, subscription.period.payment_failed, support.conversation.created, support.message.received, support.conversation.closedNoSame as type. Kept for older plugins; only on payment events from a checkout. Deprecated.
statusstring or nullNoSame as data.status. Kept for older plugins; only on payment events from a checkout. Deprecated.
psp_referencestring or nullNoKept for older plugins, which store it as the order's transaction id: a payment made before 2026-12-01 keeps its original value here; from 2026-12-01 on it is the payment's OnCharge reference (ocpay_…, the same as data.payment_reference). Only on payment events from a checkout. Deprecated.
Response
{
  "id": "string",
  "type": "payment.pending",
  "created": 0,
  "livemode": true,
  "data": {
    "session_id": "string",
    "order_id": "string",
    "reference": "string",
    "amount": 0,
    "currency": "string",
    "status": "string",
    "rail": "card",
    "payment_reference": "string",
    "payment_link_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
    "invoice_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
    "payment_method": "card",
    "tax": {
      "status": "awaiting_address",
      "inclusive": true,
      "currency": "string",
      "subtotal": 0,
      "amount": 0,
      "total": 0,
      "shipping": 0,
      "jurisdictions": [
        {
          "state": null,
          "rate": null,
          "amount": null
        }
      ],
      "refunded": 0,
      "error": "string"
    },
    "reason": "limit_exceeded"
  },
  "event": "payment.pending",
  "status": "string",
  "psp_reference": "string"
}
StatusMeaning
200The event.
404not_found: the object does not exist or belongs to another store.

Send an event to an endpoint again#

HTTP
POST /api/v1/events/{event_id}/replay

Sends an event from the last 30 days to one of your webhook endpoints again, with the same id and body, signed with that endpoint's secret. It goes even to an endpoint that has not chosen the event's type; a disabled endpoint answers 409. The delivery is retried like any other.

ParameterInTypeRequiredDescription
event_idpathstringYesAn event id (evt_…).

Request body (application/json)

FieldTypeRequiredDescription
endpoint_idstring (uuid)YesOne of your webhook endpoints (the Webhooks page shows their ids).
Request
{
  "endpoint_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11"
}

Response 200

FieldTypeAlways presentDescription
event_idstringYes
delivery_idstring (uuid)Yes
statusone of pendingYes
Response
{
  "event_id": "string",
  "delivery_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "status": "pending"
}
StatusMeaning
200Queued.
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.
409The endpoint is disabled.

Payments and balance#

Payments on every rail, payouts to your bank and your balance, as the portal shows them.

List payments#

HTTP
GET /api/v1/payments

The store's payments on every rail, newest first, from the activity ledger the portal reads: card checkout, crypto checkout, and crypto and Card to Crypto paid straight to your wallet through the plugin and the gateway API. kind lists refunds, disputes or crypto conversions instead, or all of them.

ParameterInTypeRequiredDescription
kindqueryone of payment, refund, dispute, swap, allNopayment (default), refund, dispute, swap or all.
railqueryone of card, crypto, card_to_cryptoNo
statusqueryone of paid, pending, refunded, failed, disputed, review, waiting, uncapturedNo
sourcequeryone of wallet, plugin, gatewayNoPaid straight to your wallet (plugin or gateway API), or one of them.
qquerystringNoAn OnCharge reference or id, a transaction hash, an email or an order number.
fromquerystring (date)No
toquerystring (date)No
minquerystringNoSmallest amount, in major units.
maxquerystringNoLargest amount, in major units.
methodqueryone of card, crypto, cashapp, venmo, bankNo
signalsquerystringNoComma-separated: review, fraud_warning, disputed (every one listed must hold).
limitqueryintegerNo
cursorquerystringNonext_cursor of the previous page, sent with the same filters.

Response 200

FieldTypeAlways presentDescription
paymentsarray of objectYes
payments[].idstring (uuid)YesOnCharge's id of the payment, refund, dispute or conversion.
payments[].referencestringYesOnCharge's reference: ocpay_…, ocrfd_…, ocdsp_…, ocswp_….
payments[].kindone of payment, refund, dispute, swapYes
payments[].railone of card, crypto, card_to_cryptoYesThe rail an event or payment is on: card checkout; crypto (crypto checkout, or a coin paid straight to your wallet through the plugin or the gateway API); or Card to Crypto (card, Cash App or Venmo paid out to your wallet in USDC).
payments[].statusstringYespaid, pending, authorized, review, refunded, partly_refunded, declined, failed, cancelled, expired, disputed, won, lost, completed…
payments[].status_labelstringNo
payments[].amountinteger or nullNoNull when only coin amounts are known.
payments[].currencystring or nullNo
payments[].amount_textstring or nullNoThe coin amount as text when the amount in money is not known.
payments[].feeinteger or nullNo
payments[].netinteger or nullNo
payments[].coinstring or nullNo
payments[].coin_amountstring or nullNo
payments[].coin_feestring or nullNo
payments[].coin_netstring or nullNo
payments[].order_idstring or nullNo
payments[].methodstring or nullNoVisa •••• 4242, Cash App, USDT (TRC20)…
payments[].customer_emailstring or nullNo
payments[].created_atstring (date-time)Yes
payments[].payment_referencestring or nullNoThe payment a refund or dispute belongs to.
payments[].payout_referencestring or nullNo
payments[].payment_txstring or nullNoThe paying transaction on a public chain.
payments[].payout_txstring or nullNoThe transaction that paid your wallet.
payments[].refundableintegerNoMinor units that can still be refunded (0 when this entry cannot be).
payments[].signalsarray of one of review, fraud_warning, disputedNo
payments[].taxinteger or nullNoSales tax inside amount, minor units, signed like it (a refund's share given back is negative); null when untaxed.
next_cursorstring or nullYesPass as cursor for the next page; null on the last page.
Response
{
  "payments": [
    {
      "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "reference": "string",
      "kind": "payment",
      "rail": "card",
      "status": "string",
      "status_label": "string",
      "amount": 0,
      "currency": "string",
      "amount_text": "string",
      "fee": 0,
      "net": 0,
      "coin": "string",
      "coin_amount": "string",
      "coin_fee": "string",
      "coin_net": "string",
      "order_id": "string",
      "method": "string",
      "customer_email": "string",
      "created_at": "2026-01-01T00:00:00.000Z",
      "payment_reference": "string",
      "payout_reference": "string",
      "payment_tx": "string",
      "payout_tx": "string",
      "refundable": 0,
      "signals": [
        "review"
      ],
      "tax": 0
    }
  ],
  "next_cursor": "string"
}
StatusMeaning
200Payments.
400validation_error (the message lists each invalid field) or invalid_json.

List payouts#

HTTP
GET /api/v1/payouts

The store's payouts to its bank, newest first: on their way, paid, not delivered, returned or canceled, and bank debits. Payouts pay orders whose delivery was confirmed; crypto paid to your own wallet is never in a payout.

ParameterInTypeRequiredDescription
statusqueryone of paid, on_its_way, failed, returned, canceledNo
fromquerystring (date)No
toquerystring (date)No
minquerystringNo
maxquerystringNo
qquerystringNoAn order number, payment id or payout id.
limitqueryintegerNo
cursorquerystringNonext_cursor of the previous page, sent with the same filters.

Response 200

FieldTypeAlways presentDescription
payoutsarray of objectYes
payouts[].idstring (uuid)YesThe payout id the payout.paid, payout.failed and payout.returned events carry.
payouts[].typeone of payout, bank_debitYes
payouts[].statusone of paid, on_its_way, failed, returned, canceledYes
payouts[].status_labelstringNo
payouts[].amountintegerYesMinor units; negative for a bank debit.
payouts[].currencystringYes
payouts[].created_atstring (date-time)Yes
payouts[].arrival_datestring or nullNo
payouts[].ordersinteger or nullNoOrders it paid, once its statement exists.
payouts[].itemsintegerNo
payouts[].problemstring or nullNoWhy it did not reach your bank (or, a debit card payout, your card), in plain words.
payouts[].methodone of standard, instantNoinstant: a debit card payout you asked for; amount is what reached the card.
payouts[].feeintegerNoOnCharge's fee taken out of a debit card payout, in minor units (0 for a standard payout, and for one that did not arrive).
next_cursorstring or nullYesPass as cursor for the next page; null on the last page.
Response
{
  "payouts": [
    {
      "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "type": "payout",
      "status": "paid",
      "status_label": "string",
      "amount": 0,
      "currency": "string",
      "created_at": "2026-01-01T00:00:00.000Z",
      "arrival_date": "string",
      "orders": 0,
      "items": 0,
      "problem": "string",
      "method": "standard",
      "fee": 0
    }
  ],
  "next_cursor": "string"
}
StatusMeaning
200Payouts.
400validation_error (the message lists each invalid field) or invalid_json.

Card totals for a period#

HTTP
GET /api/v1/payouts/summary

Gross volume, refunds, OnCharge's fees and what you keep, per currency, for a period (default the last 30 days, at most a year).

ParameterInTypeRequiredDescription
fromquerystring (date)NoFirst day (UTC).
toquerystring (date)NoLast day (UTC).

Response 200

FieldTypeAlways presentDescription
periodobjectYes
period.fromstring (date)No
period.tostring (date)No
totalsarray of objectYes
pricingobject or nullNo
feesarray of objectNo
Response
{
  "period": {
    "from": "string",
    "to": "string"
  },
  "totals": [
    {}
  ],
  "pricing": {},
  "fees": [
    {}
  ]
}
StatusMeaning
200Totals.
400validation_error (the message lists each invalid field) or invalid_json.

Quote a debit card payout#

HTTP
GET /api/v1/payouts/instant

Whether the store can take a debit card payout now: what would reach the card, OnCharge's fee (1.5%, at least 0.50, taken out of the payout), what would leave the balance and when it should arrive; or why it cannot. Only money already released for delivered orders, and only what the next standard payout would pay, is ever payable. Claims nothing. The debit card is added in the dashboard (it needs a one-time code). 404 not_available where debit card payouts are not switched on.

Response 200

FieldTypeAlways presentDescription
instant_payoutobjectYesWhat could reach your debit card now (money already released for delivered orders only), or why nothing can.
instant_payout.store_idstring (uuid)Yes
instant_payout.availablebooleanYes
instant_payout.blockobject or nullYes
instant_payout.amountintegerYesWhat would reach the card, in minor units.
instant_payout.feeintegerYesOnCharge's fee, in minor units: 1.5% of the total, at least 0.50.
instant_payout.totalintegerYesWhat would leave your balance: amount + fee.
instant_payout.currencyone of USDYes
instant_payout.arrivalobjectYes
instant_payout.arrival.textstringNo
instant_payout.arrival.minutesintegerNo
instant_payout.arrival.estimatestring (date-time) or nullNo
instant_payout.cardobject or nullYesThe debit card on file, masked. Added in the dashboard only.
instant_payout.card.brandstring or nullNo
instant_payout.card.last4string or nullNo
instant_payout.card.exp_monthinteger or nullNo
instant_payout.card.exp_yearinteger or nullNo
instant_payout.card.statusone of cooling_off, readyNo
instant_payout.card.usable_fromstring (date-time)No
instant_payout.card.added_atstring (date-time)No
instant_payout.fee_ruleobjectYes
instant_payout.fee_rule.percentnumberNo
instant_payout.fee_rule.minimumintegerNo
instant_payout.limitsobjectYes
instant_payout.limits.minintegerNo
instant_payout.limits.per_payout_maxintegerNo
instant_payout.limits.daily_remaining_amountintegerNo
instant_payout.limits.daily_remaining_countintegerNo
Response
{
  "instant_payout": {
    "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
    "available": true,
    "block": {
      "code": "not_available",
      "message": "string",
      "until": "2026-01-01T00:00:00.000Z",
      "action": {
        "label": null,
        "href": null
      }
    },
    "amount": 0,
    "fee": 0,
    "total": 0,
    "currency": "USD",
    "arrival": {
      "text": "Usually within 30 minutes",
      "minutes": 0,
      "estimate": "2026-01-01T00:00:00.000Z"
    },
    "card": {
      "brand": "string",
      "last4": "string",
      "exp_month": 0,
      "exp_year": 0,
      "status": "cooling_off",
      "usable_from": "2026-01-01T00:00:00.000Z",
      "added_at": "2026-01-01T00:00:00.000Z"
    },
    "fee_rule": {
      "percent": 0,
      "minimum": 0
    },
    "limits": {
      "min": 0,
      "per_payout_max": 0,
      "daily_remaining_amount": 0,
      "daily_remaining_count": 0
    }
  }
}
StatusMeaning
200The quote.
404not_found: the object does not exist or belongs to another store.

Make a debit card payout#

HTTP
POST /api/v1/payouts/instant

Sends what the quote showed to the store's debit card. An Idempotency-Key is required: the same key always answers with the same payout (200, replay: true) and never pays twice. Send expected_amount (the quote's amount): when what is payable changed, nothing is paid and the answer is 409 quote_changed with a fresh quote. Refused (409) while payouts are paused (a bank change's cooling-off included), during a new card's cooling-off, over the daily limits, or when nothing released is payable. The result arrives as payout.paid or payout.failed with method: "instant"; a failed debit card payout goes to your bank with your next payout, its fee refunded.

ParameterInTypeRequiredDescription
Idempotency-KeyheaderstringNoA unique key (up to 255 characters is safe) that makes retries of this request safe.

Request body (application/json)

FieldTypeRequiredDescription
expected_amountinteger (≥ 1)NoWhat you expect to reach the card, in minor units.
Request
{
  "expected_amount": 1
}

Response 201

FieldTypeAlways presentDescription
payoutobjectYes
payout.idstring (uuid)YesThe id the payouts list and the payout.paid / payout.failed events carry.
payout.methodone of instantYes
payout.statusone of paid, on_its_way, failed, returned, canceledYes
payout.amountintegerYesWhat reaches the card.
payout.feeintegerYes
payout.totalintegerYesWhat left your balance.
payout.currencystringYes
payout.created_atstring (date-time)Yes
payout.arrivalobjectYes
payout.arrival.textstringNo
payout.arrival.estimatestring (date-time) or nullNo
replaybooleanYesTrue when this Idempotency-Key was used before: the same payout, not a new one.
Response
{
  "payout": {
    "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
    "method": "instant",
    "status": "paid",
    "amount": 0,
    "fee": 0,
    "total": 0,
    "currency": "string",
    "created_at": "2026-01-01T00:00:00.000Z",
    "arrival": {
      "text": "string",
      "estimate": "2026-01-01T00:00:00.000Z"
    }
  },
  "replay": true
}
StatusMeaning
200This key was used before: the same payout.
201Made.
400Refused: error is the block's code (or quote_changed, invalid_request_key, invalid_amount), message says why in plain words, until when it lifts by itself. With quote_changed, instant_payout is a fresh quote.
404not_found: the object does not exist or belongs to another store.
409Refused: error is the block's code (or quote_changed, invalid_request_key, invalid_amount), message says why in plain words, until when it lifts by itself. With quote_changed, instant_payout is a fresh quote.
502Refused: error is the block's code (or quote_changed, invalid_request_key, invalid_amount), message says why in plain words, until when it lifts by itself. With quote_changed, instant_payout is a fresh quote.
503Refused: error is the block's code (or quote_changed, invalid_request_key, invalid_amount), message says why in plain words, until when it lifts by itself. With quote_changed, instant_payout is a fresh quote.

Retrieve the balance#

HTTP
GET /api/v1/balance

Where your money is, as the Balances page shows it.

Response 200

FieldTypeAlways presentDescription
as_ofstring (date-time)Yes
cardobjectYes
next_payoutsarray of objectNo
on_its_wayarray of objectNo
deliveryobjectNo
walletobject or nullNo
Response
{
  "as_of": "2026-01-01T00:00:00.000Z",
  "card": {},
  "next_payouts": [
    {}
  ],
  "on_its_way": [
    {}
  ],
  "delivery": {},
  "wallet": {}
}
StatusMeaning
200The balance.

List payment methods#

HTTP
GET /api/v1/payment-methods

The store's ways to pay beyond cards (bank debit, Cash App Pay, Klarna, Affirm, Afterpay), whether each is turned on, and its status in plain words. Read-only: owners and admins turn methods on in the portal.

Response 200

FieldTypeAlways presentDescription
store_idstring (uuid)Yes
methodsarray of objectYesOnly the methods OnCharge offers today.
methods[].methodone of bank_debit, cash_app_pay, klarna, affirm, afterpayYes
methods[].labelstringYes
methods[].summarystringYesWhat the method does for your store, in one or two sentences.
methods[].enabledbooleanYesWhether the store turned it on (owners and admins, in the portal under Settings → Payment setup).
methods[].stateone of off, not_available, requesting, reviewing, needs_information, inactive, activeYesactive: shoppers see it at checkout. not_available: not offered to this store's business.
methods[].status_textstringYesThe state in plain words.
methods[].needsarray of stringYesWhat is still needed before it can be approved, in words.
Response
{
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "methods": [
    {
      "method": "bank_debit",
      "label": "Bank debit (ACH)",
      "summary": "string",
      "enabled": true,
      "state": "off",
      "status_text": "string",
      "needs": [
        "string"
      ]
    }
  ]
}
StatusMeaning
200The store's payment methods.

Shareable OnCharge pages (/l/<code>) that take a payment without a website. Each payment is an ordinary checkout session.

HTTP
GET /api/v1/payment-links

The store's payment links, newest first, each with its views, checkouts, payments and revenue. Sign an empty body.

ParameterInTypeRequiredDescription
activequerybooleanNoOnly links that are on (true) or off (false).
limitqueryintegerNo
beforequerystring (date-time)Nonext_before from the previous page.

Response 200

FieldTypeAlways presentDescription
object"list"Yes
dataarray of objectYes
data[].idstring (uuid)Yes
data[].object"payment_link"Yes
data[].store_idstring (uuid)Yes
data[].codestringYes
data[].urlstring (uri)YesThe link to share: https://app.oncharge.io/l/<code>.
data[].titlestringYes
data[].descriptionstring or nullNo
data[].amount_typeone of fixed, customer_chosenYes
data[].amountinteger or nullNo
data[].min_amountinteger or nullNo
data[].max_amountinteger or nullNo
data[].preset_amountinteger or nullNo
data[].currencystringYes
data[].adjustable_quantitybooleanNo
data[].max_quantityintegerNo
data[].collect_shippingbooleanNo
data[].collect_phonebooleanNo
data[].success_urlstring or nullNo
data[].railsarray of one of card, cryptoNo
data[].activebooleanYes
data[].statusone of active, inactive, expiredYesactive: takes payments; inactive: turned off; expired: past expires_at.
data[].expires_atstring (date-time) or nullNo
data[].deactivated_atstring (date-time) or nullNo
data[].created_viaone of dashboard, apiNo
data[].created_atstring (date-time)Yes
data[].updated_atstring (date-time) or nullNo
data[].statsobjectYes
data[].stats.viewsintegerYesVisits of the link page while it was active.
data[].stats.checkoutsintegerYesCheckouts started from the link.
data[].stats.paymentsintegerYesPaid checkouts (captured, or refunded afterwards).
data[].stats.revenueintegerYesWhat the paid checkouts came to before refunds, minor units of the link's currency.
data[].stats.refundedintegerYesWhat was refunded of them.
data[].qr_codestring or nullNoAn SVG QR code of url as a data URI (single-link responses).
has_morebooleanYes
next_beforestring or nullYesPass as before for the next page.
Response
{
  "object": "list",
  "data": [
    {
      "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "object": "payment_link",
      "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "code": "string",
      "url": "string",
      "title": "string",
      "description": "string",
      "amount_type": "fixed",
      "amount": 0,
      "min_amount": 0,
      "max_amount": 0,
      "preset_amount": 0,
      "currency": "string",
      "adjustable_quantity": true,
      "max_quantity": 0,
      "collect_shipping": true,
      "collect_phone": true,
      "success_url": "string",
      "rails": [
        "card"
      ],
      "active": true,
      "status": "active",
      "expires_at": "2026-01-01T00:00:00.000Z",
      "deactivated_at": "2026-01-01T00:00:00.000Z",
      "created_via": "dashboard",
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z",
      "stats": {
        "views": 0,
        "checkouts": 0,
        "payments": 0,
        "revenue": 0,
        "refunded": 0
      },
      "qr_code": "string"
    }
  ],
  "has_more": true,
  "next_before": "string"
}
StatusMeaning
200A page of payment links.
400validation_error (the message lists each invalid field) or invalid_json.
HTTP
POST /api/v1/payment-links

Makes a link at https://app.oncharge.io/l/<code>. Each visit that pays creates an ordinary checkout session (card or crypto, whichever the store has on), so the payment.* webhooks fire for it with data.reference = link_<code>, and shipped goods are paid out after delivery like any other order.

Limits: a fixed amount of at least 50 cents; amount × max_quantity (or max_amount) at most $10,000; quantity up to 99; expiry at most two years ahead. A store that ships what it sells must set collect_shipping. success_url must be https on one of the store's registered domains.

Request body (application/json)

FieldTypeRequiredDescription
titlestring (min 1 chars, max 120 chars)Yes
descriptionstring or null (max 500 chars)No
amount_typeone of fixed, customer_chosenNofixed: the customer pays amount per item. customer_chosen: they choose between min_amount and max_amount. Default "fixed".
amountinteger or null (≥ 1)NoPer item, for a fixed amount. Minor units (cents), at least 50.
min_amountinteger or null (≥ 1)NoCustomer-chosen amounts: the least they may pay (default 50).
max_amountinteger or null (≥ 1)NoCustomer-chosen amounts: the most they may pay (default 1000000, $10,000).
preset_amountinteger or null (≥ 1)NoCustomer-chosen amounts: where the amount field starts.
currencystringNoCard payments are USD only on stores paid out per delivered order. Default "USD".
adjustable_quantitybooleanNoDefault false.
max_quantityinteger or null (≥ 1, ≤ 99)NoDefault 10 when adjustable_quantity is on.
collect_shippingbooleanNoAsk for a shipping address (required on stores that ship what they sell). Default false.
collect_phonebooleanNoDefault false.
success_urlstring (uri) or nullNohttps, on one of the store's registered domains. Default: OnCharge's thank-you page.
railsarray of one of card, crypto or null (≥ 1 items)NoWays to pay allowed on the link (default both); the store must have them on.
expires_atstring (date-time) or nullNo
Request
{
  "title": "Consultation deposit",
  "amount": 5000,
  "currency": "USD",
  "collect_phone": true,
  "success_url": "https://shop.example.com/thank-you"
}

Response 201

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"payment_link"Yes
store_idstring (uuid)Yes
codestringYes
urlstring (uri)YesThe link to share: https://app.oncharge.io/l/<code>.
titlestringYes
descriptionstring or nullNo
amount_typeone of fixed, customer_chosenYes
amountinteger or nullNo
min_amountinteger or nullNo
max_amountinteger or nullNo
preset_amountinteger or nullNo
currencystringYes
adjustable_quantitybooleanNo
max_quantityintegerNo
collect_shippingbooleanNo
collect_phonebooleanNo
success_urlstring or nullNo
railsarray of one of card, cryptoNo
activebooleanYes
statusone of active, inactive, expiredYesactive: takes payments; inactive: turned off; expired: past expires_at.
expires_atstring (date-time) or nullNo
deactivated_atstring (date-time) or nullNo
created_viaone of dashboard, apiNo
created_atstring (date-time)Yes
updated_atstring (date-time) or nullNo
statsobjectYes
stats.viewsintegerYesVisits of the link page while it was active.
stats.checkoutsintegerYesCheckouts started from the link.
stats.paymentsintegerYesPaid checkouts (captured, or refunded afterwards).
stats.revenueintegerYesWhat the paid checkouts came to before refunds, minor units of the link's currency.
stats.refundedintegerYesWhat was refunded of them.
qr_codestring or nullNoAn SVG QR code of url as a data URI (single-link responses).
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "payment_link",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "code": "string",
  "url": "string",
  "title": "string",
  "description": "string",
  "amount_type": "fixed",
  "amount": 0,
  "min_amount": 0,
  "max_amount": 0,
  "preset_amount": 0,
  "currency": "string",
  "adjustable_quantity": true,
  "max_quantity": 0,
  "collect_shipping": true,
  "collect_phone": true,
  "success_url": "string",
  "rails": [
    "card"
  ],
  "active": true,
  "status": "active",
  "expires_at": "2026-01-01T00:00:00.000Z",
  "deactivated_at": "2026-01-01T00:00:00.000Z",
  "created_via": "dashboard",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "stats": {
    "views": 0,
    "checkouts": 0,
    "payments": 0,
    "revenue": 0,
    "refunded": 0
  },
  "qr_code": "string"
}
StatusMeaning
201The new link, with its QR code.
400validation_error (the message lists each invalid field) or invalid_json.
409payment_method_unavailable: none of the link's ways to pay (rails) is on for the store yet.
HTTP
GET /api/v1/payment-links/{link_id}

One link with its stats and QR code. Another store's link answers 404. Sign an empty body.

ParameterInTypeRequiredDescription
link_idpathstring (uuid)YesThe payment link's id.

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"payment_link"Yes
store_idstring (uuid)Yes
codestringYes
urlstring (uri)YesThe link to share: https://app.oncharge.io/l/<code>.
titlestringYes
descriptionstring or nullNo
amount_typeone of fixed, customer_chosenYes
amountinteger or nullNo
min_amountinteger or nullNo
max_amountinteger or nullNo
preset_amountinteger or nullNo
currencystringYes
adjustable_quantitybooleanNo
max_quantityintegerNo
collect_shippingbooleanNo
collect_phonebooleanNo
success_urlstring or nullNo
railsarray of one of card, cryptoNo
activebooleanYes
statusone of active, inactive, expiredYesactive: takes payments; inactive: turned off; expired: past expires_at.
expires_atstring (date-time) or nullNo
deactivated_atstring (date-time) or nullNo
created_viaone of dashboard, apiNo
created_atstring (date-time)Yes
updated_atstring (date-time) or nullNo
statsobjectYes
stats.viewsintegerYesVisits of the link page while it was active.
stats.checkoutsintegerYesCheckouts started from the link.
stats.paymentsintegerYesPaid checkouts (captured, or refunded afterwards).
stats.revenueintegerYesWhat the paid checkouts came to before refunds, minor units of the link's currency.
stats.refundedintegerYesWhat was refunded of them.
qr_codestring or nullNoAn SVG QR code of url as a data URI (single-link responses).
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "payment_link",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "code": "string",
  "url": "string",
  "title": "string",
  "description": "string",
  "amount_type": "fixed",
  "amount": 0,
  "min_amount": 0,
  "max_amount": 0,
  "preset_amount": 0,
  "currency": "string",
  "adjustable_quantity": true,
  "max_quantity": 0,
  "collect_shipping": true,
  "collect_phone": true,
  "success_url": "string",
  "rails": [
    "card"
  ],
  "active": true,
  "status": "active",
  "expires_at": "2026-01-01T00:00:00.000Z",
  "deactivated_at": "2026-01-01T00:00:00.000Z",
  "created_via": "dashboard",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "stats": {
    "views": 0,
    "checkouts": 0,
    "payments": 0,
    "revenue": 0,
    "refunded": 0
  },
  "qr_code": "string"
}
StatusMeaning
200The link.
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.
HTTP
POST /api/v1/payment-links/{link_id}

Changes any field of the link, checked as a whole link again, or turns it off (active: false) or back on (active: true). Switching amount_type drops the other kind's amounts.

ParameterInTypeRequiredDescription
link_idpathstring (uuid)YesThe payment link's id.

Request body (application/json)

FieldTypeRequiredDescription
titlestring (min 1 chars, max 120 chars)No
descriptionstring or null (max 500 chars)No
amount_typeone of fixed, customer_chosenNofixed: the customer pays amount per item. customer_chosen: they choose between min_amount and max_amount. Default "fixed".
amountinteger or null (≥ 1)NoPer item, for a fixed amount. Minor units (cents), at least 50.
min_amountinteger or null (≥ 1)NoCustomer-chosen amounts: the least they may pay (default 50).
max_amountinteger or null (≥ 1)NoCustomer-chosen amounts: the most they may pay (default 1000000, $10,000).
preset_amountinteger or null (≥ 1)NoCustomer-chosen amounts: where the amount field starts.
currencystringNoCard payments are USD only on stores paid out per delivered order. Default "USD".
adjustable_quantitybooleanNoDefault false.
max_quantityinteger or null (≥ 1, ≤ 99)NoDefault 10 when adjustable_quantity is on.
collect_shippingbooleanNoAsk for a shipping address (required on stores that ship what they sell). Default false.
collect_phonebooleanNoDefault false.
success_urlstring (uri) or nullNohttps, on one of the store's registered domains. Default: OnCharge's thank-you page.
railsarray of one of card, crypto or null (≥ 1 items)NoWays to pay allowed on the link (default both); the store must have them on.
expires_atstring (date-time) or nullNo
activebooleanNoTurn the link off (false) or back on (true).
Request
{
  "title": "Consultation deposit (December)",
  "expires_at": "2026-12-31T23:59:59Z"
}

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"payment_link"Yes
store_idstring (uuid)Yes
codestringYes
urlstring (uri)YesThe link to share: https://app.oncharge.io/l/<code>.
titlestringYes
descriptionstring or nullNo
amount_typeone of fixed, customer_chosenYes
amountinteger or nullNo
min_amountinteger or nullNo
max_amountinteger or nullNo
preset_amountinteger or nullNo
currencystringYes
adjustable_quantitybooleanNo
max_quantityintegerNo
collect_shippingbooleanNo
collect_phonebooleanNo
success_urlstring or nullNo
railsarray of one of card, cryptoNo
activebooleanYes
statusone of active, inactive, expiredYesactive: takes payments; inactive: turned off; expired: past expires_at.
expires_atstring (date-time) or nullNo
deactivated_atstring (date-time) or nullNo
created_viaone of dashboard, apiNo
created_atstring (date-time)Yes
updated_atstring (date-time) or nullNo
statsobjectYes
stats.viewsintegerYesVisits of the link page while it was active.
stats.checkoutsintegerYesCheckouts started from the link.
stats.paymentsintegerYesPaid checkouts (captured, or refunded afterwards).
stats.revenueintegerYesWhat the paid checkouts came to before refunds, minor units of the link's currency.
stats.refundedintegerYesWhat was refunded of them.
qr_codestring or nullNoAn SVG QR code of url as a data URI (single-link responses).
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "payment_link",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "code": "string",
  "url": "string",
  "title": "string",
  "description": "string",
  "amount_type": "fixed",
  "amount": 0,
  "min_amount": 0,
  "max_amount": 0,
  "preset_amount": 0,
  "currency": "string",
  "adjustable_quantity": true,
  "max_quantity": 0,
  "collect_shipping": true,
  "collect_phone": true,
  "success_url": "string",
  "rails": [
    "card"
  ],
  "active": true,
  "status": "active",
  "expires_at": "2026-01-01T00:00:00.000Z",
  "deactivated_at": "2026-01-01T00:00:00.000Z",
  "created_via": "dashboard",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "stats": {
    "views": 0,
    "checkouts": 0,
    "payments": 0,
    "revenue": 0,
    "refunded": 0
  },
  "qr_code": "string"
}
StatusMeaning
200The changed link.
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.
409payment_method_unavailable: none of the link's ways to pay (rails) is on for the store yet.
HTTP
POST /api/v1/payment-links/{link_id}/deactivate

Turns the link off: visits say it is no longer active and no new checkout starts. Its payments stay. Idempotent. Sign an empty body or {}.

ParameterInTypeRequiredDescription
link_idpathstring (uuid)YesThe payment link's id.

No request body. Sign it as an empty body.

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"payment_link"Yes
store_idstring (uuid)Yes
codestringYes
urlstring (uri)YesThe link to share: https://app.oncharge.io/l/<code>.
titlestringYes
descriptionstring or nullNo
amount_typeone of fixed, customer_chosenYes
amountinteger or nullNo
min_amountinteger or nullNo
max_amountinteger or nullNo
preset_amountinteger or nullNo
currencystringYes
adjustable_quantitybooleanNo
max_quantityintegerNo
collect_shippingbooleanNo
collect_phonebooleanNo
success_urlstring or nullNo
railsarray of one of card, cryptoNo
activebooleanYes
statusone of active, inactive, expiredYesactive: takes payments; inactive: turned off; expired: past expires_at.
expires_atstring (date-time) or nullNo
deactivated_atstring (date-time) or nullNo
created_viaone of dashboard, apiNo
created_atstring (date-time)Yes
updated_atstring (date-time) or nullNo
statsobjectYes
stats.viewsintegerYesVisits of the link page while it was active.
stats.checkoutsintegerYesCheckouts started from the link.
stats.paymentsintegerYesPaid checkouts (captured, or refunded afterwards).
stats.revenueintegerYesWhat the paid checkouts came to before refunds, minor units of the link's currency.
stats.refundedintegerYesWhat was refunded of them.
qr_codestring or nullNoAn SVG QR code of url as a data URI (single-link responses).
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "payment_link",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "code": "string",
  "url": "string",
  "title": "string",
  "description": "string",
  "amount_type": "fixed",
  "amount": 0,
  "min_amount": 0,
  "max_amount": 0,
  "preset_amount": 0,
  "currency": "string",
  "adjustable_quantity": true,
  "max_quantity": 0,
  "collect_shipping": true,
  "collect_phone": true,
  "success_url": "string",
  "rails": [
    "card"
  ],
  "active": true,
  "status": "active",
  "expires_at": "2026-01-01T00:00:00.000Z",
  "deactivated_at": "2026-01-01T00:00:00.000Z",
  "created_via": "dashboard",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "stats": {
    "views": 0,
    "checkouts": 0,
    "payments": 0,
    "revenue": 0,
    "refunded": 0
  },
  "qr_code": "string"
}
StatusMeaning
200The link, now off.
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.

Invoices#

Bill a customer: draft, finalize, send and get paid on OnCharge's hosted invoice page through OnCharge checkout, by card or crypto. Reminders, mark paid, void and credit notes.

List invoices#

HTTP
GET /api/v1/invoices

The store's invoices, newest first. kind=credit_note lists credit notes.

ParameterInTypeRequiredDescription
statusqueryone of draft, open, overdue, paid, void, allNo
searchquerystringNoAn invoice number, a customer email, or part of a customer name.
cursorquerystringNonext_cursor from the previous page.
limitqueryintegerNo
kindqueryone of invoice, credit_noteNo

Response 200

FieldTypeAlways presentDescription
invoicesarray of objectYes
invoices[].idstring (uuid)Yes
invoices[].objectone of invoice, credit_noteYes
invoices[].store_idstring (uuid)No
invoices[].numberstring or nullNoINV-0001 (credit notes CN-0001), per store, given at finalize; null on a draft.
invoices[].statusone of draft, open, paid, void, issuedYesissued is a credit note's.
invoices[].display_statusone of draft, open, overdue, paid, void, issuedNo
invoices[].status_labelstringNo
invoices[].currencystringYes
invoices[].currency_digitsintegerNo
invoices[].customerobjectNo
invoices[].customer.namestring or nullNo
invoices[].customer.emailstring or nullNo
invoices[].customer.addressobject or nullNo
invoices[].shipping_addressobject or nullNo
invoices[].linesarray of objectYes
invoices[].lines[].descriptionstringNo
invoices[].lines[].quantityintegerNo
invoices[].lines[].unit_amountintegerNo
invoices[].lines[].tax_ratenumberNo
invoices[].lines[].amountintegerNo
invoices[].lines[].tax_amountintegerNo
invoices[].lines[].requires_shippingbooleanNo
invoices[].subtotalintegerNo
invoices[].taxintegerNo
invoices[].totalintegerYes
invoices[].amount_paidintegerNo
invoices[].amount_creditedintegerNo
invoices[].amount_remainingintegerYes
invoices[].memostring or nullNo
invoices[].footerstring or nullNo
invoices[].reply_tostring or nullNo
invoices[].days_until_dueintegerNo
invoices[].due_atstring (date-time) or nullNo
invoices[].send_remindersbooleanNo
invoices[].metadataobjectNo
invoices[].hosted_urlstring or nullNoThe hosted invoice page the customer pays on (once finalized).
invoices[].paid_out_of_bandbooleanNo
invoices[].payment_referencestring or nullNoThe OnCharge reference (ocpay_…) of the payment that paid it.
invoices[].credit_note_forobject or nullNo
invoices[].credit_note_for.idstringNo
invoices[].credit_note_for.numberstring or nullNo
invoices[].credit_reasonstring or nullNo
invoices[].sourceone of dashboard, apiNo
invoices[].created_atstring (date-time)No
invoices[].finalized_atstring or nullNo
invoices[].sent_atstring or nullNo
invoices[].paid_atstring or nullNo
invoices[].voided_atstring or nullNo
invoices[].actionsobjectNoWhat can be done now.
invoices[].eventsarray of objectNoHistory (detail only).
invoices[].paymentsarray of objectNoPayments made for it, by OnCharge reference (detail only).
invoices[].payments[].payment_referencestringNo
invoices[].payments[].session_idstringNo
invoices[].payments[].amountintegerNo
invoices[].payments[].currencystringNo
invoices[].payments[].statusstringNo
invoices[].payments[].railone of card, cryptoNo
invoices[].credit_notesarray of objectNoCredit notes issued against it (detail only).
invoices[].payment_optionsarray of objectNoHow the customer can pay it now, and why a rail is off (detail only).
invoices[].payment_options[].railstringNo
invoices[].payment_options[].availablebooleanNo
invoices[].payment_options[].reasonstring or nullNo
invoices[].idempotentbooleanNo
invoices[].email_errorstringNoFinalized, but the email could not be sent.
next_cursorstring or nullYesPass back as cursor; null on the last page.
Response
{
  "invoices": [
    {
      "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "object": "invoice",
      "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
      "number": "string",
      "status": "draft",
      "display_status": "draft",
      "status_label": "string",
      "currency": "string",
      "currency_digits": 0,
      "customer": {
        "name": "string",
        "email": "string",
        "address": null
      },
      "shipping_address": {
        "line1": null,
        "line2": null,
        "city": null,
        "state": null,
        "postal_code": null,
        "country": null
      },
      "lines": [
        {
          "description": null,
          "quantity": null,
          "unit_amount": null,
          "tax_rate": null,
          "amount": null,
          "tax_amount": null,
          "requires_shipping": null
        }
      ],
      "subtotal": 0,
      "tax": 0,
      "total": 0,
      "amount_paid": 0,
      "amount_credited": 0,
      "amount_remaining": 0,
      "memo": "string",
      "footer": "string",
      "reply_to": "string",
      "days_until_due": 0,
      "due_at": "2026-01-01T00:00:00.000Z",
      "send_reminders": true,
      "metadata": {},
      "hosted_url": "string",
      "paid_out_of_band": true,
      "payment_reference": "string",
      "credit_note_for": {
        "id": "string",
        "number": "string"
      },
      "credit_reason": "string",
      "source": "dashboard",
      "created_at": "2026-01-01T00:00:00.000Z",
      "finalized_at": "string",
      "sent_at": "string",
      "paid_at": "string",
      "voided_at": "string",
      "actions": {},
      "events": [
        {}
      ],
      "payments": [
        {
          "payment_reference": null,
          "session_id": null,
          "amount": null,
          "currency": null,
          "status": null,
          "rail": null
        }
      ],
      "credit_notes": [
        {}
      ],
      "payment_options": [
        {
          "rail": null,
          "available": null,
          "reason": null
        }
      ],
      "idempotent": true,
      "email_error": "string"
    }
  ],
  "next_cursor": "string"
}
StatusMeaning
200A page of invoices.
404not_found: the object does not exist or belongs to another store.

Create an invoice#

HTTP
POST /api/v1/invoices

A new draft. With finalize it is also numbered and opened for payment; with send it is also emailed to the customer (PDF attached). The bill-to details live on the invoice. A repeat with the same Idempotency-Key returns the first draft with idempotent: true.

ParameterInTypeRequiredDescription
Idempotency-KeyheaderstringNoA unique key (up to 255 characters is safe) that makes retries of this request safe.

Request body (application/json)

FieldTypeRequiredDescription
currencyone of USD, EUR, GBP, CAD, AUD, NZD, CHF, JPYNoAmounts are in this currency's minor units (JPY has none). Card payments on stores paid out per delivered order are USD only. Default "USD".
customerobjectNo
customer.namestring or null (max 200 chars)NoRequired to finalize.
customer.emailstring (email) or nullNoRequired to send.
customer.addressobject or nullNo
shipping_addressobject or nullNoNeeded when a line ships and the store's card payments are paid out on delivery.
linesarray of object (≤ 100 items)NoOn update, replaces every line.
lines[].descriptionstring (min 1 chars, max 500 chars)Yes
lines[].quantityinteger (≥ 1, ≤ 100000)Yes
lines[].unit_amountinteger (≥ -10000000000, ≤ 10000000000)YesMinor units of the invoice currency; negative for a discount line. quantity x unit_amount may be at most 10000000000 either way.
lines[].tax_ratenumber or stringNoA percent from 0 to 100 with up to three decimals, e.g. 8.875. Tax is rounded half away from zero per line.
lines[].requires_shippingbooleanNoA shipped item. Card payments for it are paid out after the carrier confirms delivery to shipping_address, as for any order. Default false.
memostring or null (max 2000 chars)No
footerstring or null (max 1000 chars)No
reply_tostring (email) or nullNoWhere the customer's replies to invoice emails go.
days_until_dueinteger (≥ 0, ≤ 365)NoDefault 30.
due_atstring or nullNoA date (YYYY-MM-DD, end of that day UTC) or an ISO 8601 time. Overrides days_until_due; must not be in the past when finalizing.
send_remindersbooleanNoEmail the customer 1, 7 and 14 days after the due date while it is unpaid. Default true.
metadataobjectNo
finalizebooleanNoFinalize it straight away.
sendbooleanNoFinalize it and email it to the customer.
Request
{
  "customer": {
    "name": "Ada Lovelace",
    "email": "ada@example.com"
  },
  "lines": [
    {
      "description": "Consulting, November",
      "quantity": 10,
      "unit_amount": 15000,
      "tax_rate": 8.875
    }
  ],
  "days_until_due": 14,
  "send": true
}

Response 201

FieldTypeAlways presentDescription
idstring (uuid)Yes
objectone of invoice, credit_noteYes
store_idstring (uuid)No
numberstring or nullNoINV-0001 (credit notes CN-0001), per store, given at finalize; null on a draft.
statusone of draft, open, paid, void, issuedYesissued is a credit note's.
display_statusone of draft, open, overdue, paid, void, issuedNo
status_labelstringNo
currencystringYes
currency_digitsintegerNo
customerobjectNo
customer.namestring or nullNo
customer.emailstring or nullNo
customer.addressobject or nullNo
shipping_addressobject or nullNo
linesarray of objectYes
lines[].descriptionstringNo
lines[].quantityintegerNo
lines[].unit_amountintegerNo
lines[].tax_ratenumberNo
lines[].amountintegerNo
lines[].tax_amountintegerNo
lines[].requires_shippingbooleanNo
subtotalintegerNo
taxintegerNo
totalintegerYes
amount_paidintegerNo
amount_creditedintegerNo
amount_remainingintegerYes
memostring or nullNo
footerstring or nullNo
reply_tostring or nullNo
days_until_dueintegerNo
due_atstring (date-time) or nullNo
send_remindersbooleanNo
metadataobjectNo
hosted_urlstring or nullNoThe hosted invoice page the customer pays on (once finalized).
paid_out_of_bandbooleanNo
payment_referencestring or nullNoThe OnCharge reference (ocpay_…) of the payment that paid it.
credit_note_forobject or nullNo
credit_note_for.idstringNo
credit_note_for.numberstring or nullNo
credit_reasonstring or nullNo
sourceone of dashboard, apiNo
created_atstring (date-time)No
finalized_atstring or nullNo
sent_atstring or nullNo
paid_atstring or nullNo
voided_atstring or nullNo
actionsobjectNoWhat can be done now.
eventsarray of objectNoHistory (detail only).
paymentsarray of objectNoPayments made for it, by OnCharge reference (detail only).
payments[].payment_referencestringNo
payments[].session_idstringNo
payments[].amountintegerNo
payments[].currencystringNo
payments[].statusstringNo
payments[].railone of card, cryptoNo
credit_notesarray of objectNoCredit notes issued against it (detail only).
payment_optionsarray of objectNoHow the customer can pay it now, and why a rail is off (detail only).
payment_options[].railstringNo
payment_options[].availablebooleanNo
payment_options[].reasonstring or nullNo
idempotentbooleanNo
email_errorstringNoFinalized, but the email could not be sent.
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "invoice",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "number": "string",
  "status": "draft",
  "display_status": "draft",
  "status_label": "string",
  "currency": "string",
  "currency_digits": 0,
  "customer": {
    "name": "string",
    "email": "string",
    "address": {
      "line1": "string",
      "line2": "string",
      "city": "string",
      "state": "string",
      "postal_code": "string",
      "country": "string"
    }
  },
  "shipping_address": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postal_code": "string",
    "country": "string"
  },
  "lines": [
    {
      "description": "string",
      "quantity": 0,
      "unit_amount": 0,
      "tax_rate": 0,
      "amount": 0,
      "tax_amount": 0,
      "requires_shipping": true
    }
  ],
  "subtotal": 0,
  "tax": 0,
  "total": 0,
  "amount_paid": 0,
  "amount_credited": 0,
  "amount_remaining": 0,
  "memo": "string",
  "footer": "string",
  "reply_to": "string",
  "days_until_due": 0,
  "due_at": "2026-01-01T00:00:00.000Z",
  "send_reminders": true,
  "metadata": {},
  "hosted_url": "string",
  "paid_out_of_band": true,
  "payment_reference": "string",
  "credit_note_for": {
    "id": "string",
    "number": "string"
  },
  "credit_reason": "string",
  "source": "dashboard",
  "created_at": "2026-01-01T00:00:00.000Z",
  "finalized_at": "string",
  "sent_at": "string",
  "paid_at": "string",
  "voided_at": "string",
  "actions": {},
  "events": [
    {}
  ],
  "payments": [
    {
      "payment_reference": "string",
      "session_id": "string",
      "amount": 0,
      "currency": "string",
      "status": "string",
      "rail": "card"
    }
  ],
  "credit_notes": [
    {}
  ],
  "payment_options": [
    {
      "rail": "string",
      "available": true,
      "reason": "string"
    }
  ],
  "idempotent": true,
  "email_error": "string"
}
StatusMeaning
200Idempotent replay.
201Created (and finalized or sent when asked).
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.
409store_inactive: the store is not taking payments.
422invoice_incomplete: finalizing needs a line, a total above zero and the customer's name; invoice_too_large: the lines would total more than 100000000000 minor units.

Retrieve an invoice#

HTTP
GET /api/v1/invoices/{invoice_id}

The invoice or credit note with its lines, history, payments (OnCharge references), credit notes and how it can be paid now.

ParameterInTypeRequiredDescription
invoice_idpathstring (uuid)YesThe invoice (or credit note) id.

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
objectone of invoice, credit_noteYes
store_idstring (uuid)No
numberstring or nullNoINV-0001 (credit notes CN-0001), per store, given at finalize; null on a draft.
statusone of draft, open, paid, void, issuedYesissued is a credit note's.
display_statusone of draft, open, overdue, paid, void, issuedNo
status_labelstringNo
currencystringYes
currency_digitsintegerNo
customerobjectNo
customer.namestring or nullNo
customer.emailstring or nullNo
customer.addressobject or nullNo
shipping_addressobject or nullNo
linesarray of objectYes
lines[].descriptionstringNo
lines[].quantityintegerNo
lines[].unit_amountintegerNo
lines[].tax_ratenumberNo
lines[].amountintegerNo
lines[].tax_amountintegerNo
lines[].requires_shippingbooleanNo
subtotalintegerNo
taxintegerNo
totalintegerYes
amount_paidintegerNo
amount_creditedintegerNo
amount_remainingintegerYes
memostring or nullNo
footerstring or nullNo
reply_tostring or nullNo
days_until_dueintegerNo
due_atstring (date-time) or nullNo
send_remindersbooleanNo
metadataobjectNo
hosted_urlstring or nullNoThe hosted invoice page the customer pays on (once finalized).
paid_out_of_bandbooleanNo
payment_referencestring or nullNoThe OnCharge reference (ocpay_…) of the payment that paid it.
credit_note_forobject or nullNo
credit_note_for.idstringNo
credit_note_for.numberstring or nullNo
credit_reasonstring or nullNo
sourceone of dashboard, apiNo
created_atstring (date-time)No
finalized_atstring or nullNo
sent_atstring or nullNo
paid_atstring or nullNo
voided_atstring or nullNo
actionsobjectNoWhat can be done now.
eventsarray of objectNoHistory (detail only).
paymentsarray of objectNoPayments made for it, by OnCharge reference (detail only).
payments[].payment_referencestringNo
payments[].session_idstringNo
payments[].amountintegerNo
payments[].currencystringNo
payments[].statusstringNo
payments[].railone of card, cryptoNo
credit_notesarray of objectNoCredit notes issued against it (detail only).
payment_optionsarray of objectNoHow the customer can pay it now, and why a rail is off (detail only).
payment_options[].railstringNo
payment_options[].availablebooleanNo
payment_options[].reasonstring or nullNo
idempotentbooleanNo
email_errorstringNoFinalized, but the email could not be sent.
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "invoice",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "number": "string",
  "status": "draft",
  "display_status": "draft",
  "status_label": "string",
  "currency": "string",
  "currency_digits": 0,
  "customer": {
    "name": "string",
    "email": "string",
    "address": {
      "line1": "string",
      "line2": "string",
      "city": "string",
      "state": "string",
      "postal_code": "string",
      "country": "string"
    }
  },
  "shipping_address": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postal_code": "string",
    "country": "string"
  },
  "lines": [
    {
      "description": "string",
      "quantity": 0,
      "unit_amount": 0,
      "tax_rate": 0,
      "amount": 0,
      "tax_amount": 0,
      "requires_shipping": true
    }
  ],
  "subtotal": 0,
  "tax": 0,
  "total": 0,
  "amount_paid": 0,
  "amount_credited": 0,
  "amount_remaining": 0,
  "memo": "string",
  "footer": "string",
  "reply_to": "string",
  "days_until_due": 0,
  "due_at": "2026-01-01T00:00:00.000Z",
  "send_reminders": true,
  "metadata": {},
  "hosted_url": "string",
  "paid_out_of_band": true,
  "payment_reference": "string",
  "credit_note_for": {
    "id": "string",
    "number": "string"
  },
  "credit_reason": "string",
  "source": "dashboard",
  "created_at": "2026-01-01T00:00:00.000Z",
  "finalized_at": "string",
  "sent_at": "string",
  "paid_at": "string",
  "voided_at": "string",
  "actions": {},
  "events": [
    {}
  ],
  "payments": [
    {
      "payment_reference": "string",
      "session_id": "string",
      "amount": 0,
      "currency": "string",
      "status": "string",
      "rail": "card"
    }
  ],
  "credit_notes": [
    {}
  ],
  "payment_options": [
    {
      "rail": "string",
      "available": true,
      "reason": "string"
    }
  ],
  "idempotent": true,
  "email_error": "string"
}
StatusMeaning
200The invoice.
404not_found: the object does not exist or belongs to another store.

Update a draft#

HTTP
POST /api/v1/invoices/{invoice_id}

Any draft field; lines replaces every line. A finalized invoice cannot be edited: void it and create another, or issue a credit note.

ParameterInTypeRequiredDescription
invoice_idpathstring (uuid)YesThe invoice (or credit note) id.

Request body (application/json)

FieldTypeRequiredDescription
currencyone of USD, EUR, GBP, CAD, AUD, NZD, CHF, JPYNoAmounts are in this currency's minor units (JPY has none). Card payments on stores paid out per delivered order are USD only. Default "USD".
customerobjectNo
customer.namestring or null (max 200 chars)NoRequired to finalize.
customer.emailstring (email) or nullNoRequired to send.
customer.addressobject or nullNo
shipping_addressobject or nullNoNeeded when a line ships and the store's card payments are paid out on delivery.
linesarray of object (≤ 100 items)NoOn update, replaces every line.
lines[].descriptionstring (min 1 chars, max 500 chars)Yes
lines[].quantityinteger (≥ 1, ≤ 100000)Yes
lines[].unit_amountinteger (≥ -10000000000, ≤ 10000000000)YesMinor units of the invoice currency; negative for a discount line. quantity x unit_amount may be at most 10000000000 either way.
lines[].tax_ratenumber or stringNoA percent from 0 to 100 with up to three decimals, e.g. 8.875. Tax is rounded half away from zero per line.
lines[].requires_shippingbooleanNoA shipped item. Card payments for it are paid out after the carrier confirms delivery to shipping_address, as for any order. Default false.
memostring or null (max 2000 chars)No
footerstring or null (max 1000 chars)No
reply_tostring (email) or nullNoWhere the customer's replies to invoice emails go.
days_until_dueinteger (≥ 0, ≤ 365)NoDefault 30.
due_atstring or nullNoA date (YYYY-MM-DD, end of that day UTC) or an ISO 8601 time. Overrides days_until_due; must not be in the past when finalizing.
send_remindersbooleanNoEmail the customer 1, 7 and 14 days after the due date while it is unpaid. Default true.
metadataobjectNo
Request
{
  "memo": "Thanks for your business."
}

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
objectone of invoice, credit_noteYes
store_idstring (uuid)No
numberstring or nullNoINV-0001 (credit notes CN-0001), per store, given at finalize; null on a draft.
statusone of draft, open, paid, void, issuedYesissued is a credit note's.
display_statusone of draft, open, overdue, paid, void, issuedNo
status_labelstringNo
currencystringYes
currency_digitsintegerNo
customerobjectNo
customer.namestring or nullNo
customer.emailstring or nullNo
customer.addressobject or nullNo
shipping_addressobject or nullNo
linesarray of objectYes
lines[].descriptionstringNo
lines[].quantityintegerNo
lines[].unit_amountintegerNo
lines[].tax_ratenumberNo
lines[].amountintegerNo
lines[].tax_amountintegerNo
lines[].requires_shippingbooleanNo
subtotalintegerNo
taxintegerNo
totalintegerYes
amount_paidintegerNo
amount_creditedintegerNo
amount_remainingintegerYes
memostring or nullNo
footerstring or nullNo
reply_tostring or nullNo
days_until_dueintegerNo
due_atstring (date-time) or nullNo
send_remindersbooleanNo
metadataobjectNo
hosted_urlstring or nullNoThe hosted invoice page the customer pays on (once finalized).
paid_out_of_bandbooleanNo
payment_referencestring or nullNoThe OnCharge reference (ocpay_…) of the payment that paid it.
credit_note_forobject or nullNo
credit_note_for.idstringNo
credit_note_for.numberstring or nullNo
credit_reasonstring or nullNo
sourceone of dashboard, apiNo
created_atstring (date-time)No
finalized_atstring or nullNo
sent_atstring or nullNo
paid_atstring or nullNo
voided_atstring or nullNo
actionsobjectNoWhat can be done now.
eventsarray of objectNoHistory (detail only).
paymentsarray of objectNoPayments made for it, by OnCharge reference (detail only).
payments[].payment_referencestringNo
payments[].session_idstringNo
payments[].amountintegerNo
payments[].currencystringNo
payments[].statusstringNo
payments[].railone of card, cryptoNo
credit_notesarray of objectNoCredit notes issued against it (detail only).
payment_optionsarray of objectNoHow the customer can pay it now, and why a rail is off (detail only).
payment_options[].railstringNo
payment_options[].availablebooleanNo
payment_options[].reasonstring or nullNo
idempotentbooleanNo
email_errorstringNoFinalized, but the email could not be sent.
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "invoice",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "number": "string",
  "status": "draft",
  "display_status": "draft",
  "status_label": "string",
  "currency": "string",
  "currency_digits": 0,
  "customer": {
    "name": "string",
    "email": "string",
    "address": {
      "line1": "string",
      "line2": "string",
      "city": "string",
      "state": "string",
      "postal_code": "string",
      "country": "string"
    }
  },
  "shipping_address": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postal_code": "string",
    "country": "string"
  },
  "lines": [
    {
      "description": "string",
      "quantity": 0,
      "unit_amount": 0,
      "tax_rate": 0,
      "amount": 0,
      "tax_amount": 0,
      "requires_shipping": true
    }
  ],
  "subtotal": 0,
  "tax": 0,
  "total": 0,
  "amount_paid": 0,
  "amount_credited": 0,
  "amount_remaining": 0,
  "memo": "string",
  "footer": "string",
  "reply_to": "string",
  "days_until_due": 0,
  "due_at": "2026-01-01T00:00:00.000Z",
  "send_reminders": true,
  "metadata": {},
  "hosted_url": "string",
  "paid_out_of_band": true,
  "payment_reference": "string",
  "credit_note_for": {
    "id": "string",
    "number": "string"
  },
  "credit_reason": "string",
  "source": "dashboard",
  "created_at": "2026-01-01T00:00:00.000Z",
  "finalized_at": "string",
  "sent_at": "string",
  "paid_at": "string",
  "voided_at": "string",
  "actions": {},
  "events": [
    {}
  ],
  "payments": [
    {
      "payment_reference": "string",
      "session_id": "string",
      "amount": 0,
      "currency": "string",
      "status": "string",
      "rail": "card"
    }
  ],
  "credit_notes": [
    {}
  ],
  "payment_options": [
    {
      "rail": "string",
      "available": true,
      "reason": "string"
    }
  ],
  "idempotent": true,
  "email_error": "string"
}
StatusMeaning
200The draft.
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.
409invoice_locked: a finalized invoice cannot be edited; invoice_not_draft, invalid_transition or invoice_partly_paid: not possible in its status; payment_in_progress: a payment for the invoice is under way (try again in a few minutes); store_inactive: the store is not taking payments.

Delete a draft#

HTTP
DELETE /api/v1/invoices/{invoice_id}

Only a draft can be deleted.

ParameterInTypeRequiredDescription
invoice_idpathstring (uuid)YesThe invoice (or credit note) id.

No request body. Sign it as an empty body.

Response 200

FieldTypeAlways presentDescription
idstringNo
deletedbooleanNo
Response
{
  "id": "string",
  "deleted": true
}
StatusMeaning
200Deleted.
404not_found: the object does not exist or belongs to another store.
409invoice_locked: a finalized invoice cannot be edited; invoice_not_draft, invalid_transition or invoice_partly_paid: not possible in its status; payment_in_progress: a payment for the invoice is under way (try again in a few minutes); store_inactive: the store is not taking payments.

Finalize a draft#

HTTP
POST /api/v1/invoices/{invoice_id}/finalize

Gives the draft its store's next number (INV-0001), a due date and its hosted invoice page (hosted_url). Nothing on it can change afterwards. With send, also emails it.

ParameterInTypeRequiredDescription
invoice_idpathstring (uuid)YesThe invoice (or credit note) id.

Request body (application/json)

FieldTypeRequiredDescription
sendbooleanNo
Request
{
  "send": true
}

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
objectone of invoice, credit_noteYes
store_idstring (uuid)No
numberstring or nullNoINV-0001 (credit notes CN-0001), per store, given at finalize; null on a draft.
statusone of draft, open, paid, void, issuedYesissued is a credit note's.
display_statusone of draft, open, overdue, paid, void, issuedNo
status_labelstringNo
currencystringYes
currency_digitsintegerNo
customerobjectNo
customer.namestring or nullNo
customer.emailstring or nullNo
customer.addressobject or nullNo
shipping_addressobject or nullNo
linesarray of objectYes
lines[].descriptionstringNo
lines[].quantityintegerNo
lines[].unit_amountintegerNo
lines[].tax_ratenumberNo
lines[].amountintegerNo
lines[].tax_amountintegerNo
lines[].requires_shippingbooleanNo
subtotalintegerNo
taxintegerNo
totalintegerYes
amount_paidintegerNo
amount_creditedintegerNo
amount_remainingintegerYes
memostring or nullNo
footerstring or nullNo
reply_tostring or nullNo
days_until_dueintegerNo
due_atstring (date-time) or nullNo
send_remindersbooleanNo
metadataobjectNo
hosted_urlstring or nullNoThe hosted invoice page the customer pays on (once finalized).
paid_out_of_bandbooleanNo
payment_referencestring or nullNoThe OnCharge reference (ocpay_…) of the payment that paid it.
credit_note_forobject or nullNo
credit_note_for.idstringNo
credit_note_for.numberstring or nullNo
credit_reasonstring or nullNo
sourceone of dashboard, apiNo
created_atstring (date-time)No
finalized_atstring or nullNo
sent_atstring or nullNo
paid_atstring or nullNo
voided_atstring or nullNo
actionsobjectNoWhat can be done now.
eventsarray of objectNoHistory (detail only).
paymentsarray of objectNoPayments made for it, by OnCharge reference (detail only).
payments[].payment_referencestringNo
payments[].session_idstringNo
payments[].amountintegerNo
payments[].currencystringNo
payments[].statusstringNo
payments[].railone of card, cryptoNo
credit_notesarray of objectNoCredit notes issued against it (detail only).
payment_optionsarray of objectNoHow the customer can pay it now, and why a rail is off (detail only).
payment_options[].railstringNo
payment_options[].availablebooleanNo
payment_options[].reasonstring or nullNo
idempotentbooleanNo
email_errorstringNoFinalized, but the email could not be sent.
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "invoice",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "number": "string",
  "status": "draft",
  "display_status": "draft",
  "status_label": "string",
  "currency": "string",
  "currency_digits": 0,
  "customer": {
    "name": "string",
    "email": "string",
    "address": {
      "line1": "string",
      "line2": "string",
      "city": "string",
      "state": "string",
      "postal_code": "string",
      "country": "string"
    }
  },
  "shipping_address": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postal_code": "string",
    "country": "string"
  },
  "lines": [
    {
      "description": "string",
      "quantity": 0,
      "unit_amount": 0,
      "tax_rate": 0,
      "amount": 0,
      "tax_amount": 0,
      "requires_shipping": true
    }
  ],
  "subtotal": 0,
  "tax": 0,
  "total": 0,
  "amount_paid": 0,
  "amount_credited": 0,
  "amount_remaining": 0,
  "memo": "string",
  "footer": "string",
  "reply_to": "string",
  "days_until_due": 0,
  "due_at": "2026-01-01T00:00:00.000Z",
  "send_reminders": true,
  "metadata": {},
  "hosted_url": "string",
  "paid_out_of_band": true,
  "payment_reference": "string",
  "credit_note_for": {
    "id": "string",
    "number": "string"
  },
  "credit_reason": "string",
  "source": "dashboard",
  "created_at": "2026-01-01T00:00:00.000Z",
  "finalized_at": "string",
  "sent_at": "string",
  "paid_at": "string",
  "voided_at": "string",
  "actions": {},
  "events": [
    {}
  ],
  "payments": [
    {
      "payment_reference": "string",
      "session_id": "string",
      "amount": 0,
      "currency": "string",
      "status": "string",
      "rail": "card"
    }
  ],
  "credit_notes": [
    {}
  ],
  "payment_options": [
    {
      "rail": "string",
      "available": true,
      "reason": "string"
    }
  ],
  "idempotent": true,
  "email_error": "string"
}
StatusMeaning
200The invoice.
404not_found: the object does not exist or belongs to another store.
409invoice_locked: a finalized invoice cannot be edited; invoice_not_draft, invalid_transition or invoice_partly_paid: not possible in its status; payment_in_progress: a payment for the invoice is under way (try again in a few minutes); store_inactive: the store is not taking payments.
422invoice_incomplete.

Email an open invoice#

HTTP
POST /api/v1/invoices/{invoice_id}/send

Emails the invoice (again) to the customer with its PDF attached and the payment link. Needs the customer's email.

ParameterInTypeRequiredDescription
invoice_idpathstring (uuid)YesThe invoice (or credit note) id.

No request body. Sign it as an empty body.

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
objectone of invoice, credit_noteYes
store_idstring (uuid)No
numberstring or nullNoINV-0001 (credit notes CN-0001), per store, given at finalize; null on a draft.
statusone of draft, open, paid, void, issuedYesissued is a credit note's.
display_statusone of draft, open, overdue, paid, void, issuedNo
status_labelstringNo
currencystringYes
currency_digitsintegerNo
customerobjectNo
customer.namestring or nullNo
customer.emailstring or nullNo
customer.addressobject or nullNo
shipping_addressobject or nullNo
linesarray of objectYes
lines[].descriptionstringNo
lines[].quantityintegerNo
lines[].unit_amountintegerNo
lines[].tax_ratenumberNo
lines[].amountintegerNo
lines[].tax_amountintegerNo
lines[].requires_shippingbooleanNo
subtotalintegerNo
taxintegerNo
totalintegerYes
amount_paidintegerNo
amount_creditedintegerNo
amount_remainingintegerYes
memostring or nullNo
footerstring or nullNo
reply_tostring or nullNo
days_until_dueintegerNo
due_atstring (date-time) or nullNo
send_remindersbooleanNo
metadataobjectNo
hosted_urlstring or nullNoThe hosted invoice page the customer pays on (once finalized).
paid_out_of_bandbooleanNo
payment_referencestring or nullNoThe OnCharge reference (ocpay_…) of the payment that paid it.
credit_note_forobject or nullNo
credit_note_for.idstringNo
credit_note_for.numberstring or nullNo
credit_reasonstring or nullNo
sourceone of dashboard, apiNo
created_atstring (date-time)No
finalized_atstring or nullNo
sent_atstring or nullNo
paid_atstring or nullNo
voided_atstring or nullNo
actionsobjectNoWhat can be done now.
eventsarray of objectNoHistory (detail only).
paymentsarray of objectNoPayments made for it, by OnCharge reference (detail only).
payments[].payment_referencestringNo
payments[].session_idstringNo
payments[].amountintegerNo
payments[].currencystringNo
payments[].statusstringNo
payments[].railone of card, cryptoNo
credit_notesarray of objectNoCredit notes issued against it (detail only).
payment_optionsarray of objectNoHow the customer can pay it now, and why a rail is off (detail only).
payment_options[].railstringNo
payment_options[].availablebooleanNo
payment_options[].reasonstring or nullNo
idempotentbooleanNo
email_errorstringNoFinalized, but the email could not be sent.
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "invoice",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "number": "string",
  "status": "draft",
  "display_status": "draft",
  "status_label": "string",
  "currency": "string",
  "currency_digits": 0,
  "customer": {
    "name": "string",
    "email": "string",
    "address": {
      "line1": "string",
      "line2": "string",
      "city": "string",
      "state": "string",
      "postal_code": "string",
      "country": "string"
    }
  },
  "shipping_address": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postal_code": "string",
    "country": "string"
  },
  "lines": [
    {
      "description": "string",
      "quantity": 0,
      "unit_amount": 0,
      "tax_rate": 0,
      "amount": 0,
      "tax_amount": 0,
      "requires_shipping": true
    }
  ],
  "subtotal": 0,
  "tax": 0,
  "total": 0,
  "amount_paid": 0,
  "amount_credited": 0,
  "amount_remaining": 0,
  "memo": "string",
  "footer": "string",
  "reply_to": "string",
  "days_until_due": 0,
  "due_at": "2026-01-01T00:00:00.000Z",
  "send_reminders": true,
  "metadata": {},
  "hosted_url": "string",
  "paid_out_of_band": true,
  "payment_reference": "string",
  "credit_note_for": {
    "id": "string",
    "number": "string"
  },
  "credit_reason": "string",
  "source": "dashboard",
  "created_at": "2026-01-01T00:00:00.000Z",
  "finalized_at": "string",
  "sent_at": "string",
  "paid_at": "string",
  "voided_at": "string",
  "actions": {},
  "events": [
    {}
  ],
  "payments": [
    {
      "payment_reference": "string",
      "session_id": "string",
      "amount": 0,
      "currency": "string",
      "status": "string",
      "rail": "card"
    }
  ],
  "credit_notes": [
    {}
  ],
  "payment_options": [
    {
      "rail": "string",
      "available": true,
      "reason": "string"
    }
  ],
  "idempotent": true,
  "email_error": "string"
}
StatusMeaning
200The invoice.
404not_found: the object does not exist or belongs to another store.
409invoice_locked: a finalized invoice cannot be edited; invoice_not_draft, invalid_transition or invoice_partly_paid: not possible in its status; payment_in_progress: a payment for the invoice is under way (try again in a few minutes); store_inactive: the store is not taking payments.
422invoice_incomplete: no customer email.
502email_failed: try again, or share hosted_url.

Void an open invoice#

HTTP
POST /api/v1/invoices/{invoice_id}/void

Cancels an open invoice nothing was paid on. Checkouts not yet started for it are closed; a payment already under way that completes is recorded on the invoice's history for you to refund.

ParameterInTypeRequiredDescription
invoice_idpathstring (uuid)YesThe invoice (or credit note) id.

Request body (application/json)

FieldTypeRequiredDescription
reasonstring or null (max 500 chars)No
Request
{
  "reason": "string"
}

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
objectone of invoice, credit_noteYes
store_idstring (uuid)No
numberstring or nullNoINV-0001 (credit notes CN-0001), per store, given at finalize; null on a draft.
statusone of draft, open, paid, void, issuedYesissued is a credit note's.
display_statusone of draft, open, overdue, paid, void, issuedNo
status_labelstringNo
currencystringYes
currency_digitsintegerNo
customerobjectNo
customer.namestring or nullNo
customer.emailstring or nullNo
customer.addressobject or nullNo
shipping_addressobject or nullNo
linesarray of objectYes
lines[].descriptionstringNo
lines[].quantityintegerNo
lines[].unit_amountintegerNo
lines[].tax_ratenumberNo
lines[].amountintegerNo
lines[].tax_amountintegerNo
lines[].requires_shippingbooleanNo
subtotalintegerNo
taxintegerNo
totalintegerYes
amount_paidintegerNo
amount_creditedintegerNo
amount_remainingintegerYes
memostring or nullNo
footerstring or nullNo
reply_tostring or nullNo
days_until_dueintegerNo
due_atstring (date-time) or nullNo
send_remindersbooleanNo
metadataobjectNo
hosted_urlstring or nullNoThe hosted invoice page the customer pays on (once finalized).
paid_out_of_bandbooleanNo
payment_referencestring or nullNoThe OnCharge reference (ocpay_…) of the payment that paid it.
credit_note_forobject or nullNo
credit_note_for.idstringNo
credit_note_for.numberstring or nullNo
credit_reasonstring or nullNo
sourceone of dashboard, apiNo
created_atstring (date-time)No
finalized_atstring or nullNo
sent_atstring or nullNo
paid_atstring or nullNo
voided_atstring or nullNo
actionsobjectNoWhat can be done now.
eventsarray of objectNoHistory (detail only).
paymentsarray of objectNoPayments made for it, by OnCharge reference (detail only).
payments[].payment_referencestringNo
payments[].session_idstringNo
payments[].amountintegerNo
payments[].currencystringNo
payments[].statusstringNo
payments[].railone of card, cryptoNo
credit_notesarray of objectNoCredit notes issued against it (detail only).
payment_optionsarray of objectNoHow the customer can pay it now, and why a rail is off (detail only).
payment_options[].railstringNo
payment_options[].availablebooleanNo
payment_options[].reasonstring or nullNo
idempotentbooleanNo
email_errorstringNoFinalized, but the email could not be sent.
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "invoice",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "number": "string",
  "status": "draft",
  "display_status": "draft",
  "status_label": "string",
  "currency": "string",
  "currency_digits": 0,
  "customer": {
    "name": "string",
    "email": "string",
    "address": {
      "line1": "string",
      "line2": "string",
      "city": "string",
      "state": "string",
      "postal_code": "string",
      "country": "string"
    }
  },
  "shipping_address": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postal_code": "string",
    "country": "string"
  },
  "lines": [
    {
      "description": "string",
      "quantity": 0,
      "unit_amount": 0,
      "tax_rate": 0,
      "amount": 0,
      "tax_amount": 0,
      "requires_shipping": true
    }
  ],
  "subtotal": 0,
  "tax": 0,
  "total": 0,
  "amount_paid": 0,
  "amount_credited": 0,
  "amount_remaining": 0,
  "memo": "string",
  "footer": "string",
  "reply_to": "string",
  "days_until_due": 0,
  "due_at": "2026-01-01T00:00:00.000Z",
  "send_reminders": true,
  "metadata": {},
  "hosted_url": "string",
  "paid_out_of_band": true,
  "payment_reference": "string",
  "credit_note_for": {
    "id": "string",
    "number": "string"
  },
  "credit_reason": "string",
  "source": "dashboard",
  "created_at": "2026-01-01T00:00:00.000Z",
  "finalized_at": "string",
  "sent_at": "string",
  "paid_at": "string",
  "voided_at": "string",
  "actions": {},
  "events": [
    {}
  ],
  "payments": [
    {
      "payment_reference": "string",
      "session_id": "string",
      "amount": 0,
      "currency": "string",
      "status": "string",
      "rail": "card"
    }
  ],
  "credit_notes": [
    {}
  ],
  "payment_options": [
    {
      "rail": "string",
      "available": true,
      "reason": "string"
    }
  ],
  "idempotent": true,
  "email_error": "string"
}
StatusMeaning
200The invoice.
404not_found: the object does not exist or belongs to another store.
409invoice_locked: a finalized invoice cannot be edited; invoice_not_draft, invalid_transition or invoice_partly_paid: not possible in its status; payment_in_progress: a payment for the invoice is under way (try again in a few minutes); store_inactive: the store is not taking payments.

Mark an invoice paid outside OnCharge#

HTTP
POST /api/v1/invoices/{invoice_id}/mark-paid

Records what is left to pay as paid by bank transfer, cash or cheque. The payment link stops working.

ParameterInTypeRequiredDescription
invoice_idpathstring (uuid)YesThe invoice (or credit note) id.

Request body (application/json)

FieldTypeRequiredDescription
notestring or null (max 500 chars)No
Request
{
  "note": "string"
}

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
objectone of invoice, credit_noteYes
store_idstring (uuid)No
numberstring or nullNoINV-0001 (credit notes CN-0001), per store, given at finalize; null on a draft.
statusone of draft, open, paid, void, issuedYesissued is a credit note's.
display_statusone of draft, open, overdue, paid, void, issuedNo
status_labelstringNo
currencystringYes
currency_digitsintegerNo
customerobjectNo
customer.namestring or nullNo
customer.emailstring or nullNo
customer.addressobject or nullNo
shipping_addressobject or nullNo
linesarray of objectYes
lines[].descriptionstringNo
lines[].quantityintegerNo
lines[].unit_amountintegerNo
lines[].tax_ratenumberNo
lines[].amountintegerNo
lines[].tax_amountintegerNo
lines[].requires_shippingbooleanNo
subtotalintegerNo
taxintegerNo
totalintegerYes
amount_paidintegerNo
amount_creditedintegerNo
amount_remainingintegerYes
memostring or nullNo
footerstring or nullNo
reply_tostring or nullNo
days_until_dueintegerNo
due_atstring (date-time) or nullNo
send_remindersbooleanNo
metadataobjectNo
hosted_urlstring or nullNoThe hosted invoice page the customer pays on (once finalized).
paid_out_of_bandbooleanNo
payment_referencestring or nullNoThe OnCharge reference (ocpay_…) of the payment that paid it.
credit_note_forobject or nullNo
credit_note_for.idstringNo
credit_note_for.numberstring or nullNo
credit_reasonstring or nullNo
sourceone of dashboard, apiNo
created_atstring (date-time)No
finalized_atstring or nullNo
sent_atstring or nullNo
paid_atstring or nullNo
voided_atstring or nullNo
actionsobjectNoWhat can be done now.
eventsarray of objectNoHistory (detail only).
paymentsarray of objectNoPayments made for it, by OnCharge reference (detail only).
payments[].payment_referencestringNo
payments[].session_idstringNo
payments[].amountintegerNo
payments[].currencystringNo
payments[].statusstringNo
payments[].railone of card, cryptoNo
credit_notesarray of objectNoCredit notes issued against it (detail only).
payment_optionsarray of objectNoHow the customer can pay it now, and why a rail is off (detail only).
payment_options[].railstringNo
payment_options[].availablebooleanNo
payment_options[].reasonstring or nullNo
idempotentbooleanNo
email_errorstringNoFinalized, but the email could not be sent.
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "invoice",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "number": "string",
  "status": "draft",
  "display_status": "draft",
  "status_label": "string",
  "currency": "string",
  "currency_digits": 0,
  "customer": {
    "name": "string",
    "email": "string",
    "address": {
      "line1": "string",
      "line2": "string",
      "city": "string",
      "state": "string",
      "postal_code": "string",
      "country": "string"
    }
  },
  "shipping_address": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postal_code": "string",
    "country": "string"
  },
  "lines": [
    {
      "description": "string",
      "quantity": 0,
      "unit_amount": 0,
      "tax_rate": 0,
      "amount": 0,
      "tax_amount": 0,
      "requires_shipping": true
    }
  ],
  "subtotal": 0,
  "tax": 0,
  "total": 0,
  "amount_paid": 0,
  "amount_credited": 0,
  "amount_remaining": 0,
  "memo": "string",
  "footer": "string",
  "reply_to": "string",
  "days_until_due": 0,
  "due_at": "2026-01-01T00:00:00.000Z",
  "send_reminders": true,
  "metadata": {},
  "hosted_url": "string",
  "paid_out_of_band": true,
  "payment_reference": "string",
  "credit_note_for": {
    "id": "string",
    "number": "string"
  },
  "credit_reason": "string",
  "source": "dashboard",
  "created_at": "2026-01-01T00:00:00.000Z",
  "finalized_at": "string",
  "sent_at": "string",
  "paid_at": "string",
  "voided_at": "string",
  "actions": {},
  "events": [
    {}
  ],
  "payments": [
    {
      "payment_reference": "string",
      "session_id": "string",
      "amount": 0,
      "currency": "string",
      "status": "string",
      "rail": "card"
    }
  ],
  "credit_notes": [
    {}
  ],
  "payment_options": [
    {
      "rail": "string",
      "available": true,
      "reason": "string"
    }
  ],
  "idempotent": true,
  "email_error": "string"
}
StatusMeaning
200The invoice.
404not_found: the object does not exist or belongs to another store.
409invoice_locked: a finalized invoice cannot be edited; invoice_not_draft, invalid_transition or invoice_partly_paid: not possible in its status; payment_in_progress: a payment for the invoice is under way (try again in a few minutes); store_inactive: the store is not taking payments.

Issue a credit note#

HTTP
POST /api/v1/invoices/{invoice_id}/credit-notes

A numbered credit note (CN-0001) against an open or paid invoice. On an open invoice it lowers what is left to pay (a credit for all of it settles the invoice); on a paid one it records a credit, and with refund (only for an invoice paid through OnCharge) also refunds it to the customer's payment. The customer is emailed the note.

ParameterInTypeRequiredDescription
invoice_idpathstring (uuid)YesThe invoice (or credit note) id.
Idempotency-KeyheaderstringNoA unique key (up to 255 characters is safe) that makes retries of this request safe.

Request body (application/json)

FieldTypeRequiredDescription
amountinteger (≥ 1)NoOne credit line of this many minor units.
linesarray of object (≥ 1 items, ≤ 100 items)No
lines[].descriptionstringYes
lines[].quantityintegerNoDefault 1.
lines[].unit_amountinteger (≥ 1)Yes
lines[].tax_ratenumber or stringNo
reasonone of duplicate, fraudulent, order_change, product_unsatisfactory, otherNoDefault "other".
memostring or null (max 2000 chars)No
refundbooleanNoOn an invoice paid through OnCharge, also refund the credit to the customer's payment. Default false.
Request
{
  "amount": 5000,
  "reason": "order_change",
  "memo": "Two hours fewer than quoted."
}

Response 201

FieldTypeAlways presentDescription
idstring (uuid)Yes
objectone of invoice, credit_noteYes
store_idstring (uuid)No
numberstring or nullNoINV-0001 (credit notes CN-0001), per store, given at finalize; null on a draft.
statusone of draft, open, paid, void, issuedYesissued is a credit note's.
display_statusone of draft, open, overdue, paid, void, issuedNo
status_labelstringNo
currencystringYes
currency_digitsintegerNo
customerobjectNo
customer.namestring or nullNo
customer.emailstring or nullNo
customer.addressobject or nullNo
shipping_addressobject or nullNo
linesarray of objectYes
lines[].descriptionstringNo
lines[].quantityintegerNo
lines[].unit_amountintegerNo
lines[].tax_ratenumberNo
lines[].amountintegerNo
lines[].tax_amountintegerNo
lines[].requires_shippingbooleanNo
subtotalintegerNo
taxintegerNo
totalintegerYes
amount_paidintegerNo
amount_creditedintegerNo
amount_remainingintegerYes
memostring or nullNo
footerstring or nullNo
reply_tostring or nullNo
days_until_dueintegerNo
due_atstring (date-time) or nullNo
send_remindersbooleanNo
metadataobjectNo
hosted_urlstring or nullNoThe hosted invoice page the customer pays on (once finalized).
paid_out_of_bandbooleanNo
payment_referencestring or nullNoThe OnCharge reference (ocpay_…) of the payment that paid it.
credit_note_forobject or nullNo
credit_note_for.idstringNo
credit_note_for.numberstring or nullNo
credit_reasonstring or nullNo
sourceone of dashboard, apiNo
created_atstring (date-time)No
finalized_atstring or nullNo
sent_atstring or nullNo
paid_atstring or nullNo
voided_atstring or nullNo
actionsobjectNoWhat can be done now.
eventsarray of objectNoHistory (detail only).
paymentsarray of objectNoPayments made for it, by OnCharge reference (detail only).
payments[].payment_referencestringNo
payments[].session_idstringNo
payments[].amountintegerNo
payments[].currencystringNo
payments[].statusstringNo
payments[].railone of card, cryptoNo
credit_notesarray of objectNoCredit notes issued against it (detail only).
payment_optionsarray of objectNoHow the customer can pay it now, and why a rail is off (detail only).
payment_options[].railstringNo
payment_options[].availablebooleanNo
payment_options[].reasonstring or nullNo
idempotentbooleanNo
email_errorstringNoFinalized, but the email could not be sent.
refundobjectNo
refund.okbooleanNo
refund.statusstringNo
refund.amountintegerNo
refund.messagestringNo
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "invoice",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "number": "string",
  "status": "draft",
  "display_status": "draft",
  "status_label": "string",
  "currency": "string",
  "currency_digits": 0,
  "customer": {
    "name": "string",
    "email": "string",
    "address": {
      "line1": "string",
      "line2": "string",
      "city": "string",
      "state": "string",
      "postal_code": "string",
      "country": "string"
    }
  },
  "shipping_address": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postal_code": "string",
    "country": "string"
  },
  "lines": [
    {
      "description": "string",
      "quantity": 0,
      "unit_amount": 0,
      "tax_rate": 0,
      "amount": 0,
      "tax_amount": 0,
      "requires_shipping": true
    }
  ],
  "subtotal": 0,
  "tax": 0,
  "total": 0,
  "amount_paid": 0,
  "amount_credited": 0,
  "amount_remaining": 0,
  "memo": "string",
  "footer": "string",
  "reply_to": "string",
  "days_until_due": 0,
  "due_at": "2026-01-01T00:00:00.000Z",
  "send_reminders": true,
  "metadata": {},
  "hosted_url": "string",
  "paid_out_of_band": true,
  "payment_reference": "string",
  "credit_note_for": {
    "id": "string",
    "number": "string"
  },
  "credit_reason": "string",
  "source": "dashboard",
  "created_at": "2026-01-01T00:00:00.000Z",
  "finalized_at": "string",
  "sent_at": "string",
  "paid_at": "string",
  "voided_at": "string",
  "actions": {},
  "events": [
    {}
  ],
  "payments": [
    {
      "payment_reference": "string",
      "session_id": "string",
      "amount": 0,
      "currency": "string",
      "status": "string",
      "rail": "card"
    }
  ],
  "credit_notes": [
    {}
  ],
  "payment_options": [
    {
      "rail": "string",
      "available": true,
      "reason": "string"
    }
  ],
  "idempotent": true,
  "email_error": "string",
  "refund": {
    "ok": true,
    "status": "string",
    "amount": 0,
    "message": "string"
  }
}
StatusMeaning
200Idempotent replay.
201The credit note (with refund when one was asked for).
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.
409invoice_locked: a finalized invoice cannot be edited; invoice_not_draft, invalid_transition or invoice_partly_paid: not possible in its status; payment_in_progress: a payment for the invoice is under way (try again in a few minutes); store_inactive: the store is not taking payments.
422credit_too_large: more than is left to pay (or, once paid, than the invoice).

Download an invoice PDF#

HTTP
GET /api/v1/invoices/{invoice_id}/pdf

The invoice or credit note as a PDF.

ParameterInTypeRequiredDescription
invoice_idpathstring (uuid)YesThe invoice (or credit note) id.
StatusMeaning
200The PDF.
404not_found: the object does not exist or belongs to another store.

Refund an extra payment#

HTTP
POST /api/v1/invoices/{invoice_id}/refund-extra

Refunds what a payment paid beyond what the invoice took: a payment for an invoice that was already settled, voided or credited, or the part of one over what was left to pay. Such payments show in the invoice's history as payment_unapplied and the merchant is told. Refunded at most once per payment.

ParameterInTypeRequiredDescription
invoice_idpathstring (uuid)YesThe invoice (or credit note) id.

Request body (application/json)

FieldTypeRequiredDescription
payment_referencestringYesThe payment's OnCharge reference (ocpay_…).
Request
{
  "payment_reference": "ocpay_3f2a9c1e0b7d4e6f8a1b2c3d4e5f6a7b"
}

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
objectone of invoice, credit_noteYes
store_idstring (uuid)No
numberstring or nullNoINV-0001 (credit notes CN-0001), per store, given at finalize; null on a draft.
statusone of draft, open, paid, void, issuedYesissued is a credit note's.
display_statusone of draft, open, overdue, paid, void, issuedNo
status_labelstringNo
currencystringYes
currency_digitsintegerNo
customerobjectNo
customer.namestring or nullNo
customer.emailstring or nullNo
customer.addressobject or nullNo
shipping_addressobject or nullNo
linesarray of objectYes
lines[].descriptionstringNo
lines[].quantityintegerNo
lines[].unit_amountintegerNo
lines[].tax_ratenumberNo
lines[].amountintegerNo
lines[].tax_amountintegerNo
lines[].requires_shippingbooleanNo
subtotalintegerNo
taxintegerNo
totalintegerYes
amount_paidintegerNo
amount_creditedintegerNo
amount_remainingintegerYes
memostring or nullNo
footerstring or nullNo
reply_tostring or nullNo
days_until_dueintegerNo
due_atstring (date-time) or nullNo
send_remindersbooleanNo
metadataobjectNo
hosted_urlstring or nullNoThe hosted invoice page the customer pays on (once finalized).
paid_out_of_bandbooleanNo
payment_referencestring or nullNoThe OnCharge reference (ocpay_…) of the payment that paid it.
credit_note_forobject or nullNo
credit_note_for.idstringNo
credit_note_for.numberstring or nullNo
credit_reasonstring or nullNo
sourceone of dashboard, apiNo
created_atstring (date-time)No
finalized_atstring or nullNo
sent_atstring or nullNo
paid_atstring or nullNo
voided_atstring or nullNo
actionsobjectNoWhat can be done now.
eventsarray of objectNoHistory (detail only).
paymentsarray of objectNoPayments made for it, by OnCharge reference (detail only).
payments[].payment_referencestringNo
payments[].session_idstringNo
payments[].amountintegerNo
payments[].currencystringNo
payments[].statusstringNo
payments[].railone of card, cryptoNo
credit_notesarray of objectNoCredit notes issued against it (detail only).
payment_optionsarray of objectNoHow the customer can pay it now, and why a rail is off (detail only).
payment_options[].railstringNo
payment_options[].availablebooleanNo
payment_options[].reasonstring or nullNo
idempotentbooleanNo
email_errorstringNoFinalized, but the email could not be sent.
Response
{
  "id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "object": "invoice",
  "store_id": "8b0f6f2e-4d1a-4c4e-9a52-6f3e1d2c7b11",
  "number": "string",
  "status": "draft",
  "display_status": "draft",
  "status_label": "string",
  "currency": "string",
  "currency_digits": 0,
  "customer": {
    "name": "string",
    "email": "string",
    "address": {
      "line1": "string",
      "line2": "string",
      "city": "string",
      "state": "string",
      "postal_code": "string",
      "country": "string"
    }
  },
  "shipping_address": {
    "line1": "string",
    "line2": "string",
    "city": "string",
    "state": "string",
    "postal_code": "string",
    "country": "string"
  },
  "lines": [
    {
      "description": "string",
      "quantity": 0,
      "unit_amount": 0,
      "tax_rate": 0,
      "amount": 0,
      "tax_amount": 0,
      "requires_shipping": true
    }
  ],
  "subtotal": 0,
  "tax": 0,
  "total": 0,
  "amount_paid": 0,
  "amount_credited": 0,
  "amount_remaining": 0,
  "memo": "string",
  "footer": "string",
  "reply_to": "string",
  "days_until_due": 0,
  "due_at": "2026-01-01T00:00:00.000Z",
  "send_reminders": true,
  "metadata": {},
  "hosted_url": "string",
  "paid_out_of_band": true,
  "payment_reference": "string",
  "credit_note_for": {
    "id": "string",
    "number": "string"
  },
  "credit_reason": "string",
  "source": "dashboard",
  "created_at": "2026-01-01T00:00:00.000Z",
  "finalized_at": "string",
  "sent_at": "string",
  "paid_at": "string",
  "voided_at": "string",
  "actions": {},
  "events": [
    {}
  ],
  "payments": [
    {
      "payment_reference": "string",
      "session_id": "string",
      "amount": 0,
      "currency": "string",
      "status": "string",
      "rail": "card"
    }
  ],
  "credit_notes": [
    {}
  ],
  "payment_options": [
    {
      "rail": "string",
      "available": true,
      "reason": "string"
    }
  ],
  "idempotent": true,
  "email_error": "string"
}
StatusMeaning
200The invoice, with refund.
400validation_error (the message lists each invalid field) or invalid_json.
404not_found: the object does not exist or belongs to another store.
409refund_failed: the refund could not be made.

Subscriptions#

Recurring billing: plans and add-ons, and subscriptions on them. Each period is an OnCharge invoice charged to the customer's card saved at your store; customers sign up and agree to the recurring charges on OnCharge's own pages. Subscriptions are not available yet: until they are turned on, every endpoint here answers 404 not_found.

List plans#

HTTP
GET /api/v1/plans

Your store's plans and add-ons, newest first (at most 200). Archived ones only with include_archived=true.

ParameterInTypeRequiredDescription
include_archivedquerybooleanNoAlso list archived plans.

Response 200

FieldTypeAlways presentDescription
dataarray of objectYesNewest first, at most 200.
data[].idstring (uuid)Yes
data[].objectone of plan, addonYes
data[].store_idstring (uuid)Yes
data[].namestringYes
data[].descriptionstring or nullYes
data[].amountintegerYesPer period (per unit), minor units.
data[].currencystringYes
data[].intervalone of day, week, month, year or nullYesNull for an add-on.
data[].interval_countinteger or nullYes
data[].interval_textstring or nullYesThe period in words: month, 3 months. Null for an add-on.
data[].trial_daysintegerYes
data[].introobject or nullYesThe intro price per period (amount) for the first periods periods.
data[].requires_shippingbooleanYes
data[].activebooleanYesFalse once archived.
data[].metadataobjectYes
data[].created_atstring (date-time)Yes
Response
{
  "data": [
    {
      "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
      "object": "plan",
      "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
      "name": "Monthly box",
      "description": "A box of our best sellers, every month.",
      "amount": 3000,
      "currency": "USD",
      "interval": "month",
      "interval_count": 1,
      "interval_text": "month",
      "trial_days": 14,
      "intro": {
        "amount": 1500,
        "periods": 2
      },
      "requires_shipping": true,
      "active": true,
      "metadata": {},
      "created_at": "2026-12-01T00:00:00.000Z"
    }
  ]
}
StatusMeaning
200The plans.
404not_found: subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).

Create a plan or add-on#

HTTP
POST /api/v1/plans

A plan: a price every interval_count intervals (a period is at most a year), with an optional free trial and intro price. Or an add-on (kind: "addon"): billed with the plan it is added to, in the same periods. A plan's price and terms never change once created: create another plan and move subscriptions to it with change. A repeat with the same Idempotency-Key returns the first plan (200).

ParameterInTypeRequiredDescription
Idempotency-KeyheaderstringNoA unique key (up to 255 characters is safe) that makes retries of this request safe.

Request body (application/json)

FieldTypeRequiredDescription
kindone of plan, addonNoaddon: no interval, trial or intro of its own; it is billed with the plan it is added to. Default "plan".
namestring (min 1 chars, max 120 chars)Yes
descriptionstring or null (max 1000 chars)No
amountinteger (≥ 1, ≤ 99999999)YesPer period (per unit), minor units.
currencystringNoISO 4217. Add-ons must be in their plan's currency. Default "USD".
intervalone of day, week, month, yearNoRequired for a plan.
interval_countinteger (≥ 1, ≤ 365)NoIntervals per period, up to one year: at most 365 days, 52 weeks, 12 months or 1 year. Default 1.
trial_daysinteger (≥ 0, ≤ 365)NoA free trial before the first charge: 0 (none) or at least 7 days, so the customer can be reminded 7 days before it ends. Plans only. Default 0.
introobject or nullNoA lower price for the first periods: { "amount": 1500, "periods": 2 }. Plans only.
requires_shippingbooleanNoEach period ships, needs a shipping address and is paid out after carrier-confirmed delivery. On a store that ships physical goods every period ships anyway. Default false.
metadataobjectNoYour own key-value pairs: at most 20 keys of letters, digits, _, . and - (up to 40 characters), each value up to 500 characters.
Request
{
  "name": "Monthly box",
  "description": "A box of our best sellers, every month.",
  "amount": 3000,
  "currency": "USD",
  "interval": "month",
  "trial_days": 14,
  "intro": {
    "amount": 1500,
    "periods": 2
  },
  "requires_shipping": true
}

Response 201

FieldTypeAlways presentDescription
idstring (uuid)Yes
objectone of plan, addonYes
store_idstring (uuid)Yes
namestringYes
descriptionstring or nullYes
amountintegerYesPer period (per unit), minor units.
currencystringYes
intervalone of day, week, month, year or nullYesNull for an add-on.
interval_countinteger or nullYes
interval_textstring or nullYesThe period in words: month, 3 months. Null for an add-on.
trial_daysintegerYes
introobject or nullYesThe intro price per period (amount) for the first periods periods.
requires_shippingbooleanYes
activebooleanYesFalse once archived.
metadataobjectYes
created_atstring (date-time)Yes
Response
{
  "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "object": "plan",
  "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "name": "Monthly box",
  "description": "A box of our best sellers, every month.",
  "amount": 3000,
  "currency": "USD",
  "interval": "month",
  "interval_count": 1,
  "interval_text": "month",
  "trial_days": 14,
  "intro": {
    "amount": 1500,
    "periods": 2
  },
  "requires_shipping": true,
  "active": true,
  "metadata": {},
  "created_at": "2026-12-01T00:00:00.000Z"
}
StatusMeaning
200Idempotent replay.
201Created.
400invalid_request: the message names the first invalid field (an intro price must be lower than the plan's price); invalid_json: the body is not JSON; invalid_idempotency_key: the Idempotency-Key is longer than 255 characters or has control characters.
404store_not_found; not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).

Retrieve a plan#

HTTP
GET /api/v1/plans/{plan_id}
ParameterInTypeRequiredDescription
plan_idpathstring (uuid)YesA plan or add-on of your store.

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
objectone of plan, addonYes
store_idstring (uuid)Yes
namestringYes
descriptionstring or nullYes
amountintegerYesPer period (per unit), minor units.
currencystringYes
intervalone of day, week, month, year or nullYesNull for an add-on.
interval_countinteger or nullYes
interval_textstring or nullYesThe period in words: month, 3 months. Null for an add-on.
trial_daysintegerYes
introobject or nullYesThe intro price per period (amount) for the first periods periods.
requires_shippingbooleanYes
activebooleanYesFalse once archived.
metadataobjectYes
created_atstring (date-time)Yes
Response
{
  "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "object": "plan",
  "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "name": "Monthly box",
  "description": "A box of our best sellers, every month.",
  "amount": 3000,
  "currency": "USD",
  "interval": "month",
  "interval_count": 1,
  "interval_text": "month",
  "trial_days": 14,
  "intro": {
    "amount": 1500,
    "periods": 2
  },
  "requires_shipping": true,
  "active": true,
  "metadata": {},
  "created_at": "2026-12-01T00:00:00.000Z"
}
StatusMeaning
200The plan or add-on.
404plan_not_found: no such plan in your store; not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).

Update or archive a plan#

HTTP
PATCH /api/v1/plans/{plan_id}

Its name, description or metadata, or archive it with active: false (subscriptions already on it go on; it takes no new ones). The price and terms cannot change. Signed like any request, with PATCH as the method.

ParameterInTypeRequiredDescription
plan_idpathstring (uuid)YesA plan or add-on of your store.

Request body (application/json)

FieldTypeRequiredDescription
namestring (min 1 chars, max 120 chars)No
descriptionstring or null (max 1000 chars)No
activebooleanNofalse archives the plan: it takes no new subscriptions, and those already on it go on. true brings it back.
metadataobjectNoYour own key-value pairs: at most 20 keys of letters, digits, _, . and - (up to 40 characters), each value up to 500 characters.
Request
{
  "active": false
}

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
objectone of plan, addonYes
store_idstring (uuid)Yes
namestringYes
descriptionstring or nullYes
amountintegerYesPer period (per unit), minor units.
currencystringYes
intervalone of day, week, month, year or nullYesNull for an add-on.
interval_countinteger or nullYes
interval_textstring or nullYesThe period in words: month, 3 months. Null for an add-on.
trial_daysintegerYes
introobject or nullYesThe intro price per period (amount) for the first periods periods.
requires_shippingbooleanYes
activebooleanYesFalse once archived.
metadataobjectYes
created_atstring (date-time)Yes
Response
{
  "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "object": "plan",
  "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "name": "Monthly box",
  "description": "A box of our best sellers, every month.",
  "amount": 3000,
  "currency": "USD",
  "interval": "month",
  "interval_count": 1,
  "interval_text": "month",
  "trial_days": 14,
  "intro": {
    "amount": 1500,
    "periods": 2
  },
  "requires_shipping": true,
  "active": true,
  "metadata": {},
  "created_at": "2026-12-01T00:00:00.000Z"
}
StatusMeaning
200The plan.
400invalid_request: the message names the first invalid field; invalid_json: the body is not JSON.
404plan_not_found: no such plan in your store; not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).
HTTP
POST /api/v1/plans/{plan_id}/payment-link

A payment link (https://app.oncharge.io/l/<code>) that signs shoppers up to the plan: they enter their email (and their shipping address if the plan ships), then agree to the recurring terms and enter a card on OnCharge's sign-up page. It is one of your payment links: it appears with them, and you turn it off the same way (POST /api/v1/payment-links/{link_id}/deactivate).

ParameterInTypeRequiredDescription
plan_idpathstring (uuid)YesA plan or add-on of your store.

Request body (application/json)

FieldTypeRequiredDescription
titlestring (min 1 chars, max 120 chars)NoWhat the link page shows. Default: the plan's name.
Request
{
  "title": "Join the Monthly box"
}

Response 201

FieldTypeAlways presentDescription
idstring (uuid)Yes
codestringYes
urlstringYesThe link to share: https://app.oncharge.io/l/<code>.
plan_idstring (uuid)Yes
Response
{
  "id": "5f0c9d4e-2a1b-4c3d-9e8f-7a6b5c4d3e2f",
  "code": "k7Hq2mNpR4sT",
  "url": "https://app.oncharge.io/l/k7Hq2mNpR4sT",
  "plan_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
}
StatusMeaning
201The link.
400invalid_request: the message names the first invalid field; invalid_json: the body is not JSON.
404plan_not_found: no such plan (add-ons have no links); not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).
409plan_inactive: the plan is archived.

List subscriptions#

HTTP
GET /api/v1/subscriptions

Your store's subscriptions, newest first.

ParameterInTypeRequiredDescription
statusqueryone of incomplete, incomplete_expired, trialing, active, past_due, paused, canceledNoOnly this status.
customer_idquerystring (uuid)NoOnly this customer's.
limitqueryintegerNo
starting_afterquerystring (uuid)NoThe last id of the previous page.

Response 200

FieldTypeAlways presentDescription
dataarray of objectYes
data[].idstring (uuid)Yes
data[].object"subscription"Yes
data[].store_idstring (uuid)Yes
data[].customer_idstring (uuid)Yes
data[].customerobject or nullYes
data[].customer.emailstring or nullNo
data[].customer.namestring or nullNo
data[].statusone of incomplete, incomplete_expired, trialing, active, past_due, paused, canceledYesincomplete: waiting for the customer to sign up. incomplete_expired: they did not in time. trialing: in its free trial. active: paid up. past_due: a payment failed and is being retried. paused: nothing is charged or shipped. canceled: ended.
data[].status_textstringYesThe status in plain words (Waiting for customer, Past due, …).
data[].planobjectYes
data[].plan.idstring (uuid)Yes
data[].plan.namestringNo
data[].plan.amountintegerNo
data[].plan.currencystringNo
data[].plan.intervalone of day, week, month, year or nullNo
data[].plan.interval_countinteger or nullNo
data[].quantityintegerYes
data[].addonsarray of objectYes
data[].addons[].plan_idstring (uuid)No
data[].addons[].namestring or nullNo
data[].addons[].amountinteger or nullNo
data[].addons[].quantityintegerNo
data[].introobject or nullYesThe intro price this subscription has, taken from its plan when it was created.
data[].payment_methodobject or nullYesThe saved card it is charged to. Null until the customer signs up.
data[].trial_endstring (date-time) or nullYesWhen the free trial ends (the first charge).
data[].current_periodobject or nullYes
data[].current_period.indexintegerNo0 for the first period.
data[].current_period.startstring (date-time) or nullNo
data[].current_period.endstring (date-time) or nullNo
data[].current_period.amountinteger or nullNoWhat this period was billed, minor units.
data[].next_billing_atstring (date-time) or nullYesWhen it is charged next, or resumes; null once ended.
data[].credit_balanceintegerYesCredit from downgrades, taken off the next bills (minor units).
data[].pending_changeobject or nullYesA change that applies at the next period (a price increase: from increase.effective_at).
data[].pending_change.change_idstring (uuid)NoThis change: its notice is for it alone; a newer change is always told again.
data[].pending_change.plan_idstring (uuid)No
data[].pending_change.increaseobject or nullNoSet when the change raises the price: a bigger charge, or a higher price per day when the interval changes. It applies only to the period starting effective_at, with the customer's notice confirmed sent 7 to 30 days before that date. Its date follows the subscription's real schedule (after a pause, from the day it resumes); when that schedule moves, the date moves (version goes up) and the customer is told again.
data[].pending_change.quantityintegerNo
data[].pending_change.addonsarray of objectNo
data[].cancel_at_period_endbooleanYesIt ends when the current period ends.
data[].canceled_atstring (date-time) or nullYesWhen it was cancelled (for a cancellation at the period's end, when it was asked for).
data[].ended_atstring (date-time) or nullYes
data[].cancel_reasonone of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or nullYesdunning: its payment failed on every retry. reminder_undeliverable: the reminder required 7 days before the first charge after a trial could not be emailed for 72 hours, so it ended without being charged.
data[].pauseobject or nullYesA pause waiting for the period's end (at_period_end: true), or under way.
data[].pause.at_period_endbooleanNo
data[].pause.paused_atstring (date-time) or nullNo
data[].pause.resume_atstring (date-time) or nullNoWhen it starts again by itself; null: when you (or the customer) resume it.
data[].pause.reasonone of merchant, customer, api, dunning, or nullNo
data[].shippingobject or nullYes
data[].shipping.namestring or nullNo
data[].shipping.addressobjectNo
data[].sourceone of dashboard, api, payment_link, checkoutYesHow it was started.
data[].payment_link_idstring (uuid) or nullYesThe plan payment link the customer signed up through.
data[].sign_up_expires_atstring (date-time) or nullYesWhile incomplete: when the sign-up link stops working.
data[].metadataobjectYes
data[].created_atstring (date-time)Yes
has_morebooleanYesMore follow: pass the last id as starting_after.
Response
{
  "data": [
    {
      "id": "7e2f9a1c-3b4d-4e5f-8a6b-9c0d1e2f3a4b",
      "object": "subscription",
      "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
      "customer_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
      "customer": {
        "email": "ada@example.com",
        "name": "Ada Lovelace"
      },
      "plan": {
        "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
        "name": "Monthly box",
        "amount": 3000,
        "currency": "USD",
        "interval": "month",
        "interval_count": 1
      },
      "quantity": 1,
      "addons": [],
      "intro": {
        "amount": 1500,
        "periods": 2
      },
      "credit_balance": 0,
      "pending_change": null,
      "cancel_at_period_end": false,
      "canceled_at": null,
      "ended_at": null,
      "cancel_reason": null,
      "pause": null,
      "shipping": {
        "name": "Ada Lovelace",
        "address": {
          "line1": "1 Main St",
          "line2": null,
          "city": "Austin",
          "state": "TX",
          "postal_code": "78701",
          "country": "US"
        }
      },
      "payment_link_id": null,
      "metadata": {},
      "created_at": "2026-12-01T00:00:00.000Z",
      "status": "active",
      "status_text": "Active",
      "payment_method": {
        "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
        "object": "payment_method",
        "type": "card",
        "brand": "Visa",
        "last4": "4242",
        "exp_month": 12,
        "exp_year": 2029,
        "funding": "credit",
        "country": "US",
        "wallet": null,
        "is_default": true,
        "status": "active",
        "expired": false,
        "saved_via": "save_card_page",
        "created_at": "2026-12-01T00:00:00.000Z",
        "last_used_at": "2026-12-15T00:00:00.000Z",
        "updated_by_card_network_at": null,
        "removed_at": null
      },
      "trial_end": "2026-12-15T00:00:00.000Z",
      "current_period": {
        "index": 0,
        "start": "2026-12-15T00:00:00.000Z",
        "end": "2027-01-15T00:00:00.000Z",
        "amount": 1500
      },
      "next_billing_at": "2027-01-15T00:00:00.000Z",
      "source": "api",
      "sign_up_expires_at": null
    }
  ],
  "has_more": true
}
StatusMeaning
200A page of subscriptions.
404not_found: subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).

Start a subscription for a customer#

HTTP
POST /api/v1/subscriptions

For an existing customer of your store. It starts as incomplete: OnCharge emails the customer a link to its sign-up page, where they read the terms, agree to the recurring charges and choose one of their saved cards or add one. It starts when they agree (the trial starts, or the first period is charged). The link is never returned to you, and it works for 7 days; after that the subscription is incomplete_expired. A repeat with the same Idempotency-Key returns the first subscription (200).

ParameterInTypeRequiredDescription
Idempotency-KeyheaderstringNoA unique key (up to 255 characters is safe) that makes retries of this request safe.

Request body (application/json)

FieldTypeRequiredDescription
customer_idstring (uuid)YesAn existing customer of your store. They need an email address: OnCharge emails them the link to confirm.
plan_idstring (uuid)YesAn active plan of your store.
quantityinteger (≥ 1, ≤ 1000)NoDefault 1.
addonsarray of object (≤ 20 items)NoEach add-on listed once.
addons[].plan_idstring (uuid)YesAn add-on of your store (kind: "addon"), in the plan's currency.
addons[].quantityinteger (≥ 1, ≤ 1000)NoDefault 1.
shippingobjectNoRequired when the subscription ships.
shipping.namestring (min 1 chars, max 200 chars)Yes
shipping.line1string (min 1 chars, max 300 chars)Yes
shipping.line2string or null (max 300 chars)No
shipping.citystring (min 1 chars, max 120 chars)Yes
shipping.statestring or null (max 120 chars)No
shipping.postal_codestring (min 1 chars, max 20 chars)Yes
shipping.countrystringYesTwo-letter code (US).
metadataobjectNoYour own key-value pairs: at most 20 keys of letters, digits, _, . and - (up to 40 characters), each value up to 500 characters.
Request
{
  "customer_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "plan_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "quantity": 1,
  "addons": [
    {
      "plan_id": "d2e3f4a5-b6c7-4d8e-9f0a-1b2c3d4e5f6a",
      "quantity": 1
    }
  ],
  "shipping": {
    "name": "Ada Lovelace",
    "line1": "1 Main St",
    "city": "Austin",
    "state": "TX",
    "postal_code": "78701",
    "country": "US"
  }
}

Response 201

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"subscription"Yes
store_idstring (uuid)Yes
customer_idstring (uuid)Yes
customerobject or nullYes
customer.emailstring or nullNo
customer.namestring or nullNo
statusone of incomplete, incomplete_expired, trialing, active, past_due, paused, canceledYesincomplete: waiting for the customer to sign up. incomplete_expired: they did not in time. trialing: in its free trial. active: paid up. past_due: a payment failed and is being retried. paused: nothing is charged or shipped. canceled: ended.
status_textstringYesThe status in plain words (Waiting for customer, Past due, …).
planobjectYes
plan.idstring (uuid)Yes
plan.namestringNo
plan.amountintegerNo
plan.currencystringNo
plan.intervalone of day, week, month, year or nullNo
plan.interval_countinteger or nullNo
quantityintegerYes
addonsarray of objectYes
addons[].plan_idstring (uuid)No
addons[].namestring or nullNo
addons[].amountinteger or nullNo
addons[].quantityintegerNo
introobject or nullYesThe intro price this subscription has, taken from its plan when it was created.
payment_methodobject or nullYesThe saved card it is charged to. Null until the customer signs up.
trial_endstring (date-time) or nullYesWhen the free trial ends (the first charge).
current_periodobject or nullYes
current_period.indexintegerNo0 for the first period.
current_period.startstring (date-time) or nullNo
current_period.endstring (date-time) or nullNo
current_period.amountinteger or nullNoWhat this period was billed, minor units.
next_billing_atstring (date-time) or nullYesWhen it is charged next, or resumes; null once ended.
credit_balanceintegerYesCredit from downgrades, taken off the next bills (minor units).
pending_changeobject or nullYesA change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_idstring (uuid)NoThis change: its notice is for it alone; a newer change is always told again.
pending_change.plan_idstring (uuid)No
pending_change.increaseobject or nullNoSet when the change raises the price: a bigger charge, or a higher price per day when the interval changes. It applies only to the period starting effective_at, with the customer's notice confirmed sent 7 to 30 days before that date. Its date follows the subscription's real schedule (after a pause, from the day it resumes); when that schedule moves, the date moves (version goes up) and the customer is told again.
pending_change.increase.fromintegerNoThe price per period before, minor units (per from_every).
pending_change.increase.tointegerNoThe price per period after, minor units (per to_every).
pending_change.increase.from_everystringNoThe period before, in words: every month.
pending_change.increase.to_everystringNoThe period after, in words: every week.
pending_change.increase.currencystringNo
pending_change.increase.effective_indexinteger or nullNoThe period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_atstring (date-time) or nullNoWhen that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_atstring (date-time) or nullNoWhen the email service accepted the notice; null until then (it goes 30 days before effective_at, and is tried again if it did not go).
pending_change.increase.versionintegerNoWhich notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantityintegerNo
pending_change.addonsarray of objectNo
pending_change.addons[].plan_idstring (uuid)No
pending_change.addons[].quantityintegerNo
cancel_at_period_endbooleanYesIt ends when the current period ends.
canceled_atstring (date-time) or nullYesWhen it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_atstring (date-time) or nullYes
cancel_reasonone of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or nullYesdunning: its payment failed on every retry. reminder_undeliverable: the reminder required 7 days before the first charge after a trial could not be emailed for 72 hours, so it ended without being charged.
pauseobject or nullYesA pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_endbooleanNo
pause.paused_atstring (date-time) or nullNo
pause.resume_atstring (date-time) or nullNoWhen it starts again by itself; null: when you (or the customer) resume it.
pause.reasonone of merchant, customer, api, dunning, or nullNo
shippingobject or nullYes
shipping.namestring or nullNo
shipping.addressobjectNo
shipping.address.line1stringNo
shipping.address.line2string or nullNo
shipping.address.citystringNo
shipping.address.statestring or nullNo
shipping.address.postal_codestringNo
shipping.address.countrystringNo
sourceone of dashboard, api, payment_link, checkoutYesHow it was started.
payment_link_idstring (uuid) or nullYesThe plan payment link the customer signed up through.
sign_up_expires_atstring (date-time) or nullYesWhile incomplete: when the sign-up link stops working.
metadataobjectYes
created_atstring (date-time)Yes
Response
{
  "id": "7e2f9a1c-3b4d-4e5f-8a6b-9c0d1e2f3a4b",
  "object": "subscription",
  "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "customer_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "customer": {
    "email": "ada@example.com",
    "name": "Ada Lovelace"
  },
  "plan": {
    "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "name": "Monthly box",
    "amount": 3000,
    "currency": "USD",
    "interval": "month",
    "interval_count": 1
  },
  "quantity": 1,
  "addons": [],
  "intro": {
    "amount": 1500,
    "periods": 2
  },
  "credit_balance": 0,
  "pending_change": null,
  "cancel_at_period_end": false,
  "canceled_at": null,
  "ended_at": null,
  "cancel_reason": null,
  "pause": null,
  "shipping": {
    "name": "Ada Lovelace",
    "address": {
      "line1": "1 Main St",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "postal_code": "78701",
      "country": "US"
    }
  },
  "payment_link_id": null,
  "metadata": {},
  "created_at": "2026-12-01T00:00:00.000Z",
  "status": "active",
  "status_text": "Active",
  "payment_method": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "object": "payment_method",
    "type": "card",
    "brand": "Visa",
    "last4": "4242",
    "exp_month": 12,
    "exp_year": 2029,
    "funding": "credit",
    "country": "US",
    "wallet": null,
    "is_default": true,
    "status": "active",
    "expired": false,
    "saved_via": "save_card_page",
    "created_at": "2026-12-01T00:00:00.000Z",
    "last_used_at": "2026-12-15T00:00:00.000Z",
    "updated_by_card_network_at": null,
    "removed_at": null
  },
  "trial_end": "2026-12-15T00:00:00.000Z",
  "current_period": {
    "index": 0,
    "start": "2026-12-15T00:00:00.000Z",
    "end": "2027-01-15T00:00:00.000Z",
    "amount": 1500
  },
  "next_billing_at": "2027-01-15T00:00:00.000Z",
  "source": "api",
  "sign_up_expires_at": null
}
StatusMeaning
200Idempotent replay.
201Created, waiting for the customer (incomplete).
400invalid_request: the message names the first invalid field (also an add-on listed twice, or in another currency); invalid_json: the body is not JSON; invalid_idempotency_key: the Idempotency-Key is longer than 255 characters or has control characters.
404customer_not_found, plan_not_found or addon_not_found; not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).
409customer_email_required: the customer has no email address; plan_inactive: the plan (or an add-on) is archived; store_inactive: the store is not taking payments; subscriptions_unavailable: the store has no card payments set up for saved cards; idempotency_conflict: the Idempotency-Key was used for another customer or plan.
422shipping_address_required: the subscription ships each period: send shipping.

Create a hosted sign-up page#

HTTP
POST /api/v1/subscriptions/checkout

A sign-up page on OnCharge for one customer: the answer is the subscription (incomplete) with its url. Send the customer there; they read the terms, agree to the recurring charges and enter a card, and the subscription starts (the trial starts, or the first period is charged). The page works for 24 hours and never offers the customer's saved cards. A repeat with the same Idempotency-Key returns the first subscription and its page (200).

ParameterInTypeRequiredDescription
Idempotency-KeyheaderstringNoA unique key (up to 255 characters is safe) that makes retries of this request safe.

Request body (application/json)

FieldTypeRequiredDescription
plan_idstring (uuid)YesAn active plan of your store.
quantityinteger (≥ 1, ≤ 1000)NoDefault 1.
addonsarray of object (≤ 20 items)NoEach add-on listed once.
addons[].plan_idstring (uuid)YesAn add-on of your store (kind: "addon"), in the plan's currency.
addons[].quantityinteger (≥ 1, ≤ 1000)NoDefault 1.
customer_idstring (uuid)NoAn existing customer of your store.
customer_emailstring (email) (max 254 chars)NoThe customer is found by email, or added to your store.
customer_namestring (min 1 chars, max 200 chars)NoSaved on the customer if they have no name yet.
shippingobjectNoRequired when the subscription ships.
shipping.namestring (min 1 chars, max 200 chars)Yes
shipping.line1string (min 1 chars, max 300 chars)Yes
shipping.line2string or null (max 300 chars)No
shipping.citystring (min 1 chars, max 120 chars)Yes
shipping.statestring or null (max 120 chars)No
shipping.postal_codestring (min 1 chars, max 20 chars)Yes
shipping.countrystringYesTwo-letter code (US).
success_urlstring (uri) (max 2048 chars)NoAn https page the customer goes to after signing up. Kept in the subscription's metadata as success_url.
metadataobjectNoYour own key-value pairs: at most 20 keys of letters, digits, _, . and - (up to 40 characters), each value up to 500 characters.
Request
{
  "plan_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "customer_email": "ada@example.com",
  "customer_name": "Ada Lovelace",
  "shipping": {
    "name": "Ada Lovelace",
    "line1": "1 Main St",
    "city": "Austin",
    "state": "TX",
    "postal_code": "78701",
    "country": "US"
  },
  "success_url": "https://shop.example.com/welcome"
}

Response 201

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"subscription"Yes
store_idstring (uuid)Yes
customer_idstring (uuid)Yes
customerobject or nullYes
customer.emailstring or nullNo
customer.namestring or nullNo
statusone of incomplete, incomplete_expired, trialing, active, past_due, paused, canceledYesincomplete: waiting for the customer to sign up. incomplete_expired: they did not in time. trialing: in its free trial. active: paid up. past_due: a payment failed and is being retried. paused: nothing is charged or shipped. canceled: ended.
status_textstringYesThe status in plain words (Waiting for customer, Past due, …).
planobjectYes
plan.idstring (uuid)Yes
plan.namestringNo
plan.amountintegerNo
plan.currencystringNo
plan.intervalone of day, week, month, year or nullNo
plan.interval_countinteger or nullNo
quantityintegerYes
addonsarray of objectYes
addons[].plan_idstring (uuid)No
addons[].namestring or nullNo
addons[].amountinteger or nullNo
addons[].quantityintegerNo
introobject or nullYesThe intro price this subscription has, taken from its plan when it was created.
payment_methodobject or nullYesThe saved card it is charged to. Null until the customer signs up.
trial_endstring (date-time) or nullYesWhen the free trial ends (the first charge).
current_periodobject or nullYes
current_period.indexintegerNo0 for the first period.
current_period.startstring (date-time) or nullNo
current_period.endstring (date-time) or nullNo
current_period.amountinteger or nullNoWhat this period was billed, minor units.
next_billing_atstring (date-time) or nullYesWhen it is charged next, or resumes; null once ended.
credit_balanceintegerYesCredit from downgrades, taken off the next bills (minor units).
pending_changeobject or nullYesA change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_idstring (uuid)NoThis change: its notice is for it alone; a newer change is always told again.
pending_change.plan_idstring (uuid)No
pending_change.increaseobject or nullNoSet when the change raises the price: a bigger charge, or a higher price per day when the interval changes. It applies only to the period starting effective_at, with the customer's notice confirmed sent 7 to 30 days before that date. Its date follows the subscription's real schedule (after a pause, from the day it resumes); when that schedule moves, the date moves (version goes up) and the customer is told again.
pending_change.increase.fromintegerNoThe price per period before, minor units (per from_every).
pending_change.increase.tointegerNoThe price per period after, minor units (per to_every).
pending_change.increase.from_everystringNoThe period before, in words: every month.
pending_change.increase.to_everystringNoThe period after, in words: every week.
pending_change.increase.currencystringNo
pending_change.increase.effective_indexinteger or nullNoThe period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_atstring (date-time) or nullNoWhen that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_atstring (date-time) or nullNoWhen the email service accepted the notice; null until then (it goes 30 days before effective_at, and is tried again if it did not go).
pending_change.increase.versionintegerNoWhich notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantityintegerNo
pending_change.addonsarray of objectNo
pending_change.addons[].plan_idstring (uuid)No
pending_change.addons[].quantityintegerNo
cancel_at_period_endbooleanYesIt ends when the current period ends.
canceled_atstring (date-time) or nullYesWhen it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_atstring (date-time) or nullYes
cancel_reasonone of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or nullYesdunning: its payment failed on every retry. reminder_undeliverable: the reminder required 7 days before the first charge after a trial could not be emailed for 72 hours, so it ended without being charged.
pauseobject or nullYesA pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_endbooleanNo
pause.paused_atstring (date-time) or nullNo
pause.resume_atstring (date-time) or nullNoWhen it starts again by itself; null: when you (or the customer) resume it.
pause.reasonone of merchant, customer, api, dunning, or nullNo
shippingobject or nullYes
shipping.namestring or nullNo
shipping.addressobjectNo
shipping.address.line1stringNo
shipping.address.line2string or nullNo
shipping.address.citystringNo
shipping.address.statestring or nullNo
shipping.address.postal_codestringNo
shipping.address.countrystringNo
sourceone of dashboard, api, payment_link, checkoutYesHow it was started.
payment_link_idstring (uuid) or nullYesThe plan payment link the customer signed up through.
sign_up_expires_atstring (date-time) or nullYesWhile incomplete: when the sign-up link stops working.
metadataobjectYes
created_atstring (date-time)Yes
urlstringYesThe customer's sign-up page on OnCharge. It works until sign_up_expires_at (24 hours). It never offers the customer's saved cards.
Response
{
  "id": "7e2f9a1c-3b4d-4e5f-8a6b-9c0d1e2f3a4b",
  "object": "subscription",
  "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "customer_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "customer": {
    "email": "ada@example.com",
    "name": "Ada Lovelace"
  },
  "plan": {
    "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "name": "Monthly box",
    "amount": 3000,
    "currency": "USD",
    "interval": "month",
    "interval_count": 1
  },
  "quantity": 1,
  "addons": [],
  "intro": {
    "amount": 1500,
    "periods": 2
  },
  "credit_balance": 0,
  "pending_change": null,
  "cancel_at_period_end": false,
  "canceled_at": null,
  "ended_at": null,
  "cancel_reason": null,
  "pause": null,
  "shipping": {
    "name": "Ada Lovelace",
    "address": {
      "line1": "1 Main St",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "postal_code": "78701",
      "country": "US"
    }
  },
  "payment_link_id": null,
  "metadata": {},
  "created_at": "2026-12-01T00:00:00.000Z",
  "status": "incomplete",
  "status_text": "Waiting for customer",
  "payment_method": null,
  "trial_end": null,
  "current_period": null,
  "next_billing_at": null,
  "source": "checkout",
  "sign_up_expires_at": "2026-12-02T00:00:00.000Z",
  "url": "https://app.oncharge.io/s/subscribe/7e2f9a1c-3b4d-4e5f-8a6b-9c0d1e2f3a4b?token=ocs_…"
}
StatusMeaning
200Idempotent replay.
201Created: send the customer to url.
400invalid_request: the message names the first invalid field (also neither customer_id nor customer_email, or an add-on listed twice or in another currency); invalid_json: the body is not JSON; invalid_idempotency_key: the Idempotency-Key is longer than 255 characters or has control characters.
404customer_not_found, plan_not_found or addon_not_found; not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).
409plan_inactive: the plan (or an add-on) is archived; store_inactive: the store is not taking payments; subscriptions_unavailable: the store has no card payments set up for saved cards; idempotency_conflict: the Idempotency-Key was used for another customer or plan.
422shipping_address_required: the subscription ships each period: send shipping.

Retrieve a subscription#

HTTP
GET /api/v1/subscriptions/{subscription_id}

The subscription with every bill (each period and prorated plan change, its invoice, attempts, failure and payment reference) and its history.

ParameterInTypeRequiredDescription
subscription_idpathstring (uuid)YesA subscription of your store.

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"subscription"Yes
store_idstring (uuid)Yes
customer_idstring (uuid)Yes
customerobject or nullYes
customer.emailstring or nullNo
customer.namestring or nullNo
statusone of incomplete, incomplete_expired, trialing, active, past_due, paused, canceledYesincomplete: waiting for the customer to sign up. incomplete_expired: they did not in time. trialing: in its free trial. active: paid up. past_due: a payment failed and is being retried. paused: nothing is charged or shipped. canceled: ended.
status_textstringYesThe status in plain words (Waiting for customer, Past due, …).
planobjectYes
plan.idstring (uuid)Yes
plan.namestringNo
plan.amountintegerNo
plan.currencystringNo
plan.intervalone of day, week, month, year or nullNo
plan.interval_countinteger or nullNo
quantityintegerYes
addonsarray of objectYes
addons[].plan_idstring (uuid)No
addons[].namestring or nullNo
addons[].amountinteger or nullNo
addons[].quantityintegerNo
introobject or nullYesThe intro price this subscription has, taken from its plan when it was created.
payment_methodobject or nullYesThe saved card it is charged to. Null until the customer signs up.
trial_endstring (date-time) or nullYesWhen the free trial ends (the first charge).
current_periodobject or nullYes
current_period.indexintegerNo0 for the first period.
current_period.startstring (date-time) or nullNo
current_period.endstring (date-time) or nullNo
current_period.amountinteger or nullNoWhat this period was billed, minor units.
next_billing_atstring (date-time) or nullYesWhen it is charged next, or resumes; null once ended.
credit_balanceintegerYesCredit from downgrades, taken off the next bills (minor units).
pending_changeobject or nullYesA change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_idstring (uuid)NoThis change: its notice is for it alone; a newer change is always told again.
pending_change.plan_idstring (uuid)No
pending_change.increaseobject or nullNoSet when the change raises the price: a bigger charge, or a higher price per day when the interval changes. It applies only to the period starting effective_at, with the customer's notice confirmed sent 7 to 30 days before that date. Its date follows the subscription's real schedule (after a pause, from the day it resumes); when that schedule moves, the date moves (version goes up) and the customer is told again.
pending_change.increase.fromintegerNoThe price per period before, minor units (per from_every).
pending_change.increase.tointegerNoThe price per period after, minor units (per to_every).
pending_change.increase.from_everystringNoThe period before, in words: every month.
pending_change.increase.to_everystringNoThe period after, in words: every week.
pending_change.increase.currencystringNo
pending_change.increase.effective_indexinteger or nullNoThe period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_atstring (date-time) or nullNoWhen that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_atstring (date-time) or nullNoWhen the email service accepted the notice; null until then (it goes 30 days before effective_at, and is tried again if it did not go).
pending_change.increase.versionintegerNoWhich notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantityintegerNo
pending_change.addonsarray of objectNo
pending_change.addons[].plan_idstring (uuid)No
pending_change.addons[].quantityintegerNo
cancel_at_period_endbooleanYesIt ends when the current period ends.
canceled_atstring (date-time) or nullYesWhen it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_atstring (date-time) or nullYes
cancel_reasonone of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or nullYesdunning: its payment failed on every retry. reminder_undeliverable: the reminder required 7 days before the first charge after a trial could not be emailed for 72 hours, so it ended without being charged.
pauseobject or nullYesA pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_endbooleanNo
pause.paused_atstring (date-time) or nullNo
pause.resume_atstring (date-time) or nullNoWhen it starts again by itself; null: when you (or the customer) resume it.
pause.reasonone of merchant, customer, api, dunning, or nullNo
shippingobject or nullYes
shipping.namestring or nullNo
shipping.addressobjectNo
shipping.address.line1stringNo
shipping.address.line2string or nullNo
shipping.address.citystringNo
shipping.address.statestring or nullNo
shipping.address.postal_codestringNo
shipping.address.countrystringNo
sourceone of dashboard, api, payment_link, checkoutYesHow it was started.
payment_link_idstring (uuid) or nullYesThe plan payment link the customer signed up through.
sign_up_expires_atstring (date-time) or nullYesWhile incomplete: when the sign-up link stops working.
metadataobjectYes
created_atstring (date-time)Yes
billingsarray of objectYesEvery bill, newest first.
billings[].idstring (uuid)Yes
billings[].object"subscription_billing"Yes
billings[].subscription_idstring (uuid)Yes
billings[].reasonone of period, prorationYesproration: the prorated charge of a plan change applied now.
billings[].period_indexintegerYes0 for the first period.
billings[].period_startstring (date-time)Yes
billings[].period_endstring (date-time)Yes
billings[].linesarray of objectYes
billings[].lines[].descriptionstringNo
billings[].lines[].quantityintegerNo
billings[].lines[].unit_amountintegerNo
billings[].lines[].requires_shippingbooleanNo
billings[].subtotalintegerYes
billings[].credit_appliedintegerYesCredit from earlier downgrades taken off this bill.
billings[].amount_dueintegerYes
billings[].shipsbooleanYesThis period's order ships: it is paid out after carrier-confirmed delivery.
billings[].statusone of open, paid, uncollectible, voidYes
billings[].invoiceobject or nullYes
billings[].invoice.idstring (uuid)No
billings[].invoice.numberstring or nullNoINV-0042.
billings[].attemptsintegerYesCharge attempts so far.
billings[].next_attempt_atstring (date-time) or nullYesWhile open: when it is charged again; null when it waits for the customer.
billings[].failureobject or nullYesWhy the last charge failed, while unpaid.
billings[].failure.reasonone of declined, authentication_required, unusable_card, error, store_unavailable, store_limitNo
billings[].failure.messagestringNoWhat happened and what OnCharge does next, in plain words.
billings[].failure.waits_for_customerbooleanNoNo automatic retry: the customer has to confirm the payment with their bank or add another card.
billings[].paid_atstring (date-time) or nullYes
billings[].payment_referencestring or nullYesOnCharge's reference for the payment that paid it (ocpay_…).
billings[].created_atstring (date-time)Yes
historyarray of objectYesWhat happened, newest first (at most 100).
history[].kindstringNo
history[].actorone of merchant, api, customer, systemNo
history[].dataobjectNo
history[].created_atstring (date-time)No
Response
{
  "id": "7e2f9a1c-3b4d-4e5f-8a6b-9c0d1e2f3a4b",
  "object": "subscription",
  "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "customer_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "customer": {
    "email": "ada@example.com",
    "name": "Ada Lovelace"
  },
  "plan": {
    "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "name": "Monthly box",
    "amount": 3000,
    "currency": "USD",
    "interval": "month",
    "interval_count": 1
  },
  "quantity": 1,
  "addons": [],
  "intro": {
    "amount": 1500,
    "periods": 2
  },
  "credit_balance": 0,
  "pending_change": null,
  "cancel_at_period_end": false,
  "canceled_at": null,
  "ended_at": null,
  "cancel_reason": null,
  "pause": null,
  "shipping": {
    "name": "Ada Lovelace",
    "address": {
      "line1": "1 Main St",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "postal_code": "78701",
      "country": "US"
    }
  },
  "payment_link_id": null,
  "metadata": {},
  "created_at": "2026-12-01T00:00:00.000Z",
  "status": "active",
  "status_text": "Active",
  "payment_method": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "object": "payment_method",
    "type": "card",
    "brand": "Visa",
    "last4": "4242",
    "exp_month": 12,
    "exp_year": 2029,
    "funding": "credit",
    "country": "US",
    "wallet": null,
    "is_default": true,
    "status": "active",
    "expired": false,
    "saved_via": "save_card_page",
    "created_at": "2026-12-01T00:00:00.000Z",
    "last_used_at": "2026-12-15T00:00:00.000Z",
    "updated_by_card_network_at": null,
    "removed_at": null
  },
  "trial_end": "2026-12-15T00:00:00.000Z",
  "current_period": {
    "index": 0,
    "start": "2026-12-15T00:00:00.000Z",
    "end": "2027-01-15T00:00:00.000Z",
    "amount": 1500
  },
  "next_billing_at": "2027-01-15T00:00:00.000Z",
  "source": "api",
  "sign_up_expires_at": null,
  "billings": [
    {
      "id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
      "object": "subscription_billing",
      "subscription_id": "7e2f9a1c-3b4d-4e5f-8a6b-9c0d1e2f3a4b",
      "reason": "period",
      "period_index": 0,
      "period_start": "2026-12-15T00:00:00.000Z",
      "period_end": "2027-01-15T00:00:00.000Z",
      "lines": [
        {
          "description": "Monthly box (introductory price)",
          "quantity": 1,
          "unit_amount": 1500,
          "requires_shipping": true
        }
      ],
      "subtotal": 1500,
      "credit_applied": 0,
      "amount_due": 1500,
      "ships": true,
      "status": "paid",
      "invoice": {
        "id": "4d5e6f7a-8b9c-4d0e-8f1a-2b3c4d5e6f7a",
        "number": "INV-0042"
      },
      "attempts": 1,
      "next_attempt_at": null,
      "failure": null,
      "paid_at": "2026-12-15T00:05:00.000Z",
      "payment_reference": "ocpay_8f14e45fceea467a95752c3b8e1f0b6d",
      "created_at": "2026-12-15T00:00:00.000Z"
    }
  ],
  "history": [
    {
      "kind": "billing_paid",
      "actor": "system",
      "data": {
        "amount": 1500,
        "period_index": 0,
        "reason": "period"
      },
      "created_at": "2026-12-15T00:05:00.000Z"
    },
    {
      "kind": "consent_granted",
      "actor": "customer",
      "data": {
        "version": "2026-12-01-draft"
      },
      "created_at": "2026-12-01T00:10:00.000Z"
    },
    {
      "kind": "created",
      "actor": "system",
      "data": {
        "source": "api",
        "plan_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
        "quantity": 1
      },
      "created_at": "2026-12-01T00:00:00.000Z"
    }
  ]
}
StatusMeaning
200The subscription.
404not_found: no such subscription in your store; not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).

Update a subscription#

HTTP
PATCH /api/v1/subscriptions/{subscription_id}

Change where it ships, replace its metadata, or ask the customer to switch to another of their saved cards at your store. Only the customer changes the card: with payment_method_id they are emailed a link to switch to that card on their subscription page (once an hour at most), and the answer is 202 with card_change. If that email cannot be sent, nothing in the request is saved. Nothing changes, and nothing is charged to that card, until the customer switches and agrees to the charges on it. Signed like any request, with PATCH as the method.

ParameterInTypeRequiredDescription
subscription_idpathstring (uuid)YesA subscription of your store.

Request body (application/json)

FieldTypeRequiredDescription
payment_method_idstring (uuid)NoAnother active saved card of the same customer at your store. The customer is emailed a link to switch to it themselves (202); the subscription keeps its card, and nothing is charged to this one, until they do. Not on an incomplete subscription: the customer chooses the card when they sign up.
shippingobjectNoWhere the next periods ship.
shipping.namestring (min 1 chars, max 200 chars)Yes
shipping.line1string (min 1 chars, max 300 chars)Yes
shipping.line2string or null (max 300 chars)No
shipping.citystring (min 1 chars, max 120 chars)Yes
shipping.statestring or null (max 120 chars)No
shipping.postal_codestring (min 1 chars, max 20 chars)Yes
shipping.countrystringYesTwo-letter code (US).
metadataobjectNoReplaces the metadata.
Request
{
  "payment_method_id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e"
}

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"subscription"Yes
store_idstring (uuid)Yes
customer_idstring (uuid)Yes
customerobject or nullYes
customer.emailstring or nullNo
customer.namestring or nullNo
statusone of incomplete, incomplete_expired, trialing, active, past_due, paused, canceledYesincomplete: waiting for the customer to sign up. incomplete_expired: they did not in time. trialing: in its free trial. active: paid up. past_due: a payment failed and is being retried. paused: nothing is charged or shipped. canceled: ended.
status_textstringYesThe status in plain words (Waiting for customer, Past due, …).
planobjectYes
plan.idstring (uuid)Yes
plan.namestringNo
plan.amountintegerNo
plan.currencystringNo
plan.intervalone of day, week, month, year or nullNo
plan.interval_countinteger or nullNo
quantityintegerYes
addonsarray of objectYes
addons[].plan_idstring (uuid)No
addons[].namestring or nullNo
addons[].amountinteger or nullNo
addons[].quantityintegerNo
introobject or nullYesThe intro price this subscription has, taken from its plan when it was created.
payment_methodobject or nullYesThe saved card it is charged to. Null until the customer signs up.
trial_endstring (date-time) or nullYesWhen the free trial ends (the first charge).
current_periodobject or nullYes
current_period.indexintegerNo0 for the first period.
current_period.startstring (date-time) or nullNo
current_period.endstring (date-time) or nullNo
current_period.amountinteger or nullNoWhat this period was billed, minor units.
next_billing_atstring (date-time) or nullYesWhen it is charged next, or resumes; null once ended.
credit_balanceintegerYesCredit from downgrades, taken off the next bills (minor units).
pending_changeobject or nullYesA change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_idstring (uuid)NoThis change: its notice is for it alone; a newer change is always told again.
pending_change.plan_idstring (uuid)No
pending_change.increaseobject or nullNoSet when the change raises the price: a bigger charge, or a higher price per day when the interval changes. It applies only to the period starting effective_at, with the customer's notice confirmed sent 7 to 30 days before that date. Its date follows the subscription's real schedule (after a pause, from the day it resumes); when that schedule moves, the date moves (version goes up) and the customer is told again.
pending_change.increase.fromintegerNoThe price per period before, minor units (per from_every).
pending_change.increase.tointegerNoThe price per period after, minor units (per to_every).
pending_change.increase.from_everystringNoThe period before, in words: every month.
pending_change.increase.to_everystringNoThe period after, in words: every week.
pending_change.increase.currencystringNo
pending_change.increase.effective_indexinteger or nullNoThe period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_atstring (date-time) or nullNoWhen that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_atstring (date-time) or nullNoWhen the email service accepted the notice; null until then (it goes 30 days before effective_at, and is tried again if it did not go).
pending_change.increase.versionintegerNoWhich notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantityintegerNo
pending_change.addonsarray of objectNo
pending_change.addons[].plan_idstring (uuid)No
pending_change.addons[].quantityintegerNo
cancel_at_period_endbooleanYesIt ends when the current period ends.
canceled_atstring (date-time) or nullYesWhen it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_atstring (date-time) or nullYes
cancel_reasonone of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or nullYesdunning: its payment failed on every retry. reminder_undeliverable: the reminder required 7 days before the first charge after a trial could not be emailed for 72 hours, so it ended without being charged.
pauseobject or nullYesA pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_endbooleanNo
pause.paused_atstring (date-time) or nullNo
pause.resume_atstring (date-time) or nullNoWhen it starts again by itself; null: when you (or the customer) resume it.
pause.reasonone of merchant, customer, api, dunning, or nullNo
shippingobject or nullYes
shipping.namestring or nullNo
shipping.addressobjectNo
shipping.address.line1stringNo
shipping.address.line2string or nullNo
shipping.address.citystringNo
shipping.address.statestring or nullNo
shipping.address.postal_codestringNo
shipping.address.countrystringNo
sourceone of dashboard, api, payment_link, checkoutYesHow it was started.
payment_link_idstring (uuid) or nullYesThe plan payment link the customer signed up through.
sign_up_expires_atstring (date-time) or nullYesWhile incomplete: when the sign-up link stops working.
metadataobjectYes
created_atstring (date-time)Yes
Response
{
  "id": "7e2f9a1c-3b4d-4e5f-8a6b-9c0d1e2f3a4b",
  "object": "subscription",
  "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "customer_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "customer": {
    "email": "ada@example.com",
    "name": "Ada Lovelace"
  },
  "plan": {
    "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "name": "Monthly box",
    "amount": 3000,
    "currency": "USD",
    "interval": "month",
    "interval_count": 1
  },
  "quantity": 1,
  "addons": [],
  "intro": {
    "amount": 1500,
    "periods": 2
  },
  "credit_balance": 0,
  "pending_change": null,
  "cancel_at_period_end": false,
  "canceled_at": null,
  "ended_at": null,
  "cancel_reason": null,
  "pause": null,
  "shipping": {
    "name": "Ada Lovelace",
    "address": {
      "line1": "1 Main St",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "postal_code": "78701",
      "country": "US"
    }
  },
  "payment_link_id": null,
  "metadata": {},
  "created_at": "2026-12-01T00:00:00.000Z",
  "status": "active",
  "status_text": "Active",
  "payment_method": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "object": "payment_method",
    "type": "card",
    "brand": "Visa",
    "last4": "4242",
    "exp_month": 12,
    "exp_year": 2029,
    "funding": "credit",
    "country": "US",
    "wallet": null,
    "is_default": true,
    "status": "active",
    "expired": false,
    "saved_via": "save_card_page",
    "created_at": "2026-12-01T00:00:00.000Z",
    "last_used_at": "2026-12-15T00:00:00.000Z",
    "updated_by_card_network_at": null,
    "removed_at": null
  },
  "trial_end": "2026-12-15T00:00:00.000Z",
  "current_period": {
    "index": 0,
    "start": "2026-12-15T00:00:00.000Z",
    "end": "2027-01-15T00:00:00.000Z",
    "amount": 1500
  },
  "next_billing_at": "2027-01-15T00:00:00.000Z",
  "source": "api",
  "sign_up_expires_at": null
}
StatusMeaning
200The subscription.
202With payment_method_id: the customer was emailed a link to switch to that card (card_change.status: "customer_asked", with the card's brand and last four digits). The subscription keeps its card until they do; any shipping or metadata change in the same request is saved.
400invalid_request: the message names the first invalid field; invalid_json: the body is not JSON.
404not_found: no such subscription; payment_method_not_found: not an active saved card of this customer; not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).
409subscription_ended: it has ended; not_started: the customer chooses the card when they sign up; customer_email_required: the customer has no email address to ask them to switch cards; conflict: the subscription changed meanwhile (try again). A 429 too_many_requests means you asked this customer to switch cards less than an hour ago; a 502 customer_not_emailed means the email could not be sent and nothing in the request was saved: try again.

Cancel a subscription#

HTTP
POST /api/v1/subscriptions/{subscription_id}/cancel

By default an active or trialing subscription ends when its current period (or trial) ends: nothing more is charged, and subscription.canceled follows then. With at_period_end: false, or for any other status, it ends now: anything unpaid is voided. The customer is emailed. To keep a subscription whose cancellation is waiting, resume it (not when the customer cancelled it).

ParameterInTypeRequiredDescription
subscription_idpathstring (uuid)YesA subscription of your store.

Request body (application/json)

FieldTypeRequiredDescription
at_period_endbooleanNotrue: an active or trialing subscription ends when its current period (or trial) ends; any other status ends now. false: it ends now and anything unpaid is voided. Default true.
Request
{
  "at_period_end": true
}

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"subscription"Yes
store_idstring (uuid)Yes
customer_idstring (uuid)Yes
customerobject or nullYes
customer.emailstring or nullNo
customer.namestring or nullNo
statusone of incomplete, incomplete_expired, trialing, active, past_due, paused, canceledYesincomplete: waiting for the customer to sign up. incomplete_expired: they did not in time. trialing: in its free trial. active: paid up. past_due: a payment failed and is being retried. paused: nothing is charged or shipped. canceled: ended.
status_textstringYesThe status in plain words (Waiting for customer, Past due, …).
planobjectYes
plan.idstring (uuid)Yes
plan.namestringNo
plan.amountintegerNo
plan.currencystringNo
plan.intervalone of day, week, month, year or nullNo
plan.interval_countinteger or nullNo
quantityintegerYes
addonsarray of objectYes
addons[].plan_idstring (uuid)No
addons[].namestring or nullNo
addons[].amountinteger or nullNo
addons[].quantityintegerNo
introobject or nullYesThe intro price this subscription has, taken from its plan when it was created.
payment_methodobject or nullYesThe saved card it is charged to. Null until the customer signs up.
trial_endstring (date-time) or nullYesWhen the free trial ends (the first charge).
current_periodobject or nullYes
current_period.indexintegerNo0 for the first period.
current_period.startstring (date-time) or nullNo
current_period.endstring (date-time) or nullNo
current_period.amountinteger or nullNoWhat this period was billed, minor units.
next_billing_atstring (date-time) or nullYesWhen it is charged next, or resumes; null once ended.
credit_balanceintegerYesCredit from downgrades, taken off the next bills (minor units).
pending_changeobject or nullYesA change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_idstring (uuid)NoThis change: its notice is for it alone; a newer change is always told again.
pending_change.plan_idstring (uuid)No
pending_change.increaseobject or nullNoSet when the change raises the price: a bigger charge, or a higher price per day when the interval changes. It applies only to the period starting effective_at, with the customer's notice confirmed sent 7 to 30 days before that date. Its date follows the subscription's real schedule (after a pause, from the day it resumes); when that schedule moves, the date moves (version goes up) and the customer is told again.
pending_change.increase.fromintegerNoThe price per period before, minor units (per from_every).
pending_change.increase.tointegerNoThe price per period after, minor units (per to_every).
pending_change.increase.from_everystringNoThe period before, in words: every month.
pending_change.increase.to_everystringNoThe period after, in words: every week.
pending_change.increase.currencystringNo
pending_change.increase.effective_indexinteger or nullNoThe period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_atstring (date-time) or nullNoWhen that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_atstring (date-time) or nullNoWhen the email service accepted the notice; null until then (it goes 30 days before effective_at, and is tried again if it did not go).
pending_change.increase.versionintegerNoWhich notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantityintegerNo
pending_change.addonsarray of objectNo
pending_change.addons[].plan_idstring (uuid)No
pending_change.addons[].quantityintegerNo
cancel_at_period_endbooleanYesIt ends when the current period ends.
canceled_atstring (date-time) or nullYesWhen it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_atstring (date-time) or nullYes
cancel_reasonone of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or nullYesdunning: its payment failed on every retry. reminder_undeliverable: the reminder required 7 days before the first charge after a trial could not be emailed for 72 hours, so it ended without being charged.
pauseobject or nullYesA pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_endbooleanNo
pause.paused_atstring (date-time) or nullNo
pause.resume_atstring (date-time) or nullNoWhen it starts again by itself; null: when you (or the customer) resume it.
pause.reasonone of merchant, customer, api, dunning, or nullNo
shippingobject or nullYes
shipping.namestring or nullNo
shipping.addressobjectNo
shipping.address.line1stringNo
shipping.address.line2string or nullNo
shipping.address.citystringNo
shipping.address.statestring or nullNo
shipping.address.postal_codestringNo
shipping.address.countrystringNo
sourceone of dashboard, api, payment_link, checkoutYesHow it was started.
payment_link_idstring (uuid) or nullYesThe plan payment link the customer signed up through.
sign_up_expires_atstring (date-time) or nullYesWhile incomplete: when the sign-up link stops working.
metadataobjectYes
created_atstring (date-time)Yes
Response
{
  "id": "7e2f9a1c-3b4d-4e5f-8a6b-9c0d1e2f3a4b",
  "object": "subscription",
  "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "customer_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "customer": {
    "email": "ada@example.com",
    "name": "Ada Lovelace"
  },
  "plan": {
    "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "name": "Monthly box",
    "amount": 3000,
    "currency": "USD",
    "interval": "month",
    "interval_count": 1
  },
  "quantity": 1,
  "addons": [],
  "intro": {
    "amount": 1500,
    "periods": 2
  },
  "credit_balance": 0,
  "pending_change": null,
  "cancel_at_period_end": false,
  "canceled_at": null,
  "ended_at": null,
  "cancel_reason": null,
  "pause": null,
  "shipping": {
    "name": "Ada Lovelace",
    "address": {
      "line1": "1 Main St",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "postal_code": "78701",
      "country": "US"
    }
  },
  "payment_link_id": null,
  "metadata": {},
  "created_at": "2026-12-01T00:00:00.000Z",
  "status": "active",
  "status_text": "Active",
  "payment_method": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "object": "payment_method",
    "type": "card",
    "brand": "Visa",
    "last4": "4242",
    "exp_month": 12,
    "exp_year": 2029,
    "funding": "credit",
    "country": "US",
    "wallet": null,
    "is_default": true,
    "status": "active",
    "expired": false,
    "saved_via": "save_card_page",
    "created_at": "2026-12-01T00:00:00.000Z",
    "last_used_at": "2026-12-15T00:00:00.000Z",
    "updated_by_card_network_at": null,
    "removed_at": null
  },
  "trial_end": "2026-12-15T00:00:00.000Z",
  "current_period": {
    "index": 0,
    "start": "2026-12-15T00:00:00.000Z",
    "end": "2027-01-15T00:00:00.000Z",
    "amount": 1500
  },
  "next_billing_at": "2027-01-15T00:00:00.000Z",
  "source": "api",
  "sign_up_expires_at": null
}
StatusMeaning
200The subscription: cancel_at_period_end: true, or canceled.
400invalid_request: the message names the first invalid field; invalid_json: the body is not JSON.
404not_found: no such subscription in your store; not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).
409subscription_ended: it has already ended; payment_in_progress: a payment for it is being collected (try again in a minute); conflict: the subscription changed meanwhile (try again).

Pause a subscription#

HTTP
POST /api/v1/subscriptions/{subscription_id}/pause

From the end of the current period (nothing already paid is lost), for periods periods, until resume_at, or until resumed. While paused nothing is charged or shipped. Only an active or trialing subscription can be paused; a past-due one must be paid first.

ParameterInTypeRequiredDescription
subscription_idpathstring (uuid)YesA subscription of your store.

Request body (application/json)

FieldTypeRequiredDescription
periodsinteger (≥ 1, ≤ 12)NoPause for this many periods.
resume_atstring (date-time)NoResume then: after the end of the current period.
Request
{
  "periods": 2
}

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"subscription"Yes
store_idstring (uuid)Yes
customer_idstring (uuid)Yes
customerobject or nullYes
customer.emailstring or nullNo
customer.namestring or nullNo
statusone of incomplete, incomplete_expired, trialing, active, past_due, paused, canceledYesincomplete: waiting for the customer to sign up. incomplete_expired: they did not in time. trialing: in its free trial. active: paid up. past_due: a payment failed and is being retried. paused: nothing is charged or shipped. canceled: ended.
status_textstringYesThe status in plain words (Waiting for customer, Past due, …).
planobjectYes
plan.idstring (uuid)Yes
plan.namestringNo
plan.amountintegerNo
plan.currencystringNo
plan.intervalone of day, week, month, year or nullNo
plan.interval_countinteger or nullNo
quantityintegerYes
addonsarray of objectYes
addons[].plan_idstring (uuid)No
addons[].namestring or nullNo
addons[].amountinteger or nullNo
addons[].quantityintegerNo
introobject or nullYesThe intro price this subscription has, taken from its plan when it was created.
payment_methodobject or nullYesThe saved card it is charged to. Null until the customer signs up.
trial_endstring (date-time) or nullYesWhen the free trial ends (the first charge).
current_periodobject or nullYes
current_period.indexintegerNo0 for the first period.
current_period.startstring (date-time) or nullNo
current_period.endstring (date-time) or nullNo
current_period.amountinteger or nullNoWhat this period was billed, minor units.
next_billing_atstring (date-time) or nullYesWhen it is charged next, or resumes; null once ended.
credit_balanceintegerYesCredit from downgrades, taken off the next bills (minor units).
pending_changeobject or nullYesA change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_idstring (uuid)NoThis change: its notice is for it alone; a newer change is always told again.
pending_change.plan_idstring (uuid)No
pending_change.increaseobject or nullNoSet when the change raises the price: a bigger charge, or a higher price per day when the interval changes. It applies only to the period starting effective_at, with the customer's notice confirmed sent 7 to 30 days before that date. Its date follows the subscription's real schedule (after a pause, from the day it resumes); when that schedule moves, the date moves (version goes up) and the customer is told again.
pending_change.increase.fromintegerNoThe price per period before, minor units (per from_every).
pending_change.increase.tointegerNoThe price per period after, minor units (per to_every).
pending_change.increase.from_everystringNoThe period before, in words: every month.
pending_change.increase.to_everystringNoThe period after, in words: every week.
pending_change.increase.currencystringNo
pending_change.increase.effective_indexinteger or nullNoThe period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_atstring (date-time) or nullNoWhen that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_atstring (date-time) or nullNoWhen the email service accepted the notice; null until then (it goes 30 days before effective_at, and is tried again if it did not go).
pending_change.increase.versionintegerNoWhich notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantityintegerNo
pending_change.addonsarray of objectNo
pending_change.addons[].plan_idstring (uuid)No
pending_change.addons[].quantityintegerNo
cancel_at_period_endbooleanYesIt ends when the current period ends.
canceled_atstring (date-time) or nullYesWhen it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_atstring (date-time) or nullYes
cancel_reasonone of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or nullYesdunning: its payment failed on every retry. reminder_undeliverable: the reminder required 7 days before the first charge after a trial could not be emailed for 72 hours, so it ended without being charged.
pauseobject or nullYesA pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_endbooleanNo
pause.paused_atstring (date-time) or nullNo
pause.resume_atstring (date-time) or nullNoWhen it starts again by itself; null: when you (or the customer) resume it.
pause.reasonone of merchant, customer, api, dunning, or nullNo
shippingobject or nullYes
shipping.namestring or nullNo
shipping.addressobjectNo
shipping.address.line1stringNo
shipping.address.line2string or nullNo
shipping.address.citystringNo
shipping.address.statestring or nullNo
shipping.address.postal_codestringNo
shipping.address.countrystringNo
sourceone of dashboard, api, payment_link, checkoutYesHow it was started.
payment_link_idstring (uuid) or nullYesThe plan payment link the customer signed up through.
sign_up_expires_atstring (date-time) or nullYesWhile incomplete: when the sign-up link stops working.
metadataobjectYes
created_atstring (date-time)Yes
Response
{
  "id": "7e2f9a1c-3b4d-4e5f-8a6b-9c0d1e2f3a4b",
  "object": "subscription",
  "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "customer_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "customer": {
    "email": "ada@example.com",
    "name": "Ada Lovelace"
  },
  "plan": {
    "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "name": "Monthly box",
    "amount": 3000,
    "currency": "USD",
    "interval": "month",
    "interval_count": 1
  },
  "quantity": 1,
  "addons": [],
  "intro": {
    "amount": 1500,
    "periods": 2
  },
  "credit_balance": 0,
  "pending_change": null,
  "cancel_at_period_end": false,
  "canceled_at": null,
  "ended_at": null,
  "cancel_reason": null,
  "pause": null,
  "shipping": {
    "name": "Ada Lovelace",
    "address": {
      "line1": "1 Main St",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "postal_code": "78701",
      "country": "US"
    }
  },
  "payment_link_id": null,
  "metadata": {},
  "created_at": "2026-12-01T00:00:00.000Z",
  "status": "active",
  "status_text": "Active",
  "payment_method": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "object": "payment_method",
    "type": "card",
    "brand": "Visa",
    "last4": "4242",
    "exp_month": 12,
    "exp_year": 2029,
    "funding": "credit",
    "country": "US",
    "wallet": null,
    "is_default": true,
    "status": "active",
    "expired": false,
    "saved_via": "save_card_page",
    "created_at": "2026-12-01T00:00:00.000Z",
    "last_used_at": "2026-12-15T00:00:00.000Z",
    "updated_by_card_network_at": null,
    "removed_at": null
  },
  "trial_end": "2026-12-15T00:00:00.000Z",
  "current_period": {
    "index": 0,
    "start": "2026-12-15T00:00:00.000Z",
    "end": "2027-01-15T00:00:00.000Z",
    "amount": 1500
  },
  "next_billing_at": "2027-01-15T00:00:00.000Z",
  "source": "api",
  "sign_up_expires_at": null
}
StatusMeaning
200The subscription, with pause.at_period_end: true.
400invalid_request: the message names the first invalid field (also both periods and resume_at, or a resume_at not after the end of the current period); invalid_json: the body is not JSON.
404not_found: no such subscription in your store; not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).
409payment_required: it is past due; not_pausable: it is not active or trialing; cancel_scheduled: it ends at the period's end; conflict: the subscription changed meanwhile (try again).

Resume a subscription#

HTTP
POST /api/v1/subscriptions/{subscription_id}/resume

A paused subscription starts again now: a new period begins and is charged at once. On a subscription with a pause or cancellation waiting for the period's end, the pause or cancellation is called off. A cancellation the customer asked for is theirs to undo, by subscribing again.

ParameterInTypeRequiredDescription
subscription_idpathstring (uuid)YesA subscription of your store.

No request body. Sign it as an empty body.

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"subscription"Yes
store_idstring (uuid)Yes
customer_idstring (uuid)Yes
customerobject or nullYes
customer.emailstring or nullNo
customer.namestring or nullNo
statusone of incomplete, incomplete_expired, trialing, active, past_due, paused, canceledYesincomplete: waiting for the customer to sign up. incomplete_expired: they did not in time. trialing: in its free trial. active: paid up. past_due: a payment failed and is being retried. paused: nothing is charged or shipped. canceled: ended.
status_textstringYesThe status in plain words (Waiting for customer, Past due, …).
planobjectYes
plan.idstring (uuid)Yes
plan.namestringNo
plan.amountintegerNo
plan.currencystringNo
plan.intervalone of day, week, month, year or nullNo
plan.interval_countinteger or nullNo
quantityintegerYes
addonsarray of objectYes
addons[].plan_idstring (uuid)No
addons[].namestring or nullNo
addons[].amountinteger or nullNo
addons[].quantityintegerNo
introobject or nullYesThe intro price this subscription has, taken from its plan when it was created.
payment_methodobject or nullYesThe saved card it is charged to. Null until the customer signs up.
trial_endstring (date-time) or nullYesWhen the free trial ends (the first charge).
current_periodobject or nullYes
current_period.indexintegerNo0 for the first period.
current_period.startstring (date-time) or nullNo
current_period.endstring (date-time) or nullNo
current_period.amountinteger or nullNoWhat this period was billed, minor units.
next_billing_atstring (date-time) or nullYesWhen it is charged next, or resumes; null once ended.
credit_balanceintegerYesCredit from downgrades, taken off the next bills (minor units).
pending_changeobject or nullYesA change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_idstring (uuid)NoThis change: its notice is for it alone; a newer change is always told again.
pending_change.plan_idstring (uuid)No
pending_change.increaseobject or nullNoSet when the change raises the price: a bigger charge, or a higher price per day when the interval changes. It applies only to the period starting effective_at, with the customer's notice confirmed sent 7 to 30 days before that date. Its date follows the subscription's real schedule (after a pause, from the day it resumes); when that schedule moves, the date moves (version goes up) and the customer is told again.
pending_change.increase.fromintegerNoThe price per period before, minor units (per from_every).
pending_change.increase.tointegerNoThe price per period after, minor units (per to_every).
pending_change.increase.from_everystringNoThe period before, in words: every month.
pending_change.increase.to_everystringNoThe period after, in words: every week.
pending_change.increase.currencystringNo
pending_change.increase.effective_indexinteger or nullNoThe period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_atstring (date-time) or nullNoWhen that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_atstring (date-time) or nullNoWhen the email service accepted the notice; null until then (it goes 30 days before effective_at, and is tried again if it did not go).
pending_change.increase.versionintegerNoWhich notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantityintegerNo
pending_change.addonsarray of objectNo
pending_change.addons[].plan_idstring (uuid)No
pending_change.addons[].quantityintegerNo
cancel_at_period_endbooleanYesIt ends when the current period ends.
canceled_atstring (date-time) or nullYesWhen it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_atstring (date-time) or nullYes
cancel_reasonone of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or nullYesdunning: its payment failed on every retry. reminder_undeliverable: the reminder required 7 days before the first charge after a trial could not be emailed for 72 hours, so it ended without being charged.
pauseobject or nullYesA pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_endbooleanNo
pause.paused_atstring (date-time) or nullNo
pause.resume_atstring (date-time) or nullNoWhen it starts again by itself; null: when you (or the customer) resume it.
pause.reasonone of merchant, customer, api, dunning, or nullNo
shippingobject or nullYes
shipping.namestring or nullNo
shipping.addressobjectNo
shipping.address.line1stringNo
shipping.address.line2string or nullNo
shipping.address.citystringNo
shipping.address.statestring or nullNo
shipping.address.postal_codestringNo
shipping.address.countrystringNo
sourceone of dashboard, api, payment_link, checkoutYesHow it was started.
payment_link_idstring (uuid) or nullYesThe plan payment link the customer signed up through.
sign_up_expires_atstring (date-time) or nullYesWhile incomplete: when the sign-up link stops working.
metadataobjectYes
created_atstring (date-time)Yes
Response
{
  "id": "7e2f9a1c-3b4d-4e5f-8a6b-9c0d1e2f3a4b",
  "object": "subscription",
  "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "customer_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "customer": {
    "email": "ada@example.com",
    "name": "Ada Lovelace"
  },
  "plan": {
    "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "name": "Monthly box",
    "amount": 3000,
    "currency": "USD",
    "interval": "month",
    "interval_count": 1
  },
  "quantity": 1,
  "addons": [],
  "intro": {
    "amount": 1500,
    "periods": 2
  },
  "credit_balance": 0,
  "pending_change": null,
  "cancel_at_period_end": false,
  "canceled_at": null,
  "ended_at": null,
  "cancel_reason": null,
  "pause": null,
  "shipping": {
    "name": "Ada Lovelace",
    "address": {
      "line1": "1 Main St",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "postal_code": "78701",
      "country": "US"
    }
  },
  "payment_link_id": null,
  "metadata": {},
  "created_at": "2026-12-01T00:00:00.000Z",
  "status": "active",
  "status_text": "Active",
  "payment_method": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "object": "payment_method",
    "type": "card",
    "brand": "Visa",
    "last4": "4242",
    "exp_month": 12,
    "exp_year": 2029,
    "funding": "credit",
    "country": "US",
    "wallet": null,
    "is_default": true,
    "status": "active",
    "expired": false,
    "saved_via": "save_card_page",
    "created_at": "2026-12-01T00:00:00.000Z",
    "last_used_at": "2026-12-15T00:00:00.000Z",
    "updated_by_card_network_at": null,
    "removed_at": null
  },
  "trial_end": "2026-12-15T00:00:00.000Z",
  "current_period": {
    "index": 0,
    "start": "2026-12-15T00:00:00.000Z",
    "end": "2027-01-15T00:00:00.000Z",
    "amount": 1500
  },
  "next_billing_at": "2027-01-15T00:00:00.000Z",
  "source": "api",
  "sign_up_expires_at": null
}
StatusMeaning
200The subscription.
404not_found: no such subscription in your store; not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).
409not_paused: nothing to resume; canceled_by_customer: the customer cancelled it; conflict: the subscription changed meanwhile (try again).

Change the plan, quantity or add-ons#

HTTP
POST /api/v1/subscriptions/{subscription_id}/change

A change that raises the price the customer pays is never applied at once: it waits in pending_change (with increase) for the first period that starts at least 7 days after the customer is emailed a notice, which goes 7 to 30 days before the new price is first charged. Asking for proration: "now" on an increase is refused (409 price_increase_needs_notice); leave proration out (or send "next_period") to schedule it. Any other change applies at once by default: the rest of the current period is prorated and the difference for the time left (to the second, rounded half up) is credited to the next bills. With "next_period" it applies at the renewal (pending_change). A shipped subscription (each period is one order) and a plan with another interval change at the next period only; a paused subscription always does. The customer is emailed the new price.

ParameterInTypeRequiredDescription
subscription_idpathstring (uuid)YesA subscription of your store.

Request body (application/json)

FieldTypeRequiredDescription
plan_idstring (uuid)NoAnother plan of your store, in the same currency. A new plan drops any intro price left.
quantityinteger (≥ 1, ≤ 1000)No
addonsarray of object (≤ 20 items)NoReplaces every add-on ([] removes them).
addons[].plan_idstring (uuid)YesAn add-on of your store (kind: "addon"), in the plan's currency.
addons[].quantityinteger (≥ 1, ≤ 1000)NoDefault 1.
prorationone of now, next_periodNonow: applied at once; the rest of the period is prorated (a lower price is a credit on the next bills). A change that raises the price is never applied now (409 price_increase_needs_notice). next_period: applied at the renewal, or for a price increase from the first period at least 7 days after the customer's emailed notice. Left out: now, unless the change raises the price (then scheduled with the notice). A shipped subscription, or a plan with another interval, changes at the next period only (409 change_at_next_period otherwise); a paused one always does.
Request
{
  "plan_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "quantity": 2,
  "proration": "next_period"
}

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"subscription"Yes
store_idstring (uuid)Yes
customer_idstring (uuid)Yes
customerobject or nullYes
customer.emailstring or nullNo
customer.namestring or nullNo
statusone of incomplete, incomplete_expired, trialing, active, past_due, paused, canceledYesincomplete: waiting for the customer to sign up. incomplete_expired: they did not in time. trialing: in its free trial. active: paid up. past_due: a payment failed and is being retried. paused: nothing is charged or shipped. canceled: ended.
status_textstringYesThe status in plain words (Waiting for customer, Past due, …).
planobjectYes
plan.idstring (uuid)Yes
plan.namestringNo
plan.amountintegerNo
plan.currencystringNo
plan.intervalone of day, week, month, year or nullNo
plan.interval_countinteger or nullNo
quantityintegerYes
addonsarray of objectYes
addons[].plan_idstring (uuid)No
addons[].namestring or nullNo
addons[].amountinteger or nullNo
addons[].quantityintegerNo
introobject or nullYesThe intro price this subscription has, taken from its plan when it was created.
payment_methodobject or nullYesThe saved card it is charged to. Null until the customer signs up.
trial_endstring (date-time) or nullYesWhen the free trial ends (the first charge).
current_periodobject or nullYes
current_period.indexintegerNo0 for the first period.
current_period.startstring (date-time) or nullNo
current_period.endstring (date-time) or nullNo
current_period.amountinteger or nullNoWhat this period was billed, minor units.
next_billing_atstring (date-time) or nullYesWhen it is charged next, or resumes; null once ended.
credit_balanceintegerYesCredit from downgrades, taken off the next bills (minor units).
pending_changeobject or nullYesA change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_idstring (uuid)NoThis change: its notice is for it alone; a newer change is always told again.
pending_change.plan_idstring (uuid)No
pending_change.increaseobject or nullNoSet when the change raises the price: a bigger charge, or a higher price per day when the interval changes. It applies only to the period starting effective_at, with the customer's notice confirmed sent 7 to 30 days before that date. Its date follows the subscription's real schedule (after a pause, from the day it resumes); when that schedule moves, the date moves (version goes up) and the customer is told again.
pending_change.increase.fromintegerNoThe price per period before, minor units (per from_every).
pending_change.increase.tointegerNoThe price per period after, minor units (per to_every).
pending_change.increase.from_everystringNoThe period before, in words: every month.
pending_change.increase.to_everystringNoThe period after, in words: every week.
pending_change.increase.currencystringNo
pending_change.increase.effective_indexinteger or nullNoThe period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_atstring (date-time) or nullNoWhen that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_atstring (date-time) or nullNoWhen the email service accepted the notice; null until then (it goes 30 days before effective_at, and is tried again if it did not go).
pending_change.increase.versionintegerNoWhich notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantityintegerNo
pending_change.addonsarray of objectNo
pending_change.addons[].plan_idstring (uuid)No
pending_change.addons[].quantityintegerNo
cancel_at_period_endbooleanYesIt ends when the current period ends.
canceled_atstring (date-time) or nullYesWhen it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_atstring (date-time) or nullYes
cancel_reasonone of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or nullYesdunning: its payment failed on every retry. reminder_undeliverable: the reminder required 7 days before the first charge after a trial could not be emailed for 72 hours, so it ended without being charged.
pauseobject or nullYesA pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_endbooleanNo
pause.paused_atstring (date-time) or nullNo
pause.resume_atstring (date-time) or nullNoWhen it starts again by itself; null: when you (or the customer) resume it.
pause.reasonone of merchant, customer, api, dunning, or nullNo
shippingobject or nullYes
shipping.namestring or nullNo
shipping.addressobjectNo
shipping.address.line1stringNo
shipping.address.line2string or nullNo
shipping.address.citystringNo
shipping.address.statestring or nullNo
shipping.address.postal_codestringNo
shipping.address.countrystringNo
sourceone of dashboard, api, payment_link, checkoutYesHow it was started.
payment_link_idstring (uuid) or nullYesThe plan payment link the customer signed up through.
sign_up_expires_atstring (date-time) or nullYesWhile incomplete: when the sign-up link stops working.
metadataobjectYes
created_atstring (date-time)Yes
prorationobjectNoOnly for a change applied now.
proration.chargeintegerNoCharged now for the rest of the period, minor units. Always 0 since a price increase never applies at once (kept for compatibility).
proration.creditintegerNoCredited to the next bills (a downgrade), minor units.
proration.outcomeone of paid, processing, failed, resume_later, not_charged, or nullNoHow the charge went; null when nothing was charged.
Response
{
  "id": "7e2f9a1c-3b4d-4e5f-8a6b-9c0d1e2f3a4b",
  "object": "subscription",
  "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "customer_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "customer": {
    "email": "ada@example.com",
    "name": "Ada Lovelace"
  },
  "plan": {
    "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "name": "Monthly box",
    "amount": 3000,
    "currency": "USD",
    "interval": "month",
    "interval_count": 1
  },
  "quantity": 2,
  "addons": [],
  "intro": {
    "amount": 1500,
    "periods": 2
  },
  "credit_balance": 0,
  "pending_change": null,
  "cancel_at_period_end": false,
  "canceled_at": null,
  "ended_at": null,
  "cancel_reason": null,
  "pause": null,
  "shipping": {
    "name": "Ada Lovelace",
    "address": {
      "line1": "1 Main St",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "postal_code": "78701",
      "country": "US"
    }
  },
  "payment_link_id": null,
  "metadata": {},
  "created_at": "2026-12-01T00:00:00.000Z",
  "status": "active",
  "status_text": "Active",
  "payment_method": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "object": "payment_method",
    "type": "card",
    "brand": "Visa",
    "last4": "4242",
    "exp_month": 12,
    "exp_year": 2029,
    "funding": "credit",
    "country": "US",
    "wallet": null,
    "is_default": true,
    "status": "active",
    "expired": false,
    "saved_via": "save_card_page",
    "created_at": "2026-12-01T00:00:00.000Z",
    "last_used_at": "2026-12-15T00:00:00.000Z",
    "updated_by_card_network_at": null,
    "removed_at": null
  },
  "trial_end": "2026-12-15T00:00:00.000Z",
  "current_period": {
    "index": 0,
    "start": "2026-12-15T00:00:00.000Z",
    "end": "2027-01-15T00:00:00.000Z",
    "amount": 4500
  },
  "next_billing_at": "2027-01-15T00:00:00.000Z",
  "source": "api",
  "sign_up_expires_at": null,
  "proration": {
    "charge": 1452,
    "credit": 0,
    "outcome": "paid"
  }
}
StatusMeaning
200The subscription; for a change applied now, with proration.
400invalid_request: the message names the first invalid field (also nothing to change, or an add-on listed twice or in another currency); currency_mismatch: the new plan is in another currency; invalid_json: the body is not JSON.
404not_found, plan_not_found or addon_not_found; not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).
409not_changeable: it is not active, trialing or paused (a past-due subscription must be paid first); price_increase_needs_notice: the change raises the price, so it cannot apply now: leave proration out or use "next_period"; change_at_next_period: it ships, or the new plan has another interval: use proration: "next_period"; plan_inactive: the new plan or an add-on is archived; store_inactive; conflict: the subscription changed meanwhile (try again).
422shipping_address_required: the new plan ships and the subscription has no shipping address: set one with PATCH first.

Retry a past-due payment now#

HTTP
POST /api/v1/subscriptions/{subscription_id}/retry

Charges a past-due subscription's unpaid bills to its card now, instead of waiting for the next scheduled retry (for example after the customer told you they fixed their card).

ParameterInTypeRequiredDescription
subscription_idpathstring (uuid)YesA subscription of your store.

No request body. Sign it as an empty body.

Response 200

FieldTypeAlways presentDescription
idstring (uuid)Yes
object"subscription"Yes
store_idstring (uuid)Yes
customer_idstring (uuid)Yes
customerobject or nullYes
customer.emailstring or nullNo
customer.namestring or nullNo
statusone of incomplete, incomplete_expired, trialing, active, past_due, paused, canceledYesincomplete: waiting for the customer to sign up. incomplete_expired: they did not in time. trialing: in its free trial. active: paid up. past_due: a payment failed and is being retried. paused: nothing is charged or shipped. canceled: ended.
status_textstringYesThe status in plain words (Waiting for customer, Past due, …).
planobjectYes
plan.idstring (uuid)Yes
plan.namestringNo
plan.amountintegerNo
plan.currencystringNo
plan.intervalone of day, week, month, year or nullNo
plan.interval_countinteger or nullNo
quantityintegerYes
addonsarray of objectYes
addons[].plan_idstring (uuid)No
addons[].namestring or nullNo
addons[].amountinteger or nullNo
addons[].quantityintegerNo
introobject or nullYesThe intro price this subscription has, taken from its plan when it was created.
payment_methodobject or nullYesThe saved card it is charged to. Null until the customer signs up.
trial_endstring (date-time) or nullYesWhen the free trial ends (the first charge).
current_periodobject or nullYes
current_period.indexintegerNo0 for the first period.
current_period.startstring (date-time) or nullNo
current_period.endstring (date-time) or nullNo
current_period.amountinteger or nullNoWhat this period was billed, minor units.
next_billing_atstring (date-time) or nullYesWhen it is charged next, or resumes; null once ended.
credit_balanceintegerYesCredit from downgrades, taken off the next bills (minor units).
pending_changeobject or nullYesA change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_idstring (uuid)NoThis change: its notice is for it alone; a newer change is always told again.
pending_change.plan_idstring (uuid)No
pending_change.increaseobject or nullNoSet when the change raises the price: a bigger charge, or a higher price per day when the interval changes. It applies only to the period starting effective_at, with the customer's notice confirmed sent 7 to 30 days before that date. Its date follows the subscription's real schedule (after a pause, from the day it resumes); when that schedule moves, the date moves (version goes up) and the customer is told again.
pending_change.increase.fromintegerNoThe price per period before, minor units (per from_every).
pending_change.increase.tointegerNoThe price per period after, minor units (per to_every).
pending_change.increase.from_everystringNoThe period before, in words: every month.
pending_change.increase.to_everystringNoThe period after, in words: every week.
pending_change.increase.currencystringNo
pending_change.increase.effective_indexinteger or nullNoThe period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_atstring (date-time) or nullNoWhen that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_atstring (date-time) or nullNoWhen the email service accepted the notice; null until then (it goes 30 days before effective_at, and is tried again if it did not go).
pending_change.increase.versionintegerNoWhich notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantityintegerNo
pending_change.addonsarray of objectNo
pending_change.addons[].plan_idstring (uuid)No
pending_change.addons[].quantityintegerNo
cancel_at_period_endbooleanYesIt ends when the current period ends.
canceled_atstring (date-time) or nullYesWhen it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_atstring (date-time) or nullYes
cancel_reasonone of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or nullYesdunning: its payment failed on every retry. reminder_undeliverable: the reminder required 7 days before the first charge after a trial could not be emailed for 72 hours, so it ended without being charged.
pauseobject or nullYesA pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_endbooleanNo
pause.paused_atstring (date-time) or nullNo
pause.resume_atstring (date-time) or nullNoWhen it starts again by itself; null: when you (or the customer) resume it.
pause.reasonone of merchant, customer, api, dunning, or nullNo
shippingobject or nullYes
shipping.namestring or nullNo
shipping.addressobjectNo
shipping.address.line1stringNo
shipping.address.line2string or nullNo
shipping.address.citystringNo
shipping.address.statestring or nullNo
shipping.address.postal_codestringNo
shipping.address.countrystringNo
sourceone of dashboard, api, payment_link, checkoutYesHow it was started.
payment_link_idstring (uuid) or nullYesThe plan payment link the customer signed up through.
sign_up_expires_atstring (date-time) or nullYesWhile incomplete: when the sign-up link stops working.
metadataobjectYes
created_atstring (date-time)Yes
retryarray of one of paid, processing, failed, resume_later, not_chargedYesHow each unpaid bill's charge went, oldest first.
Response
{
  "id": "7e2f9a1c-3b4d-4e5f-8a6b-9c0d1e2f3a4b",
  "object": "subscription",
  "store_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "customer_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "customer": {
    "email": "ada@example.com",
    "name": "Ada Lovelace"
  },
  "plan": {
    "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "name": "Monthly box",
    "amount": 3000,
    "currency": "USD",
    "interval": "month",
    "interval_count": 1
  },
  "quantity": 1,
  "addons": [],
  "intro": {
    "amount": 1500,
    "periods": 2
  },
  "credit_balance": 0,
  "pending_change": null,
  "cancel_at_period_end": false,
  "canceled_at": null,
  "ended_at": null,
  "cancel_reason": null,
  "pause": null,
  "shipping": {
    "name": "Ada Lovelace",
    "address": {
      "line1": "1 Main St",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "postal_code": "78701",
      "country": "US"
    }
  },
  "payment_link_id": null,
  "metadata": {},
  "created_at": "2026-12-01T00:00:00.000Z",
  "status": "active",
  "status_text": "Active",
  "payment_method": {
    "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
    "object": "payment_method",
    "type": "card",
    "brand": "Visa",
    "last4": "4242",
    "exp_month": 12,
    "exp_year": 2029,
    "funding": "credit",
    "country": "US",
    "wallet": null,
    "is_default": true,
    "status": "active",
    "expired": false,
    "saved_via": "save_card_page",
    "created_at": "2026-12-01T00:00:00.000Z",
    "last_used_at": "2026-12-15T00:00:00.000Z",
    "updated_by_card_network_at": null,
    "removed_at": null
  },
  "trial_end": "2026-12-15T00:00:00.000Z",
  "current_period": {
    "index": 0,
    "start": "2026-12-15T00:00:00.000Z",
    "end": "2027-01-15T00:00:00.000Z",
    "amount": 1500
  },
  "next_billing_at": "2027-01-15T00:00:00.000Z",
  "source": "api",
  "sign_up_expires_at": null,
  "retry": [
    "paid"
  ]
}
StatusMeaning
200The subscription, with how each charge went.
404not_found: no such subscription in your store; not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).
409not_past_due: only a past-due subscription is retried.

Webhooks#

OnCharge sends these events to your webhook endpoint. Verification and handling: Webhooks.

EventWhen
payment.pendingThe shopper started paying but the money has not arrived yet. Do not ship yet. On a gateway wallet, a payment seen on the chain and not confirmed yet.
payment.authorizedThe card was approved and the money is held for you. It is collected next.
payment.capturedThe shopper paid. Mark the order as paid and ship it. For crypto and Card to Crypto paid to your own wallet, the payout is already on its way to it.
payment.under_reviewA payment to your wallet arrived but does not match the order (for example a different amount), so check it before you ship.
payment.refusedThe payment was declined. The order is not paid; the shopper can try again. When OnCharge refused it because the store reached a limit set on its account, data.reason is limit_exceeded and nothing was sent to the bank.
payment.cancelledThe payment was cancelled before it was collected. Nothing was charged.
payment.expiredThe shopper did not finish paying in time. Nothing was charged.
payment.capture_failedAn approved payment could not be collected. The order is not paid.
refund.succeededA refund went through. The amount is the total refunded on this order so far.
refund.failedA refund could not be sent. Nothing was taken from your balance.
chargeback.openedThe shopper asked their bank to reverse this payment. OnCharge helps you answer it.
dispute.evidence_dueA dispute needs its evidence by the date given. OnCharge answers for you where it can; the dispute page says what is still missing. Sent once per dispute and deadline.
chargeback.wonThe bank decided in your favour. You keep the money.
chargeback.lostThe bank decided for the shopper. The payment is reversed.
fraud_warning.receivedThe cardholder's bank reported this payment as fraud. Do not ship it yet: the payout is on hold, and OnCharge may refund it to stop a dispute.
delivery.confirmedEvery package of the order was confirmed delivered by the carrier. Sent once per order.
payout.paidA payout reached your bank, or (a debit card payout, method "instant") your debit card, with fee taken out. Payouts pay orders whose delivery was confirmed.
payout.failedA payout could not be delivered to your bank. The money is safe and is sent again; the problem says whether your bank details need fixing. A debit card payout that fails goes to your bank instead, its fee refunded.
payout.returnedYour bank sent a payout back after it arrived. The money is sent again once working bank details are on file.
account.updatedWhat your account can do changed: taking payments, receiving payouts, or what it needs from you.
account.requirements_dueYour account needs more information by the deadline, or it stops taking payments. Provide it under Settings. Sent once per change.
account.restrictedYour account stopped taking payments or receiving payouts. The reason says what to do.
swap.createdA conversion was created and waits for the coins to arrive.
swap.completedA crypto payment was converted to the coin you are paid in and sent to your wallet.
swap.failedA crypto payment could not be converted. The coins go back to the sender, or OnCharge contacts you.
swap.refundedA conversion could not finish, and the coins were sent back to the sender.
swap.expiredNo coins arrived before the conversion's quote ran out. Nothing was converted.
support.conversation.createdA customer started a conversation by email, chat or phone. Not sent yet: the sample shows what will arrive.
support.message.receivedA customer wrote in an open conversation. Not sent yet: the sample shows what will arrive.
support.conversation.closedA conversation was marked as done by your team, an OnCharge rep or the AI assistant. Not sent yet: the sample shows what will arrive.
subscription.createdA customer agreed to a subscription and it started: its trial began, or its first period was paid.
subscription.updatedThe plan, quantity, card, or a waiting cancellation or pause changed. data.change says what: plan_changed (with prorated_charge and prorated_credit), change_scheduled (with pending_change), price_increase_notice (the customer was emailed the notice of a price increase, with price_increase), change_applied, payment_method, cancel_scheduled, pause_scheduled, kept (a waiting cancellation or pause was called off), trial_ended or payment_recovered.
subscription.trial_will_endA trial ends soon and the customer was reminded: 7 days ahead for a trial of 14 days or more, 3 days for 7 to 13 days, 1 day for 3 to 6 days. Sent once per trial.
subscription.past_dueA period's payment failed. OnCharge retries it 1, 3, 7 and 14 days after the first failure (unless it waits for the customer) and asked the customer to check their card.
subscription.pausedThe subscription paused: nothing is charged or shipped until it resumes (data.resume_at, or when you resume it).
subscription.resumedA paused subscription started again; a new period began and was charged.
subscription.canceledThe subscription ended: cancelled by you or the customer, or after its payment failed on every retry (data.cancel_reason).
subscription.period.paidA period (or a plan change) was paid. If it ships, ship it and report its tracking number with data.session_id: its payout is released on carrier-confirmed delivery, like any order.
subscription.period.payment_failedA charge for a period failed. data.failure says why and data.next_attempt_at when it is tried again (null: it waits for the customer).

Headers

HeaderDescription
OnCharge-Event-IdUnique event ID (evt_…). Deduplicate on it; the same event may be delivered more than once.
OnCharge-Signaturet=<unix seconds>,v1=<hex> where v1 = lower-case hex HMAC-SHA256(webhook signing secret, "<t>.<raw body>"). The key is your webhook signing secret (oc_cbsec_…) as given. Compare in constant time and reject events where |now - t| > 300.
X-Oncharge-SignatureDeprecated. Legacy body-only signature kept for older plugins. Verify OnCharge-Signature instead.

Event body

FieldTypeAlways presentDescription
idstringYesEvent ID (evt_…), the same as the OnCharge-Event-Id header.
typeone of payment.pending, payment.authorized, payment.captured, payment.under_review, payment.refused, payment.cancelled, payment.expired, payment.capture_failed, refund.succeeded, refund.failed, chargeback.opened, dispute.evidence_due, chargeback.won, chargeback.lost, fraud_warning.received, delivery.confirmed, payout.paid, payout.failed, payout.returned, account.updated, account.requirements_due, account.restricted, swap.created, swap.completed, swap.failed, swap.refunded, swap.expired, subscription.created, subscription.updated, subscription.trial_will_end, subscription.past_due, subscription.paused, subscription.resumed, subscription.canceled, subscription.period.paid, subscription.period.payment_failed, support.conversation.created, support.message.received, support.conversation.closedYesEvery event type. Payments on every rail use the same payment.* types (data.rail says which). Handle the types you need and acknowledge (2xx) any others; new types may be added.
createdintegerYesUnix time (seconds) the event was created.
livemodebooleanYesfalse for events from test payments.
dataobjectYesFor payment events from a checkout, the fields below. Crypto and Card to Crypto paid to your wallet carry session_id: null with payment_id, source, method, coin, coin_amount, wallet and transaction hashes; every other event its own fields. All of them carry rail.
data.session_idstring or nullNoThe checkout session; null for a payment paid straight to your wallet.
data.order_idstring or nullNoYour order ID, if known.
data.referencestring or nullNoThe reference you sent when creating the session.
data.amountinteger or nullNoMinor units. For refund.succeeded, the total refunded so far.
data.currencystring or nullNoISO 4217 code.
data.statusstring or nullNoThe order's payment status after the event (for example captured, refunded).
data.railone of card, crypto, card_to_cryptoYesThe rail an event or payment is on: card checkout; crypto (crypto checkout, or a coin paid straight to your wallet through the plugin or the gateway API); or Card to Crypto (card, Cash App or Venmo paid out to your wallet in USDC).
data.payment_referencestring or nullNoOnCharge's reference for the payment (ocpay_…).
data.payment_link_idstring (uuid) or nullNoThe payment link the checkout was made from (/api/v1/payment-links), or null.
data.invoice_idstring (uuid)NoOnly on a payment for an OnCharge invoice: the invoice's id (see Invoices).
data.payment_methodone of card, bank_debit, cash_app_pay, klarna, affirm, afterpay, or nullNoHow the shopper paid: card, or a way to pay beyond cards the store turned on (bank debit, Cash App Pay, Klarna, Affirm, Afterpay; see the Payment methods guide). Null for crypto.
data.taxobject or nullNoSales tax on the payment, on payment, refund and chargeback events of a taxed payment only.
data.tax.statusone of awaiting_address, calculated, pending, failed, collected, partly_refunded, refundedYesawaiting_address: no address yet, the payment waits. calculated: not paid yet. pending: tax included, charged while the calculation was unavailable; worked out shortly. failed: the calculation failed (error), the payment waits. collected, partly_refunded, refunded: paid, and how much of the tax was given back.
data.tax.inclusivebooleanYestrue when the listed prices include the tax.
data.tax.currencystring or nullYes
data.tax.subtotalinteger or nullYesBefore tax, minor units.
data.tax.amountinteger or nullYesThe tax, minor units.
data.tax.totalinteger or nullYesWhat the customer pays, minor units.
data.tax.shippingintegerYesThe shipping charge inside the total, minor units.
data.tax.jurisdictionsarray of objectYes
data.tax.refundedintegerYesTax given back so far with refunds and lost disputes, minor units.
data.tax.errorstring or nullYestax_address_invalid or tax_unavailable when status is failed.
data.reasonone of limit_exceededNoOnly on payment.refused when OnCharge refused the payment itself: limit_exceeded (the store reached a limit OnCharge set on its account, such as a daily volume cap). Absent when the bank declined it.
eventone of payment.pending, payment.authorized, payment.captured, payment.under_review, payment.refused, payment.cancelled, payment.expired, payment.capture_failed, refund.succeeded, refund.failed, chargeback.opened, dispute.evidence_due, chargeback.won, chargeback.lost, fraud_warning.received, delivery.confirmed, payout.paid, payout.failed, payout.returned, account.updated, account.requirements_due, account.restricted, swap.created, swap.completed, swap.failed, swap.refunded, swap.expired, subscription.created, subscription.updated, subscription.trial_will_end, subscription.past_due, subscription.paused, subscription.resumed, subscription.canceled, subscription.period.paid, subscription.period.payment_failed, support.conversation.created, support.message.received, support.conversation.closedNoSame as type. Kept for older plugins; only on payment events from a checkout. Deprecated.
statusstring or nullNoSame as data.status. Kept for older plugins; only on payment events from a checkout. Deprecated.
psp_referencestring or nullNoKept for older plugins, which store it as the order's transaction id: a payment made before 2026-12-01 keeps its original value here; from 2026-12-01 on it is the payment's OnCharge reference (ocpay_…, the same as data.payment_reference). Only on payment events from a checkout. Deprecated.
payment.captured