Developer API
Integrate with FundXPay seamlessly using our robust API.
Introduction
Welcome to the FundXPay Developer Documentation. This guide provides all the information you need to integrate our payment gateway into your application. Our RESTful API is designed to be simple, secure, and flexible, allowing you to accept payments with ease.
Payment Flow
The payment process is designed to be straightforward for both you and your customers. Here’s a typical flow:
- Customer initiates a payment on your website or app.
- Your server sends a payment request to the FundXPay API.
- FundXPay returns a payment URL.
- You redirect the customer to the FundXPay payment page.
- Customer completes the payment.
- FundXPay notifies your server via a webhook (callback) and redirects the customer back to your site.
Integration Methods
We offer several ways to integrate with FundXPay:
- Hosted Payment Page: The simplest way to integrate. Redirect your customers to our secure, customizable payment page.
- Direct API Integration: For a more seamless experience, use our API to build your own payment form.
- SDKs: We provide SDKs for popular languages to speed up your development.
Payment Process Environment
We have both Live environment and Test/Sandbox environment in FundXPay. You just need to use proper URL and Store ID's to process payments. We provide separate store ID for live and test
Live Environment
All the transaction made using this environment are counted as real transaction, URL starts with https://secure.fundxpay.com
Sandbox Environment
All the transaction made using this environment are counted as test transaction and has no effect with accounting, URL starts with https://sandbox.fundxpay.com.
Mobile OTP: 123456
Mobile PIN: 12121
Initiate Payment
For initiating payment processing, at first you need to enable HTTP IPN Listener to listen the payments. So that you can update your database accordingly even customer got connectivity issue to return back to your website.
Ready the Parameters
Some mandatory parameters need to pass to FundXPay. It identify your customers and orders. Also you have to pass the success, fail, cancel url to redirect your customer after pay.
REST API
API Endpoint (Sandbox/Test Environment):
https://sandbox.fundxpay.com/api/v1/initiate-payment
API Endpoint (Live Environment):
https://secure.fundxpay.com/api/v1/initiate-payment
Method: POST
Request Parameters
| PARAM NAME | DATA TYPE | Optional/Mandatory | DESCRIPTION |
|---|---|---|---|
store_id |
string (30) | Mandatory | Your FundXPay Store ID is the integration credential which can be collected through our managers |
store_password |
string (30) | Mandatory | Your FundXPay Store Password is the integration credential which can be collected through our managers |
amount |
decimal (10,2) | Mandatory | The amount which will process by FundXPay. It shall be decimal value (10,2). Example : 55.40. The transaction amount must be from 10.00 BDT to 500000.00 BDT |
currency |
string (3) | Mandatory | The currency type must be mentioned. It shall be three characters. Example : BDT, USD, EUR, SGD, INR, MYR, etc. If the transaction currency is not BDT, then it will be converted to BDT based on the current convert rate. Example : 1 USD = 82.22 BDT. |
transaction_id |
string (30) | Mandatory | Unique transaction ID to identify your order in both your end and FundXPay |
success_url |
string (255) | Mandatory | It is the callback URL of your website where user will redirect after successful payment |
fail_url |
string (255) | Mandatory | It is the callback URL of your website where user will redirect after failed payment |
cancel_url |
string (255) | Mandatory | It is the callback URL of your website where user will redirect after canceled payment |
ipn_url |
string (255) | Mandatory | The FundXPay IPN(Instant Payment Notification) feature is crucial for seamless integration with your system — it ensures your backend stays updated even if a transaction is pending, interrupted, or the customer session expires. In such cases, FundXPay IPN automatically keeps your transaction records accurate and synchronized. |
customer_name |
string (50) | Mandatory | Your customer name to address the customer in payment receipt email |
customer_phone |
string (20) | Mandatory | The phone/mobile number of your customer to contact if any issue arises |
customer_email |
string (50) | Optional | Valid email address of your customer to send payment receipt from FundXPay end |
note_a |
string (255) | Optional | Extra parameter to pass your meta data if it is needed. Not mandatory |
note_b |
string (255) | Optional | Extra parameter to pass your meta data if it is needed. Not mandatory |
note_c |
string (255) | Optional | Extra parameter to pass your meta data if it is needed. Not mandatory |
note_d |
string (255) | Optional | Extra parameter to pass your meta data if it is needed. Not mandatory |
Returned Parameters
| PARAM NAME | DATA TYPE | DESCRIPTION |
|---|---|---|
api_status |
string(30) | API Connection Status:
|
status |
string (10) | API connectivity status. If all the required data is provided, then it will return as SUCCESS, neither it will be FAILED |
failed_reason |
string (255) | If API connectivity is failed then it returns the reason. |
session_key |
string (50) | A unique session key which must be saved at your system to query the transaction status any time (if required). |
gateway_page_url |
string (255) | The URL to where you will redirect the customer to pay. This is the main URL which you will use for the integration. |
Example Code
Below is an example of how to initiate a payment session using PHP and cURL. This code sends the required parameters to the FundXPay API and retrieves a session key and a URL for the payment gateway page.
<?php
$post_data = array();
$post_data['store_id'] = 'teststore';
$post_data['store_password'] = 'testpassword';
$post_data['amount'] = '100.00';
$post_data['currency'] = 'BDT';
$post_data['transaction_id'] = 'test123456qwerty';
$post_data['success_url'] = 'https://your-website.com/success';
$post_data['fail_url'] = 'https://your-website.com/fail';
$post_data['cancel_url'] = 'https://your-website.com/cancel';
$post_data['ipn_url'] = 'https://your-website.com/ipn';
$post_data['customer_name'] = 'John Doe';
$post_data['customer_email'] = 'john.doe@your-website.com';
$post_data['customer_phone'] = '01700000000';
$post_data['note_a'] = 'Custom note A';
$post_data['note_b'] = 'Custom note B';
$post_data['note_c'] = 'Custom note C';
$post_data['note_d'] = 'Custom note D';
# API endpoint
$api_url = 'https://sandbox.fundxpay.com/api/v1/initiate-payment';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // For local testing
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"api_status": "DONE",
"status": "SUCCESS",
"failed_reason": null,
"session_key": "f8p76Ym8xG9avxaMuImXX6KtvOaMF6zpDOXRTrLq",
"gateway_page_url": "https://sandbox.fundxpay.com/checkout/f8p76Ym8xG9avxaMuImXX6KtvOaMF6zpDOXRTrLq"
}
IPN (Instant Payment Notification)
As IPN URL already set in panel. All the payment notification will reach through IPN prior to user return back. So it needs validation for amount and transaction properly.
The IPN will send a POST REQUEST with below parameters. Grab the post notification with your desired platform
| PARAM NAME | DATA TYPE | DESCRIPTION |
|---|---|---|
status |
string(20) | Transaction Status (e.g., VALID, FAILED, PENDING). |
failed_reason |
string(255) | If transaction status is FAILED, this returns the reason. |
transaction_id |
string(30) | Unique transaction ID that was sent by you during initiation. |
validation_id |
string(30) | A Validation ID against the successful transaction which is provided by FundXPay. |
session_key |
string(50) | The session id has been generated at the time of transaction initiated. |
amount |
decimal(10,2) | The total amount sent by you. |
store_amount |
decimal(10,2) | The amount what you will get in your account after bank charge ( Example: 100 BDT will be your store amount of 96 BDT after 4% Bank Commission ) |
tran_date |
datetime | Transaction date and time. |
bank_tran_id |
string(80) | The transaction ID at Banks End. |
card_type |
string(50) | The Bank Gateway Name that customer selected. |
card_no |
string(50) | Customer's Card number or mobile banking reference ID. |
currency |
string(3) | Currency type of the transaction. |
card_issuer |
string(50) | Issuer Bank Name. |
card_brand |
string(30) | VISA, MASTER, AMEX, IB or MOBILE BANKING. |
note_a |
string (255) | Same Value will be returned as Passed during initiation |
note_b |
string (255) | Same Value will be returned as Passed during initiation |
note_c |
string (255) | Same Value will be returned as Passed during initiation |
note_d |
string (255) | Same Value will be returned as Passed during initiation |
Example Code
<?php
// The IPN URL where FundXPay will send the POST request.
// This script should be hosted on your server.
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Retrieve the POST data sent by FundXPay
$status = isset($_POST['status']) ? $_POST['status'] : null;
$transaction_id = isset($_POST['transaction_id']) ? $_POST['transaction_id'] : null;
$validation_id = isset($_POST['validation_id']) ? $_POST['validation_id'] : null;
$amount = isset($_POST['amount']) ? $_POST['amount'] : null;
$store_amount = isset($_POST['store_amount']) ? $_POST['store_amount'] : null;
$tran_date = isset($_POST['tran_date']) ? $_POST['tran_date'] : null;
$bank_tran_id = isset($_POST['bank_tran_id']) ? $_POST['bank_tran_id'] : null;
$card_type = isset($_POST['card_type']) ? $_POST['card_type'] : null;
$card_no = isset($_POST['card_no']) ? $_POST['card_no'] : null;
$currency = isset($_POST['currency']) ? $_POST['currency'] : null;
$card_issuer = isset($_POST['card_issuer']) ? $_POST['card_issuer'] : null;
$card_brand = isset($_POST['card_brand']) ? $_POST['card_brand'] : null;
$note_a = isset($_POST['note_a']) ? $_POST['note_a'] : null;
$note_b = isset($_POST['note_b']) ? $_POST['note_b'] : null;
$note_c = isset($_POST['note_c']) ? $_POST['note_c'] : null;
$note_d = isset($_POST['note_d']) ? $_POST['note_d'] : null;
//
// IMPORTANT:
// You must validate the transaction with the "Order Validate" API before updating your database.
// This ensures the IPN is authentic and the data is correct.
//
if ($status === 'VALID') {
// 1. Validate the order using the "Order Validate" API.
// 2. Check if the transaction_id has not been previously processed.
// 3. Check that the amount is correct for the order.
// 4. If all checks pass, update your database with the transaction details.
// - Mark the order as paid.
// - Store relevant transaction information.
// Example: Log the IPN data to a file for debugging
$log_data = "IPN Received:\n" . print_r($_POST, true) . "\n\n";
file_put_contents('ipn_log.txt', $log_data, FILE_APPEND);
} else {
// The transaction was not successful (e.g., FAILED, PENDING).
// You might want to log this for investigation.
$log_data = "IPN Received with status: $status\n" . print_r($_POST, true) . "\n\n";
file_put_contents('ipn_log.txt', $log_data, FILE_APPEND);
}
// Respond with a 200 OK status to acknowledge receipt of the IPN.
http_response_code(200);
} else {
// Not a POST request.
http_response_code(405); // Method Not Allowed
echo "Method not allowed.";
}
?>
{
"status": "VALID",
"transaction_id": "unique_tx_id_from_your_system",
"amount": "100.00",
"store_amount": "96.00",
"tran_date": "2024-07-26 12:34:56",
"bank_tran_id": "BANK123456789",
"card_type": "VISA",
"card_no": "411111...1111",
"currency": "BDT",
"card_issuer": "Test Bank",
"card_brand": "VISA",
"note_a": "Custom note A",
"note_b": "Custom note B",
"note_c": null,
"note_d": null
}
Order Validate
The Order Validate API allows you to verify the authenticity and status of an order before processing it. This is crucial for preventing fraudulent transactions and ensuring data integrity.
REST API
API Endpoint (Sandbox/Test Environment):
https://sandbox.fundxpay.com/api/v1/validate-transaction
API Endpoint (Live Environment):
https://secure.fundxpay.com/api/v1/validate-transaction
Method: POST
Request Parameters
| PARAM NAME | DATA TYPE | Optional/Mandatory | DESCRIPTION |
|---|---|---|---|
validation_id |
string(30) | Mandatory | A Validation ID against the successful transaction which is provided by FundXPay. |
store_id |
string(30) | Mandatory | Your FundXPay Store ID. |
store_password |
string(30) | Mandatory | Your FundXPay Store Password. |
Returned Parameters
| PARAM NAME | DATA TYPE | DESCRIPTION |
|---|---|---|
api_status |
string(30) | API Connection Status:
|
status |
string(10) | Validation status. Returns VALID if the order is valid, otherwise INVALID_TRANSACTION. |
failed_reason |
string(255) | If validation fails, this returns the reason. |
transaction_id |
string(30) | Unique transaction ID that was sent by you during initiation. |
validation_id |
string(30) | A Validation ID against the Transaction which is provided by FundXPay |
amount |
decimal(10,2) | The total amount sent by you. |
store_amount |
decimal(10,2) | The amount what you will get in your account after bank charge ( Example: 100 BDT will be your store amount of 96 BDT after 4% Bank Commission ) |
tran_date |
datetime | Transaction date and time. |
bank_tran_id |
string(80) | The transaction ID at Banks End. |
card_type |
string(50) | The Bank Gateway Name that customer selected. |
card_no |
string(50) | Customer's Card number or mobile banking reference ID. |
currency |
string(3) | Currency type of the transaction. |
card_issuer |
string(50) | Issuer Bank Name. |
card_brand |
string(30) | VISA, MASTER, AMEX, IB or MOBILE BANKING. |
note_a |
string (255) | Same Value will be returned as Passed during initiation |
note_b |
string (255) | Same Value will be returned as Passed during initiation |
note_c |
string (255) | Same Value will be returned as Passed during initiation |
note_d |
string (255) | Same Value will be returned as Passed during initiation |
Example Code
Below is an example of how to validate an order using PHP and cURL. This code sends the required parameters to the FundXPay API and retrieves the transaction status.
<?php
$post_data = array();
$post_data['store_id'] = 'your_store_id';
$post_data['store_password'] = 'your_store_password';
$post_data['validation_id'] = 'validation_id_provided_by_fundxpay';
# API endpoint
$api_url = 'https://sandbox.fundxpay.com/api/v1/validate-transaction';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // For local testing
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"api_status": "DONE",
"status": "VALID",
"failed_reason": null,
"transaction_id": "unique_tx_id_from_your_system",
"validation_id": "validation_id_provided_by_fundxpay",
"amount": "100.00",
"store_amount": "96.00",
"tran_date": "2024-07-26 12:34:56",
"bank_tran_id": "BANK123456789",
"card_type": "VISA",
"card_no": "411111...1111",
"currency": "BDT",
"card_issuer": "Test Bank",
"card_brand": "VISA",
"note_a": "Custom note A",
"note_b": "Custom note B",
"note_c": null,
"note_d": null
}
Transaction Query
You can query your transaction status any time while you want. For ticketing system or product limitation, it will help you to release before recheck.
By Transaction ID
You can check the status of a transaction by your transaction id. So, Let's call the API and the example given below
REST API
API Endpoint (Sandbox/Test Environment):
https://sandbox.fundxpay.com/api/v1/query-transaction
API Endpoint (Live Environment):
https://secure.fundxpay.com/api/v1/query-transaction
Method: POST
Request Parameters
| PARAM NAME | DATA TYPE | Optional/Mandatory | DESCRIPTION |
|---|---|---|---|
transaction_id |
string(50) | Mandatory | Transaction ID (Unique) that was sent by you during Initiation. |
store_id |
string(30) | Mandatory | Your FundXPay Store ID is the integration credential which can be collected through our managers |
store_password |
string(30) | Mandatory | Your FundXPay Store Password is the integration credential which can be collected through our managers |
Returned Parameters
| PARAM NAME | DATA TYPE | DESCRIPTION |
|---|---|---|
api_status |
string(30) | API Connection Status:
|
status |
string(20) | Transaction Status. This parameter needs to be checked before update your database as a
successful transaction.
|
session_key |
string(50) | The session id has been generated at the time of transaction initiated. |
tran_date |
datetime | Transaction date - Payment completion date as 2016-05-08 15:53:49 |
transaction_id |
string(30) | Unique transaction ID that was sent by you during initiation. |
validation_id |
string(30) | A Validation ID against the Transaction which is provided by FundXPay. |
amount |
decimal(10,2) | The total amount sent by you. |
store_amount |
decimal(10,2) | The amount what you will get in your account after bank charge ( Example: 100 BDT will be your store amount of 96 BDT after 4% Bank Commission ) |
bank_tran_id |
string(80) | The transaction ID at Banks End. |
card_type |
string(50) | The Bank Gateway Name that customer selected. |
card_no |
string(50) | Customer's Card number or mobile banking reference ID. |
currency |
string(3) | Currency type of the transaction. |
card_issuer |
string(50) | Issuer Bank Name. |
card_brand |
string(30) | VISA, MASTER, AMEX, IB or MOBILE BANKING. |
note_a |
string (255) | Same Value will be returned as Passed during initiation |
note_b |
string (255) | Same Value will be returned as Passed during initiation |
note_c |
string (255) | Same Value will be returned as Passed during initiation |
note_d |
string (255) | Same Value will be returned as Passed during initiation |
Example Code
Below is an example of how to query an transaction using PHP and cURL. This code sends the required parameters to the FundXPay API and retrieves the transaction details.
<?php
$post_data = array();
$post_data['store_id'] = 'your_store_id';
$post_data['store_password'] = 'your_store_password';
$post_data['transaction_id'] = 'unique_tx_id_from_your_system';
# API endpoint
$api_url = 'https://sandbox.fundxpay.com/api/v1/query-transaction';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // For local testing
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"api_status": "DONE",
"status": "VALID",
"failed_reason": null,
"transaction_id": "unique_tx_id_from_your_system",
"validation_id": "validation_id_provided_by_fundxpay",
"amount": "100.00",
"store_amount": "96.00",
"tran_date": "2024-07-26 12:34:56",
"bank_tran_id": "BANK123456789",
"card_type": "VISA",
"card_no": "411111...1111",
"currency": "BDT",
"card_issuer": "Test Bank",
"card_brand": "VISA",
"note_a": "Custom note A",
"note_b": "Custom note B",
"note_c": null,
"note_d": null
}
Initiate Payout
For initiating payout processing, at first you need to enable HTTP IPN Listener to listen the payouts. So that you can update your database accordingly even customer got connectivity issue to return back to your website.
Ready the Parameters
Some mandatory parameters need to pass to FundXPay. It identify your customers and orders.
REST API
API Endpoint (Sandbox/Test Environment):
https://sandbox.fundxpay.com/api/v1/initiate-payout
API Endpoint (Live Environment):
https://secure.fundxpay.com/api/v1/initiate-payout
Method: POST
Request Headers
You must include the X-API-KEY in your request header. You need to encrypt a combination of your authKey (Store ID) and signatureKey (Store Password) using AES-128-CBC encryption and then hash the encrypted data with SHA-256. The final key is a Base64-encoded string prepended with the Initialization Vector (IV).
Request Parameters
| PARAM NAME | DATA TYPE | Optional/Mandatory | DESCRIPTION |
|---|---|---|---|
store_id |
string (30) | Mandatory | Your FundXPay Store ID is the integration credential which can be collected through our managers |
store_password |
string (30) | Mandatory | Your FundXPay Store Password is the integration credential which can be collected through our managers |
amount |
decimal (10,2) | Mandatory | The amount which will process by FundXPay. It shall be decimal value (10,2). Example : 150.00. The transaction amount must be from 100.00 BDT to 30000.00 BDT |
currency |
string (3) | Mandatory | The currency type must be mentioned. It shall be three characters. Example : BDT, USD, EUR, SGD, INR, MYR, etc. If the transaction currency is not BDT, then it will be converted to BDT based on the current convert rate. Example : 1 USD = 125.00 BDT. |
payout_id |
string (30) | Mandatory | Unique payout ID to identify your order in both your end and FundXPay |
gateway |
string (50) | Mandatory |
The payout gateway to be used for disbursement.
Supported values include any available payout channels such as
bkash, nagad, etc.
|
payout_mobile |
string (15) | Mandatory | The recipient’s mobile number linked to the selected payout gateway account (e.g., customer’s bKash or Nagad number) where the amount will be sent. |
ipn_url |
string (255) | Mandatory | The FundXPay IPN(Instant Payout Notification) feature is crucial for seamless integration with your system — it ensures your backend stays updated even if a payout is pending, interrupted, or the customer session expires. In such cases, FundXPay IPN automatically keeps your payout records accurate and synchronized. |
customer_name |
string (50) | Mandatory | Your customer name to address the customer in payment receipt email |
customer_phone |
string (20) | Mandatory | The phone/mobile number of your customer to contact if any issue arises |
customer_email |
string (50) | Optional | Valid email address of your customer to send payment receipt from FundXPay end |
note_a |
string (255) | Optional | Extra parameter to pass your meta data if it is needed. Not mandatory |
note_b |
string (255) | Optional | Extra parameter to pass your meta data if it is needed. Not mandatory |
note_c |
string (255) | Optional | Extra parameter to pass your meta data if it is needed. Not mandatory |
note_d |
string (255) | Optional | Extra parameter to pass your meta data if it is needed. Not mandatory |
Returned Parameters
| PARAM NAME | DATA TYPE | DESCRIPTION |
|---|---|---|
api_status |
string(30) | API Connection Status:
|
status |
string (10) | API connectivity status. If all the required data is provided, then it will return as SUCCESS, neither it will be FAILED |
failed_reason |
string (255) | If API connectivity is failed then it returns the reason. |
Example Code
Below is an example of how to initiate a payout session using PHP and cURL. This code sends the required parameters to the FundXPay API and retrieves response.
<?php
// -----------------------------
// Prepare Request Data
// -----------------------------
$post_data = array();
$post_data['store_id'] = 'teststore';
$post_data['store_password'] = 'testpassword';
$post_data['amount'] = '100.00';
$post_data['currency'] = 'BDT';
$post_data['payout_id'] = 'test123456qwerty';
$post_data['gateway'] = 'bkash';
$post_data['payout_mobile'] = '01700000000';
$post_data['ipn_url'] = 'https://your-website.com/payout/ipn';
$post_data['customer_name'] = 'John Doe';
$post_data['customer_email'] = 'john.doe@your-website.com';
$post_data['customer_phone'] = '01700000000';
$post_data['note_a'] = 'Custom note A';
$post_data['note_b'] = 'Custom note B';
$post_data['note_c'] = 'Custom note C';
$post_data['note_d'] = 'Custom note D';
// -----------------------------
// Generate X-API-KEY Header
// -----------------------------
$authKey = 'STORE_ID';
$signatureKey = 'STORE_PASSWORD';
$privateKey = 'YOUR_PRIVATE_KEY';
$cipher = "AES-128-CBC";
$key = substr(hash('sha256', $privateKey, true), 0, 16);
$ivlen = openssl_cipher_iv_length($cipher);
$iv = openssl_random_pseudo_bytes($ivlen);
$data = "{$authKey}:{$signatureKey}";
$encrypted = openssl_encrypt($data, $cipher, $key, OPENSSL_RAW_DATA, $iv);
$hashed = hash('sha256', $encrypted, true);
$xApiKey = base64_encode($iv . $hashed);
// -----------------------------
// cURL Request
// -----------------------------
$api_url = 'https://sandbox.fundxpay.com/api/v1/initiate-payout';
$headers = [
'X-API-KEY: ' . $xApiKey,
'Accept: application/json'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // For local testing
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"api_status": "DONE",
"status": "SUCCESS",
"failed_reason": null,
}
IPN (Instant Payout Notification)
As IPN URL already set in panel. All the payout notification will reach through IPN prior to user return back. So it needs validation for amount and transaction properly.
The IPN will send a POST REQUEST with below parameters. Grab the post notification with your desired platform
| PARAM NAME | DATA TYPE | DESCRIPTION |
|---|---|---|
status |
string(20) | Payout Status (e.g., VALID, FAILED, PENDING). |
failed_reason |
string(255) | If payout status is FAILED, this returns the reason. |
payout_id |
string(30) | Unique payout ID that was sent by you during initiation. |
gateway |
string(30) | The payout gateway to used for disbursement |
payout_mobile |
string(30) | The recipient’s mobile number where the amount sent |
amount |
decimal(10,2) | The total amount sent by you. |
store_amount |
decimal(10,2) | The amount what you will pay after commission ( Example: 100 BDT will be your store amount 104 BDT after 4% Commission ) |
tran_date |
datetime | Payout date and time. |
bank_tran_id |
string(80) | The transaction ID at Banks End. |
currency |
string(3) | Currency type of the transaction. |
note_a |
string (255) | Same Value will be returned as Passed during initiation |
note_b |
string (255) | Same Value will be returned as Passed during initiation |
note_c |
string (255) | Same Value will be returned as Passed during initiation |
note_d |
string (255) | Same Value will be returned as Passed during initiation |
Example Code
<?php
// The IPN URL where FundXPay will send the POST request.
// This script should be hosted on your server.
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Retrieve the POST data sent by FundXPay
$status = isset($_POST['status']) ? $_POST['status'] : null;
$payout_id = isset($_POST['payout_id']) ? $_POST['payout_id'] : null;
$gateway = isset($_POST['gateway']) ? $_POST['gateway'] : null;
$payout_mobile = isset($_POST['payout_mobile']) ? $_POST['payout_mobile'] : null;
$amount = isset($_POST['amount']) ? $_POST['amount'] : null;
$store_amount = isset($_POST['store_amount']) ? $_POST['store_amount'] : null;
$tran_date = isset($_POST['tran_date']) ? $_POST['tran_date'] : null;
$bank_tran_id = isset($_POST['bank_tran_id']) ? $_POST['bank_tran_id'] : null;
$currency = isset($_POST['currency']) ? $_POST['currency'] : null;
$note_a = isset($_POST['note_a']) ? $_POST['note_a'] : null;
$note_b = isset($_POST['note_b']) ? $_POST['note_b'] : null;
$note_c = isset($_POST['note_c']) ? $_POST['note_c'] : null;
$note_d = isset($_POST['note_d']) ? $_POST['note_d'] : null;
//
// IMPORTANT:
// You must validate the transaction with the "Payout Query" API before updating your database.
// This ensures the IPN is authentic and the data is correct.
//
if ($status === 'VALID') {
// 1. Validate the payout using the "Payout Query" API.
// 2. Check if the payout_id has not been previously processed.
// 3. Check that the amount is correct for the order.
// 4. If all checks pass, update your database with the transaction details.
// - Mark the order as paid.
// - Store relevant transaction information.
// Example: Log the IPN data to a file for debugging
$log_data = "IPN Received:\n" . print_r($_POST, true) . "\n\n";
file_put_contents('ipn_log.txt', $log_data, FILE_APPEND);
} else {
// The transaction was not successful (e.g., FAILED, PENDING).
// You might want to log this for investigation.
$log_data = "IPN Received with status: $status\n" . print_r($_POST, true) . "\n\n";
file_put_contents('ipn_log.txt', $log_data, FILE_APPEND);
}
// Respond with a 200 OK status to acknowledge receipt of the IPN.
http_response_code(200);
} else {
// Not a POST request.
http_response_code(405); // Method Not Allowed
echo "Method not allowed.";
}
?>
{
"status": "VALID",
"payout_id": "unique_payout_id_from_your_system",
"gateway": "bkash",
"payout_mobile": "01600000001",
"amount": "100.00",
"store_amount": "104.00",
"tran_date": "2024-07-26 12:34:56",
"bank_tran_id": "BANK123456789",
"currency": "BDT",
"note_a": "Custom note A",
"note_b": "Custom note B",
"note_c": null,
"note_d": null
}
Payout Query
You can query your payout status any time while you want. For ticketing system or product limitation, it will help you to release before recheck.
By Payout ID
You can check the status of a payout by your payout id. So, Let's call the API and the example given below
REST API
API Endpoint (Sandbox/Test Environment):
https://sandbox.fundxpay.com/api/v1/query-payout
API Endpoint (Live Environment):
https://secure.fundxpay.com/api/v1/query-payout
Method: POST
Request Parameters
| PARAM NAME | DATA TYPE | Optional/Mandatory | DESCRIPTION |
|---|---|---|---|
payout_id |
string(50) | Mandatory | Payout ID (Unique) that was sent by you during Initiation. |
store_id |
string(30) | Mandatory | Your FundXPay Store ID is the integration credential which can be collected through our managers |
store_password |
string(30) | Mandatory | Your FundXPay Store Password is the integration credential which can be collected through our managers |
Returned Parameters
| PARAM NAME | DATA TYPE | DESCRIPTION |
|---|---|---|
api_status |
string(30) | API Connection Status:
|
status |
string(20) | Payout Status. This parameter needs to be checked before update your database as a
successful payout.
|
tran_date |
datetime | Payout date - Payout completion date as 2016-05-08 15:53:49 |
payout_id |
string(30) | Unique Payout ID that was sent by you during initiation. |
gateway |
string(50) | Issuer Gateway Name. Ex. bkash, nagad |
amount |
decimal(10,2) | The total amount sent by you. |
store_amount |
decimal(10,2) | The total amount including the 4% payout service charge that will be deducted from your merchant balance. (Example: If customer receives 100 BDT, your store amount will be 104 BDT after adding 4% payout fee) |
bank_tran_id |
string(80) | The Payout ID at Banks End. |
currency |
string(3) | Currency type of the payout. |
note_a |
string (255) | Same Value will be returned as Passed during initiation |
note_b |
string (255) | Same Value will be returned as Passed during initiation |
note_c |
string (255) | Same Value will be returned as Passed during initiation |
note_d |
string (255) | Same Value will be returned as Passed during initiation |
Example Code
Below is an example of how to query an payout using PHP and cURL. This code sends the required parameters to the FundXPay API and retrieves the payout details.
<?php
$post_data = array();
$post_data['store_id'] = 'your_store_id';
$post_data['store_password'] = 'your_store_password';
$post_data['payout_id'] = 'unique_payout_id_from_your_system';
# API endpoint
$api_url = 'https://sandbox.fundxpay.com/api/v1/query-payout';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // For local testing
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"api_status": "DONE",
"status": "VALID",
"failed_reason": null,
"payout_id": "unique_payout_id_from_your_system",
"gateway": "bkash",
"payout_mobile": "01600000001",
"amount": "100.00",
"store_amount": "104.00",
"tran_date": "2025-10-26 12:34:56",
"bank_tran_id": "BANK123456789",
"currency": "BDT",
"note_a": "Custom note A",
"note_b": "Custom note B",
"note_c": null,
"note_d": null
}
Support
If you encounter any issues or have questions, please visit our developer support forum or contact our support team. We're here to help you get up and running.