How to get URL parameters of a order via API

How to get URL parameters of a order via API

miwelo
Tourist
10 0 7

Hello,

 

There is a platform sending me traffic very much like an affiliate network. Their users have a "subid" parameter in the URL that looks like this: "http://mysite.com?subid=12345"

 

Then I make an API call to fetch the order details but I don't get to find any field with this parameter. I saw some people fetching UTM parameters via GraphAPI calls but I think that's limited to source, medium and etc, not custom parameters like the one I need.

 

If somebody has the answer that'd be great.

Reply 1 (1)

Liam
Community Manager
3108 344 908

Hi Milwelo

 

Is the `?subid=12345` URL parameter added to your Shopify store URL, ie: www.mystorename.shopify.com/?subid=12345  

 

You may be able to get this via the `request` Liquid and then store it so it can be added to the order as a metafield. There's info on how to use the `request` object for this purpose here: https://community.shopify.com/c/shopify-discussions/how-to-get-full-current-custom-page-url-in-liqui...

 

Hope this helps! 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog