revkeen / sdk-php
RevKeen is a fintech-grade API for payments, subscriptions, invoices, and billing. The canonical production MCP server is available at `https://mcp.revkeen.com/mcp`. **API Version:** `2026-05-01` — Pin with the `RevKeen-Version` header. **Quick Links:** [Full Documentation](https://docs.revkeen.co
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-08-25 19:24:21 UTC
README
Important
This repository is a generated release mirror. Propose source changes in
RevKeen/revkeen; main here is updated only by an explicit reviewed SDK release.
Official PHP client for the RevKeen API — auto-generated from the OpenAPI specification via OpenAPI Generator.
Installation
composer require revkeen/sdk-php
Requires PHP 8.1 or later.
Quick Start
<?php use RevKeen\Client; $client = new Client(getenv('REVKEEN_API_KEY')); $customers = $client->customers->list(['limit' => 10]); foreach ($customers->data as $customer) { echo $customer->name . ' ' . $customer->email . "\n"; }
Authentication
API Key (recommended for server-to-server)
$client = new Client(getenv('REVKEEN_API_KEY'));
OAuth 2.1 (recommended for MCP and third-party integrations)
$client = new Client( options: new ClientOptions( oauthClientId: getenv('REVKEEN_CLIENT_ID'), oauthClientSecret: getenv('REVKEEN_CLIENT_SECRET'), scopes: ['customers:read', 'invoices:read'], ) );
See the OAuth guide for details.
Resources
Every API resource is available as a property on the client:
| Resource | Method examples |
|---|---|
$client->customers |
list(), create(), get(), update(), delete() |
$client->invoices |
list(), create(), get(), update(), finalize(), send(), void() |
$client->subscriptions |
list(), create(), get(), update(), cancel(), pause(), resume() |
$client->products |
list(), create(), get(), update(), delete() |
$client->payments |
list(), create(), get() |
$client->checkoutSessions |
create(), get() |
$client->discounts |
list(), create(), get(), update(), delete() |
$client->creditNotes |
list(), create(), get() |
$client->paymentLinks |
list(), create(), get(), update() |
$client->paymentMethods |
list(), get(), detach() |
$client->webhookEndpoints |
list(), create(), delete() |
$client->events |
list(), get() |
$client->entitlements |
list(), check() |
Webhook Verification
<?php use RevKeen\Webhooks; use RevKeen\WebhookSignatureVerificationException; try { $event = Webhooks::constructEvent( $payload, $signature, getenv('REVKEEN_WEBHOOK_SECRET') ); if ($event['type'] === 'invoice.paid') { echo 'Invoice paid: ' . $event['data']['id']; } } catch (WebhookSignatureVerificationException $e) { http_response_code(400); echo $e->getMessage(); }
Error Handling
<?php use RevKeen\Exceptions\ApiException; try { $customer = $client->customers->get('cus_nonexistent'); } catch (ApiException $e) { echo "API error {$e->getStatusCode()}: {$e->getMessage()}"; }
Configuration
<?php use RevKeen\Client; use RevKeen\ClientOptions; $client = new Client( apiKey: getenv('REVKEEN_API_KEY'), options: new ClientOptions( // Staging environment baseUrl: 'https://staging-api.revkeen.com', ) );
Compatibility
- Runtime: PHP 8.1+
- Frameworks: Laravel, Symfony, WordPress, and general PHP
- PSR-4 autoloading