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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package whop-php-sdk

Whop PHP SDK

CI PHP PHPStan

[!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.0 is 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

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 by symfony/http-client. This is intentionally different from Symfony's framework-native HttpClientInterface, 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: HttpClientInterface is for Symfony-native consumers; Psr18Client bridges 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

PHP Build Version
Package Version
Requires php Version ^8.4
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0
php-http/discovery Version ^1.19
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package devmatchable/whop-php-sdk contains the following files

Loading the files please wait ...