Skip to main content
POST
Get invoice preview

Authorizations

x-api-key
string
header
required

Enter your API key in the format x-api-key <api-key>*

Body

application/json

Preview Invoice Request

subscription_id
string
required

subscription_id is the unique identifier of the subscription to preview invoice for

hide_zero_charges_line_items
boolean
default:false

hide_zero_charges_line_items indicates whether to hide line items with zero cost

period_end
string<date-time>

period_end is the optional end date of the period to preview

period_start
string<date-time>

period_start is the optional start date of the period to preview

Response

OK

adjustment_amount
string

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_due
string

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

amount_paid
string

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

amount_remaining
string

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

billing_period
string

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

billing_reason
string

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

billing_sequence
integer

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

coupon_applications
object[]

coupon_applications contains the coupon applications associated with this invoice (overrides embedded field)

created_at
string<date-time>
created_by
string
currency
string

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

customer
object

Customer response object containing all customer information

customer_id
string

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

description
string

description is an optional description or notes about this invoice

due_date
string<date-time>

due_date is the date when payment for this invoice is due

environment_id
string

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

finalized_at
string<date-time>

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

id
string

id is the unique identifier for this invoice

idempotency_key
string

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

invoice_number
string

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

invoice_pdf_url
string

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

invoice_status
enum<string>
Available options:
DRAFT,
FINALIZED,
VOIDED,
SKIPPED
invoice_type
enum<string>
Available options:
SUBSCRIPTION,
ONE_OFF,
CREDIT
issue_date
string<date-time>

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

last_computed_at
string<date-time>

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

line_items
object[]

line_items contains the individual items that make up this invoice (overrides embedded field)

metadata
object
overpaid_amount
string

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

paid_at
string<date-time>

paid_at is the timestamp when this invoice was fully paid

payment_status
enum<string>
Available options:
INITIATED,
PENDING,
PROCESSING,
SUCCEEDED,
OVERPAID,
FAILED,
REFUNDED,
PARTIALLY_REFUNDED,
VOIDED
period_end
string<date-time>

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

period_start
string<date-time>

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

recalculated_invoice_id
string

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_amount
string

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

status
enum<string>
Available options:
published,
deleted,
archived
subscription
object
subscription_customer_id
string

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_id
string

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

subtotal
string

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

taxes
object[]

tax_applied_records contains the tax applied records associated with this invoice

tenant_id
string
total
string

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

total_discount
string

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

total_prepaid_credits_applied
string

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

total_tax
string

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

updated_at
string<date-time>
updated_by
string
version
integer

version is the version number for tracking changes to this invoice

voided_at
string<date-time>

voided_at is the timestamp when this invoice was voided or cancelled