Skip to main content
POST
Create an invoice
See Create an invoice.

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.

issueDate
string<date>
required
dueDate
string<date>
required

On or after issueDate.

timezone
string
required

The IANA timezone the invoice's dates are in.

Minimum string length: 1
Example:

"America/New_York"

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.

number
string

Uppercase letters, digits, dashes and underscores. Defaults to the next number in your invoice settings.

Required string length: 1 - 50
Pattern: ^[A-Z0-9_-]+$
Example:

"INV-1042"

scheduledSendDate
string<date>

Email the invoice at 9:00 on this day in timezone instead of now. The invoice stays scheduled until then.

discount
Percentage · object

Taken off the line items' subtotal before tax.

taxRate
number

Tax as a percent of the subtotal after the discount. 8.5 means 8.5%.

Required range: 0 <= x <= 100
memo
string

A note printed on the invoice.

Required string length: 1 - 500
ccEmails
string<email>[]

Also copied on the invoice and its reminders.

Maximum array length: 10
paymentMethods
InvoicePaymentMethodInput · object[]

How the customer can pay, each type at most once. bank_transfer is always offered, so omit this to offer only that.

Maximum array length: 4

Response

The created invoice.

A request for payment you send a customer. Slash emails it, hosts a payment page at payUrl, matches incoming deposits to it and keeps its status and amounts up to date. All amounts are in USD.

id
string
required

Invoice id with the inv_ prefix.

Example:

"inv_2rj4l7hmrrrcv"

number
string
required

Unique per legal entity.

Example:

"INV-1042"

status
enum<string>
required
Available options:
scheduled,
unpaid,
partially_paid,
paid,
void
overdue
boolean
required

Whether the invoice is unpaid or partially_paid and its due date has passed in its timezone.

accountId
string
required

The account payments settle into, with the sa_group_ prefix.

Example:

"sa_group_2rj4l7hmrrrcv"

issueDate
string<date>
required
dueDate
string<date>
required
timezone
string
required

The IANA timezone the invoice's dates are in.

Example:

"America/New_York"

lineItems
InvoiceLineItem · object[]
required
amounts
object
required
ccEmails
string[]
required

Also copied on the invoice and its reminders.

billedTo
object
required

The customer's details as they were when the invoice was created.

paymentMethods
InvoicePaymentMethod · object[]
required
payments
InvoicePayment · object[]
required

Oldest first.

payUrl
string
required

The hosted page where the customer views and pays the invoice.

documentId
string
required

The invoice's PDF, with the st_ prefix. Download it with GET /v2/documents/{documentId}. Each edit issues a new PDF.

Example:

"st_2rj4l7hmrrrcv"

createdAt
string<date-time>
required
customerId
string

Customer id with the le_cus_ prefix.

Example:

"le_cus_2rj4l7hmrrrcv"

virtualAccountId
string

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

seriesId
string

The recurring series that issued the invoice, with the inv_series_ prefix.

scheduledSendDate
string<date>

When a scheduled invoice will be emailed, at 9:00 in its timezone.

discount
Percentage · object

Taken off the line items' subtotal before tax.

taxRate
number

Tax as a percent of the subtotal after the discount. 8.5 means 8.5%.

Example:

8.5

memo
string

A note printed on the invoice.

nextReminderAt
string<date-time>

When the next automatic reminder is due to go out.

paidAt
string<date-time>

When the invoice became paid.

voidedAt
string<date-time>

When the invoice was voided.