Archive orders when fulfilled, with Mechanic.

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

Archive orders when fulfilled

Super simple: this task monitors for order fulfillments, and automatically archives orders when they're fulfilled.

Runs Occurs whenever an order is fulfilled and Occurs when a user manually triggers the task.

15-day free trial – unlimited tasks

Documentation

Super simple: this task monitors for order fulfillments, and automatically archives orders when they're fulfilled.

This task runs automatically, when orders are fulfilled. To scan your store's order history and archive all existing fulfilled orders, use the "Run task" button. Enable "Read all orders" to make sure Mechanic can scan your entire order history, and not just the last 60 days.

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/orders/fulfilled
mechanic/user/trigger
Tasks use subscriptions to sign up for specific kinds of events. Learn more
Code
{% if event.topic == "mechanic/user/trigger" %}
  {% if event.preview %}
    {
      "action": {
        "type": "shopify",
        "options": [
          "post",
          "/admin/orders/1234567890/close.json",
          {}
        ]
      }
    }
  {% else %}
    {% for order in shop.orders.any.shipped.open %}
      {
        "action": {
          "type": "shopify",
          "options": [
            "post",
            "/admin/orders/{{ order.id | default: "1234567890" }}/close.json",
            {}
          ]
        }
      }
    {% endfor %}
  {% endif %}
{% elsif event.topic == "shopify/orders/fulfilled" %}
  {% if order.closed_at == blank or event.preview %}
    {
      "action": {
        "type": "shopify",
        "options": [
          "post",
          "/admin/orders/{{ order.id | default: "1234567890" }}/close.json",
          {}
        ]
      }
    }
  {% endif %}
{% endif %}
Task code is written in Mechanic Liquid, an extension of open-source Liquid enhanced for automation. Learn more