Skip to main content
POST
/
v1
/
businesses
/
{businessId}
/
invoices
/
refunds
/
{refundId}
/
payments
Create refund payment
curl --request POST \
  --url https://sandbox.layerfi.com/v1/businesses/{businessId}/invoices/refunds/{refundId}/payments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "refunded_amount": 123,
  "completed_at": "2023-11-07T05:31:56Z",
  "method": "CASH",
  "external_id": "31415926535",
  "refund_processing_fee": 123,
  "processor": "STRIPE",
  "payment_clearing_account_identifier": {
    "type": "AccountId",
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "refunded_payment_fees": [
    {
      "account": {
        "type": "AccountId",
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      },
      "fee_amount": 123,
      "description": "<string>"
    }
  ],
  "tags": [
    {
      "key": "department",
      "value": "sales",
      "dimension_display_name": "Department",
      "value_display_name": "Sales Department"
    }
  ],
  "memo": "<string>",
  "metadata": {
    "custom_field": "value",
    "any valid json": "below 1kb",
    "nested": {
      "meaning of life": 42,
      "array": []
    }
  },
  "reference_number": "<string>"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "external_id": "31415926535",
  "refunded_amount": 123,
  "fee": 123,
  "completed_at": "2023-11-07T05:31:56Z",
  "method": "CREDIT_CARD",
  "processor": "STRIPE",
  "payment_clearing_account": {
    "id": {
      "type": "AccountId",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    },
    "name": "Current Assets",
    "account_number": "4000",
    "stable_name": {
      "type": "StableName",
      "stable_name": "CURRENT_ASSETS"
    },
    "normality": "CREDIT",
    "account_type": {
      "value": "ASSET",
      "display_name": "Asset"
    },
    "account_subtype": {
      "value": "BANK_ACCOUNTS",
      "display_name": "Current Assets"
    }
  },
  "refunded_payment_fees": [
    {
      "account": {
        "type": "AccountId",
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      },
      "description": "<string>",
      "fee_amount": 123
    }
  ],
  "transaction_tags": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "key": "ExampleTagKey",
      "value": "ExampleTagValue",
      "dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "dimension_display_name": "<string>",
      "value_display_name": "<string>",
      "archived_at": "2023-11-07T05:31:56Z"
    }
  ],
  "memo": "<string>",
  "metadata": {
    "custom_field": "value",
    "any valid json": "below 1kb",
    "nested": {
      "meaning of life": 42,
      "array": []
    }
  },
  "reference_number": "<string>"
}

Rate Limiting

This endpoint has a custom rate limit policy. Rate Limit Details:
EnvironmentLimitRefill PeriodInitial Size
Sandbox20 requests1 second40 requests
Production20 requests1 second40 requests
Response Headers: All responses include the following rate limit headers:
  • X-RateLimit-Limit: The rate limit bucket capacity
  • X-RateLimit-Remaining: The number of tokens remaining in the bucket
  • X-RateLimit-Reset: UTC timestamp (in seconds) when the bucket will be refilled
For more details on rate limiting, see Rate Limiting.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Content-Type
string

Content-Type must be set to application/json

Path Parameters

businessId
string
required

The UUID of the business to create a refund payment for.

refundId
string
required

The UUID of the refund to create a payment for.

Body

application/json

Parameters for creating a refund payment.

refunded_amount
integer<int64>
required

Amount refunded to the customer in cents.

completed_at
string<date-time>
required

Time when the payment was completed.

method
enum<string>
required

Payment method used for the refund.

Available options:
CASH,
CHECK,
CREDIT_CARD,
ACH,
CREDIT_BALANCE,
OTHER
external_id
string | null

Unique ID of the payment in your system for linking purposes. Idempotency key.

Example:

"31415926535"

refund_processing_fee
integer<int64> | null

Fee charged to the business for processing the refund in cents.

processor
string | null

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

Example:

"STRIPE"

payment_clearing_account_identifier
Account ID · object

The the ledger account to use for the payment (overrides the default determined by the payment method)

refunded_payment_fees
object[]

List of fees associated with this payment. These are refunded from the payment processor rather than the business.

tags
object[]

Tags to associate with the payment.

memo
string | null

Memo for any text you would like to associate with the refund payment.

metadata
object

Arbitrary custom metadata in JSON format with a size limit of 1KB

Example:
{
"custom_field": "value",
"any valid json": "below 1kb",
"nested": { "meaning of life": 42, "array": [] }
}
reference_number
string | null

Any (typically user-visible) identifier you would like to associate with the refund payment. Can be used to filter when listing refund payments.

Response

Refund payment has been successfully updated or unchanged.

A payment represents a transaction that moves value from a customer to a business. A specific payment can be refunded or a general refund can be applied to an invoice.

id
string<uuid>

Unique identifier for the payment.

external_id
string

Unique ID of the payment in your system for linking purposes. Idempotency key.

Example:

"31415926535"

refunded_amount
integer<int64>

Amount refunded to the customer in cents.

fee
integer<int64> | null

Fee charged for the refund in cents.

completed_at
string<date-time>

Time when the payment was completed.

method
string

Method of the payment.

Example:

"CREDIT_CARD"

processor
string | null

Processor used for the payment.

Example:

"STRIPE"

payment_clearing_account
object

The the ledger account to use for the payment (overrides the default determined by the payment method), if specified.

refunded_payment_fees
object[]

Refunded payment fees associated with the refund payment

transaction_tags
object[]
memo
string | null

Memo for any text you would like to associate with the refund payment (for example, to display to end users).

metadata
object

Arbitrary custom metadata in JSON format with a size limit of 1KB

Example:
{
"custom_field": "value",
"any valid json": "below 1kb",
"nested": { "meaning of life": 42, "array": [] }
}
reference_number
string | null

Any (typically user-visible) identifier you would like to associate with the refund payment. Can be used to filter when listing refund payments.