Introduction
Endpoints
- Accounts
- Fees
- Invoices
- Meters
- Plans
- Subscriptions
- Credit grants
- Products
- Orders
- Payments
Invoices
Create an invoice item
Creates an invoice item.
POST
/
invoices
/
{id}
/
items
Copy
curl --request POST \
--url https://sandbox-api.billingrails.com/v1/invoices/{id}/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"entity_id": "<string>",
"name": "<string>",
"description": "<string>",
"quantity": 123,
"unit_amount": 123
}'
Copy
{
"invoice": {
"object": "invoice",
"id": "inv_IhMUl3rrZ3",
"created_at": "2025-02-14T17:33:40.843Z",
"account_id": "acc_IhMUl3rrZ3",
"subscription_id": "sub_IhMUl3rrZ3",
"number": "INV-0001",
"status": "draft",
"currency": "NGN",
"collection_method": "manual",
"due_at": "2025-02-14T17:33:40.843Z",
"issued_at": "2025-02-14T17:33:40.843Z",
"credit_amount": 0,
"subtotal_amount": 1000,
"total_amount": 1000,
"paid_amount": 0,
"outstanding_amount": 1000,
"billing_start": "2025-02-14T17:33:40.843Z",
"billing_end": "2025-02-14T17:33:40.843Z",
"pdf_url": "https://billingrails.com/invoices/INV-0001.pdf",
"items": [
{
"object": "invoice_line_item",
"entity_id": "fee_IhMUl3rrZ3",
"id": "item_IhMUl3rrZ3",
"description": "Basic Plan",
"quantity": 1,
"unit_amount": 1000,
"subtotal_amount": 1000,
"total_amount": 1000,
"billing_start": "2025-02-14T17:33:40.843Z",
"billing_end": "2025-02-14T17:33:40.843Z",
"proration": null
}
]
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Body
application/json
Invoice line item payload
The body is of type object
.
Response
200 - application/json
Invoice line item added
The response is of type object
.
Copy
curl --request POST \
--url https://sandbox-api.billingrails.com/v1/invoices/{id}/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"entity_id": "<string>",
"name": "<string>",
"description": "<string>",
"quantity": 123,
"unit_amount": 123
}'
Copy
{
"invoice": {
"object": "invoice",
"id": "inv_IhMUl3rrZ3",
"created_at": "2025-02-14T17:33:40.843Z",
"account_id": "acc_IhMUl3rrZ3",
"subscription_id": "sub_IhMUl3rrZ3",
"number": "INV-0001",
"status": "draft",
"currency": "NGN",
"collection_method": "manual",
"due_at": "2025-02-14T17:33:40.843Z",
"issued_at": "2025-02-14T17:33:40.843Z",
"credit_amount": 0,
"subtotal_amount": 1000,
"total_amount": 1000,
"paid_amount": 0,
"outstanding_amount": 1000,
"billing_start": "2025-02-14T17:33:40.843Z",
"billing_end": "2025-02-14T17:33:40.843Z",
"pdf_url": "https://billingrails.com/invoices/INV-0001.pdf",
"items": [
{
"object": "invoice_line_item",
"entity_id": "fee_IhMUl3rrZ3",
"id": "item_IhMUl3rrZ3",
"description": "Basic Plan",
"quantity": 1,
"unit_amount": 1000,
"subtotal_amount": 1000,
"total_amount": 1000,
"billing_start": "2025-02-14T17:33:40.843Z",
"billing_end": "2025-02-14T17:33:40.843Z",
"proration": null
}
]
}
}
Assistant
Responses are generated using AI and may contain mistakes.