Discussing APIs and development related to customers, discounts, and order management.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hey, thanks for your time.
The problem is, I call the price rules api endpoint using POST method and it returns a list of all the existing prices rules instead of the price rule I just created. Basically, it's returning what would be the response for the GET method using that same endpoint, except, I'm using POST. Any help is appreciated, I'm quite pressed for time. Thanks.
I'm using POST method, my body:
Hi Admchrs1,,
This does seem unusual that your request is not being correctly processed as a POST request, but instead as a GET request. This could be due to a number of reasons. Here are some steps you can take to troubleshoot:
Check your Headers: Make sure you are setting the correct 'Content-Type' header to 'application/json'. This lets the server know that you're sending JSON data.
Check your Data format: Ensure that your request body is correctly formatted as JSON. You can use a tool like Postman to help with this.
Check your Access Token: Ensure that you have the necessary permissions to create a price rule. You mentioned the access scopes you have, make sure they are correct and have the necessary permissions
Try the above and let us know if you're still seeing issues. 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
Firstly, thank you so much for your response.
Secondly, unfortunately, I already did all the above x).
Here's the code:
Firstly, thank you so much for your response.
Secondly, unfortunately, I already did all the above x).
Here's the code:
(duplicate reply)
Hey Liam, any new ideas or solutions for this? Thanks
I'm getting the same issue.
Did you resolve that?
No, I tried so many things, but to no avail.
Completely ran out of ideas.
You should like the original post so that it brings attention to this ;).
@Liam do you have any new ideas for this issue?
Hi team,
I'm having the same issue, anyone was able to fix it ?
Thank you
For anyone facing the same issue, it turn out it only happen when we call the main domain but it doesn't happen when we call myshopify domain. so probably an bug on the redirection where the POST requests end up turning to a GET requests