# getTaxHistory refactor to GetTransactionByCode

Source: https://developer.avalara.com/soap-to-restv2-refactor-guide/feq5161108776502/

# getTaxHistory refactor to GetTransactionByCode

Learn how to refactor from getTaxHistory in SOAP to GetTransactionByCode in RESTv2, including field differences.

This example shows how to refactor from [getTaxHistory](https://developer.avalara.com/api-reference/avatax/soap/methods/getTaxHistory/) in SOAP to [GetTransactionByCode](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/GetTransactionByCode/) in RESTv2. It also includes a table showing the differences in the fields that are included in each API.

SOAP

RESTv2

`CompanyCode`

N/A. The `companyCode` is included in the request URL.

`DocType`

N/A. The document `type` can optionally be included in the request URL.

`DocCode`

N/A. The document `code` is included in the request URL.

## Examples

**SOAP**

```
POST https://development.avalara.net/Tax/TaxSvc.asmx/v2
         appTest Refactor SOAP API       {{companyCode}} SalesInvoice {{documentCode}}   
```

**REST V2**

```
curl
  -X GET
  -H 'Accept: application/json'
  -H 'Authorization: Basic ${btoa(`:`)}'
  'https://sandbox-rest.avatax.com/api/v2/companies/{companyCode}/transactions/{transactionCode}'
```