Skip to main content
POST
Preview an invoice

Authorizations

Authorization
string
header
required

Enter your JWT in the format: Bearer {token}

Path Parameters

workspaceId
string
required

The ID of the workspace.

Example:

"ws_a1b2c3d4e5f6g7h8"

billingAccountId
string
required

The ID of the billing account, which corresponds to a Stripe Customer ID (cus_...).

Example:

"cus_a1b2c3d4e5f6g7h8"

Body

application/json
subscription_id
string

The ID of an existing subscription to preview changes for. If omitted, previews a new subscription.

Example:

"sub_a1b2c3d4e5f6g7h8"

items
object[]

A list of products and their new quantities to preview. To remove a product, set its quantity to 0 or omit it.

cancel_subscription
boolean

Set to true to preview the invoice for canceling the subscription at the end of the current period.

Example:

false

Response

The previewed invoice object.

id
string
Example:

"in_1Kb..."

customer_id
string
Example:

"cus_..."

status
string
Example:

"paid"

amount_due
integer

Final amount due in the smallest currency unit (e.g., cents).

Example:

999

amount_paid
integer

The amount paid on this invoice in the smallest currency unit.

Example:

999

currency
string
Example:

"usd"

created_at
string<date-time>
Example:

"2025-10-29T00:40:06.000000Z"

subtotal
integer

Total of all line items before discounts and taxes.

Example:

1099

total
integer

Total after discounts and taxes.

Example:

999

tax
integer | null

The amount of tax on this invoice.

Example:

0

discount_amount
integer | null

The total discount amount applied to this invoice.

Example:

100

discount_names
string[]
Example:
lines
object[]
due_date
string<date-time> | null
Example:

null

hosted_invoice_url
string<uri> | null
Example:

"https://invoice.stripe.com/..."

invoice_pdf
string<uri> | null
Example:

"https://pay.stripe.com/..."

number
string | null
Example:

"AB123-001"