Need to pass UniqueID to Shopify to be included in purchase details

278 views
Skip to first unread message

Josh

unread,
Mar 3, 2012, 2:02:30 AM3/3/12
to shopi...@googlegroups.com
Hi,

I'm a new Shopify developer and I've got a website that is selling a product, but I need to associate a unique code to each purchase, basically it's their CustomerID from my website. This is how I'm going to tie the transaction from Shopify back to my system.  Is there a way to do this in the API, or is there an easier way I can pass this information along to Shopify (in the querystring or hidden POST variable) so it would come across in the Cart and also in the email that is generated?

Thanks in advance!
Josh

Soren Pedersen

unread,
Mar 3, 2012, 5:20:28 AM3/3/12
to shopi...@googlegroups.com
It is possible. However, you will have to make it a purely javascript based solution (all Shopify product pages are cached very aggressively and you cannot read query parameters through liquid).

So, read a query parameter (that is passed from your website) with javascript (http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript)

And then afterwards store the value in a custom text field variant on the product (http://wiki.shopify.com/The_shop-owner_guide_to_product_customization_in_Shopify)

You could also just add the customerId to the cart note (http://wiki.shopify.com/Ask_customer_for_additional_information)

John Duff

unread,
Mar 3, 2012, 9:25:24 AM3/3/12
to shopi...@googlegroups.com
Awesome reply, Soren!

Thanks for helping out on the list!

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages