checkout-sdk-js
checkout-sdk-js copied to clipboard
LineItemOption does not expose ID needed for POST order API call
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.
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.
Feature request
Can you update value_id
to be same value that POST order API expect, or add another field?