Introducing Open Payments PHP: A New Bridge for Financial Interoperability
Written by Adi Borosπ― Why Open Payments Matters
The Open Payments standard is reshaping how applications initiate, manage, and complete digital transactions β enabling truly interoperable financial systems across different wallets, services, and financial institutions.
But while the specification has seen growing adoption across JavaScript platforms, there was one massive gap: PHP developers, who still power a huge portion of the web, had no simple, native way to implement Open Payments in their applications.
Today, weβre excited to change that with the release of Open Payments PHP β an open-source library that makes it easy for PHP applications to participate in the future of financial interoperability.
π‘ What We Built: Open Payments PHP
interledger/open-payments-php is a modern, Composer-installable PHP package that provides full client support for the Open Payments API. It includes:
β Full support for Grants, Incoming Payments, Outgoing Payments, Quotes, and Token management.
β Built for PHP 8.3+, using strict typing, PSR-4 autoloading, and Composer dependency management.
β Clean, service-oriented architecture:
Services/
: Interact with the Open Payments endpoints.Models/
: Represent API resources like grants, payments, and quotes.Validators/
: Validate API request payloads before sending.
β Fully tested with PHPUnit, ready for production use.
Hereβs what it looks like to request a grant:
use OpenPayments\AuthClient;use OpenPayments\Config\Config;
$config = new Config( $WALLET_ADDRESS, $PRIVATE_KEY, $KEY_ID);$opClient = new AuthClient($config);
$wallet = $opClient->walletAddress()->get([ 'url' => $config->getWalletAddressUrl()]);
$grant = $opClient->grant()->request( [ 'url' => $wallet->authServer ], [ 'access_token' => [ 'access' => [ [ 'type' => 'incoming-payment', 'actions' => ['read', 'complete', 'create', 'list' ] ] ] ], 'client' => $config->getWalletAddressUrl() ]);
With just a few lines of code, PHP developers can now create grants, request quotes, initiate outgoing payments, or complete incoming payments β all fully compliant with Open Payments specifications (including generating HTTP signature headers).
Detailed fully functional code snippets covering all endpoints can be found on the Open Payments PHP Snippets repo.
π οΈ How It Works: Inside the Library
At its core, Open Payments PHP is designed around simplicity and modularity. The library is structured into clear layers, making it easy for developers to jump in, extend, or contribute:
π Project Structure
Folder | Purpose |
---|---|
Contracts/ | Interface definitions (routes) for Services |
Services/ | Interact with Open Payments endpoints like grants, payments, quotes |
Models/ | Data models representing Open Payments resources |
Validators/ | Input validation logic before making API calls |
Traits/ | Helpers like ID parsing and URL extraction |
Utils/ | Utility functions used for the http signature |
Each service corresponds directly to parts of the Open Payments API. For example:
- GrantService handles grant requests and continuations.
- QuoteService manages the creation and retrieval of quotes.
- IncomingPaymentService handles creation and retrieval of IncomingPayments.
- OutgoingPaymentService covers creation and retrieval of OutgoingPayments.
All these services are incorporated into the main AuthClient and can be used directly from the client like in the above examples. Developers interact mainly through these service classes, without worrying about low-level HTTP requests or Open Payments internal mechanics, like the http signatures β the library abstracts that complexity away.
π Why It Matters for the PHP Community
PHP remains one of the most widely used languages across the web β powering platforms like WordPress, Laravel, Drupal, and countless custom-built applications.
By bringing first-class Open Payments support to PHP, we unlock:
π Broader ecosystem participation: more web apps, e-commerce platforms, and financial services can integrate Open Payments without switching tech stacks.
π Faster innovation: developers can focus on building user-facing products instead of re-implementing complex financial protocols.
π‘οΈ Secure by default: thanks to strict type enforcement, request validation, and adherence to the Open Payments specification.
π€ Stronger community collaboration: easier onboarding for teams that already speak PHP.
This marks an important step toward making Open Payments truly universal across different languages and platforms.
π Whatβs Next
Weβre just getting started!
Hereβs whatβs coming soon for Open Payments PHP:
π Open Payments official documentation will soon include usage examples (snippets) for the PHP library also.
π₯ Example projects β showcasing integration with popular frameworks like Laravel, Symfony Console apps (Snippets library), and WordPress - ecommerce - plugins.
π€ Community-driven development β pull requests, issues, and feature discussions are welcome!
We encourage developers to test the library, provide feedback, open issues, or submit pull requests. Together, we can grow the Open Payments ecosystem across the entire PHP world.
π Resources
GitHub: interledger/open-payments-php
GitHub: interledger/open-payments-php-snippets
As we are open source, you can easily check our work on GitHub. If the work mentioned here inspired you, we welcome your contributions. You can join our community slack or participate in the next community call, which takes place each second Wednesday of the month.
If you want to stay updated with all open opportunities and news from the Interledger Foundation, you can subscribe to our newsletter.