Tax code & tax code values
A tax code has the tax value % that is to be calculated for an item. Items can have multiple tax codes grouped into item sales tax groups, such as federal and state tax. Tax codes are used to calculate tax for items sold in LS One. Tax codes belong to tax groups and the tax codes from the store/customer sales tax group and the item sales tax group the final tax. When the tax is calculated for an item the tax codes in the intersection of this group and the tax group of the store/customer are used.
The tax can have one or more values attached to it and represent the value of the tax code. The value has a validation to and from dates and only one tax code value can be active at once.
The taxcode
endpoint in LS One API allows management of the tax codes and their values.
Actions
GET |
Get tax code |
GET |
Get all tax codes |
POST |
Create a new tax code |
PUT |
Update a tax code |
DELETE |
Delete a tax code |
GET |
Get tax code value |
GET |
Get all tax code values |
POST |
Create a new tax code value |
PUT |
Update a tax code value |
DELETE |
Delete a tax code value |
Properties
TaxCode
Field | Data type | Validation | Description |
---|---|---|---|
id |
string |
Required
max. length = 20 |
Unique identifier of the tax code |
description | string | Required
max. length = 60 |
Description of the tax code |
receiptDisplay | string | - | Text used on receipts for the tax code. F.x. is used on customer receipt below all the items and below the total payments |
rounding | decimal | Required | The amount that the tax code value should round to. Usually this amount is 0.1, 0.01, 0.001 , ... and contains the smallest amount that the tax code should represent |
roundingMethod | string | Required | Rounding method used depending on the type of the tax code |
TaxCodeValue
Field | Data type | Validation | Description |
---|---|---|---|
gid |
guid |
Required | Globally unique identifier of the tax code value |
taxCode | string | [Required] | Name of the tax code to which this value belongs to. At any given time, only one value is valid for a tax code. |
value | decimal | Required | Value of the tax code value. A value of 10 here means 10 % tax |
fromDate | datetime | Required | Date when tax code value becomes valid. A blank value means the tax code value has no start date (is always valid until the toDate). |
toDate | datetime | Required | Date when tax code value stops being valid. A blank value means the tax code value has no end date (is valid from the fromDate). |
Examples
Get tax code
Returns details of a single tax code.
GET /api/taxcode/{id}
Permissions
-
TaxCode:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/taxcode/SC00005' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
id | string |
Required |
Unique identifier of the tax code |
Response
{
"id": "SC00005",
"description": "20% Sales Tax",
"receiptDisplay": null,
"rounding": 0.010000000000,
"roundingMethod": "Nearest"
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to read tax code(s) |
404 | Not Found | The requested tax code was not found |
Get all tax codes
Returns a list of all tax codes.
GET /api/taxcode
Permissions
-
TaxCode:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/taxcode' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Response
[
{
"id": "SC00005",
"description": "20% Sales Tax",
"receiptDisplay": null,
"rounding": 0.010000000000,
"roundingMethod": "Nearest"
},
{
"id": "SC00006",
"description": "5% Sales Tax",
"receiptDisplay": null,
"rounding": 0.010000000000,
"roundingMethod": "Nearest"
},
...
]
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to read tax code(s) |
404 | Not Found | No tax codes found |
Create a new tax code
Create a new tax code.
POST /api/taxcode
To create a new tax code, the following fields are required:
-
id
-
description
-
rounding
-
roundingMethod
Permissions
-
TaxCode:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'POST' \
'https://lsoneapi.lsretail.com/api/taxcode' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authorization_token}' \
-H 'Content-Type: application/json' \
-d '{
"id": "SC000021",
"description": "American tax code",
"rounding": 0.01,
"roundingMethod": "Nearest"
}'
Response
{
"id": "SC000021",
"description": "American tax code",
"receiptDisplay": null,
"rounding": 0.01,
"roundingMethod": "Nearest"
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to write tax code(s) |
400 | Bad Request | New tax code could not be created |
Update a tax code
Updates an existing tax code.
PUT /api/taxcode
To update an existing tax code, the following fields are required:
-
id
-
description
Permissions
-
TaxCode:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'PUT' \
'https://lsoneapi.lsretail.com/api/taxcode' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}' \
-H 'Content-Type: application/json' \
-d '{
"id": "SC000021",
"description": "American tax code updated",
"rounding": 0.15,
"roundingMethod": "Nearest"
}'
Response
{
"id": "SC000021",
"description": "American tax code updated",
"receiptDisplay": null,
"rounding": 0.15,
"roundingMethod": "Nearest"
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to write tax code(s) |
400 | Bad Request | Tax code could not be updated |
404 | Not Found | Tax code to be updated was not found |
Delete a tax code
Delete an existing tax code.
DELETE /api/taxcode/{id}
Permissions
-
TaxCode:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'DELETE' \
'https://lsoneapi.lsretail.com/api/taxcode/0-00000002' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
id | string |
Required |
Unique identifier of the tax code |
Response
HTTP/1.1 204 No Content
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to write tax code(s) |
404 | Not Found | The requested tax code was not found |
Get tax code value
Returns the current value for a tax code.
GET /api/taxcode/{taxCodeId}/value
Permissions
-
TaxCode:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/taxcode/SC00011/value' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
taxCodeId | string |
Required |
Unique identifier of the tax code |
Response
{
"id": "6db7209e-8d30-4060-bb95-53b5c4625b06",
"taxCode": "SC00011",
"value": 2.000000000000,
"fromDate": "2012-01-01T00:00:00",
"toDate": "1900-01-01T00:00:00"
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to read tax code value(s) |
404 | Not Found | The requested tax code value was not found |
Get all tax code values
Returns all recorded values for a tax code.
GET /api/taxcode/{taxCodeId}/value/all
Permissions
-
TaxCode:Read
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'GET' \
'https://lsoneapi.lsretail.com/api/taxcode/SC00011/value/all' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
taxCodeId | string |
Required |
Unique identifier of the tax code |
Response
[
{
"id": "df44d728-523d-4328-8c14-632abaddbd60",
"taxCode": "SC00011",
"value": 20.000000000000,
"fromDate": "2012-01-01T00:00:00",
"toDate": "1900-01-01T00:00:00"
},
{
"id": "e7f8c173-96de-454e-b09a-672445cb882e",
"taxCode": "SC00011",
"value": 3.000000000000,
"fromDate": "2012-01-01T00:00:00",
"toDate": "1900-01-01T00:00:00"
},
...
]
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to read tax code value(s) |
404 | Not Found | No tax code values found |
Create a new tax code value
Adds a new value for a tax code.
POST /api/taxcode/{taxCodeId}/value
To add a new value to the tax code, the following fields are required:
-
value
-
fromDate
-
toDate
Permissions
-
TaxCode:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'POST' \
'https://lsoneapi.lsretail.com/api/taxcode/SC00011/value' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authorization_token}' \
-H 'Content-Type: application/json' \
-d '{
"value": 35,
"fromDate": "2021-11-1T00:00:00",
"toDate": "1900-01-01T00:00:00"
}'
Parameter | Data type | Validation | Description |
---|---|---|---|
taxCodeId | string |
Required |
Unique identifier of the tax code |
Response
{
"id": "cf9db80a-6e35-42ce-b7f1-083db40c9420",
"taxCode": "SC00011",
"value": 35.000000000000,
"fromDate": "2021-01-01T00:00:00",
"toDate": "1900-01-01T00:00:00"
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to write tax code value(s) |
400 | Bad Request | New tax code value could not be created |
Update a tax code value
Updates an existing value of a tax code.
PUT /api/taxcode/{taxCodeId}/value
To update an existing tax code value, the following fields are required:
-
id
-
value
-
fromDate
-
toDate
Permissions
-
TaxCode:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'PUT' \
'https://lsoneapi.lsretail.com/api/taxcode/SC00011/value' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}' \
-H 'Content-Type: application/json' \
-d '{
"id": "E7F8C173-96DE-454E-B09A-672445CB882E",
"taxCode": "SC00010",
"value": 4,
"fromDate": "2021-08-01T00:00:00",
"toDate": "2021-12-01T00:00:00"
}'
Parameter | Data type | Validation | Description |
---|---|---|---|
taxCodeId | string |
Required |
Unique identifier of the tax code |
Response
{
"id": "E7F8C173-96DE-454E-B09A-672445CB882E",
"taxCode": "SC00010",
"value": 4,
"fromDate": "2021-08-01T00:00:00",
"toDate": "2021-12-01T00:00:00"
}
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to write tax code value(s) |
400 | Bad Request | Tax code could not be updated |
404 | Not Found | Tax code value to be updated was not found |
Delete a tax code value
Delete an existing value of a tax code.
DELETE /api/taxcode/value/{gid}
Permissions
-
TaxCode:Write
For more information on authenticating to LS One APIs, see Authentication.
Request
curl -X 'DELETE' \
'https://lsoneapi.lsretail.com/api/taxcode/value/cf9db80a-6e35-42ce-b7f1-083db40c9420' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer {authentication_token}'
Parameter | Data type | Validation | Description |
---|---|---|---|
gid | guid |
Required |
Globally unique identifier of the tax code value |
Response
HTTP/1.1 200 Ok
Status codes
Code | Text | Description |
---|---|---|
200 | Success | Success |
401 | Unauthorized | LS One API client did not provide a valid authentication token or it does not have permissions to write tax code value(s) |
404 | Not Found | The requested tax code value was not found |