Welcome to Sosta Pay Documentation Last updated: 2024-06-06

Sosta Pay is a secure and reliable payment automation solution designed to transform your personal account into a fully functional payment gateway. This comprehensive documentation provides everything you need to integrate our API into your website and start accepting payments from customers worldwide.

Quick Start

Get started in 3 easy steps:

  1. Obtain your API credentials from the dashboard
  2. Choose your preferred integration method
  3. Test in sandbox mode before going live

API Documentation

Our RESTful API provides a seamless and secure integration experience for receiving payments through multiple channels including card systems, mobile financial services, and digital wallets.

API Introduction

The Sosta Pay Payment Gateway enables merchants to securely receive payments by temporarily redirecting customers to our secure payment portal. After successful payment completion, customers are redirected back to your website, and you receive instant payment notifications with complete transaction details.

Technical Requirements: Working knowledge of HTML forms or cURL is required for integration. Test accounts are available for development purposes.

API Operation

We support REST APIs in both sandbox (testing) and production environments. Use the sandbox environment for development and testing, then switch to production when ready to go live.

Live API Endpoint (Payment Creation):
https://pay.sostapay.xyz/api/payment/create
Payment Verification API:
https://pay.sostapay.xyz/api/payment/verify

Important: Your server must support cURL for API integration. For HTML form submissions, please refer to our alternative integration methods.

Parameter Details

Payment Creation Parameters

Required parameters to initialize the payment process:

Field Name Description Required Example Values
cus_name Customer's full name Yes John Doe
cus_email Customer's email address Yes john@example.com
amount Total payment amount (omit trailing zeros for whole numbers) Yes 10, 10.50, or 10.6
success_url URL to redirect customer after successful payment Yes https://yourdomain.com/success.php
cancel_url URL to redirect customer if payment is cancelled Yes https://yourdomain.com/cancel.php
meta_data Additional JSON-formatted data for custom requirements Optional {"order_id": "12345", "product": "Premium Plan"}

Payment Verification Parameters

Parameters required for payment verification:

Field Name Description Required Example Values
transaction_id Transaction ID received from success URL callback Yes OVKPXW165414

API Headers Configuration

Header Name Value Source
Content-Type application/json Fixed Value
API-KEY Your unique API key API Credentials Section
SECRET-KEY Your secret key API Credentials Section
BRAND-KEY Your brand identifier key Brands Management Section

Integration Guide

Seamlessly integrate our payment gateway into your PHP, Laravel, WordPress, WooCommerce, and other platforms. Choose from direct API integration or Sosta Pay modules for faster implementation.

Sample API Request

 <?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://pay.sostapay.xyz/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://pay.sostapay.xyz/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.sostapay.xyz/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://pay.sostapay.xyz/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://pay.sostapay.xyz/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 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

Payment Verification Request

<?php
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => 'https://pay.sostapay.xyz/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://pay.sostapay.xyz/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.sostapay.xyz/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://pay.sostapay.xyz/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": "john@gmail.com", "amount": "900.000", "transaction_id": "OVKPXW165414", "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
amount String Amount
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

Sosta-Pay Modules

Accelerate your integration with our professionally developed modules for popular platforms. Each module comes with easy installation guides and full support.

WordPress Plugin v2.1

Integrate our payment gateway seamlessly into your WordPress website. Perfect for e-commerce stores, membership sites, donation platforms, and any WordPress-based business.

  • Easy setup with configuration wizard
  • WooCommerce compatible
  • Multi-currency support
  • Real-time payment notifications
  • Detailed transaction reports

WHMCS Module v1.5

Integrate our payment gateway seamlessly into your WHMCS billing system. Manage invoices, accept payments, and track transactions effortlessly with our professional module.

  • Automatic invoice synchronization
  • Support for all WHMCS versions
  • Multi-gateway support
  • Automated payment reconciliation
  • Comprehensive transaction logging

SMM Panel Module v1.2

Enhance your social media marketing panel with our specialized payment gateway module. Streamline payment processing and provide a seamless experience for your clients.

  • Built for popular SMM panels
  • Automatic balance top-up
  • Multi-payment method support
  • Real-time payment processing
  • Customizable payment forms

Sketchware SWB Module v1.0

Integrate payment functionality into your Sketchware mobile applications with our specialized SWB module. Perfect for developers creating Android apps with payment features.

  • Ready-to-use Sketchware blocks
  • Easy drag-and-drop integration
  • Mobile-optimized payment forms
  • Secure transaction handling
  • Comprehensive documentation

Laravel Topup Module v1.3

Seamlessly integrate payment functionality into your Laravel-based topup or recharge applications. Perfect for telecom, gaming, or digital service platforms.

  • Built for Laravel 8+
  • Eloquent model integration
  • Queue support for async processing
  • Multiple payment method support
  • Webhook handling included

Mobile Application v2.5

Manage your payments on the go with our feature-rich mobile application. Available for Android devices with iOS coming soon.

  • Real-time payment monitoring
  • Instant payment notifications
  • Transaction history tracking
  • Secure biometric authentication
  • Multi-language support

Setup Guide: Watch our detailed setup video for step-by-step instructions.

Watch Setup Video Download Mobile App

Developer Support

Looking for Custom Development Solutions?
Connect with Developer HMS for professional application and website development services. With extensive experience in payment gateway integration and platform development, we provide tailored solutions to meet your specific requirements.

Our Services Include:
  • Custom payment gateway integration
  • E-commerce platform development
  • Mobile application development
  • API customization and optimization
  • Technical consultation and support

Contact Developer HMS

Get Professional Assistance

Whether you need help with integration, custom module development, or complete application building, our team is ready to assist you. We offer:

Custom Integration

Tailored integration solutions for unique business requirements and specialized platforms.

App Development

Full-stack mobile and web application development with payment gateway integration.