# magebitcom/magento2-module-agentic-commerce

> Magebit Agentic Commerce extension

`composer require magebitcom/magento2-module-agentic-commerce`

Canonical URL: https://packagento.com/magebitcom/magento2-module-agentic-commerce

## At a glance

- **Vendor**: magebitcom (https://packagento.com/magebitcom.md)
- **Latest version**: 0.0.1 — released 2025-10-13
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/magebitcom/magento2-module-agentic-commerce and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require magebitcom/magento2-module-agentic-commerce:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Magebit Agentic Commerce extension

## README

This module makes your store compatible with AI-powered shopping experiences like OpenAI's "Instant Checkout" in ChatGPT.

This is the first Open-Source module that enables Agentic Commerce features in Magento 2 / Adobe Commerce stores (such as Shop in ChatGPT). The module is Hyva and Adobe Commerce Cloud compatible.

[Agentic Commerce Protocol (ACP)](https://www.agenticcommerce.dev/) is an open standard that enables a conversation between buyers, their AI agents, and businesses to complete a purchase.

**This module is currently actively under development by Magebit and is open to public contributions.**

### Features

- [x] ChatGPT Compatible Product Feed Export
- [x] Instant Checkout Ready
- [x] Agentic Checkout Configuration (according to ACP)
- [x] Agentic Checkout webhooks
- [x] Delegated Payment Support

### Requirements

- PHP >= 8.1
- Stripe Payments (only if using checkout)

### Installation

#### As a composer package

```
composer require magebitcom/magento2-module-agentic-commerce
```

Run `bin/magento setup:upgrade`

#### As a module

1. Download latest release files and extract them under `app/code/Magebit/AgenticCommerce`
2. Run `bin/magento setup:upgrade`

### Configuration

You can find the Module's configuration under `Stores -> Settings -> Configuration -> Magebit -> Agentic Commerce`:
Make sure to configure Product Feed settings before running an export.

<img width="1486" height="864" alt="image" src="https://github.com/user-attachments/assets/14ae49c3-33be-45e0-b539-89856997f557" />


Additionally, there are settings at the product level. Here you can configure product visibility in Agentic search and whether to allow
Agentic Checkout.

<img width="1799" height="320" alt="image" src="https://github.com/user-attachments/assets/5cc8b68f-5ec2-40a4-b0ca-fd806ef38b2d" />


### ACP Ready Product Feed

To export the product feed, use the `magebit:agentic-commerce:export` Magento command:

```
Usage:
  magebit:agentic-commerce:export [options]

Options:
  -s, --store=STORE     Store ID to export products from [default: 1]
  -o, --output=OUTPUT   Output file path. Relative to var directory [default: "export/agentic_commerce.csv"]
```

### Configuring Feed Mapping

Exported product attributes are mapped using the `ac_product_feed_mapping.xml` config file. To adjust the mapping,
create a new `ac_product_feed_mapping.xml` config file and add or overwrite existing mappings.

```xml
<mapping id="id">
    <source_attribute>sku</source_attribute>
    <target_attribute xsi:type="const">Magebit\AgenticCommerce\Api\Data\Spec\ProductInterface::ID</target_attribute>
</mapping>
```

- `id` is a unique identifier for the mapping
    - `source_attribute` is the Magento 2 product attribute
    - `target_attribute` is the attribute code that will be used in the feed
    - `formatter` (optional) is a Magento 2 class that formats the attribute value

Source Attribute value can be a `string` or an `object`:

```xml
<mapping id="link">
    <source_attribute xsi:type="object">Magebit\AgenticCommerce\Model\Mapping\Source\Url</source_attribute>
    <target_attribute xsi:type="const">Magebit\AgenticCommerce\Api\Data\Spec\ProductInterface::LINK</target_attribute>
</mapping>
```

Source classes must implement the `Magebit\AgenticCommerce\Api\Mapping\SourceInterface` interface.

Check out the default `ac_product_feed_mapping.xml` config for a full reference.

### Delegated Payments

By default, this module does not store any payment data as the implementation logic will be different depending on what PSP is used by the merchant. To enable delegated payments, it's required to implement a
class that implements `Magebit\AgenticCommerce\Api\PaymentMethodVaultHandlerInterface` and handles the storage of the
payment method data. Payment Method Vault handler will receive `DelegatePaymentRequestInterface` object and must return a vault token.

An example for an imaginary FooBar payment service provider:
```php
<?php

namespace My\Module\AgenticCommerce\Model;

use Magebit\AgenticCommerce\Api\PaymentMethodVaultHandlerInterface;
use Magebit\AgenticCommerce\Api\Data\Request\DelegatePaymentRequestInterface;

class FooBarPaymentVaultHandler implements DelegatePaymentRequestInterface
{
    /**
     * @param DelegatePaymentRequestInterface $request 
     * @return bool 
     */
    public function canStore(DelegatePaymentRequestInterface $request): bool
    {
        return $request->getPaymentMethod()->getType() === 'card';
    }

    /**
     * @param DelegatePaymentRequestInterface $request 
     * @return string 
     */
    public function handle(DelegatePaymentRequestInterface $request): string
    {
        $fooBarVaultToken = $this->fooBarPaymentsApi->createPaymentMethod([
            'type' => 'card',
            'number' => $request->getPaymentMethod()->getNumber(),
            'expMonth' => $request->getPaymentMethod()->getExpMonth(),
            'expYear' => $request->getPaymentMethod()->getExpYear(),
            'cvc' => $request->getPaymentMethod()->getCvc(),
        ]);

        return $fooBarVaultToken->id;
    }
}
```

Vault handler class must be registered in di.xml:

```xml
<type name="Magebit\AgenticCommerce\Service\DelegatePaymentService">
    <arguments>
        <argument name="paymentMethodVaultHandlers" xsi:type="array">
            <item name="foo_bar" xsi:type="object">My\Module\AgenticCommerce\Model\FooBarPaymentVaultHandler</item>
        </argument>
    </arguments>
</type>
```

#### Handling place order requests

See: `Magebit\AgenticCommerce\Model\Payment\StripePaymentsHandler`

### Contributing

Found a bug, have a feature suggestion or just want to help in general? Contributions are very welcome! Check out the list of active issues or submit one yourself.

### Implementation as a Service

_(README truncated for .md surface. Full README on https://packagento.com/magebitcom/magento2-module-agentic-commerce.)_

## Recent Versions

| Version | Released |
|---|---|
| 0.0.1 | 2025-10-13 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magebitcom/magento2-core | 0.1.* |
| magento/framework | * |
| php | >=8.1 |
| symfony/validator | ^7.3 |

### Suggest

| Package | Constraint |
|---|---|
| stripe/stripe-payments | * |

## Quality

Latest release (0.0.1) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | 1 | – |
| 2.4.9 | – | – | 1 | 1 |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 54 | 54 warnings (ruleset: Magento2), 8 auto-fixable with phpcbf |
| PHPMD | Warning | 9 | 9 rule violations (UnusedPrivateField:8, NumberOfChildren:1) |
| Cpd | Warning | 10 | 10 duplicated chunks spanning 376 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 2 | valid; 2 advisory notes (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 31 | 31 | – | – |
| 2.4.8 | – | 31 | 32 | – |
| 2.4.9 | – | – | 32 | 32 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["magebitcom/magento2-module-agentic-commerce"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

magebitcom is a Magento 2 vendor on Packagento. See https://packagento.com/magebitcom.md for their full catalogue.

