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 the timestamp 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 object was created"2021-03-24 17:26:46.983Z"
updatedAtDateTimeWhen this object was last updated"2021-03-24 17:26:46.983Z"

Enums​

TaxType​

ValueDescription
SALESSales Tax
USEUse Tax

REST Endpoints​

GET /tax-codes/:idOrCode​

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 Request​

GET https://api.kojo.tech/tax-codes/22

Example Response​

{
"code": "22",
"description": "San Francisco",
"id": "ckmnpybisiy5x08abky4g2d1f",
"taxPercent": 0.075,
"taxType": "SALES"
}

GET /tax-codes​

Read all tax codes, with pagination.

Parameters​

Accepts all standard pagination parameters.

Default orderBy field: code

Additionally allowed orderBy fields: createdAt, description, id, updatedAt.

Allowed filter fields: code, createdAt, description, id, taxType, updatedAt.

Response​

A list of TaxCode objects.

Example Request​

GET https://api.kojo.tech/tax-codes

Example Response​

[
{
"code": "22",
"name": "San Francisco",
"id": "ckmnpybisiy5x08abky4g2d1f",
"taxPercent": 0.075,
"taxType": "SALES"
},
{
"code": "23",
"name": "Oakland",
"id": "ckmnpybi7ag5x08abky4g2d1f",
"taxPercent": 0.08,
"taxType": "SALES"
}
]

POST /tax-codes​

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 Request​

POST https://api.kojo.tech/tax-codes
{
code: "24"
description: "Los Angeles"
taxPercent: 0.08
}

Example Response​

{
"code": "24",
"description": "Los Angeles",
"id": "ckmnpybisiy5x08abky4g2d1f",
"taxPercent": 0.08,
"taxType": "SALES"
}

PATCH /tax-codes/:idOrCode​

Updates a tax code.

Parameters​

You must specify either the ID or the code.

NameTypeDescriptionExample
idIDThe 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 Request​

PATCH https://api.kojo.tech/tax-codes/ckmnpybisiy5x08abky4g2d1f
{
code: '24',
taxPercent: 0.05
}

Example Response​

{
"code": "24",
"id": "ckmnpybisiy5x08abky4g2d1f",
"taxPercent": 0.05
}

DELETE /tax-codes/:idOrCode​

Deletes a tax code.

Response​

The deleted Tax Code.

Example Request​

DELETE https://api.kojo.tech/tax-codes/24

Example Response​

{
"code": "24",
"id": "ckmnpybisiy5x08abky4g2d1f",
"taxPercent": 0.05
}