Loki_AgenticCommerceAcp
What this module does
A thin Agentic Commerce Protocol (ACP) binding for Loki_AgenticCommerce.
It only contains an ACP payload mapper, an error renderer and an optional signature authenticator. All checkout logic
lives in Loki_AgenticCommerce.
Endpoints
| Method | Path |
|---|---|
| POST | /acp/checkout_sessions |
| GET | /acp/checkout_sessions/{id} |
| POST | /acp/checkout_sessions/{id} |
| POST | /acp/checkout_sessions/{id}/complete |
| POST | /acp/checkout_sessions/{id}/cancel |
Paths can be changed by overriding the virtualTypes Loki\AgenticCommerceAcp\Endpoint\* in your own di.xml.
Configuration
Stores > Configuration > Loki > Loki Agentic Commerce > Agentic Commerce Protocol (ACP)
- Enabled
- Signing Secret: when set, requests need an HMAC-SHA256
Signatureheader over.{body}and aTimestampheader that is no more than 5 minutes old (on top of the bearer token).
Every ACP request needs a bearer token (Authorization: Bearer <key>) with one of the API keys configured in
Loki_AgenticCommerce, also when a signing secret is set: a valid signature alone is rejected.
payment_data.provider is matched against the ID of a payment handler registered in Loki_AgenticCommerce. An
ap2 object in the complete request is passed on as payment mandate (see Loki_AgenticCommerceAp2).
Testing without an AI
bin/magento loki:agentic-commerce:acp:simulate plays the role of an AI agent by replaying the JSON scenarios in
Test/Fixtures/Scenarios, in-process or over HTTP (--url). See TESTING.md for the full test plan and
stories/ for the documented behaviour.
Installation
Install this package via composer:
composer require loki/magento2-agentic-commerce-acp
Next, enable this module:
bin/magento module:enable Loki_AgenticCommerceAcp
Current status
@dev
to the composer command.
Support
For getting support, create an Issue under the following project URL:
https://gitlab.yireo.com/loki-extensions/Loki_AgenticCommerceAcp.git
Composer details
Loki_AgenticCommerceAcploki/magento2-agentic-commerce-acp
php: >=8.2 <8.6
loki/magento2-agentic-commerce: @dev | >=0.0.1
magento/framework: ^103.0
magento/module-store: ^101.1
Releases
Changelog
Added
- Initial implementation
- Fake AI agent
bin/magento loki:agentic-commerce:acp:simulatewith JSON scenarios - User stories in
stories/and a test plan inTESTING.md
Fixed
- Require the bearer token for every ACP request, also when a valid signature is sent