Development store.
POST https://myshop.com/admin/api/2019-07/orders.json
{ "order": { "line_items": [ { "title": "Big Brown Bear Boots", "price": 74.99, "grams": "1300", "quantity": 3, "tax_lines": [ { "price": 13.5, "rate": 0.06, "title": "State tax" } ] } ], "transactions": [ { "kind": "sale", "status": "success", "amount": 238.47 } ], "total_tax": 13.5, "currency": "EUR" } }
Answer is this(Using postman):
<html> <body> <noscript> <a href="https://app.shopify.com/services/login/iSOMESTUFFTHATICOMMENTEDOUTMAYBEITSDELICATE">Continue</a> </noscript> <script type="text/javascript"> window.location = "https:\/\/app.shopify.com\/services\/login\/identity?destinationSOMESTUFFTHATICOMMENTEDOUTMAYBEITSDELICATE"; </script> </body> </html>
Updating a existing order works well.
Hello martabel,
You want to create simple product?
or you have product variant?
Hey I want to create a order so It would end up here myurl.com/admin/orders
Hello martabel,
You have to add product variant_id to create an order.
e.g:
"line_items": [ { "variant_id": 457924702, "quantity": 1 } ]
Same problem @oscprofessional
I requested my last orders https://xxx.myshopify.com/admin/api/2019-07/orders.json
And tried with the variant id-s i found there. But I am getting the same response. Does It work for you?
Hello martabel,
Yes, this works for me.
Same problem, I can retrieve the orders fine, but if I do a POST to the same endpoint, I get that HTML reply @martabel described.
It looks like a login url, but if I follow it, it gives an error.
Is any specific header needed to get the expected 201 Created response?
Nevermind: Shopify rejects all POST using Basic Auth if they contain cookies. Postman alwasy sends (hidden) cookies.
(https://shopify.dev/tutorials/authenticate-a-private-app-with-shopify-admin#make-authenticated-reque...)
Changed to authentication with Shopify access token and it worked.
User | Count |
---|---|
16 | |
12 | |
7 | |
5 | |
4 |