Pakistan P2C Gate
Accept JazzCash and Easypaisa wallet pay-ins on a MagicPayments-hosted page in Pakistani Rupee (PKR). Pay-in only — this method does not support payouts.
When to use it
The Pakistan P2C ("pay-to-company") Gate accepts mobile-wallet pay-ins via
JazzCash and Easypaisa on a MagicPayments-hosted page. The payer enters
their wallet account number and approves a push request inside their wallet app — no card, no card data on
your side. Amounts are in PKR (Pakistani Rupee, 2 decimal places — so 250000
means PKR 2,500.00).
| Operation | Rail | How the integration looks |
|---|---|---|
| Pay-in | JazzCash / Easypaisa wallet (P2C) | Create an invoice, redirect the payer to the hosted page. |
| Pay-out | — | Not supported on this method (see below). |
The Pakistan P2C Gate is a collection-only method — there is no payout rail for JazzCash/Easypaisa here. Don't build a disbursement flow against this gate. If you need to send funds out, ask your account manager which payout-capable cascade to use and follow the matching guide.
You need your signing credentials from Getting started and a
pay-in gate_id for the Pakistan wallet gate (JazzCash and/or Easypaisa).
Your account manager provides it.
How the hosted P2C flow works
-
Create the invoice
Call the gate endpoint with your
gate_idand the amount in PKR minor units. -
Redirect the payer
Send the customer's browser to the
invoice_urlwe return. On our page they pick the wallet, enter their account number (format03_________, 11 digits) and press Pay. - Payer approves in their wallet app We push a payment request to JazzCash/Easypaisa; the customer approves it inside the app to complete the payment.
-
Receive the result
We call your
callback_urlon every status change, and you can poll invoice status as a fallback.
Pay-in — hosted wallet page
/api/invoice{
"gate_id": "pk-wallet-gate",
"invoice": {
"invoice_id": "order-pk-2026-000123",
"currency": "PKR",
"amount": 250000,
"description": "Wallet top-up",
"ttl_minutes": 20
},
"customer": {
"id": "cust-88412",
"full_name": "Ahmed Raza",
"phone_number": "+923000000000"
},
"workflow_hooks": {
"callback_url": "https://merchant.example.com/mp/callbacks",
"return_success_url": "https://merchant.example.com/orders/123/done",
"return_decline_url": "https://merchant.example.com/orders/123/retry"
}
}
Python
resp = signed_post("/api/invoice", {
"gate_id": "pk-wallet-gate",
"invoice": {
"invoice_id": "order-pk-2026-000123",
"currency": "PKR",
"amount": 250_000, # PKR 2,500.00 (2 decimals)
"description": "Wallet top-up",
"ttl_minutes": 20,
},
"customer": {
"id": "cust-88412",
"full_name": "Ahmed Raza",
"phone_number": "+923000000000",
},
"workflow_hooks": {
"callback_url": "https://merchant.example.com/mp/callbacks",
"return_success_url": "https://merchant.example.com/orders/123/done",
"return_decline_url": "https://merchant.example.com/orders/123/retry",
},
})
redirect_url = resp.json()["invoice_url"] # send the payer here
Response
{
"request_status": "success",
"invoice_id": "7e2c9a14-3d55-4f80-b1a2-6c0d9e3f8a44",
"merchant_invoice_id": "order-pk-2026-000123",
"invoice_status": "unpaid",
"invoice_url": "https://stage.example-mp.com/public/invoice/7e2c9a14-.../gate",
"message": "Invoice (Gate PayIn) with internal uid=7e2c9a14-... has been created."
}
The customer selects JazzCash or Easypaisa and enters the account number on our hosted page, so you
don't send wallet details in the create call. Passing customer.phone_number is optional but
helps reconciliation.
To have us redirect straight to the hosted page from the create call, set
"redirect_to_gate_payment_page": true at the top level of the request body and follow the
303 redirect instead of reading invoice_url.
Tracking the pay-in
Look the invoice up by your own id (or our invoice_uid). It reaches paid once the
payer approves in their wallet app.
/api/invoice/statusresp = signed_post("/api/invoice/status", {
"merchant_invoice_id": "order-pk-2026-000123"
})
invoice = resp.json()
# invoice["status"] -> "paid" | "payment_failed" | "expired" | "declined_by_payer" | ...
# invoice["actual_payment"]["processing_info"]["amount_acquired"] -> settled PKR minor units
The customer switches to their wallet app to approve, so the invoice can sit in
unpaid/paying briefly. Rely on the callback rather than tight polling, and set a
ttl_minutes that matches how long you'll hold the order.
Pay-out
The Pakistan P2C Gate does not support payouts to JazzCash/Easypaisa. There is no payout endpoint to call for this method. For disbursements, use a payout-capable cascade and the relevant guide, or contact your account manager.
Testing & go-live
- On stage, use the test
gate_idfrom your account manager; no real funds move. - Drive a pay-in to
paidwith both JazzCash and Easypaisa, and confirm an expired/declined path too. - Confirm your PKR amount conversion:
amountis minor units with 2 decimal places. - Make sure your callback handler verifies the
X-MP-Signatureand is idempotent. - Swap base URL and credentials to production; the request shape is identical.