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.
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).
Parameter
In
Type
Required
Description
Idempotency-Key
header
string
No
A unique key (up to 255 characters is safe) that makes retries of this request safe.
Request body (application/json)
Field
Type
Required
Description
amount
integer (≥ 1)
Yes
Amount in the currency's minor unit (cents for USD).
currency
string (min 3 chars, max 3 chars)
Yes
ISO 4217 currency code.
reference
string (min 1 chars, max 255 chars)
Yes
Your reference for this payment (order number or cart ID). Returned in webhooks.
return_url
string (uri)
Yes
Where the shopper is sent after checkout. Must be on a registered store domain.
order_id
string (max 255 chars)
No
Your order ID, if the order already exists. Otherwise attach it later.
customer_email
string (email)
No
customer_phone
string
No
E.164 format recommended (+15551234567).
metadata
object
No
Your own key-value data, stored with the session.
shipping
object
No
Where 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.name
string (max 200 chars)
No
shipping.line1
string (max 300 chars)
No
shipping.line2
string (max 300 chars)
No
shipping.city
string (max 120 chars)
No
shipping.state
string (max 120 chars)
No
shipping.postal_code
string (max 20 chars)
No
shipping.country
string (max 60 chars)
No
ISO 3166-1 alpha-2 code recommended (US).
line_items
array of object
No
line_items[].description
string
Yes
line_items[].quantity
integer (≥ 1)
Yes
line_items[].amount_including_tax
integer (≥ 0)
Yes
Line amount in minor units, tax included.
line_items[].requires_shipping
boolean
No
Whether 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_category
one 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_cards
No
An OnCharge product tax category.
customer_id
string (uuid)
No
Your OnCharge customer (POST /api/v1/customers): the payment is theirs, and a card they choose to save is saved for them.
save_card
boolean
No
Offer 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.
tax
object
No
Sales 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.enabled
boolean
Yes
Calculate sales tax. Store plugins that already add their platform's tax should leave this off.
tax.shipping_amount
integer (≥ 0)
No
The shipping charge inside amount, minor units: taxed as shipping.
one of created, pending, authorized, captured, refused, cancelled, error, expired
Yes
created (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_url
string
Yes
Path 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_token
string
Yes
Short-lived token (30 minutes) that authorizes the checkout page. Already included in iframe_url.
created_at
string (date-time)
Yes
expires_at
string (date-time)
Yes
shipping_required
boolean
No
Present (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.
amount
integer
No
With sales tax: what the shopper pays (the calculated total, once the address is known).
tax
object or null
No
Sales tax on a payment; null when it is not taxed.
tax.status
one of awaiting_address, calculated, pending, failed, collected, partly_refunded, refunded
Yes
awaiting_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.inclusive
boolean
Yes
true when the listed prices include the tax.
tax.currency
string or null
Yes
tax.subtotal
integer or null
Yes
Before tax, minor units.
tax.amount
integer or null
Yes
The tax, minor units.
tax.total
integer or null
Yes
What the customer pays, minor units.
tax.shipping
integer
Yes
The shipping charge inside the total, minor units.
tax.jurisdictions
array of object
Yes
tax.jurisdictions[].state
string or null
No
tax.jurisdictions[].rate
string
No
Combined percent, e.g. "8.25".
tax.jurisdictions[].amount
integer
No
tax.refunded
integer
Yes
Tax given back so far with refunds and lost disputes, minor units.
tax.error
string or null
Yes
tax_address_invalid or tax_unavailable when status is failed.
Idempotent replay: an open session created with the same Idempotency-Key within the last 50 minutes. A fresh pay_token is issued.
201
Session created.
400
validation_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).
403
store_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).
422
shipping_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.
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.
Parameter
In
Type
Required
Description
session_id
path
string (uuid)
Yes
The checkout session ID returned when the session was created.
Response200
Field
Type
Always present
Description
session_id
string (uuid)
Yes
store_id
string (uuid)
Yes
order_id
string or null
No
amount
integer (≥ 1)
Yes
Amount in the currency's minor unit (cents for USD).
currency
string (min 3 chars, max 3 chars)
Yes
ISO 4217 currency code.
status
one of created, pending, authorized, captured, refused, cancelled, error, expired
Yes
created (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_reference
string
Yes
OnCharge's reference for the payment: ocpay_ and the session id in lowercase hex without dashes, for every session. Never a payment processor id.
psp_reference
string or null
No
Kept 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_method
one of card, bank_debit, cash_app_pay, klarna, affirm, afterpay, or null
No
How 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.
settlement
one of verify_deposits, processing, settled, or null
No
A 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_decision
one of accept, review, reject, or null
No
Outcome of the checkout risk check.
risk_score
number or null
No
Risk score 0–100.
created_at
string (date-time)
Yes
updated_at
string (date-time)
Yes
expires_at
string (date-time)
Yes
tax
object or null
No
Sales tax on a payment; null when it is not taxed.
tax.status
one of awaiting_address, calculated, pending, failed, collected, partly_refunded, refunded
Yes
awaiting_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.inclusive
boolean
Yes
true when the listed prices include the tax.
tax.currency
string or null
Yes
tax.subtotal
integer or null
Yes
Before tax, minor units.
tax.amount
integer or null
Yes
The tax, minor units.
tax.total
integer or null
Yes
What the customer pays, minor units.
tax.shipping
integer
Yes
The shipping charge inside the total, minor units.
tax.jurisdictions
array of object
Yes
tax.jurisdictions[].state
string or null
No
tax.jurisdictions[].rate
string
No
Combined percent, e.g. "8.25".
tax.jurisdictions[].amount
integer
No
tax.refunded
integer
Yes
Tax given back so far with refunds and lost disputes, minor units.
tax.error
string or null
Yes
tax_address_invalid or tax_unavailable when status is failed.
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.
Parameter
In
Type
Required
Description
session_id
path
string (uuid)
Yes
The checkout session ID returned when the session was created.
Request body (application/json)
Field
Type
Required
Description
order_id
string (min 1 chars, max 255 chars)
No
shipping
object
No
Where 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.
true if the session has a shipping destination (from this or an earlier call).
amount
integer
No
With sales tax: the total now that the address is known.
tax
object or null
No
Sales tax on a payment; null when it is not taxed.
tax.status
one of awaiting_address, calculated, pending, failed, collected, partly_refunded, refunded
Yes
awaiting_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.inclusive
boolean
Yes
true when the listed prices include the tax.
tax.currency
string or null
Yes
tax.subtotal
integer or null
Yes
Before tax, minor units.
tax.amount
integer or null
Yes
The tax, minor units.
tax.total
integer or null
Yes
What the customer pays, minor units.
tax.shipping
integer
Yes
The shipping charge inside the total, minor units.
tax.jurisdictions
array of object
Yes
tax.jurisdictions[].state
string or null
No
tax.jurisdictions[].rate
string
No
Combined percent, e.g. "8.25".
tax.jurisdictions[].amount
integer
No
tax.refunded
integer
Yes
Tax given back so far with refunds and lost disputes, minor units.
tax.error
string or null
Yes
tax_address_invalid or tax_unavailable when status is failed.
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)
Field
Type
Required
Description
session_id
string (uuid)
No
order_id
string (min 1 chars, max 255 chars)
No
shipments
array of object (≥ 1 items, ≤ 10 items)
Yes
shipments[].carrier
string or null (max 60 chars)
No
USPS, UPS, FedEx or DHL Express, or a shipping tool's code for one. Optional when the tracking number format identifies the carrier.
shipments[].tracking_number
string (min 1 chars, max 80 chars)
Yes
Spaces and dashes are ignored; 8–40 letters and digits after normalization.
shipments[].replaces
string or null (max 80 chars)
No
The tracking number (or shipment id) on this order that this one replaces.
Normalized carrier. Common spellings are accepted on input (USPS, United States Postal Service, UPS, FedEx, FedEx Ground, DHL, DHL Express, …).
shipments[].status
one of accepted, rejected
Yes
shipments[].error
one of carrier_not_supported, tracking_number_invalid, carrier_mismatch, tracking_number_in_use, too_many_shipments, replacement_not_found, replacement_not_allowed
No
shipments[].message
string
No
shipments[].replaced
array of string
No
Tracking numbers this one replaced.
delivery
object
Yes
delivery.state
one of not_tracked, awaiting_shipment, in_transit, delivered, on_hold, refunded
Yes
not_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.
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.
Parameter
In
Type
Required
Description
session_id
query
string (uuid)
Yes
The checkout session ID.
Response200
Field
Type
Always present
Description
session_id
string (uuid)
Yes
delivery
object
Yes
delivery.state
one of not_tracked, awaiting_shipment, in_transit, delivered, on_hold, refunded
Yes
not_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_reason
string or null
Yes
Plain-language reason when state is on_hold.
delivery.delivered_at
string (date-time) or null
Yes
When the last package was confirmed delivered.
delivery.shipments
array of object
Yes
delivery.shipments[].id
string (uuid)
Yes
delivery.shipments[].carrier
one of usps, ups, fedex, dhl_express
Yes
Normalized carrier. Common spellings are accepted on input (USPS, United States Postal Service, UPS, FedEx, FedEx Ground, DHL, DHL Express, …).
delivery.shipments[].carrier_label
string
Yes
delivery.shipments[].tracking_number
string
Yes
delivery.shipments[].status
one of pending, pre_transit, in_transit, out_for_delivery, delivered, available_for_pickup, return_to_sender, failure, cancelled, unknown
Yes
Latest carrier status.
delivery.shipments[].result
one of checking, confirmed, problem, replaced
Yes
confirmed 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[].problems
array of string
Yes
delivery.shipments[].delivered_at
string (date-time) or null
No
delivery.shipments[].delivered_to
string or null
No
City, state and postal code the carrier reported.
delivery.shipments[].note
string or null
No
delivery.shipments[].removable
boolean
Yes
delivery.shipments[].created_at
string (date-time)
Yes
delivery.shipments[].replaceable
boolean
No
delivery.shipments[].replaced_by
string (uuid) or null
No
delivery.action_required
string or null
No
What to do now, if anything (add tracking, re-ship or refund).
delivery.auto_refund_at
string (date-time) or null
No
When the shopper is refunded in full automatically if the order is still not confirmed delivered.
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.
Parameter
In
Type
Required
Description
Idempotency-Key
header
string
No
A unique key (up to 255 characters is safe) that makes retries of this request safe.
Request body (application/json)
Field
Type
Required
Description
session_id
string (uuid)
Yes
amount
integer (≥ 1)
Yes
Amount in the currency's minor unit (cents for USD).
The store's 50 most recent disputes, newest first.
Newest first, paged by cursor: pass next_cursor back as cursor. Filters are optional.
Parameter
In
Type
Required
Description
status
query
one of open, won, lost
No
reason
query
one of fraudulent, product_not_received, product_unacceptable, duplicate, subscription_canceled, credit_not_processed, unrecognized, general
No
due_before
query
string (date)
No
Evidence due on or before this day (UTC).
from
query
string (date)
No
Opened on or after this day (UTC).
to
query
string (date)
No
Opened on or before this day (UTC).
min
query
string
No
Smallest amount, in major units.
max
query
string
No
Largest amount, in major units.
q
query
string
No
A dispute or payment reference, a dispute id, or an order number.
limit
query
integer
No
cursor
query
string
No
next_cursor of the previous page.
Response200
Field
Type
Always present
Description
disputes
array of object
Yes
disputes[].id
string (uuid)
Yes
disputes[].reference
string
No
OnCharge's reference for the dispute (ocdsp_ and its id in hex).
disputes[].store_id
string (uuid)
Yes
disputes[].session_id
string (uuid) or null
Yes
The checkout session of the disputed payment.
disputes[].merchant_reference
string or null
Yes
Your own order reference.
disputes[].payment_reference
string or null
Yes
Kept 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_reference
string or null
No
The 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_amount
integer or null
Yes
Amount of the original payment, minor units.
disputes[].dispute_amount
integer or null
Yes
Disputed amount, minor units.
disputes[].currency
string or null
Yes
disputes[].reason
string or null
Yes
disputes[].reason_label
string
No
The reason in plain words.
disputes[].reason_code
string or null
Yes
disputes[].status
one of notification_of_chargeback, chargeback, second_chargeback, prearbitration, defense_pending, defended, accepted, won, lost
Yes
disputes[].status_label
string
No
The status in plain words.
disputes[].defense_deadline
string (date-time) or null
Yes
When evidence must be in.
disputes[].evidence_submitted_at
string (date-time) or null
Yes
disputes[].closed_at
string (date-time) or null
Yes
disputes[].responded_by
one of oncharge, merchant
Yes
oncharge: 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_at
string (date-time)
Yes
disputes[].updated_at
string (date-time)
Yes
next_cursor
string or null
No
Pass as cursor for the next page; null on the last page.
A dispute with the evidence files uploaded for it.
Parameter
In
Type
Required
Description
dispute_id
path
string (uuid)
Yes
Response200
Field
Type
Always present
Description
dispute
object
Yes
A dispute (chargeback) on one of your payments.
dispute.id
string (uuid)
Yes
dispute.reference
string
No
OnCharge's reference for the dispute (ocdsp_ and its id in hex).
dispute.store_id
string (uuid)
Yes
dispute.session_id
string (uuid) or null
Yes
The checkout session of the disputed payment.
dispute.merchant_reference
string or null
Yes
Your own order reference.
dispute.payment_reference
string or null
Yes
Kept 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_reference
string or null
No
The 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_amount
integer or null
Yes
Amount of the original payment, minor units.
dispute.dispute_amount
integer or null
Yes
Disputed amount, minor units.
dispute.currency
string or null
Yes
dispute.reason
string or null
Yes
dispute.reason_label
string
No
The reason in plain words.
dispute.reason_code
string or null
Yes
dispute.status
one of notification_of_chargeback, chargeback, second_chargeback, prearbitration, defense_pending, defended, accepted, won, lost
Yes
dispute.status_label
string
No
The status in plain words.
dispute.defense_deadline
string (date-time) or null
Yes
When evidence must be in.
dispute.evidence_submitted_at
string (date-time) or null
Yes
dispute.closed_at
string (date-time) or null
Yes
dispute.responded_by
one of oncharge, merchant
Yes
oncharge: 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.
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.
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.
not_found: the object does not exist or belongs to another store.
409
responded_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.
502
dispute_action_failed: the action could not be completed right now. Retry later or contact support.
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.
not_found: the object does not exist or belongs to another store.
409
responded_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.
502
dispute_action_failed: the action could not be completed right now. Retry later or contact support.
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.
Parameter
In
Type
Required
Description
dispute_id
path
string (uuid)
Yes
No request body. Sign it as an empty body.
Response200
Field
Type
Always present
Description
dispute_id
string (uuid)
Yes
success
boolean
Yes
message
string
No
Defence submitted. on success, otherwise a neutral explanation.
not_found: the object does not exist or belongs to another store.
409
responded_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.
500
build_failed (the evidence packet could not be built) or internal_error.
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.
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.
Parameter
In
Type
Required
Description
Idempotency-Key
header
string
No
A unique key (up to 255 characters is safe) that makes retries of this request safe.
customer_id
path
string (uuid)
Yes
An OnCharge customer ID of your store.
Request body (application/json)
Field
Type
Required
Description
return_url
string (uri)
No
https, on one of your store's domains: where the customer returns once the card is saved.
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.
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.
Parameter
In
Type
Required
Description
Idempotency-Key
header
string
No
A unique key (up to 255 characters is safe) that makes retries of this request safe.
customer_id
path
string (uuid)
Yes
An OnCharge customer ID of your store.
Request body (application/json)
Field
Type
Required
Description
amount
integer (≥ 1)
Yes
Amount in the currency's minor unit (cents for USD).
currency
string (min 3 chars, max 3 chars)
Yes
ISO 4217 currency code.
payment_method_id
string (uuid)
No
A saved card of this customer. The default card when omitted.
reference
string (max 255 chars)
No
order_id
string (max 255 chars)
No
description
string (max 500 chars)
No
shipping
object
No
Where 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.name
string (max 200 chars)
No
shipping.line1
string (max 300 chars)
No
shipping.line2
string (max 300 chars)
No
shipping.city
string (max 120 chars)
No
shipping.state
string (max 120 chars)
No
shipping.postal_code
string (max 20 chars)
No
shipping.country
string (max 60 chars)
No
ISO 3166-1 alpha-2 code recommended (US).
line_items
array of object (≤ 500 items)
No
line_items[].description
string
Yes
line_items[].quantity
integer (≥ 1)
Yes
line_items[].amount_including_tax
integer (≥ 0)
Yes
Line amount in minor units, tax included.
line_items[].requires_shipping
boolean
No
Whether 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_category
one 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_cards
No
An OnCharge product tax category.
metadata
object
No
tax
object
No
Sales 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.enabled
boolean
Yes
Calculate sales tax. Store plugins that already add their platform's tax should leave this off.
tax.shipping_amount
integer (≥ 0)
No
The shipping charge inside amount, minor units: taxed as shipping.
The payment, as for a checkout session: refunds, shipments and webhooks use it.
payment_reference
string
Yes
status
one of succeeded, processing, requires_authentication, declined, failed
Yes
succeeded: 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.
amount
integer
Yes
currency
string
Yes
customer_id
string (uuid)
Yes
payment_method_id
string (uuid)
Yes
order_id
string or null
No
created_at
string (date-time)
Yes
decline
object or null
Yes
decline.reason
one of insufficient_funds, expired_card, incorrect_details, authentication_required, card_not_supported, try_again_later, suspected_fraud, card_declined, limit_exceeded
Yes
decline.message
string
Yes
What happened and what to do, in plain words.
authentication
object or null
Yes
authentication.emailed
boolean
Yes
OnCharge 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_required
true
No
The order ships by carrier and has no address yet: attach it with POST /api/v1/checkout/sessions/{session_id}/order.
idempotent
true
No
A retry with the same Idempotency-Key returned the first charge.
tax
object or null
No
Sales tax on a payment; null when it is not taxed.
tax.status
one of awaiting_address, calculated, pending, failed, collected, partly_refunded, refunded
Yes
awaiting_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.inclusive
boolean
Yes
true when the listed prices include the tax.
tax.currency
string or null
Yes
tax.subtotal
integer or null
Yes
Before tax, minor units.
tax.amount
integer or null
Yes
The tax, minor units.
tax.total
integer or null
Yes
What the customer pays, minor units.
tax.shipping
integer
Yes
The shipping charge inside the total, minor units.
tax.jurisdictions
array of object
Yes
tax.jurisdictions[].state
string or null
No
tax.jurisdictions[].rate
string
No
Combined percent, e.g. "8.25".
tax.jurisdictions[].amount
integer
No
tax.refunded
integer
Yes
Tax given back so far with refunds and lost disputes, minor units.
tax.error
string or null
Yes
tax_address_invalid or tax_unavailable when status is failed.
The charge made earlier with this Idempotency-Key (idempotent: true).
201
Charge made: succeeded, processing or requires_authentication.
400
validation_error (the message lists each invalid field) or invalid_json.
402
Declined: 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.
404
not_found: the object does not exist or belongs to another store.
409
no_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.
502
try_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.
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.
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)
Field
Type
Required
Description
shopper_email
string (email)
Yes
amount
integer (≥ 1)
Yes
Amount in the currency's minor unit (cents for USD).
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.
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)
Field
Type
Required
Description
items
array of object (≤ 500 items)
No
Products to add or update.
items[].id
string (min 1 chars, max 50 chars)
Yes
Your product ID (WooCommerce: the product or variation ID). Unique per store.
items[].item_group_id
string or null (max 50 chars)
No
Groups the variants of one product (WooCommerce: the parent product ID).
items[].title
string (min 1 chars, max 1000 chars)
Yes
Product name. Stored cut to 150 characters.
items[].description
string or null (max 20000 chars)
No
Plain text or HTML (tags and shortcodes are removed). Stored cut to 5,000 characters.
items[].link
string (uri) (max 2048 chars)
Yes
Product page. Must be https; a product with an http link is rejected (or, if already stored, excluded).
items[].image_link
string (uri) or null (max 2048 chars)
No
Main image. Products without one are stored but not advertised.
items[].additional_image_links
array of string (uri) (≤ 20 items)
No
More images; at most 10 are kept.
items[].price_minor
integer (≥ 0)
Yes
Regular price in minor units, as shown in your store.
items[].sale_price_minor
integer or null (≥ 0)
No
Current sale price in minor units. Ignored unless lower than price_minor.
items[].currency
string (min 3 chars, max 3 chars)
Yes
ISO 4217 currency code.
items[].availability
one of in_stock, out_of_stock, preorder, backorder
No
Default "in_stock".
items[].condition
one of new, refurbished, used
No
Default "new".
items[].brand
string or null (max 200 chars)
No
items[].gtin
string or null (max 50 chars)
No
UPC, EAN, ISBN or ITF-14. Kept only when it is 8–14 digits.
items[].mpn
string or null (max 100 chars)
No
items[].google_product_category
string or null (max 500 chars)
No
Google's product category ID or path, if you know it.
items[].product_type
string or null (max 750 chars)
No
Your own category path, e.g. Apparel > Shirts.
items[].attributes
object
No
Variant attributes such as {"Color": "Blue", "Size": "M"}. At most 30.
items[].ruo
boolean
No
true 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.
One per product, then one per delete, in request order.
results[].id
string
Yes
results[].status
one of created, updated, unchanged, deleted, not_found, rejected
Yes
unchanged: identical to what OnCharge already has (nothing written). not_found: a delete for an ID OnCharge never had.
results[].advertisable
boolean
No
For stored products: may be sent to ad platforms.
results[].ruo
boolean
No
results[].excluded_reason
one of merchant_excluded, controlled_substance, insecure_link, missing_image, zero_price, or null
No
Why 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[].warnings
array of one of title_truncated, gtin_invalid, sale_price_ignored, additional_images_truncated, link_not_stored
The store's catalog, oldest first. Use it to find products you no longer sell and remove them. Sign an empty body.
Parameter
In
Type
Required
Description
limit
query
integer
No
offset
query
integer
No
include_deleted
query
boolean
No
Also list removed products.
updated_since
query
string (date-time)
No
Only products changed at or after this time (ISO 8601).
Response200
Field
Type
Always present
Description
products
array of object
Yes
products[].id
string
Yes
products[].item_group_id
string or null
No
products[].title
string
Yes
products[].link
string (uri)
Yes
products[].image_link
string (uri) or null
No
products[].price_minor
integer
Yes
products[].sale_price_minor
integer or null
No
products[].currency
string (min 3 chars, max 3 chars)
Yes
ISO 4217 currency code.
products[].availability
one of in_stock, out_of_stock, preorder, backorder
Yes
products[].ruo
boolean
Yes
products[].excluded_reason
one of merchant_excluded, controlled_substance, insecure_link, missing_image, zero_price, or null
Yes
Why 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[].advertisable
boolean
Yes
Not removed and not excluded.
products[].deleted
boolean
Yes
Removed (only listed with include_deleted=true).
products[].content_hash
string
Yes
Changes whenever anything OnCharge stores for the product changes.
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.
Parameter
In
Type
Required
Description
type
query
string
No
An event type (payment.captured) or a group (payout.*).
from
query
string (date)
No
Created on or after this day (UTC).
to
query
string (date)
No
Created on or before this day (UTC).
limit
query
integer
No
cursor
query
string
No
next_cursor of the previous page, sent with the same filters.
Response200
Field
Type
Always present
Description
events
array of object
Yes
events[].id
string
Yes
Event ID (evt_…), the same as the OnCharge-Event-Id header.
Every 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[].created
integer
Yes
Unix time (seconds) the event was created.
events[].livemode
boolean
Yes
false for events from test payments.
events[].data
object
Yes
For 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_id
string or null
No
The checkout session; null for a payment paid straight to your wallet.
events[].data.order_id
string or null
No
Your order ID, if known.
events[].data.reference
string or null
No
The reference you sent when creating the session.
events[].data.amount
integer or null
No
Minor units. For refund.succeeded, the total refunded so far.
events[].data.currency
string or null
No
ISO 4217 code.
events[].data.status
string or null
No
The order's payment status after the event (for example captured, refunded).
events[].data.rail
one of card, crypto, card_to_crypto
Yes
The 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_reference
string or null
No
OnCharge's reference for the payment (ocpay_…).
events[].data.payment_link_id
string (uuid) or null
No
The payment link the checkout was made from (/api/v1/payment-links), or null.
events[].data.invoice_id
string (uuid)
No
Only on a payment for an OnCharge invoice: the invoice's id (see Invoices).
events[].data.payment_method
one of card, bank_debit, cash_app_pay, klarna, affirm, afterpay, or null
No
How 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.tax
object or null
No
Sales tax on the payment, on payment, refund and chargeback events of a taxed payment only.
events[].data.reason
one of limit_exceeded
No
Only 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.
Same as type. Kept for older plugins; only on payment events from a checkout. Deprecated.
events[].status
string or null
No
Same as data.status. Kept for older plugins; only on payment events from a checkout. Deprecated.
events[].psp_reference
string or null
No
Kept 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_cursor
string or null
Yes
Pass as cursor for the next page; null on the last page.
Every 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.
created
integer
Yes
Unix time (seconds) the event was created.
livemode
boolean
Yes
false for events from test payments.
data
object
Yes
For 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_id
string or null
No
The checkout session; null for a payment paid straight to your wallet.
data.order_id
string or null
No
Your order ID, if known.
data.reference
string or null
No
The reference you sent when creating the session.
data.amount
integer or null
No
Minor units. For refund.succeeded, the total refunded so far.
data.currency
string or null
No
ISO 4217 code.
data.status
string or null
No
The order's payment status after the event (for example captured, refunded).
data.rail
one of card, crypto, card_to_crypto
Yes
The 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_reference
string or null
No
OnCharge's reference for the payment (ocpay_…).
data.payment_link_id
string (uuid) or null
No
The payment link the checkout was made from (/api/v1/payment-links), or null.
data.invoice_id
string (uuid)
No
Only on a payment for an OnCharge invoice: the invoice's id (see Invoices).
data.payment_method
one of card, bank_debit, cash_app_pay, klarna, affirm, afterpay, or null
No
How 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.tax
object or null
No
Sales tax on the payment, on payment, refund and chargeback events of a taxed payment only.
data.tax.status
one of awaiting_address, calculated, pending, failed, collected, partly_refunded, refunded
Yes
awaiting_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.inclusive
boolean
Yes
true when the listed prices include the tax.
data.tax.currency
string or null
Yes
data.tax.subtotal
integer or null
Yes
Before tax, minor units.
data.tax.amount
integer or null
Yes
The tax, minor units.
data.tax.total
integer or null
Yes
What the customer pays, minor units.
data.tax.shipping
integer
Yes
The shipping charge inside the total, minor units.
data.tax.jurisdictions
array of object
Yes
data.tax.refunded
integer
Yes
Tax given back so far with refunds and lost disputes, minor units.
data.tax.error
string or null
Yes
tax_address_invalid or tax_unavailable when status is failed.
data.reason
one of limit_exceeded
No
Only 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.
Same as type. Kept for older plugins; only on payment events from a checkout. Deprecated.
status
string or null
No
Same as data.status. Kept for older plugins; only on payment events from a checkout. Deprecated.
psp_reference
string or null
No
Kept 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.
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.
Parameter
In
Type
Required
Description
event_id
path
string
Yes
An event id (evt_…).
Request body (application/json)
Field
Type
Required
Description
endpoint_id
string (uuid)
Yes
One of your webhook endpoints (the Webhooks page shows their ids).
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.
Parameter
In
Type
Required
Description
kind
query
one of payment, refund, dispute, swap, all
No
payment (default), refund, dispute, swap or all.
rail
query
one of card, crypto, card_to_crypto
No
status
query
one of paid, pending, refunded, failed, disputed, review, waiting, uncaptured
No
source
query
one of wallet, plugin, gateway
No
Paid straight to your wallet (plugin or gateway API), or one of them.
q
query
string
No
An OnCharge reference or id, a transaction hash, an email or an order number.
from
query
string (date)
No
to
query
string (date)
No
min
query
string
No
Smallest amount, in major units.
max
query
string
No
Largest amount, in major units.
method
query
one of card, crypto, cashapp, venmo, bank
No
signals
query
string
No
Comma-separated: review, fraud_warning, disputed (every one listed must hold).
limit
query
integer
No
cursor
query
string
No
next_cursor of the previous page, sent with the same filters.
Response200
Field
Type
Always present
Description
payments
array of object
Yes
payments[].id
string (uuid)
Yes
OnCharge's id of the payment, refund, dispute or conversion.
The 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).
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.
Parameter
In
Type
Required
Description
status
query
one of paid, on_its_way, failed, returned, canceled
No
from
query
string (date)
No
to
query
string (date)
No
min
query
string
No
max
query
string
No
q
query
string
No
An order number, payment id or payout id.
limit
query
integer
No
cursor
query
string
No
next_cursor of the previous page, sent with the same filters.
Response200
Field
Type
Always present
Description
payouts
array of object
Yes
payouts[].id
string (uuid)
Yes
The payout id the payout.paid, payout.failed and payout.returned events carry.
payouts[].type
one of payout, bank_debit
Yes
payouts[].status
one of paid, on_its_way, failed, returned, canceled
Yes
payouts[].status_label
string
No
payouts[].amount
integer
Yes
Minor units; negative for a bank debit.
payouts[].currency
string
Yes
payouts[].created_at
string (date-time)
Yes
payouts[].arrival_date
string or null
No
payouts[].orders
integer or null
No
Orders it paid, once its statement exists.
payouts[].items
integer
No
payouts[].problem
string or null
No
Why it did not reach your bank (or, a debit card payout, your card), in plain words.
payouts[].method
one of standard, instant
No
instant: a debit card payout you asked for; amount is what reached the card.
payouts[].fee
integer
No
OnCharge'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_cursor
string or null
Yes
Pass as cursor for the next page; null on the last page.
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.
Response200
Field
Type
Always present
Description
instant_payout
object
Yes
What could reach your debit card now (money already released for delivered orders only), or why nothing can.
instant_payout.store_id
string (uuid)
Yes
instant_payout.available
boolean
Yes
instant_payout.block
object or null
Yes
instant_payout.amount
integer
Yes
What would reach the card, in minor units.
instant_payout.fee
integer
Yes
OnCharge's fee, in minor units: 1.5% of the total, at least 0.50.
instant_payout.total
integer
Yes
What would leave your balance: amount + fee.
instant_payout.currency
one of USD
Yes
instant_payout.arrival
object
Yes
instant_payout.arrival.text
string
No
instant_payout.arrival.minutes
integer
No
instant_payout.arrival.estimate
string (date-time) or null
No
instant_payout.card
object or null
Yes
The debit card on file, masked. Added in the dashboard only.
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.
Parameter
In
Type
Required
Description
Idempotency-Key
header
string
No
A unique key (up to 255 characters is safe) that makes retries of this request safe.
Request body (application/json)
Field
Type
Required
Description
expected_amount
integer (≥ 1)
No
What you expect to reach the card, in minor units.
Request
{
"expected_amount": 1
}
Response201
Field
Type
Always present
Description
payout
object
Yes
payout.id
string (uuid)
Yes
The id the payouts list and the payout.paid / payout.failed events carry.
payout.method
one of instant
Yes
payout.status
one of paid, on_its_way, failed, returned, canceled
Yes
payout.amount
integer
Yes
What reaches the card.
payout.fee
integer
Yes
payout.total
integer
Yes
What left your balance.
payout.currency
string
Yes
payout.created_at
string (date-time)
Yes
payout.arrival
object
Yes
payout.arrival.text
string
No
payout.arrival.estimate
string (date-time) or null
No
replay
boolean
Yes
True when this Idempotency-Key was used before: the same payout, not a new one.
Refused: 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.
404
not_found: the object does not exist or belongs to another store.
409
Refused: 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.
502
Refused: 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.
503
Refused: 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.
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.
Response200
Field
Type
Always present
Description
store_id
string (uuid)
Yes
methods
array of object
Yes
Only the methods OnCharge offers today.
methods[].method
one of bank_debit, cash_app_pay, klarna, affirm, afterpay
Yes
methods[].label
string
Yes
methods[].summary
string
Yes
What the method does for your store, in one or two sentences.
methods[].enabled
boolean
Yes
Whether the store turned it on (owners and admins, in the portal under Settings → Payment setup).
methods[].state
one of off, not_available, requesting, reviewing, needs_information, inactive, active
Yes
active: shoppers see it at checkout. not_available: not offered to this store's business.
methods[].status_text
string
Yes
The state in plain words.
methods[].needs
array of string
Yes
What is still needed before it can be approved, in words.
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)
Field
Type
Required
Description
title
string (min 1 chars, max 120 chars)
Yes
description
string or null (max 500 chars)
No
amount_type
one of fixed, customer_chosen
No
fixed: the customer pays amount per item. customer_chosen: they choose between min_amount and max_amount. Default "fixed".
amount
integer or null (≥ 1)
No
Per item, for a fixed amount. Minor units (cents), at least 50.
min_amount
integer or null (≥ 1)
No
Customer-chosen amounts: the least they may pay (default 50).
max_amount
integer or null (≥ 1)
No
Customer-chosen amounts: the most they may pay (default 1000000, $10,000).
preset_amount
integer or null (≥ 1)
No
Customer-chosen amounts: where the amount field starts.
currency
string
No
Card payments are USD only on stores paid out per delivered order. Default "USD".
adjustable_quantity
boolean
No
Default false.
max_quantity
integer or null (≥ 1, ≤ 99)
No
Default 10 when adjustable_quantity is on.
collect_shipping
boolean
No
Ask for a shipping address (required on stores that ship what they sell). Default false.
collect_phone
boolean
No
Default false.
success_url
string (uri) or null
No
https, on one of the store's registered domains. Default: OnCharge's thank-you page.
rails
array of one of card, crypto or null (≥ 1 items)
No
Ways to pay allowed on the link (default both); the store must have them on.
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.
Parameter
In
Type
Required
Description
link_id
path
string (uuid)
Yes
The payment link's id.
Request body (application/json)
Field
Type
Required
Description
title
string (min 1 chars, max 120 chars)
No
description
string or null (max 500 chars)
No
amount_type
one of fixed, customer_chosen
No
fixed: the customer pays amount per item. customer_chosen: they choose between min_amount and max_amount. Default "fixed".
amount
integer or null (≥ 1)
No
Per item, for a fixed amount. Minor units (cents), at least 50.
min_amount
integer or null (≥ 1)
No
Customer-chosen amounts: the least they may pay (default 50).
max_amount
integer or null (≥ 1)
No
Customer-chosen amounts: the most they may pay (default 1000000, $10,000).
preset_amount
integer or null (≥ 1)
No
Customer-chosen amounts: where the amount field starts.
currency
string
No
Card payments are USD only on stores paid out per delivered order. Default "USD".
adjustable_quantity
boolean
No
Default false.
max_quantity
integer or null (≥ 1, ≤ 99)
No
Default 10 when adjustable_quantity is on.
collect_shipping
boolean
No
Ask for a shipping address (required on stores that ship what they sell). Default false.
collect_phone
boolean
No
Default false.
success_url
string (uri) or null
No
https, on one of the store's registered domains. Default: OnCharge's thank-you page.
rails
array of one of card, crypto or null (≥ 1 items)
No
Ways to pay allowed on the link (default both); the store must have them on.
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.
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.
Parameter
In
Type
Required
Description
Idempotency-Key
header
string
No
A unique key (up to 255 characters is safe) that makes retries of this request safe.
Request body (application/json)
Field
Type
Required
Description
currency
one of USD, EUR, GBP, CAD, AUD, NZD, CHF, JPY
No
Amounts are in this currency's minor units (JPY has none). Card payments on stores paid out per delivered order are USD only. Default "USD".
customer
object
No
customer.name
string or null (max 200 chars)
No
Required to finalize.
customer.email
string (email) or null
No
Required to send.
customer.address
object or null
No
shipping_address
object or null
No
Needed when a line ships and the store's card payments are paid out on delivery.
lines
array of object (≤ 100 items)
No
On update, replaces every line.
lines[].description
string (min 1 chars, max 500 chars)
Yes
lines[].quantity
integer (≥ 1, ≤ 100000)
Yes
lines[].unit_amount
integer (≥ -10000000000, ≤ 10000000000)
Yes
Minor units of the invoice currency; negative for a discount line. quantity x unit_amount may be at most 10000000000 either way.
lines[].tax_rate
number or string
No
A 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_shipping
boolean
No
A shipped item. Card payments for it are paid out after the carrier confirms delivery to shipping_address, as for any order. Default false.
memo
string or null (max 2000 chars)
No
footer
string or null (max 1000 chars)
No
reply_to
string (email) or null
No
Where the customer's replies to invoice emails go.
days_until_due
integer (≥ 0, ≤ 365)
No
Default 30.
due_at
string or null
No
A 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_reminders
boolean
No
Email the customer 1, 7 and 14 days after the due date while it is unpaid. Default true.
validation_error (the message lists each invalid field) or invalid_json.
404
not_found: the object does not exist or belongs to another store.
409
store_inactive: the store is not taking payments.
422
invoice_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.
validation_error (the message lists each invalid field) or invalid_json.
404
not_found: the object does not exist or belongs to another store.
409
invoice_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.
not_found: the object does not exist or belongs to another store.
409
invoice_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.
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.
Parameter
In
Type
Required
Description
invoice_id
path
string (uuid)
Yes
The invoice (or credit note) id.
Request body (application/json)
Field
Type
Required
Description
send
boolean
No
Request
{
"send": true
}
Response200
Field
Type
Always present
Description
id
string (uuid)
Yes
object
one of invoice, credit_note
Yes
store_id
string (uuid)
No
number
string or null
No
INV-0001 (credit notes CN-0001), per store, given at finalize; null on a draft.
status
one of draft, open, paid, void, issued
Yes
issued is a credit note's.
display_status
one of draft, open, overdue, paid, void, issued
No
status_label
string
No
currency
string
Yes
currency_digits
integer
No
customer
object
No
customer.name
string or null
No
customer.email
string or null
No
customer.address
object or null
No
shipping_address
object or null
No
lines
array of object
Yes
lines[].description
string
No
lines[].quantity
integer
No
lines[].unit_amount
integer
No
lines[].tax_rate
number
No
lines[].amount
integer
No
lines[].tax_amount
integer
No
lines[].requires_shipping
boolean
No
subtotal
integer
No
tax
integer
No
total
integer
Yes
amount_paid
integer
No
amount_credited
integer
No
amount_remaining
integer
Yes
memo
string or null
No
footer
string or null
No
reply_to
string or null
No
days_until_due
integer
No
due_at
string (date-time) or null
No
send_reminders
boolean
No
metadata
object
No
hosted_url
string or null
No
The hosted invoice page the customer pays on (once finalized).
paid_out_of_band
boolean
No
payment_reference
string or null
No
The OnCharge reference (ocpay_…) of the payment that paid it.
credit_note_for
object or null
No
credit_note_for.id
string
No
credit_note_for.number
string or null
No
credit_reason
string or null
No
source
one of dashboard, api
No
created_at
string (date-time)
No
finalized_at
string or null
No
sent_at
string or null
No
paid_at
string or null
No
voided_at
string or null
No
actions
object
No
What can be done now.
events
array of object
No
History (detail only).
payments
array of object
No
Payments made for it, by OnCharge reference (detail only).
payments[].payment_reference
string
No
payments[].session_id
string
No
payments[].amount
integer
No
payments[].currency
string
No
payments[].status
string
No
payments[].rail
one of card, crypto
No
credit_notes
array of object
No
Credit notes issued against it (detail only).
payment_options
array of object
No
How the customer can pay it now, and why a rail is off (detail only).
not_found: the object does not exist or belongs to another store.
409
invoice_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.
not_found: the object does not exist or belongs to another store.
409
invoice_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.
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.
Parameter
In
Type
Required
Description
invoice_id
path
string (uuid)
Yes
The invoice (or credit note) id.
Request body (application/json)
Field
Type
Required
Description
reason
string or null (max 500 chars)
No
Request
{
"reason": "string"
}
Response200
Field
Type
Always present
Description
id
string (uuid)
Yes
object
one of invoice, credit_note
Yes
store_id
string (uuid)
No
number
string or null
No
INV-0001 (credit notes CN-0001), per store, given at finalize; null on a draft.
status
one of draft, open, paid, void, issued
Yes
issued is a credit note's.
display_status
one of draft, open, overdue, paid, void, issued
No
status_label
string
No
currency
string
Yes
currency_digits
integer
No
customer
object
No
customer.name
string or null
No
customer.email
string or null
No
customer.address
object or null
No
shipping_address
object or null
No
lines
array of object
Yes
lines[].description
string
No
lines[].quantity
integer
No
lines[].unit_amount
integer
No
lines[].tax_rate
number
No
lines[].amount
integer
No
lines[].tax_amount
integer
No
lines[].requires_shipping
boolean
No
subtotal
integer
No
tax
integer
No
total
integer
Yes
amount_paid
integer
No
amount_credited
integer
No
amount_remaining
integer
Yes
memo
string or null
No
footer
string or null
No
reply_to
string or null
No
days_until_due
integer
No
due_at
string (date-time) or null
No
send_reminders
boolean
No
metadata
object
No
hosted_url
string or null
No
The hosted invoice page the customer pays on (once finalized).
paid_out_of_band
boolean
No
payment_reference
string or null
No
The OnCharge reference (ocpay_…) of the payment that paid it.
credit_note_for
object or null
No
credit_note_for.id
string
No
credit_note_for.number
string or null
No
credit_reason
string or null
No
source
one of dashboard, api
No
created_at
string (date-time)
No
finalized_at
string or null
No
sent_at
string or null
No
paid_at
string or null
No
voided_at
string or null
No
actions
object
No
What can be done now.
events
array of object
No
History (detail only).
payments
array of object
No
Payments made for it, by OnCharge reference (detail only).
payments[].payment_reference
string
No
payments[].session_id
string
No
payments[].amount
integer
No
payments[].currency
string
No
payments[].status
string
No
payments[].rail
one of card, crypto
No
credit_notes
array of object
No
Credit notes issued against it (detail only).
payment_options
array of object
No
How the customer can pay it now, and why a rail is off (detail only).
not_found: the object does not exist or belongs to another store.
409
invoice_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.
not_found: the object does not exist or belongs to another store.
409
invoice_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.
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.
Parameter
In
Type
Required
Description
invoice_id
path
string (uuid)
Yes
The invoice (or credit note) id.
Idempotency-Key
header
string
No
A unique key (up to 255 characters is safe) that makes retries of this request safe.
Request body (application/json)
Field
Type
Required
Description
amount
integer (≥ 1)
No
One credit line of this many minor units.
lines
array of object (≥ 1 items, ≤ 100 items)
No
lines[].description
string
Yes
lines[].quantity
integer
No
Default 1.
lines[].unit_amount
integer (≥ 1)
Yes
lines[].tax_rate
number or string
No
reason
one of duplicate, fraudulent, order_change, product_unsatisfactory, other
No
Default "other".
memo
string or null (max 2000 chars)
No
refund
boolean
No
On an invoice paid through OnCharge, also refund the credit to the customer's payment. Default false.
The credit note (with refund when one was asked for).
400
validation_error (the message lists each invalid field) or invalid_json.
404
not_found: the object does not exist or belongs to another store.
409
invoice_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.
422
credit_too_large: more than is left to pay (or, once paid, than the invoice).
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.
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.
A plan: a price every interval_countintervals (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).
Parameter
In
Type
Required
Description
Idempotency-Key
header
string
No
A unique key (up to 255 characters is safe) that makes retries of this request safe.
Request body (application/json)
Field
Type
Required
Description
kind
one of plan, addon
No
addon: no interval, trial or intro of its own; it is billed with the plan it is added to. Default "plan".
name
string (min 1 chars, max 120 chars)
Yes
description
string or null (max 1000 chars)
No
amount
integer (≥ 1, ≤ 99999999)
Yes
Per period (per unit), minor units.
currency
string
No
ISO 4217. Add-ons must be in their plan's currency. Default "USD".
interval
one of day, week, month, year
No
Required for a plan.
interval_count
integer (≥ 1, ≤ 365)
No
Intervals per period, up to one year: at most 365 days, 52 weeks, 12 months or 1 year. Default 1.
trial_days
integer (≥ 0, ≤ 365)
No
A 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.
intro
object or null
No
A lower price for the first periods: { "amount": 1500, "periods": 2 }. Plans only.
requires_shipping
boolean
No
Each 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.
metadata
object
No
Your 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
}
Response201
Field
Type
Always present
Description
id
string (uuid)
Yes
object
one of plan, addon
Yes
store_id
string (uuid)
Yes
name
string
Yes
description
string or null
Yes
amount
integer
Yes
Per period (per unit), minor units.
currency
string
Yes
interval
one of day, week, month, year or null
Yes
Null for an add-on.
interval_count
integer or null
Yes
interval_text
string or null
Yes
The period in words: month, 3 months. Null for an add-on.
trial_days
integer
Yes
intro
object or null
Yes
The intro price per period (amount) for the first periods periods.
invalid_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.
404
store_not_found; not_found while subscriptions are not available yet (every subscription endpoint answers 404 until they are turned on).
plan_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).
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.
Parameter
In
Type
Required
Description
plan_id
path
string (uuid)
Yes
A plan or add-on of your store.
Request body (application/json)
Field
Type
Required
Description
name
string (min 1 chars, max 120 chars)
No
description
string or null (max 1000 chars)
No
active
boolean
No
false archives the plan: it takes no new subscriptions, and those already on it go on. true brings it back.
metadata
object
No
Your 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
}
Response200
Field
Type
Always present
Description
id
string (uuid)
Yes
object
one of plan, addon
Yes
store_id
string (uuid)
Yes
name
string
Yes
description
string or null
Yes
amount
integer
Yes
Per period (per unit), minor units.
currency
string
Yes
interval
one of day, week, month, year or null
Yes
Null for an add-on.
interval_count
integer or null
Yes
interval_text
string or null
Yes
The period in words: month, 3 months. Null for an add-on.
trial_days
integer
Yes
intro
object or null
Yes
The intro price per period (amount) for the first periods periods.
invalid_request: the message names the first invalid field; invalid_json: the body is not JSON.
404
plan_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).
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).
Parameter
In
Type
Required
Description
plan_id
path
string (uuid)
Yes
A plan or add-on of your store.
Request body (application/json)
Field
Type
Required
Description
title
string (min 1 chars, max 120 chars)
No
What the link page shows. Default: the plan's name.
Request
{
"title": "Join the Monthly box"
}
Response201
Field
Type
Always present
Description
id
string (uuid)
Yes
code
string
Yes
url
string
Yes
The link to share: https://app.oncharge.io/l/<code>.
invalid_request: the message names the first invalid field; invalid_json: the body is not JSON.
404
plan_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).
one of incomplete, incomplete_expired, trialing, active, past_due, paused, canceled
No
Only this status.
customer_id
query
string (uuid)
No
Only this customer's.
limit
query
integer
No
starting_after
query
string (uuid)
No
The last id of the previous page.
Response200
Field
Type
Always present
Description
data
array of object
Yes
data[].id
string (uuid)
Yes
data[].object
"subscription"
Yes
data[].store_id
string (uuid)
Yes
data[].customer_id
string (uuid)
Yes
data[].customer
object or null
Yes
data[].customer.email
string or null
No
data[].customer.name
string or null
No
data[].status
one of incomplete, incomplete_expired, trialing, active, past_due, paused, canceled
Yes
incomplete: 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_text
string
Yes
The status in plain words (Waiting for customer, Past due, …).
data[].plan
object
Yes
data[].plan.id
string (uuid)
Yes
data[].plan.name
string
No
data[].plan.amount
integer
No
data[].plan.currency
string
No
data[].plan.interval
one of day, week, month, year or null
No
data[].plan.interval_count
integer or null
No
data[].quantity
integer
Yes
data[].addons
array of object
Yes
data[].addons[].plan_id
string (uuid)
No
data[].addons[].name
string or null
No
data[].addons[].amount
integer or null
No
data[].addons[].quantity
integer
No
data[].intro
object or null
Yes
The intro price this subscription has, taken from its plan when it was created.
data[].payment_method
object or null
Yes
The saved card it is charged to. Null until the customer signs up.
data[].trial_end
string (date-time) or null
Yes
When the free trial ends (the first charge).
data[].current_period
object or null
Yes
data[].current_period.index
integer
No
0 for the first period.
data[].current_period.start
string (date-time) or null
No
data[].current_period.end
string (date-time) or null
No
data[].current_period.amount
integer or null
No
What this period was billed, minor units.
data[].next_billing_at
string (date-time) or null
Yes
When it is charged next, or resumes; null once ended.
data[].credit_balance
integer
Yes
Credit from downgrades, taken off the next bills (minor units).
data[].pending_change
object or null
Yes
A change that applies at the next period (a price increase: from increase.effective_at).
data[].pending_change.change_id
string (uuid)
No
This change: its notice is for it alone; a newer change is always told again.
data[].pending_change.plan_id
string (uuid)
No
data[].pending_change.increase
object or null
No
Set 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.quantity
integer
No
data[].pending_change.addons
array of object
No
data[].cancel_at_period_end
boolean
Yes
It ends when the current period ends.
data[].canceled_at
string (date-time) or null
Yes
When it was cancelled (for a cancellation at the period's end, when it was asked for).
data[].ended_at
string (date-time) or null
Yes
data[].cancel_reason
one of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or null
Yes
dunning: 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[].pause
object or null
Yes
A pause waiting for the period's end (at_period_end: true), or under way.
data[].pause.at_period_end
boolean
No
data[].pause.paused_at
string (date-time) or null
No
data[].pause.resume_at
string (date-time) or null
No
When it starts again by itself; null: when you (or the customer) resume it.
data[].pause.reason
one of merchant, customer, api, dunning, or null
No
data[].shipping
object or null
Yes
data[].shipping.name
string or null
No
data[].shipping.address
object
No
data[].source
one of dashboard, api, payment_link, checkout
Yes
How it was started.
data[].payment_link_id
string (uuid) or null
Yes
The plan payment link the customer signed up through.
data[].sign_up_expires_at
string (date-time) or null
Yes
While incomplete: when the sign-up link stops working.
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).
Parameter
In
Type
Required
Description
Idempotency-Key
header
string
No
A unique key (up to 255 characters is safe) that makes retries of this request safe.
Request body (application/json)
Field
Type
Required
Description
customer_id
string (uuid)
Yes
An existing customer of your store. They need an email address: OnCharge emails them the link to confirm.
plan_id
string (uuid)
Yes
An active plan of your store.
quantity
integer (≥ 1, ≤ 1000)
No
Default 1.
addons
array of object (≤ 20 items)
No
Each add-on listed once.
addons[].plan_id
string (uuid)
Yes
An add-on of your store (kind: "addon"), in the plan's currency.
addons[].quantity
integer (≥ 1, ≤ 1000)
No
Default 1.
shipping
object
No
Required when the subscription ships.
shipping.name
string (min 1 chars, max 200 chars)
Yes
shipping.line1
string (min 1 chars, max 300 chars)
Yes
shipping.line2
string or null (max 300 chars)
No
shipping.city
string (min 1 chars, max 120 chars)
Yes
shipping.state
string or null (max 120 chars)
No
shipping.postal_code
string (min 1 chars, max 20 chars)
Yes
shipping.country
string
Yes
Two-letter code (US).
metadata
object
No
Your own key-value pairs: at most 20 keys of letters, digits, _, . and - (up to 40 characters), each value up to 500 characters.
one of incomplete, incomplete_expired, trialing, active, past_due, paused, canceled
Yes
incomplete: 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_text
string
Yes
The status in plain words (Waiting for customer, Past due, …).
plan
object
Yes
plan.id
string (uuid)
Yes
plan.name
string
No
plan.amount
integer
No
plan.currency
string
No
plan.interval
one of day, week, month, year or null
No
plan.interval_count
integer or null
No
quantity
integer
Yes
addons
array of object
Yes
addons[].plan_id
string (uuid)
No
addons[].name
string or null
No
addons[].amount
integer or null
No
addons[].quantity
integer
No
intro
object or null
Yes
The intro price this subscription has, taken from its plan when it was created.
payment_method
object or null
Yes
The saved card it is charged to. Null until the customer signs up.
trial_end
string (date-time) or null
Yes
When the free trial ends (the first charge).
current_period
object or null
Yes
current_period.index
integer
No
0 for the first period.
current_period.start
string (date-time) or null
No
current_period.end
string (date-time) or null
No
current_period.amount
integer or null
No
What this period was billed, minor units.
next_billing_at
string (date-time) or null
Yes
When it is charged next, or resumes; null once ended.
credit_balance
integer
Yes
Credit from downgrades, taken off the next bills (minor units).
pending_change
object or null
Yes
A change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_id
string (uuid)
No
This change: its notice is for it alone; a newer change is always told again.
pending_change.plan_id
string (uuid)
No
pending_change.increase
object or null
No
Set 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.from
integer
No
The price per period before, minor units (per from_every).
pending_change.increase.to
integer
No
The price per period after, minor units (per to_every).
pending_change.increase.from_every
string
No
The period before, in words: every month.
pending_change.increase.to_every
string
No
The period after, in words: every week.
pending_change.increase.currency
string
No
pending_change.increase.effective_index
integer or null
No
The period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_at
string (date-time) or null
No
When that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_at
string (date-time) or null
No
When 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.version
integer
No
Which notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantity
integer
No
pending_change.addons
array of object
No
pending_change.addons[].plan_id
string (uuid)
No
pending_change.addons[].quantity
integer
No
cancel_at_period_end
boolean
Yes
It ends when the current period ends.
canceled_at
string (date-time) or null
Yes
When it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_at
string (date-time) or null
Yes
cancel_reason
one of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or null
Yes
dunning: 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.
pause
object or null
Yes
A pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_end
boolean
No
pause.paused_at
string (date-time) or null
No
pause.resume_at
string (date-time) or null
No
When it starts again by itself; null: when you (or the customer) resume it.
pause.reason
one of merchant, customer, api, dunning, or null
No
shipping
object or null
Yes
shipping.name
string or null
No
shipping.address
object
No
shipping.address.line1
string
No
shipping.address.line2
string or null
No
shipping.address.city
string
No
shipping.address.state
string or null
No
shipping.address.postal_code
string
No
shipping.address.country
string
No
source
one of dashboard, api, payment_link, checkout
Yes
How it was started.
payment_link_id
string (uuid) or null
Yes
The plan payment link the customer signed up through.
sign_up_expires_at
string (date-time) or null
Yes
While incomplete: when the sign-up link stops working.
invalid_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.
404
customer_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).
409
customer_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.
422
shipping_address_required: the subscription ships each period: send shipping.
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).
Parameter
In
Type
Required
Description
Idempotency-Key
header
string
No
A unique key (up to 255 characters is safe) that makes retries of this request safe.
Request body (application/json)
Field
Type
Required
Description
plan_id
string (uuid)
Yes
An active plan of your store.
quantity
integer (≥ 1, ≤ 1000)
No
Default 1.
addons
array of object (≤ 20 items)
No
Each add-on listed once.
addons[].plan_id
string (uuid)
Yes
An add-on of your store (kind: "addon"), in the plan's currency.
addons[].quantity
integer (≥ 1, ≤ 1000)
No
Default 1.
customer_id
string (uuid)
No
An existing customer of your store.
customer_email
string (email) (max 254 chars)
No
The customer is found by email, or added to your store.
customer_name
string (min 1 chars, max 200 chars)
No
Saved on the customer if they have no name yet.
shipping
object
No
Required when the subscription ships.
shipping.name
string (min 1 chars, max 200 chars)
Yes
shipping.line1
string (min 1 chars, max 300 chars)
Yes
shipping.line2
string or null (max 300 chars)
No
shipping.city
string (min 1 chars, max 120 chars)
Yes
shipping.state
string or null (max 120 chars)
No
shipping.postal_code
string (min 1 chars, max 20 chars)
Yes
shipping.country
string
Yes
Two-letter code (US).
success_url
string (uri) (max 2048 chars)
No
An https page the customer goes to after signing up. Kept in the subscription's metadata as success_url.
metadata
object
No
Your own key-value pairs: at most 20 keys of letters, digits, _, . and - (up to 40 characters), each value up to 500 characters.
one of incomplete, incomplete_expired, trialing, active, past_due, paused, canceled
Yes
incomplete: 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_text
string
Yes
The status in plain words (Waiting for customer, Past due, …).
plan
object
Yes
plan.id
string (uuid)
Yes
plan.name
string
No
plan.amount
integer
No
plan.currency
string
No
plan.interval
one of day, week, month, year or null
No
plan.interval_count
integer or null
No
quantity
integer
Yes
addons
array of object
Yes
addons[].plan_id
string (uuid)
No
addons[].name
string or null
No
addons[].amount
integer or null
No
addons[].quantity
integer
No
intro
object or null
Yes
The intro price this subscription has, taken from its plan when it was created.
payment_method
object or null
Yes
The saved card it is charged to. Null until the customer signs up.
trial_end
string (date-time) or null
Yes
When the free trial ends (the first charge).
current_period
object or null
Yes
current_period.index
integer
No
0 for the first period.
current_period.start
string (date-time) or null
No
current_period.end
string (date-time) or null
No
current_period.amount
integer or null
No
What this period was billed, minor units.
next_billing_at
string (date-time) or null
Yes
When it is charged next, or resumes; null once ended.
credit_balance
integer
Yes
Credit from downgrades, taken off the next bills (minor units).
pending_change
object or null
Yes
A change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_id
string (uuid)
No
This change: its notice is for it alone; a newer change is always told again.
pending_change.plan_id
string (uuid)
No
pending_change.increase
object or null
No
Set 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.from
integer
No
The price per period before, minor units (per from_every).
pending_change.increase.to
integer
No
The price per period after, minor units (per to_every).
pending_change.increase.from_every
string
No
The period before, in words: every month.
pending_change.increase.to_every
string
No
The period after, in words: every week.
pending_change.increase.currency
string
No
pending_change.increase.effective_index
integer or null
No
The period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_at
string (date-time) or null
No
When that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_at
string (date-time) or null
No
When 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.version
integer
No
Which notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantity
integer
No
pending_change.addons
array of object
No
pending_change.addons[].plan_id
string (uuid)
No
pending_change.addons[].quantity
integer
No
cancel_at_period_end
boolean
Yes
It ends when the current period ends.
canceled_at
string (date-time) or null
Yes
When it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_at
string (date-time) or null
Yes
cancel_reason
one of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or null
Yes
dunning: 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.
pause
object or null
Yes
A pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_end
boolean
No
pause.paused_at
string (date-time) or null
No
pause.resume_at
string (date-time) or null
No
When it starts again by itself; null: when you (or the customer) resume it.
pause.reason
one of merchant, customer, api, dunning, or null
No
shipping
object or null
Yes
shipping.name
string or null
No
shipping.address
object
No
shipping.address.line1
string
No
shipping.address.line2
string or null
No
shipping.address.city
string
No
shipping.address.state
string or null
No
shipping.address.postal_code
string
No
shipping.address.country
string
No
source
one of dashboard, api, payment_link, checkout
Yes
How it was started.
payment_link_id
string (uuid) or null
Yes
The plan payment link the customer signed up through.
sign_up_expires_at
string (date-time) or null
Yes
While incomplete: when the sign-up link stops working.
metadata
object
Yes
created_at
string (date-time)
Yes
url
string
Yes
The customer's sign-up page on OnCharge. It works until sign_up_expires_at (24 hours). It never offers the customer's saved cards.
invalid_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.
404
customer_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).
409
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.
422
shipping_address_required: the subscription ships each period: send shipping.
The subscription with every bill (each period and prorated plan change, its invoice, attempts, failure and payment reference) and its history.
Parameter
In
Type
Required
Description
subscription_id
path
string (uuid)
Yes
A subscription of your store.
Response200
Field
Type
Always present
Description
id
string (uuid)
Yes
object
"subscription"
Yes
store_id
string (uuid)
Yes
customer_id
string (uuid)
Yes
customer
object or null
Yes
customer.email
string or null
No
customer.name
string or null
No
status
one of incomplete, incomplete_expired, trialing, active, past_due, paused, canceled
Yes
incomplete: 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_text
string
Yes
The status in plain words (Waiting for customer, Past due, …).
plan
object
Yes
plan.id
string (uuid)
Yes
plan.name
string
No
plan.amount
integer
No
plan.currency
string
No
plan.interval
one of day, week, month, year or null
No
plan.interval_count
integer or null
No
quantity
integer
Yes
addons
array of object
Yes
addons[].plan_id
string (uuid)
No
addons[].name
string or null
No
addons[].amount
integer or null
No
addons[].quantity
integer
No
intro
object or null
Yes
The intro price this subscription has, taken from its plan when it was created.
payment_method
object or null
Yes
The saved card it is charged to. Null until the customer signs up.
trial_end
string (date-time) or null
Yes
When the free trial ends (the first charge).
current_period
object or null
Yes
current_period.index
integer
No
0 for the first period.
current_period.start
string (date-time) or null
No
current_period.end
string (date-time) or null
No
current_period.amount
integer or null
No
What this period was billed, minor units.
next_billing_at
string (date-time) or null
Yes
When it is charged next, or resumes; null once ended.
credit_balance
integer
Yes
Credit from downgrades, taken off the next bills (minor units).
pending_change
object or null
Yes
A change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_id
string (uuid)
No
This change: its notice is for it alone; a newer change is always told again.
pending_change.plan_id
string (uuid)
No
pending_change.increase
object or null
No
Set 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.from
integer
No
The price per period before, minor units (per from_every).
pending_change.increase.to
integer
No
The price per period after, minor units (per to_every).
pending_change.increase.from_every
string
No
The period before, in words: every month.
pending_change.increase.to_every
string
No
The period after, in words: every week.
pending_change.increase.currency
string
No
pending_change.increase.effective_index
integer or null
No
The period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_at
string (date-time) or null
No
When that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_at
string (date-time) or null
No
When 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.version
integer
No
Which notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantity
integer
No
pending_change.addons
array of object
No
pending_change.addons[].plan_id
string (uuid)
No
pending_change.addons[].quantity
integer
No
cancel_at_period_end
boolean
Yes
It ends when the current period ends.
canceled_at
string (date-time) or null
Yes
When it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_at
string (date-time) or null
Yes
cancel_reason
one of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or null
Yes
dunning: 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.
pause
object or null
Yes
A pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_end
boolean
No
pause.paused_at
string (date-time) or null
No
pause.resume_at
string (date-time) or null
No
When it starts again by itself; null: when you (or the customer) resume it.
pause.reason
one of merchant, customer, api, dunning, or null
No
shipping
object or null
Yes
shipping.name
string or null
No
shipping.address
object
No
shipping.address.line1
string
No
shipping.address.line2
string or null
No
shipping.address.city
string
No
shipping.address.state
string or null
No
shipping.address.postal_code
string
No
shipping.address.country
string
No
source
one of dashboard, api, payment_link, checkout
Yes
How it was started.
payment_link_id
string (uuid) or null
Yes
The plan payment link the customer signed up through.
sign_up_expires_at
string (date-time) or null
Yes
While incomplete: when the sign-up link stops working.
metadata
object
Yes
created_at
string (date-time)
Yes
billings
array of object
Yes
Every bill, newest first.
billings[].id
string (uuid)
Yes
billings[].object
"subscription_billing"
Yes
billings[].subscription_id
string (uuid)
Yes
billings[].reason
one of period, proration
Yes
proration: the prorated charge of a plan change applied now.
billings[].period_index
integer
Yes
0 for the first period.
billings[].period_start
string (date-time)
Yes
billings[].period_end
string (date-time)
Yes
billings[].lines
array of object
Yes
billings[].lines[].description
string
No
billings[].lines[].quantity
integer
No
billings[].lines[].unit_amount
integer
No
billings[].lines[].requires_shipping
boolean
No
billings[].subtotal
integer
Yes
billings[].credit_applied
integer
Yes
Credit from earlier downgrades taken off this bill.
billings[].amount_due
integer
Yes
billings[].ships
boolean
Yes
This period's order ships: it is paid out after carrier-confirmed delivery.
billings[].status
one of open, paid, uncollectible, void
Yes
billings[].invoice
object or null
Yes
billings[].invoice.id
string (uuid)
No
billings[].invoice.number
string or null
No
INV-0042.
billings[].attempts
integer
Yes
Charge attempts so far.
billings[].next_attempt_at
string (date-time) or null
Yes
While open: when it is charged again; null when it waits for the customer.
billings[].failure
object or null
Yes
Why the last charge failed, while unpaid.
billings[].failure.reason
one of declined, authentication_required, unusable_card, error, store_unavailable, store_limit
No
billings[].failure.message
string
No
What happened and what OnCharge does next, in plain words.
billings[].failure.waits_for_customer
boolean
No
No automatic retry: the customer has to confirm the payment with their bank or add another card.
billings[].paid_at
string (date-time) or null
Yes
billings[].payment_reference
string or null
Yes
OnCharge's reference for the payment that paid it (ocpay_…).
not_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).
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.
Parameter
In
Type
Required
Description
subscription_id
path
string (uuid)
Yes
A subscription of your store.
Request body (application/json)
Field
Type
Required
Description
payment_method_id
string (uuid)
No
Another 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.
one of incomplete, incomplete_expired, trialing, active, past_due, paused, canceled
Yes
incomplete: 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_text
string
Yes
The status in plain words (Waiting for customer, Past due, …).
plan
object
Yes
plan.id
string (uuid)
Yes
plan.name
string
No
plan.amount
integer
No
plan.currency
string
No
plan.interval
one of day, week, month, year or null
No
plan.interval_count
integer or null
No
quantity
integer
Yes
addons
array of object
Yes
addons[].plan_id
string (uuid)
No
addons[].name
string or null
No
addons[].amount
integer or null
No
addons[].quantity
integer
No
intro
object or null
Yes
The intro price this subscription has, taken from its plan when it was created.
payment_method
object or null
Yes
The saved card it is charged to. Null until the customer signs up.
trial_end
string (date-time) or null
Yes
When the free trial ends (the first charge).
current_period
object or null
Yes
current_period.index
integer
No
0 for the first period.
current_period.start
string (date-time) or null
No
current_period.end
string (date-time) or null
No
current_period.amount
integer or null
No
What this period was billed, minor units.
next_billing_at
string (date-time) or null
Yes
When it is charged next, or resumes; null once ended.
credit_balance
integer
Yes
Credit from downgrades, taken off the next bills (minor units).
pending_change
object or null
Yes
A change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_id
string (uuid)
No
This change: its notice is for it alone; a newer change is always told again.
pending_change.plan_id
string (uuid)
No
pending_change.increase
object or null
No
Set 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.from
integer
No
The price per period before, minor units (per from_every).
pending_change.increase.to
integer
No
The price per period after, minor units (per to_every).
pending_change.increase.from_every
string
No
The period before, in words: every month.
pending_change.increase.to_every
string
No
The period after, in words: every week.
pending_change.increase.currency
string
No
pending_change.increase.effective_index
integer or null
No
The period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_at
string (date-time) or null
No
When that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_at
string (date-time) or null
No
When 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.version
integer
No
Which notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantity
integer
No
pending_change.addons
array of object
No
pending_change.addons[].plan_id
string (uuid)
No
pending_change.addons[].quantity
integer
No
cancel_at_period_end
boolean
Yes
It ends when the current period ends.
canceled_at
string (date-time) or null
Yes
When it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_at
string (date-time) or null
Yes
cancel_reason
one of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or null
Yes
dunning: 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.
pause
object or null
Yes
A pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_end
boolean
No
pause.paused_at
string (date-time) or null
No
pause.resume_at
string (date-time) or null
No
When it starts again by itself; null: when you (or the customer) resume it.
pause.reason
one of merchant, customer, api, dunning, or null
No
shipping
object or null
Yes
shipping.name
string or null
No
shipping.address
object
No
shipping.address.line1
string
No
shipping.address.line2
string or null
No
shipping.address.city
string
No
shipping.address.state
string or null
No
shipping.address.postal_code
string
No
shipping.address.country
string
No
source
one of dashboard, api, payment_link, checkout
Yes
How it was started.
payment_link_id
string (uuid) or null
Yes
The plan payment link the customer signed up through.
sign_up_expires_at
string (date-time) or null
Yes
While incomplete: when the sign-up link stops working.
With 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.
400
invalid_request: the message names the first invalid field; invalid_json: the body is not JSON.
404
not_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).
409
subscription_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.
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).
Parameter
In
Type
Required
Description
subscription_id
path
string (uuid)
Yes
A subscription of your store.
Request body (application/json)
Field
Type
Required
Description
at_period_end
boolean
No
true: 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
}
Response200
Field
Type
Always present
Description
id
string (uuid)
Yes
object
"subscription"
Yes
store_id
string (uuid)
Yes
customer_id
string (uuid)
Yes
customer
object or null
Yes
customer.email
string or null
No
customer.name
string or null
No
status
one of incomplete, incomplete_expired, trialing, active, past_due, paused, canceled
Yes
incomplete: 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_text
string
Yes
The status in plain words (Waiting for customer, Past due, …).
plan
object
Yes
plan.id
string (uuid)
Yes
plan.name
string
No
plan.amount
integer
No
plan.currency
string
No
plan.interval
one of day, week, month, year or null
No
plan.interval_count
integer or null
No
quantity
integer
Yes
addons
array of object
Yes
addons[].plan_id
string (uuid)
No
addons[].name
string or null
No
addons[].amount
integer or null
No
addons[].quantity
integer
No
intro
object or null
Yes
The intro price this subscription has, taken from its plan when it was created.
payment_method
object or null
Yes
The saved card it is charged to. Null until the customer signs up.
trial_end
string (date-time) or null
Yes
When the free trial ends (the first charge).
current_period
object or null
Yes
current_period.index
integer
No
0 for the first period.
current_period.start
string (date-time) or null
No
current_period.end
string (date-time) or null
No
current_period.amount
integer or null
No
What this period was billed, minor units.
next_billing_at
string (date-time) or null
Yes
When it is charged next, or resumes; null once ended.
credit_balance
integer
Yes
Credit from downgrades, taken off the next bills (minor units).
pending_change
object or null
Yes
A change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_id
string (uuid)
No
This change: its notice is for it alone; a newer change is always told again.
pending_change.plan_id
string (uuid)
No
pending_change.increase
object or null
No
Set 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.from
integer
No
The price per period before, minor units (per from_every).
pending_change.increase.to
integer
No
The price per period after, minor units (per to_every).
pending_change.increase.from_every
string
No
The period before, in words: every month.
pending_change.increase.to_every
string
No
The period after, in words: every week.
pending_change.increase.currency
string
No
pending_change.increase.effective_index
integer or null
No
The period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_at
string (date-time) or null
No
When that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_at
string (date-time) or null
No
When 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.version
integer
No
Which notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantity
integer
No
pending_change.addons
array of object
No
pending_change.addons[].plan_id
string (uuid)
No
pending_change.addons[].quantity
integer
No
cancel_at_period_end
boolean
Yes
It ends when the current period ends.
canceled_at
string (date-time) or null
Yes
When it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_at
string (date-time) or null
Yes
cancel_reason
one of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or null
Yes
dunning: 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.
pause
object or null
Yes
A pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_end
boolean
No
pause.paused_at
string (date-time) or null
No
pause.resume_at
string (date-time) or null
No
When it starts again by itself; null: when you (or the customer) resume it.
pause.reason
one of merchant, customer, api, dunning, or null
No
shipping
object or null
Yes
shipping.name
string or null
No
shipping.address
object
No
shipping.address.line1
string
No
shipping.address.line2
string or null
No
shipping.address.city
string
No
shipping.address.state
string or null
No
shipping.address.postal_code
string
No
shipping.address.country
string
No
source
one of dashboard, api, payment_link, checkout
Yes
How it was started.
payment_link_id
string (uuid) or null
Yes
The plan payment link the customer signed up through.
sign_up_expires_at
string (date-time) or null
Yes
While incomplete: when the sign-up link stops working.
The subscription: cancel_at_period_end: true, or canceled.
400
invalid_request: the message names the first invalid field; invalid_json: the body is not JSON.
404
not_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).
409
subscription_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).
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.
Parameter
In
Type
Required
Description
subscription_id
path
string (uuid)
Yes
A subscription of your store.
Request body (application/json)
Field
Type
Required
Description
periods
integer (≥ 1, ≤ 12)
No
Pause for this many periods.
resume_at
string (date-time)
No
Resume then: after the end of the current period.
Request
{
"periods": 2
}
Response200
Field
Type
Always present
Description
id
string (uuid)
Yes
object
"subscription"
Yes
store_id
string (uuid)
Yes
customer_id
string (uuid)
Yes
customer
object or null
Yes
customer.email
string or null
No
customer.name
string or null
No
status
one of incomplete, incomplete_expired, trialing, active, past_due, paused, canceled
Yes
incomplete: 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_text
string
Yes
The status in plain words (Waiting for customer, Past due, …).
plan
object
Yes
plan.id
string (uuid)
Yes
plan.name
string
No
plan.amount
integer
No
plan.currency
string
No
plan.interval
one of day, week, month, year or null
No
plan.interval_count
integer or null
No
quantity
integer
Yes
addons
array of object
Yes
addons[].plan_id
string (uuid)
No
addons[].name
string or null
No
addons[].amount
integer or null
No
addons[].quantity
integer
No
intro
object or null
Yes
The intro price this subscription has, taken from its plan when it was created.
payment_method
object or null
Yes
The saved card it is charged to. Null until the customer signs up.
trial_end
string (date-time) or null
Yes
When the free trial ends (the first charge).
current_period
object or null
Yes
current_period.index
integer
No
0 for the first period.
current_period.start
string (date-time) or null
No
current_period.end
string (date-time) or null
No
current_period.amount
integer or null
No
What this period was billed, minor units.
next_billing_at
string (date-time) or null
Yes
When it is charged next, or resumes; null once ended.
credit_balance
integer
Yes
Credit from downgrades, taken off the next bills (minor units).
pending_change
object or null
Yes
A change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_id
string (uuid)
No
This change: its notice is for it alone; a newer change is always told again.
pending_change.plan_id
string (uuid)
No
pending_change.increase
object or null
No
Set 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.from
integer
No
The price per period before, minor units (per from_every).
pending_change.increase.to
integer
No
The price per period after, minor units (per to_every).
pending_change.increase.from_every
string
No
The period before, in words: every month.
pending_change.increase.to_every
string
No
The period after, in words: every week.
pending_change.increase.currency
string
No
pending_change.increase.effective_index
integer or null
No
The period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_at
string (date-time) or null
No
When that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_at
string (date-time) or null
No
When 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.version
integer
No
Which notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantity
integer
No
pending_change.addons
array of object
No
pending_change.addons[].plan_id
string (uuid)
No
pending_change.addons[].quantity
integer
No
cancel_at_period_end
boolean
Yes
It ends when the current period ends.
canceled_at
string (date-time) or null
Yes
When it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_at
string (date-time) or null
Yes
cancel_reason
one of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or null
Yes
dunning: 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.
pause
object or null
Yes
A pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_end
boolean
No
pause.paused_at
string (date-time) or null
No
pause.resume_at
string (date-time) or null
No
When it starts again by itself; null: when you (or the customer) resume it.
pause.reason
one of merchant, customer, api, dunning, or null
No
shipping
object or null
Yes
shipping.name
string or null
No
shipping.address
object
No
shipping.address.line1
string
No
shipping.address.line2
string or null
No
shipping.address.city
string
No
shipping.address.state
string or null
No
shipping.address.postal_code
string
No
shipping.address.country
string
No
source
one of dashboard, api, payment_link, checkout
Yes
How it was started.
payment_link_id
string (uuid) or null
Yes
The plan payment link the customer signed up through.
sign_up_expires_at
string (date-time) or null
Yes
While incomplete: when the sign-up link stops working.
invalid_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.
404
not_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).
409
payment_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).
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.
Parameter
In
Type
Required
Description
subscription_id
path
string (uuid)
Yes
A subscription of your store.
No request body. Sign it as an empty body.
Response200
Field
Type
Always present
Description
id
string (uuid)
Yes
object
"subscription"
Yes
store_id
string (uuid)
Yes
customer_id
string (uuid)
Yes
customer
object or null
Yes
customer.email
string or null
No
customer.name
string or null
No
status
one of incomplete, incomplete_expired, trialing, active, past_due, paused, canceled
Yes
incomplete: 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_text
string
Yes
The status in plain words (Waiting for customer, Past due, …).
plan
object
Yes
plan.id
string (uuid)
Yes
plan.name
string
No
plan.amount
integer
No
plan.currency
string
No
plan.interval
one of day, week, month, year or null
No
plan.interval_count
integer or null
No
quantity
integer
Yes
addons
array of object
Yes
addons[].plan_id
string (uuid)
No
addons[].name
string or null
No
addons[].amount
integer or null
No
addons[].quantity
integer
No
intro
object or null
Yes
The intro price this subscription has, taken from its plan when it was created.
payment_method
object or null
Yes
The saved card it is charged to. Null until the customer signs up.
trial_end
string (date-time) or null
Yes
When the free trial ends (the first charge).
current_period
object or null
Yes
current_period.index
integer
No
0 for the first period.
current_period.start
string (date-time) or null
No
current_period.end
string (date-time) or null
No
current_period.amount
integer or null
No
What this period was billed, minor units.
next_billing_at
string (date-time) or null
Yes
When it is charged next, or resumes; null once ended.
credit_balance
integer
Yes
Credit from downgrades, taken off the next bills (minor units).
pending_change
object or null
Yes
A change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_id
string (uuid)
No
This change: its notice is for it alone; a newer change is always told again.
pending_change.plan_id
string (uuid)
No
pending_change.increase
object or null
No
Set 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.from
integer
No
The price per period before, minor units (per from_every).
pending_change.increase.to
integer
No
The price per period after, minor units (per to_every).
pending_change.increase.from_every
string
No
The period before, in words: every month.
pending_change.increase.to_every
string
No
The period after, in words: every week.
pending_change.increase.currency
string
No
pending_change.increase.effective_index
integer or null
No
The period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_at
string (date-time) or null
No
When that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_at
string (date-time) or null
No
When 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.version
integer
No
Which notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantity
integer
No
pending_change.addons
array of object
No
pending_change.addons[].plan_id
string (uuid)
No
pending_change.addons[].quantity
integer
No
cancel_at_period_end
boolean
Yes
It ends when the current period ends.
canceled_at
string (date-time) or null
Yes
When it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_at
string (date-time) or null
Yes
cancel_reason
one of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or null
Yes
dunning: 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.
pause
object or null
Yes
A pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_end
boolean
No
pause.paused_at
string (date-time) or null
No
pause.resume_at
string (date-time) or null
No
When it starts again by itself; null: when you (or the customer) resume it.
pause.reason
one of merchant, customer, api, dunning, or null
No
shipping
object or null
Yes
shipping.name
string or null
No
shipping.address
object
No
shipping.address.line1
string
No
shipping.address.line2
string or null
No
shipping.address.city
string
No
shipping.address.state
string or null
No
shipping.address.postal_code
string
No
shipping.address.country
string
No
source
one of dashboard, api, payment_link, checkout
Yes
How it was started.
payment_link_id
string (uuid) or null
Yes
The plan payment link the customer signed up through.
sign_up_expires_at
string (date-time) or null
Yes
While incomplete: when the sign-up link stops working.
not_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).
409
not_paused: nothing to resume; canceled_by_customer: the customer cancelled it; conflict: the subscription changed meanwhile (try again).
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.
Parameter
In
Type
Required
Description
subscription_id
path
string (uuid)
Yes
A subscription of your store.
Request body (application/json)
Field
Type
Required
Description
plan_id
string (uuid)
No
Another plan of your store, in the same currency. A new plan drops any intro price left.
quantity
integer (≥ 1, ≤ 1000)
No
addons
array of object (≤ 20 items)
No
Replaces every add-on ([] removes them).
addons[].plan_id
string (uuid)
Yes
An add-on of your store (kind: "addon"), in the plan's currency.
addons[].quantity
integer (≥ 1, ≤ 1000)
No
Default 1.
proration
one of now, next_period
No
now: 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.
one of incomplete, incomplete_expired, trialing, active, past_due, paused, canceled
Yes
incomplete: 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_text
string
Yes
The status in plain words (Waiting for customer, Past due, …).
plan
object
Yes
plan.id
string (uuid)
Yes
plan.name
string
No
plan.amount
integer
No
plan.currency
string
No
plan.interval
one of day, week, month, year or null
No
plan.interval_count
integer or null
No
quantity
integer
Yes
addons
array of object
Yes
addons[].plan_id
string (uuid)
No
addons[].name
string or null
No
addons[].amount
integer or null
No
addons[].quantity
integer
No
intro
object or null
Yes
The intro price this subscription has, taken from its plan when it was created.
payment_method
object or null
Yes
The saved card it is charged to. Null until the customer signs up.
trial_end
string (date-time) or null
Yes
When the free trial ends (the first charge).
current_period
object or null
Yes
current_period.index
integer
No
0 for the first period.
current_period.start
string (date-time) or null
No
current_period.end
string (date-time) or null
No
current_period.amount
integer or null
No
What this period was billed, minor units.
next_billing_at
string (date-time) or null
Yes
When it is charged next, or resumes; null once ended.
credit_balance
integer
Yes
Credit from downgrades, taken off the next bills (minor units).
pending_change
object or null
Yes
A change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_id
string (uuid)
No
This change: its notice is for it alone; a newer change is always told again.
pending_change.plan_id
string (uuid)
No
pending_change.increase
object or null
No
Set 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.from
integer
No
The price per period before, minor units (per from_every).
pending_change.increase.to
integer
No
The price per period after, minor units (per to_every).
pending_change.increase.from_every
string
No
The period before, in words: every month.
pending_change.increase.to_every
string
No
The period after, in words: every week.
pending_change.increase.currency
string
No
pending_change.increase.effective_index
integer or null
No
The period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_at
string (date-time) or null
No
When that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_at
string (date-time) or null
No
When 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.version
integer
No
Which notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantity
integer
No
pending_change.addons
array of object
No
pending_change.addons[].plan_id
string (uuid)
No
pending_change.addons[].quantity
integer
No
cancel_at_period_end
boolean
Yes
It ends when the current period ends.
canceled_at
string (date-time) or null
Yes
When it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_at
string (date-time) or null
Yes
cancel_reason
one of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or null
Yes
dunning: 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.
pause
object or null
Yes
A pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_end
boolean
No
pause.paused_at
string (date-time) or null
No
pause.resume_at
string (date-time) or null
No
When it starts again by itself; null: when you (or the customer) resume it.
pause.reason
one of merchant, customer, api, dunning, or null
No
shipping
object or null
Yes
shipping.name
string or null
No
shipping.address
object
No
shipping.address.line1
string
No
shipping.address.line2
string or null
No
shipping.address.city
string
No
shipping.address.state
string or null
No
shipping.address.postal_code
string
No
shipping.address.country
string
No
source
one of dashboard, api, payment_link, checkout
Yes
How it was started.
payment_link_id
string (uuid) or null
Yes
The plan payment link the customer signed up through.
sign_up_expires_at
string (date-time) or null
Yes
While incomplete: when the sign-up link stops working.
metadata
object
Yes
created_at
string (date-time)
Yes
proration
object
No
Only for a change applied now.
proration.charge
integer
No
Charged now for the rest of the period, minor units. Always 0 since a price increase never applies at once (kept for compatibility).
proration.credit
integer
No
Credited to the next bills (a downgrade), minor units.
proration.outcome
one of paid, processing, failed, resume_later, not_charged, or null
No
How the charge went; null when nothing was charged.
The subscription; for a change applied now, with proration.
400
invalid_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.
404
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).
409
not_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).
422
shipping_address_required: the new plan ships and the subscription has no shipping address: set one with PATCH first.
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).
Parameter
In
Type
Required
Description
subscription_id
path
string (uuid)
Yes
A subscription of your store.
No request body. Sign it as an empty body.
Response200
Field
Type
Always present
Description
id
string (uuid)
Yes
object
"subscription"
Yes
store_id
string (uuid)
Yes
customer_id
string (uuid)
Yes
customer
object or null
Yes
customer.email
string or null
No
customer.name
string or null
No
status
one of incomplete, incomplete_expired, trialing, active, past_due, paused, canceled
Yes
incomplete: 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_text
string
Yes
The status in plain words (Waiting for customer, Past due, …).
plan
object
Yes
plan.id
string (uuid)
Yes
plan.name
string
No
plan.amount
integer
No
plan.currency
string
No
plan.interval
one of day, week, month, year or null
No
plan.interval_count
integer or null
No
quantity
integer
Yes
addons
array of object
Yes
addons[].plan_id
string (uuid)
No
addons[].name
string or null
No
addons[].amount
integer or null
No
addons[].quantity
integer
No
intro
object or null
Yes
The intro price this subscription has, taken from its plan when it was created.
payment_method
object or null
Yes
The saved card it is charged to. Null until the customer signs up.
trial_end
string (date-time) or null
Yes
When the free trial ends (the first charge).
current_period
object or null
Yes
current_period.index
integer
No
0 for the first period.
current_period.start
string (date-time) or null
No
current_period.end
string (date-time) or null
No
current_period.amount
integer or null
No
What this period was billed, minor units.
next_billing_at
string (date-time) or null
Yes
When it is charged next, or resumes; null once ended.
credit_balance
integer
Yes
Credit from downgrades, taken off the next bills (minor units).
pending_change
object or null
Yes
A change that applies at the next period (a price increase: from increase.effective_at).
pending_change.change_id
string (uuid)
No
This change: its notice is for it alone; a newer change is always told again.
pending_change.plan_id
string (uuid)
No
pending_change.increase
object or null
No
Set 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.from
integer
No
The price per period before, minor units (per from_every).
pending_change.increase.to
integer
No
The price per period after, minor units (per to_every).
pending_change.increase.from_every
string
No
The period before, in words: every month.
pending_change.increase.to_every
string
No
The period after, in words: every week.
pending_change.increase.currency
string
No
pending_change.increase.effective_index
integer or null
No
The period it applies from (0 is the first); null while unknown (paused with no end date).
pending_change.increase.effective_at
string (date-time) or null
No
When that period starts: the first charge at the new price; null while unknown.
pending_change.increase.notice_sent_at
string (date-time) or null
No
When 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.version
integer
No
Which notice: goes up each time the date moves, so a notice for an earlier date never counts again.
pending_change.quantity
integer
No
pending_change.addons
array of object
No
pending_change.addons[].plan_id
string (uuid)
No
pending_change.addons[].quantity
integer
No
cancel_at_period_end
boolean
Yes
It ends when the current period ends.
canceled_at
string (date-time) or null
Yes
When it was cancelled (for a cancellation at the period's end, when it was asked for).
ended_at
string (date-time) or null
Yes
cancel_reason
one of merchant, customer, api, dunning, store_closed, reminder_undeliverable, or null
Yes
dunning: 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.
pause
object or null
Yes
A pause waiting for the period's end (at_period_end: true), or under way.
pause.at_period_end
boolean
No
pause.paused_at
string (date-time) or null
No
pause.resume_at
string (date-time) or null
No
When it starts again by itself; null: when you (or the customer) resume it.
pause.reason
one of merchant, customer, api, dunning, or null
No
shipping
object or null
Yes
shipping.name
string or null
No
shipping.address
object
No
shipping.address.line1
string
No
shipping.address.line2
string or null
No
shipping.address.city
string
No
shipping.address.state
string or null
No
shipping.address.postal_code
string
No
shipping.address.country
string
No
source
one of dashboard, api, payment_link, checkout
Yes
How it was started.
payment_link_id
string (uuid) or null
Yes
The plan payment link the customer signed up through.
sign_up_expires_at
string (date-time) or null
Yes
While incomplete: when the sign-up link stops working.
metadata
object
Yes
created_at
string (date-time)
Yes
retry
array of one of paid, processing, failed, resume_later, not_charged
not_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).
409
not_past_due: only a past-due subscription is retried.
OnCharge sends these events to your webhook endpoint. Verification and handling: Webhooks.
Event
When
payment.pending
The 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.authorized
The card was approved and the money is held for you. It is collected next.
payment.captured
The 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_review
A payment to your wallet arrived but does not match the order (for example a different amount), so check it before you ship.
payment.refused
The 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.cancelled
The payment was cancelled before it was collected. Nothing was charged.
payment.expired
The shopper did not finish paying in time. Nothing was charged.
payment.capture_failed
An approved payment could not be collected. The order is not paid.
refund.succeeded
A refund went through. The amount is the total refunded on this order so far.
refund.failed
A refund could not be sent. Nothing was taken from your balance.
chargeback.opened
The shopper asked their bank to reverse this payment. OnCharge helps you answer it.
dispute.evidence_due
A 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.won
The bank decided in your favour. You keep the money.
chargeback.lost
The bank decided for the shopper. The payment is reversed.
fraud_warning.received
The 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.confirmed
Every package of the order was confirmed delivered by the carrier. Sent once per order.
payout.paid
A 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.failed
A 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.returned
Your bank sent a payout back after it arrived. The money is sent again once working bank details are on file.
account.updated
What your account can do changed: taking payments, receiving payouts, or what it needs from you.
account.requirements_due
Your account needs more information by the deadline, or it stops taking payments. Provide it under Settings. Sent once per change.
account.restricted
Your account stopped taking payments or receiving payouts. The reason says what to do.
swap.created
A conversion was created and waits for the coins to arrive.
swap.completed
A crypto payment was converted to the coin you are paid in and sent to your wallet.
swap.failed
A crypto payment could not be converted. The coins go back to the sender, or OnCharge contacts you.
swap.refunded
A conversion could not finish, and the coins were sent back to the sender.
swap.expired
No coins arrived before the conversion's quote ran out. Nothing was converted.
support.conversation.created
A customer started a conversation by email, chat or phone. Not sent yet: the sample shows what will arrive.
support.message.received
A customer wrote in an open conversation. Not sent yet: the sample shows what will arrive.
support.conversation.closed
A 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.created
A customer agreed to a subscription and it started: its trial began, or its first period was paid.
subscription.updated
The 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_end
A 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_due
A 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.paused
The subscription paused: nothing is charged or shipped until it resumes (data.resume_at, or when you resume it).
subscription.resumed
A paused subscription started again; a new period began and was charged.
subscription.canceled
The subscription ended: cancelled by you or the customer, or after its payment failed on every retry (data.cancel_reason).
subscription.period.paid
A 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_failed
A 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
Header
Description
OnCharge-Event-Id
Unique event ID (evt_…). Deduplicate on it; the same event may be delivered more than once.
OnCharge-Signature
t=<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.
Every 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.
created
integer
Yes
Unix time (seconds) the event was created.
livemode
boolean
Yes
false for events from test payments.
data
object
Yes
For 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_id
string or null
No
The checkout session; null for a payment paid straight to your wallet.
data.order_id
string or null
No
Your order ID, if known.
data.reference
string or null
No
The reference you sent when creating the session.
data.amount
integer or null
No
Minor units. For refund.succeeded, the total refunded so far.
data.currency
string or null
No
ISO 4217 code.
data.status
string or null
No
The order's payment status after the event (for example captured, refunded).
data.rail
one of card, crypto, card_to_crypto
Yes
The 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_reference
string or null
No
OnCharge's reference for the payment (ocpay_…).
data.payment_link_id
string (uuid) or null
No
The payment link the checkout was made from (/api/v1/payment-links), or null.
data.invoice_id
string (uuid)
No
Only on a payment for an OnCharge invoice: the invoice's id (see Invoices).
data.payment_method
one of card, bank_debit, cash_app_pay, klarna, affirm, afterpay, or null
No
How 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.tax
object or null
No
Sales tax on the payment, on payment, refund and chargeback events of a taxed payment only.
data.tax.status
one of awaiting_address, calculated, pending, failed, collected, partly_refunded, refunded
Yes
awaiting_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.inclusive
boolean
Yes
true when the listed prices include the tax.
data.tax.currency
string or null
Yes
data.tax.subtotal
integer or null
Yes
Before tax, minor units.
data.tax.amount
integer or null
Yes
The tax, minor units.
data.tax.total
integer or null
Yes
What the customer pays, minor units.
data.tax.shipping
integer
Yes
The shipping charge inside the total, minor units.
data.tax.jurisdictions
array of object
Yes
data.tax.refunded
integer
Yes
Tax given back so far with refunds and lost disputes, minor units.
data.tax.error
string or null
Yes
tax_address_invalid or tax_unavailable when status is failed.
data.reason
one of limit_exceeded
No
Only 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.
Same as type. Kept for older plugins; only on payment events from a checkout. Deprecated.
status
string or null
No
Same as data.status. Kept for older plugins; only on payment events from a checkout. Deprecated.
psp_reference
string or null
No
Kept 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.