Create a one-off invoice
This endpoint is used to create a one-off invoice for a customer.
Request body
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.
The id of the Customer to create this invoice for. One of customer_id and external_customer_id are required.
The external_customer_id of the Customer to create this invoice for. One of customer_id and external_customer_id are required.
An ISO 4217 currency string. Must be the same as the customer's currency if it is set.
An optional memo to attach to the invoice. If no memo is provided, we will attach the default memo
When true, this invoice will be submitted for issuance upon creation. When false, the resulting invoice will require manual review to issue. Defaulted to false.
Optional invoice date to set. Must be in the past, if not set, invoice_date is set to the current time in the customer's timezone.
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.
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.
Example request
{
"customer_id": "4khy3nwzktxv7",
"external_customer_id": "external-customer-id",
"currency": "USD",
"memo": "An optional memo for my invoice.",
"line_items": [
{
"start_date": "2023-09-22",
"end_date": "2023-09-22",
"quantity": 1,
"name": "Line Item Name",
"item_id": "4khy3nwzktxv7",
"model_type": "unit"
}
],
"discount": {
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"percentage_discount": 0.15
}
}Response
Created
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.
If the invoice has a status of void, this gives a timestamp when the invoice was voided.
If the invoice has a status of paid, this gives a timestamp when the invoice was paid.
If the invoice has been issued, this will be the time it transitioned to issued (even if it is now in a different state.)
If the invoice is in draft, this timestamp will reflect when the invoice is scheduled to be issued.
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.)
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.
If payment was attempted on this invoice but failed, this will be the time of the most recent attempt.
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.
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.
The creation time of the resource in Orb.
An ISO 4217 currency string or credits
When the invoice payment is due. The due date is null if the invoice is not yet finalized.
The link to download the PDF representation of the Invoice.
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.
The total after any minimums and discounts have been applied.
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.
This is true if the invoice will be automatically issued in the future, and false otherwise.
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.
Free-form text which is available on the invoice PDF and the Orb invoice portal.
The total before any discounts and minimums are applied.
The scheduled date of the invoice