> ## Documentation Index
> Fetch the complete documentation index at: https://docs.layerfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Refund object

A Refund represents a transaction that returns value from a business to a customer. Each refund has one or more Refund Allocations (targets) and zero or more Refund Payments.

## Creating Refunds

There are two ways to create refunds:

### Simple Refunds

Use simple refunds when you want to fully refund a single target (invoice, invoice line item, or invoice payment) and the refund is fully paid. Layer automatically:

* Calculates the refund amount based on what can be refunded from the target
* Creates one allocation that perfectly cancels out the target
* Creates one refund payment that pays the refund in full

### Itemized Refunds

Use itemized refunds for more complex scenarios including:

* Refunding multiple targets in a single refund
* Partial refunds that don't fully cancel out the target
* Unpaid refunds (refunds owed but not yet disbursed)
* Custom allocation amounts or payment structures

With itemized refunds, you specify all allocations and payments explicitly.

## Refund Object

### Attributes

<ParamField body="id" type="string" required="true">
  Unique identifier for the refund.
</ParamField>

<ParamField body="external_id" type="string">
  Unique ID of the refund in your system for linking purposes. **Idempotency key**.
</ParamField>

<ParamField body="refunded_amount" type="integer" required="true">
  Amount refunded to the customer in cents.
</ParamField>

<ParamField body="status" type="string" required="true">
  Status of the refund.
</ParamField>

<ParamField body="completed_at" type="ISO8601 timestamp" required="true">
  Time when the refund was completed.
</ParamField>

<ParamField body="is_dedicated" type="boolean" required="true">
  Whether this refund is dedicated or not. Dedicated refunds can only have one allocation and one payment, and their allocation target cannot be changed.
</ParamField>

