Site icon Hip-Hop Website Design and Development

Tax being added on tax inclusive merchandise React Native & Woocommerce API

I’ve completed constructing a React Native ecommerce app for my wordpress web site. The app is accomplished. I’m solely having situation with order merchandise taxes. The costs for merchandise on the web site embrace tax, so when a buyer orders a product with the value of $10 AUD, tax is included in it.

The merchandise which might be displayed on the cell app aren’t saved in woocommerce however slightly in a mongoDB database. So, after I make an order on the web site utilizing the WC-API, a ten% tax is added on prime of the merchandise value. Listed below are some screenshots for reference:

Right here is the JSON I’m 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": "kamrul@firebrandbbq.com.au",
    "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 inform Woocommerce API that the product within the line objects array, the entire value already consists of tax so the merchandise value is not greater than listed?