# question

asked Frank Faustino Deactivated

## Tax calculation,delivery fees and Order total

Hello,

I'm having a problem with taxes. Basically I'm creating an Order with the REST API as follows:

• Product A : 11.95\$
• Product B : 11.95\$
• Product C : 11.95\$
• Product D : 11.95\$
• Delivery fee as a service charge: 2.5\$

Subtotal is 47.80\$ as expected and the total is 50.30\$

If I add a VAT tax fee to all of the 4 products that has a 21% value, the subtotal would remain the same but the total becomes 58.60\$

I'm not sure how this calculation is done, shouldn't the total remain the same ? since we're only providing information about the tax ?

When I set the taxes, I still have the correct values for EX-VAT, TAX and INC VAT which are respectively 39.50\$, 8.30\$ and 47.80\$ so I'm not sure what's the problem with the order total

Your help would be very much appreciated

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

·
Which orders endpoint are you using? Can you please include the request body in JSON?

1 Like 1 ·
·

I'm using the atomic order creation endpoint:

`merchants/mId/atomic_order/orders`

With the following json in request body:

{
"orderCart" : {
"currency" : "EUR" ,
"note" : "" ,
"discounts" : [
{
"name" : "Discount" ,
"amount" : 0
}
],
"lineItems" : [
{
"name" : "Duck Gyoza Rice Box" ,
"price" : 1195 ,
"note" : null ,
"item" : {
"id" : "DMR25AVBS5DTA"
},
"modifications" : []
},
{
"name" : "Duck Gyoza Rice Box" ,
"price" : 1195 ,
"note" : null ,
"item" : {
"id" : "DMR25AVBS5DTA"
},
"modifications" : []
},
{
"name" : "Duck Gyoza Rice Box" ,
"price" : 1195 ,
"note" : null ,
"item" : {
"id" : "DMR25AVBS5DTA"
},
"modifications" : []
},
{
"name" : "Duck Gyoza Rice Box" ,
"price" : 1195 ,
"note" : null ,
"item" : {
"id" : "DMR25AVBS5DTA"
},
"modifications" : []
}
],
"merchant" : {
"id" : "5SQ3YTZ1SZH71"
},
"orderType" : {
"id" : "6A6VPFS8S3G0M" ,
"taxable" : true
}
}
}
0 Likes 0 ·
attoucheaziz ·

Thank you for providing the additional details.

I tested a similar order flow (create atomic order, apply service charge) on the EU production environment and got the following result (see below). Is this what you were expecting?

I'm not quite sure if the order total updating with the tax amount is intended or not but the Sandbox environment may not behave the same way as it's usually behind a patch or two.

0 Likes 0 ·