SofolX logo SofolXDeveloper Documentation
LIVE API

SofolX API Docs

sofolx.com is the official SofolX platform. Use this guide to create hosted payment sessions, redirect customers to SofolX checkout, verify transactions from your server, and handle callbacks securely.

Brand Keys
Production environment

API endpoints

Main websitehttps://sofolx.com
Gateway base URLhttps://pay.sofolx.com
CreatePOST /api
VerifyPOST /api/verify

Authentication

Every API call is authenticated with the merchant Brand Key created inside the SofolX dashboard. The secret key is never embedded into this public documentation.

1
Sign inOpen your merchant account.
2
Open BrandsGo to Merchant Dashboard → Brands.
3
Create / select brandSet the real website domain for that brand.
4
Copy Brand KeyUse it only from your server-side integration.

Supported authentication methods

MethodValueUse
API-KEY headerAPI-KEY: YOUR_BRAND_KEYRecommended.
api_key parameter?api_key=YOUR_BRAND_KEYSupported by the live API.
Keep your Brand Key privateStore it on your backend or in environment variables. Public examples use YOUR_BRAND_KEY as a placeholder.

Create Payment

Create a hosted SofolX payment session and receive a payment_url that you redirect the customer to.

POSThttps://pay.sofolx.com/api

Request fields

FieldTypeRequiredLive behaviour
amountnumberRequiredMust be numeric, greater than 0 and not over 1,000,000 BDT.
success_urlURLRequiredCustomer return URL for pending/completed flow. Domain must match the Brand website domain.
cancel_urlURLRequiredCustomer return URL for cancelled/failed flow. Domain must match the Brand website domain.
cus_namestringOptionalCustomer name. Live API supplies a default if omitted.
cus_emailstringOptionalCustomer email. Live API supplies a default if omitted.
cus_phonestringOptionalCustomer phone number.
webhook_urlURLOptionalBackend callback URL. When supplied, domain must match the Brand website domain.
metadataJSON objectOptionalMerchant metadata stored with the temporary payment session.
curl -X POST "https://pay.sofolx.com/api" \ -H "Content-Type: application/json" \ -H "API-KEY: YOUR_BRAND_KEY" \ -d '{ "amount": 500, "cus_name": "John Doe", "cus_email": "john@example.com", "cus_phone": "01700000000", "success_url": "https://merchant.example/payment/success", "cancel_url": "https://merchant.example/payment/cancel", "webhook_url": "https://merchant.example/api/sofolx/webhook", "metadata": {"order_id":"ORD-1001"} }'
$payload = [ 'amount' => 500, 'cus_name' => 'John Doe', 'cus_email' => 'john@example.com', 'success_url' => 'https://merchant.example/payment/success', 'cancel_url' => 'https://merchant.example/payment/cancel', 'webhook_url' => 'https://merchant.example/api/sofolx/webhook', 'metadata' => (object)['order_id' => 'ORD-1001'],];$ch = curl_init('https://pay.sofolx.com/api');curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'API-KEY: YOUR_BRAND_KEY'], CURLOPT_POSTFIELDS => json_encode($payload),]);$response = curl_exec($ch);
const response = await fetch('https://pay.sofolx.com/api', { method: 'POST', headers: { 'Content-Type': 'application/json', 'API-KEY': 'YOUR_BRAND_KEY' }, body: JSON.stringify({ amount: 500, cus_name: 'John Doe', cus_email: 'john@example.com', success_url: 'https://merchant.example/payment/success', cancel_url: 'https://merchant.example/payment/cancel', webhook_url: 'https://merchant.example/api/sofolx/webhook', metadata: {order_id: 'ORD-1001'} })});const data = await response.json();

Success response

JSON
{ "status": 1, "message": "Payment Link", "payment_url": "https://pay.sofolx.com/api/execute/PAYMENT_SESSION_ID"}
Domain validationThe gateway validates success_url, cancel_url and any supplied webhook_url against the website domain saved on the Brand.

