# Payler API Specifications

## Payment flow <a href="#openapispecification-facade-introduction" id="openapispecification-facade-introduction"></a>

Payment is a transfer from a client to a merchant account. There are two schemes for the integration with Payler API:&#x20;

* The [Payment Gate scheme](#payment-gate-scheme) (**GAPI**): a client enters their payment data on the Payler Gateway page. Follows **H2C** (host-to-client) flow.
* The [Payment Merchant scheme](#payment-merchant-scheme) (**MAPI**): a client enters their payment data on the merchant page.\
  Follows **H2H** (host-to-host) flow.

### Payment Gate scheme

In the **Payment** **Gate** (**GAPI**) scheme, a client enters their payment details on the Payler Gateway page.

{% hint style="info" %}
In the **Payment Gate** scheme, all 3D Secure interactions occur on the Payler side, without merchant involvement.
{% endhint %}

\
The payment process is:

1. Merchant initiates a payment session by calling [`Start Payment Session`](#openapispecification-facade-startpaymentsession).
2. The merchant redirects a user to the payment page using the address from the [`Start Payment Session`](#openapispecification-facade-startpaymentsession) response.
3. The user selects a payment method and provides the payment details. For [3D Secure](#payment-3-d-secure) authentication, if necessary, the payment gateway redirects the user to the issuing bank's page to enter a confirmation code.
4. Once the payment is completed, the user is redirected to the address the merchant specified while creating the session in Step 1.
5. Once the user returns, the merchant calls [`Get Status`](#openapispecification-facade-getstatus) to check the order's status.
6. Optionally, merchants can set `session.notificationUrl` in [Start Payment Session](#openapispecification-facade-startpaymentsession) to get automated status updates via POST requests for key payment events such as authorization, cancellation, or refund, eliminating the need for manual status checks.

<div data-full-width="true"><figure><img src="https://2451738236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwv5zUAmwbZ5Cg8D3fNoB%2Fuploads%2F2QBqf4d7K2p2CG4A2OqE%2Fimage.png?alt=media&#x26;token=7354057b-8448-4e73-b53d-87301d6653ea" alt=""><figcaption><p>Gate scheme payment process</p></figcaption></figure></div>

### Payment Merchant scheme

In the **Payment Merchant** (MAPI) scheme, a client enters their payment details on the merchant's page.

{% hint style="info" %}
Compliance with the PCI DSS standard is mandatory when providing bank card information in the **Payment Merchant** scheme.
{% endhint %}

The payment process can be carried out according to one of the following scenarios:

#### Single-phase payment with optional status re-check

<figure><img src="https://2451738236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwv5zUAmwbZ5Cg8D3fNoB%2Fuploads%2FanqWaU4piE2HBLZSM4MZ%2Fmapi-1.svg?alt=media&#x26;token=63ab4af2-a390-4824-a285-9635e95cb5ef" alt=""><figcaption></figcaption></figure>

#### Single-phase payment with redirect and optional status re-check

<figure><img src="https://2451738236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwv5zUAmwbZ5Cg8D3fNoB%2Fuploads%2FBh9W9LnvyCDCG5cbfOS2%2Fmapi-2.svg?alt=media&#x26;token=d833363e-f988-4d35-9584-12456df6f488" alt=""><figcaption></figcaption></figure>

#### Single-phase payment with a request for a confirmation code

<figure><img src="https://2451738236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwv5zUAmwbZ5Cg8D3fNoB%2Fuploads%2F3vpYcMcXBnxv1ukn9TSj%2Fmapi-3.svg?alt=media&#x26;token=8ac2f7f6-e524-40fb-82cb-1e575da6b60a" alt=""><figcaption></figcaption></figure>

#### Single-phase payment with a request for payment based on the details provided

<figure><img src="https://2451738236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwv5zUAmwbZ5Cg8D3fNoB%2Fuploads%2FKbgWE6nn7APOujnhxm8e%2Fmapi-4.svg?alt=media&#x26;token=9ff9e354-b047-4656-b67a-9ecb14b87eb9" alt=""><figcaption></figcaption></figure>

#### Two-phase payment with adjustment of blocked funds amount and fund withdrawal confirmation

<figure><img src="https://2451738236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwv5zUAmwbZ5Cg8D3fNoB%2Fuploads%2Fvy5npxQU5lGztkWvOn7l%2Fmapi-5.svg?alt=media&#x26;token=3ed38295-0a4d-4426-a692-8a22460a1067" alt=""><figcaption></figcaption></figure>

#### Payment refund

<figure><img src="https://2451738236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwv5zUAmwbZ5Cg8D3fNoB%2Fuploads%2FAuJrC9sUz4dCt82xurHR%2Fmapi-6.svg?alt=media&#x26;token=d8a1ecac-0a0b-4f36-a020-786c320bef94" alt=""><figcaption></figcaption></figure>

#### Payment 3-D Secure

When a request to make a payment or save a card is received, Payler checks whether the card is enrolled in 3-D Secure and determines the supported protocol version. If authentication with the 3DS 2.0 protocol is not possible, 3DS 1.0 is used.

## Payout flow

Payout is a transfer from a merchant to a client account. There are two schemes for the integration with Payler API:&#x20;

* The [Payout Gate scheme](#payout-gate-scheme): a client enters their data on the Payler Gateway page.
* The [Payout Merchant](#payout-merchant-scheme): a client enters their data on the merchant page.

### Payout Gate scheme

In the **Payout** **Gate** (**GAPI**) scheme, a client enters their data on the Payler Gateway page.

The payout process is:

1. Merchant initiates a payout session by calling [`Start Payout Session`](#start-payout-session).
2. The merchant redirects a user to the payout page using the address from the [`Start Payout Session`](#start-payout-session)response.
3. The user selects a payout method and, if needed, enters their details. If necessary, the payout gateway redirects the user to the payout provider to enter their details.
4. After completing the payout, the user is redirected to a predefined address on the merchant website/app.
5. Once the user returns, the merchant calls [`Get Payout Status`](#get-payout-status) to check the order's status.
6. Optionally, merchants can set `session.notificationUrl` in [`Start Payout Session`](#start-payout-session)  to get automated status updates via POST requests for key payout events such as authorization, eliminating the need for manual status checks.

### Payout Merchant scheme

In the **Payment Merchant** (MAPI) scheme, a client enters their data on the merchant's page.

{% hint style="info" %}
Compliance with the PCI DSS standard is mandatory when providing bank card information in the **Payment Merchant** scheme.
{% endhint %}

The payout process is:

1. Merchant lets the user choose a payout method and gets the details from the user.
2. The merchant passes the details to [`Create Payout`](#create-payout).
3. The merchant can retrieve the payout status by calling [`Get Payout Status`](#get-payout-status-1).
4. Optionally, merchants can set `session.notificationUrl` in [`Create Payout`](#create-payout)  to get automated status updates via POST requests for key payout events such as authorization, eliminating the need for manual status checks.

<figure><img src="https://2451738236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwv5zUAmwbZ5Cg8D3fNoB%2Fuploads%2F5yYQmr2vthxsOAKS3gj0%2Fmapi-payout.svg?alt=media&#x26;token=031264b8-2553-439c-92bb-550458abd00c" alt=""><figcaption><p>Payout merchant scheme</p></figcaption></figure>

## General <a href="#openapispecification-facade-general" id="openapispecification-facade-general"></a>

This section covers the range of currencies and payment/payout methods a merchant can use, as specified in their contract. It also details the various operation statuses and the use of API callbacks for confirming payout success or failure.

### Supported currencies <a href="#openapispecification-facade-currenciesdirectory" id="openapispecification-facade-currenciesdirectory"></a>

These currencies are supported by Payler's various [payment ](#openapispecification-facade-paymentmethods)and [payout](#payout-methods) methods:

{% hint style="info" %}
The currencies supported by the merchant are specified in their contract. Customers can only make payments in the currencies specified in the merchant's agreement/contract.&#x20;
{% endhint %}

<table><thead><tr><th width="241">Currency code</th><th>Currency name</th><th>Payments or Payouts?</th></tr></thead><tbody><tr><td>AED </td><td>United Arab Emirates dirham</td><td>Both</td></tr><tr><td>ARS</td><td>Argentine Peso</td><td>Both</td></tr><tr><td>AUD</td><td>Australian dollar</td><td>Both</td></tr><tr><td>AZN</td><td>Azerbaijani manat</td><td>Both</td></tr><tr><td>BRL</td><td>Brazilian real</td><td>Both</td></tr><tr><td>CAD</td><td>Canadian dollar</td><td>Both</td></tr><tr><td>CNY</td><td>Chinese yuan</td><td>Both</td></tr><tr><td>EUR</td><td>Euro</td><td>Both</td></tr><tr><td>EGP</td><td>Egyptian Pound</td><td>Both</td></tr><tr><td>GBP</td><td>Sterling</td><td>Both</td></tr><tr><td>IDR</td><td>Indonesian rupiah</td><td>Both</td></tr><tr><td>INR</td><td>Indian rupee</td><td>Both</td></tr><tr><td>KRW</td><td>South Korean won</td><td>Payments</td></tr><tr><td>MYR</td><td>Malaysian ringgit</td><td>Both</td></tr><tr><td>MAD</td><td>Moroccan Dirham</td><td>Both</td></tr><tr><td>NGN</td><td>Nigerian naira</td><td>Both</td></tr><tr><td>NZD</td><td>New Zealand dollar</td><td>Both</td></tr><tr><td>PKR</td><td>Pakistani rupee</td><td>Payments</td></tr><tr><td>PLN</td><td>Polish zloty</td><td>Payments</td></tr><tr><td>THB</td><td>Thai baht</td><td>Both</td></tr><tr><td>TRY</td><td>Turkish lira</td><td>Both</td></tr><tr><td>TWD</td><td>New Taiwan dollar</td><td>Payments</td></tr><tr><td>USD</td><td>United States dollar</td><td>Both</td></tr><tr><td>UZS</td><td>Uzbekistani som</td><td>Payments</td></tr><tr><td>VND</td><td>Vietnamese dong</td><td>Both</td></tr></tbody></table>

### Payment methods <a href="#openapispecification-facade-paymentmethods" id="openapispecification-facade-paymentmethods"></a>

The section provides an overview of all payment methods supported by Payler.

{% hint style="info" %}
The payment methods supported by the merchant are specified in their contract. Customers are limited to using the payment methods outlined in the merchant's contract.

Contact support if you haven't found the methods you're looking for in the list below.
{% endhint %}

<table><thead><tr><th width="154.33333333333331">Method</th><th width="387">Description</th><th>Currencies supported</th></tr></thead><tbody><tr><td>applepay</td><td><p>At checkout, a payer:</p><ol><li>Selects Apple Pay and is redirected to the payment page.</li><li>Chooses the payment method.</li><li>The payment is confirmed.</li></ol><p><strong>Note</strong>: a refund for this payment method requires assistance from the support team. Merchants seeking a refund must directly reach out to our support team with their request.</p></td><td>EUR</td></tr><tr><td>bancontact</td><td>For payments in Belgium.</td><td>EUR</td></tr><tr><td>bankdeposit</td><td>Depositing funds directly into a recipient's bank account.</td><td>NGN, IDR</td></tr><tr><td>banktransfer</td><td><ol><li>At checkout, a payer selects the <em>Bank Transfer</em> payment method.</li><li>Secure website with the recipient details (an account number) opens.</li><li>The payer makes a transfer using their banking app.</li><li>The payment is confirmed.</li></ol></td><td>KRW, TWD, MAD, AED, AUD</td></tr><tr><td>banktransfer (Brazil)</td><td>At checkout, a payer selects the <em>banktransfer</em> payment method, enters personal details, scans a QR code, and completes the transaction with their banking app.<br><br><strong>Note:</strong> a refund for this payment method requires assistance from the support team. Merchants seeking a refund must directly reach out to our support team with their request.</td><td>BRL</td></tr><tr><td>banktransferp2p</td><td><p>At checkout, a payer:</p><ol><li>Selects BankTransferP2P and is redirected to the BankTransferP2P website.</li><li>Chooses a bank.</li><li>Logs into the online banking to complete the transfer directly.</li></ol><p><strong>Note:</strong> a refund for this payment method requires assistance from the support team. Merchants seeking a refund must directly reach out to our support team with their request. Only one partial refund is allowed for each transaction.</p></td><td>TRY</td></tr><tr><td>blik</td><td><p>Payer provides and confirms a code in their banking app.</p><p>For payments in Poland.</p></td><td>PLN</td></tr><tr><td>boleto</td><td><p>At checkout, a payer selects the <em>boleto</em> payment method, enters personal details, scans a QR code, and completes the transaction with their banking app.</p><p></p><p><strong>Note:</strong> a refund for this payment method requires assistance from the support team. Merchants seeking a refund must directly reach out to our support team with their request.</p></td><td>BRL</td></tr><tr><td>cards</td><td>Payment is performed by entering card details linked to a debit or credit account.</td><td><a href="#openapispecification-facade-currenciesdirectory">All supported currencies</a></td></tr><tr><td>fastpayment</td><td>At checkout, a payer is redirected to their banking app, where they pay the invoice issued through the fast payment system.</td><td>*Check available currencies with your account manager</td></tr><tr><td>jazzcash</td><td><p>At checkout, a payer:</p><ol><li>Enters their mobile number in the payment form.</li><li>Receives a payment request in the <strong>Jazzcash</strong> mobile app.</li><li>Confirms the transaction by authorizing it with their PIN.</li></ol></td><td>PKR</td></tr><tr><td>ideal</td><td><ol><li>To process a payment, a payer either chooses a bank and scans the QR code or provides a personal identifier. </li><li>After the payment is completed, the payer returns to the merchant's site with the payment confirmation.</li><li>The merchant receives a payment notification via a callback. </li></ol><p>For payments in the Netherlands.</p></td><td>EUR</td></tr><tr><td>instapay</td><td>The payment is completed via Insta Pay system using the recipient's phone number or Insta Pay ID.</td><td>EGP</td></tr><tr><td>interac</td><td><p>At checkout, a payer:</p><ul><li>Receives payment instructions, including a deposit email, security question, and answer.</li><li>Logs into their online banking app and completes the transfer manually. </li><li>Once the payment is received, a webhook notifies that the order status is updated.</li></ul></td><td>CAD</td></tr><tr><td>khipu</td><td>Khipu is an electronic payment platform that enables secure and fast online transactions. It integrates with multiple banks, allowing users to pay directly from their bank accounts without needing a credit card. Khipu provides a reliable and secure solution for handling online payments.</td><td>ARS</td></tr><tr><td>lemoncash</td><td>Payment is processed via Lemon Cash app through a user-initiated transfer to a system-assigned account. Funds are processed and reflected in the user's balance shortly after.</td><td>ARS</td></tr><tr><td>mcommerce</td><td>Payment is performed via <a href="#openapispecification-facade-3dsecure">Payment Merchant scheme</a> by providing a phone number as a payment detail identifier. The transaction is confirmed using an authorization code sent to the client via SMS to the provided phone number</td><td>KZT</td></tr><tr><td>mercadopago</td><td>Payment is processed via Mercado Pago app through a user-initiated transfer to a system-assigned account. Funds are processed and reflected in the user's balance shortly after.</td><td>ARS</td></tr><tr><td>netbanking</td><td>Payment is performed online using bank-provided credentials, directly accessing and debiting the user's bank account.<br><br><strong>Note:</strong> multiple merchants can use the NetBanking payment method simultaneously by employing distinct credentials.</td><td>INR</td></tr><tr><td>openbanking</td><td>Payment is performed via an online banking interface, allowing direct bank-to-bank transactions under the user's control without sharing sensitive account details.<br><br><strong>Note:</strong> for this method, transaction limits depend on the currency.</td><td>EUR, GBP</td></tr><tr><td>orangecash</td><td>The payment is completed via Orange Cash system using the recipient's phone number.</td><td>EGP</td></tr><tr><td>p2p</td><td>Payment is carried out directly between individuals by transferring funds from one person's account to another's.</td><td>CNY</td></tr><tr><td>p2ppcr</td><td><p>At checkout, a payer:</p><ol><li>Selects the payment method (phone number, card, or IBAN).</li><li>Receives payment details.</li><li>Makes a transfer using their banking app.</li><li>Confirms the payment</li></ol></td><td>AZN, UZS, TRY</td></tr><tr><td>papara</td><td><p>At checkout, a payer:</p><ol><li>Selects Papara and is redirected to the Papara website.</li><li>Chooses a bank.</li><li>Logs into the online banking to complete the transfer directly.</li></ol><p><strong>Note:</strong> a refund for this payment method requires assistance from the support team. Merchants seeking a refund must directly reach out to our support team with their request. Only one partial refund is allowed for each transaction.</p></td><td>TRY</td></tr><tr><td>paybol</td><td><p>At checkout, a payer:</p><ol><li>Selects Paybol and is redirected to the Paybol website.</li><li>Chooses a bank.</li><li>Logs into the online banking to complete the transfer directly.</li></ol><p><strong>Note:</strong> a refund for this payment method requires assistance from the support team. Merchants seeking a refund must directly reach out to our support team with their request. Only one partial refund is allowed for each transaction.</p></td><td>TRY</td></tr><tr><td>payfix</td><td><p>At checkout, a payer:</p><ol><li>Selects Payfix and is redirected to the Payfix website.</li><li>Chooses a bank.</li><li>Logs into the online banking to complete the transfer directly.</li></ol><p><strong>Note:</strong> a refund for this payment method requires assistance from the support team. Merchants seeking a refund must directly reach out to our support team with their request. Only one partial refund is allowed for each transaction</p></td><td>TRY</td></tr><tr><td>payid</td><td>The payment is performed using an easy-to-remember identifier, like a phone number or email, linked to a bank account.</td><td>AUD</td></tr><tr><td>payster</td><td>The payment is performed using an easy-to-remember identifier, like a phone number or email, linked to a bank account. Bank code and account number are also available.</td><td>AUD, NZD</td></tr><tr><td>picpays</td><td><p>At checkout, a payer selects the <em>picpays</em> payment method, enters personal details, scans a QR code, and completes the transaction with their banking app.</p><p></p><p><strong>Note:</strong> a refund for this payment method requires assistance from the support team. Merchants seeking a refund must directly reach out to our support team with their request.</p></td><td>BRL</td></tr><tr><td>pix</td><td><p>At checkout, a payer selects the <em>pix</em> payment method, enters personal details, scans a QR code, and completes the transaction with their banking app.</p><p></p><p><strong>Note:</strong> a refund for this payment method requires assistance from the support team. Merchants seeking a refund must directly reach out to our support team with their request.</p></td><td>BRL</td></tr><tr><td>poli</td><td><p>At checkout, a payer:</p><ol><li>Selects POLi and is redirected to the POLi website.</li><li>Chooses a bank.</li><li>Logs into the online banking to complete the transfer directly.</li></ol></td><td>NZD</td></tr><tr><td>qrcode</td><td>Payment is made by scanning a QR code using a smartphone.</td><td>BRL, THB, VND, IDR, MYR</td></tr><tr><td>rapipago</td><td><p>Rapipago is a prepaid online payment method that allows users in Argentina to pay for online purchases and bills in cash at convenient locations.</p><p>When using Rapipago, users receive a bill with a barcode or payment code that they can enter or scan using the RapiPago app. Payments can be made online through the app or offline at one of over 6,000 Rapipago locations.</p></td><td>ARS</td></tr><tr><td>SCP</td><td><ol><li>At checkout, a payer selects the SCP (Supermarket Code Pay) payment method.</li><li>The payer selects a supermarket, e.g., IBON, Hi-Life, or FamiPort.</li><li>The payer receives an invoice for payment.</li><li>The payer pays from the invoice at the selected supermarket.</li></ol></td><td>TWD</td></tr><tr><td>sepa</td><td>For a payment in one of the SEPA countries, a payer makes a bank transfer to the account specified in the recipient details.</td><td>EUR</td></tr><tr><td>sepaqr</td><td>For a payment in one of the SEPA countries, a payer scans a displayed QR code and confirms the payment in their banking app.</td><td>EUR</td></tr><tr><td>unionpay</td><td><p>Payment is performed by either:</p><ul><li>entering UnionPay card number,</li><li>(if the UnionPay application is used) scanning a QR code.</li></ul></td><td>CNY</td></tr><tr><td>upi</td><td>Payment is performed through a mobile application by entering a unique UPI ID, allowing to process money transfers without revealing bank details.</td><td>INR</td></tr><tr><td>vodafonecash</td><td>The payment is completed via Vodafone Cash system using the recipient's phone number.</td><td>EGP</td></tr><tr><td>wallet</td><td>Payment is completed using a digital wallet.</td><td>CNY</td></tr><tr><td>zenpay</td><td>For payments in all countries of Europe, excluding the prohibited.</td><td>EUR</td></tr></tbody></table>

### Payout methods

The section provides an overview of all payout methods supported by Payler.

Contact support if you haven't found the methods you're looking for in the list below.

<table><thead><tr><th width="178">Method</th><th width="347">Description</th><th>Currencies supported</th></tr></thead><tbody><tr><td>banktransfer</td><td>Payout is performed by entering the customer’s bank account number with a bank code.</td><td>KRW, TWD, MAD, AUD, AED</td></tr><tr><td>cards</td><td>Payout is performed by entering card details linked to a debit or credit account.</td><td><a href="#openapispecification-facade-currenciesdirectory">All supported currencies</a></td></tr><tr><td>communitybank</td><td>Payout is made on a customer's bank account.</td><td>TRY</td></tr><tr><td>instapay</td><td>The payout is sent via Insta Pay using a phone number or Insta pay id.</td><td>EGP</td></tr><tr><td>interac</td><td><p>To initiate a payout, provide the recipient’s email and phone number along with the transfer amount. The recipient is notified via email:</p><ul><li>If <strong>Auto-Deposit</strong> is enabled, the funds are deposited automatically.</li><li>Otherwise, the recipient must manually accept the transfer through their online banking.</li></ul><p>Both the merchant and the recipient receive confirmation once the funds have been successfully added.</p></td><td>CAD</td></tr><tr><td>netbanking</td><td>Payout is performed online using bank-provided credentials, directly accessing and debiting the user's bank account.</td><td>INR</td></tr><tr><td>orangecash</td><td>The payout is sent via Orange Cash using a phone number.</td><td>EGP</td></tr><tr><td>payfix</td><td>Payout is made on a customer's PayFix wallet.</td><td>TRY</td></tr><tr><td>payster</td><td>Payout is performed by using an easy-to-remember identifier, like a phone number or email, linked to a bank account for transactions.</td><td>AUD, NZD</td></tr><tr><td>payid</td><td>Payout is performed by using an easy-to-remember identifier, like a phone number or email, linked to a bank account for transactions.</td><td>AUD</td></tr><tr><td>pcr</td><td>Payment is made on a customer's card or bank account.</td><td>AZN, TRY, UZS</td></tr><tr><td>sepainstant</td><td>For instant payouts on a customer's IBAN registered in the SEPA region.</td><td>EUR</td></tr><tr><td>vodafonecash</td><td>The payout is sent via Vodafone Cash using a phone number.</td><td>EGP</td></tr></tbody></table>

### Operation statuses <a href="#openapispecification-facade-operationstatuses" id="openapispecification-facade-operationstatuses"></a>

The section contains all possible payment and payout operation statuses and their brief descriptions for the Gate and Merchant schemes.

<table><thead><tr><th width="226">Status</th><th width="227">Description</th><th width="126">Payments or Payouts?</th><th>Is an API callback sent when a transaction gets this status?</th></tr></thead><tbody><tr><td><code>noPaymentsFound</code></td><td>The payment session is registered in the gateway, but processing hasn't started yet.</td><td>Payments</td><td></td></tr><tr><td><code>tryAnotherPayment</code></td><td>Internal status: the payment attempt within the session failed, yet another attempt with the same payment method is permissible.</td><td>Payments</td><td></td></tr><tr><td><code>ppTriesNumberIsExceeded</code></td><td>Internal status: all payment attempts with the payment method failed, but another attempt with another payment method is permissible.</td><td>Payments</td><td></td></tr><tr><td><code>rejected</code></td><td>All payment attempts within the payment session have failed, and no more attempts is permissible.</td><td>Both</td><td>+</td></tr><tr><td><code>expired</code></td><td>The time allowed to make the payment has expired.</td><td>Both</td><td>+</td></tr><tr><td><code>authorized</code></td><td>The payment/payout session has been successfully completed.</td><td>Both</td><td>+</td></tr><tr><td><code>preAuthorized</code></td><td>The first phase of a two-phase payment has been completed, the funds have been blocked.</td><td>Payments</td><td>+</td></tr><tr><td><code>refunded</code></td><td>The full refund of funds has been successfully processed.</td><td>Payments</td><td>+</td></tr><tr><td><code>cancelled</code></td><td>The funds previously blocked on the card have been fully released.</td><td>Payments</td><td>+</td></tr><tr><td><code>pending</code></td><td>Payment was initiated but hasn't been completed yet.</td><td>Payments</td><td></td></tr><tr><td><code>error</code></td><td>Unexpected error occurred. If the error keeps occuring, contact support.</td><td>Both</td><td>+</td></tr><tr><td><code>actionRequired</code></td><td><p>To continue the payment, a merchant must perform a certain action, for example:</p><ul><li>Redirect the client to the specified page for entering payment details or authenticating a card payment. </li><li>Invite the client to make a payment using  their banking app.</li><li>Send the transaction confirmation code received by the client. </li></ul><p>Description of the required action is provided in the <code>'action'</code> response object. </p></td><td>Payments</td><td>+</td></tr><tr><td><code>waitingForCustomerAction</code></td><td><p>The payout session is active, but there are either:</p><ul><li>no payout atempts, or</li><li>payout attempts are either rejected or led to an error, but there are other payout methods available for this session. </li></ul></td><td>Payouts</td><td></td></tr><tr><td><code>cancelledByCustomer</code></td><td>Customer declined the payment or payout attempt and returned to the merchant page.</td><td>Both</td><td>+</td></tr></tbody></table>

### API callbacks <a href="#openapispecification-facade-datatypes" id="openapispecification-facade-datatypes"></a>

API callbacks, also known as guaranteed notifications, are essential for informing merchants about the success or failure of payments and payouts in both Gate and Merchant schemes.

The API callbacks operate as follows:

1. When an order status changes, the gateway sends a `POST` request to a pre-defined URL. The request parameters include the `orderId`.
2. If a successful response code (`2xx`) is received, the notification processing is considered complete.\
   If an error occurs or the server isn't available, the attempt is retried every hour for the next 24 hours.

#### Status notification callback

API callbacks require the `session.notificationUrl` parameter set in:

* The [Start Payment Session](#openapispecification-facade-startpaymentsession) method for the [Payment Gate scheme](#payment-gate-scheme).
* The [Create Payment](#create-payment) method for the [Payment Merchant scheme](#payment-merchant-scheme).
* The [Start Payout Session](#start-payout-session) method for the [Payout Gate scheme](#payout-gate-scheme).
* The [Create Payout](#create-payout) method for the [Payout Merchant scheme](#payout-merchant-scheme).

When the `session.notificationUrl` parameter is set, the system will post the non-transitional payment statuses to the specified notification URL. You can find a list of possible statuses in the [Operation statuses](#openapispecification-facade-operationstatuses) section.

The system is waiting for a response with the HTTP 200 OK code. If no response arrives, the system retries sending the notification every hour for the next 24 hours, after which there will be no more attempts.

**Entry parameters:**

**Request URL:** The URL is provided in the `session.notificationUrl` parameter.

**Request method:** `POST`

**Request body parameters:**

<table><thead><tr><th width="152">Attribute</th><th width="139">Attribute type</th><th width="68">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td>string[100]</td><td>R</td><td>Session identifier.</td><td><code>9073926b929f31c2abc9fad77ae3e8eb</code></td></tr><tr><td><code>orderId</code></td><td>string[100]</td><td>R</td><td>Order identifier within the merchant system.</td><td><code>d1434908-7260-483e-8254-fa43af1b835d</code></td></tr><tr><td><code>state</code></td><td>string[100]</td><td>R</td><td><a href="#openapispecification-facade-operationstatuses">Payment/payout  state</a>.</td><td><code>authorized</code></td></tr><tr><td><code>method</code></td><td>string[100]</td><td>R</td><td><a href="#openapispecification-facade-paymentmethods">Payment</a> or <a href="#payout-methods">payout</a> method.</td><td><code>cards</code></td></tr><tr><td><code>amount</code></td><td>long</td><td>R</td><td>Amount  of the payment, taking into account all unblockings and refunds made. Presented in the payment currency using the smallest unit of that currency.<br><br><em><mark style="background-color:yellow;"><strong>Amount may change in a new callback after a successful or rejected payment. Relevant for methods: papara, paybol, payfix, havale, payid etc.</strong></mark></em><br><em><mark style="background-color:yellow;"><strong>Contact please our support team to update the list of methods.</strong></mark></em></td><td><p></p><p><br><code>10051</code> (for an amounting to 100 dollars and 51 cents in USD)</p></td></tr><tr><td><code>updated</code></td><td>string[100] (<a href="https://www.iso.org/iso-8601-date-and-time-format.html">ISO 8601</a>)</td><td>R</td><td>Date and time when the status was set.</td><td><code>2022-02-12T11:22:33.145Z</code></td></tr><tr><td>action.type</td><td>string</td><td>O</td><td><p>The type of additional action expected from the merchant to continue the payment process. Filled if the status is '<code>actionRequired</code>'.<br>Possible values are:</p><ul><li><code>'confirmPayment'</code> - the merchant must offer the user to make a payment using the details specified in the <code>'action.details'</code> parameter and, after payment, call the <a href="#confirm-payment">Confirm Payment</a>  method.</li></ul></td><td></td></tr><tr><td>action.details</td><td>object</td><td>O</td><td>Payment details to make payment in case '<code>confirmPayment'</code> type.</td><td></td></tr><tr><td><code>token</code></td><td>string[100]</td><td>R</td><td>Message signature.</td><td><code>37ca0f78f59bfd62d5d349e9666d05a405c1a6813f6fee9b666fd3e9142f2432</code></td></tr></tbody></table>

**Request examples (for both Payments and Payouts):**

<pre class="language-json"><code class="lang-json"><strong>{
</strong>  "sessionId": "9073926b929f31c2abc9fad77ae3e8eb",
  "orderId": "d1434908-7260-483e-8254-fa43af1b835d",
  "state": "actionRequired",
  "method": "payid",
  "amount": "100000",
  "updated": "2022-02-12T11:22:33.145Z",
  "action": {
    "type": "сonfirmPayment",
    "details": {
      "accountName": "TRKS TECHNOLOGY PTY LTD",
      "accountNumber": "987654321",
      "bsbNumber": "370370",
      "paymentDescription": "11223344"
    }
  },
  "token": "4e18d7564f6ecaaff5e2cb3d4a1be4a6a18e2094758e12853afc42e5a0a97be5"
}
</code></pre>

**Generating and checking message token:**

To generate a unique signature for each message using SHA-256 encryption:

1. In the payload block, transform all complex objects into simple top-level parameters: each final element object becomes a parameter of the payload object, the name of the new parameters receives a concatenation of the names of the object parameters on the path to each elementary element:

```json
{ 
	"sessionId": "9073926b929f31c2abc9fad77ae3e8eb", 
	"orderId": "d1434908-7260-483e-8254-fa43af1b835d", 
	"state": "actionRequired", 
	"method": "payid", 
	"amount": "100000", 
	"updated": "2022-02-12T11:22:33.145Z", 
	"action.type": "сonfirmPayment", 
	"action.details.accountName": "TRKS TECHNOLOGY PTY LTD",
	"action.details.accountNumber": "987654321", 
	"action.details.bsbNumber": "370370", 
	"action.details.paymentDescription": "11223344", 
	"token": "4e18d7564f6ecaaff5e2cb3d4a1be4a6a18e2094758e12853afc42e5a0a97be5" 
} 
```

2. Gather all message parameters as key-value pairs, except the “token” parameter, in the following format:

```json
[
    {"sessionId":"9073926b929f31c2abc9fad77ae3e8eb"},
    {"orderId":"d1434908-7260-483e-8254-fa43af1b835d"},
    {"state":"authorized"},
    {"method":"cards"},
    {"amount": "100000"},
    {"updated":"2022-02-12T11:22:33.145Z"}, 
    {"action.type": "сonfirmPayment"}, 
    {"action.details.accountName":"TRKS TECHNOLOGY PTY LTD"},
    {"action.details.accountNumber":"987654321"},
    {"action.details.bsbNumber":"370370"},
    {"action.details.paymentDescription": "11223344"}
]
```

3. Add a pair with “*password*” as the key and the merchant terminal password as the value of the object to the above mentioned array in the previous step:

* `{"password":"PWD123456"}`

4. Sort the array by the keys. The sorted array should be similar to the one below:

<pre class="language-json"><code class="lang-json"><strong>[
</strong><strong>    {"action.details.accountName": "TRKS TECHNOLOGY PTY LTD"},
</strong>    {"action.details.accountNumber": "987654321"}, 
    {"action.details.bsbNumber": "370370"}, 
    {"action.details.paymentDescription": "11223344"}, 
    {"action.type": "сonfirmPayment"}, 
    {"amount": "100000"},
    {"method": "cards"}, 
    {"orderId": "d1434908-7260-483e-8254-fa43af1b835d"}, 
    {"password": "PWD123456"},
    {"sessionId": "9073926b929f31c2abc9fad77ae3e8eb"}, 
    {"state": "authorized"}, 
    {"updated": "2022-02-12T11:22:33.145Z"}
]
</code></pre>

5. Concatenate the values into a single string:

`"TRKS TECHNOLOGY PTY LTD98765432137037011223344сonfirmPayment100000cardsd1434908-7260-483e-8254-fa43af1b835dPWD1234569073926b929f31c2abc9fad77ae3e8ebauthorized2022-02-12T11:22:33.145Z"`

6. Calculate the signature as SHA-256 of the concatenated string using UTF-8 encoding. In our example, the final signature is:

`281073fefe06561170cdbe819e97205134396b113dbe7faa3c0e65c3c9ce014f`

### Data types <a href="#openapispecification-facade-datatypes" id="openapispecification-facade-datatypes"></a>

Payler API uses these data types:

* string
* array
* object
* bool
* enum
* int
* long

## GAPI Payment methods <a href="#openapispecification-facade-api-methods" id="openapispecification-facade-api-methods"></a>

This section provides an overview of the main API methods used in the [**Payment Gate scheme**](#payment-gate-scheme) (**GAPI**). It includes detailed instructions for initiating a payment session, checking the payment status, and processing refunds.

### Start Payment Session <a href="#openapispecification-facade-startpaymentsession" id="openapispecification-facade-startpaymentsession"></a>

Use this method to initiate a new payment session. The request's header must include the merchant's unique terminal key and password. It ensures the session is securely linked to the merchant's account.

Once the session starts, it uses the settings set by a merchant to manage the payment process. If the request is successful, the API returns a link to the payment page that the merchant can share with customers. This link leads customers to the Payler secure payment page, where they can complete the transaction safely.

There are no restrictions on sharing the payment page link, so it can be freely distributed to simplify the payment process.

**Entry parameters:**

**Request URL:** `https://facade-api.main.gate-api.com/gapi/v1/sessions`

**Request method:** `POST`

**Request headers:**

<table><thead><tr><th width="242">Header</th><th width="59">R/O</th><th width="116">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>Original media type of the resource.</td></tr><tr><td><code>SessionTerminalKey</code></td><td>R</td><td> </td><td>Merchant terminal identifier.</td></tr><tr><td><code>SessionTerminalPassword</code></td><td>R</td><td> </td><td>Merchant terminal password.</td></tr></tbody></table>

**Request body parameters:**

<table><thead><tr><th width="277">Attribute</th><th width="115">Type</th><th width="60">R/O</th><th>Description</th></tr></thead><tbody><tr><td><code>session.lifetime</code></td><td>int</td><td>O</td><td>Session lifetime in minutes. You can set it to 20 minutes or more. The default is 20 minutes.</td></tr><tr><td><code>session.returnURLs.default.url</code></td><td>string[1000]</td><td>R</td><td>The URL to redirect a user if a transaction does <strong>not</strong> achieve its final status.</td></tr><tr><td><code>session.returnURLs.success.url</code></td><td>string[1000]</td><td>O</td><td>The URL to redirect a user if a payment is successful. If this URL is not provided, the <code>session.returnURLs.default.url</code> is used.</td></tr><tr><td><code>session.returnURLs.failure.url</code></td><td>string[1000]</td><td>O</td><td>The URL to redirect a user if the payment is <strong>not</strong> successful. If this URL is not provided, the <code>session.returnURLs.default.url</code> is used.</td></tr><tr><td><code>session.notificationUrl</code></td><td>string[1000]</td><td>O</td><td>The URL for receiving notifications (<a href="#openapispecification-facade-datatypes">callbacks</a>) about payment statuses. If this URL is not provided, callbacks are <strong>not</strong> sent.</td></tr><tr><td><code>session.payment.antifraud</code></td><td>object</td><td>O</td><td><p>Additional parameters for the antifraud system. A maximum of 70 elements is allowed. Both keys and values should be strings, limited to 100 Latin characters each. Keys must follow the pattern <code>“antifraud_*”</code>.<br><br><strong>Example:</strong><br> <code>{</code></p><p><code>“antifraud_1”: “some_value1”,</code></p><p><code>“antifraud_2”: “some_value2”</code></p><p><code>}</code></p></td></tr><tr><td><code>session.payment.type</code></td><td>string enum</td><td>R</td><td><p>The possible payment types are:</p><ul><li><code>regular:</code> a standard payment.</li><li><code>tokenized:</code> a recurring payment that uses a token from a saved card.</li></ul><p>If the type is not specified, the default value is <code>regular</code>.</p></td></tr><tr><td><code>session.payment.createPaymentToken</code></td><td>bool</td><td>O</td><td><p>The parameter states if there is a need to create a token for recurring payments:</p><ul><li><code>true:</code> creates a token for future payments.</li><li><code>false:</code> does <strong>not</strong> create a token.</li></ul><p>If this parameter is not specified, or if the request is for creating a payment with an existing token, the default value is <code>false</code>.</p></td></tr><tr><td><code>session.payment.page.lang</code></td><td>string[2]</td><td>O</td><td>The language is always <code>en</code> (English).</td></tr><tr><td><code>session.order.id</code></td><td>string[100]</td><td>R</td><td><p>A unique order ID within the merchant system. Each payment session (intent) requires this ID. </p><p>Only printable ASCII characters are permitted.</p></td></tr><tr><td><code>session.order.currency</code></td><td>string[3]</td><td>R</td><td>Payment <a href="#openapispecification-facade-currenciesdirectory">currency</a> in the ISO 4217 format.<br><br><strong>Example:</strong> <code>USD</code></td></tr><tr><td><code>session.order.amount</code></td><td>int</td><td>R</td><td>Order amount in the smallest unit of the currency. For example, if the payment is in EUR, the amount of <em>10050</em> means 100 EUR and 50 cents.</td></tr><tr><td><code>session.order.description</code></td><td>string[250]</td><td>O</td><td>Order description.</td></tr><tr><td><code>session.order.itemsType</code></td><td>string</td><td>O</td><td>Specific product, service, or item that is the subject of an order.</td></tr><tr><td><code>session.order.customer.id</code></td><td>string[100]</td><td>O<strong>*</strong></td><td>Customer’s identifier.<br><strong>*</strong>Required for <em>payid</em> payment method</td></tr><tr><td><code>session.order.customer.email</code></td><td>string<br>[100]*</td><td>R</td><td><p>Customer's email address.</p><p><strong>*</strong>For <em>banktransfer</em> method, the max length is 45.</p></td></tr><tr><td><code>session.order.customer.personsData</code></td><td>object</td><td>R</td><td><p>Customer's personal data. </p><p><em><mark style="background-color:yellow;"><strong>If customer's data (including email) is not real, payments will be rejected by antifraud system</strong></mark></em> </p></td></tr><tr><td><code>session.order.customer.personsData.phoneNumber</code></td><td>string<br>[100]*</td><td>R</td><td><p>Customer's phone number must adhere to the <a href="https://www.itu.int/rec/T-REC-E.123/en">ITU-T E.123</a> and <a href="https://www.itu.int/rec/T-REC-E.164/en">ITU-T E.164</a> standards.</p><p><strong>*</strong>For the <em>banktransfer</em> method, the max length is 15. </p><p>For the <em>applepay</em> method, the phone number must contain numbers only, and its length must be between 8 and 15 symbols.</p></td></tr><tr><td><code>session.order.customer.personsData.firstName</code></td><td>string<br>[100]*</td><td>O<strong>*</strong></td><td><p>Customer's first name.</p><p><strong>*</strong>For the <em>banktransfer</em> method, the max length is 45. </p><p>For the <em>upi</em> method, the max length is 40. </p><p>For the  <code>openbanking</code>, the max length is 25.<br><strong>*</strong>Required for these payment methods:<br><code>payid</code><br><code>openbanking</code></p><p><code>applepay</code></p></td></tr><tr><td><code>session.order.customer.personsData.lastName</code></td><td>string<br>[100]*</td><td>O<strong>*</strong></td><td><p>Customer's last name.</p><p><strong>*</strong>For the <em>banktransfer</em> method, the max length is 45. For the <em>upi</em> method, the max length is 40. <br>For the <code>openbanking</code>, the max length is 25.<br><strong>*</strong>Required for these payment methods:<br><code>payid</code><br><code>openbanking</code></p><p><code>applepay</code></p></td></tr><tr><td><code>session.order.customer.personsData.country</code></td><td>string[2]</td><td>O<strong>*</strong></td><td><p>Customer's country of residence in the ISO <a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">3166-1 alpha-2</a> format.<br><br><strong>Example:</strong> <code>GB</code><br></p><p><strong>*</strong>Required for these payment methods:</p><p><code>applepay,</code><br><code>netbanking,</code><br><code>bankdeposit,</code><br><code>qrcode,</code><br><code>wallet,</code><br><code>p2p,</code><br><code>openbanking,</code><br><code>rapipago,</code><br><code>khipu,</code><br><code>banktransfer,</code><br><code>sepa,</code><br><code>sepaqr</code></p><p>The parameter is also required for certain <em>card-method</em> transactions. Contact support for more details.</p></td></tr><tr><td><code>session.order.customer.personsData.state</code></td><td>string[100]</td><td>O<strong>*</strong></td><td><p>Customer's state code.<br></p><p><strong>*</strong>Required for these payment methods:<br><code>netbanking,</code><br><code>bankdeposit,</code><br><code>qrcode,</code><br><code>wallet,</code><br><code>p2p</code></p><p>The parameter is also required for certain <em>card-method</em> transactions. Contact support for more details</p></td></tr><tr><td><code>session.order.customer.personsData.city</code></td><td>string<br>[100]**</td><td>O<strong>*</strong></td><td><p>Customer's city.<br></p><p><strong>*</strong>Required for these payment methods:<br><code>netbanking,</code><br><code>bankdeposit,</code><br><code>qrcode,</code><br><code>wallet,</code><br><code>p2p,</code><br><code>banktransfer</code></p><p>The parameter is also required for certain <em>card-method</em> transactions. Contact support for more details.<br><strong>**</strong>For the <em>banktransfer</em> method, the max length is 45</p></td></tr><tr><td><code>session.order.customer.personsData.zip</code></td><td>string<br>[100]**</td><td>O<strong>*</strong></td><td><p>Customer's zip code.<br></p><p><strong>*</strong>Required for these payment methods:<br><code>netbanking,</code><br><code>bankdeposit,</code><br><code>qrcode,</code><br><code>wallet,</code><br><code>p2p,</code><br><code>banktransfer</code></p><p>The parameter is also required for certain <em>card-method</em> transactions. Contact support for more details.<br><strong>**</strong>For the <em>banktransfer</em> method, the max length is 45.</p></td></tr><tr><td><code>session.order.customer.personsData.address</code></td><td>string<br>[100]**</td><td>O<strong>*</strong></td><td><p>Customer's address.<br></p><p><strong>*</strong>Required for these payment methods:<br><code>netbanking,</code><br><code>bankdeposit,</code><br><code>qrcode,</code><br><code>wallet,</code><br><code>p2p,</code><br><code>banktransfer</code></p><p>The parameter is also required for certain <em>card-method</em> transactions. Contact support for more details.<br><strong>**</strong>For the <em>banktransfer</em> method, the max length is 45.</p></td></tr><tr><td><code>session.order.additionalFields.custom</code></td><td>array</td><td>O</td><td>Fields are defined by a merchant in a free form to describe specific properties of the order.</td></tr><tr><td><code>session.order.additionalFields.custom[x].key</code></td><td>string</td><td>O</td><td>Identifier of a custom field.</td></tr><tr><td><code>session.order.additionalFields.custom[x].description</code></td><td>string</td><td>O</td><td>Content within a custom field.</td></tr></tbody></table>

**Request example:**

<pre class="language-json"><code class="lang-json"><strong>{
</strong>  "session": {
    "lifetime": 15,
    "returnURLs": {
    "default": {
        "url": "https://some.address.com/success"
      },
     "success": {
        "url": "https://some.address.com/success"
      },
      "failure": {
        "url": "https://some.address.com/failed"
      }
    },
    "notificationUrl": "https://some.address.com/notify",
    "payment": {
      "type": "regular",
      "antifraud": {
        "key": "value"
      },
      "page": {
        "lang": "en"
      },
      "createPaymentToken": false
    },
    "order": {
      "id": "9073926b929f31c2abc9fad77ae3e8eb",
      "currency": "EUR",
      "amount": 10000,
      "description": "test description",
      "itemsType": "product",
      "customer": {
        "id": "100331",
        "email": "johndoe@test.com",
        "personsData": {
          "phoneNumber": "00555555",
          "firstName": "John",
          "lastName": "Doe",
          "country": "ES",
          "state": "Madrid",
          "city": "Madrid",
          "zip": "28001",
          "address": "Test Address"
          }
      },
      "additionalFields": {
        "custom": [
          {
            "key": "value",
            "description": "value"
          },
          {
            "key": "value",
            "description": "value"
          }
        ]
      }
    }
  }
}
</code></pre>

**Response attributes:**

<table><thead><tr><th width="232">Attribute</th><th width="125">Type</th><th width="59">R/O</th><th width="186">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>session.id</code></td><td>string[100]</td><td>R</td><td>Payment session ID.</td><td> 9073926b929f31c2abc9fad77ae3e8eb</td></tr><tr><td><code>session.order.id</code></td><td>string[100]</td><td>R</td><td>Unique order ID in the merchant system.</td><td> </td></tr><tr><td><code>session.order.amount</code></td><td>int</td><td>R</td><td>The total amount of the order expressed in the smallest unit of its currency.</td><td>10051</td></tr><tr><td><code>session.payment.page.url</code></td><td>string[1000]</td><td>O</td><td>A URL linking to the payment page for the current session, intended to be shared with the customer (end-user).<br><br><strong>Note</strong> that a URL is not generated for a recurring payment session using a payment token (if <code>session.paymentType</code> = <code>tokenized</code>).</td><td> </td></tr></tbody></table>

**Success response example:**

```json
{
  "session": {
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "order": {
      "id": "e79c24b3-857e-4cd1-91a3-654d3baee8710",
      "amount": 10000
    },
    "payment": {
      "page": {
        "url": "https://url.com/payment-page/:sessionID"
      }
    }
  }
}

```

**Recurring payment success response example:**

```json
{
  "session": {
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "order": {
      "id": "e79c24b3-857e-4cd1-91a3-654d3baee8710",
      "amount": 10000
    }
  }
}
```

**Error response example:**

```json
{
  "session": {
    "id": null,
    "error": {
      "type": "validationError",
      "title": "Your request parameters didn't validate.",
      "invalid-params": [
        {
          "name": "session.someKey",
          "reason": "valueHasExtraLength"
        },
        {
          "name": "session.someKey2",
          "reason": "valueIsNotPermitted"
        }
      ]
    }
  }
}
```

### Recurring Payments

In this section, you can find the instruction for creating a recurring payment.&#x20;

The [Gate scheme](#payment-gate-scheme) supports recurring payments using payment tokens.

#### **Create a payment token**

1. **Initiate a Payment Session:** Start by [creating a payment session](#openapispecification-facade-startpaymentsession) with the`regular` session type and the `createPaymentToken` parameter set to `true`.
2. **Payment Processing:** After processing the payment on the payment page, a payment token is generated.
3. **Token Retrieval:** This token is returned in the [status response](#openapispecification-facade-getstatus) and through a [notification callback](#openapispecification-facade-datatypes) as `paymentToken`.

**Perform a recurring payment**

1. **Initiate a Tokenized Session:** [Create a session](#openapispecification-facade-startpaymentsession) with the `tokenized` session type. This session type bypasses the redirect to the payment page.
2. **Create Payment Using Token:** Use the [Create payment by token](#create-payment-by-token) method passing the previously obtained `paymentToken`.
3. **Payment Confirmation:** Receive payment confirmation through the [status request](#openapispecification-facade-getstatus) or [notification callback](#openapispecification-facade-datatypes).

#### Create payment by token

This API method enables the creation of a card payment based on a previously saved recurring payment template represented by a token.

**Entry parameters:**

**Request URL:** `https://facade-api.main.gate-api.com/gapi/v1/sessions/{sessionId}/payments`

**Request method:** `POST`

**Request headers:**

<table><thead><tr><th width="242">Header</th><th width="71">R/O</th><th width="147">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>Original media type of the resource.</td></tr><tr><td><code>SessionTerminalKey</code></td><td>R</td><td></td><td>Merchant terminal identifier.</td></tr><tr><td><code>SessionTerminalPassword</code></td><td>R</td><td></td><td>Merchant terminal password.</td></tr></tbody></table>

**Path request parameters:**

<table><thead><tr><th width="150">Parameter</th><th width="81">Type</th><th width="85">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td>string</td><td>R</td><td>Payment session ID.</td><td><code>9073926b929f31c2abc9fad77ae3e8eb</code></td></tr></tbody></table>

#### **Body request parameters:**

<table><thead><tr><th width="174">Parameter</th><th width="81">Type</th><th width="85">R/O</th><th>Description</th></tr></thead><tbody><tr><td><code>paymentToken</code></td><td>string</td><td>R</td><td>Token used to create recurring payments.</td></tr></tbody></table>

**Request example:**

```json
SessionTerminalKey: *****
SessionTerminalPassword: *****
Content-Type: application/json
{
  "paymentToken": "rec-pay-4125a620-3842-4015-9960-27ba08c4510c"
}
```

**Response parameters:**

<table><thead><tr><th width="160">Attribute</th><th width="121">Type</th><th width="69">R/O</th><th width="227">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>session.id</code></td><td>string[100]</td><td>R</td><td>Payment session ID.</td><td><code>9073926b929f31c2abc9fad77ae3e8eb</code></td></tr><tr><td><code>session.payment.state</code></td><td>string[100]</td><td>R</td><td><a href="#openapispecification-facade-operationstatuses">Payment state</a>.</td><td> <code>authorized</code></td></tr><tr><td><code>session.payment.method</code></td><td>string[100]</td><td>O</td><td><a href="#openapispecification-facade-paymentmethods">Payment method</a>.</td><td> <code>cards</code></td></tr></tbody></table>

**Response example:**

```json
{
  "session": {
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "payment": {
      "state": "authorized",
      "method": "cards"
    }
  }
}
```

{% hint style="info" %}
To create a recurring payment using the [Payment Merchant (MAPI) scheme](#payment-merchant-scheme), see [this section](#creating-a-recurring-payment).
{% endhint %}

### Get Payment Status <a href="#openapispecification-facade-getstatus" id="openapispecification-facade-getstatus"></a>

Use this method to retrieve the current status of a payment session using its unique `sessionId`parameter. Once invoked, the API returns the latest status of the specified payment session.

**Entry parameters:**

**Request URL:** `https://facade-api.main.gate-api.com/gapi/v1/sessions/{sessionId}/status`

**Request method:** `GET`

**Request headers:**

<table><thead><tr><th width="184">Header</th><th width="103">R/O</th><th width="158">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>Original media type of the resource.</td></tr><tr><td><code>Cache-Control</code></td><td>R</td><td>no-cache</td><td>Retrieving the response directly from the server, bypassing caches, guarantees the latest payment status.</td></tr></tbody></table>

**Path request parameters:**

<table><thead><tr><th width="139">Parameter</th><th width="81">Type</th><th width="60">R/O</th><th width="172">Description</th><th width="294">Example</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td>string</td><td>R</td><td>Payment session ID</td><td> <code>9073926b929f31c2abc9fad77ae3e8ey</code></td></tr></tbody></table>

**Response parameters:**

<table><thead><tr><th width="160">Attribute</th><th width="121">Type</th><th width="69">R/O</th><th width="227">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>session.id</code></td><td>string[100]</td><td>R</td><td>Payment session ID.</td><td><code>9073926b929f31c2abc9fad77ae3e8eb</code></td></tr><tr><td><code>session.payment.state</code></td><td>string[100]</td><td>R</td><td><a href="#openapispecification-facade-operationstatuses">Payment state</a>.</td><td> <code>authorized</code></td></tr><tr><td><code>session.payment.method</code></td><td>string[100]</td><td>O</td><td><a href="#openapispecification-facade-paymentmethods">Payment method</a>.</td><td> <code>cards</code></td></tr><tr><td><code>session.payment.amount</code></td><td>int</td><td>R</td><td>Balance of the payment, taking into account all unblockings and refunds made. Presented in the the smallest unit of the payment currency. For example, if the payment is in EUR, the amount of <em>10050</em> means 100 EUR and 50 cents.</td><td><code>10051</code> (for an amounting to 100 dollars and 51 cents in USD)</td></tr><tr><td><code>session.payment.paymentToken</code></td><td>string</td><td>O</td><td>Recurring payment token identifier.</td><td></td></tr></tbody></table>

**Response example:**

```json
{
  "session": {
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "payment": {
      "state": "authorized",
      "method": "cards",
      "amount": 10000,
      "paymentToken": "c526dccc-c5fb-4148-9f14-42bda6c61878"
    }
  }
}
```

### Refund <a href="#openapispecification-facade-refund" id="openapispecification-facade-refund"></a>

Use this method to process refunds after a successful payment. The method requires the payment within the session to be in the `authorized` status. Upon receiving a refund request, the API facilitates either a full or partial refund of the charged amount back to the user's account.&#x20;

For security and for correct processing, include the merchant unique terminal key and password in the header.&#x20;

#### **Entry parameters:** <a href="#userregistration-entryparameters" id="userregistration-entryparameters"></a>

**Request URL:** `https://facade-api.main.gate-api.com/gapi/v1/sessions/{sessionId}/refund`

**Request method:** `POST`

**Request headers:**

<table><thead><tr><th width="279">Header</th><th width="103">R/O</th><th width="125">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>Original media type of the resource.</td></tr><tr><td><code>Cache-Control</code></td><td>R</td><td>no-cache</td><td>Retrieving the response directly from the server, bypassing caches, guarantees the latest payment status.</td></tr><tr><td><code>SessionTerminalKey</code></td><td>R</td><td> </td><td>Merchant terminal identifier.</td></tr><tr><td><code>SessionTerminalPassword</code></td><td>R</td><td> </td><td>Merchant terminal password.</td></tr></tbody></table>

#### **Path request parameters:**

<table><thead><tr><th width="146">Parameter</th><th width="82"> Type</th><th width="105">R/O</th><th width="209">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td>string</td><td>R</td><td>Payment session ID</td><td><code>9073926b929f31c2abc9fad77ae3e8ey</code></td></tr></tbody></table>

#### **Body request parameters:**

<table><thead><tr><th width="222">Attribute</th><th width="75">Type</th><th width="69">R/O</th><th width="210">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>session.refund.amount</code></td><td>int</td><td>R</td><td><p>The amount to be refunded. This value must not exceed the total amount of the original transaction (specified in <code>session.order.amount</code>).</p><p><br>Use the smallest unit of the payment currency. The minimum acceptable value is <code>1</code>.</p></td><td> <code>10051</code> (100 dollars and 51 cents if the currency is USD)</td></tr></tbody></table>

#### **Request example:**

```json
{
  "session":{
    "refund":{
      "amount": 10051
    }
  }	
}
```

&#x20;

#### **Response parameters:**

<table><thead><tr><th width="228">Attribute</th><th width="121">Type</th><th width="61">R/O</th><th width="137">Description</th><th width="162">Example</th></tr></thead><tbody><tr><td><code>session.id</code></td><td>string[100]</td><td>R</td><td>Payment session identifier.</td><td><code>9073926b929f31c2abc9fad77ae3e8eb</code></td></tr><tr><td><code>session.status</code></td><td><p>string[100]</p><p> </p></td><td>R</td><td><a href="#openapispecification-facade-operationstatuses">Payment state</a>.</td><td><code>authorized</code></td></tr><tr><td><code>session.refund.amount</code></td><td>int</td><td>R</td><td>The refunded amount specified in the smallest unit of its currency.</td><td><code>10051</code></td></tr><tr><td><code>session.order.id</code></td><td>string[100]</td><td>R</td><td>Order ID in the merchant system.</td><td><code>d1434908-7260-483e-8254-fa43af1b8356</code></td></tr><tr><td><code>session.order.amount</code></td><td>int</td><td>R</td><td>The total order amount specified in the smallest unit of its currency.</td><td><code>10051</code></td></tr><tr><td><code>session.order.currency</code></td><td>string[3]</td><td>R</td><td>Order currency.</td><td><code>USD</code></td></tr><tr><td><code>session.payment.amount</code></td><td>int</td><td>O</td><td>Balance of the payment, taking into account all unblockings and refunds made. Presented in the payment currency, using the smallest unit of that currency. For example, if the payment is in EUR, the amount of <em>10050</em> means 100 EUR and 50 cents.</td><td><code>10000</code></td></tr></tbody></table>

#### **Response example:**

```json
{
  "session": {
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "status": "refunded",
    "refund": {
      "amount": 10000
    },
    "order": {
      "id": "d1434908-7260-483e-8254-fa43af1b835d",
      "amount": 10000,
      "currency": "USD"
    },
    "payment": {
      "amount": 0
    }
  }
}
```

## GAPI Payout methods

This section provides an overview of the main API methods used in the Payler [**Payout Gate scheme**](#payout-gate-scheme) (**GAPI**). It includes detailed instructions for initiating a payout session and checking the payout status.

### Start Payout Session

Use this method to initiate a new payout session. The request must include the merchant's unique terminal key and password in the header for security and identification purposes. This information ensures that the session is securely linked to the merchant's account.

Once the session starts, it uses the settings set by a merchant to manage the payout process. If the request is successful, the API returns a link to the payout page that the merchant can share with customers. This link leads customers to the Payler secure payout page, where they can complete the transaction safely.

There are no restrictions on sharing the payout page link, meaning it can be freely shared to facilitate the payout process.

**Entry parameters:**

**Request URL:** `https://facade-api.main.gate-api.com/gapi/payout/v1/sessions`

**Request method:** `POST`

**Request headers:**

| Header                    | R/O | Value            | Description                          |
| ------------------------- | --- | ---------------- | ------------------------------------ |
| `Content-Type`            | R   | application/json | Original media type of the resource. |
| `SessionTerminalKey`      | R   |                  | Merchant terminal identifier.        |
| `SessionTerminalPassword` | R   |                  | Merchant terminal password.          |

**Body request parameters:**

<table><thead><tr><th width="296">Attribute</th><th width="117">Type</th><th width="63">R/O</th><th>Description</th></tr></thead><tbody><tr><td><code>session.lifetime</code></td><td>int</td><td>O</td><td>Session lifetime in minutes. You can set it to 20 minutes or more. The default is 20 minutes.</td></tr><tr><td><code>session.returnURLs.default.url</code></td><td>string[1000]</td><td>R</td><td>The URL to redirect a user if a transaction does <strong>not</strong> achieve its final status.</td></tr><tr><td><code>session.returnURLs.success.url</code></td><td>string[1000]</td><td>O</td><td>The URL to redirect a user if a payment is successful. If this URL is not provided, the <code>session.returnURLs.default.url</code> is used.</td></tr><tr><td><code>session.returnURLs.failure.url</code></td><td>string[1000]</td><td>O</td><td>The URL to redirect a user if the payment is <strong>not</strong> successful. If this URL is not provided, the  <code>session.returnURLs.default.url</code> is used.</td></tr><tr><td><code>session.notificationUrl</code></td><td>string[1000]</td><td>O</td><td>The URL for receiving notifications (<a href="#openapispecification-facade-datatypes">callbacks</a>) about payout statuses. If this URL is not provided, callbacks are <strong>not</strong> sent.</td></tr><tr><td><code>session.payout.antifraud</code></td><td>object</td><td>O</td><td><p>Additional parameters for the antifraud system. A maximum of 70 elements is allowed. Both keys and values should be strings, limited to 100 Latin characters each. Keys must follow the pattern <code>“antifraud_*”</code>.<br><br><strong>Example:</strong><br> <code>{</code></p><p><code>“antifraud_1”: “some_value1”,</code></p><p><code>“antifraud_2”: “some_value2”</code></p><p><code>}</code></p></td></tr><tr><td><code>session.payout.type</code></td><td>string enum</td><td>R</td><td>The type is always <code>regular</code> (standard payout).</td></tr><tr><td><code>session.payout.page.lang</code></td><td>string[2]</td><td>O</td><td>The language is always <code>en</code> (English).</td></tr><tr><td><code>session.order.id</code></td><td>string[100]</td><td>R</td><td><p>A unique order ID within the merchant system. Each payout session requires this ID.</p><p>Only printable ASCII characters are permitted.</p></td></tr><tr><td><code>session.order.currency</code></td><td>string[3]</td><td>R</td><td><p>Payout <a href="#openapispecification-facade-currenciesdirectory">currency</a> in the ISO 4217 format.</p><p><strong>Example:</strong> <code>USD</code></p></td></tr><tr><td><code>session.order.amount</code></td><td>int</td><td>R</td><td>Order amount in the smallest unit of the currency. For example, if the payout is in EUR, the amount of <em>10050</em> means 100 EUR and 50 cents.</td></tr><tr><td><code>session.order.description</code></td><td>string[250]</td><td>O</td><td>Additional order details.</td></tr><tr><td><code>session.order.itemsType</code></td><td>string</td><td>O</td><td>Specific product, service, or item that is the subject of an order.</td></tr><tr><td><code>session.order.customer.id</code></td><td>string[100]</td><td>O</td><td>Customer’s identifier.</td></tr><tr><td><code>session.order.customer.personsData</code></td><td>object</td><td>O</td><td>Customer's personal data. <br><em><mark style="background-color:yellow;"><strong>If customer's data (including email) is not real, payout will be rejected by antifraud system</strong></mark></em></td></tr><tr><td><code>session.order.customer.personsData.phoneNumber</code></td><td>string[100]</td><td>R</td><td>Customer's phone number must adhere to the <a href="https://www.itu.int/rec/T-REC-E.123/en">ITU-T E.123</a> and <a href="https://www.itu.int/rec/T-REC-E.164/en">ITU-T E.164</a> standards. </td></tr><tr><td><code>session.order.customer.personsData.firstName</code></td><td>string[100]</td><td>R</td><td>Customer's first name.</td></tr><tr><td><code>session.order.customer.personsData.lastName</code></td><td>string[100]</td><td>R</td><td>Customer's last name.</td></tr><tr><td><code>session.order.customer.personsData.country</code></td><td>string[2]</td><td>O</td><td>Customer's country of residence in the ISO <a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">3166-1 alpha-2</a> format.<br><strong>Example:</strong> <code>GB</code></td></tr><tr><td><code>session.order.customer.email</code></td><td>string[100]</td><td>R</td><td>Customer's email address.<br><em><mark style="background-color:yellow;"><strong>If customer's email is not real, payout will be rejected by antifraud system</strong></mark></em></td></tr><tr><td><code>session.order.additionalFields.custom</code></td><td>array</td><td>O</td><td>Fields are defined by a merchant in a free form to describe specific properties of the order.</td></tr><tr><td><code>session.order.additionalFields.custom[x].key</code></td><td>string</td><td>O</td><td>Identifier of a custom field.</td></tr><tr><td><code>session.order.additionalFields.custom[x].value</code></td><td>string</td><td>O</td><td>Content within a custom field.</td></tr></tbody></table>

**Request example:**&#x20;

```json
{
  "session": {
    "lifetime": 20,
    "returnURLs": {
      "default": {
        "url": "https://some.address.com/default"
      },
      "success": {
        "url": "https://some.address.com/success"
      },
      "failure": {
        "url": "https://some.address.com/failed"
      }
    },
    "notificationUrl": "https://some.address.com/notify",
    "payout": {
      "type": "regular",
      "antifraud": {
        "key": "value",
        "key2": "value"
      },
      "page": {
        "lang": "en"
      }
    },
    "order": {
      "id": "d43850a9-c909-4580-b589-a89c1748a1dw",
      "currency": "USD",
      "amount": 10000,
      "description": "some description",
      "itemsType": "test",
      "customer": {
        "id": "ff12rte33",
        "email": "some@email",
        "personsData": {
          "firstName": "John",
          "lastName": "Doe",
          "phoneNumber": "00555555",
          "country": "GB"
        }
      },
      "additionalFields": {
        "custom": [
          {
            "key": "value",
            "description": "value"
          }
        ]
      }
    }
  }
}
```

**Response parameters:**

<table><thead><tr><th>Attribute</th><th width="106">Type</th><th width="65">R/O</th><th width="176">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>session.id</code></td><td>string</td><td>R</td><td>Payout session ID.</td><td><code>9073926b929f31c2abc9fad77ae3e8eb</code></td></tr><tr><td><code>session.order.id</code></td><td>string[100]</td><td>R</td><td>Unique order ID in the merchant system.</td><td></td></tr><tr><td><code>session.order.amount</code></td><td>int</td><td>R</td><td>The total amount of the order expressed in the smallest unit of its currency.</td><td><code>10051</code></td></tr><tr><td><code>session.payout.page.url</code></td><td>string</td><td>O</td><td>A URL linking to the payout page for the current session, intended to be shared with the customer (end-user).</td><td></td></tr></tbody></table>

**Success response example:**&#x20;

```json
{
   "session":{
      "id":"013a32441c8b40938b291b65741a2486",
      "order":{
         "id":"d43850a9-c909-4580-b589-a89c1748a1da",
         "amount":10000
      },
      "payout": {
        "page":{
          "url":"https://url.com/payout-page/:sessionID"
        }
      }
   }
} 
```

**Error response example:**&#x20;

```json
{
  "error": {
    "type": "validationError",
    "title": "Your request parameters didn't validate.",
    "invalid-params": [
      {
        "name": "session.someKey",
        "reason": "valueHasExtraLength"
      },
      {
        "name": "session.someKey2",
        "reason": "valueIsNotPermited"
      }
    ]
  }
}
```

### Get Payout Status

Use this method to retrieve the current status of a payout session using its unique `sessionId` parameter. Once invoked, the API returns the latest status of the specified payout session.

**Entry parameters:**

**Request URL:** `https://facade-api.main.gate-api.com/gapi/payout/v1/sessions/{sessionId}/status`

**Request method:** `GET`

**Request headers:**

| Header          | R/O | Value            | Description                                                                                              |
| --------------- | --- | ---------------- | -------------------------------------------------------------------------------------------------------- |
| `Content-Type`  | R   | application/json | Original media type of the resource.                                                                     |
| `Cache-Control` | R   | no-cache         | Retrieving the response directly from the server, bypassing caches, guarantees the latest payout status. |

**Path request parameters:**

<table><thead><tr><th width="154">Parameter</th><th width="92">Type</th><th width="78">R/O</th><th width="241">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td>string</td><td>R</td><td>Payout session ID.</td><td><code>9073926b929f31c2abc9fad77ae3e8eb</code></td></tr></tbody></table>

**Response parameters:**

<table><thead><tr><th width="204">Attribute</th><th width="131">Type</th><th width="71">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>session.id</code></td><td>string[100]</td><td>R</td><td>Payout session ID.</td><td><code>9073926b929f31c2abc9fad77ae3e8eb</code></td></tr><tr><td><code>session.payout.state</code></td><td>string[100]</td><td>R</td><td><a href="#openapispecification-facade-operationstatuses">Payout state</a>.</td><td><code>authorized</code></td></tr><tr><td><code>session.payout.method</code></td><td>string[100]</td><td>O</td><td><a href="#payout-methods">Payout method</a>.</td><td><code>cards</code></td></tr><tr><td><code>session.payout.amount</code></td><td>long</td><td>R</td><td>Total payout amount in the smallest unit of its currency. For example, if the payout is in EUR, the amount of <em>10050</em> means 100 EUR and 50 cents.</td><td><code>10050</code></td></tr></tbody></table>

**Response example:**&#x20;

```json
{
  "session": {
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "payout": {
      "state": "authorized",
      "method": "cards",
      "amount": 10050
    }
  }
}
```

## GAPI List of errors <a href="#openapispecification-facade-api-methods" id="openapispecification-facade-api-methods"></a>

If a request for any of the GAPI methods fails, the response includes a detailed error description.

**Error description parameters:**

<table><thead><tr><th width="241">Name</th><th width="112">Type</th><th width="67">R/O</th><th>Description</th></tr></thead><tbody><tr><td><code>session.id</code></td><td>string[100]</td><td>R</td><td>Payment or payout session ID.</td></tr><tr><td><code>session.error.type</code></td><td>string</td><td>R</td><td>Internal error code. Use it when reaching out to technical support.</td></tr><tr><td><code>session.error.title</code></td><td>string</td><td>R</td><td>Error description.</td></tr></tbody></table>

**Failed request response example:**

```json
{
  "session": {
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "error": {
      "type": "invalidAmount",
      "title": "Invalid amount of the transaction."
    }
  }
}
```

If request input parameters lead to validation errors, the response includes the additional **invalid-params** array. Each element of this array describes the specific rule that was violated:

```json
{
  "session": {
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "error": {
      "type": "validationError",
      "title": "Your request parameters didn't validate.",
      "invalid-params": [
        {
          "name": "session.someKey",
          "reason": "keyHasExtraLength"
        }
      ]
    }
  }
}
```

**Error types**

The table below contains possible values of the **error.type** parameter in the responses for the failed requests.

<table><thead><tr><th>Type</th><th width="94">Error</th><th>Title</th><th>Comment</th></tr></thead><tbody><tr><td><code>malformedRequest</code><br><br><code>validationError</code></td><td>400</td><td>Your request body didn't validate.</td><td>Includes the <code>invalid-params</code> array of the incorrect parameters.</td></tr><tr><td><code>invalidAmount</code></td><td>400</td><td>Invalid amount of the transaction.</td><td><p>The error occurs if:</p><ul><li>the provided amount isn't a positive integer,</li><li>the refunded amount exceeds the original order amount.</li></ul></td></tr><tr><td><code>duplicatedOrderId</code></td><td>400</td><td>Duplicated order id.</td><td>The error occurs if a payment with the same order ID already exists.</td></tr><tr><td><code>currencyNotSupported</code></td><td>400</td><td>This currency is not supported.</td><td>See a list of <a href="#openapispecification-facade-currenciesdirectory">supported currencies</a>.</td></tr><tr><td><code>methodNotSupported</code></td><td>400</td><td>This payment method is not supported.</td><td>See a list of <a href="#openapispecification-facade-paymentmethods">payment</a> and <a href="#payout-methods">payout</a> methods.</td></tr><tr><td><code>insufficientMerchantFundsToCompleteRefund</code></td><td>400</td><td>The refund was created. There are not enough funds on the merchant's balance to complete the refund.</td><td></td></tr><tr><td><code>invalidPaymentState</code></td><td>400</td><td>The payment is in an invalid state.</td><td>The error occurs if no corresponding payments were found for the refund. The payment within the session must be <code>authorized</code>.</td></tr><tr><td><code>multipleRefundNotSupported</code></td><td>400</td><td>Subsequent refunds are not supported in the automatic mode. Contact to our support team.</td><td>The error occurs in a case of a second refund appempt, which some payment providers don't support.</td></tr><tr><td><code>partialRefundNotAllowed</code></td><td>400</td><td>Can not refund a part of the previously charged amount.</td><td>The error occurs in a case of a partial refund appempt, which some payment providers don't support.</td></tr><tr><td><code>invalidTerminalCredentials</code></td><td>400</td><td>Invalid terminal key or password.</td><td></td></tr><tr><td><code>invalidTerminalSettings</code></td><td>400</td><td><p>Terminal settings are invalid.</p><p>Contact our support team.</p></td><td></td></tr><tr><td><code>sessionNotFound</code></td><td>404</td><td>There is no session with the specified id.</td><td></td></tr><tr><td><code>interfaceNotAllowed</code></td><td>422</td><td>This interface is not allowed.</td><td>The error occurs if the GAPI interface for the requested transaction direction (payment/payout) isn't allowed.</td></tr><tr><td><code>twoPhasePaymentIsNotSupportedByTerminal</code></td><td>422</td><td>Two-phase payments aren't supported by a terminal.</td><td></td></tr><tr><td><code>facadeDeclined</code></td><td>500</td><td>Unexpected error. Contact to our support team.</td><td></td></tr><tr><td><code>temporaryMalfunction</code></td><td>503</td><td>Temporary malfunction. Please try again later.</td><td></td></tr></tbody></table>

#### **Parameter validation errors**

The table below contains possible errors occurring during the validation of the input parameters. For example, if the request body is not a correct JSON object, a response with the `malformedRequest` error type is returned. The reason value will include the line number where the first error occurred, indicated as 'XX':

```json
{
  "session": {
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "error": {
      "type": "malformedRequest",
      "title": "Your request body didn't validate.",
      "invalid-params": [
        {
          "name": "body",
          "reason": "bodyMalformedAtPosXX"
        }
      ]
    }
  }
}
```

The possible validation errors are:

<table><thead><tr><th width="290">Error</th><th>Description</th></tr></thead><tbody><tr><td><code>arrayHasExtraAttributes</code></td><td>Array attribute contains extra elements beyond the expected count.</td></tr><tr><td><code>keyHasExtraLength</code></td><td>Key exceeds its maximum length limit.</td></tr><tr><td><code>keyIsRequired</code></td><td>Mandatory attribute <code>key</code> is missing.</td></tr><tr><td><code>keyIsNotPermited</code></td><td>Unexpected attribute <code>key</code> is provided.</td></tr><tr><td><code>malformedRequest</code></td><td>Request body isn't a correct JSON object.</td></tr><tr><td><code>objectHasExtraAttributes</code></td><td>Object <code>attribute</code> contains unexpected attributes.</td></tr><tr><td><code>valueIsNotPermited</code></td><td>Value does not match the defined enumeration for the attribute.</td></tr><tr><td><code>valueIsRequired</code></td><td>Value must be provided. Empty and null values are not acceptable.</td></tr><tr><td><code>valueHasExtraLength</code></td><td>Value exceeds its maximum length limit.</td></tr><tr><td><code>valueHasWrongFormat</code></td><td>Value format differs from the expected format.</td></tr></tbody></table>

## MAPI Payment methods <a href="#openapispecification-facade-api-methods" id="openapispecification-facade-api-methods"></a>

This section explains the main API methods utilized in the Payler [**Payment Merchant scheme**](#payment-merchant-scheme) (**MAPI**). It includes detailed descriptions and protocols for creating a payment, checking payment status, completing a payment, and processing refunds and reversals.

### Create Payment

Use this method to initiate a payment creation request through the MAPI interface.

#### **Entry parameters:** <a href="#userregistration-entryparameters" id="userregistration-entryparameters"></a>

**Request URL:** `https://facade-api.main.gate-api.com/mapi/v2/payments`

**Request method:** `POST`

**Request headers:**

<table><thead><tr><th width="279">Header</th><th width="104">R/O</th><th width="116">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>The original media type of the resource.</td></tr><tr><td><code>AuthorizationKey</code></td><td>R</td><td> </td><td>Merchant terminal identifier.</td></tr><tr><td><code>AuthorizationPassword</code></td><td>R</td><td> </td><td>Merchant terminal password.</td></tr></tbody></table>

**Body request parameters:**

<table><thead><tr><th width="232">Parameter</th><th width="135">Type</th><th width="60">R/O</th><th width="237">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>order</code></td><td>object</td><td>R</td><td>Order parameters</td><td></td></tr><tr><td><code>order.id</code></td><td>string[100]</td><td>R</td><td>Unique identifier for the order within the merchant's system. Each payment (session) requires a distinct identifier. Only printable ASCII characters are allowed.</td><td></td></tr><tr><td><code>order.currency</code></td><td>string[3]</td><td>R</td><td>Currency of the payment.</td><td></td></tr><tr><td><code>order.amount</code></td><td>long</td><td>R</td><td>Order amount in the smallest units of the order's currency, as an integer.</td><td>12356</td></tr><tr><td><code>order.description</code></td><td>string[256]</td><td>O</td><td>Description of the order, payment.</td><td></td></tr><tr><td><code>type</code></td><td>string enum</td><td>R</td><td><p>Payment type:</p><ul><li><code>regular</code> - standard payment;</li><li><code>tokenized</code> - recurring payment using a token from a saved card.</li></ul><p>If the type is not specified, the default value is <code>regular</code>.</p></td><td>regular</td></tr><tr><td><code>method</code></td><td>string</td><td>R</td><td>Payment method. Possible  values: <a href="#openapispecification-facade-paymentmethods">Payment methods</a></td><td>interac</td></tr><tr><td><code>createPaymentToken</code></td><td>bool</td><td>O</td><td><p>Determines the need to create a token for recurring payments.</p><p></p><p>Possible values:</p><ul><li><code>true</code> - Creates a token for future payments.</li><li><code>false</code> - Does not create a token.</li></ul><p>If this parameter is not specified, or if the request is for creating a payment with an existing token, the default value is <code>false</code>.</p></td><td>false</td></tr><tr><td><code>details</code></td><td>object</td><td>O</td><td><p>Parameters depend on the selected payment method:</p><ul><li><a href="#payment-details-for-the-cards-method">cards</a></li><li><a href="#payment-details-for-the-mcommerce-method">mcommerce</a></li><li><a href="#payment-details-for-the-pcr-method">pcr</a></li><li><a href="#payment-details-for-the-interac-method">interac</a></li><li><a href="#payment-details-for-the-upi-method">upi</a></li><li><a href="#payment-details-for-the-openbanking-method">openbanking</a></li><li><a href="#payment-details-for-the-boleto-picpays-pixand-banktransfer-brazil-methods">boleto, picpays, pix, and banktransfer (Brazil)</a></li></ul><p>You can check a list of required parameters by sending the <a href="#retrieve-payment-method-details">Retrieve Payment Method Details</a> request.</p></td><td></td></tr><tr><td><code>customer</code></td><td>object</td><td>R</td><td>Merchant's customer payment details.<br><em><mark style="background-color:yellow;"><strong>If customer's data (including email) is not real, payments will be rejected by antifraud system</strong></mark></em></td><td></td></tr><tr><td><code>customer.id</code></td><td>string[100]</td><td>O</td><td>Merchant's system identifier for the customer.</td><td></td></tr><tr><td><code>customer.email</code></td><td>string[100]*</td><td>R</td><td>Customer's email address. <br>*For the <em>banktransfer</em> and <em>SCP</em> methods, the max length is 50.</td><td></td></tr><tr><td><code>customer.phoneNumber</code></td><td>string[100]*</td><td>R</td><td><p>Customer's phone number. </p><p>*For the <em>banktransfer</em> and <em>SCP</em> methods, the max length is 15.</p></td><td></td></tr><tr><td><code>customer.firstName</code></td><td>string[100]*</td><td>R</td><td><p>First name. </p><p>*For the <em>banktransfer</em> and <em>SCP</em> methods, the max length is 50. For the <em>upi</em> method, the max length is 40.</p></td><td></td></tr><tr><td><code>customer.lastName</code></td><td>string[100]*</td><td>R</td><td><p>Last name.</p><p>*For the <em>banktransfer</em> and <em>SCP</em> methods, the max length is 50. For the <em>upi</em> method, the max length is 40.</p></td><td></td></tr><tr><td><code>customer.documentType</code></td><td>string[100]</td><td>O</td><td>Type of identification document.</td><td></td></tr><tr><td><code>customer.documentNumber</code></td><td>string[100]</td><td>O</td><td>Identification document number.</td><td></td></tr><tr><td><code>customer.address</code></td><td>object</td><td>O*</td><td>Customer's billing address.<br>*Required for a number of APM (non-cards) payment methods.<br>The parameter is also required for certain <em>card-method</em> transactions. Contact support for more details.</td><td></td></tr><tr><td><code>customer.address.addressLine</code></td><td>string[100]**</td><td>O*</td><td><p>Address<br><strong>*</strong>Required when the merchant performs payments via one of the following payment methods:<br><code>netbanking,</code><br><code>bankdeposit, banktransfer,</code> <br><code>qrcode,</code><br><code>wallet,</code><br><code>p2p, SCP</code></p><p>**For the <em>banktransfer</em> and <em>SCP</em> methods, the max length is 50.</p></td><td></td></tr><tr><td><code>customer.address.city</code></td><td>string[100]**</td><td>O*</td><td><p>City<br><strong>*</strong>Required when the merchant performs payments via one of the following payment methods: <code>netbanking, bankdeposit,banktransfer, qrcode, wallet, p2p, SCP</code></p><p>The parameter is also required for certain <em>card-method</em> transactions. Contact support for more details.<br>**For the <em>banktransfer</em> and <em>SCP</em> methods, the max length is 50.</p></td><td></td></tr><tr><td><code>customer.address.country</code></td><td>string[2]</td><td>O*</td><td><p>Two-letter ISO country code of the customer's residence.<br><strong>*</strong>Required when the merchant performs payments via one of the following payment methods:</p><p><code>applepay, netbanking, bankdeposit, banktransfer, qrcode, wallet, p2p,  openbanking, rapipago, khipu, sepa, sepaqr, SCP</code><br>The parameter is also required for certain <em>card-method</em> transactions. Contact support for more details.</p></td><td>GB</td></tr><tr><td><code>customer.address.state</code></td><td>string[100]</td><td>O*</td><td>State/Region<br><strong>*</strong>Required when the merchant performs payments via one of the following payment methods: <code>netbanking, bankdeposit, qrcode, wallet, p2p</code><br>The parameter is also required for certain <em>card-method</em> transactions. Contact support for more details.</td><td></td></tr><tr><td><code>customer.address.postalCode</code></td><td>string[100]**</td><td>O*</td><td><p>Postal code<br><strong>*</strong>Required when the merchant performs payments via one of the following payment methods: <code>netbanking, bankdeposit,banktransfer, qrcode, wallet, p2p, SCP</code></p><p>The parameter is also required for certain <em>card-method</em> transactions. Contact support for more details.<br>**For the <em>banktransfer</em> and <em>SCP</em> methods, the max length is 10.</p></td><td></td></tr><tr><td><code>sessionContext</code></td><td>object</td><td>R</td><td>Parameters describing the customer session context.</td><td></td></tr><tr><td><code>sessionContext.ip</code></td><td>string[100]</td><td>R</td><td>IP address of the payer's device.</td><td></td></tr><tr><td><code>sessionContext.languageCode</code></td><td>string[2]</td><td>O</td><td>The language is always <code>en</code> (English).</td><td></td></tr><tr><td><code>sessionContext.browserParameters</code></td><td>object</td><td>R</td><td>Browser parameters of the payer.</td><td></td></tr><tr><td><code>sessionContext.browserParameters.accept</code></td><td>string[2000]</td><td>R</td><td>Browser's Accept header of the payer.</td><td></td></tr><tr><td><code>sessionContext.browserParameters.language</code></td><td>string[35]</td><td>R</td><td><p>Value representing the Browser language as defined in IETF BCP47. Returned from navigator.language property</p><p>Without special validation rules.</p></td><td></td></tr><tr><td><code>sessionContext.browserParameters.userAgent</code></td><td>string[2048]</td><td>R</td><td>Exact content of the HTTP user-agent header. Without special validation rules.</td><td></td></tr><tr><td><code>sessionContext.browserParameters.javaEnabled</code></td><td>bool</td><td>R</td><td>Boolean that represents the ability of the Cardholder Browser to execute Java. Without special validation rules.</td><td></td></tr><tr><td><code>sessionContext.browserParameters.javascriptEnabled</code></td><td>bool</td><td>R</td><td>Boolean that represents the ability of the Cardholder Browser to execute JavaScript. Without special validation rules.</td><td></td></tr><tr><td><code>sessionContext.browserParameters.screenHeight</code></td><td>string[6]</td><td>R</td><td><p>Total height of the Cardholder's screen in pixels. Value is returned from the screen.height property.</p><p>Special validation rules: only numeric symbols</p></td><td></td></tr><tr><td><code>sessionContext.browserParameters.screenWidth</code></td><td>string[6]</td><td>R</td><td><p>Total width of the Cardholder's screen in pixels. Value is returned from the screen.width property.</p><p>Special validation rules: only numeric symbols</p></td><td></td></tr><tr><td><code>sessionContext.browserParameters.colorDepth</code></td><td>string[2]</td><td>R</td><td><p>Value representing the bit depth of the colour palette for displaying images, in bits per pixel.</p><p>Obtained from the Cardholder Browser using the screen.colorDepth property.</p><p>Special validation rules:</p><p>possible numeric value from 1 to 99.</p></td><td></td></tr><tr><td><code>sessionContext.browserParameters.tz</code></td><td>string[5]</td><td>R</td><td>Time zone offset in minutes between UTC and the Cardholder Browser local time. Without special validation rules. </td><td>+180</td></tr><tr><td><code>returnUrls</code></td><td>object</td><td>R</td><td>URLs for redirecting back to the merchant's page.</td><td></td></tr><tr><td><code>returnUrls.default</code></td><td> string[2000]</td><td> R </td><td>Default, used for returning to the merchant's payment page from Payler's service pages if the payment is in a non-final status.</td><td></td></tr><tr><td><code>returnUrls.success</code></td><td>string[2000]</td><td>O</td><td>Used for returning to the merchant's payment page from Payler's service pages in case of success (if not specified, returnUrls.default will be used)</td><td></td></tr><tr><td><code>returnUrls.failure</code></td><td>string[2000]</td><td>O</td><td>Used for returning to the merchant's payment page from Payler's service pages in case of failure (if not specified, returnUrls.default will be used)</td><td></td></tr><tr><td><code>notificationUrl</code></td><td>string[2000]</td><td>O</td><td>Merchant's URL for receiving notifications about payment status changes. If not provided, notifications are not performed.</td><td></td></tr><tr><td><code>antifraudParameters</code></td><td>object</td><td>O</td><td>Antifraud parameters. Each property of the object represents a separate parameter, where the property name is the parameter name, and the property value is the parameter value. Properties are strings: "param_name": "param_value"</td><td></td></tr></tbody></table>

#### Payment details for the `cards` method:

<table><thead><tr><th width="183">Parameter</th><th width="155">Type</th><th width="102">R/O</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td>string, enum[“card”, “tokenized“]</td><td>R</td><td><p>Possible payment requisite types are:</p><ul><li><em>cards</em> if card parameters are the requisites.</li><li><em>tokenized</em> if a payment token for the recurring payment is the requisite.</li></ul><p>Choosing the type reflects on the parameters mentioned below.</p></td></tr><tr><td><code>isTwoPhase</code></td><td>boolean</td><td>O*</td><td><p>*For the <em>card</em> type.</p><p>The parameter states whether it’s a two-phase payment or not. <em>False</em> is a default value.</p></td></tr><tr><td><code>cardNumber</code></td><td>string</td><td>O*</td><td><p>*For the <em>card</em> type.</p><p>Card number must be between 13 and 19 symbols.</p></td></tr><tr><td><code>cardHolderName</code></td><td>string</td><td>O*</td><td><p>*For the <em>card</em> type.</p><p>Cardholder’s full name must:</p><ul><li>contain only Latin letters,</li><li>have two or three words separated by spaces,</li><li>have 50 symbols max.</li></ul></td></tr><tr><td><code>cardSecurityCode</code></td><td>string</td><td>O*</td><td><p>*For the <em>card</em> type.</p><p>Card security code is between 3 and 4 symbols.</p></td></tr><tr><td><code>expiryMonth</code></td><td>int</td><td>O*</td><td><p>*For the <em>card</em> type.</p><p>Card expiry month is a 2-digit number between <em>01</em> and <em>12</em>.</p></td></tr><tr><td><code>expiryYear</code></td><td>int</td><td>O*</td><td><p>*For the <em>card</em> type.</p><p>Card expiry year is a 2-digit number between <em>00</em> and <em>99</em>.</p></td></tr><tr><td><code>paymentToken</code></td><td>string</td><td>O*</td><td><p>*For the <em>tokenized</em> type.</p><p>Payment token for the recurring payment.</p></td></tr></tbody></table>

#### Payment details for the `mcommerce` method:

| Parameter | Type   | R/O | Description                              |
| --------- | ------ | --- | ---------------------------------------- |
| phone     | string | R   | 11 symbols are max for the phone number. |

#### Payment details for the `pcr` method:

| Parameter         | Type                          | R/O | Description                                                                                                                                                           |
| ----------------- | ----------------------------- | --- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`            | string enum \[“card”, “iban”] | R   | <p>Possible payment requisite types are:</p><ul><li><em>card</em> if card parameters are the requisites.</li><li><em>iban</em> if an IBAN is the requisite.</li></ul> |
| `accountNumber`   | string                        | R   | Depending on the *type* parameter, the account number is either a card number or an IBAN.                                                                             |
| `beneficiaryName` | string                        | R   | Beneficiary’s full name.                                                                                                                                              |
| `phone`           | string                        | O   | Beneficiary’s phone number.                                                                                                                                           |

#### Payment details for the `interac` method:

<table><thead><tr><th>Parameter</th><th>Type</th><th width="100">R/O</th><th>Description</th></tr></thead><tbody><tr><td><code>firstName</code></td><td>string</td><td>R</td><td>Payer’s first name may contain only Latin symbols, hyphen (-), and spaces between them.</td></tr><tr><td><code>lastName</code></td><td>string</td><td>R</td><td>Payer’s last name may contain only Latin symbols, hyphen, and spaces between them.</td></tr><tr><td><code>email</code></td><td>string</td><td>R</td><td><p>Payer’s email.</p><p>At least an email or phone number must be linked to a bank account.</p></td></tr><tr><td><code>phone</code></td><td>string</td><td>R</td><td>Payer’s phone number must be between 9 and 16 symbols.<br>At least an email or a phone number must be linked to a bank account.</td></tr><tr><td><code>country</code></td><td>string</td><td>R</td><td>ISO 3166-1 alpha-2 payer’s country code.</td></tr><tr><td><code>state</code></td><td>string</td><td>R</td><td>Two-letter abbreviation of a payer’s state.</td></tr><tr><td><code>address</code></td><td>string</td><td>R</td><td>200 symbols are max for a payer’s address.</td></tr><tr><td><code>city</code></td><td>string</td><td>R</td><td>Payer’s city must match the country.</td></tr><tr><td><code>zip</code></td><td>string</td><td>R</td><td>Payer’s zip code must match the country.</td></tr></tbody></table>

#### Payment details for the `upi` method:

| Parameter       | Type   | R/O | Description                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------- | ------ | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| city            | string | R   | Payer’s city.                                                                                                                                                                                                                                                                                                                                                                                                       |
| `address`       | string | R   | 200 symbols are max for a payer’s address.                                                                                                                                                                                                                                                                                                                                                                          |
| `accountNumber` | string | R   | <p>In this case, account number’s format is similar to the email format: <em>\[username]@\[bankname]</em>.</p><p>The <em>username</em> part must:</p><ul><li>contain 35 symbols max,</li><li>contain only Latin letters, digits, and a few special symbols (“.” “,” “\_”).</li></ul><p>The <em>bankname</em> part must:</p><ul><li>contain 10 symbols max,</li><li>contain only Latin letters or digits. </li></ul> |

#### Payment details for the `openbanking` method:

| Parameter | Type   | R/O | Description                                                                                                                                                                                                                                                       |
| --------- | ------ | --- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bankId`  | string | R   | <p>Technical code of a bank’s branch.<br>You can find this value by sending the <a href="#retrieve-payment-method-details">Retrieve Payment Method Details</a> and <a href="#retrieve-payment-method-entities">Retrieve Payment Method Entities</a> requests.</p> |

#### Payment details for the `boleto, picpays, pix`and `banktransfer`*`(Brazil)`* methods:

{% hint style="info" %}
For the **boleto** method, **each** of the requirements is **required**.
{% endhint %}

<table><thead><tr><th>Parameter</th><th>Type</th><th width="86">R/O</th><th>Description</th></tr></thead><tbody><tr><td><code>firstName</code></td><td>string</td><td>R</td><td>The first name must contain only Latin letters or spaces between the words. 74 symbols are the limit.</td></tr><tr><td><code>lastName</code></td><td>string</td><td>R</td><td>The last name must contain only Latin letters or spaces between the words. 74 symbols are the limit.</td></tr><tr><td><code>email</code></td><td>string</td><td>O</td><td>100 symbols are the limit for an email.</td></tr><tr><td><code>documentNumber</code></td><td>string</td><td>O</td><td>11-digit CPF number.</td></tr><tr><td><code>address</code></td><td>string</td><td>O</td><td>Customer’s street.</td></tr><tr><td><code>address2</code></td><td>string</td><td>O</td><td>Customer’s additional address, such as an apartment number.</td></tr><tr><td><code>addressNumber</code></td><td>string</td><td>O</td><td>Customer’s street number.</td></tr><tr><td><code>addressNeighborhood</code></td><td>string</td><td>O</td><td>Neighborhood or district. 30 symbols are the limit.</td></tr><tr><td><code>city</code></td><td>string</td><td>O</td><td>30 symbols are the limit for a customer’s city.</td></tr><tr><td><code>state</code></td><td>string</td><td>O</td><td>Two-letter abbreviation of a customer’s state.</td></tr><tr><td><code>zip</code></td><td>string</td><td>O</td><td>Customer’s postal or zip code.</td></tr></tbody></table>

#### Request example for the `cards` payment method:

```json
Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json

{
  "order": {
    "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "amount": 1112,
    "currency": "GBP",
    "description": "Magic staff package #5"
  },
  "createPaymentToken": false,
  "type": "regular",
  "method": "cards",
  "customer": {
    "id": "62f66472913640cc93f49d5477840657",
    "firstName": "Harry",
    "lastName": "Potter",
    "email": "customer@email.com",
    "phone": "357 123456789"
  },
  "details": {
    "type": "card",
    "isTwoPhase": false,
    "cardNumber": "4242424242424242",
    "cardHolderName": "Harry Potter",
    "cardSecurityCode": "123",
    "expiryMonth": 11,
    "expiryYear": 2025
  },
  "sessionContext": {
    "ip": "172.16.0.1",
    "languageCode": "en",
    "browserParameters": {
      "accept": "text/html",
      "language": "en-US",
      "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0",
      "javaEnabled": true,
      "javascriptEnabled": true,
      "screenHeight": "1920",
      "screenWidth": "1080",
      "colorDepth": "12",
      "tz": "-180"
    }
  },
  "returnUrls": {
    "default": "https://yourwebsite.com/{someUsefulParams1}",
    "success": "https://yourwebsite.com/{someUsefulParams2}",
    "failure": "https://yourwebsite.com/{someUsefulParams3}"
  },
  "notificationUrl": "https://yourwebsite.com/notify",
  "antifraudParams": {
    "antifraud_email": "Camryn.Roob83@gmail.com",
    "antifraud_param_name": "param_value"
  }
}
```

#### Request example for the Alternative Payment Methods (APMs):

<pre class="language-json"><code class="lang-json"><strong>Authorization-Key: *****
</strong>Authorization-Password: *****
Content-Type: application/json

{
  "order": {
    "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "amount": 1112,
    "currency": "GBP",
    "description": "Magic staff package #5"
  },
  "createPaymentToken": false,
  "method": "pcr",
  
  "customer": {
    "id": "62f66472913640cc93f49d5477840657",
    "firstName": "Harry",
    "lastName": "Potter",
    "email": "customer@email.com",
    "phone": "357 123456789",
    "documentNumber": "13245678911",
    "address": {
      "addressLine": "211, Victory street, office 7B",
      "city": "Hogwarts",
      "countryCode": "GB",
      "postalCode": "01001",
      "state": "CA"
    }
  },
   
   "details": {
    "type": "iban",    
    "accountNumber": "AZ21NABZ00000000137010001944",
    "beneficiaryName": "John Doe",
  },
  
  "sessionContext": {
    "ip": "172.16.0.1",
    "languageCode": "en",
    "browserParametes": {
      "accept": "text/html",
      "language": "en-US",
      "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0",
      "javaEnabled": true,
      "javascriptEnabled": true,
      "screenHeight": "1920",
      "screenWidth": "1080",
      "colorDepth": "12",
      "tz": "-180"
    }
  },
  "returnUrls": {
    "default": "https://yourwebsite.com/{someUsefulParams1}",
    "success": "https://yourwebsite.com/{someUsefulParams2}",
    "failure": "https://yourwebsite.com/{someUsefulParams3}"
  },
  "notificationUrl": "https://yourwebsite.com/notify",
  "antifraudParams": {
    "email": "Camryn.Roob83@gmail.com",
    "param_name": "param_value"
  }
}
</code></pre>

#### &#x20;Response parameters:

<table><thead><tr><th width="175">Parameter</th><th>Type</th><th width="58">R/O</th><th width="233">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>id</code></td><td>string[100]</td><td>R</td><td>Payment ID (Payment session identifier)</td><td>9073926b929f31c2abc9fad77ae3e8eb</td></tr><tr><td><code>orderId</code></td><td>string[100]</td><td>R</td><td>Identifier of the order being paid in the merchant's system. Each payment (session) requires a unique identifier. Only printable ASCII characters are allowed.</td><td></td></tr><tr><td><code>method</code></td><td>string[100]</td><td>R</td><td>Payment method.</td><td></td></tr><tr><td><code>status</code></td><td>string[100]</td><td>R</td><td>Payment status. </td><td></td></tr><tr><td><code>amount</code></td><td>int</td><td>O</td><td>Balance of the payment, taking into account all unblockings and refunds made. Presented in the payment currency, using the smallest unit of that currency.</td><td><code>10051</code> (for an amounting to 100 dollars and 51 cents in USD)</td></tr><tr><td><code>description</code></td><td>string[255]</td><td>O</td><td>Optional description regarding the status.</td><td></td></tr><tr><td><code>redirectUrl</code></td><td>string[2000]</td><td>O</td><td>Filled for the status 'redirect'. Contains the address to which you need to go to continue the process. All necessary parameters are presented in the address line or in the request parameters of the prepared URL.</td><td></td></tr><tr><td><code>paymentToken</code></td><td>string</td><td>O</td><td>Token for creating recurring payments.</td><td></td></tr><tr><td><code>action.type</code></td><td>string</td><td>O</td><td><p>The type of additional action expected from the merchant to continue the payment process. Filled if the status is '<code>actionRequired</code>'.<br>Possible values are:</p><ul><li>'<code>redirect</code>' - the merchant must  redirect the client to the page specified in <code>action.url</code> parameter.</li><li>'<code>confirmWithCode</code>' -  the merchant must provide a special confirmation code by calling Confirm method.</li><li><code>'confirmPayment'</code> - the merchant must offer the user to make a payment using the details specified in the <code>'action.details'</code> parameter and, after payment, call the <a href="#confirm-payment">Confirm Payment</a>  method.</li></ul></td><td></td></tr><tr><td><code>action.url</code></td><td>string</td><td>O</td><td>Filled for the status '<code>actionRequired</code>' and action.type '<code>redirect</code>'. Contains the address to which the merchant must  redirect the client to continue the process. All necessary parameters are presented in the address line or in the request parameters of the prepared URL.</td><td></td></tr><tr><td><code>action.details</code></td><td>object</td><td>O</td><td>Payment details to make payment in case '<code>actionRequired</code>' status and '<code>confirmPayment'</code> type.</td><td></td></tr></tbody></table>

#### Response Example:  Processing

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "amount": 10051,    
    "status": "pending"
}
```

#### Response Example:  Successful payment

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "amount": 10051,    
    "status": "authorized|preAuthorized"
}
```

#### Response Example: Payment rejected

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "amount": 10051,       
    "status": "rejected",
    "description": "invalidCardNumber"
}
```

#### Response Example: Redirection required

```json
{
  "id": "9073926b929f31c2abc9fad77ae3e8eb",
  "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
  "method": "cards",
  "amount": 10051,
  "status": "actionRequired",
  "action": {
    "type": "redirect",
    "url": "https://some.url?some&params"
  }
}
```

#### Response Example: Confirmation with a code required

```json
{
  "id": "9073926b929f31c2abc9fad77ae3e8eb",
  "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
  "method": "cards",
  "amount": 10051,
  "status": "actionRequired",
  "action": {
    "type": "confirmWithCode"
  }
}
```

#### Response Example: Confirmation of payment using the specified details required

```json
{
  "id": "9073926b929f31c2abc9fad77ae3e8eb",
  "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
  "method": "cards",
  "amount": 10051,
  "status": "actionRequired",
  "action": {
    "type": "confirmPayment",
    "details": {
      "accountName": "TRKS TECHNOLOGY PTY LTD",
      "accountNumber": "987654321",
      "bsbNumber": "370370"
    }
  }
}
```

#### Error types and codes

<table><thead><tr><th width="194">In case of</th><th width="73">Error</th><th width="193">Type</th><th width="102">Title</th><th>Comment</th></tr></thead><tbody><tr><td>The body of the incoming request is not a correct description of a JSON object according to JSON <a href="https://datatracker.ietf.org/doc/html/rfc8259">RFC 8259</a>.</td><td>400</td><td>malformedRequest</td><td>Your request body didn't validate.</td><td>Additionally, the element "invalid-params":[{"name":"body","reason":"bodyMalformedAtPosXXX"}] is filled in, XXX is the line number where the first syntax validation error of the request body occurred. For example, bodyMalformedAtPos27</td></tr><tr><td>The body of the incoming request represents a JSON object, but it does not meet the interface requirements</td><td>400</td><td>validationError</td><td>Your request body didn't validate.</td><td>Additionally, the element "invalid-params":[{"name":"name of the problematic field","reason":"reason"}] is filled in.</td></tr><tr><td>The requested payment method is not included in the list of those available for the merchant.</td><td>422</td><td>methodNotSupported</td><td>This payment method is not supported.</td><td></td></tr><tr><td>An attempt to create a payment session with an order identifier for which a session had already been registered earlier</td><td>422</td><td>duplicatedOrderId</td><td>Duplicated order id.</td><td></td></tr><tr><td>The operation amount specified is incorrect: the value passed is not a positive integer</td><td>422</td><td>invalidAmount</td><td>Invalid amount of the transaction.</td><td></td></tr><tr><td>The currency is not supported. In particular, the currency of the order is not among the list of currencies supported by the terminal</td><td>422</td><td>currencyNotSupported</td><td>This currency is not supported.</td><td></td></tr><tr><td>Session creation. The terminal does not support the two-phase payment execution scheme</td><td>422</td><td>twoPhasePaymentIsNotSupportedByTerminal</td><td>Two-phase payments aren't supported by a terminal.</td><td></td></tr><tr><td>Merchant terminal not found when creating a session. Incorrect terminal password provided when creating a session.</td><td>422</td><td>invalidTerminalCredentials</td><td>Invalid terminal key or password.</td><td></td></tr><tr><td>The use of the interface (gapi, mapi) is not allowed for the requested transaction direction (payment, payout)</td><td>422</td><td>interfaceNotAllowed</td><td>This interface is not allowed.</td><td></td></tr><tr><td>Unforeseen errors on the service side. Prior to the creation of the session.</td><td>500</td><td>unexpectedError</td><td>Unexpected error. Contact our support team.</td><td></td></tr></tbody></table>

#### Creating a recurring payment

Use these instructions to create a recurring payment that facilitates automated billing processes for repeat transactions. The [Merchant scheme](#payment-merchant-scheme) supports these operations using payment tokens.

{% hint style="info" %}
Unlike [recurring payments in the Gate scheme](#recurring-payment), in the [Merchant scheme](#payment-merchant-scheme), the same [`createPayment`](#create-payment) method is used for both generating a payment token and making subsequent payments with it.
{% endhint %}

Follow the instructions below to create a payment token and perform a subsequent (recurring) payment:

**Creating a payment token**

1. To generate a token, call the [Create payment](#create-payment) method with the `type` parameter set to `regular` and the `createPaymentToken` parameter set to `true`.
2. &#x20;This token is returned in the [status response](#get-payment-status) and through a notification callback as `paymentToken`.

**Making a recurring payment**

1. Once the payment token is obtained, call the [Create payment](#create-payment) method again, but this time with `type` set to `tokenized` and the `details.paymentToken` parameter included (where `details.type` should be `paymentToken`) to create a recurring payment.
2. Receive confirmation of the payment through the [status request](#get-payment-status) or [notification callback](#openapispecification-facade-datatypes).

### Get Payment Status

Use this method to request the current payment status through the MAPI interface.&#x20;

#### **Entry parameters:** <a href="#userregistration-entryparameters" id="userregistration-entryparameters"></a>

**Request URL:** `https://facade-api.main.gate-api.com/mapi/v2/payments/{paymentId}`

**Request method:** `GET`

**Request headers:**

<table><thead><tr><th width="261">Header</th><th width="74">R/O</th><th width="161">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>The original media type of the resource.</td></tr><tr><td><code>Cache-Control</code></td><td>R</td><td>no-cache</td><td>Mandates retrieving the response directly from the server, bypassing caches, to guarantee the latest status.</td></tr><tr><td><code>AuthorizationKey</code></td><td>R</td><td>-</td><td>Merchant terminal identifier.</td></tr><tr><td><code>AuthorizationPassword</code></td><td>R</td><td>-</td><td>Merchant terminal password.</td></tr></tbody></table>

**Path request parameters:**

<table><thead><tr><th>Parameter</th><th width="76">R/O</th><th width="78">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>paymentId</code></td><td>R</td><td>string</td><td>Unique payment identifier</td></tr></tbody></table>

#### Response parameters:

<table><thead><tr><th width="159">Parameter</th><th width="130">Type</th><th width="67">R/O</th><th width="223">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>id</code></td><td>string[100]</td><td>R</td><td>Payment ID (Payment session identifier)</td><td>9073926b929f31c2abc9fad77ae3e8eb</td></tr><tr><td><code>orderId</code></td><td>string[100]</td><td>R</td><td>Identifier of the order being paid in the merchant's system. Each payment (session) requires a unique identifier. Only printable ASCII characters are allowed.</td><td></td></tr><tr><td><code>method</code></td><td>string[100]</td><td>R</td><td>Payment method.</td><td>cards</td></tr><tr><td><code>status</code></td><td>string[100]</td><td>R</td><td>Payment status. </td><td>authorized</td></tr><tr><td><code>amount</code></td><td>int</td><td>O</td><td>Balance of the payment, taking into account all unblockings and refunds made. Presented in the payment currency, using the smallest unit of that currency.</td><td> <code>10051</code> (for an amounting to 100 dollars and 51 cents in USD)</td></tr><tr><td><code>redirectUrl</code></td><td>string[2000]</td><td>O</td><td>Filled for the status 'redirect'. Contains the address to which you need to go to continue the process. All necessary parameters are presented in the address line or in the request parameters of the prepared URL.</td><td></td></tr><tr><td><code>description</code></td><td>string</td><td>O</td><td>Comment on the status.</td><td></td></tr><tr><td><code>paymentToken</code></td><td>string</td><td>O</td><td>Token used for creating recurring payments.</td><td></td></tr><tr><td><code>action.type</code></td><td>string</td><td>O</td><td><p></p><p>The type of additional action expected from the merchant to continue the payment process. Filled if the status is '<code>actionRequired</code>'.<br>Possible values are:</p><ul><li>'<code>redirect</code>' - the merchant must  redirect the client to the page specified in <code>action.url</code> parameter.</li><li>'<code>confirmWithCode</code>' -  the merchant must provide a special confirmation code by calling Confirm method.</li><li><code>'confirmPayment'</code> - the merchant must offer the user to make a payment using the details specified in the <code>'action.details'</code> parameter and, after payment, call the <a href="#confirm-payment">Confirm Payment</a>  method.</li></ul></td><td></td></tr><tr><td><code>action.url</code></td><td>string</td><td>O</td><td>Filled for the status '<code>actionRequired</code>' and action.type '<code>redirect</code>'. Contains the address to which the merchant must redirect the client to continue the process. All necessary parameters are presented in the address line or in the request parameters of the prepared URL.</td><td></td></tr><tr><td><code>action.detail</code></td><td>string</td><td>O</td><td>Payment details to make payment in case '<code>actionRequired</code>' status and '<code>confirmPayment'</code> type.</td><td></td></tr></tbody></table>

#### Response Example:  Processing

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "amount": 10051,    
    "status": "pending"
}
```

#### Response Example:  Successful payment

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "amount": 10051,         
    "status": "authorized|preAuthorized"
 }
```

#### Response Example: Payment rejected

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "amount": 10051,         
    "status": "rejected",
    "description": "invalidCardNumber"
 }
```

#### Response Example: Redirection required

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "amount": 10051,       
    "status": "actionRequired",
    "action": {
        "type": "redirect",
        "url": "https://some.url?some&params"
    }
}
```

#### Response Example: Confirmation with a code required

```json
{
  "id": "9073926b929f31c2abc9fad77ae3e8eb",
  "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
  "method": "cards",
  "amount": 10051,
  "status": "actionRequired",
  "action": {
    "type": "confirmWithCode"
  }
}
```

#### Response Example: Confirmation of payment using the specified details required

```json
{
  "id": "9073926b929f31c2abc9fad77ae3e8eb",
  "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
  "method": "cards",
  "amount": 10051,
  "status": "actionRequired",
  "action": {
    "type": "confirmPayment",
    "details": {
      "accountName": "TRKS TECHNOLOGY PTY LTD",
      "accountNumber": "987654321",
      "bsbNumber": "370370"
    }
  }
}
```

#### Error types and codes

<table><thead><tr><th width="253">In case of</th><th width="77">Error</th><th width="200">Type</th><th width="220">Title</th></tr></thead><tbody><tr><td>No payment found with the specified ID.</td><td>404</td><td>paymentNotFound</td><td>There is no payment with the specified id.</td></tr><tr><td>The use of the interface (gapi, mapi) is not allowed for the requested transaction direction (payment, payout)</td><td>422</td><td>interfaceNotAllowed</td><td>This interface is not allowed.</td></tr><tr><td>Unforeseen errors on the service side. Prior to the creation of the session.</td><td>500</td><td>unexpectedError</td><td>Unexpected error. Contact our support team.</td></tr><tr><td>Temporary error: You might be able to do the operation successfully if you try again later.</td><td>503</td><td>temporaryMalfunction</td><td>Temporary malfunction. Please try again later.</td></tr></tbody></table>

### Confirm Payment

Use this method to confirm that an action previously requested by the `'actionRequired'` status has been completed.&#x20;

#### **Entry parameters:** <a href="#userregistration-entryparameters" id="userregistration-entryparameters"></a>

**Request URL:** `https://facade-api.main.gate-api.com/mapi/v2/payments/{paymentId}/confirm`

**Request method:** `POST`

**Request headers:**

<table><thead><tr><th width="261">Header</th><th width="74">R/O</th><th width="161">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>The original media type of the resource.</td></tr><tr><td><code>Cache-Control</code></td><td>R</td><td>no-cache</td><td>Mandates retrieving the response directly from the server, bypassing caches, to guarantee the latest status.</td></tr><tr><td><code>AuthorizationKey</code></td><td>R</td><td>-</td><td>Merchant terminal identifier.</td></tr><tr><td><code>AuthorizationPassword</code></td><td>R</td><td>-</td><td>Merchant terminal password.</td></tr></tbody></table>

**Path request parameters:**

<table><thead><tr><th>Parameter</th><th width="76">R/O</th><th width="114">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>paymentId</code></td><td>R</td><td>string</td><td>Unique payment identifier.</td></tr></tbody></table>

**Body request parameters:**

<table><thead><tr><th width="209.5555419921875">Parameter</th><th width="75.33331298828125">Type</th><th width="59.11114501953125">R/ O</th><th width="201.55560302734375">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>confirmationData.code</code></td><td>string</td><td>O</td><td>Confirmation code. The parameter is required if this call is made in response to receiving '<code>actionRequired</code>' status with type '<code>confirmWithCode</code>'.<br>Otherwise, no parameters are expected in the request body.</td><td>13256</td></tr><tr><td>confirmationFileIds</td><td>array</td><td>O</td><td>An array containing identifiers of previously uploaded receipt files (via <a data-mention href="#upload-files-with-payment-confirmation">#upload-files-with-payment-confirmation</a>)</td><td>[<br>"090919a9-67fb-4f5d-bdc9-ebcdef52c066", "138b4fca-0123-47bf-a296-75bbbf507e5b"<br>]</td></tr></tbody></table>

#### Request example - confirmation code provided:

```json
Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json

{
  "confirmationData": {
    "code": "123456"
  }
}
```

#### Request example - confirmation file provided:

```json
Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json
{
    "confirmationFileIds": [
        "1b05b1f3-18b9-4f70-b7ef-0b3c4539ea9c",
        "138b4fca-0123-47bf-a296-75bbbf507e5b"
    ]
}
```

#### Response parameters:

Completely identical to the response parameters of the [Get Payment Status](#get-payment-status) method

#### Response Example:  Successful payment

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "amount": 10051,         
    "status": "authorized|preAuthorized|pending"
 }
```

#### Response Example: Payment rejected

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "amount": 10051,         
    "status": "rejected",
    "description": "invalidCardNumber"
 }
```

#### Error types and codes

<table><thead><tr><th width="253">In case of</th><th width="77">Error</th><th width="200">Type</th><th width="220">Title</th></tr></thead><tbody><tr><td>No payment found with the specified ID.</td><td>404</td><td>paymentNotFound</td><td>There is no payment with the specified id.</td></tr><tr><td>The use of the interface (gapi, mapi) is not allowed for the requested transaction direction (payment, payout)</td><td>422</td><td>interfaceNotAllowed</td><td>This interface is not allowed.</td></tr><tr><td>The payment is not awaiting confirmation in its current state</td><td>422</td><td>invalidPaymentState</td><td>The payment is in an invalid state.</td></tr><tr><td>Unforeseen errors on the service side. Prior to the creation of the session.</td><td>500</td><td>unexpectedError</td><td>Unexpected error. Contact our support team.</td></tr><tr><td>Temporary error: You might be able to do the operation successfully if you try again later.</td><td>503</td><td>temporaryMalfunction</td><td>Temporary malfunction. Please try again later.</td></tr></tbody></table>

### Reverse Funds

Use this method to adjust the amount of funds that have been blocked but not yet charged in the MAPI interface.

{% hint style="warning" %}
This method is implemented for the two-phase payment scheme, for payments in the `PreAuthorized` state, and is only available for the `cards` payment method.
{% endhint %}

#### **Entry parameters:** <a href="#userregistration-entryparameters" id="userregistration-entryparameters"></a>

**Request URL:** `https://facade-api.main.gate-api.com/mapi/v2/payments/{paymentId}/reverse`

**Request method:** `POST`

**Request headers:**

<table><thead><tr><th width="261">Header</th><th width="74">R/O</th><th width="161">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>The original media type of the resource.</td></tr><tr><td><code>Cache-Control</code></td><td>R</td><td>no-cache</td><td>Mandates retrieving the response directly from the server, bypassing caches, to guarantee the latest status.</td></tr><tr><td><code>AuthorizationKey</code></td><td>R</td><td>-</td><td>Merchant terminal identifier.</td></tr><tr><td><code>AuthorizationPassword</code></td><td>R</td><td>-</td><td>Merchant terminal password.</td></tr></tbody></table>

**Path request parameters:**

<table><thead><tr><th width="152">Parameter</th><th width="76">R/O</th><th width="95">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>paymentId</code></td><td>R</td><td>string</td><td>Unique payment identifier</td></tr></tbody></table>

#### Request body parameters:

<table><thead><tr><th width="159">Parameter</th><th width="84">Type</th><th width="72">R/ O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>amount</code></td><td>long</td><td>R</td><td>Amount to be reversed in the smallest units of the order's currency.</td><td>13256</td></tr></tbody></table>

#### Request example:

<pre class="language-json"><code class="lang-json">Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json
<strong>
</strong><strong>{
</strong>    "amount": 1112
}
</code></pre>

#### Response parameters:

<table><thead><tr><th width="128">Parameter</th><th width="131">Type</th><th width="71">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>id</code></td><td>string[100]</td><td>R</td><td>Payment ID (payment session identifier).</td><td>9073926b929f31c2abc9fad77ae3e8eb</td></tr><tr><td><code>orderId</code></td><td>string[100]</td><td>R</td><td>Identifier of the order being paid in the merchant's system.</td><td>string[100]</td></tr><tr><td><code>method</code></td><td>string[100]</td><td>R</td><td>Payment method.</td><td>cards</td></tr><tr><td><code>amount</code></td><td>int</td><td>O</td><td>Balance of the payment, taking into account all unblockings and refunds made. Presented in the payment currency, using the smallest unit of that currency.</td><td> <code>10051</code> (for an amounting to 100 dollars and 51 cents in USD)</td></tr><tr><td><code>status</code></td><td>string[100]</td><td>R</td><td>Payment session status.</td><td>preAuthorized</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

#### Response example:

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "amount": 0,       
    "status": "cancelled"
}
```

#### Error types and codes

<table><thead><tr><th width="186">In case of</th><th width="73">Error</th><th width="172">Type</th><th width="139">Title</th><th>Comment</th></tr></thead><tbody><tr><td>The body of the incoming request is not a correct description of a JSON object according to JSON <a href="https://datatracker.ietf.org/doc/html/rfc8259">RFC 8259</a>.</td><td>400</td><td>malformedRequest</td><td>Your request body didn't validate.</td><td>Additionally, the element "invalid-params":[{"name":"body","reason":"bodyMalformedAtPosXXX"}] is filled in, XXX is the line number where the first syntax validation error of the request body occurred. For example, bodyMalformedAtPos27</td></tr><tr><td>The body of the incoming request represents a JSON object, but it does not meet the interface requirements</td><td>400</td><td>validationError</td><td>Your request body didn't validate.</td><td>Additionally, the element "invalid-params":[{"name":"name of the problematic field","reason":"reason"}] is filled in.</td></tr><tr><td>No payment found with the specified ID.</td><td>404</td><td>paymentNotFound</td><td>There is no payment with the specified id.</td><td></td></tr><tr><td>Unsupported operation for the specified payment method.</td><td>422</td><td>invalidOperation</td><td>The operation is not supported for payment method {attempt.method}.</td><td></td></tr><tr><td>Merchant terminal not found when creating a session. Incorrect terminal password provided when creating a session.</td><td>422</td><td>invalidTerminalCredentials</td><td>Invalid terminal key or password.</td><td></td></tr><tr><td>The operation amount specified is incorrect: the value passed is not a positive integer</td><td>422</td><td>invalidAmount</td><td>Invalid amount of the transaction.</td><td></td></tr><tr><td>The use of the interface (gapi, mapi) is not allowed for the requested transaction direction (payment, payout)</td><td>422</td><td>interfaceNotAllowed</td><td>This interface is not allowed.</td><td></td></tr><tr><td>For the twoPhaseReverse operation - Cards API returned PARTIAL_RETRIEVE_NOT_ALLOWED</td><td>422</td><td>partialRetrieveNotAllowed</td><td>Authorization amount cannot be changed.</td><td></td></tr><tr><td>For the twoPhaseReverse operation - Cards API returned EXPIRED_RETRIEVE_PERIOD</td><td>422</td><td>expiredRetrievePeriod</td><td>Expired period of changing the amount of frozen funds.</td><td></td></tr><tr><td>Inappropriate payment state for the operation: For the refund operation, payment must be in Authorized state; </td><td>422</td><td>invalidPaymentState</td><td>The payment is in an invalid state.</td><td></td></tr><tr><td>Operation not permitted in a non-two-step payment process.</td><td>422</td><td>transactionNotTwoStep</td><td>Unable to perform the operation within the non two-step payment.</td><td></td></tr><tr><td>Unforeseen errors on the service side. Prior to the creation of the session.</td><td>500</td><td>unexpectedError</td><td>Unexpected error. Contact our support team.</td><td></td></tr><tr><td>Temporary error: You might be able to do the operation successfully if you try again later.</td><td>503</td><td>temporaryMalfunction</td><td>Temporary malfunction. Please try again later.</td><td></td></tr></tbody></table>

### Complete Payment

Use this method to confirm the debiting of the blocked funds in the MAPI interface.

{% hint style="warning" %}
This method is implemented for the two-phase payment scheme, for payments in the `PreAuthorized` state, and is only available for the `cards` payment method.
{% endhint %}

#### **Entry parameters:** <a href="#userregistration-entryparameters" id="userregistration-entryparameters"></a>

**Request URL:** `https://facade-api.main.gate-api.com/mapi/v2/payments/{paymentId}/complete`

**Request method:** `POST`

**Request headers:**

<table><thead><tr><th width="261">Header</th><th width="74">R/O</th><th width="161">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>The original media type of the resource.</td></tr><tr><td><code>Cache-Control</code></td><td>R</td><td>no-cache</td><td>Mandates retrieving the response directly from the server, bypassing caches, to guarantee the latest status.</td></tr><tr><td><code>AuthorizationKey</code></td><td>R</td><td>-</td><td>Merchant terminal identifier.</td></tr><tr><td><code>AuthorizationPassword</code></td><td>R</td><td>-</td><td>Merchant terminal password.</td></tr></tbody></table>

**Path request parameters:**

<table><thead><tr><th width="152">Parameter</th><th width="76">R/O</th><th width="95">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>paymentId</code></td><td>R</td><td>string</td><td>Unique payment identifier</td></tr></tbody></table>

#### Body request parameters:

<table><thead><tr><th width="159">Parameter</th><th width="84">Type</th><th width="72">R/ O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>amount</code></td><td>long</td><td>R</td><td>Amount to be reversed in the smallest units of the order's currency.</td><td>13256</td></tr></tbody></table>

#### Request example:

<pre class="language-json"><code class="lang-json">Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json
<strong>
</strong><strong>{
</strong>    "amount": 1112
}
</code></pre>

#### Response parameters:

<table><thead><tr><th width="134">Parameter</th><th width="133">Type</th><th width="66">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>id</code></td><td>string[100]</td><td>R</td><td>Payment ID (payment session identifier).</td><td>9073926b929f31c2abc9fad77ae3e8eb</td></tr><tr><td><code>orderId</code></td><td>string[100]</td><td>R</td><td>Identifier of the order being paid in the merchant's system. Each payment requires a unique identifier.</td><td>string[100]</td></tr><tr><td><code>method</code></td><td>string[100]</td><td>R</td><td>Payment method.</td><td>cards</td></tr><tr><td><code>amount</code></td><td>int</td><td>O</td><td>Balance of the payment, taking into account all unblockings and refunds made. Presented in the payment currency, using the smallest unit of that currency.</td><td><code>10051</code> (for an amounting to 100 dollars and 51 cents in USD.</td></tr><tr><td><code>status</code></td><td>string[100]</td><td>R</td><td>Payment status.</td><td>authorized</td></tr></tbody></table>

#### Response example:

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "amount": 10051,
    "status": "authorized"
}
```

#### Error types and codes

<table><thead><tr><th width="194">In case of</th><th width="73">Error</th><th width="193">Type</th><th width="102">Title</th><th>Comment</th></tr></thead><tbody><tr><td>The body of the incoming request is not a correct description of a JSON object according to JSON <a href="https://datatracker.ietf.org/doc/html/rfc8259">RFC 8259</a>.</td><td>400</td><td>malformedRequest</td><td>Your request body didn't validate.</td><td>Additionally, the element "invalid-params":[{"name":"body","reason":"bodyMalformedAtPosXXX"}] is filled in, XXX is the line number where the first syntax validation error of the request body occurred. For example, bodyMalformedAtPos27</td></tr><tr><td>The body of the incoming request represents a JSON object, but it does not meet the interface requirements</td><td>400</td><td>validationError</td><td>Your request body didn't validate.</td><td>Additionally, the element "invalid-params":[{"name":"name of the problematic field","reason":"reason"}] is filled in.</td></tr><tr><td>No payment found with the specified ID.</td><td>404</td><td>paymentNotFound</td><td>There is no payment with the specified id.</td><td></td></tr><tr><td>Merchant terminal not found when creating a session. Incorrect terminal password provided when creating a session.</td><td>422</td><td>invalidTerminalCredentials</td><td>Invalid terminal key or password.</td><td></td></tr><tr><td>The operation amount specified is incorrect: the value passed is not a positive integer</td><td>422</td><td>invalidAmount</td><td>Invalid amount of the transaction.</td><td></td></tr><tr><td>The use of the interface (gapi, mapi) is not allowed for the requested transaction direction (payment, payout)</td><td>422</td><td>interfaceNotAllowed</td><td>This interface is not allowed.</td><td></td></tr><tr><td>Inappropriate payment state for the operation: For the refund operation, payment must be in Authorized state; </td><td>422</td><td>invalidPaymentState</td><td>The payment is in an invalid state.</td><td></td></tr><tr><td>For the twoPhaseComplete operation: Cards API returned an error PARTIAL_CHARGE_NOT_ALLOWED</td><td>422</td><td>partialChargeNotAllowed</td><td>Partial charge is not supported.</td><td></td></tr><tr><td>Unsupported operation for the specified payment method.</td><td>422</td><td>invalidOperation </td><td>The operation is not supported for payment method {attempt.method}.</td><td></td></tr><tr><td>Operation not permitted in a non-two-step payment process.</td><td>422</td><td>transactionNotTwoStep</td><td>Unable to perform the operation within the non two-step payment.</td><td></td></tr><tr><td>Unforeseen errors on the service side. Prior to the creation of the session.</td><td>500</td><td>unexpectedError</td><td>Unexpected error. Contact our support team.</td><td></td></tr><tr><td>Temporary error: You might be able to do the operation successfully if you try again later.</td><td>503</td><td>temporaryMalfunction</td><td>Temporary malfunction. Please try again later.</td><td></td></tr></tbody></table>

### Refund Payment

Use this method to refund charged funds via the MAPI interface for payments that are in the "Authorized" state.

#### **Entry parameters:** <a href="#userregistration-entryparameters" id="userregistration-entryparameters"></a>

**Request URL:** `https://facade-api.main.gate-api.com/mapi/v2/payments/{paymentId}/refund`

**Request method:** `POST`

**Request headers:**

<table><thead><tr><th width="261">Header</th><th width="74">R/O</th><th width="161">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>The original media type of the resource.</td></tr><tr><td><code>Cache-Control</code></td><td>R</td><td>no-cache</td><td>Mandates retrieving the response directly from the server, bypassing caches, to guarantee the latest status.</td></tr><tr><td><code>AuthorizationKey</code></td><td>R</td><td>-</td><td>Merchant terminal identifier.</td></tr><tr><td><code>AuthorizationPassword</code></td><td>R</td><td>-</td><td>Merchant terminal password.</td></tr></tbody></table>

**Path request parameters:**

<table><thead><tr><th width="152">Parameter</th><th width="76">R/O</th><th width="95">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>paymentId</code></td><td>R</td><td>string</td><td>Unique payment identifier</td></tr></tbody></table>

#### Body request parameters:

<table><thead><tr><th width="159">Parameter</th><th width="84">Type</th><th width="72">R/ O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>amount</code></td><td>long</td><td>R</td><td>Amount to be reversed in the smallest units of the order's currency.</td><td>13256</td></tr></tbody></table>

#### Request example:

<pre class="language-json"><code class="lang-json"><strong>Authorization-Key: *****
</strong>Authorization-Password: *****
Content-Type: application/json

{
    "amount": 1112
}
</code></pre>

#### Response parameters:

<table><thead><tr><th width="136">Parameter</th><th width="120">Type</th><th width="73">R/O</th><th width="238">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>id</code></td><td>string[100]</td><td>R</td><td>Payment ID (payment session identifier).</td><td>9073926b929f31c2abc9fad77ae3e8eb</td></tr><tr><td><code>orderId</code></td><td>string[100]</td><td>R</td><td>Identifier of the order being paid in the merchant's system. Each payment requires a unique identifier.</td><td>string[100]</td></tr><tr><td><code>method</code></td><td>string[100]</td><td>R</td><td>Payment method.</td><td>cards</td></tr><tr><td><code>amount</code></td><td>int</td><td>R</td><td>Balance of the payment, taking into account all unblockings and refunds made. Presented in the payment currency, using the smallest unit of that currency.</td><td><strong>Example:</strong> <code>10051</code> (for an amounting to 100 dollars and 51 cents in USD)</td></tr><tr><td><code>status</code></td><td>string[100]</td><td>R</td><td>Payment status.</td><td>refunded</td></tr></tbody></table>

#### Response example:

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "amount": 0,
    "status": "refunded"
}
```

#### Error types and codes

<table><thead><tr><th width="194">In case of</th><th width="73">Error</th><th width="193">Type</th><th width="137">Title</th><th width="161">Comment</th></tr></thead><tbody><tr><td>The body of the incoming request is not a correct description of a JSON object according to JSON <a href="https://datatracker.ietf.org/doc/html/rfc8259">RFC 8259</a>.</td><td>400</td><td>malformedRequest</td><td>Your request body didn't validate.</td><td>Additionally, the element "invalid-params":[{"name":"body","reason":"bodyMalformedAtPosXXX"}] is filled in, XXX is the line number where the first syntax validation error of the request body occurred. For example, bodyMalformedAtPos27</td></tr><tr><td>The body of the incoming request represents a JSON object, but it does not meet the interface requirements</td><td>400</td><td>validationError</td><td>Your request body didn't validate.</td><td>Additionally, the element "invalid-params":[{"name":"name of the problematic field","reason":"reason"}] is filled in.</td></tr><tr><td>No payment found with the specified ID.</td><td>404</td><td>paymentNotFound</td><td>There is no payment with the specified id.</td><td></td></tr><tr><td>Merchant terminal not found when creating a session. Incorrect terminal password provided when creating a session.</td><td>422</td><td>invalidTerminalCredentials</td><td>Invalid terminal key or password.</td><td></td></tr><tr><td>The operation amount specified is incorrect: the value passed is not a positive integer</td><td>422</td><td>invalidAmount</td><td>Invalid amount of the transaction.</td><td></td></tr><tr><td>The use of the interface (gapi, mapi) is not allowed for the requested transaction direction (payment, payout)</td><td>422</td><td>interfaceNotAllowed</td><td>This interface is not allowed.</td><td></td></tr><tr><td>Merchant's balance is insufficient to complete the refund. </td><td>422</td><td>insufficientMerchantFundsToCompleteRefund</td><td>The refund was created. There are not enough funds on the merchant's balance to complete the refund.</td><td></td></tr><tr><td>Inappropriate payment state for the operation: For the refund operation, payment must be in Authorized state; </td><td>422</td><td>invalidPaymentState</td><td>The payment is in an invalid state.</td><td></td></tr><tr><td>For the Refund operation: Cards API returned an error MULTIPLE_REFUND_NOT_SUPPORTED</td><td>422</td><td>multipleRefundNotSupported</td><td>Subsequent refunds are not supported in automatic mode. Contact our support team.</td><td></td></tr><tr><td>For the Refund operation: Cards API returned an error PARTIAL_REFUND_NOT_ALLOWED</td><td>422</td><td>partialRefundNotAllowed</td><td>Cannot refund a part of the previously charged amount.</td><td></td></tr><tr><td>Unforeseen errors on the service side. Prior to the creation of the session.</td><td>500</td><td>unexpectedError</td><td>Unexpected error. Contact our support team.</td><td></td></tr><tr><td>Temporary error: You might be able to do the operation successfully if you try again later.</td><td>503</td><td>temporaryMalfunction</td><td>Temporary malfunction. Please try again later.</td><td></td></tr></tbody></table>

### Retrieve Payment Method Details

Use this method to view the details you need to include in the [Create Payment > *details* object](#create-payment) to make a payment with a specific payment method.

The response contains the *details.parameterIsNestedInEntity* parameter that you can use to retrieve all the instances related to the payment method and entity via the [Retrieve Payment Method Entities](#retrieve-payment-method-entities) request. For example:

1. Let's say you sent the [Retrieve Payment Method Details](#retrieve-payment-method-details) request to view the required details for the *openbaking* method: GET mapi/v2/payments/methods/openbanking/details&#x20;
2. The response contains the *bankId* parameter and its *details.parameterIsNestedInEntity* is *banks.*
3. Using the details you've got in the response to the first request, you can retrieve all the instances related to the payment method (for example, *openbanking*), entity (for example, *banks*), and, if needed, a country (for example, *Sweden*) via the [Retrieve Payment Method Entities](#retrieve-payment-method-entities) request: GET /mapi/v2/payments/methods/openbanking/entities /banks?countries=SE
4. The response contains a list of instances related to specified parameters. In our example, it could be a list of banks with their details (the bank ID, the branch name, the branch country, etc.) as key-value pairs.&#x20;

<figure><img src="https://2451738236-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwv5zUAmwbZ5Cg8D3fNoB%2Fuploads%2FgkDc606GPGjlqKr2FgAj%2FSeqDiagram.svg?alt=media&#x26;token=e1629c74-e80d-44dd-95d2-da2c72907c63" alt=""><figcaption><p>Retrieving payment method details and possible entities</p></figcaption></figure>

{% hint style="info" %}
Currently, this API method works for the *openbanking* payment method only.
{% endhint %}

**Entry parameters:**

**Request URL:** `https://facade-api.main.gate-api.com/mapi/v2/payments/methods/{method}/details`

**Request method:** `GET`

**Request headers:**

<table><thead><tr><th width="236">Header</th><th width="86">R/O</th><th width="116">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>Original media type of the resource.</td></tr><tr><td><code>SessionTerminalKey</code></td><td>R</td><td> </td><td>Merchant terminal identifier.</td></tr><tr><td><code>SessionTerminalPassword</code></td><td>R</td><td> </td><td>Merchant terminal password.</td></tr></tbody></table>

#### Path request parameters:

<table><thead><tr><th width="150">Parameter</th><th width="81">Type</th><th width="85">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>method</code></td><td>string</td><td>R</td><td><a href="#openapispecification-facade-paymentmethods">Payment method</a>.<br>Currently, this API method works for the <em>openbanking</em> payment method only.</td><td>"openbanking"</td></tr></tbody></table>

#### Response parameters:

<table><thead><tr><th width="159">Parameter</th><th width="84">Type</th><th width="72">R/ O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>details</code></td><td>array</td><td>R</td><td>List of the parameters required for the specified payment method.</td><td></td></tr><tr><td><code>details.name</code></td><td>string</td><td>R</td><td>Parameter name.</td><td>"bankId"</td></tr><tr><td><code>details.valueIsRequestableFromApi</code></td><td>boolean</td><td>R</td><td>It states whether the parameter is retrievable via API or not.<br>In other words, if it's <em>true</em>, you can retrieve the parameter via the <a href="#retrieve-payment-method-entities">Retrieve Payment Method Entities</a> request.</td><td>true</td></tr><tr><td><code>details.parameterIsNestedInEntity</code></td><td>string</td><td>O</td><td>It states from which entity the parameter is nested. By using this entity name, you can retrieve all the instances related to the payment method and the entity via the <a href="#retrieve-payment-method-entities">Retrieve Payment Method Entities</a> request.</td><td>"banks"</td></tr></tbody></table>

#### Response example:

```json
"details":[
   {
      "name":"bankId",
      "valueIsRequestableFromApi":true,
      "parameterIsNestedInEntity":"banks"
   }
]
```

#### Error types and codes

| In case of                                     | Error | Type                       | Title              |
| ---------------------------------------------- | ----- | -------------------------- | ------------------ |
| Invalid terminal key or password.              | 404   | invalidTerminalCredentials | Invalid Terminal   |
| The specified payment method is not supported. | 422   | methodNotSupported         | Unsupported Method |

### Retrieve Payment Method Entities

Use this method to retrieve all the instances related to a specific payment method and entity. To get the entity name, check the *details.parameterIsNestedInEntity* parameter in the response for the [Retrieve Payment Method Details](#retrieve-payment-method-details) request.

The retrieved instances may include, for example, a list of banks with their details, such as a bank ID, a branch name, a branch country, etc.&#x20;

{% hint style="info" %}
Currently, the API method works for the *openbanking* payment method only.
{% endhint %}

**Entry parameters:**

**Request URL:** `https://facade-api.main.gate-api.com/mapi/v2/payments/methods/{method}/entities/{entity}?countries={alpha2code},{alpha2code}`

**Request method:** `GET`

**Request headers:**

<table><thead><tr><th width="236">Header</th><th width="86">R/O</th><th width="116">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>Original media type of the resource.</td></tr><tr><td><code>SessionTerminalKey</code></td><td>R</td><td> </td><td>Merchant terminal identifier.</td></tr><tr><td><code>SessionTerminalPassword</code></td><td>R</td><td> </td><td>Merchant terminal password.</td></tr></tbody></table>

#### Path request parameters:

<table><thead><tr><th width="150">Parameter</th><th width="81">Type</th><th width="85">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>method</code></td><td>string</td><td>R</td><td><a href="#openapispecification-facade-paymentmethods">Payment method</a>.<br><strong>Note:</strong> Currently, the API method works for the <em>openbanking</em> payment method only.</td><td>"openbanking"</td></tr><tr><td><code>entity</code></td><td>string</td><td>R</td><td>To get the parameter, check the <em>details.parameterIsNestedInEntity</em> parameter in the response to the <a href="#retrieve-payment-method-details">Retrieve Payment Method Details</a> request.</td><td>"banks"</td></tr></tbody></table>

#### Query request parameters:

<table><thead><tr><th width="150">Parameter</th><th width="81">Type</th><th width="85">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>countries</code></td><td>array</td><td>R</td><td>List of countries in the ISO <a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">3166-1 alpha-2</a> format.</td><td>AU, SE</td></tr></tbody></table>

#### Response parameters:

<table><thead><tr><th width="159">Parameter</th><th width="84">Type</th><th width="72">R/ O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>entity</code></td><td>array</td><td>R</td><td>List of instances for the specified payment method and entity.</td><td></td></tr><tr><td><code>entity.key</code></td><td>string</td><td>R</td><td>Instance identifier.</td><td>"branchName"</td></tr><tr><td><code>entity.value</code></td><td>string</td><td>R</td><td>Value within the instance.</td><td>"Swedbank"</td></tr></tbody></table>

#### Response example

```json
[
  {
    "key": "bankId",
    "value": "6daf14a5-d8c0-43ac-881e-33621d198414"
  },
  {
    "key": "branchName",
    "value": "Swedbank"
  }
]
```

#### Error types and codes

| In case of                                                                   | Error | Type                                                                  | Title              |
| ---------------------------------------------------------------------------- | ----- | --------------------------------------------------------------------- | ------------------ |
| Invalid terminal key or password.                                            | 404   | invalidTerminalCredentials                                            | Invalid Terminal   |
| The specified payment method is not supported.                               | 422   | methodNotSupported                                                    | Unsupported Method |
| The entity is not supported either by the API method or by a payment method. | 422   | <p>entityNotSupportedByEndpoint<br><br>entityNotSupportedByMethod</p> | Unsupported Entity |

### Upload files with payment confirmation

This method allows uploading up to three payment-related files to internal storage for later use in payment confirmation. Each uploaded file must have its purpose specified. These files are essential for verifying and confirming the payment during processing.

{% hint style="info" %}
Please note that the success response will return a JSON array of objects.
{% endhint %}

**Entry parameters:**

**Request URL:**  `/mapi/v2/payments/{paymentID}/files/upload`

**Request method:** `POST`

#### **Request headers:**

<table><thead><tr><th width="261">Header</th><th width="74">R/O</th><th width="161">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>multipart/form-data</td><td>The original media type of the resource.</td></tr><tr><td><code>AuthorizationKey</code></td><td>R</td><td>-</td><td>Merchant terminal identifier.</td></tr><tr><td><code>AuthorizationPassword</code></td><td>R</td><td>-</td><td>Merchant terminal password.</td></tr></tbody></table>

Path parameters:

| Parameter   | Type | R/O    | Description                |
| ----------- | ---- | ------ | -------------------------- |
| `paymentId` | R    | string | Unique payment identifier. |

#### Parameters in form dat&#x61;**:**

| Parameter | Type       | R/O | Description                   |
| --------- | ---------- | --- | ----------------------------- |
| files     | files      | R   | Uploaded files                |
| purpose   | text/plain | R   | Purpose of the uploaded files |

#### Response Parameters

**HTTP response code:** 200

**Response type:** application/json

The response will return a JSON array of objects with the following parameters:

<table><thead><tr><th width="130.111083984375">Parameter</th><th width="114">Type</th><th width="65.4444580078125">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>R</td><td>Identifier of the uploaded file for further use in the payment process</td><td>236e2d3b-2380-473c-bc5d-646b504cf614</td></tr><tr><td>fileName</td><td>string</td><td>R</td><td>Name of the uploaded file associated with this identifier</td><td>receipt.jpg</td></tr></tbody></table>

#### Response example

```
[
  {
    "fileName": "receipt.jpg",
    "id": "78704fde-b19b-4cfa-a849-3a05aec7f2aa"
  },
  {
    "fileName": "confirmation.pdf",
    "id": "236e2d3b-2380-473c-bc5d-646b504cf614"
  }
]
```

## MAPI Payout methods <a href="#openapispecification-facade-api-methods" id="openapispecification-facade-api-methods"></a>

This section explains the main API methods utilized in the Payler [**Payout Merchant scheme**](#payout-merchant-scheme) (**MAPI**). It includes detailed descriptions and protocols for creating a payout, checking payout status.

### Create Payout

Use this method to initiate a payout creation request through the MAPI interface.

**Entry parameters:**

**Request URL:** `https://facade-api.main.gate-api.com/mapi/payout/v1/​payouts`

**Request method:** `POST`

#### **Request headers:**

<table><thead><tr><th width="261">Header</th><th width="74">R/O</th><th width="161">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>The original media type of the resource.</td></tr><tr><td><code>AuthorizationKey</code></td><td>R</td><td>-</td><td>Merchant terminal identifier.</td></tr><tr><td><code>AuthorizationPassword</code></td><td>R</td><td>-</td><td>Merchant terminal password.</td></tr></tbody></table>

#### **Body request parameters:**

<table><thead><tr><th width="244">Parameter</th><th>Type</th><th width="71">R/O</th><th>Description</th></tr></thead><tbody><tr><td><code>order</code></td><td>object</td><td>R</td><td>Order parameters</td></tr><tr><td><code>order.id</code></td><td>string[100]</td><td>R</td><td>Unique identifier for the order within the merchant's system. Each payout (session) requires a distinct identifier. Only printable ASCII characters are allowed.</td></tr><tr><td><code>order.currency</code></td><td>string[3]</td><td>R</td><td>Currency of the payout in the ISO-4217 format.</td></tr><tr><td><code>order.amount</code></td><td>long</td><td>R</td><td>Order amount in the smallest unit of the currency. For example, if the payout is in EUR, the amount of <em>10050</em> means 100 EUR and 50 cents.</td></tr><tr><td><code>order.description</code></td><td>string[256]</td><td>O</td><td>Description of the order.</td></tr><tr><td><code>method</code></td><td>string</td><td>R</td><td><a href="#payout-methods">Payout method</a>.</td></tr><tr><td><code>details</code></td><td>object</td><td>R</td><td><p>Parameters depend on the selected payout method:</p><ul><li><a href="#payout-details-for-the-cards-method">cards</a></li><li><a href="#payout-details-for-the-banktransfer-method">banktransfer</a></li><li><a href="#payout-details-for-the-communitybank-method">communitybank</a></li><li><a href="#payout-details-for-the-interac-method">interac</a></li><li><a href="#payout-details-for-the-netbanking-method">netbankning</a></li><li><a href="#payout-details-for-the-payster-method">payster</a></li><li><a href="#payout-details-for-the-payid-method">payid</a></li><li><a href="#payout-details-for-the-payfix-method">payfix</a></li><li><a href="#payout-details-for-the-pcr-method">pcr</a></li><li><a href="#payout-details-for-the-sepainstant-method">sepainstant</a></li><li><a href="#payout-details-for-the-mercadopago-method">mercadopago</a></li><li><a href="#payout-details-for-the-lemoncash-method">lemonacash</a></li><li><a href="#payout-details-for-the-orangecash-method">orangecash</a></li><li><a href="#payout-details-for-the-vodafonecash-method">vodafonecash</a></li><li><a href="#payout-details-for-the-instapay-method">instapay</a></li></ul></td></tr><tr><td><code>customer</code></td><td>object</td><td>R</td><td>Customer's parameters.<br><em><mark style="background-color:yellow;"><strong>If customer's data (including email) is not real, payout will be rejected by antifraud system</strong></mark></em></td></tr><tr><td><code>customer.id</code></td><td>string</td><td>O</td><td>Customer's identifier.</td></tr><tr><td><code>customer.email</code></td><td>string</td><td>R</td><td>Customer's email address.</td></tr><tr><td><code>customer.phoneNumber</code></td><td>string</td><td>R</td><td>Customer's phone number must adhere to the <a href="https://www.itu.int/rec/T-REC-E.123/en">ITU-T E.123</a> and <a href="https://www.itu.int/rec/T-REC-E.164/en">ITU-T E.164</a> standards.</td></tr><tr><td><code>customer.firstName</code></td><td>string</td><td>R</td><td>Customer's first name.</td></tr><tr><td><code>customer.lastName</code></td><td>string</td><td>R</td><td>Customer's last name.</td></tr><tr><td><code>customer.address</code></td><td>object</td><td>O*</td><td>Customer's address.<br>*Required for these methods: <code>netbanking</code>, <code>interac</code></td></tr><tr><td><code>customer.address.addresLine</code></td><td>string[100]</td><td>O*</td><td>Customer's address.<br><strong>*</strong>Required for these payment methods: <code>netbanking</code></td></tr><tr><td><code>customer.address.countryCode</code></td><td>string[2]</td><td>O*</td><td><p>Customer's country.<br>* For <code>netbanking</code> method:</p><ul><li>Is required</li><li>Expected value is <code>IN</code></li></ul><p>* For <code>interac</code> method:</p><ul><li>Is required</li><li>Expected value is <code>CA</code></li></ul></td></tr><tr><td><code>sessionContext</code></td><td>object</td><td>R</td><td>User session context parameters.</td></tr><tr><td><code>sessionContext.ip</code></td><td>string</td><td>R</td><td>User ip address.</td></tr><tr><td><code>sessionContext.languageCode</code></td><td>string[2]</td><td>O</td><td>The language is always <code>en</code> (English).</td></tr><tr><td><code>returnUrls</code></td><td>object</td><td>R</td><td>The URLs where the user will be redirected.</td></tr><tr><td><code>returnUrls.default</code></td><td>string</td><td>R</td><td>The URL where the user will be redirected in cases where the transaction does not achieve its final status.</td></tr><tr><td><code>returnUrls.success</code></td><td>string</td><td>O</td><td>The URL to redirect the user to in the event of a successful payout. If this URL is not provided, the default address in <code>returnURLs.default</code> will be used.</td></tr><tr><td><code>returnUrls.failure</code></td><td>string</td><td>O</td><td>The URL to redirect the user to if the payout is unsuccessful. If this URL is not provided, the default address in <code>returnURLs.default</code> will be used.</td></tr><tr><td><code>notificationUrl</code></td><td>string</td><td>O</td><td>The URL for receiving notifications about payout status (callbacks). If this URL is not provided, no callbacks will be executed.</td></tr><tr><td><code>antifraudParameters</code></td><td>object</td><td> O</td><td>Additional parameters for the antifraud system. A maximum of 70 elements is allowed. Both keys and values should be strings, limited to 100 Latin characters each. Keys must follow the pattern <code>“antifraud_*”</code>.</td></tr></tbody></table>

#### Payout Details for the “cards” method

| Parameter          | Type                  | R/O | Description                                                            |
| ------------------ | --------------------- | --- | ---------------------------------------------------------------------- |
| `type`             | string enum \[“card”] | R   | In this case, the type is always *card*.                               |
| `cardNumber`       | string\[19]           | R   | Card number.                                                           |
| `cardHolderName`   | string\[40]           | R   | Cardholder's full name. It may contain two or three words with spaces. |
| `cardSecurityCode` | string\[4]            | O   | Security code (CVV).                                                   |
| `expiryMonth`      | int\[2]               | R   | Expiry month.                                                          |
| `expiryYear`       | int\[2]               | R   | Expiry year.                                                           |

#### Payout details for the “vodafonecash” method

<table><thead><tr><th width="161.6666259765625">Parameter</th><th width="76">Type</th><th width="57">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>phone</code></td><td>string</td><td>R</td><td><p>Beneficiary's phone number must:</p><ul><li>be exactly 11 digits,</li><li>contain only numbers,</li><li>not include country code.</li></ul></td><td>"01212345678"</td></tr><tr><td><code>beneficiaryName</code></td><td>string</td><td>R</td><td>Beneficiary's first and last name.<br>A string of at least two words separated by a space is expected. Up to 100 characters.</td><td>"John Doe"</td></tr></tbody></table>

#### Payout details for the “orangecash” method

<table><thead><tr><th width="172.77777099609375">Parameter</th><th width="76">Type</th><th width="57">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>phone</code></td><td>string</td><td>R</td><td><p></p><p>Beneficiary's phone number must:</p><ul><li>be exactly 11 digits,</li><li>contain only numbers,</li><li>not include country code.</li></ul></td><td>"01012345678"</td></tr><tr><td><code>beneficiaryName</code></td><td>string</td><td>R</td><td>Beneficiary's first and last name.<br>A string of at least two words separated by a space is expected. Up to 100 characters.</td><td>"John Doe"</td></tr></tbody></table>

#### Payout details for the “mercadopago” method

<table><thead><tr><th width="182.77777099609375">Parameter</th><th width="87.11114501953125">Type</th><th width="74.7777099609375">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>accountNumber</code></td><td>string</td><td>R</td><td><p>Beneficiary's account number must:</p><ul><li>be 22 symbols,</li><li>contain only numbers.</li></ul></td><td>"0000168100000000000000"</td></tr><tr><td><code>beneficiaryName</code></td><td>string</td><td>R</td><td>Beneficiary's first and last name.<br>A string of at least two words separated by a space is expected. Up to 100 characters.</td><td>"John Doe"</td></tr></tbody></table>

#### Payout details for the “lemoncash” method

<table><thead><tr><th width="177">Parameter</th><th width="85">Type</th><th width="67">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>accountNumber</code></td><td>string</td><td>R</td><td><p>Beneficiary's account number must:</p><ul><li>be 22 symbols,</li><li>contain only numbers.</li></ul></td><td>"0000168100000000000000"</td></tr><tr><td><code>beneficiaryName</code></td><td>string</td><td>R</td><td>Beneficiary's first and last name.<br>A string of at least two words separated by a space is expected. Up to 100 characters.</td><td>"John Doe"</td></tr></tbody></table>

#### Payout details for the “instapay” method

<table><thead><tr><th width="177">Parameter</th><th width="85">Type</th><th width="67">R/O</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>type</td><td>string</td><td>R</td><td>Type of details. Possible values:<br>• <strong>Phone</strong><br>• <strong>InstaPayId</strong></td><td></td></tr><tr><td><code>accountNumber</code></td><td>string</td><td>R</td><td>The format is determined by the value of the parameter <code>type</code>:<br>• if <code>type = phone</code> — 11 digits<br>• if <code>type = instaPayId</code> — a string in the format <code>&#x3C;username>@instapay</code>, with a maximum length of 256 characters</td><td>"12345678901" or<br>"username@instapay"</td></tr><tr><td><code>beneficiaryName</code></td><td>string</td><td>R</td><td>Beneficiary's first and last name.<br>A string of at least two words separated by a space is expected. Up to 100 characters.</td><td>"John Doe"</td></tr></tbody></table>

#### Payout details for the “payster” method

{% hint style="info" %}
The set of payout details for the *payster* method depends on the country: **Australia** or **New Zealand**.
{% endhint %}

For **Australia**, the parameters are:

<table><thead><tr><th>Parameter</th><th>Type</th><th>R/O</th><th width="171">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>type</code></td><td>string enum [“email”, “phone”, “bsbAccount“]</td><td>R</td><td><p>Type of details used for the “payster” method:</p><ul><li><em>“email“</em> if an email address is used as a requisite.</li><li><em>“phone“</em> if a telephone number is used as a requisite.</li><li><em>“bsbAccount“</em> if a bank code and bank account number are used as a requisite.</li></ul></td><td> "email"</td></tr><tr><td><code>accountHolder</code></td><td>string</td><td>R</td><td><p>The account holder full name must:</p><ul><li>contain only Latin letters, numbers, or spaces between,</li><li>have two words minimum,</li><li>have between 3 and 50 symbols.</li></ul></td><td>"John Doe"</td></tr><tr><td><code>email</code></td><td>string</td><td>O*</td><td><p>*Required for the <em>“email”</em> type.<br>The email must:</p><ul><li>contain only Latin letters, numbers, or  some special symbols ("_" "-" "." "+" "~"),</li><li>be between 5 and 35 symbols.</li></ul></td><td> "johndoe@test.com"</td></tr><tr><td><code>phone</code></td><td>string</td><td>O*</td><td><p>*Required for the <em>“phone”</em> type.</p><p><em>The format is +{number}.</em><br>The number must be between 8 and 16 symbols.</p></td><td> "+123456789"</td></tr><tr><td><code>bsb</code></td><td>string</td><td>O*</td><td><p>*Required for the <em>“bsbAccount”</em> type.<br>Bank 6-digit bsb code.</p><p></p></td><td>“010000“</td></tr><tr><td><code>accountNumber</code></td><td>string</td><td>O*</td><td>*Required for the <em>“bsbAccount”</em> type.<br>Account number must be between 6 and 12 symbols.</td><td>“12345678901234567890“</td></tr></tbody></table>

For **New Zealand**, the parameters are:

| Parameter              | Type   | R/O | Description                                                                                                                                                                                                                                                                   | Example            |
| ---------------------- | ------ | --- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| `beneficiaryFirstName` | string | R   | <p>Beneficiary's first name must:</p><ul><li>contain only Latin letters or spaces between them,</li><li>not exceed 48 symbols.</li></ul><p>The overall length of the <em>beneficiaryFirstName</em> and <em>beneficiaryLastNam</em>e parameters must be within 50 symbols.</p> | "John"             |
| `beneficiaryLastName`  | string | R   | <p>Beneficiary's last name must:</p><ul><li>contain only Latin letters or spaces between them,</li><li>not exceed 48 symbols.</li></ul><p>The overall length of the <em>beneficiaryFirstName</em> and <em>beneficiaryLastNam</em>e parameters must be within 50 symbols.</p>  | "Doe"              |
| `accountNumber`        | string | R   | <p>Beneficiary's account number must:<br></p><ul><li>be between 15 and 16 symbols,</li><li>contain only numbers.</li></ul>                                                                                                                                                    | “1234567890123456“ |

#### Payout details for the “payid” method

<table><thead><tr><th>Parameter</th><th>Type</th><th width="79">R/O</th><th width="192">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>type</code></td><td>string enum [“email”, “phone”]</td><td>R</td><td><p>Type of details used for the “payid” method:</p><ul><li><em>“email“</em> if an email address is used as a requisite.</li><li><em>“phone“</em> if a telephone number is used as a requisite.</li></ul></td><td> "email"</td></tr><tr><td><code>beneficiaryFirstName</code></td><td>string</td><td>R</td><td><p>Beneficiary's first name must:</p><ul><li>contain only Latin letters or spaces between them,</li><li>not exceed 48 symbols.</li></ul><p>The overall length of the <em>beneficiaryFirstName</em> and <em>beneficiaryLastNam</em>e parameters must be within 50 symbols.</p></td><td>"John"</td></tr><tr><td><code>beneficiaryLastName</code></td><td>string</td><td>R</td><td><p>Beneficiary's last name must:</p><ul><li>contain only Latin letters or spaces between them,</li><li>not exceed 48 symbols.</li></ul><p>The overall length of the <em>beneficiaryFirstName</em> and <em>beneficiaryLastNam</em>e parameters must be within 50 symbols.</p></td><td>"Doe"</td></tr><tr><td><code>email</code></td><td>string</td><td>O*</td><td><p>*Required for the <em>“email”</em> type.<br>The email must:</p><ul><li>contain only Latin letters, numbers, or  some special symbols ("_" "-" "." "+" "~"),</li><li>be between 5 and 35 symbols.</li></ul></td><td> "johndoe@test.com"</td></tr><tr><td><code>phone</code></td><td>string</td><td>O*</td><td><p>*Required for the <em>“phone”</em> type.</p><p><em>The format is {number},</em> consists of 9 digits, without country code.</p></td><td> "123456789"</td></tr></tbody></table>

#### Payout details for the “interac” method

<table><thead><tr><th>Parameter</th><th width="118">Type</th><th width="59">R/O</th><th>Description</th></tr></thead><tbody><tr><td><code>firstName</code></td><td>string</td><td>R</td><td>Customer’s first name.<br>May contain only latin letters, up to 100 characters in length.</td></tr><tr><td><code>lastName</code></td><td>string</td><td>R</td><td>Customer’s last name.<br>May contain only latin letters, up to 100 characters in length.</td></tr><tr><td><code>email</code></td><td>string</td><td>R</td><td><p>Customer’s email.</p><p><br><em><mark style="background-color:yellow;">At least an email or phone number must be linked to a bank account.</mark></em></p></td></tr><tr><td><code>phone</code></td><td>string</td><td>R</td><td>Customer's phone number.<br><br>Must be between 9 and 16 symbols.<br><br><em><mark style="background-color:yellow;">At least an email or a phone number must be linked to a bank account.</mark></em></td></tr></tbody></table>

#### Payout details for the “netbanking” method

| Parameter              | Type                         | R/O | Description                                                                                                                                                    | Example                  |
| ---------------------- | ---------------------------- | --- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| `type`                 | string enum \[“bankAccount“] | R   | In this case, it's always *"bankAccount"*.                                                                                                                     |                          |
| `beneficiaryFirstName` | string                       | R   | First name of a beneficiary mustn’t exceed 50 symbols and may contain Latin letters and spaces (excluding spaces at the beginning and at the end of the line). | "John"                   |
| `beneficiaryLastName`  | string                       | R   | Last name of a beneficiary mustn’t exceed 50 symbols and may contain Latin letters and spaces (excluding spaces at the beginning and at the end of the line).  | "Doe"                    |
| `accountNumber`        | string                       | R   | Beneficiary's account number mustn’t exceed 100 symbols                                                                                                        | "1234567890"             |
| `accountBankCode`      | string                       | R   | Code of the customer’s bank mustn’t exceed 20 symbols                                                                                                          | "UTBI0DWK743"            |
| `accountBankName`      | string                       | R   | Name of the customer’s bank mustn’t exceed 100 symbols                                                                                                         | "UNITED BANK OF INDIA"   |
| `accountBankBranch`    | string                       | O   | Branch of the customer’s bank mustn’t exceed 100 symbols                                                                                                       | "DWARKA"                 |
| `accountBankAddress`   | string                       | O   | Address of the customer’s bank mustn’t exceed 100 symbols                                                                                                      | "BHAGAWATI PLAZA PLNO12" |

#### Payout details for the “payfix” method

| Parameter  | Type                    | R/O | Description                                                                                 | Example      |
| ---------- | ----------------------- | --- | ------------------------------------------------------------------------------------------- | ------------ |
| `type`     | string enum \[“wallet“] | R   | In this case, it's always *"wallet",* meaning a wallet ID is used as a requisite.           |              |
| `walletId` | string                  | R   | <p>Payfix wallet identifier.</p><p>10-long digit, starting at 1 or higher, is expected.</p> | "1234567890" |

#### Payout details for the “communitybank” method

| Parameter         | Type                         | R/O | Description                                                                                                                            |
| ----------------- | ---------------------------- | --- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `type`            | string enum \[“bankAccount“] | R   | In this case, it's always *"bankAccount".*                                                                                             |
| `iban`            | string                       | R   | IBAN.                                                                                                                                  |
| `swiftCode`       | string                       | R   | SWIFT/BIC code.                                                                                                                        |
| `beneficiaryName` | string                       | R   | <p>Beneficiary's first and last name.</p><p>A string of at least two words separated by a space is expected. Up to 200 characters.</p> |
| `documentNumber`  | string                       | R   | <p>Beneficiary's document number.</p><p>The limit is 11 digits.</p>                                                                    |

#### Payout details for the “pcr” method

<table><thead><tr><th width="157">Parameter</th><th width="136">Type</th><th width="60">R/O</th><th width="181">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>type</code></td><td>string enum [“card”, “iban”]</td><td>R</td><td><p>Types of requisite details used for the “pcr” method:</p><ul><li>“card”: a card number is used as a requisite.</li><li>“iban”: an IBAN is used as a requisite</li></ul></td><td><p>“card”</p><p>“iban”</p><p><br></p></td></tr><tr><td><code>accountNumber</code></td><td>string</td><td>R</td><td><ul><li>If the type is “card”, the account number is a card number. </li><li>If the type is “iban”, the account number is an IBAN.</li></ul></td><td><p>“2200300103446166” (for “card”)</p><p></p><p>“NL91ABNA0417164300” (for “iban”)</p></td></tr><tr><td><code>beneficiaryName</code></td><td>string</td><td>R</td><td>Beneficiary’s full name. A string of two words separated by a space is expected.</td><td>“John Doe”</td></tr><tr><td><code>phone</code></td><td>string</td><td>O</td><td>Beneficiary’s phone number.</td><td>“124567890”</td></tr></tbody></table>

#### Payout details for the "sepainstant" method

<table><thead><tr><th width="187">Parameter</th><th>Type</th><th width="60">R/O</th><th width="169">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>type</code></td><td>string enum [“bankAccount“]</td><td>R</td><td>In this case, the type is always <em>“bankAccount”</em>.</td><td><p>“bankAccount”</p><p></p></td></tr><tr><td><code>beneficiaryEmail</code></td><td>string</td><td>R</td><td><p>The beneficiary email mustn’t exceed 100 symbols and may contain:</p><ul><li>Latin letters.</li><li>Numbers.</li><li>Some special symbols: underscore (_), hyphen (-), period (.), and plus (+).</li></ul></td><td><p></p><p><br>"test@test.com"</p></td></tr><tr><td><code>beneficiaryBirthdate</code></td><td>string</td><td>R</td><td>Birthdate in the <em>dd-mm-yyyy</em> format. Beneficiary must be between 18 and 60 years old on the current day.</td><td>"23-08-1978"</td></tr><tr><td><code>beneficiaryCountryResidence</code></td><td>string</td><td>R</td><td>Beneficiary country in the ISO Alpha-2 format.</td><td>"FR"</td></tr><tr><td><code>beneficiaryFirstName</code></td><td>string</td><td>R</td><td>First name of a beneficiary mustn’t exceed 100 symbols and may contain Latin letters and spaces (excluding spaces at the beginning and at the end of the line).</td><td>“John”</td></tr><tr><td><code>beneficiaryLastName</code></td><td>string</td><td>R</td><td>Last name of a beneficiary mustn’t exceed 100 symbols and may contain Latin letters and spaces (excluding spaces at the beginning and at the end of the line).</td><td>"Doe"</td></tr><tr><td><code>iban</code></td><td>string</td><td>R</td><td>Beneficiary IBAN from the SEPA region.</td><td>“FR1420041010050500013M02606”</td></tr></tbody></table>

#### Payout details for the "`banktransfer`" method

<table><thead><tr><th>Parameter</th><th width="100">Type</th><th width="62">R/O</th><th width="162">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>bankAccount</code></td><td>string</td><td>R</td><td>Bank account number must be between 8 and 24 symbols.</td><td>"4564984561151456"<br></td></tr><tr><td><code>bankCode</code></td><td>string</td><td>R*</td><td>Code of the customer’s bank.<br>* Required only for  bank transfers with KRW and TWD currencies.</td><td>"BUSANBANK"<br></td></tr><tr><td>beneficiaryName</td><td>string</td><td>R</td><td>Beneficiary’s full name. A string of two words separated by a space is expected.<br>Max length - 250 characters.</td><td>"John Smith"</td></tr></tbody></table>

#### Payout details for the "`banktransfer`" (Marocco) method

<table><thead><tr><th>Parameter</th><th width="100">Type</th><th width="62">R/O</th><th width="162">Description</th><th>Example</th></tr></thead><tbody><tr><td>accountNumber</td><td>string</td><td>R</td><td>Bank account number must be between 8 and 24 symbols.</td><td>"4564984561151456"<br></td></tr><tr><td>beneficiaryName</td><td>string</td><td>R</td><td>Beneficiary’s full name. A string of two words separated by a space is expected.<br>Max length - 250 characters.</td><td>"John Smith"</td></tr></tbody></table>

#### Payout details for the "`banktransfer`" (UAE) method

<table><thead><tr><th>Parameter</th><th width="100">Type</th><th width="62">R/O</th><th width="162">Description</th><th>Example</th></tr></thead><tbody><tr><td>accountNumber</td><td>string</td><td>R</td><td>Bank account number must be in IBAN format, consisting of 15 to 34 characters.</td><td>"AE020090004001079346500"<br></td></tr><tr><td>beneficiaryName</td><td>string</td><td>R</td><td>Beneficiary’s full name. A string of two words separated by a space is expected.<br>Max length - 250 characters.</td><td>"John Smith"</td></tr></tbody></table>

#### Payout details for the "`banktransfer`" (Australia) method

<table><thead><tr><th>Parameter</th><th width="100">Type</th><th width="62">R/O</th><th width="162">Description</th><th>Example</th></tr></thead><tbody><tr><td>accountNumber</td><td>string</td><td>R</td><td>Payout account number. Contains digits only, length from 8 to 24 characters.</td><td>"4564984561151456"<br></td></tr><tr><td>bankbranchcode</td><td>string</td><td>R</td><td>BSB code, consisting of 6 digits</td><td>"123456"</td></tr><tr><td>beneficiaryName</td><td>string</td><td>R</td><td>Beneficiary’s full name. A string of two words separated by a space is expected.<br>Max length - 250 characters.</td><td>"John Smith"</td></tr></tbody></table>

#### Request example **for the `banktransfer` (Marocco) method**:

```json
Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json

{
    "order": {
        "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
        "amount": 123456,
        "currency": "MAD",
        "description": "some description"
    },
    "method": "banktransfer",
    "details": {
        "accountNumber": "1234567890",
        "beneficiaryName": "John Doe",
    },
    "customer": {
        "id": "62f66472913640cc93f49d5477840633"
     },
    "sessionContext": {
        "ip": "172.16.0.1",
        "languageCode": "en"
    },
    "returnUrls": {
      "default": "https://yourwebsite.com/{someUsefulParams1}",
      "success": "https://yourwebsite.com/{someUsefulParams2}",
      "failure": "https://yourwebsite.com/{someUsefulParams3}"
    },
    "notificationUrl": "https://yourwebsite.com/notify",
    "antifraudParams": {
        "antifraud_email": "rms@check.com",
        "antifraud_param_name": "param_value"
    }
}
```

#### Request example **for the `banktransfer` (UAE) method**:

```json
Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json

{
    "order": {
        "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
        "amount": 123456,
        "currency": "AED",
        "description": "some description"
    },
    "method": "banktransfer",
    "details": {
        "accountNumber": "AE020090004001079346500",
        "beneficiaryName": "John Doe",
    },
    "customer": {
        "id": "62f66472913640cc93f49d5477840633"
     },
    "sessionContext": {
        "ip": "172.16.0.1",
        "languageCode": "en"
    },
    "returnUrls": {
      "default": "https://yourwebsite.com/{someUsefulParams1}",
      "success": "https://yourwebsite.com/{someUsefulParams2}",
      "failure": "https://yourwebsite.com/{someUsefulParams3}"
    },
    "notificationUrl": "https://yourwebsite.com/notify",
    "antifraudParams": {
        "antifraud_email": "rms@check.com",
        "antifraud_param_name": "param_value"
    }
}
```

#### Request example **for the `banktransfer` (Australia) method**:

```json
Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json

{
    "order": {
        "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
        "amount": 123456,
        "currency": "AUD",
        "description": "some description"
    },
    "method": "banktransfer",
    "details": {
        "accountNumber": "40010793465",
        "bankbranchcode":"123456",
        "beneficiaryName": "John Doe",
    },
    "customer": {
        "id": "62f66472913640cc93f49d5477840633"
     },
    "sessionContext": {
        "ip": "172.16.0.1",
        "languageCode": "en"
    },
    "returnUrls": {
      "default": "https://yourwebsite.com/{someUsefulParams1}",
      "success": "https://yourwebsite.com/{someUsefulParams2}",
      "failure": "https://yourwebsite.com/{someUsefulParams3}"
    },
    "notificationUrl": "https://yourwebsite.com/notify",
    "antifraudParams": {
        "antifraud_email": "rms@check.com",
        "antifraud_param_name": "param_value"
    }
}
```

#### Request example **for the `cards` method**:

<pre class="language-json"><code class="lang-json"><strong>Authorization-Key: *****
</strong>Authorization-Password: *****
Content-Type: application/json

{
    "order": {
        "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
        "amount": 123456,
        "currency": "USD",
        "description": "some description"
    },
    "method": "cards",
    "details": {
        "type": "card",
        "cardNumber": "4242424242424242",
        "cardHolderName": "Card Holder",
        "cardSecurityCode": "123",
        "expiryMonth": 11,
        "expiryYear": 2025
    },
    "customer": {
        "id": "62f66472913640cc93f49d5477840657",
        "firstName": "Harry",
        "lastName": "Potter",
        "email": "customer@email.com",
        "phone": "357123456789"
     },
    "sessionContext": {
        "ip": "172.16.0.1",
        "languageCode": "en"
    },
    "returnUrls": {
      "default": "https://yourwebsite.com/{someUsefulParams1}",
      "success": "https://yourwebsite.com/{someUsefulParams2}",
      "failure": "https://yourwebsite.com/{someUsefulParams3}"
    },
    "notificationUrl": "https://yourwebsite.com/notify",
    "antifraudParams": {
        "antifraud_email": "Camryn.Roob83@gmail.com",
        "antifraud_param_name": "param_value"
    }
}
</code></pre>

#### Request example **for the `instapay` method:**

```javascript
Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json

{
    "order": {
        "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
        "amount": 123456,
        "currency": "EGP",
        "description": "some description"
    },
    "method": "instapay",
    "details": {
        "type":"instapayid",
        "accountNumber": "username@instapay",
        "beneficiaryName": "John Doe",
    },
    "customer": {
        "id": "62f66472913640cc93f49d5477840633"
     },
    "sessionContext": {
        "ip": "172.16.0.1",
        "languageCode": "en"
    },
    "returnUrls": {
      "default": "https://yourwebsite.com/{someUsefulParams1}",
      "success": "https://yourwebsite.com/{someUsefulParams2}",
      "failure": "https://yourwebsite.com/{someUsefulParams3}"
    },
    "notificationUrl": "https://yourwebsite.com/notify",
    "antifraudParams": {
        "antifraud_email": "rms@check.com",
        "antifraud_param_name": "param_value"
    }
}
```

#### Request example **for the `orangecash` method**:

```javascript
Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json

{
    "order": {
        "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
        "amount": 123456,
        "currency": "EGP",
        "description": "some description"
    },
    "method": "orangecash",
    "details": {
        "phone": "01212345678",
        "beneficiaryName": "John Doe",
    },
    "customer": {
        "id": "62f66472913640cc93f49d5477840633"
     },
    "sessionContext": {
        "ip": "172.16.0.1",
        "languageCode": "en"
    },
    "returnUrls": {
      "default": "https://yourwebsite.com/{someUsefulParams1}",
      "success": "https://yourwebsite.com/{someUsefulParams2}",
      "failure": "https://yourwebsite.com/{someUsefulParams3}"
    },
    "notificationUrl": "https://yourwebsite.com/notify",
    "antifraudParams": {
        "antifraud_email": "rms@check.com",
        "antifraud_param_name": "param_value"
    }
}
```

#### Request example **for the `vodafonecash` method**:

```javascript
Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json

{
    "order": {
        "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
        "amount": 123456,
        "currency": "EGP",
        "description": "some description"
    },
    "method": "vodafonecash",
    "details": {
        "phone": "01012345678",
        "beneficiaryName": "John Doe",
    },
    "customer": {
        "id": "62f66472913640cc93f49d5477840633"
     },
    "sessionContext": {
        "ip": "172.16.0.1",
        "languageCode": "en"
    },
    "returnUrls": {
      "default": "https://yourwebsite.com/{someUsefulParams1}",
      "success": "https://yourwebsite.com/{someUsefulParams2}",
      "failure": "https://yourwebsite.com/{someUsefulParams3}"
    },
    "notificationUrl": "https://yourwebsite.com/notify",
    "antifraudParams": {
        "antifraud_email": "rms@check.com",
        "antifraud_param_name": "param_value"
    }
}
```

#### Request example **for the `mercadopago`method**:

```javascript
Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json

{
    "order": {
        "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
        "amount": 123456,
        "currency": "ARS",
        "description": "some description"
    },
    "method": "mercadopago",
    "details": {
        "accountNumber": "0000168100000000000000",
        "beneficiaryName": "John Doe",
    },
    "customer": {
        "id": "62f66472913640cc93f49d5477840633"
     },
    "sessionContext": {
        "ip": "172.16.0.1",
        "languageCode": "en"
    },
    "returnUrls": {
      "default": "https://yourwebsite.com/{someUsefulParams1}",
      "success": "https://yourwebsite.com/{someUsefulParams2}",
      "failure": "https://yourwebsite.com/{someUsefulParams3}"
    },
    "notificationUrl": "https://yourwebsite.com/notify",
    "antifraudParams": {
        "antifraud_email": "rms@check.com",
        "antifraud_param_name": "param_value"
    }
}
```

#### Request example **for the `lemoncash` method**:

```javascript
Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json

{
    "order": {
        "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
        "amount": 123456,
        "currency": "ARS",
        "description": "some description"
    },
    "method": "lemoncash",
    "details": {
        "accountNumber": "0000168100000000000000",
        "beneficiaryName": "John Doe",
    },
    "customer": {
        "id": "62f66472913640cc93f49d5477840633"
     },
    "sessionContext": {
        "ip": "172.16.0.1",
        "languageCode": "en"
    },
    "returnUrls": {
      "default": "https://yourwebsite.com/{someUsefulParams1}",
      "success": "https://yourwebsite.com/{someUsefulParams2}",
      "failure": "https://yourwebsite.com/{someUsefulParams3}"
    },
    "notificationUrl": "https://yourwebsite.com/notify",
    "antifraudParams": {
        "antifraud_email": "rms@check.com",
        "antifraud_param_name": "param_value"
    }
}
```

#### Request example **for the `payster` method:**

```json
Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json

{
    "order": {
        "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
        "amount": 123456,
        "currency": "AUD",
        "description": "some description"
    },
    "method": "payster",
    "details": {
        "type": "email",
        "accountHolder": "John Doe",
        "email": "some.email@some.domain"
    },
    "customer": {
        "id": "62f66472913640cc93f49d5477840633",
        "firstName": "Harry",
        "lastName": "Potter",
        "email": "customer@email.com",
        "phone": "357123456789"
     },
    "sessionContext": {
        "ip": "172.16.0.1",
        "languageCode": "en"
    },
    "returnUrls": {
      "default": "https://yourwebsite.com/{someUsefulParams1}",
      "success": "https://yourwebsite.com/{someUsefulParams2}",
      "failure": "https://yourwebsite.com/{someUsefulParams3}"
    },
    "notificationUrl": "https://yourwebsite.com/notify",
    "antifraudParams": {
        "antifraud_email": "Camryn.Roob83@gmail.com",
        "antifraud_param_name": "param_value"
    }
}
```

#### Request example **for the `pcr` method:**

<pre class="language-json"><code class="lang-json">Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json

{
<strong>    "order": {
</strong>        "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
        "amount": 123456,
        "currency": "TRY",
        "description": "some description"
    },
    "method": "pcr",
    "details": {
        "type": "iban",
        "accountNumber": "NL91ABNA0417164300",
        "beneficiaryName": "John Doe",
        "phoneNumber": "124567890"
    },
<strong>    "customer": {
</strong>        "firstName": "Harry",
        "lastName": "Potter",
        "email": "customer@email.com",
        "phone": "357123456789"
     },
    "sessionContext": {
        "ip": "172.16.0.1",
        "languageCode": "en"
    },
    "returnUrls": {
      "default": "https://yourwebsite.com/{someUsefulParams1}",
      "success": "https://yourwebsite.com/{someUsefulParams2}",
      "failure": "https://yourwebsite.com/{someUsefulParams3}"
    },
    "notificationUrl": "https://yourwebsite.com/notify",
    "antifraudParams": {
        "antifraud_email": "Camryn.Roob83@gmail.com",
        "antifraud_param_name": "param_value"
    }
}
</code></pre>

#### Request example **for the `sepainstant`method:**

```json
Authorization-Key: *****
Authorization-Password: *****
Content-Type: application/json

{
    "order": {
        "id": "test-d43850a9-c909-4580-b589-a89c1748a1da",
        "amount": 1000,
        "currency": "EUR"
    },
    
    "method": "sepainstant",
    
    "details": {
        "type": "bankAccount",
        "beneficiaryEmail": "test@test.com",
        "beneficiaryBirthdate": "23-08-1978",
        "beneficiaryCountryResidence": "FR",
        "beneficiaryFirstName": "John",
        "beneficiaryLastName": "Doe",
        "iban": "FR1420041010050500013M02606"
    },
    "customer": {
        "firstName": "Harry",
        "lastName": "Potter",
        "email": "customer@email.com",
        "phone": "357123456789"
     },
    "sessionContext": {
        "ip": "172.16.0.1",
        "languageCode": "en"
    },

    "returnUrls": {
      "default": "https://yourwebsite.com/{someUsefulParams1}",
      "success": "https://yourwebsite.com/{someUsefulParams2}",
      "failure": "https://yourwebsite.com/{someUsefulParams3}"
    },
          
    "notificationUrl": "https://yourwebsite.com/notify",
    
    "antifraudParams": {
        "antifraud_email": "customer@email.com",
        "antifraud_param_name": "param_value"
    }
}
```

**Response parameters:**

| Parameter |        | R/O | Description                                                                                                                                       | Example                          |
| --------- | ------ | --- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| `id`      | string | R   | Unique payout identifier.                                                                                                                         | 9073926b929f31c2abc9fad77ae3e8eb |
| `orderId` | string | R   | Unique Identifier of the order being paid in the merchant's system.                                                                               |                                  |
| `method`  | string | R   | Payment method.                                                                                                                                   | cards                            |
| `status`  | string | R   | Payout status.                                                                                                                                    | authorized                       |
| `amount`  | long   | R   | Total payout amount in the smallest unit of the currency. For example, if the payout is in EUR, the amount of *10050* means 100 EUR and 50 cents. | 10050                            |

#### **Response example:**

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "status": "pending",
    "amount": 10050
}
```

#### **Error types and codes:**

<table><thead><tr><th width="167">In case of</th><th width="80">Error</th><th width="200">Type</th><th width="115">Title</th><th>Comment</th></tr></thead><tbody><tr><td>The body of the incoming request is not a correct description of a JSON object according to JSON <a href="https://datatracker.ietf.org/doc/html/rfc8259">RFC 8259</a>.</td><td>400</td><td>malformedRequest</td><td>Your request body didn't validate.</td><td><p>Additionally, the element "invalid-params":</p><p><code>[{</code></p><p><code>"name":"body",</code></p><p><code>"reason":"bodyMalformedAtPosXXX"</code></p><p><code>}]</code> </p><p>is filled in, XXX is the line number where the first syntax validation error of the request body occurred. For example, <code>bodyMalformedAtPos27</code></p></td></tr><tr><td>The body of the incoming request represents a JSON object, but it does not meet the interface requirements</td><td>400</td><td>validationError</td><td>Your request body didn't validate.</td><td>Additionally, the element "invalid-params":[{"name":"name of the problematic field","reason":"reason"}] is filled in.</td></tr><tr><td>Merchant terminal not found when creating a session. Incorrect terminal password provided when creating a session.</td><td>422</td><td>invalidTerminalCredentials</td><td>Invalid terminal key or password.</td><td></td></tr><tr><td>Invalid Terminal Settings</td><td>422</td><td>invalidTerminalSettings</td><td><p>Terminal’s settings are invalid.</p><p>Contact our support team.</p></td><td></td></tr><tr><td>The use of the mapi interface is not allowed for the payout transaction</td><td>422</td><td>interfaceNotAllowed</td><td>This interface is not allowed.</td><td></td></tr><tr><td>The operation amount specified is incorrect: the value passed is not a positive integer</td><td>422</td><td>invalidAmount</td><td>Invalid amount of the transaction.</td><td></td></tr><tr><td>Payout with the same order id value has already been registered</td><td>422</td><td>duplicatedOrderId</td><td>Duplicated order id.</td><td></td></tr><tr><td>The requested currency is not supported.</td><td>422</td><td>сurrencyNotSupported</td><td>This currency is not supported.</td><td></td></tr><tr><td>The requested payment method is not supported.</td><td>422</td><td>methodNotSupported</td><td>This payment method not supported.</td><td></td></tr><tr><td>Unforeseen errors on the service side. Prior to the creation of the session.</td><td>500</td><td>unexpectedError</td><td>Unexpected error. Contact our support team.</td><td></td></tr><tr><td>Temporary error: You might be able to do the operation successfully if you try again later.</td><td>503</td><td>temporaryMalfunction</td><td>Temporary malfunction. Please try again later.</td><td></td></tr></tbody></table>

### Get Payout Status

Use this method to request the current payout status through the MAPI interface.

**Entry parameters:**

**Request URL:** `https://facade-api.main.gate-api.com/mapi/payout/v1/​payouts/{payoutId}`

**Request method:** GET

**Request headers:**

<table><thead><tr><th>Header</th><th width="107">R/O</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>R</td><td>application/json</td><td>The original media type of the resource.</td></tr><tr><td><code>Cache-Control</code></td><td>R</td><td>no-cache</td><td>Mandates retrieving the response directly from the server, bypassing caches, to guarantee the latest status.</td></tr><tr><td><code>AuthorizationKey</code></td><td>R</td><td></td><td>Merchant terminal identifier.</td></tr><tr><td><code>AuthorizationPassword</code></td><td>R</td><td></td><td>Merchant terminal password.</td></tr></tbody></table>

​​Path parameters:

| Parameter  | Type | R/O    | Description               |
| ---------- | ---- | ------ | ------------------------- |
| `payoutId` | R    | string | Unique payout identifier. |

#### **Response body parameters:**

| Parameter     | Type   | R/O | Description                                                                                                                                       | Example                          |
| ------------- | ------ | --- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| `id`          | string | R   | Unique payout identifier.                                                                                                                         | 9073926b929f31c2abc9fad77ae3e8eb |
| `orderId`     | string | R   | Unique identifier for the order within the merchant's system.                                                                                     |                                  |
| `method`      | string | R   | Payout method.                                                                                                                                    | cards                            |
| `status`      | string | R   | Payout status.                                                                                                                                    | authorized                       |
| `description` | string | O   | Comment on the status.                                                                                                                            | "balanceExceeded"                |
| `amount`      | long   | R   | Total payout amount in the smallest unit of the currency. For example, if the payout is in EUR, the amount of *10050* means 100 EUR and 50 cents. | 10050                            |

#### **Response example - Successful payout:**

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "status": "authorized",
    "amount": 10050
}
```

#### **Response example - Payout rejected:**

```json
{
    "id": "9073926b929f31c2abc9fad77ae3e8eb",
    "orderId": "test-d43850a9-c909-4580-b589-a89c1748a1da",
    "method": "cards",
    "status": "rejected",
    "description": "balanceExceeded",
    "amount": 10050
}
```

#### **Error types and codes:**

| **In case of**                                                                                                     | **Error** | **Type**                   | **Title**                                   |
| ------------------------------------------------------------------------------------------------------------------ | --------- | -------------------------- | ------------------------------------------- |
| No payout found with the specified ID.                                                                             | 404       | payoutNotFound             | There is no payout with the specified id.   |
| Merchant terminal not found when creating a session. Incorrect terminal password provided when creating a session. | 422       | invalidTerminalCredentials | Invalid terminal key or password.           |
| The use of the mapi interface is not allowed for the payout transaction                                            | 422       | interfaceNotAllowed        | This interface is not allowed.              |
| Unforeseen errors on the service side. Prior to the creation of the session.                                       | 500       | unexpectedError            | Unexpected error. Contact our support team. |

### MAPI failed request responses

In the event of a request failure, the response will include a detailed description of the error.

**Error description parameters:**

<table><thead><tr><th width="241">Name</th><th width="118">Type</th><th width="75">R/O</th><th>Description</th></tr></thead><tbody><tr><td><code>error.type</code></td><td>string</td><td>R</td><td>Internal Error Code: Necessary when reaching out to technical support service.</td></tr><tr><td><code>error.title</code></td><td>string</td><td>R</td><td>Error Description: Details of the occurred error.</td></tr></tbody></table>

**Failed request response example:**

```json
{
   "error":
   {
      "type":"invalidAmount",
      "title":"Invalid amount of the transaction."
   }
}
```

Expected `error.type` values are described for all the API methods below.

In cases errors were detected during input parameter validation, an additional invalid-params array is included in the response. Each element of this array describes the specific rules that were violated:

```json
{
  "error": {
    "type": "validationError",
    "title": "Your request parameters didn't validate.",
    "invalid-params": [
      {
        "name": "someKey",
        "reason": "keyHasExtraLength"
      }
    ]
  }
}
```

The potential reasons for errors are detailed in the [Validation errors](#validation-errors) table below. Specifically, if the request body is not a correct JSON object, a response with the `malformedRequest` error type is returned. The reason value will include the line number where the first error occurred, indicated as 'XX' (the number of the line containing the first error):

```json
{
  "error": {
    "type": "malformedRequest",
    "title": "Your request body didn't validate.",
    "invalid-params": [
      {
        "name": "body",
        "reason": "bodyMalformedAtPosXXX"
      }
    ]
  }
}
```

#### **Validation errors:**

<table><thead><tr><th width="290">Error</th><th>Description</th></tr></thead><tbody><tr><td><code>keyHasExtraLength</code></td><td>Key exceeds maximum length limit.</td></tr><tr><td><code>keyIsRequired</code></td><td>Mandatory attribute <code>key</code> is missing.</td></tr><tr><td><code>keyIsNotPermited</code></td><td>Unexpected attribute <code>key</code> is provided.</td></tr><tr><td><code>valueHasExtraLength</code></td><td>Value exceeds maximum length limit.</td></tr><tr><td><code>arrayHasExtraAttributes</code></td><td>Array attribute contains extra elements beyond the expected count.</td></tr><tr><td><code>objectHasExtraAttributes</code></td><td>Object <code>attribute</code> contains unexpected attributes.</td></tr><tr><td><code>valueIsNotPermited</code></td><td>Value does not match the defined enumeration for the attribute.</td></tr><tr><td><code>valueIsRequired</code></td><td>Value must be provided; Empty and null values are not acceptable.</td></tr><tr><td><code>valueHasWrongFormat</code></td><td>Value format differs from the expected format.</td></tr></tbody></table>
