Skip to main content

Tax Codes

Tax codes store percentage and tax type for use with Orders.

Schema​

TaxCode​

Fields​

NameTypeDescriptionExample
idIDThe unique tax code ID"ckmnpybisiy5x08abky4g2d1f"
codestringThe unique human-readable code to represent this tax code"22"
deletedAtDateTimeWhen this tax code was deleted"2021-03-24 17:26:46.983Z"
descriptionstringDescription of the tax code"San Francisco"
taxPercentfloatFloat value of tax percentage. Represented in resolved format; e.g., 0.075 for 7.5%0.075
taxTypeTaxTypeThe type of tax. Default: SALES.SALES
createdAtDateTimeWhen this tax code was created"2021-03-24 17:26:46.983Z"
updatedAtDateTimeWhen this tax code was last updated"2021-03-24 17:26:46.983Z"

Enums​

TaxType​

ValueDescription
SALESSales Tax
USEUse Tax

Queries​

taxCode​

Read a single tax code. You must specify either the ID or the code.

Parameters​

NameDescriptionExample
idThe ID of the tax code to fetch"ckmnpybisiy5x08abky4g2d1f"
codeThe 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​

NameTypeDescriptionExample
codestringThe unique human-readable code to represent this tax code"22"
descriptionstringDescription of the tax code"San Francisco"
taxPercentfloatFloat value of tax percentage. Represented in resolved format; e.g., 0.075 for 7.5%0.075
taxTypeTaxTypeThe 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​

NameTypeDescriptionExample
idIDRequired. The ID of the tax code to update."ckmnpybisiy5x08abky4g2d1f"
codestringThe code of the tax code to update."22"
descriptionstringDescription of the tax code"San Francisco"
taxPercentfloatFloat value of tax percentage. Represented in resolved format; e.g., 0.075 for 7.5%0.075
taxTypeTaxTypeThe type of taxSALES

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​

NameTypeDescriptionExample
idIDRequired. The ID of the tax code to update."ckmnpybisiy5x08abky4g2d1f"
codestringThe 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
}