Documentation

Sage 50 Integration with Opayo (via AG)

Introduction

Some merchants use Sage 50 accounting software and want to import transaction data from their WooCommerce store.
Our Opayo plugin is built primarily for Opayo’s own API format, but we now have a way to make your order data compatible with Sage 50’s basket import.


Overview

Out of the box, our Opayo plugins send the order’s basket (line item data) to Opayo in the standard format used for payment processing.
However, Sage 50’s accounting import expects a different structure; one that lists products, quantities, and tax breakdowns in a very specific way.

To help merchants bridge that gap, we’ve introduced a customisable drop-in filter that reformats the basket before it’s sent to Opayo.

This means you can:

  • Continue using Opayo for secure payments

  • Export/import transactions into Sage 50 without manual re-entry

  • Retain line-by-line detail (SKUs, VAT, discounts, shipping, etc.)


How It Works

Here’s a quick summary of the data flow:


WooCommerce → AG Opayo Plugin → Opayo → Sage 50 Import

Normally, Opayo receives a simple transaction summary. With the Sage 50 Basket Format drop-in, your WooCommerce order data is translated into the detailed line structure Sage 50 requires.


Why a Custom Snippet?

Sage 50 isn’t directly supported by Opayo’s API, it relies on structured basket data that Sage can read during import.
This structure isn’t something Opayo provides natively, which is why we’ve released a ready-to-use snippet for merchants who need it.

This snippet replaces the standard basket payload with the format Sage 50 understands.

If you’re comfortable with PHP or have a developer, you can adjust it for your setup.
If not, it’s designed to work “out of the box” for most stores.


Developer Guide

If you need the technical details or want to implement the snippet yourself, head over to the guide below:

Add_filter | Opayo | Sage 50 Basket Format

That page includes the full PHP snippet, comments, and a sample output.


Requirements

  • AG Opayo Plugin (any integration type: Direct, Server, or Pi)

  • WooCommerce 8.0+

  • PHP 8.1+

  • Sage 50 import feature configured to read basket line data


What This Doesn’t Do

  • It does not send data directly to Sage 50

  • It does not create invoices or ledgers automatically

  • It simply ensures the Opayo “basket” (the line-level order data) matches what Sage 50’s import tool expects


Example Basket Output

4:[SKU001]Blue T-Shirt:2:12.50:2.50:15.00:30.00:[SKU002]Cap:1:10.00:2.00:12.00:12.00:Delivery:000:000:000:000:4.79:Discount:000:000:000:000:-5.00

Each part corresponds to:

  • [SKU]ProductName

  • Quantity

  • Unit ex-VAT

  • Unit VAT

  • Unit inc-VAT

  • Line inc-VAT


Example Use Case

“We use Sage 50 for our accounts, and Opayo for card payments on WooCommerce.
Before this, we had to manually retype every sale into Sage.
With this new basket format, our accountant can import sales straight from Opayo’s export — line by line. It’s saved hours every week.”


Collaboration & Customisation

We developed this drop-in with the help of a real merchant already using Sage 50 to ensure the format works in practice.

The snippet is designed to be used as is, and should cover most standard setups.
If you need to adapt it for your own workflow or add extra fields, please work with your developer to make those adjustments.

If you’re using Sage 50 and would like to share feedback or confirm your setup works with this snippet, we’d love to hear from you, it helps us refine our documentation and better support future merchants.


Summary

This isn’t a full-blown Sage 50 integration, it’s a bridge.
It gives your accountant clean, import-ready data and saves time re-keying orders.

If you’re processing WooCommerce orders with Opayo and managing your books in Sage 50, this snippet helps the two systems speak the same language.

Was this helpful?

Opayo

Don't already have the plugin? Get access now.

Still need help?

Our team are on hand to provide fast, helpful and professional support.

Support request
All systems operational

Back End Demo

Start exploring our fully functional demo site today.
Gain exclusive admin access to see what's possible.

Create your demo now

Front End Demo

Test drive our plugin on the demo site.

View Demo