My for Craft CMS

MYOB AccountRight for Craft Commerce 5

Every order in MYOB, for what the customer paid

My turns each completed Commerce order into a MYOB sale invoice, against the customer's existing card if they have one. It applies the payment so the invoice doesn't sit unpaid, raises a credit note when you refund, and refuses to send an invoice whose total doesn't match the order.

My

See the invoice before MYOB does

The dry run, the Preview button on Commerce's order screen and the real push all go through one payload builder, so what you read here is what MYOB receives. It ends by adding the invoice up the way MYOB will and comparing that with the order. Looking is read-only: nothing is created in MYOB, not even a customer card.

shell
$ php craft my/sync/order 1042 --dryRun
POST Sale/Invoice/Service
{
    "Customer": { "UID": "7c1e4a90-…" },
    "Date": "2026-10-02T00:00:00",
    "IsTaxInclusive": true,
    "Lines": [
        {
            "Type": "Transaction",
            "Description": "2 × Linen apron (APR-01)",
            "Total": 90,
            "TaxCode": { "UID": "b3f0…" },
            "Account": { "UID": "52d9…" }
        },
        …
    ],
    "Number": "1042",
    "Freight": 11,
    "FreightTaxCode": { "UID": "b3f0…" },
    "CustomerPurchaseOrderNumber": "1042",
    "JournalMemo": "Craft order 1042",
    "InvoiceDeliveryStatus": "AlreadyPrintedOrSent"
}

Would book 110.00; the order is 110.00.

Features

An accounting integration has one failure it can't be forgiven: booking a different number than the customer paid. Most of My is built around not doing that, and around never doing it twice.

Totals checked twice

My never states a total. It sends the lines, adds them up the way MYOB will, and refuses to push if the sum is off from the order by more than a cent. After the push it compares what MYOB booked with what the customer paid, which catches a tax code mapped to the wrong rate.

  • Line amounts come from Commerce's own totals, so a third-party surcharge isn't dropped
  • Refuse, add a rounding line, or push and warn: your call

One invoice per order, however many retries

A unique key on order, document and source, claimed before the request goes out. If MYOB created the invoice but the reply was lost, the next attempt asks MYOB for that invoice number and links it instead of posting a second.

No second card for regulars

Before creating a customer card, My searches MYOB for one with the order's email address and remembers the match. A company file with ten years of customers in it stays one card per customer.

  • Company or individual card, from the billing address
  • Or post everything to one card, for high-volume retail

Payments and refunds follow

Each Commerce payment becomes a MYOB customer payment applied to the invoice, so nobody closes them by hand. A refund becomes a credit note and, if you want, a credit refund out of the account you name.

  • Authorisations wait until they're captured
  • Gateways mapped to MYOB's own payment methods

Cloud, or the server in the office

Connect a cloud company file over OAuth, or an AccountRight local server over HTTP Basic. My keeps the twenty-minute tokens fresh on its own, and copes with newer API keys that MYOB won't let list company files.

  • Pin the company file per environment, so staging can't invoice production

Every request on the record

A connection log of what was sent and what MYOB said back, with tokens and company file passwords redacted before anything is written. MYOB's field-level error detail is kept, so an Invalid data tells you which field.

  • Console commands for dry runs, backfill, retry and status
  • Checkout never waits: every push is queued

The invoice number on your order page

craft.myob can only read. Show the MYOB invoice number on an order confirmation or account page; a template render is no place to write to the books.

twig
{% if craft.myob.isInvoiced(order) %}
    <p>Tax invoice {{ craft.myob.invoice(order).myobNumber }}</p>
{% endif %}

{% for document in craft.myob.documents(order) %}
    <li>{{ document.getTypeLabel() }}: {{ document.getStatusLabel() }}</li>
{% endfor %}

Frequently Asked Questions

The questions worth answering before you connect it to your books.

Read the invoice before it is sent

My is $99 for one Craft installation, then $79 a year for updates. Connect your company file, preview a real order, and read the invoice MYOB would receive before a single one is sent.