POST
/
v1
/
businesses
/
{businessId}
/
invoices
/
refunds
curl --request POST \
  --url https://sandbox.layerfi.com/v1/businesses/{businessId}/invoices/refunds \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "external_id": "<string>",
  "refunded_amount": 123,
  "completed_at": "2023-11-07T05:31:56Z",
  "payments": [
    {
      "external_id": "31415926535",
      "refunded_amount": 123,
      "refund_processing_fee": 123,
      "completed_at": "2023-11-07T05:31:56Z",
      "method": "CASH",
      "processor": "STRIPE",
      "refunded_payment_fees": [
        {
          "account": {
            "type": "AccountId",
            "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
          },
          "description": "<string>",
          "fee_amount": 123
        }
      ],
      "tags": [
        {
          "key": "Location",
          "value": "MainStreet"
        }
      ],
      "memo": "<string>",
      "metadata": {
        "custom_field": "value",
        "any valid json": "below 10kb",
        "nested": {
          "meaning of life": 42,
          "array": []
        }
      }
    }
  ],
  "refund_processing_fee": 123,
  "method": "CASH",
  "processor": "<string>",
  "refunded_payment_fees": [
    {
      "account": {
        "type": "AccountId",
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      },
      "description": "<string>",
      "fee_amount": 123
    }
  ],
  "allocations": [
    {
      "amount": 123,
      "account_identifier": {
        "type": "AccountId",
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      },
      "invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "invoice_external_id": "<string>",
      "invoice_line_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "invoice_line_item_external_id": "<string>",
      "invoice_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "invoice_payment_external_id": "<string>",
      "customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "customer_external_id": "<string>",
      "tags": [
        {
          "key": "Location",
          "value": "MainStreet"
        }
      ],
      "memo": "<string>",
      "metadata": {
        "custom_field": "value",
        "any valid json": "below 10kb",
        "nested": {
          "meaning of life": 42,
          "array": []
        }
      }
    }
  ],
  "invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoice_external_id": "<string>",
  "invoice_line_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoice_line_item_external_id": "<string>",
  "invoice_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoice_payment_external_id": "<string>",
  "customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "customer_external_id": "<string>",
  "tags": [
    {
      "key": "Location",
      "value": "MainStreet"
    }
  ],
  "memo": "<string>",
  "metadata": {
    "custom_field": "value",
    "any valid json": "below 10kb",
    "nested": {
      "meaning of life": 42,
      "array": []
    }
  }
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "external_id": "31415926535",
  "refunded_amount": 123,
  "status": "PAID",
  "completed_at": "2023-11-07T05:31:56Z",
  "is_dedicated": true,
  "allocations": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "amount": 123,
      "account_identifier": {
        "type": "AccountId",
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      },
      "invoice_external_id": "<string>",
      "invoice_line_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "invoice_line_item_external_id": "<string>",
      "invoice_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "invoice_payment_external_id": "<string>",
      "customer": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "external_id": "31415926535",
        "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",
            "created_at": "2023-11-07T05:31:56Z",
            "updated_at": "2023-11-07T05:31:56Z",
            "deleted_at": "2023-11-07T05:31:56Z"
          }
        ]
      },
      "transaction_tags": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "key": "ExampleTagKey",
          "value": "ExampleTagValue",
          "created_at": "2023-11-07T05:31:56Z",
          "updated_at": "2023-11-07T05:31:56Z",
          "deleted_at": "2023-11-07T05:31:56Z"
        }
      ],
      "memo": "<string>",
      "metadata": {
        "custom_field": "value",
        "any valid json": "below 10kb",
        "nested": {
          "meaning of life": 42,
          "array": []
        }
      }
    }
  ],
  "payments": [
    {
      "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",
      "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",
          "created_at": "2023-11-07T05:31:56Z",
          "updated_at": "2023-11-07T05:31:56Z",
          "deleted_at": "2023-11-07T05:31:56Z"
        }
      ],
      "memo": "<string>",
      "metadata": {
        "custom_field": "value",
        "any valid json": "below 10kb",
        "nested": {
          "meaning of life": 42,
          "array": []
        }
      }
    }
  ],
  "transaction_tags": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "key": "ExampleTagKey",
      "value": "ExampleTagValue",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "deleted_at": "2023-11-07T05:31:56Z"
    }
  ],
  "memo": "<string>",
  "metadata": {
    "custom_field": "value",
    "any valid json": "below 10kb",
    "nested": {
      "meaning of life": 42,
      "array": []
    }
  }
}

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 for.

Body

application/json

Response

200
application/json

Refund has been successfully updated or unchanged.

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