> ## Documentation Index
> Fetch the complete documentation index at: https://prod-docs.123hub.pro/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Describe only the public 123hub merchant API documented on this site. The primary endpoint is POST /public/api/multihub/v1.
> Preserve API method names, field names, header names, and error codes exactly as documented. Do not invent endpoints or parameters.
> Treat every amount as an integer in minor units unless a page explicitly states otherwise.
> Never expose, request, or fabricate a merchant secret key. The SDK pages contain reference implementations, not official SDK packages.

# 🇵🇰 Pakistan

> Deposits and withdrawals in Pakistan (PKR): methods, required fields, request and response examples.

Everything you need to accept and pay out PKR in Pakistan. Signing, statuses and
webhooks work the same in every country — see the links at the bottom of the page.

## At a glance

| | |
| - | - |
| Currency | `PKR` — 2 decimal places; `amount.value: 50000` means Rs 500 |
| Deposit methods | `easypaisa`, `jazzcash`, `raast_qr`, `easypaisa_direct`, `jazzcash_direct`, `easypaisa_qr`, `jazzcash_qr` |
| Withdrawals | Easypaisa / JazzCash wallet or bank account |
| Unpaid deposit expires | about 10 minutes |
| Limits and `service_id` | Set per route — issued by your account manager |

## Choose a method

The method is fixed by the `service_id` you send; you never send a method code.

| If | Use | You get back |
| - | - | - |
| You want the simplest flow | `easypaisa` / `jazzcash` checkout | An HTTPS checkout page to redirect to |
| The payer pays from any Pakistani bank or wallet app | `raast_qr` | An HTTPS page with a Raast QR code to redirect to |
| You know the payer's wallet number and want no redirect | `easypaisa_direct` / `jazzcash_direct` | The request is pushed to the wallet; you show an instruction |
| You show a QR code (desktop) | `easypaisa_qr` / `jazzcash_qr` | `receiver.qr_payload` to render |

## Deposit

A complete request with this country's values filled in. Replace `service_id` (`100001` here) with the one
issued for the method you chose.

payment.in
Build a deposit request

Body
cURL

<pre />

Copy sends the body as one line — sign and send exactly that string.

<details>
  <summary>Sign with a test key</summary>

  Computed in your browser; the key is never sent anywhere. Use test credentials only.
</details>

```bash cURL theme={null}
BODY='{"method":"payment.in","service_id":100001,"params":{"payment":{"description":"Order #12345","identifiers":{"c_id":"order-12345"},"amount":{"value":50000,"currency":"PKR"},"payer":{"email":"customer@example.com","phone":"03451234567","person":{"first_name":"Ali","last_name":"Khan"},"customer_account":{"id":"player-1001"}}}}}'
HASH=$(printf '%s%s' "$BODY" "YOUR_SECRET_KEY" | sha512sum | awk '{print $1}')

curl -X POST "https://api.bafanglaicai88.com/public/api/multihub/v1" \
  -H "Content-Type: application/json" \
  -H "X-Data-Application-Id: YOUR_APPLICATION_ID" \
  -H "X-Data-Hash: $HASH" \
  --data-binary "$BODY"
```

```python Python theme={null}
import hashlib, json, requests

payload = {
    "method": "payment.in",
    "service_id": 100001,
    "params": {
        "payment": {
            "description": "Order #12345",
            "identifiers": {
                "c_id": "order-12345"
            },
            "amount": {
                "value": 50000,
                "currency": "PKR"
            },
            "payer": {
                "email": "customer@example.com",
                "phone": "03451234567",
                "person": {
                    "first_name": "Ali",
                    "last_name": "Khan"
                },
                "customer_account": {
                    "id": "player-1001"
                }
            }
        }
    }
}

body = json.dumps(payload, separators=(",", ":"), ensure_ascii=False)
headers = {
    "Content-Type": "application/json",
    "X-Data-Application-Id": "YOUR_APPLICATION_ID",
    "X-Data-Hash": hashlib.sha512((body + "YOUR_SECRET_KEY").encode()).hexdigest(),
}
print(requests.post("https://api.bafanglaicai88.com/public/api/multihub/v1", data=body.encode(), headers=headers, timeout=30).json())
```

