question

Cristhiam avatar image
Cristhiam asked richardprieto published

How to add taxes (globally) using SDK?

Hi everyone,
My app should create taxes of my country. But I don't have find how to create taxes programmatically.
Using SDK V3.
Clover Android SDKTaxes
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
richardprieto avatar image
richardprieto answered richardprieto published

@ Hello,

To add taxes programmatically using the Clover SDK V3, you can follow these steps:

Connect to the Clover device: Establish a connection to the Clover device using the Clover Connector provided by the SDK. This will allow you to communicate with the device and perform various actions.

Create a TaxRate object: Use the Clover SDK to create a TaxRate object that represents the tax rate you want to add. The TaxRate object should include information such as the tax name, tax percentage, and any additional properties required by your country's tax regulations.

Here's an example of creating a TaxRate object in C#:

csharp
var taxRate = new com.clover.sdk.v3.taxes.TaxRate();
taxRate.setName("Sales Tax");
taxRate.setRate(8.5); // Set the tax rate percentage
// Set any other properties required by your country's tax regulations
// For example: taxRate.setIsDefault(true); to set it as the default tax rate

// You can set other properties of the tax rate as needed
// taxRate.setIsDeleted(false);
// taxRate.setIsSystem(false);
// ...

// Optionally, associate the tax rate with specific tax categories or items
// taxRate.setCategories(Arrays.asList("Category1", "Category2"));
// taxRate.setItems(Arrays.asList("Item1", "Item2"));

Add the tax rate to the Clover device: Use the Clover Connector to add the tax rate to the Clover device. This will make the tax rate available for use in transactions.

csharp
// Assuming you have an instance of CloverConnector named cloverConnector
cloverConnector.addTaxRate(taxRate);

This will send the tax rate information to the connected Clover device, and it will be stored on the device.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community