Skip to main content
POST
Create draft invoice or add to next bill

Authorizations

Authorization
string
header
required

Team API key from Settings → Integrations. Use Authorization: Bearer <key> or x-api-key.

Body

application/json
customerId
string<uuid>
required

Customer id from list_customers.

items
object[]
required
Required array length: 1 - 25 elements
dueDate
string

Due date (YYYY-MM-DD). Defaults to the facility's usual terms.

Pattern: ^\d{4}-\d{2}-\d{2}$
memo
string

Note shown on the invoice.

Maximum string length: 500
billingOption
enum<string>

draft (default) creates a draft invoice. next_bill creates no invoice: each line is added to the customer's next monthly plan bill and charged with it (one charge per line). Answers 409 (code: no_eligible_plan) when the customer has no active monthly plan to add to, 409 (code: out_of_stock) when a capped product is sold out, 409 (code: idempotency_conflict) when idempotencyKey was already used for different lines, 409 (code: busy) when the plan's add-ons are being changed (retry shortly), or 409 (code: needs_confirmation) for a large amount sent without confirmedLargeAmount: true. dueDate and memo are ignored.

Available options:
draft,
next_bill
subscriptionId
string<uuid>

next_bill only: the plan to add to (from list_billing_subscriptions). Defaults to the plan that renews soonest.

addOnsGetPlanDiscount
boolean

next_bill only: when the plan has a percent-off discount on the whole plan, whether these lines get it too. Saved on the plan and used for later add-ons. Without an answer, add-ons pay full price.

idempotencyKey
string

next_bill only: send the same key when retrying so each line is stored once.

Required string length: 1 - 200
confirmedLargeAmount
boolean

next_bill only: set to true to add a large amount: any line over the facility's line amount, or lines that take the plan's waiting add-ons over its plan amount (set in Billing settings; $10,000 and $25,000 unless changed, and either can be turned off). Without it such a request stores nothing and answers 409 (code: needs_confirmation, details.largeAmount with the amount and the facility's limit as thresholdCents). Confirm with the person asking, then resend with the same idempotencyKey.

Response

Draft invoice created, or (next_bill) the lines added to the next bill.

data
object
required