Automatically add shipping to draft orders

Automatically add shipping to draft orders

dtubs
Tourist
6 0 1

Hi I am wanting to create a flow to automatically add a flat rate shipping price of $9.99 to all draft orders created please

Replies 4 (4)

RPiii
Shopify Staff
110 19 36

You might be able to do this with a workflow that starts with a Draft order created trigger followed by a Send Admin API request action that uses a draftOrderUpdate mutation to update the shippingLine on the draft order.

dtubs
Tourist
6 0 1

Thank you so much, I am having a look now and the code is a bit confusing to me. I have pasted it below which bit should I update to make all draft shipping orders have $9.99.

 

{
"id": "",
"shippingLine": {
"price": {
"amount": "",
"currencyCode": ""
},
"title": ""
}
}

dtubs
Tourist
6 0 1

{
"id": "{{draftOrder.id}}",
"shippingLine": {
"price": {
"amount": "9.99",
"currencyCode": "AUD"
},
"title": "Standard"
}
}

This is what I have at the moment and getting the error: 

Error Mutation had errors: "invalid id"
 
Kalen_Jordan
Shopify Partner
801 38 145

Try logging out the values so you can see what details are getting passed into the action.