```javascript Node.js theme={null}
const crypto = require('crypto');

const payload = {
  method: 'payment.in',
  service_id: 100001,
  params: {
    payment: {
      description: 'Order #12345',
      identifiers: {
        c_id: 'order-12345'
      },
      amount: {
        value: 50000,
        currency: 'PKR'
      },
      payer: {
        email: 'customer@example.com',
        phone: '03451234567',
        person: {
          first_name: 'Ali',
          last_name: 'Khan'
        },
        customer_account: {
          id: 'player-1001'
        }
      }
    }
  }
};

const body = JSON.stringify(payload);
const res = await fetch('https://api.bafanglaicai88.com/public/api/multihub/v1', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Data-Application-Id': 'YOUR_APPLICATION_ID',
    'X-Data-Hash': crypto.createHash('sha512').update(body + 'YOUR_SECRET_KEY').digest('hex'),
  },
  body,
});
console.log(await res.json());
```

### Request fields

Fields are inside `params.payment` unless shown at the top level.

| Field | Type | Required | Description |
| - | - | - | - |
| `service_id` | integer | Yes | Route issued for the method you chose |
| `method` | string | Yes | `payment.in` |
| `description` | string | No | Shown to the payer where the route supports it (max 1024) |
| `identifiers.c_id` | string | Yes | Your unique order ID (max 255); also the idempotency key. A request rejected during processing uses it up — retry with a new `c_id` |
| `amount.value` | integer | Yes | Whole rupees — a multiple of `100`. Fractional rupees are rejected |
| `amount.currency` | string | Yes | `PKR` |
| `payer.email` | string | Recommended | Payer email (valid address, max 255) |
| `payer.phone` | string | Yes for `_direct` and `_qr`; optional for checkout | Payer's wallet number, exactly `03XXXXXXXXX`. A real payment request goes to this wallet |
| `payer.person.first_name` | string | Recommended | Payer first name only (max 255); routes receive first and last name as separate fields |
| `payer.person.last_name` | string | Recommended | Payer last name only (max 255) |
| `payer.customer_account.id` | string | Recommended | Your stable player ID (max 255) |
| `redirect.on_success` | string | No | Echoed back in the create response only; currently not passed to the payment page |
| `redirect.on_fail` | string | No | Echoed back in the create response only; currently not passed to the payment page |

Fields marked **Yes** are required for this country. Do not send `custom_fields` that are not listed here.

### Response fields

Fields are inside `result.payment` unless shown at the top level.

