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
Sandbox
https://api-sandbox.sadad.qa/api/invoices/createInvoice
Live
https://api-s.sadad.qa/api/invoices/createInvoice
Permission: Merchant
- Curl
- Ruby
- Python
- PHP
- Java
- Node.js
- Go
- .NET
curl -d "@data.json" -H "Content-Type: application/json" -H "Authorization: {ACCESS_TOKEN}" -X POST https://api-s.sadad.qa/api/invoices/createInvoice
require 'net/http'
require 'json'
uri = URI("https://api-s.sadad.qa/api/invoices/createInvoice")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "{ACCESS_TOKEN}"
request.body = {
amount: 150,
customerName: "John Doe",
customerEmail: "john@example.com",
description: "Invoice payment"
}.to_json
response = http.request(request)
puts response.body
import requests
url = "https://api-s.sadad.qa/api/invoices/createInvoice"
headers = {
"Content-Type": "application/json",
"Authorization": "{ACCESS_TOKEN}"
}
payload = {
"amount": 150,
"customerName": "John Doe",
"customerEmail": "john@example.com",
"description": "Invoice payment"
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
<?php
$url = "https://api-s.sadad.qa/api/invoices/createInvoice";
$data = [
"amount" => 150,
"customerName" => "John Doe",
"customerEmail" => "john@example.com",
"description" => "Invoice payment"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: {ACCESS_TOKEN}"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class CreateInvoice {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api-s.sadad.qa/api/invoices/createInvoice");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("Authorization", "{ACCESS_TOKEN}");
conn.setDoOutput(true);
String jsonInput = "{\"amount\":150,\"customerName\":\"John Doe\",\"customerEmail\":\"john@example.com\",\"description\":\"Invoice payment\"}";
OutputStream os = conn.getOutputStream();
os.write(jsonInput.getBytes());
os.flush();
os.close();
System.out.println(conn.getResponseCode());
}
}
fetch("https://api-s.sadad.qa/api/invoices/createInvoice", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "{ACCESS_TOKEN}"
},
body: JSON.stringify({
amount: 150,
customerName: "John Doe",
customerEmail: "john@example.com",
description: "Invoice payment"
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
package main
import (
"bytes"
"fmt"
"net/http"
)
func main() {
jsonStr := []byte(`{
"amount":150,
"customerName":"John Doe",
"customerEmail":"john@example.com",
"description":"Invoice payment"
}`)
req, _ := http.NewRequest("POST",
"https://api-s.sadad.qa/api/invoices/createInvoice",
bytes.NewBuffer(jsonStr))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "{ACCESS_TOKEN}")
client := &http.Client{}
resp, _ := client.Do(req)
fmt.Println(resp.Status)
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "{ACCESS_TOKEN}");
var json = @"{
""amount"": 150,
""customerName"": ""John Doe"",
""customerEmail"": ""john@example.com"",
""description"": ""Invoice payment""
}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api-s.sadad.qa/api/invoices/createInvoice",
content
);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
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:
[
{
"invoiceno": "SD77xxx3409881",
"clientname": "test",
"cellno": "974-5xxx3455",
"emailaddress": null,
"remarks": "invoice test remarks",
"grossamount": 20,
"readreceipt": true,
"readdatetime": null,
"is_archived": 0,
"shareUrl": "FRE0Q",
"invoice_webhook_url": null,
"invoice_thankyou_page_url": null,
"invoice_customer_share_url": null,
"id": 4458215,
"date": "2026-05-18",
"sentviaId": 1,
"invoicestatusId": 2,
"invoicereceiverId": null,
"invoicesenderId": {
"SadadId": "6647430",
"name": "Sadad Payment Solutions",
"cellnumber": "50xxx117",
"id": 11306
},
"invoicestatus": {
"name": "Unpaid",
"id": 2
},
"invoicedetails": [
{
"description": "invoice test 1",
"quantity": 1,
"amount": 10,
"id": 1339943,
"invoiceId": 4458215
},
{
"description": "invoice test 1",
"quantity": 2,
"amount": 10,
"id": 1339946,
"invoiceId": 4458215
}
]
}
]
Error 4xx
| Name | Description |
|---|---|
| 401 | Authorization Required |
| 400 | Invalid data |
| 404 | Data not found |
- Response (example):
{
"error": {
"statusCode": 401,
"name": "Error",
"message": "Authorization Required"
}
}