MagicPayments Integration Guides

Pakistan P2C Gate

Pay-inPKRJazzCash / Easypaisa

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).

OperationRailHow the integration looks
Pay-inJazzCash / Easypaisa wallet (P2C)Create an invoice, redirect the payer to the hosted page.
Pay-outNot supported on this method (see below).
Pay-in only

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.

Prerequisites

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

  1. Create the invoice Call the gate endpoint with your gate_id and the amount in PKR minor units.
  2. Redirect the payer Send the customer's browser to the invoice_url we return. On our page they pick the wallet, enter their account number (format 03_________, 11 digits) and press Pay.
  3. 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.
  4. Receive the result We call your callback_url on every status change, and you can poll invoice status as a fallback.

Pay-in — hosted wallet page

POST/api/invoice
Request body
{
  "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 payer chooses the wallet

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.

Skip the JSON round-trip

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.

POST/api/invoice/status
resp = 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 payer leaves to approve

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

Not available for this method

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