I am posting following data on rest api url “https://example.com/wp-json/wc/v3/orders”
{
“payment_method”: “cod”,
“payment_method_title”: “Cash on delivery”,
“set_paid”: true,
“customer_id”: 1200584,
“customer_note”: “Some of my notes”,
“billing”: {
“first_name”: “Example”,
“last_name”: “Developer”,
“address_1”: “Example address”,
“address_2”: “Delhi2”,
“city”: “Delhi”,
“state”: “Delhi”,
“postcode”: “110020”,
“country”: “IN”,
“email”: “[email protected]”,
“phone”: “9876543210”
},
“shipping”: {
“first_name”: “Example”,
“last_name”: “Developer”,
“address_1”: “Example address”,
“address_2”: “Delhi2”,
“city”: “Delhi”,
“state”: “Delhi”,
“postcode”: “110020”,
“country”: “IN”,
“email”: “[email protected]”,
“phone”: “9876543210”
},
“line_items”: [
{
“product_id”: “849660”,
“quantity”: 1,
“taxes”: [
{
“rate_code”: “IN-DL-CGST-1”,
“rate_id”: “9193”,
“label”: “CGST”,
“compound”: false,
“tax_total”: “0”,
“rate_percent”: “0%”
},
{
“rate_code”: “IN-DL-SGST-2”,
“rate_id”: “9229”,
“label”: “SGST”,
“compound”: false,
“tax_total”: “0”,
“rate_percent”: “0%”
},
{
“rate_code”: “IN-DL-IGST-3”,
“rate_id”: “9265”,
“label”: “IGST”,
“compound”: false,
“tax_total”: “38.095238”,
“rate_percent”: “5%”
}
]
}
],
“shipping_lines”: [
{
“method_id”: “flat_rate”,
“method_title”: “Flat Rate”,
“total”: “60.00”
}
],
“fee_lines”: [
{
“name”: “COD Charges”,
“total”: “30.00”
}
]
}
But the order is being created withiut taxes.
Any one can help?
The order should be created with cgst, stgs and igst included in line data.
Md Nazrul Islam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.