PHPackages                             shopbridge/shopbridge-php - 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. shopbridge/shopbridge-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

shopbridge/shopbridge-php
=========================

PHP SDK for Agentic Commerce Protocol

v1.0.0(7mo ago)622MITPHPPHP ^7.4 || ^8.0

Since Oct 1Pushed 7mo agoCompare

[ Source](https://github.com/shopbridge/shopbridge-php)[ Packagist](https://packagist.org/packages/shopbridge/shopbridge-php)[ RSS](/packages/shopbridge-shopbridge-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

ShopBridge PHP SDK
==================

[](#shopbridge-php-sdk)

[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/f4fc7ecce2891193b534bdc0d77b32e344dca2308daa243d070c699cd4a34a25/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342532422d3737374242342e737667)](#requirements)[![Composer Package](https://camo.githubusercontent.com/e4544c64fa6949ce509fb9918e37c9a0bc56cf6705046e91619e179e84d47378/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5061636b61676973742d73686f7062726964676525324673686f706272696467652d2d7068702d6f72616e67652e737667)](https://packagist.org/packages/shopbridge/shopbridge-php)

ShopBridge PHP SDK helps merchants integrate with the [Agentic Commerce Protocol (ACP)](https://www.agenticcommerce.dev/). The library adheres to the official specifications published in the [agentic-commerce-protocol](https://github.com/agentic-commerce-protocol/agentic-commerce-protocol) repository and remains compatible with PHP 7.4 and newer.

Highlights
----------

[](#highlights)

- Merchant checkout lifecycle support with rich DTOs and validation (`create`, `update`, `get`, `complete`, `cancel`).
- Webhook signature verification and event parsing tailored to ACP payloads.
- Product feed builders for ACP-compliant catalog exports (JSON, CSV, TSV, XML).
- Framework-agnostic, PSR-7/17/18 compatible design that runs on PHP 7.4 and newer.

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

[](#requirements)

- PHP 7.4+
- Composer 2
- PSR-18 HTTP client and PSR-17 factories (for example `guzzlehttp/guzzle` together with `guzzlehttp/psr7`)

Installation
------------

[](#installation)

```
composer require shopbridge/shopbridge-php
```

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

[](#quick-start)

```
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Psr7\HttpFactory;
use ShopBridge\Models\Checkout\PaymentData;
use ShopBridge\Requests\Checkout\CheckoutSessionCompleteRequest;
use ShopBridge\Requests\Checkout\CheckoutSessionCreateRequest;
use ShopBridge\Requests\Checkout\CheckoutSessionItemRequest;
use ShopBridge\Requests\Checkout\CheckoutSessionUpdateRequest;
use ShopBridge\ShopBridge;
use ShopBridge\Support\HmacSignatureGenerator;

$httpClient = new GuzzleClient();
$requestFactory = new HttpFactory();
$streamFactory = new HttpFactory();
$signatureGenerator = new HmacSignatureGenerator('merchant-secret');

$shopBridge = new ShopBridge(
    $httpClient,
    $requestFactory,
    $streamFactory,
    'https://merchant.example.com',
    'sk_live_...',
    $signatureGenerator
);

// Create a checkout session
$createRequest = new CheckoutSessionCreateRequest([
    new CheckoutSessionItemRequest('sku_123', 1),
]);
$session = $shopBridge->checkout()->createSession($createRequest);

// Update the session
$updateRequest = new CheckoutSessionUpdateRequest([
    new CheckoutSessionItemRequest('sku_123', 2),
]);
$session = $shopBridge->checkout()->updateSession($session->getId(), $updateRequest);

// Complete the checkout with a payment token
$completeRequest = new CheckoutSessionCompleteRequest(
    new PaymentData('spt_abc123', 'stripe')
);
$session = $shopBridge->checkout()->completeSession($session->getId(), $completeRequest);
```

### Webhook handling

[](#webhook-handling)

```
use ShopBridge\Services\WebhookService;
use ShopBridge\Support\HmacSignatureValidator;

$validator = new HmacSignatureValidator('merchant-secret');
$webhookService = new WebhookService($validator);

try {
    $event = $webhookService->parseWebhook($payload, $signatureFromHeader, 'merchant-secret');
    // React to the event, for example $event->getData()->getStatus()
} catch (\ShopBridge\Exceptions\InvalidSignatureException $exception) {
    // Signature verification failed — reject the request
} catch (\ShopBridge\Exceptions\TransportException $exception) {
    // Payload is not valid JSON or is missing required ACP fields
}
```

### Product feed export

[](#product-feed-export)

```
use PDO;
use ShopBridge\Models\Common\Currency;
use ShopBridge\Models\Common\Money;
use ShopBridge\ProductFeed\CsvFormatter;
use ShopBridge\ProductFeed\Product;
use ShopBridge\ProductFeed\ProductFeedBuilder;

$pdo = new PDO('mysql:host=localhost;dbname=shop', 'user', 'pass');
$builder = new ProductFeedBuilder(null, new CsvFormatter());

$products = (function () use ($pdo): \Generator {
    $stmt = $pdo->query('SELECT * FROM products');
    while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
        yield new Product(
            $row['sku'],
            $row['title'],
            $row['description'],
            $row['link'],
            new Money((int) $row['price_minor_units'], new Currency($row['currency'])),
            (bool) $row['enable_search'],
            (bool) $row['enable_checkout'],
            $row['availability'],
            (int) $row['inventory_quantity'],
            $row['image_main'],
            json_decode($row['image_additional'], true) ?? []
        );
    }
})();

$csv = $builder->buildString($products);
file_put_contents('feed.csv', $csv);

// For very large catalogs, stream chunks instead of building the entire string in memory:
$stream = fopen('feed.csv', 'w');
foreach ($builder->build($products) as $chunk) {
    fwrite($stream, $chunk);
}
fclose($stream);
```

Project development
-------------------

[](#project-development)

We welcome contributions! Here’s how to get involved.

### Local setup

[](#local-setup)

```
composer install
composer test
composer lint
```

- `composer test` runs PHPUnit.
- `composer lint` runs PHPStan (`phpstan.neon.dist`). Keep the report clean before opening a PR.

### Filing issues

[](#filing-issues)

Helpful reports include:

- What you expected to happen vs. what happened.
- Sample payloads/responses (anonymised), SDK version, PHP version, and `API-Version` header in use.

### Pull request checklist

[](#pull-request-checklist)

1. Fork the repo and create a topic branch.
2. Add tests/docs that cover the change.
3. Run `composer test` and `composer lint` locally.
4. Ensure the code stays compatible with PHP 7.4 (no enums, union types, constructor property promotion, etc.).
5. Reference any related issues or ACP spec updates in the PR description.

### Updating the ACP API version

[](#updating-the-acp-api-version)

The default `API-Version` lives in `src/Http/AcpHttpClient.php`.

### Reference material

[](#reference-material)

- ACP documentation: [agenticcommerce.dev](https://www.agenticcommerce.dev/)
- Official specs and examples: [agentic-commerce-protocol](https://github.com/agentic-commerce-protocol/agentic-commerce-protocol)

The SDK is under active development and not yet recommended for production workloads. If you run into trouble, open an issue and we’ll help out.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance63

Regular maintenance activity

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

Unknown

Total

1

Last Release

224d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4571cb78cf4f9724875666f297ed934fbec20d94390f7175c63b42028ef60491?d=identicon)[MariuszT](/maintainers/MariuszT)

---

Top Contributors

[![MariuszT](https://avatars.githubusercontent.com/u/643860?v=4)](https://github.com/MariuszT "MariuszT (1 commits)")

---

Tags

sdkaiacpagentic commerce protocol

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/shopbridge-shopbridge-php/health.svg)

```
[![Health](https://phpackages.com/badges/shopbridge-shopbridge-php/health.svg)](https://phpackages.com/packages/shopbridge-shopbridge-php)
```

###  Alternatives

[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[shopware/app-php-sdk

Shopware App SDK for PHP

1577.8k1](/packages/shopware-app-php-sdk)

PHPackages © 2026

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