Download the PHP package devmatchable/whop-php-sdk without Composer
On this page you can find all versions of the php package devmatchable/whop-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package whop-php-sdk
Whop PHP SDK
[!WARNING] This package is in active development and is not yet ready for production use. The public API may change at any time before version
1.0.0is released. Please do not depend on it in production projects until a stable release is published.
Framework-agnostic PHP client for the Whop API. Built on pure PSR interfaces (PSR-18 / PSR-17 / PSR-7) — drop it into any PHP 8.4+ project without pulling in a framework or opinionated HTTP stack.
Requirements
- PHP 8.4+
- A PSR-18 HTTP client and a PSR-7/17 implementation (your choice — see below)
Installation
The SDK declares only the PSR interface packages and php-http/discovery in its
require block. Concrete HTTP implementations are not bundled — you pick what fits
your stack.
Recommended: nyholm/psr7 (PSR-7 + PSR-17) paired with symfony/http-client
(PSR-18) work well together:
Any other PSR-18 client (guzzlehttp/guzzle, etc.) and any PSR-7/17 implementation
work as drop-in replacements.
[!NOTE] The SDK uses
Symfony\Component\HttpClient\Psr18Client— the PSR-18 adapter shipped bysymfony/http-client. This is intentionally different from Symfony's framework-nativeHttpClientInterface, which has a non-PSR shape and isn't compatible with this SDK (or any other PSR-18 consumer). The two interfaces ship from the same package but solve different problems:HttpClientInterfaceis for Symfony-native consumers;Psr18Clientbridges the same underlying client to the PSR-18 standard the SDK type-hints against.
Quick start
PSR-17 request and stream factories are auto-discovered at construction time via
php-http/discovery when you omit them. Pass requestFactory: and streamFactory:
explicitly if you want to control which implementation is used.
Error handling
Every failure surfaces as a WhopException — network problems, non-2xx responses,
bad JSON, and shape mismatches all go through the same base type, so a single catch
covers everything:
When you need to distinguish the failure mode, catch a specific subtype:
The five concrete exception types:
| Exception | When it's thrown |
|---|---|
WhopApiException |
The API returned an HTTP 4xx or 5xx response |
TransportException |
A network-level PSR-18 failure (connection refused, timeout, etc.) |
SerializationException |
The request body couldn't be JSON-encoded, or the response body couldn't be decoded |
MissingArgumentsException |
A required field was absent or invalid when hydrating a typed DTO |
WebhookVerificationException |
Webhook signature, timestamp, or header verification failed |
WhopApiException exposes two public readonly properties: statusCode (int) and
responseBody (array).
Configuration
The full constructor signature:
To target the Whop sandbox instead of production, pass the sandbox base URL:
If requestFactory or streamFactory is omitted and no PSR-17 implementation is
installed, the constructor throws Http\Discovery\Exception\NotFoundException at
construction time.
Webhook verification
WebhookVerifier implements the Standard Webhooks
specification. Both whsec_ (production) and ws_ (sandbox) secret formats are
supported — construct it with whichever secret is configured in your Whop dashboard:
$requestHeaders is a case-insensitive array mapping header names to values. The
verifier checks for webhook-id, webhook-timestamp, and webhook-signature and
enforces a 5-minute timestamp tolerance.
Resources
Access the API through resource properties on $client. Each method returns a typed
DTO where one exists, otherwise the raw decoded array:
The SDK covers the full Whop API surface across 57 resource groups. Per-endpoint method signatures and response shapes are documented in the GitHub Wiki.
A quick map of what's available:
| Group | Properties |
|---|---|
| Core | $companies, $accountLinks, $files, $accessTokens, $authorizedUsers, $users, $members, $webhooks |
| Payments & Billing | $payments, $checkouts, $plans, $products, $memberships, $refunds, $invoices, $promoCodes, $paymentMethods, $setupIntents |
| Platform & Finance | $transfers, $feeMarkups, $topups, $withdrawals, $ledgerAccounts, $payoutAccounts, $payoutMethods |
| Disputes | $disputes, $disputeAlerts, $resolutionCenter |
| Commerce | $shipments, $leads, $entries, $reviews, $affiliates, $stats |
| Experiences & Courses | $experiences, $courses, $courseChapters, $courseLessons, $courseLessonInteractions, $courseStudents |
| Communication | $chatChannels, $dmChannels, $dmMembers, $messages, $reactions, $forums, $forumPosts, $supportChannels, $notifications |
| Advertising | $adCampaigns, $adGroups, $ads |
| Apps & AI | $apps, $appBuilds, $aiChats, $tokenTransactions |
| Verifications | $verifications |
Development
License
MIT — see LICENSE.
All versions of whop-php-sdk with dependencies
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0
php-http/discovery Version ^1.19