Tax Calculation Input

Input representation of the details of the request to calculate tax.

JSON Example 

This example shows a tax request for a specified invoice as the reference entity.

1{
2  "addresses": {
3    "billTo": {
4      "street": "123 Main Street",
5      "city": "Bainbridge Island",
6      "state": "WA",
7      "postalCode": "98110",
8      "country": "US"
9    },
10    "soldTo": {
11      "street": "123 Main Street",
12      "city": "Bainbridge Island",
13      "state": "WA",
14      "postalCode": "98110",
15      "country": "US"
16    },
17    "shipFrom": {
18      "street": "123 Alaskan Way",
19      "city": "Seattle",
20      "state": "WA",
21      "country": "US",
22      "postalCode": "98101"
23    },
24    "shipTo": {
25      "street": "123 Main street",
26      "city": "Bainbridge Island",
27      "state": "WA",
28      "postalCode": "98110",
29      "country": "US"
30    }
31  },
32  "currencyIsoCode": "USD",
33  "customerDetails": {
34    "accountId": "001xx000003HYD5AAO"
35  },
36  "description": "Monthly invoice for account 001xx000003HYEhAAO",
37  "documentCode": "3ttxx0000000C7d_Debit-4wAxx00000000ODEAY",
38  "effectiveDate": "2022-03-09T10:30:41.000Z",
39  "isCommit": true,
40  "lineItems": [
41    {
42      "quantity": 1,
43      "amount": 100,
44      "taxCode": "TX0001",
45      "productCode": "Y0001",
46      "productSKU": "PRES-RX-12896745",
47      "description": "New Product",
48      "effectiveDate": "2022-03-09T10:30:41.000Z",
49      "lineNumber": "5TVxx0000004C92GAE",
50      "addresses": {
51        "shipFrom": {
52          "street": "123 Alaskan Way",
53          "city": "Seattle",
54          "state": "WA",
55          "country": "US",
56          "postalCode": "98101",
57          "latitude": 45.12,
58          "longitude": 45.12
59        },
60        "shipTo": {
61          "street": "123 Auburn Blvd",
62          "city": "Sacramento",
63          "state": "CA",
64          "country": "US",
65          "postalCode": "95841",
66          "latitude": 45.12,
67          "longitude": 45.12
68        },
69        "soldTo": {
70          "street": "123 Auburn Blvd",
71          "city": "Sacramento",
72          "state": "CA",
73          "country": "US",
74          "postalCode": "95841",
75          "latitude": 45.12,
76          "longitude": 45.12
77        },
78        "billTo": {
79          "street": "123 Auburn Blvd",
80          "city": "Sacramento",
81          "state": "CA",
82          "country": "US",
83          "postalCode": "95841",
84          "latitude": 45.12,
85          "longitude": 45.12
86        }
87      }
88    }
89  ],
90  "referenceDocumentCode" = null,
91  "referenceEntityId": "3ttxx0000000C7d",
92  "shouldVoidTax": false,
93  "taxEngineId": "4wAxx0000000g8v",
94  "taxType": "Actual",
95  "taxTransactionType": "Debit",
96  "transactionDate": "2022-03-09T10:30:41.000Z"
97}

This example shows a tax request for a specified credit memo as the reference entity.

