How To Add An Additional Value To A Shopify Checkout URL?

- 1 answer

My client's live Shopify setup has a feature where a URL goes to a sort of "quick checkout" that allows a customer to quickly purchase a single item. The way it works is, you first visit a URL like this:

and then you are immediately redirected to a URL like this:

And then on that second URL you can fill out the checkout form to purchase a single item that is displayed there. Notice that the two URLs use a different domain name. The x's are numbers, the y is a number. The a's are numbers and the b's are hexadecimal digits(0-9, a-f).

Is this a common/documented URL flow for a Shopify single item checkout setup?

What I need to do is add a value to the first URL so that it carries through to the second URL, eg:

And then if the second URL has the extra value I need to do something extra in the code.



Shopify has some information on how to do this here:

To summarize, you can add a cart note and an arbitrary number of cart attributes to your link as query parameters to the end of your direct-buy link.

The structure of such a URL is thus:


I just confirmed that this does indeed work by placing a test order this way on my dev store - if you're still having any trouble, let me know and we can dig deeper.