# postTax refactor to SettleTransaction

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

# postTax refactor to SettleTransaction

Understand the difference between the SOAP postTax method with the RESTv2 SettleTransaction method, including field differences and examples.

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

SOAP

RESTv2

`DocID`

N/A - Authorization performed at the header level

`CompanyCode`

`companyCode`

`DocType`

`documentType`

`DocCode`

`transactionCode`

`DocDate`

`verifyTransactionDate`

`TotalAmount`

`verifyTransactionAmount`

`TotalTAx`

`verifyTotalTax`

`HashCode`

N/A

`Commit`

`commit`

`NewDocCode`

`newCode`

## Examples

**SOAP**

```
POST https://development.avalara.net/Tax/TaxSvc.asmx/V2
         appTest Refactor SOAP API        {{companyCode}} SalesInvoice {{documentCode}} 2021-11-11 100 6.25 0 false 14e86844-cbc8-47fa-9a5b-eb2fc8a45a12   
```

**REST V2**

```
curl
  -X GET
  -H 'Accept: application/json'
  -H 'Authorization: Basic ${btoa(`:`)}'
  -- data {
    "verify": {
      "verifyTransactionDate": "2024-09-11T00:00:00+00:00",
      "verifyTotalAmount": 100,
      "verifyTotalTax": 6.25
    },
    "changeCode": {
      "newCode": "14e86844-cbc8-47fa-9a5b-eb2fc8a45a12"
    },
    "commit": {
      "commit": false
    }
  }
  'https://sandbox-rest.avatax.com/api/v2/companies/{companyCode}/transactions/{transactionCode}/settle'
```