Initialize a payment
Creates a payment session and returns a URL to redirect your customer to.
The payment_type field determines which URL you get back:
payment_type | Flow | Redirect using |
|---|---|---|
1 | Direct to K-Net | direct_url |
2 | Direct to Credit Card | direct_url |
3 | Hosted Transit Page (includes Apple Pay) | transit_url |
Store the returned PaymentID — you need it to check the payment status and to issue refunds.
curl --request POST \
--url https://development.payzah.net/ws/paymentgateway/index \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"trackid": "ORDER-2001",
"amount": "11.250",
"currency": "414",
"success_url": "https://yourstore.com/success",
"error_url": "https://yourstore.com/error",
"payment_type": "3",
"language": "ENG",
"customer_name": "Ahmed Al-Rashid",
"customer_email": "[email protected]",
"customer_phone": "96512345678"
}
'{
"status": true,
"data": {
"PaymentUrl": "https://development.payzah.net/pgaction",
"PaymentID": "2019070115360420",
"transit_url": "https://devgateway.trytajer.app?id=202409271806248183",
"direct_url": ""
}
}Authorizations
Your private key, Base64-encoded.
Encode the key before sending it — for example base64_encode($privateKey) in PHP or
Buffer.from(privateKey).toString('base64') in Node.js. Paste the already-encoded
value here when testing from these docs.
Use your test key here. This console only calls the sandbox environment, so a production key will not authenticate.
Body
Your unique identifier for this transaction. Alphanumeric only — no special characters. Must never be reused.
255"ORDER-2001"
Transaction amount as a plain decimal string. No currency symbols, commas, or spaces.
10"11.250"
ISO 4217 numeric currency code. Use 414 for Kuwaiti Dinar.
3"414"
URL Payzah redirects the customer to after a successful payment.
255"https://yourstore.com/success"
URL Payzah redirects the customer to if payment fails or is cancelled.
255"https://yourstore.com/error"
Which checkout experience to use.
1 = direct to K-Net, 2 = direct to Credit Card, 3 = hosted Transit Page (includes Apple Pay).
1, 2, 3 "3"
Language shown on the Payzah payment page. Defaults to ENG.
ENG, ARA "ENG"
K-Net faster checkout customer ID, if the customer has enrolled in K-Net fast checkout.
Customer's full name, for tracking and reconciliation.
255"Ahmed Al-Rashid"
Customer's phone number, for tracking. Optional — omit the field or send an empty value.
If supplied it must be 8 to 15 digits, must not start with 0, and must contain
digits only. The +, -, space, and bracket characters are rejected.
Valid: 96512345678, 12345678. Invalid: +96512345678, 0965123456, 1234567.
8 - 15^[1-9][0-9]{7,14}$"96512345678"
User-defined field 1. No special characters.
255User-defined field 2. No special characters.
255User-defined field 3. No special characters.
255User-defined field 4. No special characters.
255User-defined field 5. No special characters.
255Multivendor only — numeric identifier for the delivery company on this order.
Multivendor only — delivery cost applied to this transaction.
Multivendor only — 1 fixed amount, 2 percentage, 3 mixed.
1, 2, 3 Multivendor only — percentage rate, used when commission_type is 2 or 3.
Multivendor only — fixed amount, used when commission_type is 1 or 3.
curl --request POST \
--url https://development.payzah.net/ws/paymentgateway/index \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"trackid": "ORDER-2001",
"amount": "11.250",
"currency": "414",
"success_url": "https://yourstore.com/success",
"error_url": "https://yourstore.com/error",
"payment_type": "3",
"language": "ENG",
"customer_name": "Ahmed Al-Rashid",
"customer_email": "[email protected]",
"customer_phone": "96512345678"
}
'{
"status": true,
"data": {
"PaymentUrl": "https://development.payzah.net/pgaction",
"PaymentID": "2019070115360420",
"transit_url": "https://devgateway.trytajer.app?id=202409271806248183",
"direct_url": ""
}
}
