OrderCentral calculates VAT based upon the country of the shipment address and the corresponding VAT Rule. If this is not per your requirements there is the option to write you own logic to calculate VAT. This article describes how to do this.
All referenced class names are within the welisacommerce namespace
- Create a new Apex class and have it implement the ITaxCalculator interface
- Implement your logic and return an instance of TaxCalculationResponse (all properties are required
- Register your class within the OrderCentral plugin registrations
- Setup -> Custom Metadata Types -> Plugin Registrations -> New
- In the Plugin field select pluging with name ITaxCalculator
- Save
TaxCalculationRequest
TaxCalculationResponse
Property Name |
Type |
totalTaxAmount |
Decimal |
shippingTaxAmount |
Decimal |
productTaxDetails |
List<ProductTaxDetail> |
AccountDetail
ShippingDetail
OrderProductDetail
Property Name |
Type |
productCode |
String |
quantity |
Decimal |
totalAmount |
Decimal |
AddressDetail
Property Name |
Type |
city |
String |
country |
String |
postalCode |
String |
state |
String |
street |
String |
DeliveryMethod
Property Name |
Type |
name |
String |
price |
Double |
CustomFields
| Method Name | Argument | Return Value |
| --- | --- |
| getValue | fieldApiName (String) | object |
ProductTaxDetail
Property Name |
Type |
productCode |
String |
taxAmount |
Decimal |