To represent Taxes associated with Property and Rate Plans at Channex.io you can use Taxes and Tax Sets.
Taxes
Entity which represent specific tax applicable to your Rate Plan or Property. Example: VAT 20%, City Tax 1 EUR per Guest per Night or any other.
Tax Sets
Entity which represent group of Taxes applicable to your Rate Plan or Property.
Each property can have many Tax Sets and Taxes, but only one can be selected as Default Tax Set. Default Tax Set will be applied to each new Rate Plan automatically.
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a list of Tax objects in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.
{"errors": {"code":"not_found","title":"Resouce Not Found" }}
Returns
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Tax object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided or User not have access to requested Tax.
Not Found Error
Method can return a Not Found Error result with 404 Not Found HTTP Code if Tax with provided ID is not present at system.
{"errors": {"code":"resource_not_found""title": "Resource Not Found" }}
Validation Error Response
Status Code: 422 Unprocessable Entity
{"errors": {"code":"validation_error","title":"Validation Error","details": {"title": ["can't be blank" ] } }}
Returns
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Tax object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.
Not Found Error
Method can return a Not Found Error result with 404 Not Found HTTP Code if Tax with provided ID is not present at system.
Validation Error
Method can return a Validation Error result with 422 Unprocessable Entity HTTP Code if any validation rule is failed.
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a list of Tax Set objects in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.
Get Tax Set by ID
Retrieve specific Tax Set associated with User by ID.
Request:
GET https://staging.channex.io/api/v1/tax_sets/:id
{"errors": {"code":"not_found","title":"Resouce Not Found" }}
Returns
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Tax Set object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided or User not have access to requested Tax Set.
Not Found Error
Method can return a Not Found Error result with 404 Not Found HTTP Code if Tax Set with provided ID is not present at system.
Create Tax Set
Create a new Tax Set.
Request:
POST https://staging.channex.io/api/v1/tax_sets
Query body (JSON):
{"tax_set": {"title":"Tax Set Title","property_id":"716305c4-561a-4561-a187-7f5b8aeb5920","taxes": [ {"id":"c1fb94b3-ce95-4233-be0e-2748b3728715"}, {"id":"a3c4f3c8-841c-4492-b5ff-ce9ca92c1c83"} ],"currency":"USD" }}
{"errors": {"code":"validation_error","title":"Validation Error","details": {"title": ["can't be blank" ] } }}
Fields
title [required]
Any non-empty string with maximum length of 255 symbols.
Note: The Tax Set will be represented in the system under that title.
property_id [required]
UUID of Property which is associated with Tax Set.
Note: If it is first Tax Set for Property, it will be automatically installed as default_tax_set for this property.
currency [required]*
String. Should a valid currency code. Represent Tax Set currency.
taxes [required]
List of object with associated taxes IDs. Can contain another taxes inside.
Returns
Success
Method can return a Success result with 201 Created HTTP Code if operation is successful. Will contain a Tax Set object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.
Validation Error
Method can return a Validation Error result with 422 Unprocessable Entity HTTP Code if any validation rule is failed.
{"errors": {"code":"resource_not_found""title": "Resource Not Found" }}
Validation Error Response
Status Code: 422 Unprocessable Entity
{"errors": {"code":"validation_error","title":"Validation Error","details": {"title": ["can't be blank" ] } }}
Returns
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Tax Set object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.
Not Found Error
Method can return a Not Found Error result with 404 Not Found HTTP Code if Tax Set with provided ID is not present at system.
Validation Error
Method can return a Validation Error result with 422 Unprocessable Entity HTTP Code if any validation rule is failed.