Merchant Login
Welcome to Hostemebd Developer Docs v2.4 API Production

Hostemebd is a robust, automated payment gateway infrastructure designed to seamlessly process personal and merchant accounts. Accept payments from customers on your websites and apps with real-time verification and instant callbacks.

Developer Notice

All requests must be made over secure HTTPS and pass your secret signature keys in HTTP request headers.

Supported Environments

Our payment gateway operates two distinct environments to ensure seamless development and reliable production deployments:

Sandbox (Testing)

Use test credentials to simulate successful and failed payments without moving real money.

Production (Live)

Connect live API and Brand credentials generated from your verified merchant portal.

Core REST APIs

The gateway redirects customers to the secure payment screen. Once completed, the customer returns to your store while your server receives transaction metadata.

1. Create Payment Endpoint

Generate a unique payment session URL by posting order details and customer data.

POST https://xtransactia.com/api/payment/create

2. Verify Payment Endpoint

Query the transaction status after the customer is redirected back to your success_url.

POST https://xtransactia.com/api/payment/verify

Required Authentication Headers

Every REST API request must include these 4 HTTP headers for authentication:

Header Key Type Required Description
Content-Type string Required Must always be set to application/json
API-KEY string Required Your public API application key from Merchant Dashboard
SECRET-KEY string Required Your confidential secret key from Merchant Dashboard
BRAND-KEY string Required The unique Brand Identifier key associated with your checkout

Payment Initialization Payload

JSON payload parameters to send in the body of POST /api/payment/create:

Field Name Type Required Description Example
cus_name string Required Customer's full name John Doe
cus_email string Required Valid customer email address for receipt delivery [email protected]
amount decimal Required Total payable charge amount without currency symbols 150.00
success_url url Required Callback URL where customer returns after successful payment https://site.com/success
cancel_url url Required URL where customer is redirected if they cancel payment https://site.com/cancel
meta_data object Optional Custom JSON metadata object for internal order tracking {"order_id": 1042}

Verification Payload Parameters

JSON payload parameters sent in the body of POST /api/payment/verify:

Field Name Type Required Description Example
transaction_id string Required The unique transaction reference received in the query parameter TRX_92847102

Code Implementation & SDKs

Select your preferred programming language or framework below for copy-pasteable request examples.

Sample Request (Create Payment)

 <?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://xtransactia.com/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: gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type: application/json', 'SECRET-KEY: YourSecretKeyHere', 'BRAND-KEY: YourBrandKeyHere' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ?> 
 <?php $client = new Client(); $headers = [ 'API-KEY' => 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type' => 'application/json', 'SECRET-KEY' => 'YourSecretKeyHere', 'BRAND-KEY' => 'YourBrandKeyHere' ]; $body = '{ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "metadata": { "phone": "016****" }, "amount": "10" }'; $request = new Request('POST', 'https://xtransactia.com/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://xtransactia.com/api/payment/create', headers: { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json', 'SECRET-KEY': 'YourSecretKeyHere', 'BRAND-KEY': 'YourBrandKeyHere' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); 
 import requests import json url = "https://xtransactia.com/api/payment/create" payload = json.dumps({ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "metadata": { "phone": "016****" }, "amount": "10" }) headers = { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json', 'SECRET-KEY': 'YourSecretKeyHere', 'BRAND-KEY': 'YourBrandKeyHere' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) 
 package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://xtransactia.com/api/payment/create" method := "POST" payload := strings.NewReader(`{"success_url":"yourdomain.com/success","cancel_url":"yourdomain.com/cancel","metadata":{"phone":"01521412457"},"amount":"10"}`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("API-KEY", "gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef") req.Header.Add("Content-Type", "application/json") req.Header.Add("SECRET-KEY", "YourSecretKeyHere") req.Header.Add("BRAND-KEY", "YourBrandKeyHere") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } 

Response Structure

Response Field Data Type Description
Success Response (HTTP 200 OK)
status boolean Returns true when payment initialization succeeds
message string Status message, e.g., "Payment initialized successfully"
payment_url url string Hosted Checkout Link where the customer must be redirected
Error Response (HTTP 400 / 401 / 500)
status boolean Returns false when error occurs
message string Specific error explanation (e.g. "Invalid API Key", "Amount required")
Redirection Query Parameters

Upon completing payment on the gateway, the customer will be redirected to your success_url or cancel_url with the following query parameters appended:
?transactionId=******&paymentMethod=***&paymentAmount=**.**&paymentFee=**.**&status=success

Sample Request (Verify Payment)

<?php
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => 'https://xtransactia.com/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: gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type: application/json', 'SECRET-KEY: Secret key From API credentials', 'BRAND-KEY: Brand key From Brands' ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?> 
<?php
$client = new Client();
$headers = [ 'API-KEY' => 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type' => 'application/json', 'SECRET-KEY' => 'Secret key From API credentials', 'BRAND-KEY' => 'Brand key From Brands'
];
$body = '{ "transaction_id": "ABCDEFH"
}';
$request = new Request('POST', 'https://xtransactia.com/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://xtransactia.com/api/payment/verify', headers: { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json', 'SECRET-KEY': 'Secret key From API credentials', 'BRAND-KEY': 'Brand key From Brands' }, data : data
};
axios.request(config)
.then((response) => { console.log(JSON.stringify(response.data));
})
.catch((error) => { console.log(error);
}); 
import http.client
import json
conn = http.client.HTTPSConnection("local.pay.expensivepay.com")
payload = json.dumps({ "transaction_id": "ABCDEFH"
})
headers = { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json', 'SECRET-KEY': 'Secret key From API credentials', 'BRAND-KEY': 'Brand key From Brands'
}
conn.request("POST", "/api/payment/verify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8")) 
package main
import ( "fmt" "strings" "net/http" "io/ioutil"
)
func main() { url := "https://xtransactia.com/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", "gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef") req.Header.Add("Content-Type", "application/json") req.Header.Add("SECRET-KEY", "Secret key From API credentials") req.Header.Add("BRAND-KEY", "Brand key From Brands") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body))
} 
Sample Response
{ "cus_name": "John Doe", "cus_email": "[email protected]", "amount": "900.000", "transaction_id": "OVKPXW165414", "metadata": { "phone": "015****", }, "payment_method": "bkash", "status": "COMPLETED"
} 

Verification Response Structure

Response Field Data Type Description
Success Response (HTTP 200 OK)
status string Transaction state: COMPLETED, PENDING, or ERROR
cus_name string Full name of the payer
cus_email string Email address of the payer
amount decimal Total transaction amount verified
transaction_id string Unique system transaction identifier
metadata object Custom metadata passed during payment creation
Error Response (HTTP 400 / 401 / 404)
status boolean Returns false when transaction cannot be verified
message string Reason for error (e.g. "Transaction not found", "Invalid Signature")

Plugins & Pre-Built Modules

No coding required! Integrate Hostemebd into popular eCommerce platforms and billing engines using our ready-made packages.

WooCommerce Payment Gateway Plugin

Compatible with WordPress 5.x–6.x and WooCommerce 7.x–9.x. Automatic order status update.

Download Plugin (.zip)
WHMCS Payment Gateway Module

Native billing gateway for web hosting providers. Seamless client area invoice clearing.

Download Module (.zip)
SMM Panel Automated Gateway

Instant balance recharge integration for social media marketing panel scripts.

Download Script (.zip)
Android SMS Auto-Listener APK

Automated background notification listener for personal merchant SIM devices.

Download APK (.apk)