Charges
List charges
Most recent first, scoped to your business and your key's mode.
Before you call this endpoint
- An API key needs the
payments:readscope. - Once your business has an IP allowlist, every live key must call from an address on it.
- Guide: Mobile money collections
Most recent first, scoped to your business and your key's mode.
Query Parameters
1 <= value <= 20050created|pending|succeeded|failed|refunded|partially_refunded|disputed
Filter on whether the money has landed. false is money the payer has paid that you cannot spend yet. Separate from status because settlement is not a lifecycle state: a charge is succeeded the moment the network or bank confirms it, and whether the funds have arrived is a different question about the same charge.
Response Body
application/json
application/json
curl -X GET "https://example.com/api/b/v1/charges"[ { "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" }]Expire a checkout session
End a session now, so its link can no longer be paid. For a cart your customer abandoned or an order that changed. The session becomes `expired` and `checkout.session.expired` is sent, once. Expiring a session that has already expired returns it unchanged with 200, so a retry is safe. Only a session nobody has started paying can be expired. While a payment is in progress the answer is 409 `CHECKOUT_IN_PROGRESS`: that money may still arrive, and the session will end as `complete` or `failed` by itself. A session that is already `complete` or `failed` is 409 `CHECKOUT_SESSION_CLOSED`. The payer pressing Cancel on the checkout page does not expire the session: they are sent to your `cancel_url` and may come back and pay before `expires_at`. If you want the link dead once they cancel, call this from your `cancel_url` handler. `expires_at` keeps its original value, so an `expired_at` before it shows the session was ended early.
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.