> 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/pkr/order-creation-deposit.md).

# Order creation (deposit)

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

| Name      | Method              | Type     |
| --------- | ------------------- | -------- |
| JAZZCCASH | PMC\_S2P\_JAZZCCASH | redirect |
| EASYPAISA | PMC\_S2P\_EASYPAISA | redirect |
| RAAST QR  | PMC\_S2P\_QR\_PAY   | H2H      |

{% hint style="info" %}
In the DEV (test) environment, you can try creating orders using the PMC\_S2P\_JAZZCCASH and PMC\_S2P\_EASYPAISA methods. You can also test receiving callbacks for orders with the following statuses: CREATED, COMPLETED, CANCELLED, and EXPIRED.
{% 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 PKR = 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;

**clientAccount** (string, optional) - client's phone number in national domestic format (starts with 03);

**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 "Back to Store" button links to:

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

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

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 "Back to Store" 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, neither the cancelUrl nor failureUrl fields need to be specified.
{% 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 need to redirect your client to this page to pay for the order.&#x20;

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" %}
If you are creating an order for a PKR deposit and have passed the client's phone number in the clientAccount field, you do not need to redirect the client to the checkoutUrl page; just wait for the order status callback.
{% endhint %}

{% hint style="info" %}
Partial payment of orders is not available for the JAZZCASH, EASYPAISA and RAAST QR methods.
{% endhint %}

**Example of a request to create a payout using the PMC\_S2P\_JAZZCASH method**

{% code overflow="wrap" %}

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

{
    "apiKey": "<API_KEY>",
    "amount": {
       "currency": "PKR",
       "minorAmount": 50000
   },
   "paymentMethod": "PMC_S2P_JAZZCASH",
   "clientId": "123456789",
   "externalId": "123456789",
   "clientAccount": "03006298786",
   "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 a payout using the PMC\_S2P\_EASYPAISA method**

{% code overflow="wrap" %}

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

{
    "apiKey": "<API_KEY>",
    "amount": {
       "currency": "PKR",
       "minorAmount": 50000
   },
   "paymentMethod": "PMC_S2P_EASYPAISA",
   "clientId": "123456789",
   "externalId": "123456789",
   "clientAccount": "03006298786",
   "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 a payout using the PMC\_S2P\_QR\_PAY method**

{% code overflow="wrap" %}

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

{
    "apiKey": "<API_KEY>",
    "amount": {
       "currency": "PKR",
       "minorAmount": 50000
   },
   "paymentMethod": "PMC_S2P_QR_PAY",
   "clientId": "123456789",
   "externalId": "123456789",
   "clientAccount": "03006298786",
   "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 is paid by customer, you will receive a callback with the COMPLETED status (see the "Callback" section).

<details>

<summary>Example of an order creation response</summary>

{% code overflow="wrap" %}

```json
{"order": {
        "id": "714213c5-54ca-4412-98d1-060896baf17b",
        "createdAt": "2026-02-19T08:07:50.643Z",
        "merchant": {
            "id": "8481fd2a-16f3-45cf-8eb0-7de1285d518a",
            "name": "NewNik",
            "picture": null
        },
        "store": {
            "id": "d8440d52-25a5-4e8e-907d-3d73dd3763a8",
            "name": "Best",
            "country": "RU",
            "picture": null
        },
        "externalId": "davvc4dc2ftаf4ffc5аssв3jrc1cdk",
        "clientId": "4d331ccdс712fccаfsff4ав5cr2",
        "amount": {
            "minorAmount": 50000,
            "currency": "PKR"
        },
        "paymentFlow": null,
        "paymentMethod": {
            "code": "PMC_S2P_JAZZCASH",
            "instructions": [
                "USERNAME",
                "ACCOUNT_NUMBER",
                "PASSWORD",
                "APP_SECRET"
            ]
        },
        "institution": null,
        "readyForPaymentAt": null,
        "processingSince": null,
        "reason": null,
        "state": "CREATED",
        "expiringAt": "2026-02-19T08:12:50.643Z",
        "redirectUrl": "https://cb.dev.acqproject.com/api/piqpay",
        "failureUrl": null,
        "cancelUrl": null,
        "paymentUrl": null,
        "paymentQr": null,
        "paymentDeepLinks": null,
        "paymentCountry": null,
        "checkoutUrl": "https://checkout.piqpay.codes/714213c5-54ca-4412-98d1-060896baf17b",
        "adjustment": null,
        "clientFlow": null,
        "adjustedAt": null,
        "endClient": {
            "name": null,
            "account": null,
            "email": null,
            "phone": null,
            "institution": null,
            "billingAddress": null
        },
        "receiptConfig": null
    },
    "services": null,
   "requisites": null
}
```

{% endcode %}

</details>


---

# 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/pkr/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.
