Hosted Payment Page

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.

1. Create invoice
POST Invoice/insert
→
2. Get payment URL
GET Invoice/getbyid
→
3. Redirect customer
Customer pays on SADAD Pay
→
4. Customer returns
Success or Fail URL
→
5. Verify payment
status = Paid

📘

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

FieldTypeRequiredDescriptionExample
amountnumberYesThe 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_CodestringYesThe invoice currency: KWD, USD, SAR, AED or QAR."KWD"
customer_NamestringYesThe customer's name, shown on the invoice."Ahmed Ali"
ref_NumberstringRecommendedYour own order or reference number. Use it to match the invoice to your order."ORD-1001"
customer_MobilestringRecommendedThe customer's mobile number."99999999"
customer_EmailstringRecommendedThe customer's email address."[email protected]"
langstringRecommendedPayment page language: en (English) or ar (Arabic). Defaults to Arabic if not sent."en"
itemsarrayNoThe invoice line items. See below.
commentstringNoPayment purpose shown on the invoice (up to 500 characters)."Order 1001"
expiry_DatestringNoWhen 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_ReturnURLstringNoWhere to send the customer after a successful payment, for this invoice only. Overrides the Success URL in your profile."https://yourstore.com/success"
fail_ReturnURLstringNoWhere to send the customer after a failed payment, for this invoice only. Overrides the Fail URL in your profile."https://yourstore.com/fail"
discount_TypestringNoAmount (fixed amount) or Percent."Percent"
discount_AmountnumberNoThe discount value, used with discount_Type.10

Item fields

FieldTypeRequiredDescriptionExample
namestringYesItem name"Blue T-shirt"
quantityintegerYesNumber of units2
amountnumberYesPrice of one unit, in the invoice currency2.500

🚧

Amounts are in the invoice currency (changed September 2026)

The amount is in the currency you send in currency_Code. For example, amount: 10 with currency_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 isValid

Validation errors are returned with HTTP 200. Always check isValid in 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:

FieldDescriptionExample
urlThe payment page link. Send your customer here.https://sandbox.sadadpay.net/pay/6341447571451
keyThe invoice key. The payment link is /pay/{key}."6341447571451"
qrLink to download a QR code for the same payment page.https://sandbox.sadadpay.net/qr/6341447571451/download
statusThe 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.

1568

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.

StatusMeaningWhat to do
UnpaidNot paid yet, or the payment attempt failedDo not complete the order. The customer can try again with the same link.
PaidPaid successfullyComplete the order
DepositedPaid, and the money has been transferred to your bank accountOrder already complete
RefundedThe payment was refundedCancel or reverse the order
CanceledThe invoice was cancelled and can no longer be paidDo 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

  • amount is always the KWD value. alt_Amount is the amount in the invoice currency when it is not KWD.
  • total is the amount the customer pays, after any discount.
  • Dates use the MM/dd/yyyy HH:mm:ss format.

❗️

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

errorKeyHTTP statusCauseHow to fix
AmountRequired200amount is missing or 0Send an amount greater than 0
CustomerNameRequired200customer_Name is missingSend the customer's name
InvalidCurrencyCode200currency_Code is missing or not supportedSend KWD, USD, SAR, AED or QAR
InvoiceAmountMustEqualsToTotalItemsAmount200amount does not equal the total of the itemsMake amount equal the sum of quantity × amount for all items
UnauthorizedAccess401The Access Token is missing, wrong or expiredGenerate a new Access Token
UnauthorizedAccess403The invoice ID does not exist or belongs to another accountCheck the invoice ID and the environment (Sandbox or Live)

Next steps