Invoice Line Items

Line items represent individual products or services being billed on an invoice. The Invoice Line Items API allows you to create, retrieve, update, and delete line items for a specific invoice.

The Line Item object

Attributes
idstring

Unique identifier for the line item.

objectstring

String representing the object's type.

descriptionstring

The name or description of the product or service.

quantityinteger

The quantity of the product or service.

unit_amount_centsinteger

The unit price of the product or service in cents.

unit_amount_currencystring

Three-letter ISO currency code, in uppercase. Currently only supports "USD".

createdtimestamp

Time at which the line item was created.

updatedtimestamp

Time at which the line item was last updated.

THE LINE ITEM OBJECT
{
  "id": "08231737-6286-4a38-87c6-7e7812b2fafd",
  "object": "invoice_line_item",
  "description": "Fantastic Granite Keyboard",
  "quantity": 3,
  "unit_amount_cents": 1000,
  "unit_amount_currency": "USD",
  "created": 1742574589,
  "updated": 1742574589
}

List Line Items

Retrieves a list of line items for a specific invoice.

Parameters

No parameters.

Returns

A dictionary with a data property that contains an array of Line Item objects.

GET/v1/invoices/:invoice_id/line_items
curl --request GET \
  --url https://api.framepayments.com/v1/invoices/inv_1234567890/line_items \
  --header 'Authorization: Bearer API_KEY'
Response
{
  "data": [
    {
      "id": "08231737-6286-4a38-87c6-7e7812b2fafd",
      "object": "invoice_line_item",
      "description": "Fantastic Granite Keyboard",
      "quantity": 3,
      "unit_amount_cents": 1000,
      "unit_amount_currency": "USD",
      "created": 1742574589,
      "updated": 1742574589
    }
  ]
}

Create a Line Item

Creates a new line item for a specific invoice.

Parameters
productREQUIREDstring

The ID of the product to be added to the invoice.

quantityREQUIREDinteger

The quantity of the product to be added to the invoice. Must be greater than 0.

Returns

Returns the created Line Item object if the request was successful.

POST/v1/invoices/:invoice_id/line_items
curl --request POST \
  --url https://api.framepayments.com/v1/invoices/inv_1234567890/line_items \
  --header 'Authorization: Bearer API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "product": "prod_1234567890",
    "quantity": 2
  }'
Response
{
  "id": "08231737-6286-4a38-87c6-7e7812b2fafd",
  "object": "invoice_line_item",
  "description": "Fantastic Granite Keyboard",
  "quantity": 3,
  "unit_amount_cents": 1000,
  "unit_amount_currency": "USD",
  "created": 1742574589,
  "updated": 1742574589
}

Update a Line Item

Updates an existing line item for a specific invoice.

Parameters
productstring

The ID of the product to update the line item with.

quantityinteger

The new quantity for the line item. Must be greater than 0.

Returns

Returns the updated Line Item object if the request was successful.

PATCH/v1/invoices/:invoice_id/line_items/:id
curl --request PATCH \
  --url https://api.framepayments.com/v1/invoices/inv_1234567890/line_items/li_1234567890 \
  --header 'Authorization: Bearer API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "quantity": 3
  }'
Response
{
  "id": "08231737-6286-4a38-87c6-7e7812b2fafd",
  "object": "invoice_line_item",
  "description": "Fantastic Granite Keyboard",
  "quantity": 3,
  "unit_amount_cents": 1000,
  "unit_amount_currency": "USD",
  "created": 1742574589,
  "updated": 1742574589
}

Retrieve a Line Item

Retrieves the details of an existing line item.

Parameters

No parameters.

Returns

Returns a Line Item object if a valid ID was provided.

GET/v1/invoices/:invoice_id/line_items/:id
curl --request GET \
  --url https://api.framepayments.com/v1/invoices/inv_1234567890/line_items/li_1234567890 \
  --header 'Authorization: Bearer API_KEY'
Response
{
  "id": "08231737-6286-4a38-87c6-7e7812b2fafd",
  "object": "invoice_line_item",
  "description": "Fantastic Granite Keyboard",
  "quantity": 3,
  "unit_amount_cents": 1000,
  "unit_amount_currency": "USD",
  "created": 1742574589,
  "updated": 1742574589
}

Delete a Line Item

Deletes a line item from an invoice. Line items cannot be deleted if the invoice is paid.

Parameters

No parameters.

Returns

Returns a confirmation that the line item has been deleted.

DELETE/v1/invoices/:invoice_id/line_items/:id
curl --request DELETE \
  --url https://api.framepayments.com/v1/invoices/inv_1234567890/line_items/li_1234567890 \
  --header 'Authorization: Bearer API_KEY'
Response
{
  "object": "invoice_line_item",
  "deleted": true
}