Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Body

application/json

Autogenerated input type of CreateInvoice

collection_method
enum<string>
required

How the invoice should be collected. Use charge_automatically to charge a stored payment method, or send_invoice to email the customer.

Available options:
send_invoice,
charge_automatically
company_id
string
required

The unique identifier of the company to create this invoice for.

Example:

"biz_xxxxxxxxxxxxxx"

plan
object
required

The plan attributes defining the price, currency, and billing interval for this invoice.

product
object
required

The properties of the product to create for this invoice. Provide this to create a new product inline.

automatically_finalizes_at
string<date-time> | null

The date and time when the invoice will be automatically finalized. For charge_automatically, triggers an automatic charge. For send_invoice, sends the invoice email to the customer at the specified time.

Example:

"2023-12-01T05:00:00.401Z"

billing_address
object | null

Inline billing address to create a new mailing address for this invoice. Cannot be used together with mailing_address_id.

charge_buyer_fee
boolean | null

Whether to charge the customer a buyer fee on this invoice.

customer_name
string | null

The name of the customer. Required when creating an invoice for a customer who is not yet a member of the company.

due_date
string<date-time> | null

The date by which the invoice must be paid. Required unless save_as_draft is true.

Example:

"2023-12-01T05:00:00.401Z"

email_address
string | null

The email address of the customer. Required when creating an invoice for a customer who is not yet a member of the company.

line_items
object[] | null

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price.

mailing_address_id
string | null

The unique identifier of an existing mailing address to attach to this invoice. Cannot be used together with billing_address.

Example:

"ma_xxxxxxxxxxxxxxx"

member_id
string | null

The unique identifier of an existing member to create this invoice for. If not provided, you must supply an email_address and customer_name.

Example:

"mber_xxxxxxxxxxxxx"

payment_method_id
string | null

The unique identifier of the payment method to charge. Required when collection_method is charge_automatically.

Example:

"pmt_xxxxxxxxxxxxxx"

payment_token_id
string | null

The payment token ID to use for this invoice. If using charge_automatically, you must provide a payment_token.

Example:

"payt_xxxxxxxxxxxxx"

save_as_draft
boolean | null

When true, creates the invoice as a draft without sending or charging. Relaxes customer and due date requirements.

subscription_billing_anchor_at
string<date-time> | null

The date that defines when the subscription billing cycle should start. When set on a renewal plan invoice, this anchors all future billing periods to this date.

Example:

"2023-12-01T05:00:00.401Z"

Response

A successful response

An invoice represents an itemized bill sent by a company to a customer for a specific product and plan, tracking the amount owed, due date, and payment status.

created_at
string<date-time>
required

The datetime the invoice was created.

Example:

"2023-12-01T05:00:00.401Z"

current_plan
object
required

The plan that this invoice charges for.

due_date
string<date-time> | null
required

The deadline by which payment is expected. Null if the invoice is collected automatically.

Example:

"2023-12-01T05:00:00.401Z"

email_address
string | null
required

The email address of the customer this invoice is addressed to. Null if no email is on file.

Example:

"customer@example.com"

fetch_invoice_token
string
required

A signed token that allows fetching invoice data publicly without authentication.

Example:

"eyJhbGciOiJIUzI1NiJ9..."

id
string
required

The unique identifier for the invoice.

Example:

"inv_xxxxxxxxxxxxxx"

line_items
object[]
required

Optional line items that break down the invoice total into individual charges.

number
string
required

The sequential invoice number for display purposes.

Example:

"#0001"

status
enum<string>
required

The current payment status of the invoice, such as draft, open, paid, or void.

Available options:
draft,
open,
paid,
past_due,
uncollectible,
void
user
object | null
required

The user this invoice is addressed to. Null if the user account has been removed.