Create an invoice with the API and redirect your customer to the secure SADAD Pay payment page.
The Hosted Payment Page is the simplest and safest way to accept payments with SADAD Pay. You create an invoice with the API, send your customer to the SADAD Pay payment page, and confirm the result when they return. Card details never touch your system.
Before you start
- You need an Access Token. See API Keys & Authentication.
- Set your Payment Success Return URL, Payment Failed Return URL and Webhook URL in the portal under Profile → Update Profile → API.
- All examples use the Sandbox URL. See Sandbox & Live Accounts for the Live URL.
Step 1: Create the invoice
Send the order details to POST /api/Invoice/insert · API Reference
The request body contains an Invoices array, so you can create one or more invoices in a single call.
Request fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
amount | number | Yes | The invoice amount in the currency set in currency_Code. Must be greater than 0. If you send items, it must equal the total of the items. | 10.500 |
currency_Code | string | Yes | The invoice currency: KWD, USD, SAR, AED or QAR. | "KWD" |
customer_Name | string | Yes | The customer's name, shown on the invoice. | "Ahmed Ali" |
ref_Number | string | Recommended | Your own order or reference number. Use it to match the invoice to your order. | "ORD-1001" |
customer_Mobile | string | Recommended | The customer's mobile number. | "99999999" |
customer_Email | string | Recommended | The customer's email address. | "[email protected]" |
lang | string | Recommended | Payment page language: en (English) or ar (Arabic). Defaults to Arabic if not sent. | "en" |
items | array | No | The invoice line items. See below. | |
comment | string | No | Payment purpose shown on the invoice (up to 500 characters). | "Order 1001" |
expiry_Date | string | No | When the invoice expires, in MM/dd/yyyy HH:mm:ss format. If not sent, the invoice expires 30 days after it is created. | "12/31/2026 23:59:00" |
success_ReturnURL | string | No | Where to send the customer after a successful payment, for this invoice only. Overrides the Success URL in your profile. | "https://yourstore.com/success" |
fail_ReturnURL | string | No | Where to send the customer after a failed payment, for this invoice only. Overrides the Fail URL in your profile. | "https://yourstore.com/fail" |
discount_Type | string | No | Amount (fixed amount) or Percent. | "Percent" |
discount_Amount | number | No | The discount value, used with discount_Type. | 10 |
Item fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
name | string | Yes | Item name | "Blue T-shirt" |
quantity | integer | Yes | Number of units | 2 |
amount | number | Yes | Price of one unit, in the invoice currency | 2.500 |
Amounts are in the invoice currency (changed September 2026)
The
amountis in the currency you send incurrency_Code. For example,amount: 10withcurrency_Code: "SAR"creates a 10 SAR invoice. SADAD Pay converts it to KWD using its configured exchange rates, and all payments are processed and settled in KWD.Before September 2026, the amount was always treated as KWD. If you integrated before then and use a currency other than KWD, update your integration.
Examples
{
"Invoices": [
{
"ref_Number": "ORD-1001",
"amount": 10.500,
"currency_Code": "KWD",
"customer_Name": "Ahmed Ali",
"customer_Mobile": "99999999",
"customer_Email": "[email protected]",
"lang": "en"
}
]
}
{
"Invoices": [
{
"ref_Number": "ORD-1002",
"amount": 10,
"currency_Code": "KWD",
"customer_Name": "Ahmed Ali",
"customer_Mobile": "99999999",
"lang": "en",
"items": [
{ "name": "Item 1", "quantity": 2, "amount": 2 },
{ "name": "Item 2", "quantity": 6, "amount": 1 }
]
}
]
}
{
"Invoices": [
{ "ref_Number": "ORD-1003", "amount": 5, "currency_Code": "KWD", "customer_Name": "Ahmed Ali", "lang": "en" },
{ "ref_Number": "ORD-1004", "amount": 20, "currency_Code": "SAR", "customer_Name": "Sara Saleh", "lang": "ar" }
]
}
Response
{
"isValid": true,
"errorKey": null,
"response": {
"invoiceId": "71456"
}
}
{
"isValid": true,
"errorKey": null,
"response": {
"invoiceId": "71458,71459"
}
}
{
"isValid": false,
"errorKey": "CustomerNameRequired",
"response": null
}
Always check
isValidValidation errors are returned with HTTP 200. Always check
isValidin the response body, not only the HTTP status code. See Common errors below.
Save the invoiceId. When you create several invoices in one call, the IDs are returned in the same order, separated by commas.
Step 2: Get the payment URL
Call GET /api/Invoice/getbyid?id={invoiceId} · API Reference
The response contains the full invoice. The fields you need now are:
| Field | Description | Example |
|---|---|---|
url | The payment page link. Send your customer here. | https://sandbox.sadadpay.net/pay/6341447571451 |
key | The invoice key. The payment link is /pay/{key}. | "6341447571451" |
qr | Link to download a QR code for the same payment page. | https://sandbox.sadadpay.net/qr/6341447571451/download |
status | The invoice status. See Step 5. | "Unpaid" |
The payment link format is:
- Sandbox:
https://sandbox.sadadpay.net/pay/{key} - Live:
https://sadadpay.net/pay/{key}
Step 3: Redirect the customer
Redirect your customer to the payment URL. They choose a payment method, such as KNET, card or Apple Pay, and complete the payment. The methods shown depend on what is enabled on your account.

