Skip to main content
A Customer Credit represents a transaction that reduces accounts payable to a customer, typically due to returned goods. Each customer credit has one or more line items specifying debited revenue accounts, and zero or more allocations applying portions of the credit to invoices.

Attributes

string
required
Unique identifier for the customer credit.
string
Unique ID of the customer credit in your system for linking purposes. Idempotency key.
Customer object
required
The Customer associated with this credit.
ISO8601 timestamp
required
Time when the customer credit was sent.
array of CustomerCreditLineItem objects
required
Line items included in this customer credit. See Customer Credit Line Item Object for details.
array of CustomerCreditAllocation objects
Allocations of this customer credit to invoices. See Customer Credit Allocation Object for details.
ISO8601 timestamp
required
Time when the customer credit was created in Layer.
ISO8601 timestamp
required
Time when the customer credit was last updated in Layer.
ISO8601 timestamp
Time when the customer credit was deleted, if applicable.
Array of Tags
Tags associated with the customer credit.
string
Memo for any text you would like to associate with the customer credit (for example, to display to end users).
object
Arbitrary custom metadata in JSON format with a size limit of 1KB.
string
Any (typically user-visible) identifier you would like to associate with the customer credit. Can be used to filter when listing customer credits.

Customer Credit Line Item Object

A Customer Credit Line Item represents an individual revenue account being credited by the Customer Credit.
string
required
Unique identifier for the customer credit line item.
SingleApiChartAccount object
Ledger account associated with this line item. This is what you’re specifying with the ‘revenue_account_identifier’ in the create parameters.
integer
required
Amount for the line item in cents.
string
Description or notes for the line item.
json object
Arbitrary metadata you can include with the customer credit line item

Customer Credit Allocation Object

A Customer Credit Allocation represents how a portion of a customer credit is applied to a specific invoice. By allocating customer credits to invoices, the amount owed to customers can be reduced accordingly.
string
required
Unique identifier for the customer credit allocation.
string
required
ID of the customer credit this allocation belongs to.
string
required
ID of the invoice this allocation is for.
integer
required
Amount of the allocation in cents.