POST
/
v1
/
businesses
/
{businessId}
/
bills
/
refunds
Create vendor refund
curl --request POST \
  --url https://sandbox.layerfi.com/v1/businesses/{businessId}/bills/refunds \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "external_id": "<string>",
  "completed_at": "2023-11-07T05:31:56Z",
  "bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "bill_external_id": "<string>",
  "bill_line_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "bill_line_item_external_id": "<string>",
  "bill_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "bill_payment_external_id": "<string>",
  "refund_processing_fee": 0,
  "method": "CASH",
  "processor": "STRIPE",
  "tags": [
    {
      "key": "Location",
      "value": "MainStreet"
    }
  ],
  "memo": "<string>",
  "metadata": {
    "custom_field": "value",
    "any valid json": "below 10kb",
    "nested": {
      "meaning of life": 42,
      "array": []
    }
  },
  "reference_number": "<string>"
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "external_id": "vendor-refund-123",
  "refunded_amount": 123,
  "status": "PAID",
  "completed_at": "2023-11-07T05:31:56Z",
  "allocations": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "bill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "amount": 123,
      "line_items": [
        {
          "external_id": "<string>",
          "amount": 123,
          "ledger_account": {
            "id": {
              "type": "AccountId",
              "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
            },
            "name": "Current Assets",
            "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"
            }
          },
          "prepayment_account": {
            "id": {
              "type": "AccountId",
              "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
            },
            "name": "Current Assets",
            "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"
            }
          },
          "transaction_tags": [
            {
              "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "key": "ExampleTagKey",
              "value": "ExampleTagValue",
              "display_name": "<string>",
              "dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "archived_at": "2023-11-07T05:31:56Z"
            }
          ],
          "memo": "<string>",
          "metadata": {
            "custom_field": "value",
            "any valid json": "below 10kb",
            "nested": {
              "meaning of life": 42,
              "array": []
            }
          },
          "reference_number": "<string>"
        }
      ],
      "bill_external_id": "<string>",
      "bill_line_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "bill_line_item_external_id": "<string>",
      "bill_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "bill_payment_external_id": "<string>",
      "vendor": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "external_id": "<string>",
        "individual_name": "<string>",
        "company_name": "<string>",
        "email": "<string>",
        "mobile_phone": "<string>",
        "office_phone": "<string>",
        "address_string": "<string>",
        "memo": "<string>",
        "status": "ACTIVE",
        "transaction_tags": [
          {
            "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "key": "ExampleTagKey",
            "value": "ExampleTagValue",
            "display_name": "<string>",
            "dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "archived_at": "2023-11-07T05:31:56Z"
          }
        ]
      },
      "transaction_tags": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "key": "ExampleTagKey",
          "value": "ExampleTagValue",
          "display_name": "<string>",
          "dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "archived_at": "2023-11-07T05:31:56Z"
        }
      ],
      "memo": "<string>",
      "metadata": {
        "custom_field": "value",
        "any valid json": "below 10kb",
        "nested": {
          "meaning of life": 42,
          "array": []
        }
      },
      "reference_number": "<string>"
    }
  ],
  "payments": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "external_id": "payment-456",
      "refunded_amount": 123,
      "refund_processing_fee": 123,
      "completed_at": "2023-11-07T05:31:56Z",
      "method": "ACH",
      "processor": "STRIPE",
      "payment_clearing_account": {
        "id": {
          "type": "AccountId",
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        },
        "name": "Current Assets",
        "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"
        }
      },
      "transaction_tags": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "key": "ExampleTagKey",
          "value": "ExampleTagValue",
          "display_name": "<string>",
          "dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "archived_at": "2023-11-07T05:31:56Z"
        }
      ],
      "memo": "<string>",
      "metadata": {
        "custom_field": "value",
        "any valid json": "below 10kb",
        "nested": {
          "meaning of life": 42,
          "array": []
        }
      },
      "reference_number": "<string>"
    }
  ],
  "transaction_tags": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "key": "ExampleTagKey",
      "value": "ExampleTagValue",
      "display_name": "<string>",
      "dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "archived_at": "2023-11-07T05:31:56Z"
    }
  ],
  "memo": "<string>",
  "metadata": {
    "custom_field": "value",
    "any valid json": "below 10kb",
    "nested": {
      "meaning of life": 42,
      "array": []
    }
  },
  "reference_number": "<string>"
}

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<uuid>
required

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

Body

application/json

Simple vendor refund creation parameters. The system will automatically calculate the refund amount based on the specified target (bill, line item, or payment). At least one target identifier must be provided.

completed_at
string<date-time>
required

The time the vendor refund was completed.

method
enum<string>
required

The payment method used for the refund.

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

An external identifier for the vendor refund transaction.

bill_id
string<uuid> | null

The ID of the bill to refund.

bill_external_id
string | null

The external ID of the bill to refund.

bill_line_item_id
string<uuid> | null

The ID of the bill line item to refund.

bill_line_item_external_id
string | null

The external ID of the bill line item to refund.

bill_payment_id
string<uuid> | null

The ID of the bill payment to refund.

bill_payment_external_id
string | null

The external ID of the bill payment to refund.

refund_processing_fee
integer
default:0

The fee charged to the business for processing the refund in cents.

processor
string | null

The payment processor used to process the refund.

Example:

"STRIPE"

tags
object[]

Tags to associate with the vendor refund.

memo
string | null

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

metadata
object

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

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

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

Response

Vendor refund has been successfully updated or unchanged.

A vendor refund represents a transaction where a vendor returns value to a business. A specific bill can be refunded or a general refund can be applied to a vendor.

id
string<uuid>

Unique identifier for the vendor refund.

external_id
string | null

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

Example:

"vendor-refund-123"

refunded_amount
integer

Amount refunded to the business in cents.

status
string

Status of the vendor refund.

Example:

"PAID"

completed_at
string<date-time>

Time when the vendor refund was completed.

allocations
object[]

Allocations associated with this vendor refund.

payments
object[]

Payments associated with this vendor refund.

transaction_tags
object[]
memo
string | null

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

metadata
object

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

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

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