Closed cjbarth closed 4 weeks ago
I would also like to add that not being able to remove a line item seems to be problematic for others, and has been promised for the v3 API, 7 years ago: https://support.bigcommerce.com/s/question/0D51B0000431LkfSAE/deleting-an-order-via-the-api?language=en_US.
Also, this doesn't work to remove an item if the minimum order quantity is set. Well, it doesn't work to remove an order line item no matter what, but it really doesn't do anything if there is a minimum order quantity: https://support.bigcommerce.com/s/question/0D54O00006IJ2LkSAL/updateremove-order-line-trough-the-api?language=en_US
How is it that I can click the -
button in the admin interface to remove a line item, but can't do it via the API. The documentation her said I can remove a line item.
I also see in the documentation the following:
However, if I run that and the subsequently call "List Order Products" I see the item there with a quantity of 0. That isn't removed. Is there a job that runs later and cleans that up?
Here is an example of one order where I set the quantity to 0:
This is the current JSON for that order:
[
{
"id": 3149,
"order_id": 789,
"product_id": 0,
"variant_id": 0,
"order_pickup_method_id": 0,
"order_address_id": 935,
"name": "TERMINAL BLOCK - 100844843",
"name_customer": "TERMINAL BLOCK - 100844843",
"name_merchant": "TERMINAL BLOCK - 100844843",
"sku": "",
"upc": "",
"type": "physical",
"base_price": "1.0000",
"price_ex_tax": "1.0000",
"price_inc_tax": "2.0000",
"price_tax": "1.0000",
"base_total": "2.0000",
"total_ex_tax": "2.0000",
"total_inc_tax": "4.0000",
"total_tax": "2.0000",
"weight": "0.0000",
"width": "0.0000",
"height": "0.0000",
"depth": "0.0000",
"quantity": 2,
"base_cost_price": "0.0000",
"cost_price_inc_tax": "0.0000",
"cost_price_ex_tax": "0.0000",
"cost_price_tax": "0.0000",
"is_refunded": false,
"quantity_refunded": 0,
"refund_amount": "0.0000",
"return_id": 0,
"wrapping_id": 0,
"wrapping_name": "",
"base_wrapping_cost": "0.0000",
"wrapping_cost_ex_tax": "0.0000",
"wrapping_cost_inc_tax": "0.0000",
"wrapping_cost_tax": "0.0000",
"wrapping_message": null,
"quantity_shipped": 0,
"event_name": null,
"event_date": null,
"fixed_shipping_cost": "0.0000",
"ebay_item_id": "",
"ebay_transaction_id": "",
"option_set_id": null,
"parent_order_product_id": null,
"is_bundled_product": false,
"bin_picking_number": "",
"external_id": null,
"fulfillment_source": "",
"brand": "",
"gift_certificate_id": null,
"applied_discounts": [],
"product_options": [],
"configurable_fields": [],
"discounted_total_inc_tax": "4.0000"
},
{
"id": 3150,
"order_id": 789,
"product_id": 1603,
"variant_id": 1599,
"order_pickup_method_id": 0,
"order_address_id": 935,
"name": "Item Test4.3 - ITEM_TEST4",
"name_customer": "Item Test4.3 - ITEM_TEST4",
"name_merchant": "Item Test4.3 - ITEM_TEST4",
"sku": "ITEM_TEST4",
"upc": "",
"type": "physical",
"base_price": "120.0000",
"price_ex_tax": "120.0000",
"price_inc_tax": "120.0000",
"price_tax": "0.0000",
"base_total": "0.0000",
"total_ex_tax": "0.0000",
"total_inc_tax": "0.0000",
"total_tax": "0.0000",
"weight": "2.0000",
"width": "1.0000",
"height": "1.0000",
"depth": "1.0000",
"quantity": 0,
"base_cost_price": "0.0000",
"cost_price_inc_tax": "0.0000",
"cost_price_ex_tax": "0.0000",
"cost_price_tax": "0.0000",
"is_refunded": false,
"quantity_refunded": 0,
"refund_amount": "0.0000",
"return_id": 0,
"wrapping_id": 0,
"wrapping_name": "",
"base_wrapping_cost": "0.0000",
"wrapping_cost_ex_tax": "0.0000",
"wrapping_cost_inc_tax": "0.0000",
"wrapping_cost_tax": "0.0000",
"wrapping_message": "",
"quantity_shipped": 0,
"event_name": null,
"event_date": null,
"fixed_shipping_cost": "0.0000",
"ebay_item_id": "",
"ebay_transaction_id": "",
"option_set_id": null,
"parent_order_product_id": null,
"is_bundled_product": false,
"bin_picking_number": "",
"external_id": "",
"fulfillment_source": "",
"brand": "",
"gift_certificate_id": null,
"applied_discounts": [],
"product_options": [],
"configurable_fields": [],
"discounted_total_inc_tax": "0.0000"
},
{
"id": 3156,
"order_id": 789,
"product_id": 1603,
"variant_id": 1599,
"order_pickup_method_id": 0,
"order_address_id": 935,
"name": "Item Test4.3 - ITEM_TEST4",
"name_customer": "Item Test4.3 - ITEM_TEST4",
"name_merchant": "Item Test4.3 - ITEM_TEST4",
"sku": "ITEM_TEST4",
"upc": "",
"type": "physical",
"base_price": "120.0000",
"price_ex_tax": "120.0000",
"price_inc_tax": "120.0000",
"price_tax": "0.0000",
"base_total": "360.0000",
"total_ex_tax": "360.0000",
"total_inc_tax": "360.0000",
"total_tax": "0.0000",
"weight": "2.0000",
"width": "1.0000",
"height": "1.0000",
"depth": "1.0000",
"quantity": 3,
"base_cost_price": "0.0000",
"cost_price_inc_tax": "0.0000",
"cost_price_ex_tax": "0.0000",
"cost_price_tax": "0.0000",
"is_refunded": false,
"quantity_refunded": 0,
"refund_amount": "0.0000",
"return_id": 0,
"wrapping_id": 0,
"wrapping_name": "",
"base_wrapping_cost": "0.0000",
"wrapping_cost_ex_tax": "0.0000",
"wrapping_cost_inc_tax": "0.0000",
"wrapping_cost_tax": "0.0000",
"wrapping_message": "",
"quantity_shipped": 0,
"event_name": null,
"event_date": null,
"fixed_shipping_cost": "0.0000",
"ebay_item_id": "",
"ebay_transaction_id": "",
"option_set_id": null,
"parent_order_product_id": null,
"is_bundled_product": false,
"bin_picking_number": "",
"external_id": "",
"fulfillment_source": "",
"brand": "",
"gift_certificate_id": null,
"applied_discounts": [],
"product_options": [],
"configurable_fields": [],
"discounted_total_inc_tax": "360.0000"
}
]
Now, if I delete an item via the UI, I get this:
With the following corresponding JSON:
[
{
"id": 3149,
"order_id": 789,
"product_id": 0,
"variant_id": 0,
"order_pickup_method_id": 0,
"order_address_id": 935,
"name": "TERMINAL BLOCK - 100844843",
"name_customer": "TERMINAL BLOCK - 100844843",
"name_merchant": "TERMINAL BLOCK - 100844843",
"sku": "",
"upc": "",
"type": "physical",
"base_price": "1.0000",
"price_ex_tax": "1.0000",
"price_inc_tax": "2.0000",
"price_tax": "1.0000",
"base_total": "2.0000",
"total_ex_tax": "2.0000",
"total_inc_tax": "4.0000",
"total_tax": "2.0000",
"weight": "0.0000",
"width": "0.0000",
"height": "0.0000",
"depth": "0.0000",
"quantity": 2,
"base_cost_price": "0.0000",
"cost_price_inc_tax": "0.0000",
"cost_price_ex_tax": "0.0000",
"cost_price_tax": "0.0000",
"is_refunded": false,
"quantity_refunded": 0,
"refund_amount": "0.0000",
"return_id": 0,
"wrapping_id": 0,
"wrapping_name": "",
"base_wrapping_cost": "0.0000",
"wrapping_cost_ex_tax": "0.0000",
"wrapping_cost_inc_tax": "0.0000",
"wrapping_cost_tax": "0.0000",
"wrapping_message": null,
"quantity_shipped": 0,
"event_name": null,
"event_date": null,
"fixed_shipping_cost": "0.0000",
"ebay_item_id": "",
"ebay_transaction_id": "",
"option_set_id": null,
"parent_order_product_id": null,
"is_bundled_product": false,
"bin_picking_number": "",
"external_id": null,
"fulfillment_source": "",
"brand": "",
"gift_certificate_id": null,
"applied_discounts": [],
"product_options": [],
"configurable_fields": [],
"discounted_total_inc_tax": "4.0000"
},
{
"id": 3150,
"order_id": 789,
"product_id": 1603,
"variant_id": 1599,
"order_pickup_method_id": 0,
"order_address_id": 935,
"name": "Item Test4.3 - ITEM_TEST4",
"name_customer": "Item Test4.3 - ITEM_TEST4",
"name_merchant": "Item Test4.3 - ITEM_TEST4",
"sku": "ITEM_TEST4",
"upc": "",
"type": "physical",
"base_price": "120.0000",
"price_ex_tax": "120.0000",
"price_inc_tax": "120.0000",
"price_tax": "0.0000",
"base_total": "0.0000",
"total_ex_tax": "0.0000",
"total_inc_tax": "0.0000",
"total_tax": "0.0000",
"weight": "2.0000",
"width": "1.0000",
"height": "1.0000",
"depth": "1.0000",
"quantity": 0,
"base_cost_price": "0.0000",
"cost_price_inc_tax": "0.0000",
"cost_price_ex_tax": "0.0000",
"cost_price_tax": "0.0000",
"is_refunded": false,
"quantity_refunded": 0,
"refund_amount": "0.0000",
"return_id": 0,
"wrapping_id": 0,
"wrapping_name": "",
"base_wrapping_cost": "0.0000",
"wrapping_cost_ex_tax": "0.0000",
"wrapping_cost_inc_tax": "0.0000",
"wrapping_cost_tax": "0.0000",
"wrapping_message": "",
"quantity_shipped": 0,
"event_name": null,
"event_date": null,
"fixed_shipping_cost": "0.0000",
"ebay_item_id": "",
"ebay_transaction_id": "",
"option_set_id": null,
"parent_order_product_id": null,
"is_bundled_product": false,
"bin_picking_number": "",
"external_id": "",
"fulfillment_source": "",
"brand": "",
"gift_certificate_id": null,
"applied_discounts": [],
"product_options": [],
"configurable_fields": [],
"discounted_total_inc_tax": "0.0000"
},
{
"id": 3156,
"order_id": 789,
"product_id": 1603,
"variant_id": 1599,
"order_pickup_method_id": 0,
"order_address_id": 935,
"name": "Item Test4.3 - ITEM_TEST4",
"name_customer": "Item Test4.3 - ITEM_TEST4",
"name_merchant": "Item Test4.3 - ITEM_TEST4",
"sku": "ITEM_TEST4",
"upc": "",
"type": "physical",
"base_price": "120.0000",
"price_ex_tax": "120.0000",
"price_inc_tax": "120.0000",
"price_tax": "0.0000",
"base_total": "360.0000",
"total_ex_tax": "360.0000",
"total_inc_tax": "360.0000",
"total_tax": "0.0000",
"weight": "2.0000",
"width": "1.0000",
"height": "1.0000",
"depth": "1.0000",
"quantity": 3,
"base_cost_price": "0.0000",
"cost_price_inc_tax": "0.0000",
"cost_price_ex_tax": "0.0000",
"cost_price_tax": "0.0000",
"is_refunded": false,
"quantity_refunded": 0,
"refund_amount": "0.0000",
"return_id": 0,
"wrapping_id": 0,
"wrapping_name": "",
"base_wrapping_cost": "0.0000",
"wrapping_cost_ex_tax": "0.0000",
"wrapping_cost_inc_tax": "0.0000",
"wrapping_cost_tax": "0.0000",
"wrapping_message": "",
"quantity_shipped": 0,
"event_name": null,
"event_date": null,
"fixed_shipping_cost": "0.0000",
"ebay_item_id": "",
"ebay_transaction_id": "",
"option_set_id": null,
"parent_order_product_id": null,
"is_bundled_product": false,
"bin_picking_number": "",
"external_id": "",
"fulfillment_source": "",
"brand": "",
"gift_certificate_id": null,
"applied_discounts": [],
"product_options": [],
"configurable_fields": [],
"discounted_total_inc_tax": "360.0000"
}
]
Which is not a mistake; they are identical. So clearly there is something going on here that the documentation isn't covering properly.
Hello @cjbarth Sorry for the delay. I created PR 551 to fix the mistake in the request example. I also asked someone from the Orders team to address how to remove a line item.
Unfortunately, that's the limitation of the API atm. It's not possible to "actually delete" a line item, so the suggested walk-around is to set the quantity to 0, which will have the same effect on the order's prices.
@cjbarth Sorry we did not have better news for you. I will close this issue. Feel free to continue sending us your issues.
For the following API, the sample doesn't work. There is no
quantity
listed for the last product, so an error is generated.