Simulate taxes for the items in a cart together with freight, for a given destination country and state.
All input and output monetary values for this API are in the local currency (for example, BRL when country is BR).
curl -X POST 'https://product.api.e-cross.tech/ext/taxes' \
-H 'Authorization: Bearer YOUR_SALES_CHANNEL_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"items": [
{
"id": "029c31c8-6576-42fb-a846-5144d2efb3a4",
"skuId": "1",
"quantity": 1,
"unitPriceWithDiscount": 180.00
}
],
"freight": 50,
"country": "BR",
"state": "SP"
}'
{
"fxRate" : 5.51 ,
"items" : [
{
"id" : "029c31c8-6576-42fb-a846-5144d2efb3a4" ,
"skuId" : "1" ,
"cbsTaxValue" : 0 ,
"ibsETaxValue" : 0 ,
"ibsMTaxValue" : 0 ,
"icmsTaxValue" : 31.6 ,
"importTaxValue" : 0 ,
"totalTaxValue" : 31.6
}
],
"totals" : {
"cbsTaxValue" : 0 ,
"ibsETaxValue" : 0 ,
"ibsMTaxValue" : 0 ,
"icmsTaxValue" : 31.6 ,
"importTaxValue" : 0 ,
"totalTaxValue" : 31.6
}
}
How authentication works
This endpoint uses the sales channel token authentication model, not the auth token generated with merchant credentials.
The bearer token is provided by e-CROSS to the sales channel during the integration process.
Authorization: Bearer YOUR_SALES_CHANNEL_TOKEN
Bearer token for the sales channel request. Use the format Bearer YOUR_SALES_CHANNEL_TOKEN.
Request body
Line items to simulate taxes for together. Unique ID for this line; the same ID is returned in the response for that line.
SKU identifier on e-CROSS.
Unit price in local currency after discounts; the amount the customer pays per unit at checkout.
Freight value for the cart in local currency, without any shipping discount applied.
ISO 3166-1 alpha-2 destination country code (for example, BR).
Destination state or region code. For countries where taxes depend on state (for example, Brazil), use the correct two-letter state code (for example, SP).
Response fields
USD to BRL FX rate used by this API when calculating the response values.
One entry per request line, in the same order as requested. Line ID from the request.
CBS (Contribuição sobre Bens e Serviços) tax for this line, in local currency.
IBS-E (Imposto Estadual sobre Bens e Serviços) tax for this line, in local currency.
IBS-M (Imposto Municipal sobre Bens e Serviços) tax for this line, in local currency.
Total ICMS (or equivalent domestic sales tax) for this line, in local currency.
Total import tax for this line, in local currency.
Total tax for this line: icmsTaxValue + importTaxValue.
Aggregates for the whole request. Sum of CBS (Contribuição sobre Bens e Serviços) tax across all lines.
Sum of IBS-E (Imposto Estadual sobre Bens e Serviços) tax across all lines.
Sum of IBS-M (Imposto Municipal sobre Bens e Serviços) tax across all lines.
Sum of icmsTaxValue across all lines.
Sum of importTaxValue across all lines.
Sum of totalTaxValue across all lines (equivalently, totals.icmsTaxValue + totals.importTaxValue).
Errors
The request is missing the Authorization header, the bearer format is invalid, or the token is invalid.