Max SystemsMAXFIdeveloper hub
APICheckout sessions

Create a checkout session

Creates a session on the MAXFI payment page. Redirect the customer to checkout_url: they choose a payment method and pay on maxfi-api.exezine.az/checkout/<id>, so card details never pass through your servers. MAXFI runs bank verification (3-D Secure) when the bank requires it and reports the result with webhooks.

The page is available in English, Russian and Azerbaijani. It shows the payment methods enabled for your account; settings.payment_methods narrows the list for one session.

POST/v2/payments/checkout
Authentication: sk_live_ / sk_test_. Secret API key. Use it only on your server.

Request body

FieldTypeDescription
amount (required)integerAmount in minor units, a positive integer: 4900 = 49.00.
currency (required)string(3)AZN, USD, EUR or RUB. The currency must be enabled for the channel of the payment; otherwise the API returns 400 CURRENCY_NOT_ALLOWED.
descriptionstring(500)Shown to the customer on the payment page.
order_idstring(128)Your order number. Returned as order_number in webhook events and in GET /v2/payments/checkout/{id}. If omitted, MAXFI generates one.
languagestringLanguage of the page: en, ru or az. If you pass it, the page opens in this language; the customer can still switch it on the page. If you omit it, the page uses the language of the customer’s browser, and otherwise the default language set in merchant portal → Form Builder. Languages switched off there are not used.
initial_methodstringPayment method whose tab the page opens first: card, sbp, sberpay, tpay, yoomoney, recurrent, apple_pay or google_pay. If this method is not available for the payment — recurrent never is: a saved card is charged only with POST /v2/payments — the page opens the first method in the list.
customerobjectemail — the customer’s email. It is stored with the session and sent as customer_email in webhook events. ip — the customer’s IP address (IPv4 or IPv6) for risk checks; without it the payment page uses the address of the customer’s browser. An invalid address is ignored.
success_urlstring (url)The success screen of the payment page links to this address. Opening the page of a paid session redirects here.
cancel_urlstring (url)Return address after an unsuccessful payment, for payment steps that take the customer away from the MAXFI page (for example, a bank or wallet page).
webhook_urlstring (url)Sends this session’s payment.requires_action, payment.succeeded and payment.failed events to this address instead of your account’s webhook URL; payment.refunded and payment.expired still go to the account URL. Events are signed with your account’s webhook secret, if one is set. Deliveries go only to public HTTPS addresses.
metadataobjectYour key–value pairs; values must be strings. Returned in data.metadata of payment status webhook events. Keys merchant_id and channel_id are reserved: MAXFI removes them and sets channel_id itself.
channel_idstring(64)Channel for this payment: its code, ch_… ID or UUID. Omit it to use the default channel or the channel of a channel-bound key. See Channels.
settingsobjectpayment_methods — an array of method codes (the same values as initial_method): the session offers only these methods, and a payment by another method is refused. If none of them is available for this payment — for example, only SBP for a payment that is not in RUB, or only recurrent, which the payment page does not offer — the API returns 400 PAYMENT_METHODS_UNAVAILABLE. settings.success_url and settings.cancel_url are still read for older integrations; the top-level fields take precedence. Other settings fields (button_text, auto_return, customer_fields) are not supported and return 400 UNSUPPORTED_PARAMETER.
test_modebooleanNot needed: the key sets the mode (sk_test_ or sk_live_). A value that matches the key changes nothing; a value that contradicts it returns 400 TEST_MODE_MISMATCH.

Headers

HeaderDescription
Authorization*Bearer sk_live_… or Bearer sk_test_…. Alternative: X-API-Key: sk_…. Send one of the two.
Content-Typeapplication/json
Idempotency-KeyA key you choose, up to 255 characters, that makes retries safe (see below).

Send an Idempotency-Key header so that a retry after a timeout does not create a second session. A repeat with the same key and the same body within 24 hours returns the stored response — the same session — with the idempotent-replay: true header. The same key with a different body returns 409 IDEMPOTENCY_KEY_REUSED; a repeat while the first request is still running returns 409 IDEMPOTENCY_IN_PROGRESS. Errors are not stored, so a request that failed can be repeated with the same key. Use a new key for every new session: a session expires after 30 minutes, but its stored response is returned for 24 hours.

Response

FieldTypeDescription
idstringSession ID (cs_…). Use it with GET /v2/payments/checkout/{id}; payments made on the page use it as their ID in webhooks and refunds.
checkout_urlstringPayment page address. Redirect the customer here.
expires_atdatetime30 minutes after creation. After that the session cannot be opened or paid, and GET /v2/payments/checkout/{id} returns 404.
amountintegerEchoed from the request.
currencystringEchoed from the request.
statusstringopen for a new session.
livemodebooleantrue for a live key, false for a test key.

With a test key (sk_test_) the session opens the same MAXFI payment page, but no money moves: pay with the test cards; steps that a bank or wallet would show open a MAXFI test page where you choose the result. Responses and webhook events carry "livemode": false.

Errors

HTTPCodeReason
400VALIDATION_ERRORThe body does not match the schema: amount, currency, URL format, field length, or an unknown method code in initial_method or settings.payment_methods.
400BAD_REQUESTThe channel in channel_id was not found, or it is paused, deleted or inactive.
400CURRENCY_NOT_ALLOWEDThe currency is not enabled for the channel of the payment. The channel’s currencies are set in the merchant portal, on the Channels page.
400TEST_MODE_MISMATCHtest_mode contradicts the mode of the key.
400UNSUPPORTED_PARAMETERThe request has settings.button_text, settings.auto_return or settings.customer_fields.
400PAYMENT_METHODS_UNAVAILABLENone of the methods in settings.payment_methods is available for this payment.
401UNAUTHORIZEDMissing or invalid API key.
403FORBIDDENA live key before live mode is enabled, a channel-bound key with another channel’s channel_id, or a restricted key without payments:write.
409LIVE_PAYMENTS_NOT_CONFIGUREDA live key, but live payments are not set up for your account yet. Contact MAXFI.
409IDEMPOTENCY_KEY_REUSEDThe Idempotency-Key was already used with a different request.
409IDEMPOTENCY_IN_PROGRESSA request with the same Idempotency-Key is still being processed. Retry later.
429RATE_LIMIT_EXCEEDEDMore than 100 requests in 60 seconds from your IP address.
500INTERNAL_ERRORUnexpected error. Retry later and quote request_id to support.
POST /v2/payments/checkout · MAXFI Developer Hub