Invoice Items#
Invoice Items represent individual line items on an invoice. You can add, update, and remove items from draft invoices.
The Invoice Item object#
| Attribute | Type | Description |
|---|---|---|
id | string | Unique identifier with ii_ prefix |
object | string | Always "invoice_item" |
invoice | string | Parent Invoice ID |
description | string | Line item description |
amount | integer | Amount in smallest currency unit |
currency | string | ISO 4217 currency code |
quantity | integer | Quantity |
unit_amount | integer | Amount per unit |
tax_rates | array | Applied tax rate IDs |
metadata | hash | Key-value pairs |
created | timestamp | Time at which the object was created |
{
"id": "ii_item1",
"object": "invoice_item",
"invoice": "inv_abc123",
"description": "Monthly rent — Unit 4B",
"amount": 120000,
"currency": "eur",
"quantity": 1,
"unit_amount": 120000,
"tax_rates": [],
"metadata": {},
"created": 1706140800
}Create an Invoice Item#
POST /v1/invoice_items
| Parameter | Type | Required | Description |
|---|---|---|---|
invoice | string | Yes | Invoice ID |
description | string | Yes | Line item description |
amount | integer | Yes | Amount in smallest currency unit |
currency | string | Yes | ISO 4217 currency code |
quantity | integer | No | Quantity (default: 1) |
tax_rates | array | No | Tax rate IDs to apply |
curl https://api.casapay.com/v1/invoice_items \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
-H "Content-Type: application/json" \
-d '{
"invoice": "inv_abc123",
"description": "Late payment fee",
"amount": 2500,
"currency": "eur"
}'Retrieve an Invoice Item#
GET /v1/invoice_items/:id
curl https://api.casapay.com/v1/invoice_items/ii_item1 \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"Update an Invoice Item#
POST /v1/invoice_items/:id
curl https://api.casapay.com/v1/invoice_items/ii_item1 \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
-H "Content-Type: application/json" \
-d '{"description": "Monthly rent — Unit 4B (updated)", "amount": 125000}'Delete an Invoice Item#
DELETE /v1/invoice_items/:id
curl -X DELETE https://api.casapay.com/v1/invoice_items/ii_item1 \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"List Invoice Items#
GET /v1/invoice_items
| Parameter | Type | Description |
|---|---|---|
invoice | string | Filter by invoice |
curl "https://api.casapay.com/v1/invoice_items?invoice=inv_abc123" \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"