checkout-sdk-js icon indicating copy to clipboard operation
checkout-sdk-js copied to clipboard

LineItemOption does not expose ID needed for POST order API call

Open daisy1754 opened this issue 6 years ago • 0 comments

Issue

CheckoutSDK provides LineItemOption that has name_id and value_id fields. Looks like it expose values from api/storefront/checkout/<id> endpoint.

When I try using these value_ids with v2 POST order API (use case - when submitOrder failed for some reason and cart is abandoned, we'd like to create an order from backend), API failed with "The options of one or more products are invalid." error.

api storefront checkout id screen shot 2018-11-18 at 10 11 50 am

It turns out, this value_id is different (?) than product_options.value we can use for v2 POST order API. If you inspect DOM in the product page, you see attribute index is 118 in screenshot below while value_id is 8. When I change value to 118, POST order API worked.

product_page postman 2018-11-18 10-25-47

Feature request

Can you update value_id to be same value that POST order API expect, or add another field?

daisy1754 avatar Nov 18 '18 18:11 daisy1754