Create an Invoice
This endpoint imports an invoice for a business into Layer.
Path Parameters
Body
External ID for the invoice within your platform. Idempotency key.
When the invoice was sent by the business to the recipient.
When the invoice is due.
When the invoice was voided. Voiding excludes the invoice entirely from accounting.
Number for the invoice for display to end-users.
ID of the Customer the invoice is associated with.
Either the customer_id
or the customer_external_id
must be provided.
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 updated later using the Update a customer endpoint.
Any text you would like to associate with the invoice (for example, to display to end users)
Line items making up the invoice.
Additional discount applied to the whole invoice in addition to individual line items.
List of sales tax obligations on this line item.
Tips included by the buyer, in cents.
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 that have been made towards the balance of the invoice.
Arbitrary metadata you can include with the invoice payment
Arbitrary metadata you can include with 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 for the invoice within your platform. Idempotency key.
Method used to make the payment.
Values can be: CASH
, CHECK
, CREDIT_CARD
, ACH
, REDEEMED_PREPAYMENT
, OTHER
Fee associated with processing a payment, e.g. credit card processing fees, in cents.
Value of the payment, in cents. If blank, this is assumed to be the entire total of the invoice.
Optional: Create refunds with the invoice
This field can be specified when creating an invoice and any of its invoice line items or invoice payments
List of Dedicated Refunds to create with this payment