There's a moment every backend developer knows: you're staring at an API's raw HTTP docs, copy-pasting curl examples, and slowly building a mental model of what the response shape will be. It works. But it shouldn't have to feel like this.
When I started wiring up Mono for recurring debit and mandate workflows, I kept thinking — someone should just wrap this cleanly. So I did.
Meet itamelions/mono-php-sdk — a PHP SDK for the Mono API.
The Inspiration: Standing on Good Shoulders
If you've ever integrated Paystack in PHP, you've probably encountered yabacon/paystack-php. It's the gold standard for what an SDK feels like TO ME, zero ceremony, obvious method names, and an API surface that maps naturally to the docs.
That's the bar I set for this SDK. Not just "makes API calls work," but genuinely enjoyable to integrate.
What It Does
The SDK covers the core Mono workflows you'll actually need in production:
- Customer management — create and retrieve customers
- Mandate lifecycle — initiate, query, and manage direct debit mandates
- Debit operations — charge debits and pull transaction history
- Webhook verification — cryptographically verify incoming Mono webhook signatures
- Structured error handling — typed exceptions instead of raw HTTP status codes
No framework lock-in. No magic. No black boxes.
Installing It Takes About 10 Seconds
composer require itamelions/mono-php-sdk
The Design Philosophy (The Boring-but-Important Stuff)
A few principles drove every decision:
1. Resource-oriented method names.
customer(), mandate(), debit() — if you've seen the Mono docs once, you'll know exactly where to look.
2. Arrays all the way down.
No custom response objects to learn. You get arrays. You know how to use arrays.
3. Explicit errors.
HTTP 422s and 429s shouldn't silently fail. The SDK throws typed exceptions with meaningful messages so you know exactly what went wrong and where.
4. Built for testing.
HTTP clients are injectable — mock them in your test suite without hacks.
5. Docs that reflect real usage.
Examples are drawn from actual integration flows, not hypothetical endpoints.
Most of these improvements came from real sandbox testing and the kind of edge cases you only discover when something breaks at 2am.
If this package shaves an afternoon off your next Mono integration, that's the whole point. Contributions, issues, and feedback are genuinely welcome.
Top comments (0)