# RefundMultiDocumentTransaction

Create a refund for a MultiDocument transaction

`POST /api/v2/transactions/multidocument/{code}/type/{type}/refund`

**API:** AvaTax API
**Tag:** MultiDocument
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Content-Type:** `application/json`
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/avatax/api/methods/MultiDocument/RefundMultiDocumentTransaction/

## Description

Create a refund for a MultiDocument transaction.
            
A traditional transaction requires exactly two parties: a seller and a buyer.  MultiDocument transactions can
involve a marketplace of vendors, each of which contributes some portion of the final transaction.  Within
a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate
document.  This separation of documents allows each seller to file their taxes separately.
            
The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund
for a previously created `SalesInvoice` transaction.  You can choose to create a full or partial refund, and
specify individual line items from the original sale for refund.
            
The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that
was calculated during the original transaction, regardless of any changes to your company's configuration, rules,
nexus, or any other setting.
            
This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following
common refund scenarios:
            
* A full refund of a previous sale
* Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase
* Refunding one or more items (lines) from a previous sale
* Granting a customer a percentage refund of a previous sale
            
For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to
create a custom refund transaction.
            
You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
            
* Lines
* Details (implies lines)
* Summary (implies details)
* Addresses
* SummaryOnly (omit lines and details - reduces API response size)
* LinesOnly (omit details - reduces API response size)
            
If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.

NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
* Replace '/' with '\_-ava2f-\_'  For example: document/Code becomes document_-ava2f-_Code
* Replace '+' with '\_-ava2b-\_'  For example: document+Code becomes document_-ava2b-_Code
* Replace '?' with '\_-ava3f-\_'  For example: document?Code becomes document_-ava3f-_Code
* Replace '%' with '\_-ava25-\_'  For example: document%Code becomes document_-ava25-_Code
* Replace '#' with '\_-ava23-\_'  For example: document#Code becomes document_-ava23-_Code
* Replace ' ' with '%20'  For example: document Code becomes document%20Code

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, ReturnsOnlyAccountAdmin, ReturnsOnlyCompanyAdmin, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
* This API depends on the following active services:*Required* (all):  AvaTaxPro.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `code` | string | path | Yes | The code of this MultiDocument transaction |
| `type` | string | path | Yes | The type of this MultiDocument transaction |
| `$include` | string | query | No | Specifies objects to include in the response after transaction is created |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Request Body

**Schema:** `RefundTransactionModel`

Refund a committed transaction

| Property | Type | Required | Description |
|---|---|---|---|
| `refundTransactionCode` | string | No | The transaction code for the refund.  This code will be saved to the `ReturnInvoice` transaction, and does not need to match the code of the original sale. Example: `aa3f5ee0-ed9c-4ba9-9bf7-bf2a72245a63`. |
| `refundDate` | string | **Yes** | The date of the refund.  For customers using Avalara's Managed Returns Service, this date controls the month in which the refund
transaction will be reported on a tax filing. Example: `2026-07-02T00:00:00+00:00`. |
| `refundType` | string | No | Type of this refund.
            
To submit a full refund, specify `Full`.
            
To refund only specific lines from the transaction, specify `Partial` and indicate the lines you wish to apply in the `refundLines` field.
            
To refund the tax that was paid in the previous transaction, specify `TaxOnly`.
            
To issue a percentage-based discount, specify `Percentage`. Values: `Full`, `Partial`, `TaxOnly`, `Percentage`. Example: `Full`. |
| `refundPercentage` | number | No | The percentage for refund.
            
This value only applies if you choose `refundType = Percentage` or `refundType = Partial`. |
| `refundLines` | string[] | No | If you chose a refund of type `Partial`, this indicates which lines from the original transaction are being refunded. |
| `referenceCode` | string | No | A user-defined reference field containing information about this refund. Example: `Refund for a committed transaction`. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success | `MultiDocumentModel` |
| 400 | Bad Request |  |
| 401 | Unauthorized |  |
| 404 | Not Found |  |

### 200 Response: `MultiDocumentModel`

A MultiDocument transaction represents a sale or purchase that occurred between more than two companies.
            
A traditional transaction requires exactly two parties: a seller and a buyer.  MultiDocument transactions can
involve a marketplace of vendors, each of which contributes some portion of the final transaction.  Within
a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate
document.  This separation of documents allows each seller to file their taxes separately.

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | The unique ID number of this MultiDocument object. Example: `12`. |
| `accountId` | integer | No | The unique ID number of the AvaTax customer account that created this MultiDocument object. Example: `123456`. |
| `code` | string | No | The transaction code of the MultiDocument transaction.
            
All individual transactions within this MultiDocument object will have this code as a prefix. Example: `98602f3c-dfa4-4388-990a-26e8aca1e3b0`. |
| `type` | string | No | Indicates the type of MultiDocument transaction.  Common values are:
            
* SalesOrder - An estimate that is not permanently recorded
* SalesInvoice - An invoice that can be reported on a tax return
            
For more information about document types, see [DocumentType](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/DocumentType/) Values: `SalesOrder`, `SalesInvoice`, `PurchaseOrder`, `PurchaseInvoice`, `ReturnOrder`, `ReturnInvoice`, `InventoryTransferOrder`, `InventoryTransferInvoice`, `ReverseChargeOrder`, `ReverseChargeInvoice`, `CustomsInvoice`, `CustomsOrder`, `InventoryTransferOutboundInvoice`, `InventoryTransferOutboundOrder`, `Any`. Example: `SalesOrder`. |
| `createdUserId` | integer | No | The user ID of the user who created this record. Example: `87954`. |
| `createdDate` | string | No | The date/time when this record was created. Example: `2026-07-02T00:00:00+00:00`. |
| `modifiedDate` | string | No | The date/time when this record was last modified. Example: `2026-07-02T00:00:00+00:00`. |
| `modifiedUserId` | integer | No | The user ID of the user who last modified this record. Example: `66783`. |
| `documents` | TransactionModel[] | No | A separate document will exist for each unique combination of buyer and seller in this MultiDocument transaction. |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/transactions/multidocument/{code}/type/{type}/refund" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "refundTransactionCode": "aa3f5ee0-ed9c-4ba9-9bf7-bf2a72245a63",
  "refundDate": "2026-07-02",
  "refundType": "Full",
  "referenceCode": "Refund for a committed transaction"
}'
```