v51

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2026-08-011534301009.2 KB
Billing

Simulate an invoice for a customer

Simulate an invoice for a customer.

This call will simulate an invoice for a customer based on the pending line items.

The call will return the total amount of the invoice and the line items that will be included in the invoice.

post/api/v1/billing/customers/{customerId}/invoices/simulate

Path parameters

customerIdstring required
Example:01G65Z755AFWAKHE12NY0CQ9FH

Request body

numberstring

InvoiceNumber is a unique identifier for the invoice, generated by the invoicing app.

The uniqueness depends on a lot of factors:

  • app setting (unique per app or unique per customer)
  • multiple app scenarios (multiple apps generating invoices with the same prefix)
currencystring required

Three-letter ISO4217 currency code. Custom three-letter currency codes are also supported for convenience.

Response

The request has succeeded.

idstring required

A unique identifier for the resource.

descriptionstring

Optional description of the resource. Maximum 1024 characters.

metadataMetadata

Set of key-value pairs. Metadata can be used to store additional information about a resource.

createdAtstring date-time required

Timestamp of when the resource was created.

updatedAtstring date-time required

Timestamp of when the resource was last updated.

deletedAtstring date-time

Timestamp of when the resource was permanently deleted.

type'standard' | 'credit_note' required

InvoiceType represents the type of invoice.

The type of invoice determines the purpose of the invoice and how it should be handled.

numberstring required

InvoiceNumber is a unique identifier for the invoice, generated by the invoicing app.

The uniqueness depends on a lot of factors:

  • app setting (unique per app or unique per customer)
  • multiple app scenarios (multiple apps generating invoices with the same prefix)
currencystring required

Three-letter ISO4217 currency code. Custom three-letter currency codes are also supported for convenience.

status'gathering' | 'draft' | 'issuing' | 'issued' | 'payment_processing' | 'overdue' | 'paid' | 'uncollectible' | 'voided' required

InvoiceStatus describes the status of an invoice.

issuedAtstring date-time

The time the invoice was issued.

Depending on the status of the invoice this can mean multiple things:

  • draft, gathering: The time the invoice will be issued based on the workflow settings.
  • issued: The time the invoice was issued.
draftUntilstring date-time

The time until the invoice is in draft status.

On draft invoice creation it is calculated from the workflow settings.

If manual approval is required, the draftUntil time is set.

quantitySnapshotedAtstring date-time

The time when the quantity snapshots on the invoice lines were taken.

collectionAtstring date-time

The time when the invoice will be/has been collected.

dueAtstring date-time

Due time of the fulfillment of the invoice (if available).

voidedAtstring date-time

The time the invoice was voided.

If the invoice was voided, this field will be set to the time the invoice was voided.

sentToCustomerAtstring date-time

The time the invoice was sent to customer.