Delete Invoice
Permanently deletes an invoice that has not received any payments. Only draft and open invoices can be deleted.
HTTP Request
- URL:
/invoices/{id} - Method:
DELETE - Headers:
accessToken: Required. Your API access token.
- Required scope:
READ_WRITE_INVOICE
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | Required. The ID of the invoice to delete. |
cURL Example
curl --location --request DELETE '<BASE_URL>/invoices/665f2310d5775459152d6dd8' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The invoice was deleted.
- 400 Bad Request: The invoice ID is not valid, or the invoice cannot be deleted because of its status or payments.
- 401 Unauthorized: The access token is missing or invalid.
- 403 Forbidden: The access token does not have the required scope.
- 404 Not Found: No invoice exists with this ID.
- 409 Conflict: The invoice was paid or changed while it was being deleted. Get the invoice again and retry.
Sample JSON Response
{
"success": true,
"message": "Invoice deleted successfully",
"data": {
"id": "665f2310d5775459152d6dd8"
}
}
Response Details
Delete Data
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the invoice was deleted. |
message | String | Result message. |
data.id | String | ID of the deleted invoice. |
Notes
- Deleting an invoice cannot be undone. To keep a record of a cancelled invoice, use Void Invoice instead.
- After an order's invoice is deleted, you can create a new invoice for that order.