Verify Payment

Verify the SofolX transaction from your backend before updating your order or service.

POSThttps://pay.sofolx.com/api/verify
FieldTypeRequiredDescription
transaction_idstringRequiredThe SofolX transaction reference returned by the payment flow.
curl -X POST "https://pay.sofolx.com/api/verify" \ -H "Content-Type: application/json" \ -H "API-KEY: YOUR_BRAND_KEY" \ -d '{"transaction_id":"TRANSACTION_ID"}'
$ch = curl_init('https://pay.sofolx.com/api/verify');curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'API-KEY: YOUR_BRAND_KEY'], CURLOPT_POSTFIELDS => json_encode(['transaction_id' => 'TRANSACTION_ID']),]);$response = curl_exec($ch);
const response = await fetch('https://pay.sofolx.com/api/verify', { method: 'POST', headers: {'Content-Type':'application/json','API-KEY':'YOUR_BRAND_KEY'}, body: JSON.stringify({transaction_id: 'TRANSACTION_ID'})});const result = await response.json();

Verify response fields

FieldReturned value
cus_nameCustomer name stored on the payment.
cus_emailCustomer email stored on the payment.
amountPayment amount.
transaction_idSofolX transaction reference.
metadataMerchant metadata stored at creation.
payment_methodDetected/processed payment method when available.
statusPENDING, COMPLETED, CANCELED, FAILED or ERROR.

Webhook & Redirect Flow

When the live payment flow is processed, SofolX sends the merchant callback fields below and also appends matching status information to the customer redirect URL.

Webhook payload
{ "paymentMethod": "bkash", "transactionId": "TRANSACTION_ID", "paymentAmount": 500, "paymentFee": 0, "status": "completed"}

Customer redirect query fields

The gateway adds paymentMethod, transactionId, paymentAmount, paymentFee and status to the configured success/cancel URL.

1
Create order
2
Create payment
3
Redirect customer
4
Payment processed
5
Webhook received
6
Verify API
Recommended merchant behaviourTreat the webhook/redirect as a signal, then call https://pay.sofolx.com/api/verify from your backend and act on the returned status.

Errors & Status

Use these statuses and error codes when handling API responses from the gateway.

PENDING

Waiting or still processing.

COMPLETED

Payment confirmed.

CANCELED

Customer/payment flow cancelled.

FAILED

Payment flow failed.

ERROR

Unexpected/unknown status mapping.

Common API errors

HTTPCodeMeaning
401INVALID_API_KEYMissing or invalid Brand Key.
403PLAN_EXPIRED / PLAN_REQUIRED / BRAND_INACTIVEBrand/account does not currently have access.
404TRANSACTION_NOT_FOUNDThe transaction does not belong to the Brand or cannot be found.
422REQUIRED_FIELD_MISSINGRequired verify field is missing.
422INVALID_PARAMETERSCreate request contains invalid or missing parameters.

Production Checklist

Complete these checks before enabling SofolX on a production merchant website.

Store the Brand Key only on the merchant backend.
Save the correct merchant website domain under Brands.
Use HTTPS success, cancel and webhook URLs.
Redirect customers only to the returned payment_url.
Verify every transaction before fulfilment.
Handle duplicate webhook calls idempotently.

Apps & Integrations

Download and integration links are managed from SofolX Admin → Apps/Plugin. Updates made there are reflected on this page automatically.

SofolX Android App

Merchant device application link from the current Admin settings.

Open App Link

WordPress Plugin

Current WordPress/WooCommerce integration link configured by Admin.

Open Plugin Link

cPanel Integration

Current cPanel integration package link configured by Admin.

Open cPanel Link

Shopify Integration

Open the merchant Shopify integration area inside SofolX.

Open Shopify Setup
Main: https://sofolx.com   •   Gateway: https://pay.sofolx.comsupport@sofolx.com   •   +966531270392