Unable to create orders by using POST /admin/api/2022-07/orders.json

Topic summary

Problem: Creating an order via Admin REST POST /admin/api/2022-07/orders.json was returning 200 OK with a list of orders instead of 201 Created and the new order.

Key details:

  • Request used POST with JSON body (line_items, customer, financial_status) and correct headers (X‑Shopify‑Access‑Token, Content‑Type).
  • Docs and support suggested testing minimal payload and using tools like Postman or curl; provide x-request-id to support if needed.

Root cause discovered:

  • The request targeted a custom domain (e.g., https://myshop.com/admin/api/…).
  • Shopify responds with an HTTP 301 redirect to the store’s canonical https://.myshopify.com/admin/api/… URL.
  • The client (e.g., Postman) followed the 301 and converted the POST into a GET, yielding a 200 response with the orders list.

Solution:

  • Use the *.myshopify.com admin domain directly for POST requests, or detect/handle redirects properly (curl revealed the 301).

Outcome:

  • Confirmed fix; creating orders via POST works as expected with the myshopify.com URL.
  • Thread resolved; no further open questions.
Summarized with AI on January 24. AI used: gpt-5.

I also contacted support. But they haven’t told me a solution yet. It doesn’t make sense that the request responses with status 200. The documentation doesn’t mention anything about that.