Skip to main content
POST
Create an invoice series

Authorizations

X-API-Key
string
header
required

User API key authentication. Create a key under Settings → API keys in the Slash dashboard (https://app.slash.com/global-settings/api-keys) and send the x-legal-entity header naming the legal entity to act on with every request. Keys scoped to a legal entity are rejected with 403 user_api_key_required.

Headers

X-Idempotency-Key
string
required

Unique caller-generated key for one create request. Once an authenticated, schema-valid request reaches the operation, the key is permanently consumed for that operation and legal entity whether the operation succeeds or fails. Reusing it in that scope returns 409 and never replays a response, unlike API v1, which replays the original response for a matching key.

Required string length: 1 - 255

The legal entity to act on. Required on every request; a user API key can act on any legal entity its user has access to.

Pattern: ^le_[a-zA-Z0-9]+$

Body

application/json
customerId
string
required

Customer id with the le_cus_ prefix.

recurrence
Weekly · object
required

Which days the series issues an invoice on.

startDate
string<date>
required

The first day the series can issue an invoice on: today or later in timezone.

timezone
string
required

The IANA timezone the series' dates are in.

Minimum string length: 1
Example:

"America/New_York"

paymentTermsDays
integer
required

Each invoice is due this many days after it's issued.

Required range: 0 <= x <= 365
lineItems
InvoiceLineItemCreate · object[]
required
Required array length: 1 - 200 elements
accountId
string

The account payments settle into, with the sa_group_ prefix. Required when the legal entity has more than one account that can receive payments.

virtualAccountId
string

A virtual account to settle into instead of the account's primary one, with the subaccount_ prefix.

end
Never · object

Defaults to { "type": "never" }.

discount
Percentage · object

Taken off the line items' subtotal before tax.

taxRate
number

Tax as a percent of the subtotal after the discount.

Required range: 0 <= x <= 100
memo
string
Required string length: 1 - 500
ccEmails
string<email>[]
Maximum array length: 10
paymentMethods
InvoicePaymentMethodInput · object[]

How the customer can pay, each type at most once. bank_transfer is always offered.

Maximum array length: 4

Response

The created series.

Issues the same invoice to a customer on a schedule. Each invoice is created scheduled ahead of its send date, is sent at 9:00 in the series' timezone, and then behaves like any other invoice. All amounts are in USD.

id
string
required

Series id with the inv_series_ prefix.

Example:

"inv_series_2rj4l7hmrrrcv"

status
enum<string>
required
Available options:
active,
ended,
cancelled
accountId
string
required

The account payments settle into, with the sa_group_ prefix.

recurrence
Weekly · object
required

Which days the series issues an invoice on.

startDate
string<date>
required

The first day the series can issue an invoice on.

timezone
string
required

The IANA timezone the series' dates are in.

Example:

"America/New_York"

paymentTermsDays
integer
required

Each invoice is due this many days after it's issued.

end
Never · object
required

When the series stops issuing invoices.

lineItems
InvoiceLineItem · object[]
required
amounts
object
required

Each invoice's amounts.

ccEmails
string[]
required
paymentMethods
InvoicePaymentMethod · object[]
required
createdAt
string<date-time>
required
customerId
string

Customer id with the le_cus_ prefix.

virtualAccountId
string

The virtual account payments settle into, with the subaccount_ prefix. Absent when they settle into the account's primary virtual account.

discount
Percentage · object

Taken off the line items' subtotal before tax.

taxRate
number

Tax as a percent of the subtotal after the discount.

memo
string
nextInvoiceDate
string<date>

When the next invoice goes out. Only on active series.

nextInvoiceId
string

The next invoice, already created as scheduled, with the inv_ prefix. Only on active series.