ruby on rails - Shopify API - Draft Orders, Mark as Payment Pending
I'm creating draft orders using the Shopify API, the API documentation says " the draft order can be paid, set to pending, or paid by credit card; in each case, the draft order is set to completed and an order is created. "
I've been trying alllllll day to set the draft as pending so that Shopify creates a real order and I can do something with that.
If I try and set the status directly I just get this
 pry(main)> order.status => "open"  pry(main)> order.status = 'pending' => "pending"  pry(main)> order.status => "pending"  pry(main)> order.save => true  pry(main)> order.status => "open"  pry(main)> order.taxes_included => true  pry(main)> order.taxes_included = false => false  pry(main)> order.save => true  pry(main)> order.taxes_included => true
I've tried creating a transaction for the DraftOrder but the transaction method doesn't take draft_order_id, only order_id which isn't right.
Permissons on the app are correct and I get the same results from Shopify CLI
Please can someone give some me advice???
Thanks for your time.
Order status are
- open - Open orders (default)
- closed - Only closed orders
- any - Any order status
Where as order financial status are
- authorized - Only authorized orders
- pending - Only pending orders
- paid - Only paid orders
- refunded - Show only refunded orders
- voided - Show only voided orders
- any - All authorized, pending, and paid orders (default)
This is with the orders, and i hope it's same with the draft orders. Please try
order.financial_status = 'pending' and this should work.
Thank you very much to everyone who looked at the question.
I've had an official reply from Shopify:
"Changing the status to complete requires a new endpoint, which is not available right now"
The Draft Order API is very new, fingers crossed this will be released soon.
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.