XM
Powered By GitBook
Create Estimate Transaction
Path:
1
POST /api-tax/tax/create
Copied!
Fabric's tax APIs helps dynamically calculate and apply tax on orders.
Headers
Content-Type : application/json
x-api-key : d41d8cd98f00b204e9800998ecf8427e

Parameters

Type: Body
Name: Line Item details
Required: true

Sample Request

1
{
2
"lineItems": [
3
{
4
"price": 900.00,
5
"quantity": 2,
6
"taxCode": "PF050099",
7
"title": "Chocolate",
8
"sku": "srtdyfyg7uy",
9
"lineItemId": 1
10
},
11
{
12
"price": 40.21,
13
"quantity": 2,
14
"taxCode": "PC040400",
15
"title": "Baseball Bat",
16
"sku": "srtdyfyg7uy",
17
"lineItemId": 2
18
},
19
{
20
"price": 89.99,
21
"quantity": 2,
22
"taxCode": "SA090700",
23
"title": "Oil change service (with synthetic oil)",
24
"sku": "srtdyfyg7uy",
25
"lineItemId": 3
26
},
27
{
28
"price": 2.99,
29
"quantity": 1,
30
"taxCode": "FR020000",
31
"title": "Shipping Costs",
32
"sku": "srtdyfyg7uy",
33
"lineItemId": 4
34
}
35
],
36
"type": "SalesOrder",
37
"addresses": {
38
"shipTo": {
39
"street1": "2000 Main Street",
40
"city": "Irvine",
41
"state": "CA",
42
"country": "US",
43
"zipCode": "92614"
44
},
45
"shipFrom": {
46
"street1": "317 Adelaide St W",
47
"city": "Toronto",
48
"state": "Ontario",
49
"country": "CA",
50
"zipCode": "M5V 1P9"
51
}
52
}
53
}
Copied!

2.0.6. Response

Response Code: 200
Message: OK
Sample
1
{
2
"code": "b8daba33-6f59-4bef-8789-7fc6863001ff",
3
"date": "2020-07-20",
4
"paymentDate": "2020-07-20",
5
"status": "Temporary",
6
"type": "SalesOrder",
7
"customerCode": "FABRIC_INC",
8
"totalAmount": 2063.39,
9
"totalExempt": 1982.97,
10
"totalDiscount": 0,
11
"totalTax": 6.23,
12
"totalTaxable": 80.42,
13
"totalTaxCalculated": 6.23,
14
"lines": [
15
{
16
"id": 0,
17
"lineNumber": "1",
18
"description": "Chocolate",
19
"isItemTaxable": false,
20
"lineAmount": 1800,
21
"quantity": 2,
22
"tax": 0,
23
"taxableAmount": 0,
24
"taxCalculated": 0,
25
"taxCode": "PF050099"
26
},
27
{
28
"id": 0,
29
"lineNumber": "2",
30
"description": "Baseball Bat",
31
"isItemTaxable": true,
32
"lineAmount": 80.42,
33
"quantity": 2,
34
"tax": 6.23,
35
"taxableAmount": 80.42,
36
"taxCalculated": 6.23,
37
"taxCode": "PC040400"
38
},
39
{
40
"id": 0,
41
"lineNumber": "3",
42
"description": "Oil change service (with synthetic oil)",
43
"isItemTaxable": false,
44
"lineAmount": 179.98,
45
"quantity": 2,
46
"tax": 0,
47
"taxableAmount": 0,
48
"taxCalculated": 0,
49
"taxCode": "SA090700"
50
},
51
{
52
"id": 0,
53
"lineNumber": "4",
54
"description": "Shipping Costs",
55
"isItemTaxable": false,
56
"lineAmount": 2.99,
57
"quantity": 1,
58
"tax": 0,
59
"taxableAmount": 0,
60
"taxCalculated": 0,
61
"taxCode": "FR020000"
62
}
63
]
64
}
Copied!
Error Code: 403
Message: Forbidden
Description: You will see this error when the account number is incorrect in the x-site-context (for a multi-tenent client).
1
{
2
"message": "Forbidden"
3
}
Copied!

Changelog

    Last updated - July 2020
Last modified 3mo ago
Copy link
Contents
Changelog