F

FluxPay API

Developer Documentation

Complete Payment Processing API

Accept Payments in Minutes

Powerful payment infrastructure with intelligent routing, automatic failover, and multi-provider support. Create payment links and track transactions with just a few API calls.

Intelligent Routing

Automatic provider selection and failover for maximum approval rates.

Secure Payments

Bank-grade encryption, PCI DSS compliant infrastructure.

Simple Integration

Clean REST API with comprehensive documentation.

Multiple Payment Methods

Accept cards, Open Banking, and more through a single API.

1

Generate Your API Key

First step: Get your authentication credentials

Test vs Live Keys

sk_test_*TEST MODE

• Use for development and testing
• Routes to DEMO provider (no real money)
• Safe to use in staging environments

sk_live_*LIVE MODE

• Use for production payments
• Routes to real payment providers
• Processes actual transactions

How to Generate

  1. 1Login to your FluxPay Dashboard
  2. 2Navigate to Settings → API Keys
  3. 3Toggle Test Mode or Live Mode in the header
  4. 4Click "Rotate API Key" to generate a new key
  5. 5⚠️ Copy immediately - you can't view it again!

Security Best Practices

Store in Environment VariablesNever hardcode API keys in your source code. Use .env files:FLUXPAY_API_KEY=sk_live_your_key_here
Use Server-Side OnlyAPI keys should NEVER be exposed in client-side code or public repositories.
Rotate Keys RegularlyRotate your API keys periodically, especially if you suspect they may have been compromised.
Separate Test and LiveAlways use test keys during development and only switch to live keys in production.
2

Make API Calls

Use any HTTP client to integrate with FluxPay

🔧 cURL / REST API
# No installation needed - cURL is pre-installed on most systems
# Your API key from Dashboard → Settings → API Keys
# Test mode: sk_test_*  |  Live mode: sk_live_*
3

Create a Payment

Understanding parameters and payment flow

Payment Parameters

Required Parameters

amountnumber

Payment amount in decimal format (e.g., 99.99).
Used to determine traffic routing (FTD/STD/REST segmentation).

currencystring

Currency code (USD, EUR, GBP, CAD, AUD, etc.).
Must be supported by at least one of your assigned payment providers.

customer.emailstring

Customer email address.
Used for payment receipts and customer identification.

customer.firstNamestring

Customer first name.
Required by payment providers for compliance and fraud prevention.

customer.lastNamestring

Customer last name.
Required by payment providers for compliance and fraud prevention.

descriptionstring

Payment description.
Helps you and your customer identify the payment purpose.

Form Pre-fill Parameters (Optional)

customer.phonestring

Customer phone number.
Pre-fills the phone field on the payment form.

customer.billingobject

Billing address object.
Pre-fills billing address fields on the payment form.
Fields: address, city, state, country, postalCode

"billing": { "address": "123 Main St", "city": "NYC", "state": "NY", "country": "US", "postalCode": "10001" }
languagestring

Payment form language.
Sets the language for the payment form UI.
Supported: en (English), fr (French)

Optional Parameters

webhookUrlstring (optional)

Custom webhook URL for this specific payment.
Important: Overrides your default webhook URL configured in the dashboard.
When to use:

  • • Different webhook URLs for different payment types
  • • Testing webhooks without changing dashboard settings
  • • Route notifications to different microservices

⚠️ If not provided, uses the webhook URL from your dashboard settings.

metadataobject (optional)

Custom data object attached to the payment.
Purpose: Store any custom information (order IDs, user IDs, etc.)
Returned in: Webhooks and API responses for easy correlation
Example use cases:

  • • Link payment to your internal order ID
  • • Store customer ID for your records
  • • Add campaign tracking codes
  • • Include fulfillment information
🔧 cURL Example
curl -X POST https://fluxpay.online/api/v1/payments \
  -H "Authorization: Bearer sk_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 99.99,
    "currency": "USD",
    "customer": {
      "email": "customer@example.com",
      "firstName": "John",
      "lastName": "Doe",
      "phone": "+1-212-555-1234",
      "billing": {
        "address": "123 Main Street",
        "city": "New York",
        "state": "NY",
        "country": "US",
        "postalCode": "10001"
      }
    },
    "description": "Order #1234",
    "language": "fr",
    "webhookUrl": "https://yoursite.com/webhooks/fluxpay",
    "metadata": {
      "orderId": "ORD-2024-001",
      "userId": "user_12345"
    }
  }'

