v1

latestOpenAPI 3.1.02026-07-228956435.8 KB
Invoices

Update an invoice line item

Updates a line item of a draft invoice and recalculates the invoice total. All body fields are optional; send only the fields you want to change. The invoice must be in draft status and any new currency must match the invoice currency.

patch/invoices/{invoice_id}/lines/{id}

Path parameters

invoice_idstring required

The id of the invoice the line item belongs to.

idstring required

The id of the line item to update.

Request body

amountinteger

New amount of the line item, in the smallest unit of currency (for example, 30000 for $30000 CLP, since CLP has no minor unit, or 3000 for $30.00 MXN). Must be greater than 0.

currency'CLP' | 'MXN'

New currency of the line item, as an ISO 4217 code. Must match the invoice currency.

period_endstring date-time

New ISO 8601 timestamp marking the end of the billing period covered by the line item. Must remain after period_start.

period_startstring date-time

New ISO 8601 timestamp marking the start of the billing period covered by the line item.

quantityinteger

New number of units billed by the line item. Must be greater than 0.

namestring

New display name for the line item shown on the invoice.

descriptionstring

New additional details about the line item shown on the invoice.

Example request

{
  "amount": 80000,
  "currency": "CLP",
  "period_end": "2026-06-01T00:00:00Z",
  "period_start": "2026-05-01T00:00:00Z",
  "quantity": 2,
  "name": "Premium Plan",
  "description": "A premium plan"
}

Response

The updated line item. The invoice total already reflects the new amount.

idstring required

Unique identifier of the line item.

object'line_item' required

Type of the object. Always line_item.

amountinteger required

Amount of the line item, in the smallest unit of currency (for example, 30000 for $30000 CLP, since CLP has no minor unit, or 3000 for $30.00 MXN).

currency'CLP' | 'MXN' required

Currency of the line item, as an ISO 4217 code. Always matches the invoice currency.

descriptionstring nullable required

Additional details about the line item shown on the invoice. null when the line item has no description.

namestring required

Display name for the line item shown on the invoice.

period_endstring date-time nullable required

ISO 8601 datetime in UTC marking the end of the billing period covered by the line item. null for line items on invoices not tied to a subscription.

period_startstring date-time nullable required

ISO 8601 datetime in UTC marking the start of the billing period covered by the line item. null for line items on invoices not tied to a subscription.

quantityinteger required

Number of units billed by the line item.

Example response

{
  "id": "il_2bVdX0PqJs6RhNu9FmZlTo2EyKq",
  "amount": 30000,
  "currency": "CLP",
  "description": "A premium plan",
  "name": "Premium Plan",
  "period_end": "2026-06-01T00:00:00Z",
  "period_start": "2026-05-01T00:00:00Z",
  "quantity": 1
}