The Stripe PHP package gives PHP applications typed access to Stripe API resources, installable via Composer or a manual download.
Overview
Stripe PHP bindings wrap Stripe’s HTTP API for applications written in PHP. They ship with predefined resource classes that populate themselves from API responses, which helps the client track API shape changes across versions.
You install the library through Composer or by downloading a release and including the initializer. Runtime requires PHP from the supported range stated in the project docs, along with standard PHP extensions for HTTP and JSON handling that Composer normally pulls in.
Usage supports both newer client and service patterns and older integration styles from before those patterns were introduced. Configuration covers custom timeouts, proxies, logging through PSR-3 loggers, per-request API keys for Connect-style multi-account apps, CA bundles, automatic retries with idempotency keys, and optional telemetry that can be turned off.
The package also documents preview and alpha SDK suffixes, rawRequest for undocumented or private beta endpoints from recent major versions, and helpers for plugins to identify themselves via setAppInfo.
Key features
- Dynamic API resource classes
- Composer installation
- Client and legacy API patterns
- Configurable HTTP timeouts
- Automatic retries with idempotency
- PSR-3 logging support
- Per-request API keys
- Custom and raw API requests
Use cases
- Accepting payments in PHP apps
- Server-side Stripe API integration
- Stripe Connect multi-account flows
- PHP e-commerce billing backends