XPAY Jazzcash Subscription
The JazzCash Subscription is a server-side API that enables merchants to initiate recurring payment flows with customers using JazzCash.
Key Highlights:
- Redirection Flow: Merchants provide success and failure redirect URLs. After the customer completes the payment on JazzCash, they are redirected to the appropriate URL based on the payment result.
- Phone Number Required: The customer’s JazzCash phone number is required when initiating the subscription. This is used to create a secure token for future recurring charges.
- Webhook Notification: Upon successful payment, a webhook is triggered to the store's configured endpoint. This webhook includes the generated token, which can then be stored and used for future recurring payments.
bash
curl --location -g --request POST '{{base_url}}/public/v1/subscription/wallet/setup' \
--header 'x-api-key: {{x-api-key-sk}}' \
--header 'x-account-id: {{x-account-id}}' \
--header 'User-Agent: Apidog/1.0.0 (https://apidog.com)' \
--header 'Content-Type: application/json' \
--header 'x-signature: {{x-signature}}' \
--data-raw '{
"wallet_type": "jazzcash",
"phone":"03411234567",
"success_redirect_url":"https://webhook.site/68ba6181-38e5-498a-9aa5-ad67537aa53c",
"failure_redirect_url":"https://webhook.site/68ba6181-38e5-498a-9aa5-ad67537aa53c",
"payment_method_types":"wallet"
}'response will contain redirect_url where end-user can enter MPIN and OTP to complete the token creation flow
json
{
"success": true,
"responseStatus": "OK",
"message": "Request processed successfully.",
"data": {
"redirect_url": "https://xpay-checkout-stage.xstak.com/wallet/payment-setup?id=670cc16ca4f54be748916396&payment_setup_id=xpay_wallet_ad5fa24d4a4849768362789699b95d3b"
}
}