Invoices

Update a line item on an invoice

Updates one line item and recalculates the invoice total. Every field is optional, and anything you leave out keeps its current value.

Only invoices that have not been paid for work here. An invoice that is paid, partially paid, or has a payment in progress is closed to changes and returns 403.

A line item built from a timesheet takes its amount, rate and unit_type from the time entries behind it. Sending a different value for one of those returns 422. Sending the stored value is accepted, so a full-representation update still works.

patch/public-api/v1/invoices/{invoice_id}/invoice_items/{id}

Request

  • Base URL
    https://app.hellobonsai.com
  • URL
    https://app.hellobonsai.com/public-api/v1/invoices/{invoice_id}/invoice_items/{id}
  • Auth
    • OAuth 2
      Authorization code: https://app.hellobonsai.com/oauth/authorize
      Token URL: https://app.hellobonsai.com/oauth/token
    • or HTTP bearer

Request body

Example request

{
  "invoice_item": {
    "name": "Consulting",
    "description": "Discovery workshops",
    "amount": "3",
    "rate": "100"
  }
}

Response

The line item was updated and the invoice total recalculated.

Example response

{
  "data": {
    "id": 4471,
    "name": "Design",
    "description": "Homepage and pricing page",
    "amount": "2.0",
    "rate": "100.0",
    "unit_type": "per_hour",
    "total": "200.0"
  },
  "meta": {
    "request_id": "b1f0d2c4-7a9e-4c3b-8d5f-1e2a3b4c5d6e"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.