DocsOverview
Developer Documentation

Payment APIs

Comprehensive API documentation for integrating payment processing into your applications.

API Documentation Overview

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.com

The 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

Use the test environment for testing and development. All test transactions are simulated and do not process real payments.

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_key

Important

Keep your API keys secure. Do not share your API key with anyone — including team members who do not need access, support staff outside official channels, or third-party tools you do not trust. Never expose API keys in client-side code, mobile apps, or version control. Use environment variables or a secrets manager on your server only.

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

Do not share your Encryption Key with anyone. Anyone with your Encryption Key and API key can encrypt and decrypt payment payloads on your behalf. Store it only on your backend server — never in frontend code, emails, chat, or public repositories.
View Encryption Guide

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/charge

Note

Use the test environment for development. All test transactions are simulated and do not process real payments.

Request & Response Format

Important

All payment API requests and responses use payload encryption. Encrypt your JSON before sending; decrypt the 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

Do not share your API key or Encryption Key with anyone. Both credentials must stay on your backend server only — never in frontend code, emails, or public repositories.

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:

200 OKRequest succeeded
400 Bad RequestInvalid request parameters
401 UnauthorizedInvalid or missing API key
403 ForbiddenAPI key lacks required permissions
404 Not FoundResource not found
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorServer error

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:

Standard Tier100 requests per minute per API key
Premium Tier500 requests per minute per API key
Enterprise TierCustom rate limits based on agreement

Rate limit information is included in response headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640995200

Important

If you exceed the rate limit, you will receive a 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-request

If 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

Idempotency keys should be unique per transaction. Use a UUID or a unique identifier from your system.

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.

SUCCESSTransaction successfully processed
FAILEDTransaction failed
BLOCKEDTransaction blocked due to security/compliance

Webhook requests include a signature header for verification:

fs-webhook-hash: HMAC-SHA256 signature

Important

Always verify webhook signatures to ensure requests are from PayoFlux. The signature is generated using HMAC-SHA256 with your secret key.

Payment Statuses

Transactions can have the following statuses:

SUCCESSPayment has been successfully processed
FAILEDPayment failed due to an error or insufficient funds
PENDINGPayment is pending and awaiting further action
INITPayment process has been initialized but not yet completed
REDIRECTUser has been redirected to a third-party page for payment completion
BLOCKEDPayment blocked due to security or compliance reasons
ABANDONEDPayment process was started but not completed by the user

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.

API Categories

Charge

Process credit and debit card charges. All requests and responses are encrypted.

Status

Check transaction status. Encrypted request and response payloads.