# Send the original invoice date as the tax calculation date for refunds

Source: https://developer.avalara.com/avatax-dm-combined-erp/sales-tax-badge/transactions/send-original-invoice-date/

# Send the original invoice date as the tax calculation date for refunds

**Element type: Required** for Refunds

**Endpoints/models used:** [CreateTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/), [RefundTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/RefundTransaction/)

Tax rates can change. Imagine you have a customer who purchases an item on October 1, and the tax rate at that time is 10%. Then on October 15, the tax rate changes to 12.5%. On October 30, the customer returns the item purchased on October 1. You want to calculate the return credit using the tax rate calculated on the date of purchase, when the calculated tax was 10%. You do not want to refund tax at the newer rate of 12.5%. In order to do this, you must provide a method to use the original invoice date as the tax calculation date for the refund. Note that this is not the same as changing the post date for the refund. In this scenario, the date of the refund should still be October 30. 

When issuing refunds using the [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/), this can be accomplished using a`taxOverride` of`TaxDate`.

When issuing refunds using the [RefundTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/RefundTransaction/), your workflow should recognize the date of the original transaction based on the`transactionCode` in the endpoint URL and pass that as the tax calculation date for the return.

Send original invoice date using CreateTransaction

When using CreateTransaction, be sure to include the original transaction date in the tax override. In the example below, the date of the original transaction is October 29, 2020.

```
{  "lines": [    {      "number":"1",      "quantity":1,      "amount":-100,      "taxCode":"P0000000",      "itemCode":"Test SKU",      "description":"Test Item Description"    }  ],  "taxOverride":{    "type": "TaxDate",    "taxDate":"2020-10-29",    "reason": "Return"  },  "addresses": {    "singleLocation":{      "line1":"100 Ravine Ln NE",      "city":"Bainbridge Island",      "region":"WA",      "country":"US",      "postalCode":"98110-2687"    }  },   "type":"ReturnInvoice",  "code":"TestTransactions1",  "companyCode":"DEFAULT",  "date":"2020-11-12",  "customerCode":"Test Customer ID",  "commit":true,  "currencyCode":"USD"}
```

Send original invoice date using RefundTransaction

When using RefundTransction, AvaTax will retrieve the date of the original transaction based on the transaction code in the request URL. This transaction code must match the original invoice`code`. In the example below, the code for the original transaction is TestTransactions1.

```
curl    -X POST    -H 'Accept: application/json'    -H 'Authorization: Basic ${btoa(`:`)}'    -H 'Content-Type: application/json'    --data '{        "refundTransactionCode": "RefundTransactionTest",        "refundDate": "2020-10-12",        "refundType": "Full",        "referenceCode": "Refund for a committed transaction"    }'    'https://sandbox-rest.avatax.com/api/v2/companies/DEFAULT/transactions/TestTransactions1/refund'
```

[Previous](/avatax-dm-combined-erp/sales-tax-badge/transactions/create-commit-credit-memos)

[Next](/avatax-dm-combined-erp/sales-tax-badge/transactions/send-current-transaction-date)