1{
2  "addresses": {
3    "billTo": {
4      "street": "123 Main Street",
5      "city": "Bainbridge Island",
6      "state": "WA",
7      "postalCode": "98110",
8      "country": "US"
9    },
10    "soldTo": {
11      "street": "123 Main Street",
12      "city": "Bainbridge Island",
13      "state": "WA",
14      "postalCode": "98110",
15      "country": "US"
16    },
17    "shipFrom": {
18      "street": "123 Alaskan Way",
19      "city": "Seattle",
20      "state": "WA",
21      "country": "US",
22      "postalCode": "98101"
23    },
24    "shipTo": {
25      "street": "123 Main street",
26      "city": "Bainbridge Island",
27      "state": "WA",
28      "postalCode": "98110",
29      "country": "US"
30    }
31  },
32  "currencyIsoCode": "USD",
33  "customerDetails": {
34    "accountId": "001xx000003HYD5AAO"
35  },
36  "description": "Monthly credit memo for account 001xx000003HYEhAAO",
37  "documentCode": "50gxx000000g27KAAQ-4wAxx00000000ODEAY",
38  "effectiveDate": "2022-03-09T10:30:41.000Z",
39  "isCommit": true,
40  "lineItems": [
41    {
42      "quantity": 1,
43      "amount": 100,
44      "taxCode": "TX0001",
45      "productCode": "Y0001",
46      "productSKU": "PRES-RX-12896745",
47      "description": "New Product",
48      "effectiveDate": "2022-03-09T10:30:41.000Z",
49      "lineNumber": "5TVxx0000004C92GAE",
50      "addresses": {
51        "shipFrom": {
52          "street": "123 Alaskan Way",
53          "city": "Seattle",
54          "state": "WA",
55          "country": "US",
56          "postalCode": "98101",
57          "latitude": 45.12,
58          "longitude": 45.12
59        },
60        "shipTo": {
61          "street": "123 Auburn Blvd",
62          "city": "Sacramento",
63          "state": "CA",
64          "country": "US",
65          "postalCode": "95841",
66          "latitude": 45.12,
67          "longitude": 45.12
68        },
69        "soldTo": {
70          "street": "123 Auburn Blvd",
71          "city": "Sacramento",
72          "state": "CA",
73          "country": "US",
74          "postalCode": "95841",
75          "latitude": 45.12,
76          "longitude": 45.12
77        },
78        "billTo": {
79          "street": "123 Auburn Blvd",
80          "city": "Sacramento",
81          "state": "CA",
82          "country": "US",
83          "postalCode": "95841",
84          "latitude": 45.12,
85          "longitude": 45.12
86        }
87      }
88    }
89  ],
90  "referenceDocumentCode" = null,
91  "referenceEntityId": "50gxx000000g27K",
92  "shouldVoidTax": false,
93  "taxEngineId": "4wAxx0000000g8v",
94  "taxType": "Actual",
95  "taxTransactionType": "Debit",
96  "transactionDate": "2022-03-09T10:30:41.000Z"
97}

Properties 

NameTypeDescriptionRequired or OptionalAvailable Version
addressesAddressesAddress details for tax calculation.Optional62.0
currencyIsoCodeStringCurrency ISO code that’s used for tax calculation.Optional62.0
customerDetailsCustomer DetailsCustomer details for determining the applicable tax.Optional62.0
descriptionStringDescription of the tax transaction.Optional62.0
documentCodeStringUnique identifier for the tax document. If the documentCode property isn’t specified, the tax engine auto-generates it.Optional62.0
effectiveDateStringDate when the tax rules are applied. If a tax rate changes on a specific date, the effectiveDate property ensures the correct rate is applied based on the transaction’s timing. For credit-based tax callouts, specify the original invoice date.Optional62.0
isCommitBooleanIndicates whether to submit the transaction to the tax engine for reporting ( true ) or not ( false ). This property value is true for invoices and credit memos with the Posted status.Optional62.0
lineItemsLine Item Input []Details of the line items for calculating the applicable tax.Required62.0
reference​DocumentCodeStringReference document code. For subsequent transactions such as a credit tax, this property value specifies the original document code. For credit-based tax callouts, specify the original invoice ID.Optional62.0
reference​EntityIdStringID of the related quote, invoice, and other transaction documents.Optional62.0
sellerDetailsSeller Details InputSeller details for tax calculation.Optional62.0
shouldVoidTaxBooleanIndicates whether to void the tax transaction associated with a document that’s mentioned as the referenceDocumentCode property value with taxType property value as Actual and isCommit property value set to true. Keep these considerations in mind when you use this property.Optional65.0
taxEngineIdStringID of the tax engine that’s used to calculate tax.Required62.0
tax​TransactionTypeStringType of the tax transaction. Valid values are Debit—Increases tax liability for the seller, requiring the seller to pay tax on the transaction, Credit—Decreases tax liability for the seller, resulting in a tax refund for the seller, or Void—Reserved for internal use. The default value is Debit.Optional62.0
taxTypeStringType of the tax. Valid values are Actual—Exact tax amount that’s calculated based on actual sales or Estimated— Estimated tax amount, which is adjusted later to match actual tax calculations. For draft invoices and quote records, the tax type is marked as Estimated. After draft invoices are posted and the status changes to Posted, the tax type is updated to Actual. Similarly, when a quote record is finalized and converted into an actual order, the tax type is also updated to Actual.Required62.0
transactionDateStringDate of the transaction that appears on the invoice, order, and other transaction documents.Required62.0

Supported values:

  • If the shouldVoidTax property value is set to true, then the operation returns a response with documentCode property value updated to referenceDocumentCode property value that was originally sent in the request payload. The response also includes the taxTransactionType property value as Void. This indicates that the document specified in the referenceDocumentCode property value is voided.
  • If document is locked or you can’t void the tax transaction for any reason, then you can use the Tax Calculation request to perform another transaction such as a Credit Tax request. In this scenario, the response includes the documentCode property value that was sent in the request payload.
  • If the document that’s mentioned in the referenceDocumentCode property value isn’t available in the tax engine, then an error response occurs with ResultCode value as ReferenceDocumentCodeMissing.