XM

Create Estimate Transaction

Path:

POST /api-tax/tax/create

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

{
"lineItems": [
{
"price": 900.00,
"quantity": 2,
"taxCode": "PF050099",
"title": "Chocolate",
"sku": "srtdyfyg7uy",
"lineItemId": 1
},
{
"price": 40.21,
"quantity": 2,
"taxCode": "PC040400",
"title": "Baseball Bat",
"sku": "srtdyfyg7uy",
"lineItemId": 2
},
{
"price": 89.99,
"quantity": 2,
"taxCode": "SA090700",
"title": "Oil change service (with synthetic oil)",
"sku": "srtdyfyg7uy",
"lineItemId": 3
},
{
"price": 2.99,
"quantity": 1,
"taxCode": "FR020000",
"title": "Shipping Costs",
"sku": "srtdyfyg7uy",
"lineItemId": 4
}
],
"type": "SalesOrder",
"addresses": {
"shipTo": {
"street1": "2000 Main Street",
"city": "Irvine",
"state": "CA",
"country": "US",
"zipCode": "92614"
},
"shipFrom": {
"street1": "317 Adelaide St W",
"city": "Toronto",
"state": "Ontario",
"country": "CA",
"zipCode": "M5V 1P9"
}
}
}

2.0.6. Response

Response Code: 200

Message: OK

Sample

{
"code": "b8daba33-6f59-4bef-8789-7fc6863001ff",
"date": "2020-07-20",
"paymentDate": "2020-07-20",
"status": "Temporary",
"type": "SalesOrder",
"customerCode": "FABRIC_INC",
"totalAmount": 2063.39,
"totalExempt": 1982.97,
"totalDiscount": 0,
"totalTax": 6.23,
"totalTaxable": 80.42,
"totalTaxCalculated": 6.23,
"lines": [
{
"id": 0,
"lineNumber": "1",
"description": "Chocolate",
"isItemTaxable": false,
"lineAmount": 1800,
"quantity": 2,
"tax": 0,
"taxableAmount": 0,
"taxCalculated": 0,
"taxCode": "PF050099"
},
{
"id": 0,
"lineNumber": "2",
"description": "Baseball Bat",
"isItemTaxable": true,
"lineAmount": 80.42,
"quantity": 2,
"tax": 6.23,
"taxableAmount": 80.42,
"taxCalculated": 6.23,
"taxCode": "PC040400"
},
{
"id": 0,
"lineNumber": "3",
"description": "Oil change service (with synthetic oil)",
"isItemTaxable": false,
"lineAmount": 179.98,
"quantity": 2,
"tax": 0,
"taxableAmount": 0,
"taxCalculated": 0,
"taxCode": "SA090700"
},
{
"id": 0,
"lineNumber": "4",
"description": "Shipping Costs",
"isItemTaxable": false,
"lineAmount": 2.99,
"quantity": 1,
"tax": 0,
"taxableAmount": 0,
"taxCalculated": 0,
"taxCode": "FR020000"
}
]
}

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).

{
"message": "Forbidden"
}

Changelog

  • Last updated - July 2020