Charges
Charge a subscription
Charges the subscription’s payment method off-session for offer lines of your catalogue, never a free amount. A failure is a state of the charge, not an error.
Authorization
bearer charges:writeAuthorizationBearer <token>
A v1 API key; the scope named is the one the route needs.
In: header
Scope: charges:write
Header Parameters
Idempotency-Key*string
Names the act so a retry under it lands on the stored answer (idempotency-key).
Length
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://example.com/v1/charges" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "subscriptionId": "string", "lines": [ { "offerId": "42da58f8-9040-4cf5-98ce-bce9965cca0d", "quantity": 1 } ] }'{ "id": "string", "subscriptionId": "string", "status": "string", "amount": { "amount": -9007199254740991, "currency": "string" }, "tax": { "amount": -9007199254740991, "currency": "string" }, "lines": [ { "kind": "offer", "offerId": "42da58f8-9040-4cf5-98ce-bce9965cca0d", "quantity": 1, "unitAmount": { "amount": -9007199254740991, "currency": "string" }, "amount": { "amount": -9007199254740991, "currency": "string" } } ], "orderId": "b3e1eced-f2bd-4d8c-9765-fbc9d1d222d5", "invoiceNumber": "string", "failureCode": "string", "createdAt": "2019-08-24T14:15:22Z", "liveMode": true}