Get CartID with GraphQL Storefront API 'null'

I’m trying to target the cart id with graphql, but I keep getting Data: { cart: null}. I’m doing the tests with the token it comes with in the json.

Screen Shot 2022-04-08 at 11.20.18 AM.png

Then I modify it with base64 gid://shopify/Cart/“token”. Is that the token that should be used or how could I extract the cartId with the frontstore API within a Shopify theme?

6 Likes

I’m having the same issue following the same steps, so this is replicable. I even included credentials (i.e. cookies) with the Storefront API graphql request from the same domain origin, and same result. No error, just a null cart.

Did you find a workaround? I’ll be looking into this more over the next couple of days and will reply if I find out anything else.

Hey. Any solution you have got yet. I am also trying same but not working in my end as well.

I’m also encountering this. Any solutions welcome!

@sushilsth21 @MSuki93 I contacted the support team a while back, and apparently the Storefront API and the standard cookie-based cart API are not interoperable. As it stands now, a cart created on one cannot be accessed by the other. Kind of a bummer, but maybe they’ll add support in the future if it’s requested enough.

3 Likes

Hi @chaffinated Is this same case for checkout as well? I tried using “checkoutDiscountCodeApplyV2” mutation and always endup getting “Checkout does not exist”.

1 Like