Update an Invoice
PATCH /api/v1/invoices/:id
Update an existing invoice. Partial updates are supported; only provided fields are modified. Line items can be added, updated, or removed by including their IDs.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | The unique ID of the invoice. |
Request Body
Same as Create an Invoice, but optional. For updating items:
- Include
idfor existing items to update. - Omit
idfor new items. - Set
_destroy: trueto remove items.
Request Example
{ "invoice": { "issued_at": "2025-10-12T00:00:00.000Z", "payment_term_id": 89, "currency": "USD", "customer_id": 13, "items_attributes": [ { "id": 172, "name": "Items Consulting", "unit_price": "400.0", "quantity": 2 } ], "discount_type": "percent", "discount_value": "5", "invoice_taxes_attributes": [ { "id": 15, "tax_id": 1 } ], "notes": "" } }
PATCH /api/v1/invoices/123 HTTP/1.1
Host: koteshen.com
Authorization: Bearer {access_token}
Content-Type: application/json
Accept: application/json
{request_body}
Response
Status Codes:
200 OK- Invoice updated successfully.401 Unauthorized- Invalid or missing token.404 Not Found- Invoice not found.422 Unprocessable Entity- Validation errors.
Success Response (200)
Same structure as Retrieve an Invoice.