Add a line item to an invoice

​

Adds one line item to an invoice and recalculates its total.

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 422.

The upfront payment for a contract, proposal or document is closed to changes too, and returns 422.

Path Parameters

  • Id of the invoice the line item belongs to.

Body

required
application/json

The line item, wrapped in an invoice_item key.

  • Properties: 5

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/public-api/v1/invoices/{invoice_id}/invoice_items
curl https://app.hellobonsai.com/public-api/v1/invoices/1/invoice_items \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "invoice_item": {
    "name": "Consulting",
    "description": "Discovery workshops",
    "amount": "3",
    "rate": "100",
    "unit_type": "flat"
  }
}'
{
  "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"
  }
}