Skip to content

Preview invoice

POST
/v1/invoices/preview

Preview an invoice for a subscription without persisting anything.

InvoicePreviewRequest

Request body for invoice preview.

object
subscription_id
required
Subscription Id
string format: uuid
billing_period_start
Any of:
string format: date-time
billing_period_end
Any of:
string format: date-time

Successful Response

InvoicePreviewResponse

Response for an invoice preview.

object
subtotal_cents
required
Subtotal Cents
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
tax_amount_cents
required
Tax Amount Cents
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
coupons_amount_cents
required
Coupons Amount Cents
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
prepaid_credit_amount_cents
required
Prepaid Credit Amount Cents
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
total_cents
required
Total Cents
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
currency
required
Currency
string
fees
required
Fees
Array<object>
FeePreview

Preview of a single fee/line item.

object
description
required
Description
string
units
required
Units
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
unit_amount_cents
required
Unit Amount Cents
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
amount_cents
required
Amount Cents
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
charge_model
Any of:
string
metric_code
Any of:
string

Subscription not found or not active

Unauthorized – invalid or missing API key

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object