> 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/ar/payin/payin-e-com-redirect.md). Agents can also search and read this documentation through its [MCP server](https://docs.50spays.com/~gitbook/mcp).

# PayIn E-Com Redirect

## Create Incoming E-Com Payment

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

This method is used to create deposit orders.

**Body**

| Name                    | Type                                                   | Description                                                                                                          |
| ----------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
| amount                  | number <mark style="color:red;">**(required)**</mark>  | Payment amount                                                                                                       |
| currencyId              | string <mark style="color:red;">**(required)**</mark>  | <p>Payment currency (for fiat, use the ISO 4217 3-letter code):<br><code>RUB, USD, EUR, UAH, AZN, KRW ...</code></p> |
| merchantOrderId         | string <mark style="color:red;">**(required)**</mark>  | Unique order ID in the merchant’s system                                                                             |
| ttl                     | integer                                                | Desired order lifetime in seconds. The actual lifetime may differ.                                                   |
| callbackUrl             | string <mark style="color:red;">**(required)**</mark>  | Callback URL where order status updates will be sent                                                                 |
| merchantURL             | string <mark style="color:red;">**(required)**</mark>  | Merchant Website URL                                                                                                 |
| successRedirectURL      | string                                                 | URL for user redirecting to the Merchant page in case of success                                                     |
| failedRedirectURL       | string                                                 | URL for user redirecting to the Merchant page in case of failure                                                     |
| comment                 | string <mark style="color:red;">**(required)**</mark>  | Payment comment                                                                                                      |
| payerInfo               | object <mark style="color:red;">**(required)**</mark>  | Information about the payer                                                                                          |
| payerInfo.ip            | string                                                 | IP address                                                                                                           |
| payerInfo.userId        | string <mark style="color:red;">**(required)**</mark>  | Unique user ID in the merchant’s system                                                                              |
| payerInfo.fingerprint   | string                                                 | Device fingerprint                                                                                                   |
| payerInfo.registeredAt  | integer <mark style="color:red;">**(required)**</mark> | UNIX timestamp of user registration in the merchant’s system                                                         |
| payerInfo.email         | string                                                 | User email                                                                                                           |
| payerInfo.phone         | string                                                 | User phone                                                                                                           |
| payerInfo.userFirstName | string                                                 | <p>User first name<br><sub><mark style="color:red;">required for KRW</mark></sub></p>                                |
| payerInfo.userLastName  | string                                                 | <p>User last name<br><sub><mark style="color:red;">required for KRW</mark></sub></p>                                 |

**Example Request Body**

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

```json
{
    "amount": 100,
    "currencyId": "KZT",
    "ttl": 900,
    "merchantOrderId": {{merchantOrderId}},
    "callbackUrl": "https://webhook.site/c7e3b35d-3e0b-42e7-a46b-e51b98e865c4",
    "merchantURL": "https://merchant-website.com/",
    "successRedirectURL": "https://webhook.site?success=1",
    "failedRedirectURL": "https://webhook.site?error=1",
    "comment": "iPhone 17 Pro Max 1Tb",
    "payerInfo": {
        "ip": "176.221.227.144",
        "userId": "3",
        "email": "jack@email.com",
        "phone": "+995555555555",
        "userFirstName": "Jack",
        "userLastName": "Hoverton",
        "registeredAt": 1695057185
    }
}
```

{% endtab %}

{% tab title="quasi AZN" %}

```json
{
    "amount": 230,
    "currencyId": "AZN",
    "ttl": 5000,
    "merchantOrderId": {{merchantOrderId}},
    "callbackUrl": "https://webhook.site/c7e3b35d-3e0b-42e7-a46b-e51b98e865c4",
    "merchantURL": "https://merchant-website.com/",
    "successRedirectURL": "https://webhook.site/?success=1",
    "failedRedirectURL": "https://webhook.site/?error=1",
    "comment": "Order #12331",
    "payerInfo": {
        "ip": "176.221.227.144",
        "userId": "3",
        "userFirstName": "Jack",
        "userLastName": "Hoverton",
        "registeredAt": 1695057185
    }
}
```

{% endtab %}
{% endtabs %}

**Response**

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

```json
{
    "ok": true,
    "order": {
        "orderUid": "e2f657da-a776-4fd0-b9bd-5ed1fd75bd7b",
        "amountRequested": 100,
        "currencyIdRequested": "KZT",
        "paymentUrl": "https://....."
    }
}
```

| Name                | Type   | Description                                                                         |
| ------------------- | ------ | ----------------------------------------------------------------------------------- |
| orderUid            | string | Order UID in our system                                                             |
| paymentUrl          | string | The customer must be redirected to this payment URL to proceed with the transaction |
| amountRequested     | number | Amount the client should send                                                       |
| currencyIdRequested | string | <p>Payment currency:<br><code>RUB, USD, EUR, UAH, AZN ...</code></p>                |
| {% 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/ar/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/ar/payin/payin-e-com-redirect.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.
