Create invoice preview

Creates a preview of the upcoming invoice for a subscription (or for a new subscription). - When subscriptionDetails is present in the request: preview shall be generated based on subscriptionDetails (request body). - When subscriptionDetails is absent: subscription and line items are fetched from DynamoDB (subscriptionId required). For previewType=next_invoice, logic aligns with CREATE/UPDATE subscription invoice generation. For previewType=recurring, returns a standard recurring cycle invoice (recurring items only).

Body Params

Request for creating an invoice preview. - subscription (subscriptionId) present = preview for existing subscription. - subscription absent = preview for new subscription; then customer and subscriptionDetails are required.

string

Customer ID. Required when subscription not sent (new subscription preview).

string

Subscription ID. When present, preview uses the existing subscription; when absent, use customer + subscriptionDetails for new subscription preview.

string
enum

next_invoice = next invoice for subscription; recurring = standard billing period

Allowed:
shippingDetails
object

Shipping details (optional; else from customer)

custom_fields
array of objects
custom_fields
subscriptionDetails
object

Object containing subscription details for the new subscription to be created (when subscription is not sent), or optional updates to apply for an existing subscription preview.

Headers
string
required
string
string
string
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json