ChargesBeta

A Charge is one authorization against a payment method, created when a Payment Intent is paid. A Payment Intent ends with at most one successful charge; its latest_charge holds the id.

Read a charge for the money totals: how much was captured and how much was refunded. Use the Payment Intent's status to decide whether you got paid.

The Charge objectBeta

idstring
Unique identifier, prefixed ch_.
objectstring
Always "charge".
livemodeboolean
Test or live mode.
payment_intentstring
ID of the Payment Intent this charge belongs to.
customerstring|null
ID of the Customer, if one was attached.
payment_methodstring|null
ID of the saved Payment Method, when the card was saved or reused. null for a one-off payment.
statusenum
See the status reference.
amountinteger
Amount authorized, in the smallest currency unit.
amount_capturedinteger
Amount captured. Lower than amount after a partial capture.
amount_refundedinteger
Total refunded so far. The refundable remainder is amount_captured - amount_refunded.
refundedboolean
true when the whole captured amount was refunded (status is refunded).
capturedboolean
Whether the charge has been captured.
currencystring
ISO 4217 code, uppercase.
payment_method_detailsobject
wallet is applepay, googlepay, clicktopay, samsungpay, paze or null for a card entered directly. card is { brand, last4, exp_month, exp_year, funding, country } or null when no card was used.
outcomeobject
type is authorized, declined, blocked or pending. risk_level is normal, elevated, highest or null. For why a payment was declined, read the Payment Intent's last_payment_error.
payer_authobject|null
3D Secure result, or null when 3D Secure did not run. outcome is authenticated, attempted, failed, unavailable or bypassed; liability_shift says whether fraud liability moved to the card issuer.
off_sessionboolean
true for a merchant-initiated charge on a saved card.
created_atstring
ISO 8601 timestamp.
THE CHARGE OBJECT
JSON
1{
2 "id": "ch_01JQX...",
3 "object": "charge",
4 "livemode": false,
5 "payment_intent": "pi_01JQX...",
6 "customer": "cus_01JQX...",
7 "payment_method": null,
8 "status": "partially_refunded",
9 "amount": 5000,
10 "amount_captured": 5000,
11 "amount_refunded": 2000,
12 "refunded": false,
13 "captured": true,
14 "currency": "USD",
15 "payment_method_details": {
16 "wallet": null,
17 "card": {
18 "brand": "visa",
19 "last4": "4242",
20 "exp_month": 12,
21 "exp_year": 2030,
22 "funding": "credit",
23 "country": "CW"
24 }
25 },
26 "outcome": {
27 "type": "authorized",
28 "risk_level": "normal"
29 },
30 "payer_auth": {
31 "outcome": "authenticated",
32 "liability_shift": true
33 },
34 "off_session": false,
35 "created_at": "2026-04-07T18:30:00.000Z"
36}
STATUS REFERENCE
pending
In progressAuthorization or 3D Secure is still running.
authorized
Funds heldManual capture. Capture or cancel the Payment Intent.
captured
CapturedThe money moved. Refundable up to amount_captured.
partially_refunded
Partly refundedSome of the captured amount was returned.
refunded
RefundedThe whole captured amount was returned.
voided
VoidedThe hold was released before capture.
failed
DeclinedThe authorization was declined or blocked.

Was this section helpful?

Retrieve a chargeBeta

GET/v1/charges/:id

Returns a single charge. Pass a Payment Intent's latest_charge to read its captured and refunded totals. Needs the payments:read scope on a restricted key.

Path parameters

idstringRequired
The charge id, prefixed ch_.

Errors

401unauthorized
Bad signature, expired timestamp, or unknown key.
403forbidden
The key lacks payments:read.
404 CHARGE_NOT_FOUNDnot_found
No charge with this id in the key's account and mode. A charge from another account, or from test when you use a live key, returns the same 404.
REQUEST
1curl https://api.cxpay.net/v1/charges/ch_01JQX... \
2 -H "X-Key-Id: ak_test_..." \
3 -H "X-Signature: <base64-hmac>" \
4 -H "X-Timestamp: 2026-04-07T18:30:00.000Z" \
5 -H "X-Nonce: 550e8400-..." \
6 -H "X-Body-Hash: <sha256-of-empty>"
TestGET /v1/charges/ch_01JQX...
RESPONSE
JSON
1{
2 "id": "ch_01JQX...",
3 "object": "charge",
4 "livemode": false,
5 "payment_intent": "pi_01JQX...",
6 "customer": "cus_01JQX...",
7 "payment_method": null,
8 "status": "partially_refunded",
9 "amount": 5000,
10 "amount_captured": 5000,
11 "amount_refunded": 2000,
12 "refunded": false,
13 "captured": true,
14 "currency": "USD",
15 "payment_method_details": {
16 "wallet": null,
17 "card": {
18 "brand": "visa",
19 "last4": "4242",
20 "exp_month": 12,
21 "exp_year": 2030,
22 "funding": "credit",
23 "country": "CW"
24 }
25 },
26 "outcome": {
27 "type": "authorized",
28 "risk_level": "normal"
29 },
30 "payer_auth": {
31 "outcome": "authenticated",
32 "liability_shift": true
33 },
34 "off_session": false,
35 "created_at": "2026-04-07T18:30:00.000Z"
36}

Was this section helpful?

Powered by CX Pay