Bulk create invoice payments
Creates multiple invoice payments in a single request. Each payment in the array uses the same parameters as the single payment endpoint. If a payment includes an external_id that matches an existing payment, the existing payment will be updated instead of creating a new one (upsert behavior).
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Content-Type must be set to application/json.
Path Parameters
The UUID of the business to create payments for.
Body
Array of payments to create. Each payment follows the same schema as the single payment creation endpoint.
The timestamp when the payment was made.
Payment method.
CASH, CHECK, CREDIT_CARD, ACH, CREDIT_BALANCE, OTHER Payment amount in cents.
Each element in this array is either an InvoicePaymentAllocation (allocating to an invoice) or an InvoicePaymentAllocationToLedgerAccount (allocating directly to a ledger account). The type is determined by the fields present: if account is provided, it is treated as a ledger account allocation; otherwise, it is treated as an invoice allocation.
Allocates a portion of the payment to a specific invoice.
- Invoice Payment Allocation
- Ledger Account Allocation
External identifier for the payment, used for idempotency.
Fee amount in cents.
Additional fees associated with the payment.
Payment processor name.
The ledger account to use for the payment (overrides the default determined by the payment method).
- Account ID
- Account Stable Name
Account to use for credit balance redemptions. Only applicable when method is CREDIT_BALANCE.
- Account ID
- Account Stable Name
Dedicated refunds to associate with this invoice payment.
Tags to apply to the payment.
Memo for any text you would like to associate with the payment.
Arbitrary custom metadata in JSON format.
Any (typically user-visible) identifier you would like to associate with the payment.
Response
Payments created or updated successfully. Returns the created/updated payment objects in the same order as the request.
Unique identifier for the payment.
Unique ID of the invoice payment in an external system for linking and idempotency.
"payment-1"
Timestamp when the payment was completed.
Payment method.
CASH, CHECK, CREDIT_CARD, ACH, CREDIT_BALANCE, OTHER Fee paid by business for processing of payment in positive cents.
Identifier for the ledger account to use if this is a prepayment.
- Account ID
- Account Stable Name
The the ledger account to use for the payment (overrides the default determined by the payment method), if specified.
List of additional fees associated with this payment.
Customer payment amount, in cents.
Processor used to make the payment, if any. Any processor name can be provided and will be tracked. Allowed only when method is CREDIT_CARD, ACH, CREDIT_BALANCE, or OTHER.
"STRIPE"
Timestamp when the payment was imported into Layer.
Allocations specify how a payment is distributed. A payment can include two types of allocations: InvoicePaymentAllocation (allocates to an invoice) and InvoicePaymentAllocationToLedgerAccount (allocates directly to a ledger account for overpayments or deposits). The sum of all allocation amounts must be less than or equal to the payment amount.
Allocates a portion of the payment to a specific invoice.
- Invoice Payment Allocation
- Ledger Account Allocation
Refund allocations associated with this invoice payment.
[]Payouts associated with this payment.
List of tags associated with this transaction.
[]Memo for any text you would like to associate with the invoice payment (for example, to display to end users).
Arbitrary custom metadata in JSON format with a size limit of 1KB.
{
"custom_field": "value",
"any valid json": "below 1kb",
"nested": { "meaning of life": 42, "array": [] }
}Any (typically user-visible) identifier you would like to associate with the invoice payment. Can be used to filter when listing invoice payments.