Requirements
- PHP 8.1+
- Composer
Installation
Install the SDK with Composer:Configuration
The SDK resolves configuration in this order:- Config array passed directly to
Client - Environment variables (
PAYDIOS_SECRET_KEY,PAYDIOS_BASE_URL) - Default base URL (
https://api.paydios.io)
Environment variables (recommended)
Create a.env file in your project root and add your secret key:
Passing config manually
If you prefer to configure the client explicitly, pass an array when creating the instance:Quick Start
Once the SDK is installed and your secret key is set in your environment, you can make your first API call:Authentication
All Merchant API requests are authenticated with a Bearer token:Products API
The merchant identity is inferred from your secret key, so you do not need to pass a merchant ID to product endpoints. The SDK uses the following endpoints:List products
Retrieve a paginated list of your products. Usesearch to filter by keyword:
Create product
Create a new product. Setstatus to draft to keep it unpublished until ready:
Get product
Retrieve a single product by its ID:Update product
Update one or more fields on an existing product. Changestatus to published to make it live:
Delete product
Permanently delete a product:Checkout Sessions
Use checkout sessions for backend-driven payment flows. The session returns acheckout_url you can redirect your customer to, and a session_id you use to verify the result after payment.
The SDK uses these endpoints:
Create checkout session
Create a session for a specific transaction. Pass your Merchant ID (available in the merchant dashboard):Verify checkout session
After the customer completes payment, verify the session status on your server:Testing
The SDK ships with unit tests (mocked HTTP) and optional integration tests that run against a real API.Run unit tests
Integration tests (real API)
Integration tests are skipped unless you explicitly enable them. Add the following to your.env:
Laravel Usage
For Laravel-specific setup — includingconfig/services.php registration, controller examples, and the singleton pattern — see the dedicated Laravel integration guide.
Common Errors
Missing secret key
If the SDK cannot find a secret key, requests will fail with an authentication error. Make sure your environment includes:secret_key key is present in the array passed to Client.
Security Notes
- Never expose your secret key in frontend or client-side code.
- Use the publishable key for client-side checkout flows.
- Use the secret key only in your server-side backend code.
Resources
Paydios PHP SDK on GitHub
Browse the source code, open issues, and contribute to the SDK.
Packagist Package
View the Composer package on Packagist for version history and install stats.