List-Invoices
This API is used to get the list of invoices created by merchant By providing correct/required filters with the correct access token, merchant user will get a list of invoices created in JSON format.
Filters
- Pagination Filters:
Value of skip determines starting number page and limit determines ending number of page
These filters are required with other filters
Example: ?filter[skip]=0&filter[limit]=10 - Clientname Filter:
To fetch invoices by provided client name in invoice
Example: ?filter[skip]=0&filter[limit]=10&filter[clientname]=test - Date Filter:
To fetch invoices from by provided date
Date should be in proper format: YYYY-MM-DD
Example: ?filter[skip]=0&filter[limit]=10&filter[date]=2020-10-24 - Invoice Number Filter:
To fetch invoice by provided invoice number
Example: ?filter[skip]=0&filter[limit]=10&filter[invoicenumber]=SD20XXXXXXXXXXX - Status Filter:
To fetch invoices by provided status of invoices
Example: ?filter[skip]=0&filter[limit]=10&filter[status]=5
Status Description 1 - Draft 2 - Unpaid 3 - Paid 4 - Overdue 5 - Cancelled
sentviaId Description 1 - None 2 - Whatsapp 3 - Email 4 - SMS
- GET
{
https://api-sandbox.sadad.qa/api//invoices/listInvoices
}
Permission: Merchant
- Example usage:
curl -H "Content-Type: application/json" -H "Authorization: {ACCESS_TOKEN}" -X GET https://api-sandbox.sadad.qa/api/invoices/listInvoices?filter[skip]=0&filter[limit]=10
Header
| Field | Type | Description |
|---|---|---|
| Authorization | String | User's unique access-token |
- Header-Example:
{
"Authorization": "BN79o6YNrY4IPP60UF4JmNEM6O8hX9HVUq0e0HWNyo2tt1jqCT9IWnXSBhfr7Mws"
}
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 |
| remarks | String | Remarks of invoice |
| grossamount | Number | Amount of invoice |
| readreceipt | Boolean | Invoice is read or not |
| readdatetime | String | Date and time of read invoice |
| is_archived | Number | Invoice is archived or not |
| id | Number | Unique id of invoice data |
| date | String | Date of the invoice created |
| sentviaId | Number | How the invoice is shared. 1 - none, 2 - whatsapp, 3 - email, 4 - mobile |
| grossamount | Number | Amount of invoice |
| invoicestatusId | Number | Invoice status Id (Brief details will be in invoice status parameter) |
| invoicereceiverId | Object | Details of invoice receiver like SadadId, name, cellnumber |
| invoicesenderId | Object | Details of invoice sender like SadadId, name, cellnumber |
| invoicestatus | Object | Invoice status details with id and status name |
| invoicedetails | ArrayObject | Array object of product if any product associated with invoice. This object contains description, amount, quantity of product along with its invoice id |
- Success-Response:
[
{
"invoiceno": "SD202101761399",
"clientname": "test test",
"cellno": "91-76XXXXXXX2",
"emailaddress": null,
"remarks": "invoice test remarks",
"grossamount": 15,
"readreceipt": true,
"readdatetime": null,
"is_archived": 0,
"id": 8888,
"date": "2021-01-04",
"sentviaId": 1,
"invoicestatusId": 2,
"invoicereceiverId": {
"SadadId": "2470962",
"name": "User1",
"cellnumber": "76XXXXXXX2",
"id": 1817
},
"invoicesenderId": {
"SadadId": "1853219",
"name": "User2",
"cellnumber": "54XXXXX5",
"id": 466
},
"invoicestatus": {
"name": "Unpaid",
"id": 2
},
"invoicedetails": [
{
"description": "invoice test 1",
"quantity": 1,
"amount": 10,
"invoiceId": 8888
},
{
"description": "invoice test 1",
"quantity": 2,
"amount": 10,
"invoiceId": 8888
},
{
"description": "invoice test 3",
"quantity": 3,
"amount": 10,
"invoiceId": 8888
}
]
}
]
Error 4xx
| Name | Description |
|---|---|
| 401 | Authorization Required |
| 400 | Invalid data |
| 404 | Data not found |
- Response (example):
{
"error": {
"statusCode": 401,
"name": "Error",
"message": "Authorization Required"
}
}