Invoices and payments
Invoices and payments represent revenue collected by your business customers. This can be in-person sales made through a point of sale system, invoices sent through your software, ecommerce sales, or any other type of accounts receivable activity. To import invoices, make a call to the Create Invoice endpoint. This endpoint takes in the data on the sale your customer made, what was sold, any associated taxes, and how the sale was paid for.Invoices without payments
Invoices can be created without any payments associated with them. Payments towards the invoice can then be recorded later on using the Record an Invoice Payment endpoint.Request
Response
Invoices with payments
For instances where invoices are immediately paid, such as when using a point of sale device for in-person sales or online merchandise sales, you can also include payment information directly in the creation of the invoice. This looks very similar to the above example with the addition of payment information.Request
Response
Payouts
A Payout represents a processor deposit that moves funds from a payment processor, such as Stripe, to one of your business customers’ bank accounts. Payouts are used to reconcile bank transactions that represent processor deposits with the underlying processor activity they contain, such as invoice payments and refunds. Matching bank transactions to payouts prevents revenue from being double-counted: first from the invoice payment, and second from categorizing the bank transaction as revenue.Importing payouts
Create payouts with the Create Payout endpoint, or use Bulk Create Payouts to create or update multiple payouts in a single request. Ifprocessor is set (e.g. STRIPE), every linked payment and refund must also use this processor value. Use the Update Payout endpoint to modify a payout after it has been created.
external_id is your idempotency key. Re-posting the same external_id returns the existing payout unchanged. The bulk endpoint uses upsert semantics: if a payout with the same external_id already exists, it will be updated; otherwise, a new payout is created.
Linking payments and refunds
Attach existing invoice payments and refunds by Layer ID or your external ID:Other transactions
Useother_transactions for line items that are not represented as invoice payments or refunds (e.g. Merchant Cash Advance fees, tax withholding, or other fees).
Stripe Instant Payouts
Instant payouts from Stripe should be imported as two Payout objects in Layer: one payout for the instant cash movement, and one following payout that reconciles the itemized payment activity when Stripe includes it in a later payout. Normal Stripe payouts are itemized around the specific transactions included in the payout. Instant payouts are amount-based, so Layer represents the instant transfer separately from the later itemized payout that contains the payment.Process Steps
The expected process steps are:- Import the invoice and payment.
- Create the instant payout with no payments or refunds, plus one
CREDITtransaction toSTRIPE_CLEARING. - Create the following payout with the original payment attached, plus one
DEBITtransaction fromSTRIPE_CLEARING.
STRIPE_CLEARING entries will offset each other.
1. Import the payment
First, import the sale and its Stripe payment. In the example payout below, there is an invoice for12500 cents, with one credit card payment for the same amount and no fee.
2. Create the instant payout
Create a payout for the instant transfer itself. Note the example payout below has the amount that Stripe deposited, but does not yet attach the invoice payment.3. Create the following payout
When Stripe later reports the itemized payout that includes the payment, create a second payout. In the example payout below, thepaid_out_amount of 0, references the invoice payment created earlier and includes the opposite STRIPE_CLEARING transaction.
STRIPE_CLEARING account will net to zero after the CREDIT and DEBIT transactions are applied.