Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
Is there a way to modify the attributes of an order on its Thank you page ? We can add liquid and JS on this page but I didn't see any way of doing it, the AJAX API allows to edit the cart attributes, but it's not usable anymore once the order is placed.
In last resort I will probably create a GCP Cloud Function that will call the Admin API when I AJAX something to it, but I would like to use a more native Shopify way if there is one.
No. By the time you are on the Thankyou page the order has been created so you’d be left with API options.
Why can’t the attribute be added before checkout? Knowing a bit of context into why you need it could reveal other approaches.
This is an unusual demand but the circumstances are unusual as well. We're actually setting the cart attributes before the checkout, but we're using the Mondial Relay official app, which happens to dynamically set its own order attributes after it's placed (the customer has to chose the relay point on the Thank You page with their script). The only problem being that when they update the order's attributes, they erase all the previous attributes set, which is a terrible behavior. Their customer support say that it's because they can't afford to make one more API call to retrieve existing attributes because of their huge clients and the API rate limit, but I'm sure there would be many other ways for them not to break this system.
So I basically need a way to set back the attributes they remove after the client chose their relay point.
(Btw, is there a way to report this kind of practice to Shopify market place ? This behavior is obviously not mentioned in their documentation)
I'd be questioning or at least challenging on the API call rate. Get the view on how many calls they actually need today. Even if on the smaller plan giving 2 calls per second that's still quite a lot for a lot of merchants when it comes to the amount of orders being created and updating a property afterwards. You might find it's not really a problem at all to make a call to get latest data set.
There's also the option of storing the attribute current externally if there was a super strong desire to avoid an API call. So order is created with attributes in place, that info can flow to a DB via webhook, and you pull the data from that db instead of making an request to get it.
Are attributes the right place for this to live? Perhaps you might get them as attributes to start with but for the final choice perhaps you update a metafield instead. It's an API call either way.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025