Skip to main content
POST
Typescript (SDK)

Body Parameters

Response

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-api-version
string
default:2.5.0
required

Body

application/json
customer_id
string
required

The customer to invoice.

entity_id
string

The entity every plan is billed to unless the plan sets its own entity_id. The invoice is tagged with it when every plan line resolves to this entity.

Minimum string length: 1
plans
object[]
custom_line_items
object[]

Charges that are not tied to any plan or feature.

discounts
AttachDiscount · object[]

Discounts applied to the whole invoice.

invoice_template_id
string

ID of an invoice template whose footer, memo and default payment terms are applied.

net_terms_days
integer

Days until the invoice is due. Defaults to the template's terms, then the org default. Cannot be combined with due_date.

Required range: -9007199254740991 < x <= 9007199254740991
issue_date
integer

Date of issue printed on the invoice, in milliseconds. Defaults to now; cannot be in the future.

Required range: 0 <= x <= 9007199254740991
due_date
integer

When payment is due, in milliseconds. Must be in the future. Cannot be combined with net_terms_days.

Required range: 0 <= x <= 9007199254740991
tax_rate_id
string

Stripe tax rate ID (txr_...) applied to every line.

period_start
integer

Start of the period being invoiced, in milliseconds. Plan, feature and license lines without their own period use this one, and every line period must fall inside it. If omitted, lines without their own period carry none and are not prorated.

Required range: 0 <= x <= 9007199254740991
period_end
integer

End of the period being invoiced, in milliseconds. Given together with period_start.

Required range: 0 <= x <= 9007199254740991
preview
boolean

If true, returns the calculated lines and totals without creating an invoice.

issue_method
enum<string>

draft leaves the invoice editable. finalize opens it without Stripe emailing, reminding or charging (auto_advance off). send opens it with auto_advance on. Defaults to send.

Available options:
draft,
finalize,
send

Response

200 - application/json

OK

invoice
object | null
required

The created invoice. Null when preview is true.

preview
object
required