Mechanic Get Mechanic
Task library

Auto-complete new draft orders

This task monitors for newly-created draft orders, and converts each one into a completed order. Nothing more, nothing less. :)

Try this task

When it runs

Occurs whenever a draft order is created

What you choose

Mark new orders as fully paid

Task code and subscriptions

You can edit the Liquid code after installing this task. View on GitHub or ask a question in the Mechanic Slack community.

Subscriptions

shopify/draft_orders/create
How task subscriptions work

Option types and flags

Task code

{% assign payment_pending = true %}
{% if options.mark_new_orders_as_fully_paid__boolean %}
  {% assign payment_pending = false %}
{% endif %}

{% action "shopify" %}
  mutation {
    draftOrderComplete(
      id: {{ draft_order.admin_graphql_api_id | json }}
      paymentPending: {{ payment_pending | json }}
    ) {
      draftOrder {
        order {
          id
          name
          fullyPaid
        }
      }
      userErrors {
        field
        message
      }
    }
  }
{% endaction %}
Mechanic Liquid reference

Default option values

Mark new orders as fully paid
true