Ad

Shopify API - Draft Orders, Mark As Payment Pending

- 1 answer

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. "

https://help.shopify.com/api/draft-orders

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

[12] pry(main)> order.status
=> "open"
[13] pry(main)> order.status = 'pending'
=> "pending"
[14] pry(main)> order.status
=> "pending"
[15] pry(main)> order.save
=> true
[16] pry(main)> order.status
=> "open"
[17] pry(main)> order.taxes_included
=> true
[18] pry(main)> order.taxes_included = false
=> false
[19] pry(main)> order.save
=> true
[20] 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.

Ad

Answer

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.

Ad
source: stackoverflow.com
Ad