POST
/
v1
/
businesses
/
{business_id}
/
invoices

Path Parameters

business_id
string

ID of the Business the invoice is associated with.

Body

external_id
string
required

External ID for the invoice within your platform. Idempotency key.

sent_at
ISO8601 timestamp
required

When the invoice was sent by the business to the recipient.

due_at
ISO8601 timestamp

When the invoice is due.

voided_at
ISO8601 timestamp

When the invoice was voided. Voiding excludes the invoice entirely from accounting.

invoice_number
string

Number for the invoice for display to end-users.

customer_id
string

ID of the Customer the invoice is associated with. Either the customer_id or the customer_external_id must be provided.

customer_external_id
string

External ID of the Customer the invoice is associated with. Either the customer_id or the customer_external_id must be provided.

A customer does not need to be created before creating an invoice. When you provide a customer external id, Layer will create a customer object with the provided external id if it does not already exist. Customer details can be udpated later using the Update a customer endpoint.

line_items
array of InvoiceLineItem objects
required

Line items making up the invoice.

additional_discount
integer

Additional discount applied to the whole invoice in addition to individual line items.

additional_sales_taxes
array of TaxLineItem objects

List of sales tax obligations on this line item.

tips
integer

Tips included by the buyer, in cents.

tips_account
object

The Account Identifier for a tips account. If not specified, tips will be attributed to the Chart of Account’s default tips account, default a liability account. Alternate accounts can be specified in case tips should be tracked as revenue.

payments
array of InvoicePayment objects

Payments that have been made towards the balance of the invoice.

Response

Returns the created Invoice Object

Optional: Create a Paid invoice

You can specify an invoice as immediately paid by including InvoicePayment object(s) in the payments field of the invoice. This allows you to create and invoice and specify the full payment information in a single API call.

This is equivalent to creating an invoice and then creating a payment fully allocated to that invoice.

InvoicePayment parameters

external_id
string
required

External ID for the invoice within your platform. Idempotency key.

method
enum
required

Method used to make the payment. Values can be: CASH, CHECK, CREDIT_CARD, ACH, REDEEMED_PREPAYMENT, OTHER

fee
integer

Fee associated with processing a payment, e.g. credit card processing fees, in cents.

additional_fees
array of InvoicePaymentFee objects
amount
integer

Value of the payment, in cents. If blank, this is assumed to be the entire total of the invoice.