We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm using WooCommerce 3.5.2 and the REST API v2. I have created an Order successfully with 2 line items:
"id": 3583, "line_items": [ { "id": 95, "meta_data": [], "name": "Happy Ninja", "price": 50, "product_id": 37, "quantity": 2, "sku": "", "subtotal": "100.00", "subtotal_tax": "10.00", "tax_class": "", "taxes": [ { "id": 1, "subtotal": "10", "total": "10" } ], "total": "100.00", "total_tax": "10.00", "variation_id": 0 }, { "id": 107, "meta_data": [], "name": "Calligraphy Set", "price": 89, "product_id": 1098, "quantity": 1, "sku": "", "subtotal": "89.00", "subtotal_tax": "8.90", "tax_class": "", "taxes": [ { "id": 1, "subtotal": "8.9", "total": "8.9" } ], "total": "89.00", "total_tax": "8.90", "variation_id": 0 } ],
I then do a PUT to /wp-json/wc/v2/orders/3583 with just one line item:
"id" : 3583, "line_items" : [ { "id" : "107", "name" : "Calligraphy Set", "product_id" : "1098", "quantity" : 1, "subtotal" : "89.00", "total" : "89.00", "variation_id" : "0" } ],
but it doesn't delete the 2nd line item (id 95) it simply adds an additional line item. I've tried updating the Order with no line items as well:
"id" : 3583, "line_items" : [],
but that doesn't remove the line items. I would have thought if I didn't pass in the ID it would remove the existing line items from the Order?
The text was updated successfully, but these errors were encountered:
To delete the second item add {"id":95,"quantity":0}.
{"id":95,"quantity":0}
Sorry, something went wrong.
This is likely because of your order status, you can't remove products from processing / completed orders. With pending orders this is possible.
No branches or pull requests
I'm using WooCommerce 3.5.2 and the REST API v2. I have created an Order successfully with 2 line items:
"id": 3583,
"line_items": [
{
"id": 95,
"meta_data": [],
"name": "Happy Ninja",
"price": 50,
"product_id": 37,
"quantity": 2,
"sku": "",
"subtotal": "100.00",
"subtotal_tax": "10.00",
"tax_class": "",
"taxes": [
{
"id": 1,
"subtotal": "10",
"total": "10"
}
],
"total": "100.00",
"total_tax": "10.00",
"variation_id": 0
},
{
"id": 107,
"meta_data": [],
"name": "Calligraphy Set",
"price": 89,
"product_id": 1098,
"quantity": 1,
"sku": "",
"subtotal": "89.00",
"subtotal_tax": "8.90",
"tax_class": "",
"taxes": [
{
"id": 1,
"subtotal": "8.9",
"total": "8.9"
}
],
"total": "89.00",
"total_tax": "8.90",
"variation_id": 0
}
],
I then do a PUT to /wp-json/wc/v2/orders/3583 with just one line item:
"id" : 3583,
"line_items" :
[
{
"id" : "107",
"name" : "Calligraphy Set",
"product_id" : "1098",
"quantity" : 1,
"subtotal" : "89.00",
"total" : "89.00",
"variation_id" : "0"
}
],
but it doesn't delete the 2nd line item (id 95) it simply adds an additional line item. I've tried updating the Order with no line items as well:
"id" : 3583,
"line_items" : [],
but that doesn't remove the line items. I would have thought if I didn't pass in the ID it would remove the existing line items from the Order?
The text was updated successfully, but these errors were encountered: