# adjustTax refactor to AdjustTransaction

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

# adjustTax refactor to AdjustTransaction

Compare the adjustTax method in SOAP with the AdjustTransaction method in RESTv2, including field differences and examples.

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

SOAP

RESTv2

`AdjustTax.AdjustmentReason`

`adjustmentReason`

`AdjustTax.AdjustmentDescription`

`adjustmentDescription`

`CompanyCode`

`companyCode`

`DocType`

`type`

`AdjustmentReason`

N/A

`AdjustmentDescription`

N/A

`DocCode`

`code`

`DocDate`

`date`

`CustomerCode`

`customerCode`

`Discount`

`discount`

`AddressCode`

N/A

`Line1`

`line1`

`City`

`city`

`Region`

`region`

`Country`

`country`

`PostalCode`

`postalCode`

`LocationTypeCode`

N/A

`No`

`number`

`Qty`

`quantity`

`Amount`

`amount`

`TaxCode`

`taxCode`

`ItemCode`

`itemCode`

`Description`

`description`

`DetailLevel`

`debugLevel`

`HashCode`

N/A

`Commit`

`commit`

`CurrencyCode`

`currencyCode`

## Examples

**SOAP**

```
POST https://development.avalara.net/Tax/TaxSvc.asmx/v2
         myApp myApp SOAP API       8 Test    {{companyCode}} SalesInvoice 1 Wrong amount {{documentCode}} 2021-11-11+05:00 GUEST 0    ORIG 255 S King St Seattle WA 98104 US   DEST 255 S King St Seattle WA 98104 US     ORIG ShipFrom   DEST ShipTo     1 1 100.0 P0000000 P12345 Item Description   2 1 20 FR020100 Shipping Shipping Cost   Tax 0 true USD    
```

**REST V2**

```
curl
  -X GET
  -H 'Accept: application/json'
  -H 'Authorization: Basic ${btoa(`:`)}'
  --data {
    "adjustmentReason": "PriceAdjusted",
    "adjustmentDescription": "Price drop before shipping",
    "newTransaction": {
      "type": "SalesInvoice",
      "companyCode": "",
      "date": "2024-10-11",
      "customerCode": "GUEST",
      "addresses": {
        "shipFrom": {
          "line1": "255 S King St",
          "city": "Seattle",
          "region": "WA",
          "country": "US",
          "postalCode": "98104"
        },
        "shipTo": {
          "line1": "255 S King St",
          "city": "Seattle",
          "region": "WA",
          "country": "US",
          "postalCode": "98104"
        }
      },
      "lines": [
        {
          "number": "1",
          "quantity": 1,
          "amount": 75,
          "taxCode": "P0000000",
          "itemCode": "P12345",
          "description": "Item Description"
        },
        {
          "number": "2",
          "quantity": 1,
          "amount": 20,
          "taxCode": "FR020100",
          "itemCode": "Shipping",
          "description": "Shipping Costs"
        }
      ],
      "commit": true,
      "currencyCode": "USD",
      "description": "Sample Transaction"
    }
  }
  'https://sandbox-rest.avatax.com/api/v2/companies/{companyCode}/transactions/{transactionCode}/adjust'
```