FAST PAY BD DocsREST API · Sandbox & Live

Welcome to FAST PAY BD Docs Last updated: 2024-06-06

FAST PAY BD is a simple and secure payment automation tool designed to use a personal account as a payment gateway, so you can accept payments from your customers through your website. Here you will find a complete overview of how FAST PAY BD works and how to integrate the FAST PAY BD API into your website.

API Introduction

FAST PAY BD Payment Gateway enables merchants to receive money from their customers by temporarily redirecting them to www.fastpaybd.site. The gateway connects multiple payment terminals, including card systems, mobile financial services, and local and international wallets. After the payment is complete, the customer is returned to the merchant's site, and seconds later the merchant receives a notification with the transaction details. This document is intended for technical staff supporting the merchant's website. Working knowledge of HTML forms or cURL is required. You will probably need test accounts, which you can get by contacting fastpaybd.site or which may already have been provided to you.

API Operation

REST APIs are supported in two environments. Use the Sandbox environment for testing, then move to the live environment for production processing. When testing, generate an order URL with your test credentials to make calls to the Sandbox URIs. When you're ready to go live, use the live credentials assigned to your new signature key to generate a live order URL for the live URIs. Your server must support cURL. For HTML form submission, an HTML POST method URL is also provided after the cURL section.

Live API endpoint (create payment URL)
POSThttps://pay.fastpaybd.site/api/payment/create
Payment verify API
POSThttps://pay.fastpaybd.site/api/payment/verify

Parameter Details

Variables to POST to initialize the payment process in the gateway URL
Field nameDescriptionRequiredExample values
cus_nameCustomer full nameYesJohn Doe
cus_emailEmail address of the customerYesjohn@gmail.com
amountThe total amount payable. Skip trailing zeros when the amount is a whole number.Yes10 or 10.50 or 10.6
success_urlURL the customer returns to after a successful payment. This should be the last page on the merchant's website, where the customer is notified that the payment succeeded.Yeshttps://yourdomain.com/success.php
cancel_urlURL that returns the customer to your product page or home page.Yeshttps://yourdomain.com/cancel.php
meta_dataAny JSON-formatted data you want to pass alongNoJSON formatted
Variables needed for payment verify
Field nameDescriptionRequiredExample values
transaction_idTransaction ID received as a query parameter on the success URL you provided during payment creation.YesOVKPXW165414

Headers Details

Header nameValue
Content-Typeapplication/json
API-KEYApp key from API credentials
SECRET-KEYSecret key from API credentials
BRAND-KEYBrand key from Brands

Integration

You can integrate our payment gateway into your PHP, Laravel, WordPress and WooCommerce sites.

Sample Request

