Payment Gateway API for Developers
Integrate EPaySe through a RESTful API with HMAC-SHA256 request signing, webhooks, and a sandbox to test before you go live.
Choose Your Integration Path
Start accepting payments in the way that works best for your stack.
Sandbox Quick Start
Get started with our RESTful API and make your first transaction in the sandbox
SDKs Planned
PHP, JavaScript, and Python libraries are on the roadmap — the RESTful API works today, no SDK required
WooCommerce Plugin
Accept payments on WooCommerce with the EPaySe plugin, or integrate any other platform through the RESTful API
Simple, Powerful API
Clean, intuitive code that gets you up and running quickly.
<?php
$gateway = 'https://gateway.epayse.com';
$apiKeyId = getenv('EPAYSE_API_KEY_ID');
$secretKey = getenv('EPAYSE_SECRET_KEY'); // sk_test_... for sandbox
$path = 'api/v1/transaction/create';
$body = '{"ref":"ORDER-1001","amount":100.5,"currency":"USD","websiteUrl":"https://example.com","redirectUrl":"https://example.com/payment/success","cancelUrl":"https://example.com/payment/cancel","description":"Premium subscription - monthly","customerDetails":{"firstName":"John","lastName":"Doe","email":"[email protected]","country":"US","ip":"203.0.113.10","phoneCode":"US","phoneNumber":"5551234567"}}';
$timestamp = time();
$nonce = bin2hex(random_bytes(16));
$signature = hash_hmac('sha256', implode('|', ['POST', $path, $timestamp, $nonce, $body]), $secretKey);
$ch = curl_init($gateway . '/' . $path);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $body,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-Api-Key-Id: ' . $apiKeyId,
'X-Signature: ' . $signature,
'X-Timestamp: ' . $timestamp,
'X-Nonce: ' . $nonce,
'X-Signature-Version: 3',
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
if (($response['status'] ?? null) !== 'SUCCESS') {
error_log('EPaySe error: ' . json_encode($response));
exit(1);
}
// Redirect the customer to the checkout page
header('Location: ' . $gateway . $response['data']['checkoutUrl']);Everything you need to process payments
- Multi-PSP routing for higher success rates
- Built-in fraud prevention and risk management
- Real-time webhook notifications
- Comprehensive error handling
- HMAC-SHA256 request signing with replay protection
- Extensive code examples and guides
SDKs & Libraries — Planned
Type-safe, well-documented libraries, planned for PHP, JavaScript, and Python. The RESTful API is available today.
PHP SDK
Composer-ready library with Laravel integration
Planned install command — not yet published
composer require epayse/php-sdkJavaScript SDK
NPM package with TypeScript support and React hooks
Planned install command — not yet published
npm install @epayse/sdkPython SDK
Pip-installable package with async support
Planned install command — not yet published
pip install epayseE-Commerce Platform Plugins
The WooCommerce plugin is available on request. For any other stack, the RESTful API and hosted checkout work today.
Developer Resources
Everything you need to integrate, test, and scale your payment solution.
Ready to Start Building?
Read the docs, open a sandbox account, and run your first test payment today.