Skip to main content

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

https://api-sandbox.sadad.qa/api//invoices/createInvoice

Permission: Merchant

curl -d "@data.json" -H "Content-Type: application/json" -H "Authorization: {ACCESS_TOKEN}" -X POST https://api-sandbox.sadad.qa/api/invoices/createInvoice
FieldTypeDescription
AuthorizationStringUser's unique access-token
{
"Authorization": "BN79o6YNrY4IPP60UF4JmNEM6O8hX9HVUq0e0HWNyo2tt1jqCT9IWnXSBhfr7Mws"
}

Parameter

FieldTypeDescription
countryCodeNumber/StringCountry code of cell number
cellnumberNumber/StringCellnumber of invoice
clientnameStringClient name on invoice
statusNumberStatus of invoice
remarksStringRemarks of invoice
amountNumberAmount of invoice
invoicedetailsArrayObjectArray object of product details associated with invoice containing description, quantity and amount
 {
"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

FieldTypeDescription
invoicenoStringUnique invoice number
clientnameStringName of thee client on invoice
cellnoStringCell number of invoice
emailaddressStringEmail address of invoice
referenceIdStringRefernece Id of invoice
grossamountNumberAmount of invoice
paymentUrlStringDirect gateway payment page
ShareUrlStringshareUrl 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.
callbackUrlStringWebhook endpoint for payment updates
returnUrlStringCustomer redirect after payment
expiryDateStringExpiry date and time of invoice
idNumberUnique id of invoice data
createdAtStringDate of the invoice created
sentviaIdNumberHow the invoice is shared. 1 - none, 2 - whatsapp, 3 - email, 4 - mobile
updatedAtStringLast update timestamp
Total amountNumberAmount of invoice
invoiceStatusStringUnpaid / Paid / Expired / Cancelled
 {
"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

NameDescription
401Authorization Required
400Invalid data
404Data not found
{
"error": {
"statusCode": 401,
"name": "Error",
"message": "Authorization Required"
}
}