Skip to main content
Customers sometimes pay more than an invoice total, or pay a deposit before an invoice exists. Layer tracks this extra amount as a customer credit in a liability account. When the customer uses the credit, you record a separate payment that moves the credit onto the new invoice. This approach has two benefits:
  • The original payment never changes after you record it.
  • The credit balance is visible on the balance sheet until the customer uses it.
All amounts are integer cents. All examples use Record a payment: POST /v1/businesses/{businessId}/invoices/payments.

Record an overpayment

Allocate the invoice amount to the invoice, and allocate the extra amount to a liability account. In this example, a customer pays $125.00 on a $100.00 invoice.
Invoice inv-500 is fully paid, and $25.00 sits in Unearned Revenue as a customer credit.
Always allocate the extra amount to a named liability account. Do not allocate it to Accounts Receivable. If you leave it unallocated, Layer records it as Uncategorized Revenue, and a later redemption cannot offset it.

Record a deposit before an invoice exists

A deposit, such as a payment on an accepted quote, uses the same pattern. Allocate the full amount to the liability account.

Apply the credit to a later invoice

When the customer uses the credit, record a new payment with method CREDIT_BALANCE. Set paid_at to the date that the credit is applied. Set redemption_account to the same account that holds the credit. In this example, the customer applies the $25.00 credit to a $60.00 invoice.
This payment moves $25.00 out of Unearned Revenue and onto invoice `inv-612`. The customer pays the remaining $35.00 with a normal payment. To use only part of a credit, set amount to the part that is used. The rest stays in the liability account. CREDIT_BALANCE payments have these rules:
  • Do not send a processor, fee, or additional_fees.
  • Send redemption_account only with method CREDIT_BALANCE. If you omit it, Layer uses Unearned Revenue.
  • The sum of invoice_payments must not be more than amount.

Accounting effect

Track different types of credit

You can track deposits, overpayments, and gift balances separately. Create child accounts under Unearned Revenue, or other liability accounts, with Create ledger account. Use the same account in the original allocation and in redemption_account. Separate accounts are optional. They are not an accounting requirement.

Import sales and AR data

Review how invoices, payments, refunds, and payouts flow into Layer.

Record a payment

Review the request parameters for invoice payments.