Kai Ole Hartwig

sylius-mpp — a price that is actually enforced.

The bundle serves an OpenAPI 3.1 document at /openapi.json and annotates payable operations with x-payment-info. The prices come from the same table that x402 enforces. Every payable operation also declares its 402.

An advertised price that nobody charges is false information.

API Platform publishes its OpenAPI document at /docs.jsonopenapi. MPP discovery looks for exactly /openapi.json and nowhere else. A shop that already serves a complete and correct document is therefore still not discoverable for MPP — the bundle closes precisely that gap instead of talking the discovery side into making an exception.

The prices in x-payment-info come from the same table that enforcement reads from. A route therefore cannot advertise a price it does not charge. With two sources, the divergence would only be a matter of time — and it would surface only once an agent pays the advertised amount and is rejected anyway.

Every payable operation additionally declares its 402 response in the schema. A client reading the document therefore knows in advance that this route will require a payment, and can plan for it — instead of treating the 402 as an error it did not expect.

Advertising and enforcement from the same table

Sylius: 2.0+ · PHP: 8.2+ · Licence: MIT · Version: 1.0.0

Source code & documentation

Composer package

MIT · Sylius 2.0+ · PHP 8.2+

composer require koh/sylius-mpp

Built, tested and published under MIT. Public distribution via Packagist is being prepared (coming soon).

Part of the family

MIT

This package belongs to koh/sylius-agent-ready — seventeen bundles that make a Sylius shop usable for AI agents. Each one can be deployed on its own.

To the overview
Part of the family