The SADAD Pay payment page
Step 4: Handle the return
After the payment, SADAD Pay redirects the customer back to your site:
- Successful payment: to your Payment Success Return URL
- Failed or cancelled payment: to your Payment Failed Return URL
The invoice ID is added to the URL as the invoice_id parameter. For example: https://yourstore.com/success?invoice_id=71451
The return is not proof of payment
The customer may close the browser before returning, or the return URL can be changed by hand. Always continue to Step 5 and verify the payment with the API.
Step 5: Verify the payment
Call GET /api/Invoice/getbyid?id={invoice_id} again and check the status field before you complete the order.
| Status | Meaning | What to do |
|---|---|---|
Unpaid | Not paid yet, or the payment attempt failed | Do not complete the order. The customer can try again with the same link. |
Paid | Paid successfully | Complete the order |
Deposited | Paid, and the money has been transferred to your bank account | Order already complete |
Refunded | The payment was refunded | Cancel or reverse the order |
Canceled | The invoice was cancelled and can no longer be paid | Do not complete the order |
When an invoice is paid, the response also contains the payment details in paymentGateway, transactionID and the transactions array.
{
"isValid": true,
"errorKey": null,
"response": {
"id": 71451,
"code": "INV-71451",
"type": "Invoice",
"status": "Paid",
"amount": 0.1,
"alt_Amount": 0,
"total": 0.1,
"refunded_Amount": 0,
"lang": "en",
"customer_Name": "Test Customer",
"customer_Mobile": "",
"customer_Email": "[email protected]",
"ref_Number": "",
"currency_Code": "KWD",
"expiry_Date": "12/08/2026 00:00:00",
"comment": "Documentation test payment",
"key": "6341447571451",
"items": [],
"transactions": [
{
"id": 30833,
"request_Type": "Capture",
"type": "Invoice",
"invoice_Id": 71451,
"status": "Success",
"paymentGateway": "K net",
"paymentGatewayCode": "Knet",
"transactionId": "631210009159851",
"trackId": "134386020943148035",
"referenceId": "631210000264",
"paymentId": "100631210000003874",
"amount": 0.1,
"currencyCode": "KWD",
"createDate": "11/08/2026 12:01:34",
"authorizationId": "B20307"
}
],
"transactionID": "631210009159851",
"paymentGateway": "K net",
"paymentGatewayCode": "Knet",
"url": "https://sandbox.sadadpay.net/pay/6341447571451",
"qr": "https://sandbox.sadadpay.net/qr/6341447571451/download",
"createDate": "11/08/2026 12:00:07",
"payment_Date": "11/08/2026 12:01:59"
}
}
Key response fields
amountis always the KWD value.alt_Amountis the amount in the invoice currency when it is not KWD.totalis the amount the customer pays, after any discount.- Dates use the
MM/dd/yyyy HH:mm:ssformat.
Never skip verification
SADAD Pay is not responsible for orders completed without verifying that the invoice status is Paid.
Use webhooks too
If the customer closes the browser before returning to your site, the webhook still tells your server that the invoice was paid. See Webhooks.
Common errors
| errorKey | HTTP status | Cause | How to fix |
|---|---|---|---|
AmountRequired | 200 | amount is missing or 0 | Send an amount greater than 0 |
CustomerNameRequired | 200 | customer_Name is missing | Send the customer's name |
InvalidCurrencyCode | 200 | currency_Code is missing or not supported | Send KWD, USD, SAR, AED or QAR |
InvoiceAmountMustEqualsToTotalItemsAmount | 200 | amount does not equal the total of the items | Make amount equal the sum of quantity × amount for all items |
UnauthorizedAccess | 401 | The Access Token is missing, wrong or expired | Generate a new Access Token |
UnauthorizedAccess | 403 | The invoice ID does not exist or belongs to another account | Check the invoice ID and the environment (Sandbox or Live) |
Next steps
- Receive payment notifications on your server with Webhooks.
- Test your integration with the Test Cards.
- Before going live, follow the Go-Live Checklist.

