Tax Codes
Tax codes store percentage and tax type for use with Orders
.
Schema​
TaxCode
​
Fields​
Name | Type | Description | Example |
---|---|---|---|
id | ID | The unique tax code ID | "ckmnpybisiy5x08abky4g2d1f" |
code | string | The unique human-readable code to represent this tax code | "22" |
deletedAt | DateTime | When this tax code was deleted | "2021-03-24 17:26:46.983Z" |
description | string | Description of the tax code | "San Francisco" |
taxPercent | float | Float value of tax percentage. Represented in resolved format; e.g., 0.075 for 7.5% | 0.075 |
taxType | TaxType | The type of tax. Default: SALES . | SALES |
createdAt | DateTime | When this tax code was created | "2021-03-24 17:26:46.983Z" |
updatedAt | DateTime | When this tax code was last updated | "2021-03-24 17:26:46.983Z" |
Enums​
TaxType
​
Value | Description |
---|---|
SALES | Sales Tax |
USE | Use Tax |
Queries​
taxCode
​
Read a single tax code. You must specify either the ID or the code.
Parameters​
Name | Description | Example |
---|---|---|
id | The ID of the tax code to fetch | "ckmnpybisiy5x08abky4g2d1f" |
code | The code of the tax code to fetch | "22" |
Response​
A single TaxCode
object.
Example Query​
query {
taxCode(code: "22") {
code
description
id
}
}
Example Response​
{
"code": "22",
"description": "San Francisco",
"id": "ckmnpybisiy5x08abky4g2d1f"
}
taxCodes
​
Read all tax codes, with pagination.
Parameters​
Accepts all standard pagination parameters.
Allowed orderBy fields: code
(default), createdAt
, description
, id
, updatedAt
.
Allowed filter fields: code
, createdAt
, description
, id
, taxType
, updatedAt
.
Response​
A list of TaxCode
objects.
Example Query​
query {
taxCodes(limit: 10, orderBy: code) {
code
description
id
}
}
Example Response​
[
{
"code": "22",
"name": "San Francisco",
"id": "ckmnpybisiy5x08abky4g2d1f"
},
{
"code": "23",
"name": "Oakland",
"id": "ckmnpybi7ag5x08abky4g2d1f"
}
]
Mutations​
createTaxCode
​
Creates a new tax code.
Parameters​
Name | Type | Description | Example |
---|---|---|---|
code | string | The unique human-readable code to represent this tax code | "22" |
description | string | Description of the tax code | "San Francisco" |
taxPercent | float | Float value of tax percentage. Represented in resolved format; e.g., 0.075 for 7.5% | 0.075 |
taxType | TaxType | The type of tax. Default: SALES . | SALES |
Response​
The created TaxCode
.
Example Mutation​
mutation {
createTaxCode(
code: "24"
description: "Los Angeles"
taxPercent: 0.08
) {
code
description
id
taxPercent
taxType
}
}
Example Response​
{
"code": "24",
"description": "Los Angeles",
"id": "ckmnpybisiy5x08abky4g2d1f",
"taxPercent": 0.08,
"taxType": "SALES"
}
updateTaxCode
​
Updates a tax code.
Parameters​
Name | Type | Description | Example |
---|---|---|---|
id | ID | Required. The ID of the tax code to update. | "ckmnpybisiy5x08abky4g2d1f" |
code | string | The code of the tax code to update. | "22" |
description | string | Description of the tax code | "San Francisco" |
taxPercent | float | Float value of tax percentage. Represented in resolved format; e.g., 0.075 for 7.5% | 0.075 |
taxType | TaxType | The type of tax | SALES |
Response​
The updated Tax Code
.
Example Mutation​
mutation {
updateTaxCode(
id: "ckmnpybisiy5x08abky4g2d1f"
taxPercent: 0.05
) {
code
id
taxPercent
}
}
Example Response​
{
"code": "22",
"id": "ckmnpybisiy5x08abky4g2d1f",
"taxPercent": 0.05
}
deleteTaxCode
​
Deletes a tax code.
Parameters​
Name | Type | Description | Example |
---|---|---|---|
id | ID | Required. The ID of the tax code to update. | "ckmnpybisiy5x08abky4g2d1f" |
code | string | The code of the tax code to update. | "22" |
One of id
or code
is required.
Response​
The updated Tax Code
.
Example Mutation​
mutation {
deleteTaxCode(
id: "ckmnpybisiy5x08abky4g2d1f"
) {
code
id
taxPercent
}
}
Example Response​
{
"code": "22",
"id": "ckmnpybisiy5x08abky4g2d1f",
"taxPercent": 0.05
}