> For the complete documentation index, see [llms.txt](https://piqpay.gitbook.io/merchant-integration/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://piqpay.gitbook.io/merchant-integration/h2h-host-to-host-integration/bdt/order-creation-deposit.md).

# Order creation (deposit)

The following methods are available for creating orders in BDT:&#x20;

<table><thead><tr><th>Name</th><th width="232.6929931640625">Method</th><th>Type</th></tr></thead><tbody><tr><td>BKASH P2C</td><td>PMC_S2P_BKASH</td><td>redirect</td></tr><tr><td>BKASH P2P</td><td>PMC_S2P_BKASH_AGENT</td><td>H2H, redirect</td></tr><tr><td>BKASH Alternative</td><td>PMC_S2P_BKASH_WALLET</td><td>redirect</td></tr><tr><td>NAGAD P2C</td><td>PMC_S2P_NAGAD</td><td>redirect</td></tr><tr><td>NAGAD P2P</td><td>PMC_S2P_NAGAD_AGENT</td><td>H2H, redirect</td></tr><tr><td>NAGAD Alternative</td><td>PMC_S2P_NAGAD_WALLET</td><td>redirect</td></tr><tr><td>UPAY P2C</td><td>PMC_S2P_UPAY</td><td>redirect</td></tr><tr><td>UPAY P2P</td><td>PMC_S2P_UPAY_AGENT</td><td>H2H, redirect</td></tr><tr><td>UPAY Alternative</td><td>PMC_S2P_UPAY_WALLET</td><td>redirect</td></tr></tbody></table>

{% hint style="success" %}
**Tips**: Using the "BKASH Alternative" gives your client the opportunity to receive an additional bonus — cashback paid by the PiqPay project.\
To credit the user's deposit amount along with the cashback on his balance on your site, you should refer to the "amount" field in the COMPLETED order callback (check the Callback section).
{% endhint %}

{% hint style="info" %}
In the DEV (test) environment, you can test creating orders using the BKASH, BKASH\_WALLET, NAGAD\_WALLET, and UPAY\_WALLET methods (the NAGAD, BKASH\_AGENT, NAGAD\_AGENT, UPAY, and UPAY\_AGENT methods are not available in the DEV environment).

You can also test receiving callbacks for orders with the CREATED, CANCELLED, and EXPIRED statuses for  all methods, as well as the COMPLETED status for the BKASH method.
{% endhint %}

To create an order using these methods, you need to send a POST request with the following parameters in the body.

**Request Body Fields**

**apiKey** (string) - the API key you created for your brand (the Secret Key is specified in the request header as Bearer token);

**amount** (object)  - the order amount, type: integer, and the order currency, type: string (example amount: 1000 BDT = 100000 minorAmount);

**paymentMethod** (string) - the order payment method (you can find a list of available methods in the "Methods: Order and Withdrawal" section);

**clientId** (string) - the unique user ID in your system;

**externalId** (string) - the unique order ID in your system;

**callbackUrl** (string, optional) - the URL to which callbacks (notifications) will be sent when an order is created and its status changes;

**redirectUrl** (string, optional) - the link your client will be redirected to after successful payment of the order by clicking the button on the checkout page;

**failureUrl** (string, optional) - the link your client will be redirected to in the event of an order payment failure by clicking the button on the checkout page;

**cancelUrl** (string, optional) - the link your client will be redirected to if the order is canceled by clicking the button on the checkout page.

{% hint style="info" %}
On the checkout page, the "Close" button links (for the PMC\_S2P\_BKASH\_AGENT, PMC\_S2P\_BKASH\_WALLET, PMC\_S2P\_NAGAD\_AGENT, and PMC\_S2P\_NAGAD\_WALLET methods):

to the link in the redirectUrl field if the order is successful;

to the link in the cancelUrl field if the order is canceled by the user or from the backoffice;

to the link in the failureUrl field if an error occurred while creating the order.

On the checkout page, the "Exit" button always links to the link in the redirectUrl.

If the redirectUrl field is not specified in the request, the "Close" and "Exit" buttons will not appear on the checkout page, regardless of the order status.

If the redirectUrl field is not specified in the order body, then the cancelUrl and failureUrl fields do not need to be specified.

For the PMC\_S2P\_BKASH and PMC\_S2P\_NAGAD methods, redirection occurs automatically, according to the order status.
{% endhint %}

After successfully creating an order, you will receive a response to the API request with a link to the payment page (the link is in the checkoutUrl field). You should redirect your client to this page to pay for the order.

If you get an error after sending an API request, please check it in the "[API error](/merchant-integration/additional-information/api-errors.md)" section.

{% hint style="info" %}
In addition, we return payment details (in the requisites field) in the BKASH\_AGENT and NAGAD\_AGENT methods in the order creation request response. You can use these details to display on your site to avoid redirecting the client to our page.
{% endhint %}

{% hint style="info" %}
Partial payment of an order is available for the BKASH\_AGENT, BKASH\_WALLET, NAGAD\_AGENT, NAGAD\_WALLET, as well as UPAY\_AGENT, UPAY\_WALLET methods.
{% endhint %}

**Example of a request to create an order using the PMC\_S2P\_BKASH  method**

{% code overflow="wrap" %}

```json
POST https://eha.piqpay.codes/v1/orders
Authorization: Bearer ${secretKey}

{
    "apiKey": "<API_KEY>",
    "amount": {
       "currency": "BDT",
       "minorAmount": 50000
   },
   "paymentMethod": "PMC_S2P_BKASH",
   "clientId": "123456789",
   "externalId": "123456789",
   "redirectUrl": "https://example.com/redirect",
   "callbackUrl": "https://example.com/callback",
   "failureUrl": "https://example.com/failure",
   "cancelUrl": "https://example.com/cancel"
}
```

{% endcode %}

**Example of a request to create an order using the PMC\_S2P\_BKASH\_AGENT method**

{% code overflow="wrap" %}

```json
POST https://eha.piqpay.codes/v1/orders
Authorization: Bearer ${secretKey}

{
    "apiKey": "<API_KEY>",
    "amount": {
       "currency": "BDT",
       "minorAmount": 50000
   },
   "paymentMethod": "PMC_S2P_BKASH_AGENT",
   "clientId": "123456789",
   "externalId": "123456789",
   "redirectUrl": "https://example.com/redirect",
   "callbackUrl": "https://example.com/callback",
   "failureUrl": "https://example.com/failure",
   "cancelUrl": "https://example.com/cancel"
}
```

{% endcode %}

**Example of a request to create an order using the PMC\_S2P\_BKASH\_WALLET method**

{% code overflow="wrap" %}

```json
POST https://eha.piqpay.codes/v1/orders
Authorization: Bearer ${secretKey}

{
    "apiKey": "<API_KEY>",
    "amount": {
       "currency": "BDT",
       "minorAmount": 50000
   },
   "paymentMethod": "PMC_S2P_BKASH_WALLET",
   "clientId": "123456789",
   "externalId": "123456789",
   "redirectUrl": "https://example.com/redirect",
   "callbackUrl": "https://example.com/callback",
   "failureUrl": "https://example.com/failure",
   "cancelUrl": "https://example.com/cancel"
}
```

{% endcode %}

**Example of a request to create an order using the PMC\_S2P\_NAGAD method**

{% code overflow="wrap" %}

```json
POST https://eha.piqpay.codes/v1/orders
Authorization: Bearer ${secretKey}

{
    "apiKey": "<API_KEY>",
    "amount": {
       "currency": "BDT",
       "minorAmount": 50000
   },
   "paymentMethod": "PMC_S2P_NAGAD",
   "clientId": "123456789",
   "externalId": "123456789",
   "redirectUrl": "https://example.com/redirect",
   "callbackUrl": "https://example.com/callback",
   "failureUrl": "https://example.com/failure",
   "cancelUrl": "https://example.com/cancel"
}
```

{% endcode %}

**Example of a request to create an order using the PMC\_S2P\_NAGAD\_AGENT method**

{% code overflow="wrap" %}

```json
POST https://eha.piqpay.codes/v1/orders
Authorization: Bearer ${secretKey}

{
    "apiKey": "<API_KEY>",
    "amount": {
       "currency": "BDT",
       "minorAmount": 50000
   },
   "paymentMethod": "PMC_S2P_NAGAD_AGENT",
   "clientId": "123456789",
   "externalId": "123456789",
   "redirectUrl": "https://example.com/redirect",
   "callbackUrl": "https://example.com/callback",
   "failureUrl": "https://example.com/failure",
   "cancelUrl": "https://example.com/cancel"
}
```

{% endcode %}

**Example of a request to create an order using the PMC\_S2P\_NAGAD\_WALLET method**

{% code overflow="wrap" %}

```json
POST https://eha.piqpay.codes/v1/orders
Authorization: Bearer ${secretKey}

{
    "apiKey": "<API_KEY>",
    "amount": {
       "currency": "BDT",
       "minorAmount": 50000
   },
   "paymentMethod": "PMC_S2P_NAGAD_WALLET",
   "clientId": "123456789",
   "externalId": "123456789",
   "redirectUrl": "https://example.com/redirect",
   "callbackUrl": "https://example.com/callback",
   "failureUrl": "https://example.com/failure",
   "cancelUrl": "https://example.com/cancel"
}
```

{% endcode %}

**Example of a request to create an order using the PMC\_S2P\_UPAY method**

{% code overflow="wrap" %}

```json
POST https://eha.piqpay.codes/v1/orders
Authorization: Bearer ${secretKey}

{
    "apiKey": "<API_KEY>",
    "amount": {
       "currency": "BDT",
       "minorAmount": 50000
   },
   "paymentMethod": "PMC_S2P_UPAY",
   "clientId": "123456789",
   "externalId": "123456789",
   "redirectUrl": "https://example.com/redirect",
   "callbackUrl": "https://example.com/callback",
   "failureUrl": "https://example.com/failure",
   "cancelUrl": "https://example.com/cancel"
}
```

{% endcode %}

**Example of a request to create an order using the PMC\_S2P\_UPAY\_AGENT method**

{% code overflow="wrap" %}

```json
POST https://eha.piqpay.codes/v1/orders
Authorization: Bearer ${secretKey}

{
    "apiKey": "<API_KEY>",
    "amount": {
       "currency": "BDT",
       "minorAmount": 50000
   },
   "paymentMethod": "PMC_S2P_UPAY_AGENT",
   "clientId": "123456789",
   "externalId": "123456789",
   "redirectUrl": "https://example.com/redirect",
   "callbackUrl": "https://example.com/callback",
   "failureUrl": "https://example.com/failure",
   "cancelUrl": "https://example.com/cancel"
}
```

{% endcode %}

**Example of a request to create an order using the PMC\_S2P\_UPAY\_WALLET method**

{% code overflow="wrap" %}

```json
POST https://eha.piqpay.codes/v1/orders
Authorization: Bearer ${secretKey}

{
    "apiKey": "<API_KEY>",
    "amount": {
       "currency": "BDT",
       "minorAmount": 50000
   },
   "paymentMethod": "PMC_S2P_UPAY_WALLET",
   "clientId": "123456789",
   "externalId": "123456789",
   "redirectUrl": "https://example.com/redirect",
   "callbackUrl": "https://example.com/callback",
   "failureUrl": "https://example.com/failure",
   "cancelUrl": "https://example.com/cancel"
}
```

{% endcode %}

After sending an API deposit request, you will receive a response from our server (example below). Once your deposit request is paid, you will receive a callback with the COMPLETED status (see the "Callback" section).

<details>

<summary>Example of a response to a request to create an order</summary>

{% code overflow="wrap" %}

```json
{"order": {
        "id": "90b75e64-b029-4d75-a129-22ffcc9be54d",
        "createdAt": "2026-02-05T14:21:28.129Z",
        "merchant": {
            "id": "8481fd2a-16f3-45cf-8eb0-7de1285d518a",
            "name": "NewNik",
            "picture": null
        },
        "store": {
            "id": "d8440d52-25a5-4e8e-907d-3d73dd3763a8",
            "name": "Best",
            "country": "BD","picture": null
        },
        "externalId": "123456789",
        "clientId": "123456789",
        "amount": {
            "minorAmount": 500000,
            "currency": "BDT"
        },
        "paymentFlow": "INTERNAL",
        "paymentMethod": {
            "code": "PMC_S2P_BKASH",
            "instructions": [
                "PHONE",
                "LEGAL_NAME"
            ]
        },
        "institution": "BKASH_BD",
        "readyForPaymentAt": null,
        "processingSince": null,
        "reason": null,
        "state": "READY_FOR_PAYMENT",
        "expiringAt": "2026-02-05T14:26:28.129Z",
        "redirectUrl": null,
        "failureUrl": null,
        "cancelUrl": null,
        "paymentUrl": null,
        "paymentQr": null,
        "paymentDeepLinks": null,
        "paymentCountry": null,
        "checkoutUrl": "https://checkout.piqpay.codes/90b75e64-b029-4d75-a129-fcc9be54d",
        "adjustment": null,
        "clientFlow": "REGULAR",
        "adjustedAt": null,
        "endClient": {
            "name": null,
            "account": null,
            "email": null,
            "phone": null,
            "institution": null,
            "billingAddress": null
        },
        "receiptConfig": null
    },
    "services": null,
    "requisites": null}

```

{% endcode %}

</details>

<br>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://piqpay.gitbook.io/merchant-integration/h2h-host-to-host-integration/bdt/order-creation-deposit.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
