Developer changelog

Subscribe to the changelog to stay up to date on recent changes to Shopify’s APIs and other developer products, as well as preview upcoming features and beta releases.

Get updates by RSS

Cart Mutations return a new cart on FailedToRetrieveCart error


In order to make the Cart SFAPI experience more seamless, we're rolling out changes to Cart Update mutations so they return a new, valid Cart even if the provided token is no longer valid. If a Cart is found for the provided token, the mutations will work the way they always have. That way you get back a a valid, updated Cart in your response, no matter what.

These mutations will return a new, empty cart:

  • cartLinesRemove
  • cartLinesUpdate
  • cartSelectedDeliveryOptionsUpdate

The following mutations will update the new cart with the requested input:

  • cartAttributesUpdate
  • cartBuyerIdentityUpdate
  • cartDiscountCodesUpdate
  • cartLinesAdd
  • cartNoteUpdate

To take advantage of this, use the new Cart ID from the returned Cart when you receive the FailedToRetrieveCart error code in your response. Please note that the new cart is not a copy of the cart whose token was invalid.