Download the PHP package caspahouzer/lemonsqueezy-api-client without Composer

On this page you can find all versions of the php package caspahouzer/lemonsqueezy-api-client. 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 lemonsqueezy-api-client

LemonSqueezy PHP API Client

Tests Packagist Version Packagist Downloads PHP Version License BuyMeACoffee

A modern, PSR-4 compliant PHP API client for the LemonSqueezy platform. This package provides full coverage of all documented LemonSqueezy REST API endpoints with support for both bearer token authentication and public API access.

Features

Installation

Via Composer (Recommended)

Manual Installation

  1. Download or clone this repository
  2. Add PSR-4 autoloading to your composer.json:

  3. Run composer dump-autoload

Quick Start

Basic Authentication

Public License API (No Authentication)

API Documentation

View Full API Documentation

The comprehensive API documentation includes:

Documentation is automatically generated and deployed to GitHub Pages on each release.

Available Resources

The client provides access to all 19 documented LemonSqueezy API resources. Note that the LemonSqueezy API has specific limitations on which operations each resource supports:

Resource Supported Methods Endpoint Notes
Users list, get /users Read-only
Stores list, get /stores Read-only
Products list, get /products Read-only
Variants list, get /variants Read-only
Prices list, get /prices Read-only
Files list, get /files Read-only
Customers list, get, create, update /customers Supports create/update only (no delete)
Orders list, get /orders Read-only
Order Items list, get /order-items Read-only
Subscriptions list, get, update /subscriptions Supports update only (no create/delete)
Subscription Invoices list, get /subscription-invoices Read-only
Subscription Items list, get, update /subscription-items Supports update only (no create/delete)
Discounts list, get, create, update, delete /discounts Full CRUD support
Discount Redemptions list, get /discount-redemptions Read-only
License Keys activate, validate, deactivate /licenses/* Public API (no auth required)
Webhooks list, get, create, update, delete /webhooks Full CRUD support
Checkouts list, create /checkouts Supports create only (no update/delete)
Affiliates list, get /affiliates Read-only
Usage Records list, get, create /usage-records Supports create only (no update/delete)

→ See docs/API_COVERAGE.md for complete endpoint checklist with all methods and accurate API capability mapping

Query Building

Use the fluent query builder for advanced filtering, sorting, and pagination:

Error Handling

The client throws specific exceptions for different error conditions:

Unsupported Operations

The LemonSqueezy API has specific limitations on which operations each resource supports. Attempting an unsupported operation will throw UnsupportedOperationException:

Note: Supported write operations are clearly marked in the docs/API_COVERAGE.md.

Special API Operations

Some resources support special action endpoints beyond standard CRUD operations:

See docs/API_COVERAGE.md for all available special operations.

Batch Operations

The client supports efficient bulk processing of resources through batch operations. Execute multiple create, update, and delete operations in a single batch with intelligent rate limiting.

Quick Start

Batch Methods

1. Create Multiple Resources

2. Update Multiple Resources

3. Delete Multiple Resources

4. Mixed Operations

Configuration Options

Handling Results

Rate Limiting

Batch operations automatically respect the API's 300 requests/minute rate limit:

Advanced Configuration

Custom HTTP Client

With Logger (PSR-3)

Webhook Signature Verification

The client includes comprehensive webhook signature verification to securely validate incoming webhooks from LemonSqueezy. The verification uses HMAC-SHA256 with timing-safe comparison to prevent timing attacks.

Setup with Configuration

Method 1: Using the Client Convenience Method

The simplest approach for integration:

Method 2: Using WebhookVerifier Directly (Standalone)

For standalone use without a client instance:

Method 3: Using WebhookVerifier with Config

Method 4: Boolean Check (Non-Exception)

For cases where you prefer boolean returns:

Working with PSR-7 Streams

The verification supports PSR-7 StreamInterface for flexible webhook body handling:

Exception Handling

Different error scenarios throw specific exception codes:

Security Features

Webhook Event Listeners

The framework includes a powerful event dispatcher system for handling webhooks. Register listeners for specific webhook events and they will be automatically executed when webhooks are received.

Quick Start

Features

Supported Events

All LemonSqueezy webhook events are supported:

→ See docs/WEBHOOKS.md for comprehensive webhook listener documentation with examples

Examples

Using Closures:

Using Listener Classes:

Multiple Listeners for One Event:

Example: Complete Webhook Endpoint

See examples/webhook_listener.php for a complete working example.

Response Models

All responses are hydrated into model objects with convenient property accessors:

Rate Limiting

The client automatically tracks rate limits (300 requests per minute). If a rate limit is exceeded, a RateLimitException is thrown:

Testing

Requirements

License

MIT. See LICENSE file for details.

Support

For issues, feature requests, or contributions, please visit the GitHub repository.

API Documentation

For complete API documentation, visit LemonSqueezy API Docs.


All versions of lemonsqueezy-api-client with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.0
psr/log Version ^1.0 || ^2.0 || ^3.0
psr/simple-cache Version ^1.0 || ^2.0 || ^3.0
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 caspahouzer/lemonsqueezy-api-client contains the following files

Loading the files please wait ...