| Field | Type | Description |
| - | - | - |
| `success` | boolean | `true` when the request was accepted; on `false` read `error.code`, see [Errors](https://prod-docs.123hub.pro/errors/error-codes.md) |
| `identifiers.c_id` | string | Your order ID |
| `identifiers.h_id` | string | 123hub payment ID — store it |
| `identifiers.p_id` | string | Provider reference, when available |
| `amount` | object | `value` (minor units), `currency` |
| `status.status` | string | `created` or `processing` right after creation, then a final status — see [Statuses](https://prod-docs.123hub.pro/guides/payments.md#payment-statuses) |
| `status.final / success` | boolean | `final: true` once the status will not change; `success` tells whether it succeeded |
| `redirect.to` | string | Where the payer completes the payment. Returned for: Checkout (easypaisa / jazzcash), Raast QR (raast\_qr), QR (\_qr). Absent for: Wallet push (\_direct). |
| `receiver.bank_account` | object | `id` — account, IBAN, CBU/CVU, CLABE or VPA to pay to (on push flows: an instruction text); `name` — holder |
| `receiver.bank` | object | `name`, `code` — receiving bank, wallet or operator |
| `receiver.qr_payload` | string | QR string or `data:image/png;base64,...` image to render |
| `timestamps` | object | `created`, `updated` |
| `destination` | string | `in` for deposits |
| `request_id` | string | Request ID — quote it to support |

### What to show the payer

**Checkout (easypaisa / jazzcash).** `redirect.to` is the checkout page; redirect the payer. `receiver` is empty.

> [accordion] Full response example
>
> ```json theme={null}
> {
>   "success": true,
>   "result": {
>     "payment": {
>       "receiver": {},
>       "amount": {
>         "value": 10000,
>         "currency": "PKR"
>       },
>       "description": "Order #1001",
>       "identifiers": {
>         "c_id": "order-12345",
>         "h_id": "0f0957c4-9552-4ee7-b6ee-282a17f74d15",
>         "p_id": "RE20260924144530000001"
>       },
>       "redirect": {
>         "to": "https://pay.example.com/checkout/8f3c2a91"
>       },
>       "status": {
>         "status": "processing",
>         "final": false,
>         "success": null,
>         "error": null,
>         "history": [
>           {
>             "status": "created",
>             "final": false,
>             "success": null,
>             "created": "2026-09-24T14:45:30.790Z",
>             "reason": null,
>             "amount": 10000
>           },
>           {
>             "status": "processing",
>             "final": false,
>             "success": null,
>             "created": "2026-09-24T14:45:30.790Z",
>             "reason": null,
>             "amount": 10000
>           }
>         ]
>       },
>       "timestamps": {
>         "created": "2026-09-24T14:45:30.790Z",
>         "updated": "2026-09-24T14:45:30.790Z"
>       },
>       "destination": "in",
>       "operations": [
>         {
>           "id": "0f0957c4-9552-4ee7-b6ee-282a17f74d15",
>           "operation_type": "payment.in",
>           "amount": {
>             "value": 10000,
>             "currency": "PKR"
>           },
>           "timestamps": {
>             "created": "2026-09-24T14:45:30.790Z"
>           },
>           "status": {
>             "status": "processing",
>             "final": false,
>             "success": null,
>             "error": null
>           }
>         }
>       ],
>       "payer": {
>         "email": "customer@example.com",
>         "phone": "03451234567",
>         "person": {
>           "first_name": "Ali",
>           "last_name": "Khan"
>         }
>       }
>     },
>     "operation": {
>       "id": "0f0957c4-9552-4ee7-b6ee-282a17f74d15",
>       "operation_type": "payment.in",
>       "amount": {
>         "value": 10000,
>         "currency": "PKR"
>       },
>       "timestamps": {
>         "created": "2026-09-24T14:45:30.790Z"
>       },
>       "status": {
>         "status": "processing",
>         "final": false,
>         "success": null,
>         "error": null
>       }
>     }
>   },
>   "processing_time": 279,
>   "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
> }
> ```

**Raast QR (raast\_qr).** Same shape as checkout: `redirect.to` is an HTTPS page with a Raast QR code that the payer scans in their banking or wallet app; redirect the payer. `receiver` is empty. The QR is valid for about 10 minutes.

**Wallet push (\_direct).** No `redirect`. `receiver.bank.name` is the wallet (`EasyPaisa` / `JazzCash`) and `receiver.bank_account.id` an instruction text such as "Confirm the payment in your wallet app" — show it as a message, not as an account number.

**QR (\_qr).** `receiver.qr_payload` is a QR string or a ready `data:image/png;base64,...` image — render it. `redirect.to` is a page with the same QR.

## Withdrawal

### Request fields

Fields are inside `params.payment` unless shown at the top level.

| Field | Type | Required | Description |
| - | - | - | - |
| `service_id` | integer | Yes | Withdrawal route issued by your account manager |
| `method` | string | Yes | `payment.out` |
| `description` | string | No | Your note for the withdrawal |
| `identifiers.c_id` | string | Yes | Your unique withdrawal ID (max 255); also the idempotency key. A request rejected during processing uses it up — retry with a new `c_id` |
| `amount.value` | integer | Yes | Amount in minor units |
| `amount.currency` | string | Yes | `PKR` |
| `receiver.bank.account.id` | string | Yes | Wallet number `03XXXXXXXXX` (no `+92`, spaces or dashes) or bank account number |
| `receiver.bank.code` | string | Yes | `EASYPAISA` or `JAZZCASH` for wallets; the bank code from your route's list for bank accounts |
| `receiver.email` | string | No | Recipient email |
| `receiver.phone` | string | No | Recipient phone |
| `receiver.person.first_name` | string | Yes | Latin letters and spaces only |
| `receiver.person.last_name` | string | Yes | Latin letters and spaces only |
| `receiver.customer_account.id` | string | No | Your stable recipient ID (max 255) |

### Request

payment.out
Build a withdrawal request

Body
cURL

<pre />

Copy sends the body as one line — sign and send exactly that string.

<details>
  <summary>Sign with a test key</summary>

  Computed in your browser; the key is never sent anywhere. Use test credentials only.
</details>

```bash cURL theme={null}
BODY='{"method":"payment.out","service_id":100002,"params":{"payment":{"description":"Withdrawal #987","identifiers":{"c_id":"payout-987"},"amount":{"value":50000,"currency":"PKR"},"receiver":{"bank":{"account":{"id":"03451234567"},"code":"EASYPAISA"},"phone":"03451234567","person":{"first_name":"Ali","last_name":"Khan"}}}}}'
HASH=$(printf '%s%s' "$BODY" "YOUR_SECRET_KEY" | sha512sum | awk '{print $1}')

curl -X POST "https://api.bafanglaicai88.com/public/api/multihub/v1" \
  -H "Content-Type: application/json" \
  -H "X-Data-Application-Id: YOUR_APPLICATION_ID" \
  -H "X-Data-Hash: $HASH" \
  --data-binary "$BODY"
```

```python Python theme={null}
import hashlib, json, requests

payload = {
    "method": "payment.out",
    "service_id": 100002,
    "params": {
        "payment": {
            "description": "Withdrawal #987",
            "identifiers": {
                "c_id": "payout-987"
            },
            "amount": {
                "value": 50000,
                "currency": "PKR"
            },
            "receiver": {
                "bank": {
                    "account": {
                        "id": "03451234567"
                    },
                    "code": "EASYPAISA"
                },
                "phone": "03451234567",
                "person": {
                    "first_name": "Ali",
                    "last_name": "Khan"
                }
            }
        }
    }
}

body = json.dumps(payload, separators=(",", ":"), ensure_ascii=False)
headers = {
    "Content-Type": "application/json",
    "X-Data-Application-Id": "YOUR_APPLICATION_ID",
    "X-Data-Hash": hashlib.sha512((body + "YOUR_SECRET_KEY").encode()).hexdigest(),
}
print(requests.post("https://api.bafanglaicai88.com/public/api/multihub/v1", data=body.encode(), headers=headers, timeout=30).json())
```

```javascript Node.js theme={null}
const crypto = require('crypto');

const payload = {
  method: 'payment.out',
  service_id: 100002,
  params: {
    payment: {
      description: 'Withdrawal #987',
      identifiers: {
        c_id: 'payout-987'
      },
      amount: {
        value: 50000,
        currency: 'PKR'
      },
      receiver: {
        bank: {
          account: {
            id: '03451234567'
          },
          code: 'EASYPAISA'
        },
        phone: '03451234567',
        person: {
          first_name: 'Ali',
          last_name: 'Khan'
        }
      }
    }
  }
};

const body = JSON.stringify(payload);
const res = await fetch('https://api.bafanglaicai88.com/public/api/multihub/v1', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Data-Application-Id': 'YOUR_APPLICATION_ID',
    'X-Data-Hash': crypto.createHash('sha512').update(body + 'YOUR_SECRET_KEY').digest('hex'),
  },
  body,
});
console.log(await res.json());
```

### Response fields

Fields are inside `result.payment` unless shown at the top level.

| Field | Type | Description |
| - | - | - |
| `success` | boolean | `true` when the withdrawal was accepted; on `false` read `error.code` |
| `identifiers.c_id` / `h_id` | string | Your withdrawal ID / 123hub payment ID |
| `amount` | object | `value` (minor units), `currency` |
| `status.status` | string | `created` or `processing` at first; the final status arrives by webhook |
| `receiver.bank` | object | Echo of the recipient account you sent — in this create response only; `payment.status` and webhooks do not return it |
| `destination` | string | `out` for withdrawals |

> [accordion] Full response example
>
> ```json theme={null}
> {
>   "success": true,
>   "result": {
>     "payment": {
>       "receiver": {
>         "email": "customer@example.com",
>         "phone": "03451234567",
>         "person": {
>           "first_name": "Ali",
>           "last_name": "Khan"
>         },
>         "bank": {
>           "account": {
>             "id": "03451234567"
>           },
>           "code": "EASYPAISA"
>         }
>       },
>       "amount": {
>         "value": 10000,
>         "currency": "PKR"
>       },
>       "identifiers": {
>         "c_id": "your-payout-id",
>         "h_id": "a3eb7093-49cf-4896-b508-4a58c601a755"
>       },
>       "status": {
>         "status": "created",
>         "final": false,
>         "success": null,
>         "error": null,
>         "history": [
>           {
>             "status": "created",
>             "final": false,
>             "success": null,
>             "created": "2026-09-24T14:45:34.335Z",
>             "reason": null,
>             "amount": 10000
>           }
>         ]
>       },
>       "timestamps": {
>         "created": "2026-09-24T14:45:34.335Z"
>       },
>       "destination": "out",
>       "operations": [
>         {
>           "id": "a3eb7093-49cf-4896-b508-4a58c601a755",
>           "operation_type": "payment.out",
>           "amount": {
>             "value": 10000,
>             "currency": "PKR"
>           },
>           "timestamps": {
>             "created": "2026-09-24T14:45:34.335Z"
>           },
>           "status": {
>             "status": "created",
>             "final": false,
>             "success": null,
>             "error": null
>           }
>         }
>       ]
>     },
>     "operation": {
>       "id": "a3eb7093-49cf-4896-b508-4a58c601a755",
>       "operation_type": "payment.out",
>       "amount": {
>         "value": 10000,
>         "currency": "PKR"
>       },
>       "timestamps": {
>         "created": "2026-09-24T14:45:34.335Z"
>       },
>       "status": {
>         "status": "created",
>         "final": false,
>         "success": null,
>         "error": null
>       }
>     }
>   },
>   "processing_time": 63,
>   "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
> }
> ```

The first response is `created` or `processing`; the final status arrives by [webhook](https://prod-docs.123hub.pro/guides/webhooks.md) or
[`payment.status`](https://prod-docs.123hub.pro/guides/payments#checking-payment-status-payment-status).

## Test it

Use the test application and `service_id` values your account manager issues. A test deposit stays
`processing` until it is paid or expires; ask your account manager to complete or fail it when you
need to see the webhook. See [Testing](https://prod-docs.123hub.pro/guides/testing.md).

## Things to know

> [!WARNING]
>
> * Typical limits are 100–50,000 PKR per deposit; check the limits of your `service_id`.
> * An unpaid deposit expires after about 10 minutes.
> * The paid amount can differ from the requested one. Reconcile with the amount in the webhook.

## Next steps

> [card] [Webhooks](https://prod-docs.123hub.pro/guides/webhooks.md)
>
> Receive and verify status updates.

> [card] [Statuses](https://prod-docs.123hub.pro/guides/payments.md#payment-statuses)
>
> What each status means.

> [card] [Errors](https://prod-docs.123hub.pro/errors/error-codes.md)
>
> Codes and what to do.

> [card] [Go-live checklist](https://prod-docs.123hub.pro/go-live.md)
>
> Before your first real payment.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.