Skip to main content

Initiate Payment

Create a pay-in session and receive a payment_url to redirect the customer to the wallet operator's payment page.

Applies to: Bangladesh · Nepal · Egypt · Iraq


Endpoint

MethodPOST
Path/payins/payments/initiate
Sandboxhttps://sandbox.simpaisa.com/payins/payments/initiate
Productionhttps://payin.simpaisa.com/payins/payments/initiate

Headers

HeaderRequiredDescription
AcceptYestext/plain, application/json, application/*+json
Content-TypeYesapplication/json
api-tokenYesMerchant API token
modeYespayin
regionYesBD · NP · EG · IQ
operatorIdYesOperator code — see regional configuration
versionYes3.0

Request Body

ParameterTypeRequiredDescription
merchantIdStringYesSimpaisa-assigned merchant ID (7 digits)
userKeyStringYesYour unique order reference
msisdnStringYesCustomer mobile number linked to the wallet
amountStringYesAmount to charge
operatorStringYes†Bangladesh only. Operator ID (must match operatorId header)
operatorIdStringYes†Nepal, Egypt, Iraq. Operator ID (must match operatorId header)
successUrlStringYesRedirect URL after successful payment
failureUrlStringYesRedirect URL after failed payment
productReferenceStringYesShort description of the product or service
platformStringNoPlatform identifier
currencyCodeStringNo*ISO currency — BDT · NPR · EGP · IQD
transactionTypeStringNo0 = one-time payment (default)

* Recommended for NP, EG, and IQ. Required for correct currency handling in those regions.

† Field name is region-specific for request and response: use operator for BD only; use operatorId for NP, EG, and IQ. Send one field, not both.


Response Body

ParameterTypeDescription
statusStringStatus code — 0037 means pending (redirect customer to pay)
messageStringHuman-readable status
merchantIdStringEcho of your merchant ID
userKeyStringEcho of your order reference
msisdnStringCustomer mobile number
amountStringTransaction amount
transactionIdStringSimpaisa transaction ID — store this for Inquire
payment_urlStringURL to redirect the customer to complete payment
operatorStringBangladesh only. Operator ID used
operatorIdStringNepal, Egypt, Iraq. Operator ID used
currencyCodeStringCurrency, when returned
transactionTypeStringTransaction type

Integration Steps

  1. Call Initiate with the correct region, operatorId, and body fields.
  2. If status is 0037 (Transaction-Pending), redirect the customer to payment_url.
  3. When the customer returns to successUrl or failureUrl, call Inquire with transactionId.
  4. Optionally handle the async postback.
info

payment_url is returned for sandbox and production. Redirect the customer's browser (or open in WebView) immediately after a successful Initiate call.


Samples

curl --location 'https://sandbox.simpaisa.com/payins/payments/initiate' \
--header 'api-token: YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--header 'mode: payin' \
--header 'region: BD' \
--header 'operatorId: 10001' \
--header 'version: 3.0' \
--data '{
"merchantId": "4000000",
"operator": "10001",
"msisdn": "1812345678",
"amount": "20.00",
"userKey": "order-22223452",
"successUrl": "https://merchant.example/success",
"failureUrl": "https://merchant.example/failure",
"productReference": "Top-up"
}'

Response

{
"status": "0037",
"message": "Transaction-Pending",
"merchantId": "4000000",
"userKey": "order-22223452",
"msisdn": "1812345678",
"amount": "20.00",
"transactionId": "110647",
"payment_url": "https://sandbox.simpaisa.com/payins-redirect/110647/530818005517471744"
}

Operator Use Cases

OperatorRegionDetails
bKashBDUse case: bKash
NagadBDUse case: Nagad
KhaltiNPUse case: Khalti
PaymobEGUse case: Paymob
ZainCashIQUse case: ZainCash