We have a webhook listening for `carts/create` and `carts/update` events, which come with `id` and `token` fields; we store these carts locally. Our web app uses StoreFront API for creating carts, which come back with global ids that look like this: `
gid://shopify/Cart/c1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`. I am looking for a way of finding a cart we receive from webhooks knowing the global ID of the cart we created with StoreFront API. Is this doable?
PS. Trying to use the `xxx...` part of the Gid produced no results, with or without the `c-` prefix.
You're on the right path - you can use the token to create a global ID. Keep in mind liquid carts and SFAPI carts aren't interoperable right now, but should be very soon. Let me know if I'm misunderstanding your query.
I have both formats come through webhooks and I am able to work with the cart object when the id/token is in the format: c1-cbdb4c4178dafdb65ad2fb3. However when the c1- is not in the id/token I am not able to use the Storefront API because a NULL is returned for the cart object.
I am testing on multiple environments: a partners development site, a shopify plus development site and a shopify plus production site. The partners development site and a shopify plus production site return a cart id/token with the prefix c1- where as the shopify plus development site does not have the c1- prefex.