A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Have anybody done this before ? It should be simple and straight forward but I just can't seem to figure it out.
I am referring API documentation here.
https://shopify.dev/docs/admin-api/rest/reference/orders/draftorder?api%5Bversion%5D=2021-04#complet...
But it looks like documentation is not correct due to following observation.
- This call either creates something or updates something. So it should be either PUT or POST call by nature. I see GET call which makes no sense!
- There is not proper request schema provided neither example matches the scenario of this action.
- API endpoint is simply a copy of draft order GET call. So, it looks like someone copied it and forgot to documentation 🙂
So, have anybody done this before ? Any idea about correct end-point for this?
Thanks,
Dhrumil
Solved! Go to the solution
This is an accepted solution.
Hey @dhrumil4u360
Thanks for raising this! We had the documentation errors raised to us prior and are working through fixing the documentation, apologies for the inconvenience.
Here's the calls that can be used to complete a Draft order via the REST API - hope this helps!
Complete and mark as paidPUT /admin/api/{api_version}/draft_orders/{draft_order_id}/complete.json
Complete and mark as pendingPUT /admin/api/{api_version}/draft_orders/{draft_order_id}/complete.json?payment_pending=tru
This is an accepted solution.
Hey @dhrumil4u360
Thanks for raising this! We had the documentation errors raised to us prior and are working through fixing the documentation, apologies for the inconvenience.
Here's the calls that can be used to complete a Draft order via the REST API - hope this helps!
Complete and mark as paidPUT /admin/api/{api_version}/draft_orders/{draft_order_id}/complete.json
Complete and mark as pendingPUT /admin/api/{api_version}/draft_orders/{draft_order_id}/complete.json?payment_pending=tru
Thank you!
I am glad that documentation getting better and better day by day!
Also, thanks for putting up quick example about that API call here. It really helps to move forward while I understand that documentation update should go by process and may time bit time to go live.
Thanks,
Dhrumil
@Luke_K It looks like documentation is now updated. Thank you for that. However, this endpoint is not working. I am simply adding draft order ID in URL and just making HTTP PUT call. I get only response :
{"errors": "Not Found"}
I am tryin on 2021-07 API version which is latest. I can see the draft order with same ID in my shopify account as a double check measure that order must exist.
Can you please do the needful?
Thanks,
Dhrumil
Hey @dhrumil4u360
Apologies for the delay, I have been out of office - if you're still receiving this issue would you mind sharing the full call you are making here and the request_id from it? I can take a look. Thanks!
@Luke_K Thank you for your response. I figured it out. I was unsure about what to send as payload in the PUT request. But apparently there is no payload here.
Thank you again for your time.