PHPackages                             bymayo/order-importer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bymayo/order-importer

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

bymayo/order-importer
=====================

Imports Orders via Feed Me Plugin

1.0.5(2mo ago)1151[2 issues](https://github.com/bymayo/craft-order-importer/issues)proprietaryPHPPHP &gt;=8.2CI failing

Since Jul 31Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/bymayo/craft-order-importer)[ Packagist](https://packagist.org/packages/bymayo/order-importer)[ RSS](/packages/bymayo-order-importer/feed)WikiDiscussions craft-5 Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (6)Used By (0)

[![](https://github.com/bymayo/craft-order-importer/raw/craft-5/resources/icon.png)](https://github.com/bymayo/craft-order-importer/blob/craft-5/resources/icon.png)

Order Importer for Craft CMS 5
==============================

[](#order-importer-for-craft-cms-5)

Order Importer is a Craft CMS plugin that uses [Feed Me](https://plugins.craftcms.com/feed-me) to import orders in to Craft Commerce from a import file (XML &amp; JSON).

[![](https://raw.githubusercontent.com/bymayo/craft-order-importer/craft-5/resources/screenshot.png)](https://raw.githubusercontent.com/bymayo/craft-order-importer/craft-5/resources/screenshot.png)

Install
-------

[](#install)

- Install Feed Me via the plugin store [Feed Me](https://plugins.craftcms.com/feed-me) or, with Composer via `composer require craftcms/feed-me` from your project directory.
- Install Order Importer via the plugin store [Order Importer](https://plugins.craftcms.com/order-importer) or, with Composer via `composer require bymayo/order-importer` from your project directory.
- Enable / Install both plugins in the Craft Control Panel under `Settings > Plugins`
- Follow the [Setup](#setup) instructions below

Requirements
------------

[](#requirements)

- Craft CMS 5.x
- Feed Me 6.x
- Craft Commerce 5.x
- PHP 8.2
- MySQL (No PostgreSQL support)

Setup
-----

[](#setup)

This plugin requires Feed Me and Craft Commerce to function.

All Product/Purchasables must be created in the CMS before importing orders. Similar if all Users/Customers are created in the CMS before importing orders this would be a good idea, but this plugin will create any Users/Customers that don't exist.

1. Navigate to the Feed Me in the sidebar and create a new feed.
2. Give your feed a `Name`, add you `Feed URL`.
3. In `Feed Type` select `JSON` or `XML`. These are the only supported feed types due to how you need to structure the feed. See [Feed Types](#feed-types) for examples.
4. Select the 'Commerce Orders' `Element Type` from the dropdown.
5. If you have a custom field layout for Commerce Orders, select it from the `Custom Field Layout` dropdown.
6. All other settings are optional, hit `Save & Continue` and select your `Primary Element` from the dropdown.
7. Map your fields to the feed elements and hit `Save & Continue` again. See [Mapping](#mapping) for some important notes.
8. Hit `Process it now` and you should see your orders imported into the CMS.

Feed Types
----------

[](#feed-types)

We recommend using only XML and JSON file types for your feeds due to how you need to structure the feed, specifically the `Line Items` and `Address` fields. Below are some examples of how to structure your feed:

### XML

[](#xml)

```

        1
        test@test.com
        new
        fd20cfdf6ff2e6c30a074385b273b928
        000550
        true
        2025-07-16 09:51:05
        2025-07-16 09:51:05
        2025-07-30 09:54:26
        GBP
        GBP
        en-GB

            1827
            First
            Name
            Address Line 1
            Address Line 2
            Address Line 3
            City
            State
            12345
            US

            1827
            First
            Name
            Address Line 1
            Address Line 2
            Address Line 3
            City
            State
            12345
            US

                3745
                ABC123
                Red T-Shirt
                {&quot;currency&quot;:&quot;GBP&quot;,&quot;purchasableId&quot;:3745,&quot;time&quot;:1752655509,&quot;price&quot;:{&quot;base&quot;:&quot;25.0000&quot;,&quot;modifier&quot;:&quot;1&quot;,&quot;modified&quot;:25,&quot;salePrice&quot;:25,&quot;saleAmount&quot;:0}}
                10
                30
                20
                10
                2
                25.00
                20.00
                5.00
                40.00
                40.00
                Leave parcel at the front door
                Delivery drive to leave parcel in safe place
                1
                1

                1044
                success
                purchase
                40.0000

        1
        10.00
        DHL Next Day
        7.50
        VAT
        20%
        10.00
        10% off
        Online Offer

```

### JSON

[](#json)

```
{
  "order": {
    "customerId": "1",
    "orderEmailAddress": "test@test.com",
    "orderStatus": "new",
    "number": "fd20cfdf6ff2e6c30a074385b273b928",
    "reference": "000550",
    "isCompleted": "true",
    "dateOrdered": "2025-07-16 09:51:05",
    "datePaid": "2025-07-16 09:51:05",
    "dateAuthorized": "2025-07-30 09:54:26",
    "currency": "GBP",
    "paymentCurrency": "GBP",
    "orderLanguage": "en-GB",
    "billingAddress": {
      "id": "1827",
      "firstName": "First",
      "lastName": "Name",
      "addressLine1": "Address Line 1",
      "addressLine2": "Address Line 2",
      "addressLine3": "Address Line 3",
      "city": "City",
      "state": "State",
      "postalCode": "12345",
      "countryCode": "US"
    },
    "shippingAddress": {
      "id": "1827",
      "firstName": "First",
      "lastName": "Name",
      "addressLine1": "Address Line 1",
      "addressLine2": "Address Line 2",
      "addressLine3": "Address Line 3",
      "city": "City",
      "state": "State",
      "postalCode": "12345",
      "countryCode": "US"
    },
    "lineItems": {
      "lineItem": {
        "purchasableId": "3745",
        "sku": "ABC123",
        "description": "Red T-Shirt",
        "options": "{\"currency\":\"GBP\",\"purchasableId\":3745,\"time\":1752655509,\"price\":{\"base\":\"25.0000\",\"modifier\":\"1\",\"modified\":25,\"salePrice\":25,\"saleAmount\":0}}",
        "width": "10",
        "height": "30",
        "length": "20",
        "weight": "10",
        "quantity": "2",
        "price": "25.00",
        "salePrice": "20.00",
        "saleAmount": "5.00",
        "subTotal": "40.00",
        "total": "40.00",
        "note": "Leave parcel at the front door",
        "privateNote": "Delivery drive to leave parcel in safe place",
        "taxCategory": "1",
        "shippingCategory": "1"
      }
    },
    "transactions": {
      "transaction": {
        "id": "1044",
        "status": "success",
        "type": "purchase",
        "amount": "40.0000"
      }
    },
    "gatewayId": "1",
    "shippingTotal": "10.00",
    "shippingMethodName": "DHL Next Day",
    "taxTotal": "7.50",
    "taxRateName": "VAT",
    "taxRate": "20%",
    "discountTotal": "10.00",
    "discountName": "10% off",
    "discountDescription": "Online Offer"
  }
}
```

There are some examples of how to create XML feeds in the repository under `examples/` if you're importing from a Craft 4 or 5 project with the variables already set up.

Mapping
-------

[](#mapping)

1. It's important that Products/Purchasables are created in the CMS before importing orders to use the `Purchasable ID` fields correctly.
2. Similarly, it's important that Users/Customers are created in the CMS before importing orders to use the `Customer ID` fields correctly. But the plugin will create any Users/Customers that don't exist.
3. Make sure you structure your `Line Items` as an Array, so it can loop through the array and create the line items.
4. Make sure you structure your `Transactions` as an Array, so it can loop through the array and create the transactions.
5. `Billing Address Fields` and `Shipping Address Fields` need to also be setup line an Array.
6. Line Item `Options` need to be setup as a valid JSON string, or not imported at all.
7. There are no "Total" fields to include in your feeds, due to the way Craft Commerce calculates all totals.

Caveats
-------

[](#caveats)

- Currently you can only add one Transaction per order.
- Currently multiple Shipping, Tax and Discount adjusters are not supported.

Support
-------

[](#support)

If you have any issues (Surely not!) then I'll aim to reply to these as soon as possible. If it's a site-breaking-oh-no-what-has-happened moment, then hit me up on the Craft CMS Discord - @bymayo

Roadmap
-------

[](#roadmap)

- Add support multiple Shipping, Tax and Discount adjusters.
- Add support multiple Transactions per order.
- Add support for Status History

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance64

Regular maintenance activity

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~67 days

Total

4

Last Release

86d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/522877?v=4)[Jason Mayo](/maintainers/bymayo)[@bymayo](https://github.com/bymayo)

---

Top Contributors

[![bymayo](https://avatars.githubusercontent.com/u/522877?v=4)](https://github.com/bymayo "bymayo (26 commits)")

### Embed Badge

![Health badge](/badges/bymayo-order-importer/health.svg)

```
[![Health](https://phpackages.com/badges/bymayo-order-importer/health.svg)](https://phpackages.com/packages/bymayo-order-importer)
```

###  Alternatives

[spicyweb/craft-neo

A Matrix-like field type with block hierarchy

395798.1k10](/packages/spicyweb-craft-neo)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[supercool/tablemaker

Create customizable and user-defined table fields.

40141.7k](/packages/supercool-tablemaker)[verbb/vizy

A flexible visual editor field for Craft.

4348.6k](/packages/verbb-vizy)[verbb/social-poster

Automatically post entries to social media.

918.5k](/packages/verbb-social-poster)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
