Skip to content
New issue

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

Feedback for “Orders” #522

Closed
cjbarth opened this issue Sep 13, 2024 · 6 comments
Closed

Feedback for “Orders” #522

cjbarth opened this issue Sep 13, 2024 · 6 comments

Comments

@cjbarth
Copy link

cjbarth commented Sep 13, 2024

For the following API, the sample doesn't work. There is no quantity listed for the last product, so an error is generated.

image

@cjbarth
Copy link
Author

cjbarth commented Sep 13, 2024

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.

@cjbarth
Copy link
Author

cjbarth commented Sep 13, 2024

I also see in the documentation the following:

image

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?

@cjbarth
Copy link
Author

cjbarth commented Sep 13, 2024

Here is an example of one order where I set the quantity to 0:

image

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:
image

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.

@bc-traciporter
Copy link
Collaborator

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.

@donald-nguyen-bc
Copy link
Contributor

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.

@bc-traciporter
Copy link
Collaborator

@cjbarth Sorry we did not have better news for you. I will close this issue. Feel free to continue sending us your issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants