v12

latestOpenAPI 3.0.1AGPL-3.0raw.githubusercontent.com2026-07-0971442569.2 KB
Invoices

Update invoice

Use when updating invoice metadata or due date (e.g. PDF URL, net terms). For paid invoices only safe fields can be updated.

put/invoices/{id}

Path parameters

idstring required

Invoice ID

Request body

due_datestring date-time
invoice_pdf_urlstring

invoice_pdf_url is the URL where customers can download the PDF version of this invoice

metadataTypesMetadata

Response

OK

adjustment_amountstring

adjustment_amount is the total sum of credit notes of type "adjustment". These are non-cash reductions applied to the invoice (e.g. goodwill credit, billing correction).

amount_duestring

amount_due is the total amount that needs to be paid for this invoice

amount_paidstring

amount_paid is the amount that has already been paid towards this invoice

amount_remainingstring

amount_remaining is the outstanding amount still owed on this invoice (calculated as amount_due minus amount_paid)

billing_periodstring

billing_period describes the billing period this invoice covers (e.g., "January 2024", "Q1 2024")

billing_reasonstring

billing_reason indicates why this invoice was generated (e.g., "subscription_billing", "manual_charge")

billing_sequenceinteger

billing_sequence is the sequential number indicating the billing cycle for subscription invoices

created_atstring date-time
created_bystring
currencystring

currency is the three-letter ISO currency code (e.g., USD, EUR, GBP) that applies to all monetary amounts on this invoice

customer_idstring

customer_id is the ID of the customer who will receive this invoice

descriptionstring

description is an optional description or notes about this invoice

due_datestring date-time

due_date is the date when payment for this invoice is due

environment_idstring

environment_id is the ID of the environment this invoice belongs to (for multi-environment setups)

finalized_atstring date-time

finalized_at is the timestamp when this invoice was finalized and made ready for payment

idstring

id is the unique identifier for this invoice

idempotency_keystring

idempotency_key is a unique key used to prevent duplicate invoice creation when retrying API calls

invoice_numberstring

invoice_number is the human-readable invoice number displayed to customers (e.g., INV-2024-001)

invoice_pdf_urlstring

invoice_pdf_url is the URL where customers can download the PDF version of this invoice

invoice_status'DRAFT' | 'FINALIZED' | 'VOIDED' | 'SKIPPED'
invoice_type'SUBSCRIPTION' | 'ONE_OFF' | 'CREDIT'
issue_datestring date-time

issue_date is the user-facing date of the invoice. Defaults to created_at if not set.

last_computed_atstring date-time

last_computed_at is the timestamp when this invoice was last computed by ComputeInvoice

metadataTypesMetadata
overpaid_amountstring

overpaid_amount is the amount overpaid if payment_status is OVERPAID (amount_paid - total)

paid_atstring date-time

paid_at is the timestamp when this invoice was fully paid

payment_status'INITIATED' | 'PENDING' | 'PROCESSING' | 'SUCCEEDED' | 'OVERPAID' | 'FAILED' | 'REFUNDED' | 'PARTIALLY_REFUNDED' | 'VOIDED'
period_endstring date-time

period_end is the end date of the billing period covered by this invoice

period_startstring date-time

period_start is the start date of the billing period covered by this invoice

recalculated_invoice_idstring

recalculated_invoice_id is the ID of the replacement invoice created when this invoice was voided and recalculated. When set, it forms a parent→child link from this (voided) invoice to the new replacement invoice.

refunded_amountstring

refunded_amount is the total sum of credit notes of type "refund". These are actual refunds issued to the customer.

status'published' | 'deleted' | 'archived'
subscription_customer_idstring

subscription_customer_id is the subscription owner's customer ID (Subscription.CustomerID). It may differ from customer_id when the subscription uses an invoicing customer. Set internally; nullable in DB.

subscription_idstring

subscription_id is the ID of the subscription this invoice is associated with (only present for subscription-based invoices)

subtotalstring

subtotal is the sum of all line items before any taxes, discounts, or additional fees

tenant_idstring
totalstring

total is the final amount including taxes, fees, and discounts

total_discountstring

total_discount is the sum of all coupon discounts applied to the invoice

total_prepaid_credits_appliedstring

total_prepaid_credits_applied is the total amount of prepaid credits applied to this invoice.

total_taxstring

total_tax is the sum of all taxes combined at the invoice level.

updated_atstring date-time
updated_bystring
versioninteger

version is the version number for tracking changes to this invoice

voided_atstring date-time

voided_at is the timestamp when this invoice was voided or cancelled