POST
/
api-tax
/
tax
/
create
curl --request POST \
  --url https://prod01-apigw.{customer_name}.fabric.zone/api-tax/tax/create \
  --header 'Content-Type: application/json' \
  --header 'x-site-context: <x-site-context>' \
  --data '{
  "type": "SalesInvoice",
  "lineItems": [
    {
      "price": 12.99,
      "quantity": 3,
      "taxCode": "PF050099",
      "title": "Fabric Inc T-Shirt",
      "sku": "123456789Red-Shirt",
      "lineItem": 3
    }
  ],
  "addresses": {
    "shipTo": {
      "street1": "2000 Main Street",
      "city": "Irvine",
      "state": "CA",
      "country": "US",
      "zipCode": "92614"
    },
    "shipFrom": {
      "street1": "2000 Main Street",
      "city": "Irvine",
      "state": "CA",
      "country": "US",
      "zipCode": "92614"
    }
  }
}'
{
  "code": "e2ab8924-4316-47b6-880d-3744b16aaa4f",
  "date": "2021-09-19",
  "status": "Saved",
  "type": "SalesInvoice",
  "customerCode": "FABRIC_INC",
  "totalAmount": 2063.39,
  "totalExempt": 182.97,
  "totalDiscount": 0,
  "totalTax": 145.73,
  "totalTaxable": 1880.42,
  "totalTaxCalculated": 145.73,
  "lines": [
    {
      "id": 6000306551642,
      "lineNumber": "1",
      "description": "Chocolate",
      "isItemTaxable": true,
      "lineAmount": null,
      "quantity": 2,
      "tax": 139.5,
      "taxableAmount": 1800,
      "taxCalculated": 139.5,
      "taxCode": "P0000000"
    }
  ]
}

Headers

x-site-context
string
required

The x-site-context header is a JSON object that contains information about the source you wish to pull from. The mandatory account is the 24 character identifier found in Copilot. The channel (Sales channel ID), stage (environment name), and date attributes can be used to further narrow the scope of your data source.

Example:

"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"

Body

application/json

Response

200
application/json

Created tax

The response is of type object.