Charge Subscription
Charge an additional one-off amount to an active Subscription. Creates a new Invoice and handles payment processing. Multiple items (up to 20) can be charged in a single call; each becomes its own Invoice line. All items must share the same currency, and that currency must match the Subscription's currency. Tax is calculated on the total and distributed proportionally across the lines. The total including tax must reach the card processor's minimum charge (for example 0.50 EUR or USD) and cover the platform fee. A smaller total answers 400 before anything is written. A total the card processor refuses as too small in your settlement currency also answers 400 and nothing is charged, but a failed payment stays on the Subscription. To bill a small proration, update the Subscription with `prorationBehavior: create_prorations` so the amount lands on its next invoice.
Authorization
Public key Secret key In: header
In: header
Path Parameters
Subscription identifier - the initial order number, exactly as returned in subscription.id. Omit the leading # the dashboard shows: a #-prefixed value passes validation but resolves to nothing. Payment-provider subscription ids are not accepted.
^#?([0-9A-Za-z]{12,32}|[0-9]+)(-[0-9]+)?$Request Body
application/json
POST /v0/subscriptions/:subscriptionIdOrNumber/charge Request body
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/v0/subscriptions/ABC123DEF456/charge" \ -H "Content-Type: application/json" \ -d '{ "items": [ { "unitPrice": 4999, "quantity": 1, "description": "Additional storage upgrade" } ] }'{ "status": "success", "data": { "payment": { "object": "payment", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "type": "one_time", "number": "string", "status": "PENDING", "value": 0, "tax": 0, "fee": 0, "currency": "AFN", "currencyDecimals": null, "createdAt": 0, "userId": null, "user": null, "orderId": null, "orderNumber": null, "order": null, "subscriptionId": null, "subscription": null, "checkoutId": null, "discount": null, "invoiceNumber": null, "invoiceUrl": null, "charges": null } }}Update Subscription PATCH
Update Subscription items and handle proration behavior. Can modify prices, quantities, and add/remove items. The items array is the desired end state of the Subscription: items are paired to existing lines by offerId, missing ones are removed, and new ones are added (up to 20 total). All resulting items must share the same currency and billing period (recurring interval + interval count); otherwise the request is rejected with a 400. An item naming the offer already live and sending no unitPrice keeps the unit price that line bills now. On a subscription still billed at a discount, a single item naming another offer the discount covers and sending no unitPrice is priced from that offer with the same discount taken off; a change it cannot price is rejected with a 400. Exception: for a subscription managed in the new dashboard, each item names only its offerId and quantity, at the offer's own price and name, and prorationBehavior stays none: an upgrade is billed now and a downgrade on the next invoice. A unitPrice, a name or another prorationBehavior is rejected with a 400 before any change.
Cancel Subscription PATCH
Cancel a Subscription, either immediately or at the end of the current billing period. This endpoint issues no refund; refund the Subscription's payment separately if one is due.