Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
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: `
`
Hey @abaturytski
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.
E.g. Webhook:
"token": "c1-c6872150bf4341c375fac549298124b5"
SFAPI Cart ID:
gid://shopify/Cart/c1-c6872150bf4341c375fac549298124b5
Scott | Developer Advocate @ Shopify
Hi SBD_,
What about these formats:
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.
Thoughts?