Hi everyone,
I’m running into an issue while working with the carts/create webhook.
Here’s my setup:
-
I’m listening to the
carts/createwebhook, which gives me acart.idand acart.token. -
From there, I want to fetch the cart details along with customer data (email, id, etc.).
-
The problem: the webhook payload doesn’t include the
key, and when I try to fetch the cart info server-side, I can’t get the customer details.
If I fetch /cart.js client-side in the storefront, I can see the key and then use it to access more details, but this isn’t feasible for my use case since my code runs on the server (in my app).
What I’ve tried / explored:
-
Admin API: Doesn’t seem to expose carts (only checkouts/orders), so no customer data here.
-
Storefront API: I can query a cart using
cartIdandtoken, but I still can’t access customer data unless the cart was created with abuyerIdentity.customerAccessToken. -
I want to be able to fetch customer info for a cart as soon as it’s created, ideally from the webhook or via an API call.
Questions:
-
Is there any way to get the
cart key(or equivalent) on the server when handling the webhook? -
Can customer details be fetched reliably at the cart stage, or is it only possible at checkout/order?
-
Is the recommended approach to ensure carts are created with a
buyerIdentity.customerAccessTokenin the first place?
Any guidance would be appreciated ![]()
Thanks!