We are using cookies to improve your experience!

By clicking "Allow all", you agree to use of all cookies. Visit our Privacy Policy to learn more.

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 id for existing items to update.
  • Omit id for new items.
  • Set _destroy: true to 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.