Orders API responding with login screen

Michel_Jung
New Member
1 0 0

Hi there,

Pretty sure I'm doing something wrong, but I'm unable to figure out what. I'm using the Postman collection (THANK YOU, CREATOR!) and I also consulted the API docs, ending up with this URL:

https://{{apikey}}:{{password}}@{{yourstore}}.myshopify.com/admin/orders.json

I set the environment variables correctly (triple-checked), I tried the example URL that is generated in the Admin panel, I checked the permissions (read/write for orders) and I even tried using postman's Basic Auth instead of having the credentials in the URL. And I use this body (from the example):

{
  "order": {
    "line_items": [
      {
        "variant_id": 33214924878,
        "quantity": 1
      }
    ],
    "customer": {
      "id": 3989659651
    },
    "financial_status": "pending"
  }
}

Yet, the response I'm getting is the HTML code of the login page. I can't see anything that I'm doing wrong (and this isn't the first time I'm using an API) so I'm close to saying the API doesn't work. Can you spot any mistake? Did I forget do enable something somewhere? But then again, what API responds with a login page?

Thanks in advance

0 Likes
Josh
Shopify Staff
Shopify Staff
1130 82 191

Hey Michel, 

As of 7 months or so ago, Shopify no longer accepts Basic Auth POST requests that include cookies. All hope is not lost though, I'm pretty sure Postman just includes them by default. If you're using their browser extension, try out their native desktop client instead - that should help (I don't use it myself admittedly). 

 

Mr_Marcia_Ong
New Member
1 0 0

Thanks for mentioning it. To those that are doing R&D for integration, do take note of this!!
PSA If you're doing a PUT/POST request call, remember to clear your Postman cookies!

0 Likes