Tax Class
This is a Simplify domain object. In order to get access to a domain object, a client needs to be created. The client is then used to invoke the different methods e.g.
var client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.tax.METHOD_NAME(params, function(error, data){
if(error){
// handle the error
}
// Awesome...no error, handle the data
});
Constructor
Tax
-
appKeys
Parameters:
-
appKeys
ObjectObject containing the public & private API keys
Methods
create
-
params
-
callback
Function to create a Tax object.
Parameters:
-
params
ObjectA map of parameters in which to create the Tax from.
Valid parameters include:- label : The label of the tax object. [max length: 255] (REQUIRED)
- rate : The tax rate. Decimal value up three decimal places. e.g 12.501. [max length: 6] (REQUIRED)
NOTE: Any parameters with a sub-parameter (e.g. param.subParam) need to be nested when passed as an argument in e.g.{ param: { subParam1: 'value', subParam2: 'value' } }
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
delete
-
A
-
callback
Function to delete a Tax object.
Parameters:
-
A
Objectstring ID of the Tax to delete.
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
find
-
id
-
callback
Function to retrieve a Tax object from the API.
Parameters:
-
id
StringThe ID of the Tax to retrieve
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
list
-
params
-
callback
Function to retrieve a list Tax objects.
Parameters:
-
params
ObjectA map of parameters in which to define the Tax list from.
Valid parameters include:- filter :
filter.id Filter by the Id of the tax filter.label Filter by the label(name) of the tax - max : Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
- offset : Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
- sorting : Allows for ascending or descending sorting of the list. The value maps properties to the sort direction (either 'asc' for ascending or 'desc' for descending).
Sortable properties are:- id
- label
NOTE: Any parameters with a sub-parameter (e.g. param.subParam) need to be nested when passed as an argument in e.g.{ param: { subParam1: 'value', subParam2: 'value' } }
- filter :
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.