Payment APIs
Comprehensive API documentation for integrating payment processing into your applications.
Secure & Compliant
Bank-level encryption and enterprise-grade infrastructure to protect your transactions.
Fast Processing
Real-time transaction processing with optimized infrastructure for fast responses.
Global Support
Multi-currency support and international payment methods for global reach.
Encrypted Payloads
AES-256-CBC encryption on all payment API requests and responses using your merchant Encryption Key.
Overview
The PayoFlux Payment API provides a unified interface for processing payments across multiple payment methods, including charge (card), alternative payment methods (APM), crypto payments, reconciliation, and payment links.
Base URL & Environments
All API requests should be made to the following base URL:
Base URL
https://api.payoflux.comThe difference between live and test environments is in the API path:
Live Endpoints
https://api.payoflux.com/api/live/...Test Endpoints (Testing)
https://api.payoflux.com/api/test/...Note
Authentication
All payment API endpoints require authentication using an API key. Include your API key in the Authorization header:
Authorization Header
Authorization: Bearer your_api_key_or_sandbox_api_keyImportant
You can obtain your API keys from your merchant dashboard after completing the onboarding process.
Payload Encryption
For server-to-server integrations, encrypt your request body before sending it to PayoFlux and decrypt the encrypted response on your server. This protects sensitive payment data in transit using AES-256-CBC with your merchant-specific Encryption Key.
Encrypted request body
{
"payload": "{iv_hex}:{ciphertext_hex}"
}Your 64-character Encryption Key is available in the merchant dashboard under Config after onboarding. See the full encryption guide for algorithm details and code examples in Node.js, PHP, and Python.
Important
Environment Paths
Charge endpoints use /api/live/charge and /api/test/charge. Other payment APIs use /api/live and /api/test prefixes.
/api/live/charge
/api/test/chargeNote
Request & Response Format
Important
payload field in responses. See Encryption guide.Content-Type
All requests must include the Content-Type: application/json header and Authorization: Bearer your_api_key.
Important
Request body (wire format)
Build your JSON payload per endpoint docs, encrypt it with your Encryption Key, then send:
Encrypted request
{
"payload": "3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a:8e4f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0"
}Response body (wire format)
Responses are returned encrypted. Decrypt the payload field to get the JSON result:
Encrypted response
{
"success": true,
"payload": "7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7:4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8"
}Decrypted success example
After decryption, a typical success response looks like:
Decrypted response
{
"success": true,
"data": {
"transactionId": "TXN-20240101-ABC123",
"status": "SUCCESS",
"amount": 100.50,
"currency": "USD"
}
}Error Handling
The API uses standard HTTP status codes to indicate success or failure:
Error Response Format
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "The request parameters are invalid",
"details": {
"field": "amount",
"reason": "Amount must be greater than 0"
}
}
}Rate Limits
To ensure fair usage and system stability, API requests are rate-limited:
Rate limit information is included in response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640995200Important
429 Too Many Requests response. Wait until the reset time before making additional requests.Idempotency
For payment endpoints, you can include an idempotencyKey in the request header to ensure that duplicate requests are not processed multiple times:
Idempotency Header
Idempotency-Key: unique-key-per-requestIf you make the same request (with the same idempotency key) multiple times, only the first request will be processed. Subsequent requests will return the same response as the first request.
Note
Webhooks
Webhooks allow you to receive real-time notifications about transaction status changes. Configure your webhook URL when creating a payment, and we will send POST requests to your endpoint when events occur.
Webhook requests include a signature header for verification:
fs-webhook-hash: HMAC-SHA256 signatureImportant
Payment Statuses
Transactions can have the following statuses:
Quick Start
Encrypt your charge payload before sending. Example using the encrypted wire format:
Example: Encrypted charge request
curl -X POST https://api.payoflux.com/api/test/charge \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_api_key_or_sandbox_api_key" \
-d '{
"payload": "3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8:8e4f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a"
}'The payload value is your encrypted JSON (see Encryption guide). The API returns encrypted data in the payload field — decrypt it on your server.