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
type
enum<string>
required
Available options:
SalesInvoice,
SalesOrder
Example:

"SalesInvoice"

lineItems
object[]
required
addresses
object
required

Response

200
application/json
Created tax
code
string
Example:

"e2ab8924-4316-47b6-880d-3744b16aaa4f"

date
string
Example:

"2021-09-19"

status
string
Example:

"Saved"

type
string
Example:

"SalesInvoice"

customerCode
string
Example:

"FABRIC_INC"

totalAmount
number
Example:

2063.39

totalExempt
number
Example:

182.97

totalDiscount
number
Example:

0

totalTax
number
Example:

145.73

totalTaxable
number
Example:

1880.42

totalTaxCalculated
number
Example:

145.73

lines
object[]