Creating an order through GraphQL for integration tests

Topic summary

Goal: Create Shopify orders in integration tests via GraphQL without relying on draft orders.

  • Original approach: Tests used the Admin GraphQL API to create draft orders, then converted them to regular orders to trigger app flows.
  • Change/issue: Shopify locked checkout on a development store due to this usage, and support indicated draft-order-based testing is no longer valid for that context.

Recent update from Shopify:

  • There is no direct GraphQL endpoint to create orders without draft orders. Draft orders remain the primary GraphQL method, but development store limitations still apply.
  • For testing, Shopify recommends using the REST API’s test order workflows and provides an official guide.

Implications:

  • No GraphQL-only solution currently exists to create orders bypassing draft orders.
  • Recommended workaround is to use REST API test order creation methods, especially for development stores where draft-order flows can trigger restrictions.

Status: Partially addressed; no GraphQL alternative offered. Testing guidance provided via REST API.

Summarized with AI on January 10. AI used: gpt-5.

Hi,

We have Shopify integration in our product (through private/custom app GraphQL API) and last year we wrote some integration tests which would create orders in our Shopify Partners account test store and test our code is working well with new Shopify orders. To trigger this entire flow in our tests we automatically (using GraphQL API) created draft orders and converted them to normal orders (this still is the suggested way by n1 result when googling “shopify graphql order creation” - https://community.shopify.com/topic/516388)
In the meantime something has changed on Shopify side and our checkout got locked because of using draft orders and we were told by Shopify support that that is not a valid way of testing this anymore. Now, I can’t find any other way to create orders through GraphQL but by creating draft orders first. So, is there a way to create order from GraphQL API without using draft orders?

1 Like

Did you ever arrive at a solution to this? I am in need of this functionality as well

Hey @ACDev , Draft orders is currently the best way to create orders through GraphQL although the limitation on development stores still exist. With that in mind, we have a great guide here on creating test orders through the REST API.

Hope that helps.

  • Kyle G.