Unable to add an order through REST

Highlighted
New Member
7 0 0

I am trying to add an order through REST.  When I issue the REST command I get HTML back with a link, when clicked, sends me to a page asking me to "Choose an account".  I am trying to do this with Postman.  My username and password are correct.  What am I missing?

 

 

0 Likes
Highlighted
Excursionist
17 0 4

I assume you are already using the correct link with  the API key &  password provided in the admin panel.

The only other thing you need to make sure is deleting the cookies stored in Postman for the shop domain. If you created an API key, deleted it and created a new app then the new API key doesn't work with the stored cookies. 

0 Likes
Highlighted
New Member
7 0 0
Thanks for the reply. I deleted all the cookies and got the same results.

It is very perplexing, because I make another REST call to get all the
orders and that works fine.
0 Likes
Highlighted
Excursionist
17 0 4

I had this cookie problem with Postman which caused me to write a custom script when I first started testing the APIs. Later I found out that I had cookies saved under the domain name in Postman (thanks to this post I guess: https://community.shopify.com/c/Shopify-APIs-SDKs/SHOPIFY-API-POST-requests-do-not-work-with-POSTMAN...). So I was pretty sure it is same problem.

Just curious: Is it only the POST attempt which is failing but all the GET attempts work? 

0 Likes
Highlighted
New Member
7 0 0
The Get command returns:

he request could not be understood by the server due to malformed
syntax.##-

Please type your reply above this line -##
0 Likes
Highlighted
Excursionist
17 0 4

Just to make sure - you are sending POST request to add the order, right? 

0 Likes
Highlighted
New Member
7 0 0
Yes. I am sending with POST.
0 Likes
Highlighted
Shopify Partner
265 16 41

Hi @igreisman ,

 

Check out this post and see if the solution in there helps you. This is a topic that comes up frequently.

https://community.shopify.com/c/Shopify-APIs-SDKs/POST-admin-api-2020-01-orders-json-gt-return-200-l...

Regards,

Sam

Custom Apps and Themes Support | hello@achieveapplabs.com
0 Likes
Highlighted
New Member
7 0 0

Cookies were the first things I looked at, but that is not the problem.

I am first going to try and get the API call working in PHP, and then I am going back to Postman to dig in a little further.

From experience, I will bet that there is something I overlooked.

Thank you for the response.

0 Likes