# Refunds scenario

Source: https://developer.avalara.com/avatax-dm-combined-erp/sales-tax-badge/transactions/test-refunds/

# Refunds scenario

If your platform does not support "voiding" or does support Refunds/Credit Memos, this test ensures that the transactions are handled properly. This scenario assumes the following:

-   The`shipFrom` address is anywhere in the US.
-   The`shipTo` address is in Washington DC, so be sure that your company is configured to collect tax in Washington DC.
-   The document`type` is`returnInvoice`.
-   Refund the invoice with a document`date` in the past.
-   Set negative values for line items for returns:
    -   Line 1`amount` is -$100, and the`taxCode` is`P0000000`.
    -   Line 2`amount` is -$75, and the`taxCode` is`P0000000`.
    -   Line 3`amount` is -$50, and the`taxCode` is`FR020100`.
-   Set the transaction`date` to the current date; set the tax override`taxDate` to the original invoice date.

## Expected result

Verify that a returns invoice with negative values was created.

![](https://www.avalara.com/content/dam/assets/ui/screenshots/test-refund.png)

## Example

Click on the request and response below to view a working example using cURL.

Request

```
curl    -X POST    -H 'Accept: application/json'    -H 'Authorization: Basic aHR0cHdhdQNoOmY='    -H 'Content-Type: application/json'    --data '{        "lines": [           {             "number":"1",             "quantity":1,             "amount":-100,             "taxCode":"P0000000",             "itemCode":"Test SKU",             "description":"Test Item Description"           },           {             "number":"2",             "quantity":1,             "amount":-75,             "taxCode":"P0000000",             "itemCode":"Test SKU",             "description":"Test Item Description"           },           {             "number":"3",             "quantity":1,             "amount":-50,             "taxCode":"FR020100",             "itemCode":"Freight SKU",             "description":"Common Carrier"           }         ],         "taxOverride":{           "type": "TaxDate",           "taxDate":"2020-10-29",           "reason": "Return"         },         "addresses": {           "shipFrom":{             "line1":"100 Ravine Ln NE",             "city":"Bainbridge Island",             "region":"WA",             "country":"US",             "postalCode":"98110-2687"           },           "shipTo":{             "line1":"915 F St Nw",             "city":"Washington, DC",             "region":"Washington, DC",             "country":"US",             "postalCode":"20004-1493"           }         },          "code":"Refunds scenario",         "type":"ReturnInvoice",         "companyCode":"DICEYREILLYS",         "date":"2021-03-08",         "customerCode":"Test Customer ID",         "commit":true,         "currencyCode":"USD"    }'    'https://sandbox-rest.avatax.com/api/v2/transactions/create'
```

Response

```
{  "id": 1001005390918,  "code": "Refunds scenario",  "companyId": 365522,  "date": "2021-03-08",  "status": "Committed",  "type": "ReturnInvoice",  ...  "taxOverrideType": "TaxDate",  "taxOverrideAmount": 0,  "taxOverrideReason": "Return",  "totalAmount": -225,  "totalExempt": 0,  "totalDiscount": 0,  "totalTax": -13.5,  "totalTaxable": -225,  "totalTaxCalculated": -13.5,  ...  "taxDate": "2020-10-29T00:00:00Z",  ...}
```

[Previous](/avatax-dm-combined-erp/sales-tax-badge/transactions/test-entity-use-code)

[Next](/avatax-dm-combined-erp/sales-tax-badge/calculate-tax-offline)