Solved

Admin Graphql Creating Orders

gilg
Shopify Partner
31 6 6

I've been working on a tool to create orders via Graphql API and I'm honestly not sure if it's not fully implemented or just much different from the REST API.

 

1. The REST API allows us to directly create orders. Is it correct that the GraphqL implementation requires us to first call the draftOrderCreate mutation and then the draftOrderComplete?

 

2. Is there no equivalent RISK API for the GraphqL? It appears I would need to leverage the REST API if I want to work with the RISK API.

 

I make Checkout Promotions on the app store. Native pre & post purchase upsells - used by over 1,800 merchants.
Accepted Solution (1)
Zameer
Shopify Staff
297 31 90

This is an accepted solution.

Ah yes, sorry for misunderstanding, I didn't realize you were looking to update OrderRisk values and thought you were just looking to query them.

 

The REST and GraphQL API are not currently at full parity, but we're working towards bringing them to parity in the future. This means that for the time being, for certain use-cases you may be required to use both REST and GraphQL to accomplish what it is you're looking to do. As is the case with updating an Orders Risk Level.

 

I would recommend subscribing to our API changelog for future announcements about changes to the GraphQL API.

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 6 (6)

Zameer
Shopify Staff
297 31 90

Hey there,

 

1. Yes, when using GraphQL to create an order, you must first use the draftOrderCreate mutation and then the draftOrderComplete mutation.

2. You can find the OrderRisk object under our Objects documentation linked here. It provides you with properties such as the OrderRiskLevel, display status, and the risk message that's shown to the merchant in the Shopify admin.

 

 

To learn more visit the Shopify Help Center or the Community Blog.

gilg
Shopify Partner
31 6 6

Hi Zameer,

 

Thanks kindly for taking the time to respond. Regarding #2, I saw the risk object but I don't see any mutation to add or update an order's risk like what's possible with the REST API - https://help.shopify.com/en/api/reference/orders/order-risk#create Am I overlooking some Graphql Mutation or is this possibly coming in the future to the Graphql API version? I think there are instances of other APIs not yet currently available  over Graphql.

I make Checkout Promotions on the app store. Native pre & post purchase upsells - used by over 1,800 merchants.
Zameer
Shopify Staff
297 31 90

This is an accepted solution.

Ah yes, sorry for misunderstanding, I didn't realize you were looking to update OrderRisk values and thought you were just looking to query them.

 

The REST and GraphQL API are not currently at full parity, but we're working towards bringing them to parity in the future. This means that for the time being, for certain use-cases you may be required to use both REST and GraphQL to accomplish what it is you're looking to do. As is the case with updating an Orders Risk Level.

 

I would recommend subscribing to our API changelog for future announcements about changes to the GraphQL API.

To learn more visit the Shopify Help Center or the Community Blog.

Yu727
Excursionist
38 0 10

Hi @Zameer 

I hope you are having a great weekend.

 

I am using GraphQL to create an order, so I first use the draftOrderCreate mutation and then the draftOrderComplete mutation.

But in this case, the order confirmation email was sent to customers.

Is there any way to prevent sending an email when using GraphQL?

 

Thank you & have a great weekend!

M_tech
Shopify Partner
2 0 0

I'm using the same procedure but payment status is getting paid by default idk why 

how can I make it pending and leave it to COD

dev2121
Shopify Partner
2 0 1

Is it still true that Shopify is bringing GQL and RestAPI to parity?