Development discussions around Shopify APIs
To continue receiving payouts, you need to secure your account by turning on two-step authentication. If two-step authentication is not turned on your payouts will be paused. Learn more
I am trying to retrieve an order by draftOrderId. My expectation is that an orderId would be available via the `draftOrderComplete` mutation. However, that is not the case. Further, draftOrderId is not a supported filter parameter via the `orders` query. Is this currently possible? If not, are there any known work arounds?
Solved! Go to the solution
This is an accepted solution.
Hi there
This should definitely be possible.
I presume you're using GraphQL based on your post.
So the draftOrder object has an order property that will get you the order that was completed from this draft.
So you can do this to get the first 10 draft orders and the orders that were completed on the back of that:
query getDraftOrders {
draftOrders(first: 10) {
edges {
node {
id
createdAt
completedAt
order {
id
createdAt
}
}
}
}
}
So in your case - the DraftOrder that is returned from the draftOrderComplete mutation should have this "order" property that you can retrieve this information from?
This is an accepted solution.
Hi there
This should definitely be possible.
I presume you're using GraphQL based on your post.
So the draftOrder object has an order property that will get you the order that was completed from this draft.
So you can do this to get the first 10 draft orders and the orders that were completed on the back of that:
query getDraftOrders {
draftOrders(first: 10) {
edges {
node {
id
createdAt
completedAt
order {
id
createdAt
}
}
}
}
}
So in your case - the DraftOrder that is returned from the draftOrderComplete mutation should have this "order" property that you can retrieve this information from?
@2BDigital -- I must have looked at the DraftOrder resource docs for an hour yesterday and missed the Order connection. 🤦♂️ Thank you -- I appreciate it.
User | RANK |
---|---|
6 | |
5 | |
5 | |
5 | |
4 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022