<ParamField body="allocations" type="array of RefundAllocation objects">
  Allocations associated with this refund. See [Refund Allocation Object](#refund-allocation-object) for details.
</ParamField>

<ParamField body="payments" type="array of RefundPayment objects">
  Payments associated with this refund. See [Refund Payment Object](#refund-payment-object) for details.
</ParamField>

<ParamField body="payouts" type="array of Payout objects">
  Payouts associated with this refund.
</ParamField>

<ParamField body="transaction_tags" type="Array of Tags">
  Tags associated with the refund.

  <Expandable title="Tag properties">
    <ResponseField name="key" required="true" type="string">
      The tag's key
    </ResponseField>

    <ResponseField name="value" required="true" type="string">
      The tag's value
    </ResponseField>

    <ResponseField name="created_at" required="true" type="ISO8601 timestamp">
      When the tag was created
    </ResponseField>

    <ResponseField name="updated_at" required="true" type="ISO8601 timestamp">
      When the tag was last updated
    </ResponseField>

    <ResponseField name="deleted_at" type="ISO8601 timestamp">
      When the tag was deleted
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="memo" type="string">
  Memo for any text you would like to associate with the refund.
</ParamField>

<ParamField body="metadata" type="json object">
  Arbitrary metadata you can include with the refund.
</ParamField>

<ParamField body="reference_number" type="string">
  Any (typically user-visible) identifier you would like to associate with the refund. Can be used to filter when listing refunds.
</ParamField>

## Refund Allocation Object

A Refund Allocation represents one of the targets of a refund. It can reference a specific invoice, invoice line item, invoice payment, or customer.
For example, a refund can apply to two separate invoices if the invoices have the same customer.
The total of the amounts of the refund allocations must add up to the refund amount.

<ParamField body="id" type="string" required="true">
  Unique identifier for the refund allocation.
</ParamField>

<ParamField body="invoice_id" type="string">
  ID of the invoice this allocation is associated with.
</ParamField>

<ParamField body="amount" type="integer" required="true">
  Amount of the allocation in cents.
</ParamField>

<ParamField body="line_items" type="array of RefundAllocationLineItem objects">
  Line items that make up this allocation. See [Refund Allocation Line Item Object](#refund-allocation-line-item-object) for details.
</ParamField>

<ParamField body="invoice_external_id" type="string">
  External ID of the invoice this allocation is associated with.
</ParamField>

<ParamField body="invoice_line_item_id" type="string">
  ID of the invoice line item this allocation is associated with. If specified, must not refer to a different invoice than `invoice_id` or `invoice_external_id`.
</ParamField>

<ParamField body="invoice_line_item_external_id" type="string">
  The external ID of the invoice line item to refund. If specified alongside `invoice_line_item_id`, they must refer to the same invoice line item.
</ParamField>

<ParamField body="invoice_payment_id" type="string">
  ID of the invoice payment this allocation is associated with.
</ParamField>

<ParamField body="invoice_payment_external_id" type="string">
  External ID of the invoice payment this allocation is associated with.
</ParamField>

<ParamField body="customer" type="Customer object">
  The [Customer](/api-reference/customer/customer) associated with this refund allocation.
</ParamField>

<ParamField body="transaction_tags" type="Array of Tags">
  Tags associated with the refund allocation.

  <Expandable title="Tag properties">
    <ResponseField name="key" required="true" type="string">
      The tag's key
    </ResponseField>

    <ResponseField name="value" required="true" type="string">
      The tag's value
    </ResponseField>

    <ResponseField name="created_at" required="true" type="ISO8601 timestamp">
      When the tag was created
    </ResponseField>

    <ResponseField name="updated_at" required="true" type="ISO8601 timestamp">
      When the tag was last updated
    </ResponseField>

    <ResponseField name="deleted_at" type="ISO8601 timestamp">
      When the tag was deleted
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="memo" type="string">
  Memo for any text you would like to associate with the refund allocation.
</ParamField>

<ParamField body="metadata" type="json object">
  Arbitrary metadata you can include with the refund allocation.
</ParamField>

<ParamField body="reference_number" type="string">
  Any (typically user-visible) identifier you would like to associate with the refund allocation.
</ParamField>

## Refund Allocation Line Item Object

A Refund Allocation Line Item represents a specific line within a refund allocation, allowing for detailed breakdowns of how the allocation amount is distributed across different ledger accounts.

<ParamField body="external_id" type="string">
  External identifier for the line item.
</ParamField>

<ParamField body="amount" type="integer" required="true">
  Amount of the line item in cents.
</ParamField>

<ParamField body="ledger_account" type="ChartAccount object">
  The ledger account associated with this line item.
</ParamField>

<ParamField body="prepayment_account" type="ChartAccount object">
  The prepayment ledger account associated with this line item, if applicable.
</ParamField>

<ParamField body="transaction_tags" type="Array of Tags">
  Tags associated with the line item.

  <Expandable title="Tag properties">
    <ResponseField name="key" required="true" type="string">
      The tag's key
    </ResponseField>

    <ResponseField name="value" required="true" type="string">
      The tag's value
    </ResponseField>

    <ResponseField name="created_at" required="true" type="ISO8601 timestamp">
      When the tag was created
    </ResponseField>

    <ResponseField name="updated_at" required="true" type="ISO8601 timestamp">
      When the tag was last updated
    </ResponseField>

    <ResponseField name="deleted_at" type="ISO8601 timestamp">
      When the tag was deleted
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="memo" type="string">
  Memo for any text you would like to associate with the line item.
</ParamField>

<ParamField body="metadata" type="json object">
  Arbitrary metadata you can include with the line item.
</ParamField>

<ParamField body="reference_number" type="string">
  Any (typically user-visible) identifier you would like to associate with the refund pyment. Can be used to filter when listing refund payments.
</ParamField>

## Refund Payment Object

A Refund Payment represents a money movement by which the refund was disbursed to the customer.
A refund with zero payments represents a refund that is owed to a customer but has not yet been sent.

A refund can have many payments so long as the total of their `refunded_amount`s does not exceed the total amount of the refund.

Refund payments are matchable to bank transactions and are therefore the means by which refunds are reconciled with bank accounts.

<ParamField body="id" type="string" required="true">
  Unique identifier for the payment.
</ParamField>

<ParamField body="external_id" type="string">
  Unique ID of the payment in your system for linking purposes. **Idempotency key**.
</ParamField>

<ParamField body="refunded_amount" type="integer" required="true">
  Amount refunded to the customer in cents.
</ParamField>

<ParamField body="refund_processing_fee" type="integer">
  Fee paid by the business to make the refund payment (typically a payment processing fee).
</ParamField>

<ParamField body="completed_at" type="ISO8601 timestamp" required="true">
  Time when the payment was completed.
</ParamField>

<ParamField body="method" type="string" required="true">
  Method of the payment (e.g., `CREDIT_CARD`, `ACH`, etc.).
</ParamField>

<ParamField body="processor" type="string">
  Processor used for the payment (e.g., `STRIPE`, `SHOPIFY`, etc.).
</ParamField>

<ParamField body="refunded_payment_fees" type="array of RefundedPaymentFee objects">
  Refunded payment fees associated with the refund payment. See [Refunded Payment Fee Object](#refunded-payment-fee-object) for details.
</ParamField>

<ParamField body="transaction_tags" type="Array of Tags">
  Tags associated with the refund payment.

  <Expandable title="Tag properties">
    <ResponseField name="key" required="true" type="string">
      The tag's key
    </ResponseField>

    <ResponseField name="value" required="true" type="string">
      The tag's value
    </ResponseField>

    <ResponseField name="created_at" required="true" type="ISO8601 timestamp">
      When the tag was created
    </ResponseField>

    <ResponseField name="updated_at" required="true" type="ISO8601 timestamp">
      When the tag was last updated
    </ResponseField>

    <ResponseField name="deleted_at" type="ISO8601 timestamp">
      When the tag was deleted
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="memo" type="string">
  Memo for any text you would like to associate with the refund payment.
</ParamField>

<ParamField body="metadata" type="json object">
  Arbitrary metadata you can include with the refund payment.
</ParamField>

## Refunded Payment Fee Object

A Refunded Payment Fee represents a fee that was refunded as part of a refund payment.
This differs from the 'refund\_processing\_fee' field on the refund payment, since that is paid by the business (typically to a payment processor), whereas this is refunded from the payment processor back to the business.

<ParamField body="account" type="AccountIdentifier object" required="true">
  Identifier of the ledger account for the refunded payment fee.
</ParamField>

<ParamField body="description" type="string">
  Description of the fee that the refunded payment fee refunds.
</ParamField>

<ParamField body="fee_amount" type="integer" required="true">
  Amount of the fee refund in cents.
</ParamField>

## Simple Refund Creation Parameters

Use these parameters to create a simple refund that fully refunds a single target (invoice, invoice line item, or invoice payment) and is fully paid.

<ParamField body="external_id" type="string">
  Unique ID of the refund in your system for linking purposes. **Idempotency key**.
</ParamField>

<ParamField body="completed_at" type="ISO8601 timestamp" required="true">
  When the refund was completed and paid.
</ParamField>

<ParamField body="invoice_id" type="string">
  The ID of the invoice to refund. Cannot be used with other target identifiers.
</ParamField>

<ParamField body="invoice_external_id" type="string">
  The external ID of the invoice to refund. Cannot be used with other target identifiers.
</ParamField>

<ParamField body="invoice_line_item_id" type="string">
  The ID of the invoice line item to refund. Cannot be used with other target identifiers.
</ParamField>

<ParamField body="invoice_line_item_external_id" type="string">
  The external ID of the invoice line item to refund. Cannot be used with other target identifiers.
</ParamField>

<ParamField body="invoice_payment_id" type="string">
  The ID of the invoice payment to refund. Cannot be used with other target identifiers.
</ParamField>

<ParamField body="invoice_payment_external_id" type="string">
  The external ID of the invoice payment to refund. Cannot be used with other target identifiers.
</ParamField>

<ParamField body="refund_processing_fee" type="integer">
  Fee charged to the business for processing the refund in cents. Defaults to 0.
</ParamField>

<ParamField body="method" type="PaymentMethod enum" required="true">
  Method of the payment (e.g., `CREDIT_CARD`, `ACH`, etc.).
</ParamField>

<ParamField body="processor" type="string">
  Processor used for the payment (e.g., `STRIPE`, `SHOPIFY`, etc.).
</ParamField>

<ParamField body="tags" type="array of TagKeyValue objects">
  Tags to apply to the refund. Tags are key-value pairs that can be used to categorize and filter refunds.

  <Expandable title="TagKeyValue properties">
    <ParamField body="key" required="true" type="string">
      The tag dimension key (e.g., "department", "project", "location")
    </ParamField>

    <ParamField body="dimension_display_name" type="string">
      Optional display name for the tag dimension. If the dimension doesn't exist, this will be used as its display name.
    </ParamField>

    <ParamField body="value" required="true" type="string">
      The tag value (e.g., "engineering", "project-alpha", "san-francisco")
    </ParamField>

    <ParamField body="value_display_name" type="string">
      Optional display name for the tag value. If the value doesn't exist, this will be used as its display name.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="memo" type="string">
  Memo for any text you would like to associate with the refund.
</ParamField>

<ParamField body="metadata" type="json object">
  Arbitrary metadata you can include with the refund.
</ParamField>

## Itemized Refund Creation Parameters

Use these parameters to create an itemized refund with full control over allocations and payments.

<ParamField body="external_id" type="string">
  Unique ID of the refund in your system for linking purposes. **Idempotency key**.
</ParamField>

<ParamField body="refunded_amount" type="integer" required="true">
  The total amount of the refund in cents. Must equal the sum of all allocation amounts.
</ParamField>

<ParamField body="completed_at" type="ISO8601 timestamp" required="true">
  When the refund was completed.
</ParamField>

<ParamField body="allocations" type="array of RefundAllocationParams objects" required="true">
  The targets of the refund. Each allocation specifies how much of the refund should be applied to a specific invoice, line item, payment, or customer.

  <Expandable title="RefundAllocationParams properties">
    <ResponseField name="external_id" type="string">
      External identifier for the allocation.
    </ResponseField>

    <ResponseField name="total_amount" required="true" type="integer">
      Total amount of this allocation in cents. Must equal the sum of all line item amounts.
    </ResponseField>

    <ResponseField name="line_items" required="true" type="array of LineItemParams objects">
      Line items that make up this allocation.
    </ResponseField>

    <ResponseField name="invoice_id" type="string">
      ID of the invoice this allocation targets.
    </ResponseField>

    <ResponseField name="invoice_external_id" type="string">
      External ID of the invoice this allocation targets.
    </ResponseField>

    <ResponseField name="invoice_line_item_id" type="string">
      ID of the invoice line item this allocation targets.
    </ResponseField>

    <ResponseField name="invoice_line_item_external_id" type="string">
      External ID of the invoice line item this allocation targets.
    </ResponseField>

    <ResponseField name="invoice_payment_id" type="string">
      ID of the invoice payment this allocation targets.
    </ResponseField>

    <ResponseField name="invoice_payment_external_id" type="string">
      External ID of the invoice payment this allocation targets.
    </ResponseField>

    <ResponseField name="customer_id" type="string">
      ID of the customer this allocation targets.
    </ResponseField>

    <ResponseField name="customer_external_id" type="string">
      External ID of the customer this allocation targets.
    </ResponseField>

    <ResponseField name="tags" type="array of TagKeyValue objects">
      Tags for this allocation.
    </ResponseField>

    <ResponseField name="memo" type="string">
      Memo for this allocation.
    </ResponseField>

    <ResponseField name="metadata" type="json object">
      Metadata for this allocation.
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="payments" type="array of RefundPaymentParams objects" required="true">
  The payment methods and amounts used to process the refund.

  <Expandable title="RefundPaymentParams properties">
    <ResponseField name="external_id" type="string">
      External identifier for the payment.
    </ResponseField>

    <ResponseField name="refunded_amount" required="true" type="integer">
      Amount refunded to the customer in cents.
    </ResponseField>

    <ResponseField name="refund_processing_fee" type="integer">
      Fee charged to the business for processing this payment.
    </ResponseField>

    <ResponseField name="completed_at" required="true" type="ISO8601 timestamp">
      When this payment was completed.
    </ResponseField>

    <ResponseField name="method" required="true" type="PaymentMethod enum">
      Payment method used.
    </ResponseField>

    <ResponseField name="processor" type="string">
      Processor used for this payment.
    </ResponseField>

    <ResponseField name="refunded_payment_fees" type="array of RefundedPaymentFeeInput objects">
      Fees refunded as part of this payment.
    </ResponseField>

    <ResponseField name="tags" type="array of TagKeyValue objects">
      Tags for this payment.
    </ResponseField>

    <ResponseField name="memo" type="string">
      Memo for this payment.
    </ResponseField>

    <ResponseField name="metadata" type="json object">
      Metadata for this payment.
    </ResponseField>

    <ParamField body="reference_number" type="string">
      Any (typically user-visible) identifier for this payment.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="tags" type="array of TagKeyValue objects">
  Tags to apply to the refund. Tags are key-value pairs that can be used to categorize and filter refunds.

  <Expandable title="TagKeyValue properties">
    <ParamField body="key" required="true" type="string">
      The tag dimension key (e.g., "department", "project", "location")
    </ParamField>

    <ParamField body="dimension_display_name" type="string">
      Optional display name for the tag dimension. If the dimension doesn't exist, this will be used as its display name.
    </ParamField>

    <ParamField body="value" required="true" type="string">
      The tag value (e.g., "engineering", "project-alpha", "san-francisco")
    </ParamField>

    <ParamField body="value_display_name" type="string">
      Optional display name for the tag value. If the value doesn't exist, this will be used as its display name.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="memo" type="string">
  Memo for any text you would like to associate with the refund.
</ParamField>

<ParamField body="metadata" type="json object">
  Arbitrary metadata you can include with the refund.
</ParamField>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "external_id": "31415926535",
    "refunded_amount": 123,
    "status": "PAID",
    "completed_at": "2023-11-07T05:31:56Z",
    "is_dedicated": false,
    "allocations": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "amount": 123,
        "line_items": [
          {
            "external_id": "line-item-1",
            "amount": 123,
            "ledger_account": {
              "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "name": "Revenue",
              "account_number": "4000"
            },
            "prepayment_account": null,
            "transaction_tags": [
              {
                "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                "key": "department",
                "value": "sales",
                "dimension_display_name": "Department",
                "value_display_name": "Sales Team",
                "dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
                "definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
                "created_at": "2024-02-27T02:16:40.389772Z",
                "updated_at": "2024-02-27T02:16:40.389772Z",
                "deleted_at": null,
                "archived_at": null
              }
            ],
            "memo": null,
            "metadata": null
          }
        ],
        "invoice_external_id": "invoice-123",
        "invoice_line_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "invoice_line_item_external_id": "line-item-123",
        "invoice_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "invoice_payment_external_id": "payment-123",
        "customer": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "external_id": "31415926535",
          "individual_name": "John Doe",
          "company_name": "Acme Corp",
          "email": "john@example.com",
          "mobile_phone": "555-123-4567",
          "office_phone": "555-987-6543",
          "address_string": "123 Main St, Anytown, CA 90210",
          "notes": "VIP customer",
          "status": "ACTIVE",
          "transaction_tags": [
            {
              "key": "CustomerType",
              "value": "Premium",
              "created_at": "2023-11-07T05:31:56Z",
              "updated_at": "2023-11-07T05:31:56Z",
              "deleted_at": null
            }
          ]
        },
        "transaction_tags": [
          {
            "key": "RefundReason",
            "value": "CustomerRequest",
            "created_at": "2023-11-07T05:31:56Z",
            "updated_at": "2023-11-07T05:31:56Z",
            "deleted_at": null
          }
        ],
        "memo": null,
        "metadata": null
      }
    ],
    "payments": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "external_id": "31415926535",
        "refunded_amount": 123,
        "refund_processing_fee": 15,
        "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": "Processing fee refund",
            "fee_amount": 10
          }
        ],
        "transaction_tags": [
          {
            "key": "ProcessorReference",
            "value": "ref_12345",
            "created_at": "2023-11-07T05:31:56Z",
            "updated_at": "2023-11-07T05:31:56Z",
            "deleted_at": null
          }
        ],
        "memo": null,
        "metadata": null
      }
    ],
    "payouts": [],
    "transaction_tags": [
      {
        "key": "Department",
        "value": "CustomerService",
        "created_at": "2023-11-07T05:31:56Z",
        "updated_at": "2023-11-07T05:31:56Z",
        "deleted_at": null
      }
    ],
    "memo": null,
    "metadata": null
  }
  ```
</ResponseExample>

## Dedicated Refunds

Dedicated refunds are a refunds that are created alongside invoices, invoice line items, and invoice payments. They provide a streamlined way to create refunds during the invoice creation or payment recording process.

They are intended for when you know at the time of importing an invoice, invoice line item, or payment that it will be refunded, and want to create everything in one API call.

Each dedicated refund has exactly one allocation and one payment. Once created, the allocation target cannot be changed

Dedicated refunds can be included when creating:

**Invoices**: Add `dedicated_refunds` array to the invoice body

**Invoice Line Items**: Add `dedicated_refunds` array to any line item

**Invoice Payments**: Add `dedicated_refunds` array to any payment within an invoice

### Simple vs Itemized Dedicated Refunds

When creating dedicated refunds, Layer will automatically determine whether to create them as simple or itemized refunds based on the parameters you provide:

**Simple Dedicated Refunds** (see [Simple Refunds](#simple-refund-creation-parameters)):

* Created when you don't specify the `line_items` parameter
* Layer automatically calculates the refund amount and creates a single allocation
* Ideal for straightforward refunds where you want to refund the full amount of a target

**Itemized Dedicated Refunds** (see [Itemized Refunds](#itemized-refund-creation-parameters)):

* Created when you provide the `line_items` parameter with detailed allocation breakdowns
* You have full control over how the refund amount is distributed across different ledger accounts
* Required for complex refunds involving multiple accounts or partial amounts

### Create Dedicated Refund Parameters Object

<ParamField body="external_id" type="string">
  External ID for the refund within your platform. **Idempotency key.**
</ParamField>

<ParamField body="account_identifier" type="AccountIdentifier object">
  The [Account Identifier](/api-reference/ledger/account-identifier) for the refund allocation. If not specified, will use the appropriate account based on the target.
</ParamField>

<ParamField body="line_items" type="array of CreateCustomerRefundAllocationLineItemParams objects">
  Detailed line items for the refund allocation. Use this for itemized refunds where you need to specify the exact amounts and accounts.

  <Expandable title="CreateCustomerRefundAllocationLineItemParams properties">
    <ResponseField name="amount" required="true" type="integer">
      Amount for this line item in cents.
    </ResponseField>

    <ResponseField name="account_identifier" type="AccountIdentifier object">
      The [Account Identifier](/api-reference/ledger/account-identifier) for this line item.
    </ResponseField>

    <ResponseField name="tags" type="array of TagKeyValue objects">
      Tags for this line item.
    </ResponseField>

    <ResponseField name="memo" type="string">
      Memo for this line item.
    </ResponseField>

    <ResponseField name="metadata" type="json object">
      Metadata for this line item.
    </ResponseField>

    <ResponseField name="reference_number" type="string">
      Reference number for this line item.
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="completed_at" type="ISO8601 timestamp" required="true">
  When the refund was completed.
</ParamField>

<ParamField body="refund_processing_fee" type="integer">
  Processing fee for the refund, in cents. Defaults to 0.
</ParamField>

<ParamField body="method" type="PaymentMethod enum" required="true">
  Method used to make the refund.
  Values can be: `CASH`, `CHECK`, `CREDIT_CARD`, `ACH`, `CREDIT_BALANCE`, `OTHER`
</ParamField>

<ParamField body="processor" type="string">
  Processor used to make the refund, if any.
</ParamField>

<ParamField body="refunded_payment_fees" type="array of RefundedInvoicePaymentFeeInput objects">
  List of payment fees that were refunded as part of this refund.

  <Expandable title="RefundedInvoicePaymentFeeInput properties">
    <ResponseField name="account" required="true" type="AccountIdentifier object">
      The [Account Identifier](/api-reference/ledger/account-identifier) for the refunded fee.
    </ResponseField>

    <ResponseField name="description" type="string">
      Description of the fee being refunded.
    </ResponseField>

    <ResponseField name="amount" required="true" type="integer">
      Amount of the fee refund in cents.
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="tags" type="array of TagKeyValue objects">
  Tags to apply to the refund. Tags are key-value pairs that can be used to categorize and filter refunds.

  <Expandable title="TagKeyValue properties">
    <ParamField body="key" required="true" type="string">
      The tag dimension key (e.g., "department", "project", "location")
    </ParamField>

    <ParamField body="dimension_display_name" type="string">
      Optional display name for the tag dimension. If the dimension doesn't exist, this will be used as its display name.
    </ParamField>

    <ParamField body="value" required="true" type="string">
      The tag value (e.g., "engineering", "project-alpha", "san-francisco")
    </ParamField>

    <ParamField body="value_display_name" type="string">
      Optional display name for the tag value. If the value doesn't exist, this will be used as its display name.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="memo" type="string">
  Any text you would like to associate with the refund.
</ParamField>

<ParamField body="metadata" type="json object">
  Arbitrary metadata you can include with the refund.
</ParamField>

<ParamField body="reference_number" type="string">
  Any (typically user-visible) identifier you would like to associate with the refund.
</ParamField>

### Example: Invoice with Dedicated Refunds

```json theme={null}
{
  "external_id": "invoice-123",
  "sent_at": "2024-04-02T09:02:00Z",
  "customer_external_id": "customer-456",
  "line_items": [
    {
      "product": "Widget Pro",
      "unit_price": 2500,
      "quantity": 4,
      "dedicated_refunds": [
        {
          "external_id": "refund-widget-1",
          "line_items": [
            {
              "amount": 1000,
              "account_identifier": {
                "type": "StableName",
                "stable_name": "CUSTOMER_REFUNDS"
              }
            }
          ],
          "completed_at": "2024-04-03T10:00:00Z",
          "method": "CREDIT_CARD",
          "processor": "RAINFOREST",
          "memo": "Partial (itemized) refund for damaged item"
        }
      ]
    }
  ],
  "payments": [
    {
      "external_id": "payment-123",
      "method": "CREDIT_CARD",
      "amount": 5000,
      "dedicated_refunds": [
        {
          "external_id": "refund-processing-fee",
          "completed_at": "2024-04-03T10:00:00Z",
          "method": "CREDIT_CARD",
          "processor": "RAINFOREST",
          "memo": "Full (simple) payment refund"
        }
      ]
    },
    {
      "external_id": "payment-xyz",
      "method": "CREDIT_CARD",
      "amount": 7000
    }
  ],
  "dedicated_refunds": [
    {
      "external_id": "refund-invoice-discount",
      "line_items": [
        {
          "amount": 250,
          "account_identifier": {
            "type": "StableName",
            "stable_name": "CUSTOMER_REFUNDS"
          }
        }
      ],
      "completed_at": "2024-04-03T10:00:00Z",
      "method": "CREDIT_CARD",
      "processor": "RAINFOREST",
      "memo": "Partial (itemized) refund for whole invoice"
    }
  ]
}
```
