Update-Invoice
This API is used to update merchant’s invoice By providing correct/required request data/fields with the correct access token, merchant user will be able to update invoice.
Status Description 1 - Draft 2 - Unpaid 3 - Paid 4 - Overdue 5 - Cancelled
sentviaId Description 1 - None 2 - Whatsapp 3 - Email 4 - SMS
- PATCH
https://api-sandbox.sadad.qa/api//invoices/updateInvoice
Permission: Merchant
- Example usage:
curl -d "@data.json" -H "Content-Type: application/json" -H "Authorization: {ACCESS_TOKEN}" -X PATCH https://api-sandbox.sadad.qa/api/invoices/updateInvoice
Header
| Field | Type | Description |
|---|---|---|
| Authorization | String | User's unique access-token |
- Header-Example:
{
"Authorization": "BN79o6YNrY4IPP60UF4JmNEM6O8hX9HVUq0e0HWNyo2tt1jqCT9IWnXSBhfr7Mws"
}
Parameter
| Field | Type | Description |
|---|---|---|
| id | Number | Id of the invoice to update |
| clientname | String | Name of thee client on invoice |
| status (optional) | Number | Status of invoice |
| remarks (optional) | String | Remarks of invoice |
| amount (optional) | Number | Amount of invoice |
| invoicedetails (optional) | ArrayObject | Invoice is read or not |
- Request-Example:
{
"clientname": "test test",
"invoicedetails": [
{
"description": "invoice test 3",
"quantity": 3,
"amount": 10,
"invoiceId": 8888
}
],
"amount": 15,
"id": 8888
}
Success 200
| Field | Type | Description |
|---|---|---|
| count | Number | Indicates number of updated items. |
- Success-Response:
{
"count": 1
}
Error 4xx
| Name | Description |
|---|---|
| 401 | Authorization Required |
| 400 | Invalid data |
| 404 | Data not found |
- Response (example):
{
"error": {
"statusCode": 401,
"name": "Error",
"message": "Authorization Required"
}
}