Reputation: 3
I have finished building a React Native ecommerce app for my wordpress website. The app is completed. I am only having issue with order item taxes. The prices for products on the website include tax, so when a customer orders a product with the price of $10 AUD, tax is included in it.
The products that are displayed on the mobile app are not saved in woocommerce but rather in a mongoDB database. So, when I make an order on the website using the WC-API, a 10% tax is added on top of the item price. Here are some screenshots for reference:
Here is the JSON I am sending to the api:
Object {
"billing": Object {
"address_1": xx",
"address_2": "",
"city": "Arndell Park",
"country": "AU",
"email": "xx",
"first_name": "xx",
"last_name": "x",
"phone": "+xx",
"postcode": "x",
"state": "x",
},
"currency": "AUD",
"currency_symbol": "$",
"customer_id": 30043,
"customer_note": "",
"line_items": Array [
Object {
"__v": 0,
"_id": "613045905291cccac594dc68",
"cardId": "61303af6397497e57935c979",
"description": "",
"image": "https://firebrandbbq.com.au/wp-content/uploads/2021/07/lanes-pepper-1.jpg",
"images": Array [
Object {
"_id": "613045905291cccac594dc69",
"alt": "",
"date_created": "2021-07-21T01:50:32",
"date_created_gmt": "2021-07-20T05:50:32",
"date_modified": "2021-08-20T00:49:39",
"date_modified_gmt": "2021-08-19T04:49:39",
"id": 84060,
"name": "lanes-pepper-1",
"src": "https://firebrandbbq.com.au/wp-content/uploads/2021/07/lanes-pepper-1.jpg",
},
],
"instock": 11,
"name": "Lanes BBQ BLACK PEPPER (16 Mesh) Seasoning 226g",
"price": 9.99,
"quantity": 1,
"shortDesc": "Use the same ingredients that’s in all the Lane’s BBQ rubs, just in bulk! For the purest out there. This big bold large grain black pepper will add more flavor than the finely ground black pepper in your little bird-shaped shaker. This 16 mesh black pepper will go perfectly on steaks before they hit the grill, chicken, pasta, really it adds a strong flavor to all cuts of meat. Part of the Lanes Specialty range of seasonings. Shaker Jar: 226g ",
"sku": "app-LRSPPEP",
"total": "8.991",
"was": 14.95,
"weight": 0.22,
},
],
"payment_method_title": "Credit Card",
"set_paid": true,
"shipping": Object {
"address_1": "",
"address_2": "",
"city": "",
"company": "",
"country": "AU",
"email": "[email protected]",
"first_name": "Kamrul",
"last_name": "Islam",
"phone": "+61424575514",
"postcode": "",
"state": "",
},
"shipping_lines": Array [
Object {
"method_id": "NSW click and collect",
"method_title": "Click and Collect",
"total": "0",
},
],
"status": "processing",
"transaction_id": "null",
}
How do I tell Woocommerce API that the product in the line items array, the total price already includes tax so the item price isn't more than listed?
Upvotes: 0
Views: 318
Reputation: 238
If you're adding an order with the WooCommerce REST API, you can set prices_include_tax
to true
.
Upvotes: 0