Skip to main content
The Paydios PHP SDK lets you integrate payment processing into any PHP application. It wraps the Merchant API and handles authentication, request formatting, and error handling for you — so you can manage products, create checkout sessions, and verify payments without writing raw HTTP calls.
This SDK is for server-side (merchant backend) use only. Never expose your secret key in frontend code or commit it to version control.

Requirements

Installation

Install the SDK with Composer:

Configuration

The SDK resolves configuration in this order:
  1. Config array passed directly to Client
  2. Environment variables (PAYDIOS_SECRET_KEY, PAYDIOS_BASE_URL)
  3. Default base URL (https://api.paydios.io)
This means you can rely on environment variables for credentials and only override when needed. Create a .env file in your project root and add your secret key:
Using environment variables keeps your credentials out of source code. Never commit your .env file to version control — add it to .gitignore.

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:
The SDK sets this header automatically using the secret key you provide. You never need to construct or attach authorization headers manually.

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. Use search to filter by keyword:

Create product

Create a new product. Set status 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. Change status 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 a checkout_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:
Then run:

Laravel Usage

For Laravel-specific setup — including config/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:
If you are passing config manually, confirm the 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.