# commitTax refactor to CommitTransaction

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

# commitTax refactor to CommitTransaction

Learn how to refactor from commitTax in SOAP to commitTransaction in RESTv2, including field differences and examples.

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

SOAP

RESTv2

`DocId`

N/A

`CompanyCode`

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

`DocType`

N/A. Optionally include the document `type` in the request URL.

`DocCode`

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

`NewDocCode`

N/A

N/A

`commit`

## Examples

**SOAP**

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

**REST V2**

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