# Response:
# {
#   "success": true,
#   "payment": {
#     "id": "pay_abc123",
#     "status": "PENDING",
#     "amount": 99.99,
#     "currency": "USD",
#     "paymentUrl": "https://fluxpay.online/payment/generic/pay_abc123",
#     "customer": { ... },
#     "createdAt": "2025-01-23T10:30:00Z"
#   }
# }

What Happens After Creation?

1
Payment Link Created
You receive a unique payment URL (e.g., https://fluxpay.online/payment/generic/pay_abc123)
2
Send to Customer
Share this URL with your customer via email, SMS, or redirect them directly
3
Customer Opens Link
Customer is redirected to the payment page where they enter card details
4
Intelligent Routing
FluxPay automatically selects the best payment provider based on amount, currency, and success rates
5
Automatic Failover
If payment fails, system automatically tries up to 3 different providers (cascade)
6
Webhook Notification
You receive real-time webhook when payment completes, fails, or requires action

Payment Methods

Multiple ways for your customers to pay

Credit & Debit Cards

Default Method

Accept all major credit and debit cards with 3D Secure authentication support. Intelligent routing automatically selects the best provider for each transaction.

Visa, Mastercard, Amex, Discover
3D Secure 2.0 authentication
Multi-provider cascade for higher approval
Global coverage in 100+ countries

Open Banking

Bank Transfers

Instant bank-to-bank payments via Open Banking. Lower fees than cards with direct settlement to your account. Available in supported European markets.

Lower transaction fees than cards
Instant bank authentication
No chargebacks
EU/EEA bank coverage (PSD2 compliant)

How It Works

1
Customer Opens Payment Link
The payment page automatically displays available payment methods based on your configuration.
2
Customer Selects Payment Method
Card: Customer enters card details directly on the secure form.
Open Banking: Customer selects their bank and authenticates via their banking app.
3
FluxPay Processes Payment
Our intelligent routing selects the optimal provider. For cards, we use cascade logic for higher approval rates.
4
You Receive Webhook Notification
The webhook payload includes a paymentMethod field indicating which method was used (CREDIT_CARD or OPEN_BANKING).

Identifying Payment Method in Webhooks

Every webhook notification includes a paymentMethod field so you can identify how the customer paid:

{
  "event": "payment.completed",
  "transactionId": "pay_abc123",
  "amount": 99.99,
  "currency": "EUR",
  "status": "COMPLETED",
  "paymentMethod": "OPEN_BANKING",  // or "CREDIT_CARD"
  "customerEmail": "customer@example.com",
  ...
}
CREDIT_CARD

Card payment (Visa, Mastercard, etc.)

OPEN_BANKING

Direct bank transfer via Open Banking

4

Configure Webhooks

Receive real-time payment notifications

Two Ways to Configure

Option 1: Dashboard (Default)

Set a default webhook URL in your dashboard that applies to all payments:

  1. 1. Go to Settings → Webhooks
  2. 2. Enter your webhook URL
  3. 3. Select events to receive
  4. 4. Copy webhook secret for signature verification
Option 2: Per-Payment Override

Override the default by including webhookUrl in your API request:

webhookUrl: "https://your-app.com/webhooks"

Useful for routing different payment types to different endpoints.

Webhook Events

payment.completed

Payment successful - fulfill order and send confirmation

payment.failed

Payment failed after all retry attempts - notify customer

payment.pending

Payment processing - update order status to "processing"

Retry Policy

Failed webhooks are automatically retried:
• After 5 seconds
• After 30 seconds
• After 5 minutes
• Maximum 3 attempts

📨 Webhook Payload Example
# WEBHOOK PAYLOAD EXAMPLE
# POST https://yoursite.com/webhooks/fluxpay
# Headers:
#   Content-Type: application/json
#   X-Webhook-Signature: <hmac_sha256_signature>

{
  "event": "payment.completed",
  "transactionId": "pay_abc123",
  "amount": 99.99,
  "currency": "USD",
  "status": "COMPLETED",
  "customerEmail": "customer@example.com",
  "metadata": {
    "orderId": "ORD-2024-001",
    "userId": "user_12345"
  },
  "processedAt": "2025-01-23T10:35:00Z"
}

# YOUR WEBHOOK ENDPOINT MUST:
# 1. Verify the X-Webhook-Signature header (HMAC SHA256)
# 2. Process the event (fulfill order, send email, etc.)
# 3. Return 200 OK within 30 seconds
5

Return Customer to Your Site

Redirect customers back after payment completion

Redirect URL Options

returnUrlstring (optional)

General redirect URL for both success and failure. Customer is redirected here after any payment outcome.

successUrlstring (optional)

Success-specific redirect.
Overrides returnUrl for successful payments only.

failureUrlstring (optional)

Failure-specific redirect.
Overrides returnUrl for failed payments only.

Query Parameters Received

When the customer is redirected, these query parameters are appended to your URL:

status- "success" or "failed"
transaction_id- Unique transaction identifier
amount- Payment amount
currency- Currency code (USD, EUR, etc.)
reference- External reference ID
metadata[key]- Your custom metadata fields

Tip: Always verify payment status via webhook or API query - do not rely solely on redirect URL parameters.

🔧 cURL Example
curl -X POST https://fluxpay.online/api/v1/payments \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 99.99,
    "currency": "USD",
    "customer": {
      "email": "customer@example.com",
      "firstName": "John",
      "lastName": "Doe"
    },
    "description": "Order #1234",
    "metadata": {
      "orderId": "ORD-2024-001"
    },
    "returnUrl": "https://yoursite.com/payment/callback",
    "successUrl": "https://yoursite.com/payment/success",
    "failureUrl": "https://yoursite.com/payment/failure"
  }'

