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 the timestamp 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 object was created | "2021-03-24 17:26:46.983Z" |
updatedAt | DateTime | When this object was last updated | "2021-03-24 17:26:46.983Z" |
Enums​
TaxType
​
Value | Description |
---|---|
SALES | Sales Tax |
USE | Use Tax |
REST Endpoints​
GET /tax-codes/:idOrCode
​
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 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​
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 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.
Name | Type | Description | Example |
---|---|---|---|
id | ID | 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 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
}