PHPackages                             megzo/acumatica-xrp-integrator - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. megzo/acumatica-xrp-integrator

ActiveLibrary[HTTP &amp; Networking](/categories/http)

megzo/acumatica-xrp-integrator
==============================

Framework-agnostic PHP toolkit to integrate e-commerce platforms with Acumatica ERP (XRP): OAuth2 ROPC REST client for Stock Items / Sales Orders / Customers, plus HMAC-signed webhook signing &amp; verification.

00PHPCI passing

Since Jun 18Pushed 1w agoCompare

[ Source](https://github.com/forint573/Acumatica-XRP-PHP-Integrator)[ Packagist](https://packagist.org/packages/megzo/acumatica-xrp-integrator)[ RSS](/packages/megzo-acumatica-xrp-integrator/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Acumatica XRP — PHP Integrator
==============================

[](#acumatica-xrp--php-integrator)

[![Buy a license](https://camo.githubusercontent.com/6afdeb28a78227cd91b8eaea59bb119ba128689330a5e0cb6697991f8b471b2a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d42757925323061742532306d65677a6f2e62697a2d3265613434662e737667)](https://megzo.biz)[![CI](https://github.com/forint573/Acumatica-XRP-PHP-Integrator/actions/workflows/ci.yml/badge.svg)](https://github.com/forint573/Acumatica-XRP-PHP-Integrator/actions/workflows/ci.yml)[![License: Proprietary](https://camo.githubusercontent.com/d73dedd75fb9837ac4e48bb75823cb711536fc63c2ff75dfc7dca5704c10e85a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d50726f70726965746172792532302870616964292d7265642e737667)](LICENSE)[![PHP 8.1+](https://camo.githubusercontent.com/ab828ceaf31f2952dc4c9f1c8e712fd700410c57f8dd0ebb8fb6ae986a8b15f5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d3737376262332e737667)](composer.json)

A small, **framework-agnostic PHP toolkit for integrating any e‑commerce platform with [Acumatica ERP](https://www.acumatica.com/) (XRP)** over its contract-based REST API.

It gives you the two hard, reusable pieces — talking to Acumatica securely, and securing the webhooks between your shop and the ERP — so you can focus on your own product/order mapping.

> **© MEGZO\_tech — proprietary, source-available.** Provided for evaluation/reference. Production or commercial use requires a **paid commercial license** and **author attribution** — see [LICENSE](LICENSE). Not affiliated with Acumatica, Inc. — see [TRADEMARKS.md](TRADEMARKS.md).

---

### 🇷🇴 Descriere (RO)

[](#-descriere-ro)

**Integrare PHP pentru Acumatica ERP (XRP).** Un set de unelte care rezolvă cele două părți grele și refolosibile ale oricărei integrări de e‑commerce cu Acumatica: clientul REST securizat (autentificare OAuth2 ROPC, cu cache și reîmprospătare de token) și semnarea și verificarea HMAC a webhook‑urilor. Rămâne de făcut doar maparea propriilor produse și comenzi. În plus, traduce erorile Acumatica în cauza reală (de exemplu câmpul respins de ERP), nu doar „HTTP 500". Produs comercial MEGZO\_tech, cu licență cu plată la [megzo.biz](https://megzo.biz).

### 🇭🇺 Leírás (HU)

[](#-leírás-hu)

**PHP integráció az Acumatica ERP‑hez (XRP).** Eszközkészlet, amely minden Acumatica e‑kereskedelmi integráció két nehéz, újrahasznosítható részét megoldja: a biztonságos REST‑klienst (OAuth2 ROPC hitelesítés, token‑gyorsítótárazással és ‑frissítéssel) és a webhookok HMAC‑aláírását és ‑ellenőrzését. Így csak a saját termékek és rendelések megfeleltetése marad hátra. Ráadásul az Acumatica hibáit a tényleges okukra fordítja le (például az ERP által elutasított mezőre), nem csak „HTTP 500" kódot mutat. Kereskedelmi MEGZO\_tech termék, fizetős licenccel a [megzo.biz](https://megzo.biz) oldalon.

---

What's in the box
-----------------

[](#whats-in-the-box)

- **`AcumaticaClient`** — a clean Acumatica REST client:
    - OAuth 2.0 **Resource Owner Password Credentials (ROPC)** auth with automatic token caching + refresh.
    - Helpers for **Stock Items**, **Sales Orders** and **Customers** (`upsertStockItem`, `createSalesOrder`, `upsertCustomer`).
    - `findSalesOrder()` for **idempotent** order pushes, `getStockItemsModifiedSince()` for reconciliation pulls.
    - Automatic conversion to/from Acumatica's `{"field":{"value": …}}` wire format (`autoWrap` / `unwrap`), including detail lines and custom (`Usr-`) fields.
    - `testConnection()` for a quick health check.
- **`Webhook\HmacSigner`** / **`Webhook\HmacVerifier`** — sign and verify HMAC-SHA256 webhook requests between the ERP/middleware and your shop (timestamped, replay-bounded, constant-time, multi-key for rotation).
- **`Contracts\ErpConnector`** — the interface to code your integration against (swap drivers, mock in tests).

Pure PHP — only `ext-curl` and `ext-json`. No framework, no platform lock-in.

Get a license
-------------

[](#get-a-license)

This is a commercial product. Purchase a license at **[megzo.biz](https://megzo.biz)**; licensees receive the package and install it via the private distribution they're given (e.g. a Composer VCS/path repository) — it is **not** published on Packagist.

Quick start
-----------

[](#quick-start)

### 1. Talk to Acumatica

[](#1-talk-to-acumatica)

```
use Megzo\Acumatica\AcumaticaClient;

$acu = new AcumaticaClient([
    'base_url'      => 'https://your.acumatica.com', // instance root, no trailing slash
    'endpoint_name' => 'Default',                    // your contract endpoint
    'version'       => '24.200.001',
    'client_id'     => '....@Company',
    'client_secret' => '....',
    'username'      => 'integration-user',
    'password'      => '....',
]);

$acu->testConnection(); // ['ok' => true, 'message' => 'Connected — OAuth + endpoint reachable.']
```

### 2. Push a product (Stock Item)

[](#2-push-a-product-stock-item)

```
$acu->upsertStockItem([
    'InventoryID'  => 'GIFT-001',
    'Descr'        => 'Personalised mug',
    'ItemClass'    => 'STOCKITEM',
    'DefaultPrice' => 49.90,
    // custom Usr- field:
    // 'custom' => ['ItemSettings' => ['UsrShopItem' => ['type' => 'CbBoolean', 'value' => true]]],
]);
```

### 3. Create a Sales Order from a shop order (idempotent)

[](#3-create-a-sales-order-from-a-shop-order-idempotent)

```
$orderNbr = 'WEB-10532';

if (! $acu->findSalesOrder($orderNbr)) {
    $acu->createSalesOrder([
        'OrderType'        => 'SO',
        'CustomerID'       => 'WEBSHOP',
        'CustomerOrderNbr' => $orderNbr, // external ref → idempotency
        'Details'          => [
            ['InventoryID' => 'GIFT-001', 'OrderQty' => 2, 'UnitPrice' => 49.90],
        ],
    ]);
}
```

### 4. Secure your inbound webhooks

[](#4-secure-your-inbound-webhooks)

The **sender** (your ERP / middleware) signs the request:

```
use Megzo\Acumatica\Webhook\HmacSigner;

$headers = (new HmacSigner($secret))->headers('my-key-id', $jsonBody);
// X-Megzo-Key / X-Megzo-Timestamp / X-Megzo-Signature  → attach to the HTTP request
```

The **receiver** (your shop endpoint) verifies it:

```
use Megzo\Acumatica\Webhook\HmacVerifier;

$verifier = new HmacVerifier(['my-key-id' => $secret], 'sha256', 300); // 300s replay window
$ok = $verifier->verify(
    $request->header('X-Megzo-Key'),
    $request->header('X-Megzo-Timestamp'),
    $request->header('X-Megzo-Signature'),
    $rawRequestBody, // sign/verify the EXACT bytes
);
```

Signature = `base64( hmac_sha256( timestamp + "." + rawBody, secret ) )`.

See [`examples/`](examples) for runnable scripts.

Going live? Read [`docs/GO_LIVE_TROUBLESHOOTING.md`](docs/GO_LIVE_TROUBLESHOOTING.md) — the actual `422`/`500` causes &amp; fixes (most are ERP config, not code), and how `AcumaticaException::summarize()` makes them visible. A full, real-world CodeIgniter 4 reference integration (the first order it posted live was Acumatica SalesOrder `000010`) is maintained privately by MEGZO\_tech and available to commercial-license holders.

How it fits a real integration
------------------------------

[](#how-it-fits-a-real-integration)

```
                         ┌─────────────────────────┐
   Acumatica (ERP)  ◀───▶│   AcumaticaClient        │  catalog/price/stock ← ERP
                         │   (OAuth ROPC + REST)    │  orders / products    → ERP
                         └─────────────────────────┘
   ERP / middleware ───signed webhook───▶  HmacVerifier  ───▶  your shop
   your shop  ───▶  HmacSigner  ───signed webhook───▶  ERP / middleware

```

Your application supplies the platform-specific parts — reading products/orders, mapping fields, queueing — and depends on `ErpConnector`. This library stays out of your framework's way.

Security notes
--------------

[](#security-notes)

- Sign and verify the **exact raw body bytes** (don't re-encode/pretty-print between).
- Keep the replay window tight (default 300s) and pair it with a nonce/dedup store if you need strict once-only delivery.
- Each ROPC sign-in consumes an Acumatica license seat — the client caches and refreshes the token to avoid churning seats.
- Store credentials/secrets outside the web root; never commit them (see `.env.example`).

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

[](#requirements)

- PHP **8.1+**, `ext-curl`, `ext-json`.
- An Acumatica contract-based REST endpoint and an integration user authorized for OAuth.

Contributing
------------

[](#contributing)

Bug reports are welcome via issues. By submitting a contribution you assign it to MEGZO\_tech under this project's proprietary license. Run the suite with `composer test`.

License &amp; trademarks
------------------------

[](#license--trademarks)

**Proprietary — © 2026 MEGZO\_tech. All rights reserved.** This is source-available for evaluation/reference, **not** open source. Any production or commercial use requires a **paid commercial license** and must keep **author attribution to MEGZO\_tech** — see [LICENSE](LICENSE). Purchase a license at **[megzo.biz](https://megzo.biz)** (or ).

"Acumatica" is a trademark of Acumatica, Inc.; in Romania "Acumatica XRP" is a registered trademark of **SeniorSoftware** (exclusive Acumatica reseller in Romania). This project is independent and **not affiliated** with either — see [TRADEMARKS.md](TRADEMARKS.md). Not legal advice; have counsel review before relying on these terms.

###  Health Score

21

—

LowBetter than 17% of packages

Maintenance64

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/47117f871a2ef70b33d76b36401081951ac159881e929156ace64af0a1bd2fc6?d=identicon)[forint573](/maintainers/forint573)

---

Top Contributors

[![forint573](https://avatars.githubusercontent.com/u/270204971?v=4)](https://github.com/forint573 "forint573 (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/megzo-acumatica-xrp-integrator/health.svg)

```
[![Health](https://phpackages.com/badges/megzo-acumatica-xrp-integrator/health.svg)](https://phpackages.com/packages/megzo-acumatica-xrp-integrator)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25026.1M82](/packages/php-http-cache-plugin)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k122](/packages/httpsoft-http-message)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)[swoft/websocket-server

swoft websocket server component

16135.7k5](/packages/swoft-websocket-server)[thesis/nats

Async (fiber based) client for Nats.

754.4k](/packages/thesis-nats)[jasny/http-signature

Implementation of the IETF HTTP Signatures draft RFC

10104.7k](/packages/jasny-http-signature)

PHPackages © 2026

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