put https://apiprod.fattlabs.com/invoice/
Alter or update an invoice.
Updates the details of an existing invoice, allowing for modifications to items, taxes, memos, and more. This endpoint is ideal for making corrections or adding additional details to an invoice before it is finalized.
Key Features
- Updates an invoice's details, such as:
- Items and quantities.
- Tax amounts.
- Attached files (e.g., supporting documentation).
- Reference numbers or memos.
- Maintains all existing invoice relationships, such as payments and customer associations.
- Prevents editing of fully paid invoices for data integrity.
- Ensures compatibility with third-party integrations like QuickBooks Online by retaining critical metadata.
Usage Notes
Editable Fields
- The fields that can be updated are the same as those used when the invoice was created. Key editable attributes include:
- Items: Modify or add items in the invoice.
- Taxes: Update or apply tax amounts.
- Memo: Add or change a memo visible to customers.
- Files: Attach or update supporting files (e.g., contracts or receipts).
- Reference Numbers: Update reference details for internal tracking.
Restrictions
- Fully paid invoices cannot be edited. Attempting to update such invoices will result in an error.
- Be cautious when modifying metadata (
meta
fields). These fields may affect integrations like:- Receipt emails.
- The invoice page in the Stax Pay platform.
- QuickBooks Online integration.
Unusual Behavior Risk
- Removing or altering metadata fields in the
meta
object might lead to unintended behavior in downstream systems. For instance:- Missing fields may result in incorrect invoice display.
- Integration features relying on metadata might fail.
Response Structure
Code | Response | Reason |
---|---|---|
200 | Success | The invoice was successfully updated. |
400 | Bad Request | Invalid or unmodifiable fields provided. |
401 | Unauthorized | Authentication failed. |
404 | Not Found | An invoice with the specified ID does not exist. |
422 | Unprocessable Entity | Attempt to update a fully paid invoice. |
500 | Internal Server Error | Unexpected server error. |
Important Considerations
- Fully Paid Invoices: Once an invoice is fully paid, no further edits are allowed to ensure payment integrity.
- Metadata Changes: Only update metadata if necessary and with an understanding of how it impacts integrations and downstream systems.
- Audit Trail: Changes to invoices are logged to maintain a record of updates for compliance and transparency.
- Customer Communication: If an invoice is updated after being sent, consider notifying the customer to avoid confusion.