Charges
Charge lifecycle, reversal and retries
Creating a charge
Authorization
bearer In: header
Header Parameters
8 to 128 characters [A-Za-z0-9._:-], unique per operation
^[A-Za-z0-9._:-]{8,128}$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
application/json
curl -X POST "https://example.com/v1/charges" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "externalId": "order-777", "cardId": "0192f3a0-5c1e-7b2a-9f4d-2b24b1f0c7a1", "amount": 25000000, "recipients": [ { "recipientId": "0192f3a0-5c1e-7b2a-9f4d-2b24b1f0c7b2", "share": 7000 }, { "recipientId": "0192f3a0-5c1e-7b2a-9f4d-2b24b1f0c7b3", "share": 3000 } ] }'{ "success": true, "meta": { "requestId": "string", "timestamp": "2019-08-24T14:15:22Z", "processingTimeMs": 0 }, "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "externalId": "string", "cardId": "f16ba382-eb42-481a-b08f-c57bdc9aae24", "status": "CREATED", "amount": 0, "fee": 0, "feeBps": 0, "recipients": [ { "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d", "share": 0, "amount": 0 } ], "split": { "status": "NOT_STARTED" }, "fiscal": { "status": "NOT_STARTED", "receiptUrl": "string" }, "failureReason": "string", "createdAt": "2019-08-24T14:15:22Z", "succeededAt": "2019-08-24T14:15:22Z" }}POST /v1/charges debits amount from the card and returns the result immediately:
status | Meaning |
|---|---|
SUCCEEDED | The money has been charged |
FAILED | The bank declined; the reason is in failureReason. The HTTP response is still 201 |
CREATED | The outcome at the provider is unknown (connection failure). We reconcile it ourselves: do not retry with a different externalId |
REVERSED | The charge was reversed |
externalId is your order number, unique per merchant. Repeating a request with the same externalId, card and
amount returns the existing charge; with different parameters it returns 409.
After payment
Authorization
bearer In: header
Path Parameters
uuidResponse Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/charges/497f6eca-6276-4993-bfeb-53cbbbba6f08"{ "success": true, "meta": { "requestId": "string", "timestamp": "2019-08-24T14:15:22Z", "processingTimeMs": 0 }, "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "externalId": "string", "cardId": "f16ba382-eb42-481a-b08f-c57bdc9aae24", "status": "CREATED", "amount": 0, "fee": 0, "feeBps": 0, "recipients": [ { "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d", "share": 0, "amount": 0 } ], "split": { "status": "NOT_STARTED" }, "fiscal": { "status": "NOT_STARTED", "receiptUrl": "string" }, "failureReason": "string", "createdAt": "2019-08-24T14:15:22Z", "succeededAt": "2019-08-24T14:15:22Z" }}Authorization
bearer In: header
Query Parameters
1 <= value11 <= value <= 10020Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/v1/charges"{ "success": true, "meta": { "requestId": "string", "timestamp": "2019-08-24T14:15:22Z", "processingTimeMs": 0, "pagination": { "page": 0, "limit": 0, "totalItems": 0, "totalPages": 0 } }, "data": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "externalId": "string", "cardId": "f16ba382-eb42-481a-b08f-c57bdc9aae24", "status": "CREATED", "amount": 0, "fee": 0, "feeBps": 0, "recipients": [ { "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d", "share": 0, "amount": 0 } ], "split": { "status": "NOT_STARTED" }, "fiscal": { "status": "NOT_STARTED", "receiptUrl": "string" }, "failureReason": "string", "createdAt": "2019-08-24T14:15:22Z", "succeededAt": "2019-08-24T14:15:22Z" } ]}The split and the receipt run in the background:
split.status:PENDINGβCOMPLETED(usually within seconds). On failures it retries automatically, then becomesFAILEDand is retried by support.fiscal.status:COMPLETEDafter the split; the receipt link is infiscal.receiptUrl.
Reversal
Authorization
bearer In: header
Path Parameters
uuidResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/charges/497f6eca-6276-4993-bfeb-53cbbbba6f08/reverse"{ "success": true, "meta": { "requestId": "string", "timestamp": "2019-08-24T14:15:22Z", "processingTimeMs": 0 }, "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "externalId": "string", "cardId": "f16ba382-eb42-481a-b08f-c57bdc9aae24", "status": "CREATED", "amount": 0, "fee": 0, "feeBps": 0, "recipients": [ { "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d", "share": 0, "amount": 0 } ], "split": { "status": "NOT_STARTED" }, "fiscal": { "status": "NOT_STARTED", "receiptUrl": "string" }, "failureReason": "string", "createdAt": "2019-08-24T14:15:22Z", "succeededAt": "2019-08-24T14:15:22Z" }}POST /v1/charges/{id}/reverse works only on the day of payment (Tashkent time) and before the split is done.
After the split, refunds go through support.
Recipients
Authorization
bearer In: header
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
curl -X POST "https://example.com/v1/recipients" \ -H "Content-Type: application/json" \ -d '{ "kind": "SELF_EMPLOYED", "fullName": "string", "pinfl": "string" }'{ "success": true, "meta": { "requestId": "string", "timestamp": "2019-08-24T14:15:22Z", "processingTimeMs": 0 }, "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "kind": "SELF_EMPLOYED", "fullName": "string", "pinfl": "string", "tin": "string", "status": "PENDING_VERIFICATION", "rejectionReason": "string", "createdAt": "2019-08-24T14:15:22Z" }}Authorization
bearer In: header
Query Parameters
1 <= value11 <= value <= 10020Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/v1/recipients"{ "success": true, "meta": { "requestId": "string", "timestamp": "2019-08-24T14:15:22Z", "processingTimeMs": 0, "pagination": { "page": 0, "limit": 0, "totalItems": 0, "totalPages": 0 } }, "data": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "kind": "SELF_EMPLOYED", "fullName": "string", "pinfl": "string", "tin": "string", "status": "PENDING_VERIFICATION", "rejectionReason": "string", "createdAt": "2019-08-24T14:15:22Z" } ]}Without the recipients field, the whole amount goes to the merchant's default recipient. Every recipient must be
verified by the platform, otherwise the response is 422 with code -6004.