Documentation for Sohojpay BD

Gateway Recharge Create Your Account

Overview

SohojpayBD General overview

Effortlessly connect through our system. Seamlessly link applications and data sources, automate tasks, and enjoy smooth workflows with ease. Receive payments directly into your personal account using our payment automation software, eliminating the need for manual payment handling.

Setup your panel

Checkpoint Tips:

Setup your Mobile App

Checkpoint Tips:

Resources

Composer command

See documentation for composer installation:

Github:https://github.com/blitheforge/sohojpaybd-php-lib
composer require sohojpay/sohojpay-lib
API Reference

See our api reference:

Reference:https://sohojpayb.readme.io/reference/post_api-payment-create
SohojpayBD Api Reference
Checkout POPUP

Add This JS To Your Page:

<script src="https://scripts.sohojpaybd.com/checkout.js"></script>
<script> sohojpayCheckOut(payment_url); </script>
Payment Url From payment api Endpoint

Payment Create Process

We have made Live environment to process payments.

REST API
API Endpoint for Create Payment: https://secure.sohojpaybd.com/api/payment/create
Method:GET or POST

Request Parameters

Param Name Data Type Description
cus_name string (50) Mandatory - This parameter will be returned only when the request successfully initiates
cus_email string (50) Mandatory - This parameter will be returned only when the request successfully initiates
cus_phone string (50) Optional - This parameter will be returned only when the request successfully initiates
metadata JSON (150) Optional- use {"phone":01****} to send customer sms - This parameter will be returned as when the request successfully initiates
success_url string (100) Mandatory - This parameter will be returned only when the request successfully initiates
cancel_url string (100) Mandatory - This parameter will be returned only when the request successfully initiates
webhook_url string (100) Optional - This url will be called when a payment will be completed
amount string (50) Mandatory - This parameter will be returned only when the request successfully initiates

Request Headers

Header Name Value
Content-Type "application/json"
SOHOJPAY-API-KEY Your Brand KEY as API KEY

Create Payment Request

Live Environment:

API Endpoint for Create Payment: https://secure.sohojpaybd.com/api/payment/create

Payment Create code


<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://secure.sohojpaybd.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 =>'{"cus_name":"Demo","cus_email":"demo@gmail.com","cus_phone":"015****","success_url":"yourdomain.com/success","cancel_url":"yourdomain.com/cancel","webhook_url":"yourdomain.com/webhook","metadata":{"phone":"015****"},"amount":"10"} ',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'SOHOJPAY-API-KEY: NKfoJJL14oLhMBFzlpDchNVwS01L7VutKUcfYmWEk3clB50N7n'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>
                

<?php
require 'vendor/autoload.php';

use GuzzleHttp\Client;

$client = new Client();
$response = $client->post('https://secure.sohojpaybd.com/api/payment/create', [
    'json' => [
        'cus_name' => 'Demo',
        'cus_email' => 'demo@gmail.com',
        'cus_phone' => '015****',
        'success_url' => 'yourdomain.com/success',
        'cancel_url' => 'yourdomain.com/cancel',
        'webhook_url' => 'yourdomain.com/webhook',
        'metadata' => ['phone' => '015****'],
        'amount' => '10'
    ],
    'headers' => [
        'Content-Type' => 'application/json',
        'SOHOJPAY-API-KEY' => 'NKfoJJL14oLhMBFzlpDchNVwS01L7VutKUcfYmWEk3clB50N7n'
    ]
]);

echo $response->getBody();

?>
                

const axios = require('axios');

let data = {
    cus_name: 'Demo',
    cus_email: 'demo@gmail.com',
    cus_phone: '015****',
    success_url: 'yourdomain.com/success',
    cancel_url: 'yourdomain.com/cancel',
    webhook_url: 'yourdomain.com/webhook',
    metadata: { phone: '015****' },
    amount: '10'
};

let config = {
    method: 'post',
    url: 'https://secure.sohojpaybd.com/api/payment/create',
    headers: {
        'Content-Type': 'application/json',
        'SOHOJPAY-API-KEY': 'NKfoJJL14oLhMBFzlpDchNVwS01L7VutKUcfYmWEk3clB50N7n'
    },
    data: data
};

axios(config)
    .then(response => {
        console.log(JSON.stringify(response.data));
    })
    .catch(error => {
        console.error(error);
    });
                

import requests

url = "https://secure.sohojpaybd.com/api/payment/create"

payload = {
    "cus_name": "Demo",
    "cus_email": "demo@gmail.com",
    "cus_phone": "015****",
    "success_url": "yourdomain.com/success",
    "cancel_url": "yourdomain.com/cancel",
    "webhook_url": "yourdomain.com/webhook",
    "metadata": {"phone": "015****"},
    "amount": "10"
}

