I’m adding the below attribute to the cart on page load
fetch('/cart/update.js', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ attributes: {test:"testvalue"} })
})
and I added a webhook in Settings → Notification → Webhook with carts/create and checkouts/create but the problem is the carts/create webhook doesn’t have this “test” attribute.
When I checked the /cart.js it’s there and I can see it in the incoming checkouts/create webhook data
Any ideas?
For api feature requests, or possible bug reports, use the developer forum https://community.shopify.dev waaaay better experience for devs right now
Notes for future searchers a lot of posts about cart/create, carts/update ,checkouts/create etc behaviors have been lost to time and forum migrations.
Do not expect parity or consistency between shopify’s apis , especially between frontend and backend


█▬▬
e.g. https://www.google.com/search?q=community+shopify+dev+webhook+missing __X
e.g. https://community.shopify.com/t/webhook-payloads-are-not-sufficiently-documented/406065
Attributes, ~CustomAttributes, are not listed in the docs https://shopify.dev/docs/api/webhooks/latest?reference=toml&accordionItem=webhooks-carts-create#list-of-topics-carts/create
So do not plan on it being added in any near term if ever.
In the here and now developers need to:
- stuff the info into the cart note (flaky and harder UX, more relevant for ERP situations[1])
- stuff the info into product line item properties
- and or a literal product to the cart that is a special “info” item
- (items can be nested now, and there is a removable property that may nor may not be useable somehow??)
Or fire off to your own webhook from the visitors browser and reconcile the two with some broad risky/flakey assumptions about session matching especially if it’s not a logged in customer.
[1] note to self I could have sworn I had a reply on the .dev forums about these approaches but can’t find it.