Skip to main content
POST
Create a one-off invoice

Authorizations

Authorization
string
header
required

API Keys can be issued in the Orb's web application.

Body

application/json
currency
string
required

An ISO 4217 currency string. Must be the same as the customer's currency if it is set.

Example:

"USD"

invoice_date
required

An ISO 8601 date or timestamp, interpreted in the customer's timezone. If a date is set without a time, invoice_date is set to midnight on the chosen date in the customer's timezone. invoice_date cannot be more than one year in the future.

Example:

"2025-09-22"

line_items
InvoiceLineItemParams · object[]
required
Minimum array length: 1
metadata
Metadata · object | null

User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

customer_id
string | null

The id of the Customer to create this invoice for. One of customer_id and external_customer_id are required.

Example:

"4khy3nwzktxv7"

external_customer_id
string | null

The external_customer_id of the Customer to create this invoice for. One of customer_id and external_customer_id are required.

Example:

"external-customer-id"

memo
string | null

An optional memo to attach to the invoice. If no memo is provided, we will attach the default memo

Example:

"An optional memo for my invoice."

will_auto_issue
boolean
default:false

When true, auto-issues the invoice on the invoice date. If the invoice date is today's date or earlier, the invoice will be issued upon creation. When false, the resulting invoice will require manual review to issue. Defaults to false.

Example:

false

net_terms
integer | null

The net terms determines the due date of the invoice. Due date is calculated based on the invoice or issuance date, depending on the account's configured due date calculation method. A value of '0' here represents that the invoice is due on issue, whereas a value of '30' represents that the customer has 30 days to pay the invoice. Do not set this field if you want to set a custom due date.

Required range: x >= 0
Example:

0

due_date

An optional custom due date for the invoice. If not set, the due date will be calculated based on the net_terms value.

Example:

"2025-09-22"

discount
PercentageDiscount · object

An optional discount to attach to the invoice.

auto_collection
boolean | null

Determines whether this invoice will automatically attempt to charge a saved payment method, if any. If not specified, the invoice inherits the customer's auto_collection setting.

Response

Created

An Invoice is a fundamental billing entity, representing the request for payment for a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as the result of an action, such as a cancellation.

metadata
Metadata · object
required

User specified key-value pairs for the resource. If not present, this defaults to an empty dictionary. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

voided_at
string<date-time> | null
required

If the invoice has a status of void, this gives a timestamp when the invoice was voided.

paid_at
string<date-time> | null
required

If the invoice has a status of paid, this gives a timestamp when the invoice was paid.

issued_at
string<date-time> | null
required

If the invoice has been issued, this will be the time it transitioned to issued (even if it is now in a different state.)

scheduled_issue_at
string<date-time> | null
required

If the invoice is in draft, this timestamp will reflect when the invoice is scheduled to be issued.

auto_collection
AutoCollection · object
required
issue_failed_at
string<date-time> | null
required

If the invoice failed to issue, this will be the last time it failed to issue (even if it is now in a different state.)

sync_failed_at
string<date-time> | null
required

If the invoice failed to sync, this will be the last time an external invoicing provider sync was attempted. This field will always be null for invoices using Orb Invoicing.

payment_failed_at
string<date-time> | null
required

If payment was attempted on this invoice but failed, this will be the time of the most recent attempt.

payment_started_at
string<date-time> | null
required

If payment was attempted on this invoice, this will be the start time of the most recent attempt. This field is especially useful for delayed-notification payment mechanisms (like bank transfers), where payment can take 3 days or more.

amount_due
string
required

This is the final amount required to be charged to the customer and reflects the application of the customer balance to the total of the invoice.

Example:

"8.00"

created_at
string<date-time>
required

The creation time of the resource in Orb.

Example:

"2022-05-01T07:01:31+00:00"

currency
string
required

An ISO 4217 currency string or credits

Example:

"USD"

customer
CustomerMinified · object
required
due_date
string<date-time> | null
required

When the invoice payment is due. The due date is null if the invoice is not yet finalized.

Example:

"2022-05-30T07:00:00+00:00"

id
string
required
invoice_pdf
string | null
required

The link to download the PDF representation of the Invoice.

Example:

"https://assets.withorb.com/invoice/rUHdhmg45vY45DX/qEAeuYePaphGMdFb"

invoice_number
string
required

Automatically generated invoice number to help track and reconcile invoices. Invoice numbers have a prefix such as RFOBWG. These can be sequential per account or customer.

Example:

"JYEFHK-00001"

subscription
SubscriptionMinified · object | null
required
total
string
required

The total after any minimums and discounts have been applied.

Example:

"8.00"

customer_balance_transactions
CustomerBalanceTransaction · object[]
required
status
enum<string>
required
Available options:
issued,
paid,
synced,
void,
draft
invoice_source
enum<string>
required
Available options:
subscription,
partial,
one_off
shipping_address
Address · object | null
required
billing_address
Address · object | null
required
hosted_invoice_url
string | null
required

A URL for the customer-facing invoice portal. This URL expires 60 days after the link is generated, or 30 days after the invoice's due date — whichever is later.

will_auto_issue
boolean
required

This is true if the invoice will be automatically issued in the future, and false otherwise.

eligible_to_issue_at
string<date-time> | null
required

If the invoice has a status of draft, this will be the time that the invoice will be eligible to be issued, otherwise it will be null. If auto-issue is true, the invoice will automatically begin issuing at this time.

customer_tax_id
CustomerTaxId · object | null
required

Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices.

Supported Tax ID Countries and Types

memo
string | null
required

Free-form text which is available on the invoice PDF and the Orb invoice portal.

credit_notes
CreditNoteSummary · object[]
required

A list of credit notes associated with the invoice

payment_attempts
PaymentAttempt · object[]
required

A list of payment attempts associated with the invoice

discount
any | null
required
deprecated

This field is deprecated in favor of discounts. If a discounts list is provided, the first discount in the list will be returned. If the list is empty, None will be returned.

discounts
(PercentageDiscount · object | AmountDiscount · object | TrialDiscount · object | TieredPercentageDiscount · object)[]
required
minimum
Minimum · object | null
required
minimum_amount
string | null
required
maximum
Maximum · object | null
required
maximum_amount
string | null
required
line_items
InvoiceLineItem · object[]
required

The breakdown of prices in this invoice.

subtotal
string
required

The total before any discounts and minimums are applied.

Example:

"8.00"

invoice_date
string<date-time>
required

The scheduled date of the invoice

Example:

"2022-05-01T07:00:00+00:00"