POST
/
v1
/
businesses
/
{business_id}
/
invoices
/
refunds

Path Parameters

business_id
string
required

ID of the Business the invoice is associated with.

Body

external_id
string

Unique ID of the refund in your system for linking and idempotency.

completed_at
ISO8601 timestamp
required

Timestamp when refund posted.

refunded_amount
integer
required

Amount of refund received by customer.

fee
integer

Fee, in cents, charged by payment processor for the refund.

method
enum
required

Payment method. Possible values are: CASH, CHECK, CREDIT_CARD, ACH, STORE_CREDIT, OTHER

processor
string

Processor used to make the payment, if any. Any processor name can be provided and will be tracked. Supported processors (STRIPE, SHOPIFY) will have additional asset balance tracking.

customer_id
string

ID of the Customer the refund is associated with. Either the customer_id or the customer_external_id must be provided.

customer_external_id
string

External ID of the Customer the refund 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 a refund. 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 udpated later using the Update a customer endpoint.

invoice_id
string

Invoice ID this refund was applied to, if applicable. This field does not need to be specified, but if invoice_line_item_id is also specified, it must belong to this invoice.

invoice_external_id
string

Invoice external ID this refund was applied to, if applicable. This field is for convience if it is easier to reference invoices by an external ID. This field can be used instead of or alongside invoice_id, but if both are specified, they must refer to the same invoice.

invoice_line_item_id
string

Invoice line item ID specifying an exact product or service which was refunded.

invoice_payment_id
string

Payment ID this refund was applied to, if applicable.

invoice_payment_external_id
string

Specifies the payment this refund was applied to using the external ID of that payment. This field is for convenience if it is easier to reference payments by an external ID. This field can be used instead of or alongside invoice_payment_id, but if both are specified, they must refer to the same payment.

Response

Returns the created Refund Object