Skip to main content

Resources and configuration

Configure your sandbox and production environment to ensure API requests are optimal.

Checkout Protocol

Checkout Protocol API resources.

Authentication request

Authenticate to the APIs and start using the Checkout.

Endpoint: POST {CHECKOUT_URL}/api/v1/session

Header: Content-Type: application/json

Common parameters for Checkout Protocol

These apply to all operations (purchase, debit, credit, transfer). Operation-specific extras are listed in each API call.

ParameterTypeRequiredDescription
merchant_keystringyesYour merchant key from admin panel.
operationstringyesOne of purchase, debit, credit, transfer.
success_urlstring (URL, ≤1024)yesWhere to redirect after a successful payment. May contain query parameters.
cancel_urlstring (URL, ≤1024)noWhere to redirect when the customer closes the form. Trigger conditions configurable via "Maximum count declines" in Protocol Mappings.
expiry_urlstring (URL, ≤1024)noRedirect target when the session expires before completion.
error_urlstring (URL, ≤1024)noRedirect target on a Checkout-side technical error (e.g., misconfiguration). If omitted, Checkout shows a default error page.
url_targetstringnoHTML browsing context for return: _self, _parent, _top.
session_expiryinteger (1–720)noSession lifetime in minutes. Default 60.
channel_idstring (≤16)noRoutes the payment to a specific MID (Merchant Mapping). Configured in admin panel. If used together with methods, the MID must support the chosen method.
hashstringyesRequest signature. See hash signature.
orderobjectyesSee below.
order.numberstring (3–255)yesYour unique order identifier. Idempotency key: see idempotency.
order.amountstringyesDecimal string. Format depends on the currency exponent. See Amount format.
order.currencystring (3 chars fiat / 3–6 chars crypto)yesISO 4217 for fiat.
order.descriptionstring (2–1024)yesHuman-readable product name shown on the receipt.
customerobjectconditionalRequired when the chosen payment method needs it. If omitted, Checkout asks the customer to fill the missing fields.
customer.namestring (2–200, Latin basic [a-zA-Z])conditionalCustomer's name. Its validation (including whether the field is required) is governed by the Protocol Mapping settings. If it is not specified in the request, the Checkout page shows it — when a payment method needs it — as the Cardholder field. Example: John Doe.
customer.emailstring (email)conditional
customer.birth_datestring (yyyy-mm-dd, ISO 8601)conditionalRequired by some APMs.
billing_addressobjectconditionalRequired by AVS / 3DS / some APMs.
billing_address.countrystring (alpha-2)conditionalISO 3166-1.
billing_address.statestring (2–32)optionalCollected and validated only when billing_address.country is US, CA, AU, JP, or IN (2-letter code); ignored for other countries.
billing_address.citystring (2–40)conditional
billing_address.addressstring (2–255)conditional
billing_address.house_numberstring (1–9)optional
billing_address.zipstring (2–10)conditional
billing_address.phonestring (1–32, digits/+()-)conditional
billing_address.phone_country_codestringoptionalE.g., +380.
billing_address.districtstring (2–32)optional
billing_address.languagestringoptionalLanguage for the billing context, e.g. UA (case-insensitive).
parametersobjectoptionalExtra parameters required by a specific payment method. Keyed by method name: parameters.card.foo, parameters.paypal.bar.
custom_dataobjectoptionalArbitrary key-value data that will be echoed back in the callback.

General fields for Checkout Page

The fields the Checkout page renders, their limitations and the error strings returned on validation failure are documented on the Checkout page guide.

Operation-specific parameters

ParameterTypeOperationsDescription
methodsarray of stringsall operationsRestricts the methods shown on the Checkout page (e.g. ["card","paypal"]). If omitted, pre-routing rules apply.
req_tokenboolean (default false)purchase, debitWhen true, Checkout returns a card_token in the callback for future tokenized payments. Ignored if card_token is supplied.
card_tokenarray of strings (each 64 chars)purchase, debitUse a previously saved token to skip card-data entry. A payout to a saved token is a separate request, not a Checkout session: see Card credit, where card_token replaces the card data and payee_first_name / payee_last_name name the recipient.
authstring, Y or N (default N)purchase onlyAuthenticate only, do not capture. This is the two-step Dual Message System (DMS) flow; see DMS mode. When Y, routing selects DMS or SMS/DMS (both) MIDs and the capture-type logic applies.
recurring_initboolean (default false)purchase, debitInitializes a recurring chain. Once the initializing transaction settles, recurring_token (and recurring_init_trans_id for purchase) is returned in the response and the callback. Subsequent recurring payments use /api/v1/payment/recurring.
schedule_idstringpurchase, debit, when recurring_init=trueSchedule for recurring billing. Schedules are not separated by operation type.
vat_calcboolean (default false)purchase onlyEnables VAT calculation for this payment.
payeeobjecttransfer, creditRecipient details. See below.
payee.namestring (2–32, Latin)transfer, creditRequired.
payee.emailstring (email)transfer, creditConditional.
payee_billing_address.*objecttransfer, creditSame shape as billing_address.
crypto.networkstring (≤50)any with crypto methodsNetwork to display, e.g. ERC20, TRC20, solana, polygon.
form_idstring (UUID)anyIdentifier for a custom payment form. See the Checkout SDK documentation.

