> For the complete documentation index, see [llms.txt](https://docs.50spays.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.50spays.com/payin/payin-e-com-h2h.md). Agents can also search and read this documentation through its [MCP server](https://docs.50spays.com/~gitbook/mcp).

# PayIn E-Com H2H

## Create Incoming E-Com Payment

<mark style="color:green;">`POST`</mark> /api/merchant/h2h/payin/ecom

This method is used to create deposit orders.

**Body**

<table><thead><tr><th>Name</th><th width="249">Type</th><th>Description</th></tr></thead><tbody><tr><td>amount</td><td>number <mark style="color:red;"><strong>(required)</strong></mark></td><td>Payment amount</td></tr><tr><td>currencyId</td><td>string <mark style="color:red;"><strong>(required)</strong></mark></td><td>Payment currency (for fiat, use the ISO 4217 3-letter code):<br><code>RUB, USD, EUR, UAH, AZN, KRW ...</code></td></tr><tr><td>merchantOrderId</td><td>string <mark style="color:red;"><strong>(required)</strong></mark></td><td>Unique order ID in the merchant’s system</td></tr><tr><td>ttl</td><td>integer</td><td>Desired order lifetime in seconds. The actual lifetime may differ.</td></tr><tr><td>callbackUrl</td><td>string <mark style="color:red;"><strong>(required)</strong></mark></td><td>Callback URL where order status updates will be sent</td></tr><tr><td>merchantURL</td><td>string <mark style="color:red;"><strong>(required)</strong></mark></td><td>Merchant Website URL</td></tr><tr><td>successRedirectURL</td><td>string</td><td>URL for user redirecting to the Merchant page in case of success</td></tr><tr><td>failedRedirectURL</td><td>string</td><td>URL for user redirecting to the Merchant page in case of failure</td></tr><tr><td>comment</td><td>string <mark style="color:red;"><strong>(required)</strong></mark></td><td>Payment comment</td></tr><tr><td>cardInfo</td><td>string <mark style="color:red;"><strong>(required)</strong></mark></td><td><p>Encrypted card data.</p><p>Card data structure:<br>{<br>"pan": "4111111111111111",<br>"cvv": "444",<br>"expMonth": 11,<br>"expYear": 30<br>}<br><br>Encryption instructions are provided here.</p></td></tr><tr><td>payerInfo</td><td>object <mark style="color:red;"><strong>(required)</strong></mark></td><td>Information about the payer</td></tr><tr><td>payerInfo.userAgent</td><td>string <mark style="color:red;"><strong>(required)</strong></mark></td><td>Browser User-Agent</td></tr><tr><td>payerInfo.ip</td><td>string</td><td>IP address</td></tr><tr><td>payerInfo.userId</td><td>string <mark style="color:red;"><strong>(required)</strong></mark></td><td>Unique user ID in the merchant’s system</td></tr><tr><td>payerInfo.fingerprint</td><td>string</td><td>Device fingerprint</td></tr><tr><td>payerInfo.registeredAt</td><td>integer <mark style="color:red;"><strong>(required)</strong></mark></td><td>UNIX timestamp of user registration in the merchant’s system</td></tr><tr><td>payerInfo.email</td><td>string</td><td>User email</td></tr><tr><td>payerInfo.phone</td><td>string</td><td>User phone</td></tr><tr><td>payerInfo.userFirstName</td><td>string</td><td>User first name<br><sub><mark style="color:red;">required for KRW</mark></sub></td></tr><tr><td>payerInfo.userLastName</td><td>string</td><td>User last name<br><sub><mark style="color:red;">required for KRW</mark></sub></td></tr></tbody></table>

**Card Data Encryption Guide**

This guide explains how to securely encrypt cardholder data using the provided public key before submitting it to the payment API.

{% content-ref url="/pages/CjcqyZcyUn9YZURJYViF" %}
[Encryption: public key](https://docs.50spays.com/security/encryption-public-key.md)
{% endcontent-ref %}

**Example Request Body**

{% tabs %}
{% tab title="quasi AZN" %}
{% code overflow="wrap" %}

```json
{
    "amount": 100,
    "currencyId": "AZN",
    "ttl": 5000,
    "merchantOrderId": "order123321",
    "callbackUrl": "https://alektest.free.beeceptor.com/webhook",
    "merchantURL": "https://nova-casino.com/",
    "successRedirectURL": "https://alektest.free.beeceptor.com/webhook?success=1",
    "failedRedirectURL": "https://alektest.free.beeceptor.com/webhook?error=1",
    "cardInfo": "Z6T5H42L7HOZ0v7Y9zrkbyOkiRnPXc1FOOFdWvUmoexHEGU0YAGmObVHVcAEh2xfvKFjcWxLaB02zgUo4MA1BPt6QcPgmlazn2McCEPgqDnqxGAcIU3QeuUkKcyCkjZNYl0k83gxvtALPB2htK7b+nAyDcCxEOcC67TaIf3mSmBm/katwp9nQy86dKaXLDMB1+9eILtRTlsSbI3qdyLm0defrwYdc98GcAPwOqLFrkKFZf5b5dAeHysYKMVe9hRkOW7RsAhJB3AUc/VuKknG4gxX0d0szbAn78/MGMCylYrzOQbhXwubRCgpIrQhi3TvIMUJYx3jDzeZNfqlBKHmiQ==",
    "payerInfo": {
        "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/655.1.15 (KHTML, like Gecko) Version/16.4 Mobile/148 Safari/04.1",
        "ip": "176.221.227.144",
        "userId": "3",
        "userFirstName": "Nikita",
        "userLastName": "Kosmos",
        "registeredAt": 1695057185
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "ok": true,
    "order": {
        "orderUid": "d7319c24-d0d7-4cd4-ab9f-bfde9e313cd0",
        "amountRequested": 100,
        "currencyIdRequested": "AZN",
        "exchangeRate": 1.75,
        "ttl": 900,
        "expireAt": 1771235651,
        "confirmData": {
            "type": "code"
        }
    }
}
```

| Name                    | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| orderUid                | string | Order UID in our system                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| amountRequested         | number | Amount the client should send                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| currencyIdRequested     | string | <p>Payment currency:<br><code>RUB, USD, EUR, UAH, AZN ...</code></p>                                                                                                                                                                                                                                                                                                                                                                                                  |
| exchangeRate            | number | <p>Exchange rate used to convert the paid currency into the final settlement currency.<br>The field may be null or omitted if both currencies are the same and no conversion is required.</p>                                                                                                                                                                                                                                                                         |
| ttl                     | number | Order time-to-live in seconds                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| expireAt                | number | Expiration time of the order in UNIX timestamp                                                                                                                                                                                                                                                                                                                                                                                                                        |
| confirmData             | object | <p><strong>3DS Confirmation Information</strong><br>Indicates the method and status of the cardholder’s 3D Secure authentication.<br>The cardholder must complete the authentication process with the issuing bank (e.g., OTP, or banking app approval).</p>                                                                                                                                                                                                          |
| confirmData.type        | string | <p>Specifies the 3DS confirmation flow type. Possible values: <code>code, redirect.</code><br>• If code — the merchant must collect the OTP from the cardholder on their payment form and submit it via the <a href="https://docs.50spays.com/payin/payin-e-com-h2h.md#confirm-3ds-by-code">corresponding API method</a>.<br>• If redirect — the merchant must redirect the cardholder to the URL provided in confirmData.redirectUrl to complete authentication.</p> |
| confirmData.redirectUrl | string | The customer must be redirected to this payment URL to proceed with the transaction                                                                                                                                                                                                                                                                                                                                                                                   |
| {% endtab %}            |        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

{% tab title="4xx/5xx" %}
{% code fullWidth="true" %}

```json
{
    "ok": false,
    "code": 402,
    "message": "human readable error message"
}
```

{% endcode %}

[**All Error Codes**](https://docs.50spays.com/reference/error-codes.md)
{% endtab %}
{% endtabs %}

## Confirm 3DS By code

<mark style="color:green;">`POST`</mark> /api/merchant/h2h/payin/ecom/3ds/confirm

This endpoint is used to complete the 3D Secure authentication in the code flow.

The merchant must collect the OTP provided by the cardholder and submit it to this endpoint to finalize the 3DS verification process.

The payment will proceed only if the OTP is successfully validated.

**Body**

<table><thead><tr><th>Name</th><th width="249">Type</th><th>Description</th></tr></thead><tbody><tr><td>orderUid</td><td>string <mark style="color:red;"><strong>(required)</strong></mark></td><td>Order UID in our system</td></tr><tr><td>code</td><td>string <mark style="color:red;"><strong>(required)</strong></mark></td><td>OTP code</td></tr></tbody></table>

**Example Request Body**

{% tabs %}
{% tab title="Request" %}
{% code overflow="wrap" %}

```json
{ 
    "orderUid": "0e194cc8-cfb5-459c-a1a1-21903c2066d7", 
    "code": "123123"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "ok": true
}
```

{% endtab %}

{% tab title="4xx/5xx" %}
{% code fullWidth="true" %}

```json
{
    "ok": false,
    "code": 402,
    "message": "human readable error message"
}
```

{% endcode %}

[**All Error Codes**](https://docs.50spays.com/reference/error-codes.md)
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.50spays.com/payin/payin-e-com-h2h.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