# After payment, customer is redirected to:
# SUCCESS: https://yoursite.com/payment/success?status=success&transaction_id=...
# FAILURE: https://yoursite.com/payment/failure?status=failed&transaction_id=...
6

Embed Payment Page

Embed FluxPay checkout directly in your website

Redirect (Recommended)

Redirect customer to FluxPay hosted page. Best for security and compliance. No iframe needed.

Best for: Most use cases

Modal iFrame

Embed payment page in a popup modal. Keeps customer on your site during checkout.

Best for: SaaS, subscriptions

Inline iFrame

Embed payment form directly in your page layout. Seamless checkout experience.

Best for: Single-page apps
📄 HTML / iFrame Example
<!-- OPTION 1: Inline iFrame -->
<iframe
  src="https://fluxpay.online/payment/generic/pay_abc123"
  width="100%"
  height="600"
  frameborder="0"
  allow="payment"
  style="border: none; border-radius: 12px;"
></iframe>

<!-- OPTION 2: Modal/Popup iFrame -->
<div id="payment-modal" style="
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
">
  <div style="
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%; max-width: 500px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
  ">
    <iframe id="payment-iframe" width="100%" height="600" frameborder="0"></iframe>
  </div>
</div>

<script>
function openPayment(paymentUrl) {
  document.getElementById('payment-iframe').src = paymentUrl;
  document.getElementById('payment-modal').style.display = 'block';
}
</script>
⚛️ React Component Example
// React Component for Embedded Payment
import { useState } from 'react';

function PaymentModal({ paymentUrl, onClose }) {
  return (
    <div className="fixed inset-0 bg-black/50 flex items-center justify-center z-50">
      <div className="bg-white rounded-2xl w-full max-w-lg overflow-hidden">
        <div className="flex justify-between items-center p-4 border-b">
          <h3 className="font-semibold">Complete Payment</h3>
          <button onClick={onClose} className="text-gray-500 hover:text-gray-700">✕</button>
        </div>
        <iframe
          src={paymentUrl}
          className="w-full h-[600px] border-0"
          allow="payment"
        />
      </div>
    </div>
  );
}

// Usage in your checkout page
function CheckoutPage() {
  const [paymentUrl, setPaymentUrl] = useState(null);

  const handleCheckout = async () => {
    const res = await fetch('/api/create-payment', { method: 'POST' });
    const { paymentUrl } = await res.json();
    setPaymentUrl(paymentUrl);
  };

  return (
    <div>
      <button onClick={handleCheckout}>Pay Now</button>
      {paymentUrl && (
        <PaymentModal
          paymentUrl={paymentUrl}
          onClose={() => setPaymentUrl(null)}
        />
      )}
    </div>
  );
}

Important Notes for Embedding

Always Create Payments Server-SideNever expose your API key in frontend code. Create payments on your backend and pass the payment URL to the frontend.
Use Webhooks for VerificationAlways verify payment completion via webhooks - do not rely solely on redirect parameters or iframe events.
Mobile ConsiderationsiFrames work on mobile but may have limited space. Consider using redirect method for mobile users.
3D Secure CompatibilitySome banks open 3DS authentication in a popup. Ensure your site allows popups from fluxpay.online.

Ready to Start Accepting Payments?

Create your account, generate an API key, and start processing payments in minutes.