Auto-complete new draft orders, with Mechanic.

Mechanic is a development and ecommerce automation platform for Shopify. :)

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. :)

Runs Occurs whenever a draft order is created. Configuration includes mark new orders as fully paid.

15-day free trial – unlimited tasks

Developer details

Mechanic is designed to benefit everybody: merchants, customers, developers, agencies, Shopifolks, everybody.

That’s why we make it easy to configure automation without code, why we make it easy to tweak the underlying code once tasks are installed, and why we publish it all here for everyone to learn from.

(By the way, have you seen our documentation? Have you joined the Slack community?)

Open source
View on GitHub to contribute to this task
Subscriptions
shopify/draft_orders/create
Tasks use subscriptions to sign up for specific kinds of events. Learn more
Options
mark new orders as fully paid (boolean)
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 %}
Task code is written in Mechanic Liquid, an extension of open-source Liquid enhanced for automation. Learn more
Defaults
Mark new orders as fully paid
true