ApiCharges

Create a charge

Take a payment. A repeated `idempotency_key` returns the original charge with 201 rather than a conflict. A client that did not hear our answer and asked again wants the charge, not an error it has to interpret.

POST
/api/b/v1/charges

Take a payment.

A repeated idempotency_key returns the original charge with 201 rather than a conflict. A client that did not hear our answer and asked again wants the charge, not an error it has to interpret.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/b/v1/charges" \  -H "Content-Type: application/json" \  -d '{    "idempotency_key": "stringst",    "amount_minor": 1,    "currency": "str"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "reference": "string",  "amount_minor": 0,  "fee_minor": 0,  "net_minor": 0,  "refunded_minor": 0,  "currency": "string",  "status": "string",  "channel": "string",  "failure_reason": "string",  "is_test": true,  "created_at": "2019-08-24T14:15:22Z",  "confirmed_at": "2019-08-24T14:15:22Z"}