Hi, does anyone have an idea about how Shopify encodes discount codes in URLs?
I’m trying to apply a discount through my app by sending a request to the discount URL. However, this approach fails when the discount code contains special characters like “%”
For example,
shopify encodes ‘test%10’ in the URL as: teststore.myshopify.com/discount/test%252510
‘test%10’ gets encoded as ‘test%2510’
‘test%2510’ gets encoded as ‘test%252510’
It seems like Shopify is double encoding the discount code. Is this intentional?
I think you misunderstood me. I am not creating discounts; I am only applying the discounts created by merchants through my app. Sometimes, the discount codes contain special characters like %, and I can’t ask them to avoid using such codes since they work fine on the checkout page. I want to know how Shopify encodes them so that I can do the same.