Create invoice ondemand for subscription

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

A one-time invoice can be created on demand for a subscription. It is configurable in the request where the order lines for the invoice should come from. The following are possible:

  • Subscription plan (and attached subscription add-ons)
  • Pending additional costs
  • Pending credits
  • Optionally given additional order lines

Control when the invoice is charged using the instant and due parameters. By default (instant=false), invoices are queued for automatic processing (typically within 5 minutes) and follow your dunning plan if payment fails, providing automatic retries for standard subscription billing. Set instant: true to process payment immediately and synchronously: the API call will return the invoice as either settled or failed with no dunning, ideal when you need instant confirmation for pay-per-use features or point-of-sale scenarios. Alternatively, set a due date (e.g., "2026-12-01T00:00:00") to defer processing until a specific time: the invoice remains pending until that date, then enters automatic processing with dunning support, perfect for scheduled renewals or planned future charges. Note that instant=true and due cannot be combined; attempting to use both will return error code 1.

Optionally either an offline manual transfer or a settle with an alternative payment method can be given for the invoice creation. The manual transfer will always settle the invoice. If a settle using an alternative payment method fails, the invoice will left pending if instant is not used, and failed otherwise.

Errors

The operation can generate the following errors beside the generic HTTP error codes described here.

Error code HTTP codeDescription
12404Subscription not found
13400Subscription expired
95400Subscription on-hold
54400The request results in an invoice with no order lines
1 400 Due argument was given for an instant invoice request
76 400Payment method not provided and settle requested
40404 Payment method provided not found
Path Params
string
required

Subscription handle

Body Params
string
required
length ≥ 1

Per account unique handle for the invoice. Max length 255 with allowable characters [a-zA-Z0-9_.-@]. It is recommended to use a maximum of 20 characters as this will allow for the use of handle as reference on bank statements without truncation.

string

Optional due date and time on the form yyyy-MM-dd, yyyyMMdd, yyyy-MM-ddTHH:mm and yyyy-MM-ddTHH:mm:ss from which the invoice is eligible to be collected.

metadata
object

Custom metadata.

boolean

Create and process invoice instantly and leave as either settled or failed. The default is to leave the invoice for automatic processing and potential dunning management as other subscription invoices (default false).

settle
object

Optional settle to perform after creation using a different payment method. If the settle fails the status will be failed if instant or pending if not instant. The due date will be ignored for subscription invoice create.

boolean

Create manually for plan by adding plan product and potential add-ons as order line (default false)

string

Date and time on the form yyyy-MM-dd, yyyyMMdd, yyyy-MM-ddTHH:mm and yyyy-MM-ddTHH:mm:ss describing the start of the service period for the plan-related order lines. This only takes effect if plan_manual is set.

string

Date and time on the form yyyy-MM-dd, yyyyMMdd, yyyy-MM-ddTHH:mm and yyyy-MM-ddTHH:mm:ss describing the end of the service period for the plan-related order lines. This only takes effect if plan_manual is set.

add_on_service_periods
object

Optional map of add-on handles with date and time in the form yyyy-MM-dd, yyyyMMdd, yyyy-MM-ddTHH:mm and yyyy-MM-ddTHH:mm:ss describing the start and end of the service period for related order lines. This only takes effect if plan_manual is set.

boolean

Collect pending additional costs and transfer to invoice (default true)

additional_cost_service_periods
object

Optional map of additional cost handles with date and time in the form yyyy-MM-dd, yyyyMMdd, yyyy-MM-ddTHH:mm and yyyy-MM-ddTHH:mm:ss describing the start and end of the service period for related order lines. This only takes effect if plan_manual is set.

boolean

Collect pending credit and transfer to invoice (default true)

boolean

Apply potential discounts for the subscription to the invoice order lines (default true)

boolean

Include unbilled usage for the subscription's current billing period (default false)

string

Cost center for accounting invoices, overrides the value set for the subscription

string

Purchase order number for accounting invoices, overrides the value set for the subscription

order_lines
array of objects
length between 0 and 1000

Optional additional order lines for the invoice. A maximum of 100 order lines is allowed.

order_lines
billing_address
object

Optional billing address

shipping_address
object

Optional shipping address

manual_transfer
object

Optional manual transfer. If given the invoice will be settled using the manual transfer transaction.

Responses

Language
Credentials
Basic
base64
:
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json