Invoices
Delete retail invoice
Permanently delete a retail invoice and its associated data.
DELETE
Authentication
All requests to this endpoint must include a valid JWT in theAuthorization header.
Path parameters
The unique identifier of the retail invoice to delete.
What gets deleted
Deleting a retail invoice removes the following:- The invoice record from the
RetailInvoicesDynamoDB table. - The invoice’s parsed detail record from the corresponding category detail table (e.g.,
FoodDeliveryInvoices,ClothingInvoices,TechnologyInvoices,SubscriptionInvoices,GroceryInvoices,MiscUtilityInvoices,MiscInvoices,TravelInvoices). - The raw HTML invoice file from S3.
Response
A human-readable confirmation message. Example:
"Invoice deleted successfully"HTTP status code.
200 on success.Error responses
| Status | Error code | Description |
|---|---|---|
400 | MISSING_FIELDS | The invoice_id path parameter is absent. |
401 | INVALID_CREDENTIALS | The Authorization header is missing or the token is invalid. |
401 | TOKEN_EXPIRED | The JWT has expired. |
404 | INVALID_REQUEST | No invoice found for the given invoice_id, or the invoice belongs to a different user. |
502 | DEPENDENCY_FAILURE | A downstream dependency (DynamoDB or S3) returned an error during deletion. |
500 | INTERNAL_SERVER_ERROR | An unexpected server-side error occurred. |