Amount format

order.amount is a string. Its format depends on the currency exponent:

Currency exponentFormatExamples
0 (e.g., JPY, KRW, CLP, UGX)"XX.XX" (with trailing zeros)"1000.00"
2 (most fiat: USD, EUR, UAH, ...)"XX.XX""100.99"
3 (BHD, KWD, ...)"XXX.XXX""100.999"
4 (CLF, ...)"XXX.XXXX""100.9999"
CryptoUse the exponent appropriate for the asset"0.00000001" for BTC

Special cases:

  • purchase with crypto: omit amount entirely (and exclude it from the hash) when the customer enters the amount on a third-party UI (e.g., wallet app).
  • transfer with amount = -1: shows an empty amount field on Checkout so the customer can enter it.

Idempotency

tip

order.number is not globally unique in the system — multiple merchants can reuse the same value. Use a unique order.number for each payment attempt so you can reliably match callbacks to orders. To limit a customer to one attempt per session, set Maximum number of declines to 1 in admin panel > Protocol mapping.

Server-side deduplication. A repeated request with the same merchant_key + order.number within 15 seconds of the previous one returns:

{ "error_code": "400", "error_message": "Duplicate request." }

This protects against accidental double-submits (network retries, double-clicks). After the 15-second window the request is treated as new.

Recommended pattern: generate a UUID (or your own monotonic ID) for each payment attempt your customer makes; do not reuse it across cart-abandon retries.

Responses

On success the API returns:

{
"redirect_url": "https://checkout-sandbox.example.com/p/abc123",
}

On validation failure the API returns 400 Bad Request with errors[]. See Error reference.

Examples

Purchase (one-step, card, with billing address)
curl -X POST "$CHECKOUT_URL/api/v1/session" \
-H "Content-Type: application/json" \
-d '{
"merchant_key": "27106696-656c-...-7e11ae873370",
"operation": "purchase",
"methods": ["card"],
"session_expiry": 60,
"order": {
"number": "order-1234",
"amount": "0.19",
"currency": "USD",
"description": "Important gift"
},
"success_url": "https://example.com/success",
"cancel_url": "https://example.com/cancel",
"expiry_url": "https://example.com/expiry",
"url_target": "_parent",
"customer": {
"name": "John Doe",
"email": "test@example.com"
},
"billing_address": {
"country": "US",
"state": "CA",
"city": "Los Angeles",
"address": "Moor Building 35274",
"zip": "123456",
"phone": "347771112233"
},
"req_token": true,
"hash": "<sha1(md5(uppercase(order.number+amount+currency+description+password)))>"
}'
Debit (charge with a saved token)
curl -X POST "$CHECKOUT_URL/api/v1/session" \
-H "Content-Type: application/json" \
-d '{
"merchant_key": "27106696-...-7e11ae873370",
"operation": "debit",
"methods": ["card"],
"card_token": ["f5d6a0ab6fcfb6487a39e2256e50fff3c95aaa97075ee5e539bb662fceff4dc1"],
"order": {
"number": "order-1234",
"amount": "0.19",
"currency": "USD",
"description": "Important gift"
},
"success_url": "https://example.com/success",
"cancel_url": "https://example.com/cancel",
"customer": { "name": "John Doe", "email": "test@example.com" },
"hash": "<auth signature>"
}'
Transfer (P2P)
curl -X POST "$CHECKOUT_URL/api/v1/session" \
-H "Content-Type: application/json" \
-d '{
"merchant_key": "27106696-...-7e11ae873370",
"operation": "transfer",
"order": {
"number": "order-1234",
"amount": "100.55",
"currency": "USD",
"description": "P2P transfer"
},
"success_url": "https://example.com/success",
"cancel_url": "https://example.com/cancel",
"customer": { "name": "John Doe", "email": "sender@example.com" },
"payee": { "name": "Jane Doe", "email": "recipient@example.com" },
"billing_address": { "country": "US", "state": "CA", "city": "Los Angeles", "address": "Moor Building 35274", "zip": "94538", "phone": "0987654321" },
"payee_billing_address": { "country": "US", "state": "NY", "city": "New York", "address": "123 Park Ave", "zip": "10001", "phone": "0987654321" },
"hash": "<auth signature>"
}'
Credit (payout to a card)
curl -X POST "$CHECKOUT_URL/api/v1/session" \
-H "Content-Type: application/json" \
-d '{
"merchant_key": "27106696-...-7e11ae873370",
"operation": "credit",
"methods": ["airtel"],
"order": {
"number": "order-1234",
"amount": "100.55",
"currency": "USD",
"description": "Reward payout"
},
"success_url": "https://example.com/success",
"cancel_url": "https://example.com/cancel",
"payee_billing_address": { "country": "US", "phone": "347771112255" },
"hash": "<auth signature>"
}'

Errors

The Payments APIs use standard HTTP status codes to indicate the success or failure of a request.

Status CodeDescription
200OK
201Created
204No Content
400Bad Request
401Unauthorized
403Forbidden
404Not Found
429Too Many Requests
500Internal Server Error

We also return a code and message in the response body for each error. Learn more about error codes in Error handling.