POSThttps://pay.fastpaybd.site/api/payment/create
<?php$curl = curl_init();curl_setopt_array($curl, array( CURLOPT_URL => 'https://pay.fastpaybd.site/api/payment/create', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{"success_url":"yourdomain.com/success","cancel_url":"yourdomain.com/cancel","metadata":{"phone":"016****"},"amount":"10"}', CURLOPT_HTTPHEADER => array( 'API-KEY: YOUR_API_KEY', 'Content-Type: application/json', 'SECRET-KEY: YOUR_SECRET_KEY', 'BRAND-KEY: YOUR_BRAND_KEY' ),));$response = curl_exec($curl);curl_close($curl);echo $response;
<?phprequire 'vendor/autoload.php';use GuzzleHttp\Client;use GuzzleHttp\Psr7\Request;$client = new Client();$headers = [ 'API-KEY' => 'YOUR_API_KEY', 'Content-Type' => 'application/json', 'SECRET-KEY' => 'YOUR_SECRET_KEY', 'BRAND-KEY' => 'YOUR_BRAND_KEY'];$body = '{ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "metadata": { "phone": "016****" }, "amount": "10"}';$request = new Request('POST', 'https://pay.fastpaybd.site/api/payment/create', $headers, $body);$res = $client->sendAsync($request)->wait();echo $res->getBody();
const axios = require('axios');let data = JSON.stringify({ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "metadata": { "phone": "016****" }, "amount": "10"});let config = { method: 'post', maxBodyLength: Infinity, url: 'https://pay.fastpaybd.site/api/payment/create', headers: { 'API-KEY': 'YOUR_API_KEY', 'Content-Type': 'application/json', 'SECRET-KEY': 'YOUR_SECRET_KEY', 'BRAND-KEY': 'YOUR_BRAND_KEY' }, data : data};axios.request(config).then((response) => { console.log(JSON.stringify(response.data));}).catch((error) => { console.log(error);});
import requestsimport jsonurl = "https://pay.fastpaybd.site/api/payment/create"payload = json.dumps({ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "metadata": { "phone": "016****" }, "amount": "10"})headers = { 'API-KEY': 'YOUR_API_KEY', 'Content-Type': 'application/json', 'SECRET-KEY': 'YOUR_SECRET_KEY', 'BRAND-KEY': 'YOUR_BRAND_KEY'}response = requests.request("POST", url, headers=headers, data=payload)print(response.text)
package mainimport ( "fmt" "io" "net/http" "strings")func main() { url := "https://pay.fastpaybd.site/api/payment/create" method := "POST" payload := strings.NewReader(`{"success_url":"yourdomain.com/success","cancel_url":"yourdomain.com/cancel","metadata":{"phone":"016****"},"amount":"10"}`) client := &http.Client{} req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("API-KEY", "YOUR_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("SECRET-KEY", "YOUR_SECRET_KEY") req.Header.Add("BRAND-KEY", "YOUR_BRAND_KEY") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body))}
Required headers API-KEYSECRET-KEYBRAND-KEYContent-Type: application/json

Response Details

Field Name Type Description
Success Response
status bool TRUE
message String Message for Status
payment_url String Payment Link (where customers will complete their payment)
Error Response
status bool FALSE
message String Message associated with the error response

Completing Payment Page task you will be redirected to success or cancel page based on transaction status with the following Query Parameters:

yourdomain.com/(success/cancel)?transactionId=******&paymentMethod=***&paymentAmount=**.**&paymentFee=**.**&status=pending or success or failed
transactionIdpaymentMethodpaymentAmountpaymentFee status = pendingsuccessfailed

Verify Request

Verify payment

Confirm a transaction before delivering your product or service.
POSThttps://pay.fastpaybd.site/api/payment/verify
<?php$curl = curl_init();curl_setopt_array($curl, array( CURLOPT_URL => 'https://pay.fastpaybd.site/api/payment/verify', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => '{"transaction_id":"ABCDEFH"}', CURLOPT_HTTPHEADER => array( 'API-KEY: YOUR_API_KEY', 'Content-Type: application/json', 'SECRET-KEY: YOUR_SECRET_KEY', 'BRAND-KEY: YOUR_BRAND_KEY' ),));$response = curl_exec($curl);curl_close($curl);echo $response;
<?phpuse GuzzleHttp\Client;use GuzzleHttp\Psr7\Request;$client = new Client();$headers = [ 'API-KEY' => 'YOUR_API_KEY', 'Content-Type' => 'application/json', 'SECRET-KEY' => 'YOUR_SECRET_KEY', 'BRAND-KEY' => 'YOUR_BRAND_KEY'];$body = '{ "transaction_id": "ABCDEFH"}';$request = new Request('POST', 'https://pay.fastpaybd.site/api/payment/verify', $headers, $body);$res = $client->sendAsync($request)->wait();echo $res->getBody();
const axios = require('axios');let data = JSON.stringify({ "transaction_id": "ABCDEFH"});let config = { method: 'post', maxBodyLength: Infinity, url: 'https://pay.fastpaybd.site/api/payment/verify', headers: { 'API-KEY': 'YOUR_API_KEY', 'Content-Type': 'application/json', 'SECRET-KEY': 'YOUR_SECRET_KEY', 'BRAND-KEY': 'YOUR_BRAND_KEY' }, data: data};axios.request(config).then((response) => { console.log(JSON.stringify(response.data));}).catch((error) => { console.log(error);});
import http.clientimport jsonconn = http.client.HTTPSConnection("pay.fastpaybd.site")payload = json.dumps({ "transaction_id": "ABCDEFH"})headers = { 'API-KEY': 'YOUR_API_KEY', 'Content-Type': 'application/json', 'SECRET-KEY': 'YOUR_SECRET_KEY', 'BRAND-KEY': 'YOUR_BRAND_KEY'}conn.request("POST", "/api/payment/verify", payload, headers)res = conn.getresponse()data = res.read()print(data.decode("utf-8"))
package mainimport ( "fmt" "io" "net/http" "strings")func main() { url := "https://pay.fastpaybd.site/api/payment/verify" method := "POST" payload := strings.NewReader(`{"transaction_id":"ABCDEFH"}`) client := &http.Client{} req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("API-KEY", "YOUR_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("SECRET-KEY", "YOUR_SECRET_KEY") req.Header.Add("BRAND-KEY", "YOUR_BRAND_KEY") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body))}
Required headers API-KEYSECRET-KEYBRAND-KEYContent-Type: application/json

Sample response

What you get back for a completed payment.
JSONCompleted payment
{ "cus_name": "John Doe", "cus_email": "john@gmail.com", "amount": "900.000", "transaction_id": "OVKPXW165414", "metadata": { "phone": "015****" }, "payment_method": "bkash", "status": "COMPLETED"}

Response details

Every field returned by the verify endpoint.
Field nameTypeDescription
Success response
status string COMPLETEDPENDINGERROR
cus_name string Customer name
cus_email string Customer email
amount string Payment amount
transaction_id string Transaction ID generated by the system
metadata json Metadata sent when the payment was created
Error response
status bool FALSE
message string Message describing the error

WordPress Module

WordPress ZIP 13 KB

Integrate our payment gateway into your WordPress website effortlessly. Whether you run an e-commerce store, a membership site, or a donation platform, our WordPress module makes it easy to accept payments online. Download now and start accepting payments with ease!

Download Now

WHMCS Module

WHMCS ZIP 3 KB

Integrate our payment gateway seamlessly into your WHMCS setup. With our module, you can easily accept payments from your customers, manage invoices, and track transactions effortlessly. Get started with just a few clicks!

Download Now

SMM Panel Module

SMM Panel ZIP 13 KB

Enhance your SMM panel with our payment gateway integration module. Streamline the payment process for your social media marketing services and provide a seamless experience for your clients. Download the module now and take your SMM panel to the next level!

Download Now

Mobile App

Android APK 6.4 MB

Setup video: Watch here

Download Mobile App Now