headers = {
    'Content-Type': 'application/json',
    'SOHOJPAY-API-KEY': 'NKfoJJL14oLhMBFzlpDchNVwS01L7VutKUcfYmWEk3clB50N7n'
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
                

var xhr = new XMLHttpRequest();
xhr.open("POST", "https://secure.sohojpaybd.com/api/payment/create", true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("SOHOJPAY-API-KEY", "NKfoJJL14oLhMBFzlpDchNVwS01L7VutKUcfYmWEk3clB50N7n");

xhr.onreadystatechange = function () {
    if (xhr.readyState === 4 && xhr.status === 200) {
        console.log(xhr.responseText);
    }
};

var data = JSON.stringify({
    "cus_name": "Demo",
    "cus_email": "demo@gmail.com",
    "cus_phone": "015****",
    "success_url": "yourdomain.com/success",
    "cancel_url": "yourdomain.com/cancel",
    "webhook_url": "yourdomain.com/webhook",
    "metadata": {"phone": "015****"},
    "amount": "10"
});

xhr.send(data);
                

Gateway Response

Response:
{
    "status": 1,
    "message": "Payment Link",
    "payment_url": "https://secure.sohojpaybd.com/api/execute/c8ae8041fd6b6f6f46a22731ac27f332"
}
                  
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=**.**&currency=****&status=pending or success or failed
Parameters

In GET Request

Param Name Data Type Description
transactionId string (50) Receive it by $_GET['transactionId'] in your success and cancel url
paymentMethod string (50) Receive it by $_GET['paymentMethod'] in your success and cancel url
paymentAmount string (50) Receive it by $_GET['paymentAmount'] in your success and cancel url
paymentFee string (50) Receive it by $_GET['paymentFee'] in your success and cancel url
currency string (50) Receive it by $_GET['currency'] ;
Currecny List

USD => United States dollar
AED => United Arab Emirates dirham
AFN => Afghan afghani
ALL => Albanian lek
AMD => Armenian dram
ANG => Netherlands Antillean guilder
AOA => Angolan kwanza
ARS => Argentine peso
AUD => Australian dollar
AWG => Aruban florin
AZN => Azerbaijani manat
BAM => Bosnia and Herzegovina convertible mark
BBD => Barbadian dollar
BDT => Bangladeshi taka
BGN => Bulgarian lev
BHD => Bahraini dinar
BIF => Burundian franc
BMD => Bermudian dollar
BND => Brunei dollar
BOB => Bolivian boliviano
BRL => Brazilian real
BSD => Bahamian dollar
BTN => Bhutanese ngultrum
BWP => Botswana pula
BYN => Belarusian ruble
BZD => Belize dollar
CAD => Canadian dollar
CDF => Congolese franc
CHF => Swiss franc
CLP => Chilean peso
CNY => Chinese yuan
COP => Colombian peso
CRC => Costa Rican colón
CUP => Cuban peso
CVE => Cape Verdean escudo
CZK => Czech koruna
DJF => Djiboutian franc
DKK => Danish krone
DOP => Dominican peso
DZD => Algerian dinar
EGP => Egyptian pound
ERN => Eritrean nakfa
ETB => Ethiopian birr
EUR => Euro
FJD => Fijian dollar
FKP => Falkland Islands pound
FOK => Faroese króna
GBP => British pound
GEL => Georgian lari
GGP => Guernsey pound
GHS => Ghanaian cedi
GIP => Gibraltar pound
GMD => Gambian dalasi
GNF => Guinean franc
GTQ => Guatemalan quetzal
GYD => Guyanese dollar
HKD => Hong Kong dollar
HNL => Honduran lempira
HRK => Croatian kuna
HTG => Haitian gourde
HUF => Hungarian forint
IDR => Indonesian rupiah
ILS => Israeli new shekel
IMP => Isle of Man pound
INR => Indian rupee
IQD => Iraqi dinar
IRR => Iranian rial
ISK => Icelandic króna
JEP => Jersey pound
JMD => Jamaican dollar
JOD => Jordanian dinar
JPY => Japanese yen
KES => Kenyan shilling
KGS => Kyrgyzstani som
KHR => Cambodian riel
KID => Kiribati dollar
KMF => Comorian franc
KRW => South Korean won
KWD => Kuwaiti dinar
KYD => Cayman Islands dollar
KZT => Kazakhstani tenge
LAK => Lao kip
LBP => Lebanese pound
LKR => Sri Lankan rupee
LRD => Liberian dollar
LSL => Lesotho loti
LYD => Libyan dinar
MAD => Moroccan dirham
MDL => Moldovan leu
MGA => Malagasy ariary
MKD => Macedonian denar
MMK => Burmese kyat
MNT => Mongolian tögrög
MOP => Macanese pataca
MRU => Mauritanian ouguiya
MUR => Mauritian rupee
MVR => Maldivian rufiyaa
MWK => Malawian kwacha
MXN => Mexican peso
MYR => Malaysian ringgit
MZN => Mozambican metical
NAD => Namibian dollar
NGN => Nigerian naira
NIO => Nicaraguan córdoba
NOK => Norwegian krone
NPR => Nepalese rupee
NZD => New Zealand dollar
OMR => Omani rial
PAB => Panamanian balboa
PEN => Peruvian sol
PGK => Papua New Guinean kina
PHP => Philippine peso
PKR => Pakistani rupee
PLN => Polish złoty
PYG => Paraguayan guaraní
QAR => Qatari riyal
RON => Romanian leu
RSD => Serbian dinar
RUB => Russian ruble
RWF => Rwandan franc
SAR => Saudi riyal
SBD => Solomon Islands dollar
SCR => Seychellois rupee
SDG => Sudanese pound
SEK => Swedish krona
SGD => Singapore dollar
SHP => Saint Helena pound
SLE => Sierra Leonean leone
SLL => Sierra Leonean leone
SOS => Somali shilling
SRD => Surinamese dollar
SSP => South Sudanese pound
STN => São Tomé and Príncipe dobra
SYP => Syrian pound
SZL => Eswatini lilangeni
THB => Thai baht
TJS => Tajikistani somoni
TMT => Turkmenistani manat
TND => Tunisian dinar
TOP => Tongan paʻanga
TRY => Turkish lira
TTD => Trinidad and Tobago dollar
TVD => Tuvaluan dollar
TWD => New Taiwan dollar
TZS => Tanzanian shilling
UAH => Ukrainian hryvnia
UGX => Ugandan shilling
UYU => Uruguayan peso
UZS => Uzbekistani soʻm
VES => Venezuelan bolívar
VND => Vietnamese đồng
VUV => Vanuatu vatu
WST => Samoan tala
XAF => Central African CFA franc
XCD => East Caribbean dollar
XDR => Special drawing rights
XOF => West African CFA franc
XPF => CFP franc
YER => Yemeni rial
ZAR => South African rand
ZMW => Zambian kwacha
ZWL => Zimbabwean dollar
                                 

status string Receive it by $_GET['status'] in your success and cancel url and value will be [pending or success or failed]

Verify Payment Process

We have made Live environment to verify payments.

REST API
API Endpoint for Verify Payment: https://secure.sohojpaybd.com/api/payment/verify
Method:GET or POST

Verify Parameters

Param Name Data Type Description
transaction_id string Mandatory -This parameter can be retrieved from the "transactionId" (GET parameter).

Verify Headers

Header Name Value
Content-Type "application/json"
SOHOJPAY-API-KEY Your Brand KEY as API KEY

Verify Payment Request

Live Environment:

API Endpoint for Verify Payment: https://secure.sohojpaybd.com/api/payment/verify

Payment Verify code

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://secure.sohojpaybd.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":"GCAN7A410970"}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'SOHOJPAY-API-KEY: NKfoJJL14oLhMBFzlpDchNVwS01L7VutKUcfYmWEk3clB50N7n'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
                
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;

$client = new Client();
$headers = [
  'Content-Type' => 'application/json',
  'SOHOJPAY-API-KEY' => 'NKfoJJL14oLhMBFzlpDchNVwS01L7VutKUcfYmWEk3clB50N7n'
];
$body = '{"transaction_id":"GCAN7A410970"}';
$request = new Request('POST', 'https://secure.sohojpaybd.com/api/payment/verify', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
?>
                
const axios = require('axios');
const data = JSON.stringify({
  "transaction_id": "GCAN7A410970"
});

const config = {
  method: 'post',
  url: 'https://secure.sohojpaybd.com/api/payment/verify',
  headers: { 
    'Content-Type': 'application/json', 
    'SOHOJPAY-API-KEY': 'NKfoJJL14oLhMBFzlpDchNVwS01L7VutKUcfYmWEk3clB50N7n'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
                
import requests
import json

url = "https://secure.sohojpaybd.com/api/payment/verify"

payload = json.dumps({
  "transaction_id": "GCAN7A410970"
})
headers = {
  'Content-Type': 'application/json',
  'SOHOJPAY-API-KEY': 'NKfoJJL14oLhMBFzlpDchNVwS01L7VutKUcfYmWEk3clB50N7n'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
                
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://secure.sohojpaybd.com/api/payment/verify");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("SOHOJPAY-API-KEY", "NKfoJJL14oLhMBFzlpDchNVwS01L7VutKUcfYmWEk3clB50N7n");

var data = JSON.stringify({
  "transaction_id": "GCAN7A410970"
});

xhr.send(data);
                

Verify Response

Response:
{
   "cus_name": "Demo",
   "cus_email": "demo@gmail.com",
   "cus_phone": "015****",
   "amount": "10.000",
   "currency": "BDT",
   "transaction_id": "GCAN7A410970",
   "metadata": {
      "phone": "015****",
   },
   "payment_method": "bkash",
   "status": "COMPLETED"
}
                  
Response Details
Field Name Type Description
Success Response
status string COMPLETED or PENDING or ERROR
cus_name String Customer Name
cus_email String Customer Email
cus_phone String Customer Phone Number
amount String Amount
currency String Currency
transaction_id String Transaction id Generated by System
metadata json Metadata used for Payment creation
Error Response
status bool FALSE
message String Message associated with the error response

All Modules

Whmcs Module
WHMCS MODULE
Wordpress Module
Wp module
SMM Panel Module (DreamPanel)
SMM Panel (Dream Panel) Module
Modified SMM Panel Module
Modified SMM Panel Module
Sketchware Module
Sketchware Module