Tax
Tax rates to be applied to an invoice.
Examples
Create Tax
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
Tax tax = Tax.create(new PaymentsMap()
.set("label", "City")
.set("rate", "5.806")
);
System.out.println(tax);
require 'simplify'
Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"
tax = Simplify::Tax.create({
"rate" => "5.806",
"label" => "City"
})
puts tax.inspect
import simplify
simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"
tax = simplify.Tax.create({
"rate" : "5.806",
"label" : "City"
})
print(tax)
<?php
require_once("./lib/Simplify.php");
Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
$tax = Simplify_Tax::createTax(array(
'rate' => '5.806',
'label' => 'City'
));
print_r($tax);
?>
use Net::Simplify;
$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
my $tax = Net::Simplify::Tax->create({
rate => "5.806",
label => "City"
});
print "Tax ID ", $tax->{id}, "\n";
using SimplifyCommerce.Payments;
PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
PaymentsApi api = new PaymentsApi();
Tax tax = new Tax();
tax.Label = "City";
tax.Rate = "5.806";
try
{
tax = (Tax)api.Create(tax);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
var Simplify = require("simplify-commerce"),
client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.tax.create({
rate : "5.806",
label : "City"
}, function(errData, data){
if(errData){
console.error("Error Message: " + errData.data.error.message);
// handle the error
return;
}
console.log("Success Response: " + JSON.stringify(data));
});
INPUT PARAMETERS
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
OUTPUT
id
Unique id of the tax object.
label
The label of the tax object.
rate
The tax rate. Decimal value up three decimal places. e.g 12.501.
Examples
Delete Tax
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
Tax tax = Tax.find("4TR6Bc");
tax = tax.delete();
System.out.println(tax);
require 'simplify'
Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"
tax = Simplify::Tax.find('4TR6Bc')
tax = tax.delete()
puts tax.inspect
import simplify
simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"
tax = simplify.Tax.find('4TR6Bc')
tax.delete()
<?php
require_once("./lib/Simplify.php");
Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
$obj = Simplify_Tax::findTax('4TR6Bc');
$obj = $obj->deleteTax();
?>
use Net::Simplify;
$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
$tax = Net::Simplify::Tax->find('4TR6Bc');
$tax->delete();
using SimplifyCommerce.Payments;
PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
PaymentsApi api = new PaymentsApi();
try
{
String id = "1234";
Tax tax = (Tax)api.Find(typeof(Tax), id);
tax = (Tax)api.Delete(typeof(Tax), tax.Id);
Console.WriteLine (tax.Id);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
var Simplify = require("simplify-commerce"),
client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.tax.delete("4TR6Bc", function(errData, data){
if(errData){
console.error("Error Message: " + errData.data.error.message);
// handle the error
return;
}
console.log("Success Response: " + JSON.stringify(data));
});
INPUT PARAMETERS
id
Object ID.
required
OUTPUT
id
Unique id of the tax object.
label
The label of the tax object.
rate
The tax rate. Decimal value up three decimal places. e.g 12.501.
Examples
List Tax
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
ResourceList<Tax> tax = Tax.list(new PaymentsMap("max", 30));
System.out.println ("Total: " + tax.getTotal());
for (Tax o: tax.getList()) {
System.out.println(o.toString());
}
require 'simplify'
Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"
val = Simplify::Tax.list({"max" => 30})
puts "Total: #{val['total']}"
val['list'].each do |o|
puts o.inspect
end
import simplify
simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"
taxs = simplify.Tax.list({"max": 30})
print "Total: " + str(taxs.total)
for o in taxs.list:
print(o)
<?php
require_once("./lib/Simplify.php");
Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
$tax = Simplify_Tax::listTax(array("max" => 30));
print "Total: " . $tax->total . "\n";
foreach ($tax->list as $o) {
print_r($o);
}
?>
use Net::Simplify;
$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
$taxs = Net::Simplify::Tax->list({max => 30});
print "Total: ", $taxs->total, "\n";
foreach my $tax ($taxs->list) {
print $tax->{id}, "\n";
}
using SimplifyCommerce.Payments;
PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
PaymentsApi api = new PaymentsApi();
try
{
ResourceList<Tax> tax = (ResourceList<Tax>)api.List(typeof(Tax));
Console.WriteLine ("Total: " + tax.Total);
Console.WriteLine ("List: " + tax.List.ToString());
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
var Simplify = require("simplify-commerce"),
client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.tax.list({max: 30}, function(errData, data){
if(errData){
console.error("Error Message: " + errData.data.error.message);
// handle the error
return;
}
console.log("Total: " + data.total);
for(var i=0; i < data.list.length; i++){
console.log("Amount: " + data.list[i].amount);
}
});
INPUT PARAMETERS
filter
optional
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:
optional
20
]
offset
Used in paging of the list. This is the start offset of the page.
[min value: 0, default:
optional
0
]
sorting
Allows for ascending or descending sorting of the list.
The value is a map between the property name and the sorting direction (either 'asc' for ascending or 'desc' for descending). Sortable properties are:
id
, label
optional
OUTPUT
filter
Filters to apply to the list.
list
Object list
max
Allows up to a max of 50 list items to return.
offset
Used in paging of the list. This is the start offset of the page.
sorting
Allows for ascending or descending sorting of the list.
total
Total number of records available
Examples
Find Tax
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
Tax tax = Tax.find("4TR6Bc");
System.out.println (tax);
require 'simplify'
Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"
tax = Simplify::Tax.find('4TR6Bc')
puts tax.inspect
import simplify
simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"
tax = simplify.Tax.find('4TR6Bc')
print(tax)
<?php
require_once("./lib/Simplify.php");
Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
$obj = Simplify_Tax::findTax('4TR6Bc');
print_r($obj);
?>
use Net::Simplify;
$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
$tax = Net::Simplify::Tax->find('4TR6Bc');
print $tax->{id}, "\n";
using SimplifyCommerce.Payments;
using Newtonsoft.Json;
PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
PaymentsApi api = new PaymentsApi();
try
{
String id = "1234";
Tax tax = (Tax)api.Find(typeof(Tax), id);
// output all properties
Console.WriteLine(JsonConvert.SerializeObject(tax).ToString());
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
var Simplify = require("simplify-commerce"),
client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.tax.find("4TR6Bc", function(errData, data){
if(errData){
console.error("Error Message: " + errData.data.error.message);
// handle the error
return;
}
console.log("Success Response: " + JSON.stringify(data));
});
INPUT PARAMETERS
id
Object ID.
required
OUTPUT
id
Unique id of the tax object.
label
The label of the tax object.
rate
The tax rate. Decimal value up three decimal places. e.g 12.501.