Charges

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. The same key with a different amount, currency, account, channel or payer is not a retry, and is refused with 422 `IDEMPOTENCY_KEY_REUSED`. Send `account` to collect into one of your accounts other than the main one; the charge, its webhooks and its settlement all name it.

Before you call this endpoint

  • An API key needs the payments:write scope.
  • Once your business has an IP allowlist, every live key must call from an address on it.
  • Guide: Mobile money collections
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. The same key with a different amount, currency, account, channel or payer is not a retry, and is refused with 422 IDEMPOTENCY_KEY_REUSED.

Send account to collect into one of your accounts other than the main one; the charge, its webhooks and its settlement all name it.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/b/v1/charges" \  -H "Content-Type: application/json" \  -d '{    "idempotency_key": "order-1042",    "amount_minor": 500000,    "currency": "RWF"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "reference": "string",  "amount_minor": 0,  "fee_minor": 0,  "net_minor": 0,  "refunded_minor": 0,  "refund_pending_minor": 0,  "refund_state": "none",  "currency": "string",  "status": "string",  "channel": "mobile_money",  "country_code": "RW",  "provider": "string",  "failure_reason": "string",  "is_test": true,  "created_at": "2019-08-24T14:15:22Z",  "confirmed_at": "2019-08-24T14:15:22Z",  "settled_at": "2019-08-24T14:15:22Z",  "expected_settlement_at": "2019-08-24T14:15:22Z",  "account": "acct_4f1c9a2b7d3e8f6a0b1c2d3e",  "payer_name": "string"}