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.
checkout_languagestringnoDefault Checkout Page language. Highest-priority language source. Allowed values: fr, en, es, de, kk, ru, ar, zh, az, ua, no, zho. An unsupported value returns the error The checkout_language parameter is incorrect.
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 (≤255, [A-Za-z0-9-!"#$%&'()*+,./:;&@])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–32)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 list of the general fields and possible errors on the Checkout page is below:

FieldsTypeLimitationsError
Card numberIntegralLun algorithm, length 14-19 numbersInvalid card
Expiry DateDate2-2 numbers (in the format mm-yy),
after today's date
The expiration date of card is expired
and not valid.
Security codeIntegralUp to 4 charactersInvalid security code
Name on cardStringUp to 32 charactersThe name on card field
Must contain at least 2 words: first name and last name. Allowed special characters: hyphens, apostrophes, diacritics
CountryList2-letters codeCountry is required.
Please enter a valid Country
State/RegionString
List - for USA,
Canada, Australia,
Japan, India
2-letter code for US, CA, AU, JP, IN; free string elsewhereVaries by country
CityStringUp to 32 charactersCity is required.
Please enter a valid City
Address lineStringUp to 32 charactersAddress line is required.
Please enter a valid Address line
Zip codeStringUp to 32 charactersZip code is required.
Please enter a valid Zip code
Phone numberStringUp to 32 charactersPhone number is required.
Please enter a valid Phone number

Operation-specific parameters

ParameterTypeOperationsDescription
methodsarray of stringspurchase, debit, creditRestricts 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, debit, creditUse a previously saved token to skip card-data entry. For credit, no card data is collected (no MM / YY, no CVV) and there is no redirect to the checkout page; the payee name is taken from the token, or from payee_first_name + payee_last_name if supplied (those take priority).
authboolean (default false)purchase onlyAuthenticate only, do not capture. This is the two-step Dual Message System (DMS) flow; see DMS mode. When true, 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 SDK CHECKOUT docs.

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": "_blank",
"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.