Cart Warnings in Storefront API Cart
API
Effective October 01, 2024
Action required
As of API version 2024-10, inventory errors about stock levels will no longer be included in the userErrors
of cart mutations. Inventory errors will now be available in a new return field, warnings
and will contain explicit code
values of MERCHANDISE_NOT_ENOUGH_STOCK
or MERCHANDISE_OUT_OF_STOCK
.
Warnings will be available on all cart mutations to show automatic changes that occurred during the mutation. You can use warnings to manage items in your cart or display information to a buyer. For example, out of stock lines can be easily removed from a cart by using the target
field included in the warning as the input to a call to CartLineRemove
.
Learn more about cart warnings on Shopify.dev.