Create Invoice
This API is used to create merchant’s invoice. By providing correct/required request data/fields with the correct access token, merchant user will be able to create invoices. If invoice is created successfully then invoice details will be provided in response.
Status Description 1 - Draft 2 - Unpaid 3 - Paid 4 - Overdue 5 - Cancelled
sentviaId Description 1 - None 2 - Whatsapp 3 - Email 4 - SMS
- POST
https://api-sandbox.sadad.qa/api//invoices/createInvoice
Permission: Merchant
- Example usage:
curl -d "@data.json" -H "Content-Type: application/json" -H "Authorization: {ACCESS_TOKEN}" -X POST https://api-sandbox.sadad.qa/api/invoices/createInvoice
Header
| Field | Type | Description |
|---|---|---|
| Authorization | String | User's unique access-token |
- Header-Example:
{
"Authorization": "BN79o6YNrY4IPP60UF4JmNEM6O8hX9HVUq0e0HWNyo2tt1jqCT9IWnXSBhfr7Mws"
}
Parameter
| Field | Type | Description |
|---|---|---|
| countryCode | Number/String | Country code of cell number |
| cellnumber | Number/String | Cellnumber of invoice |
| clientname | String | Client name on invoice |
| status | Number | Status of invoice |
| remarks | String | Remarks of invoice |
| amount | Number | Amount of invoice |
| invoicedetails | ArrayObject | Array object of product details associated with invoice containing description, quantity and amount |
- Request-Example:
{
"countryCode": 974,
"cellnumber": 54XXXXX5,
"clientname": "test",
"invoicedetails": [
{
"description": "invoice test 1",
"quantity": 1,
"amount": 10
},
{
"description": "invoice test 1",
"quantity": 2,
"amount": 10
}
],
"status": 2,
"remarks": "invoice test remarks",
"amount": 20
}
Success 200
| Field | Type | Description |
|---|---|---|
| invoiceno | String | Unique invoice number |
| clientname | String | Name of thee client on invoice |
| cellno | String | Cell number of invoice |
| emailaddress | String | Email address of invoice |
| referenceId | String | Refernece Id of invoice |
| grossamount | Number | Amount of invoice |
| paymentUrl | String | Direct gateway payment page |
| ShareUrl | String | shareUrl is a public payment link that you can share directly with the customer via: SMS,WhatsApp,Email etc. When the customer opens this URL, they are redirected to the hosted SADAD payment page for that invoice. |
| callbackUrl | String | Webhook endpoint for payment updates |
| returnUrl | String | Customer redirect after payment |
| expiryDate | String | Expiry date and time of invoice |
| id | Number | Unique id of invoice data |
| createdAt | String | Date of the invoice created |
| sentviaId | Number | How the invoice is shared. 1 - none, 2 - whatsapp, 3 - email, 4 - mobile |
| updatedAt | String | Last update timestamp |
| Total amount | Number | Amount of invoice |
| invoiceStatus | String | Unpaid / Paid / Expired / Cancelled |
- Success-Response:
{
"status": true,
"code": 200,
"message": "Invoice created successfully",
"requestId": "REQ-20260222094530",
"data": {
"invoiceId": "INV-20260222001",
"invoiceNumber": "ORD-10025",
"referenceId": "REF-88997766",
"amountDetails": {
"subtotal": 450.00,
"tax": 50.00,
"discount": 0.00,
"total": 500.00,
"currency": "QAR"
},
"customerDetails": {
"name": "Ahmed Ali",
"email": "[email protected]",
"mobile": "966500000000",
"countryCode": "966"
},
"invoiceStatus": "Unpaid",
"paymentMethod": null,
"paymentUrl": "https://pay.sadad.sa/invoice/INV-20260222001",
"shareUrl": "https://sadad.sa/i/INV-20260222001",
"qrCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"expiryDate": "2026-02-25T23:59:59",
"createdAt": "2026-02-22T09:45:30",
"updatedAt": "2026-02-22T09:45:30",
"callbackUrl": "https://yourdomain.com/api/payment/callback",
"returnUrl": "https://yourdomain.com/payment/success",
"metadata": {
"orderId": "10025",
"customerId": "CUST-5566",
"notes": "Online order payment"
}
}
}
Error 4xx
| Name | Description |
|---|---|
| 401 | Authorization Required |
| 400 | Invalid data |
| 404 | Data not found |
- Response (example):
{
"error": {
"statusCode": 401,
"name": "Error",
"message": "Authorization Required"
}
}