I tried using the discount code lookup endpoint to get the location of discount code that already exists in my store but could not find the location header to get the response.
How are we supposed to get the header?
Hi, could you elaborate a little more what you mean by location header of a discount code?
Discount codes are bund to a price rule which you will find referenced in the discount code itself, along with the code itself and how often it was used. I don't see how location comes in to play here?
Ah I get you. That endpoint returns a 303 aka see other status. What that means is basically that if the discount code is found, the header contains a URI to the actual resource - if you're testing this via Postman or Insomnia, it's likely you're being redirected straight away to that resource hence you see a 200 and nada else.
Don't know about Postman, but Insomnia you will find the request timeline which will clearly show the initial 303 response which includes he location in the header.
Hope this helps!
this is kind of the same topic but a little different.
I need to get a price rule id. I need to look for a specific coupon and get the price rule id that it is based on.
how would you try to solve this issue?
Connect your PayPal account to allow your customers to checkout using the PayPal gateway a...By Ollie Jul 28, 2022