Invoices
Update an invoice
Updates an invoice.
Authorization
bearerAuth AuthorizationBearer <token>
In: header
Path Parameters
id*string
Request Body
application/json
Invoice payload
collection_method?string
Payment collection method for the invoice.
Value in
"automatic" | "manual"payment_method_id?string|null
Payment method ID to charge (required if collection_method is automatic).
due_at?string
Date the invoice is due.
Format
date-timeline_items?
Response Body
application/json
curl -X PUT "https://api.sandbox.billingrails.com/v1/invoices/string" \ -H "Content-Type: application/json" \ -d '{ "line_items": [ { "id": "invli_IhMUl3rrZ3", "quantity": 2 } ] }'{
"invoice": {
"object": "invoice",
"id": "inv_IhMUl3rrZ3",
"number": "INV-0001",
"type": "adhoc",
"status": "draft",
"account_id": "acc_IhMUl3rrZ3",
"currency": "USD",
"collection_method": "manual",
"credit_amount": 0,
"outstanding_amount": 1000,
"paid_amount": 0,
"download_url": "https://billingrails.page/acme/i/inv_IhMUl3rrZ3/pdf",
"hosted_url": "https://billingrails.page/acme/i/inv_IhMUl3rrZ3",
"subscription_id": "sub_IhMUl3rrZ3",
"subtotal_amount": 1000,
"total_amount": 1000,
"created_at": "2025-02-14T17:33:40.843Z",
"due_at": "2025-02-14T17:33:40.843Z",
"issued_at": "2025-02-14T17:33:40.843Z",
"billing_start": "2025-02-14T17:33:40.843Z",
"billing_end": "2025-02-14T17:33:40.843Z",
"line_items": [
{
"object": "invoice_line_item",
"id": "invli_IhMUl3rrZ3",
"name": "Basic Plan",
"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"
}
]
},
"meta": {
"request_id": "req_IhMUl3rrZ3"
}
}