Documentation for Paystation

In this section you'll find basic information about Paystation and how to install it and use it properly. If you're first time user then you should read Getting Started section first.

Registration Postman collection (sandbox) Test Cards

Hosted Checkout

Hosted Checkout Integration

Here, you will redirect the customer to Paystation Hosted page to display the payment channels and Customer will be redirected after completing payment to your website with payment response.

Payment Process Environment

We have both Live environment and Test/Sandbox environment in Paystation. 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://api.paystation.com.bd

Initiate Payment

API NAME : Initiate Payment
API URL : https://api.paystation.com.bd/initiate-payment
METHOD : POST

Request Data

Param_Name Data_Type Description
Request Parameters
merchantId string Mandatory - Your Merchant ID will be provided by PayStation.
Example: 204-16537301811
password string Mandatory - Your Password will be provided by PayStation.
Example: gamepass
invoice_number string Mandatory - Unique invoice number for the transaction.
Example: 900113355
currency string Currency code for the transaction.
Example: BDT
payment_amount integer Mandatory - Transaction amount.
Example: 1
pay_with_charge integer Will merchant bear the payment charge or not
Example: 1
reference string Reference information for the transaction.
Example: Some Ref Info
cust_name string Mandatory - Customer's full name.
Example: MM
cust_phone string Mandatory - Customer's phone number.
Example: 01726315133
cust_email string Mandatory - Customer's email address.
Example: mm@mm.com
cust_address string Customer's physical address.
Example: Customer address
callback_url string (URL) Mandatory - URL to receive transaction status updates.
Example: https://api.paystation.com.bd/payment-success/104
checkout_items string / JSON Details of the purchased items.
Example: Some text or JSON
opt_a string / JSON Any optional informattion
Example: Some text or JSON
opt_b string / JSON Any optional informattion
Example: Some text or JSON
opt_c string / JSON Any optional informattion
Example: Some text or JSON

Request Response

Param_Name Description
status_code Status code "200" indicates the request was successful. Any other code indicates failure.
status Indicates the status of the request: success or failed.
message Provides additional details about the response.
Example: Payment Link Created Successfully.
payment_amount The amount for the payment.
Example: 1
invoice_number The unique invoice number for the transaction.
Example: 90011335545343
payment_url The URL for the payment checkout page.
Example: https://api.paystation.com.bd/checkout/12117397758013220/ZzHkhjalJ1ulsjuJOdx1mCSN1nj5AGPAvr1BlBjpccTFlC02hX

Sample Request & Response

						
1.PHP CURL SCRIPT : 

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.paystation.com.bd/initiate-payment',
  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 => array('invoice_number' => '90011335545343','currency' => 'BDT','payment_amount' => '1','reference' => 'Some Ref Info','cust_name' => 'MM','cust_phone' => '01726315133','cust_email' => 'mm@mm.com','cust_address' => 'Customer address','callback_url' => 'https://api.paystation.com.bd/payment-success/104','checkout_items' => 'Some text or JSON','merchantId' => '1104-164354','password' => 'gameone'),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;



2. SUCCESS RESPONSE (json format):
{
    "status_code": "200",
    "status": "success",
    "message": "Payment Link Created Successfully.",
    "payment_amount": "1",
    "invoice_number": "90011335545343",
    "payment_url": "https://api.paystation.com.bd/checkout/12117397758013220/ZzHkhjalJ1ulsjuJOdx1mCSN1nj5AGPAvr1BlBjpccTFlC02hX"
}

3. FAILED RESPONSE (json format):
{
    "status_code": "1008",
    "status": "failed",
    "message": "Duplicate invoice number."
}		
                        
					

Payment Notification (callback)

After completing the payment, we will send the payment information to the callback URL that you provided in the create payment API. The payment details will be sent via the URL parameters in the callback request.

Example : http://yourdomain.com/success.php?status=Successful&invoice_number=2021252525&trx_id=10XB9900

URL Parameters

Param Name Description
status Payment Status: Successful/Failed/Canceled
invoice_number Your unique invoice_number that you have been sent in payment create API.
trx_id Payment Transaction ID (you will get trx_id for success payment only)

Transaction status

API NAME : TRANSACTION STATUS
API URL : https://api.paystation.com.bd/transaction-status
METHOD : POST

Request Data

Param Name Description
Request Header Parameter
merchantId Mandatory Your Merchant ID provided by PayStation. Example: 204-16537301811.
Request Body
invoice_number Mandatory - Your unique invoice_number that you have been sent in payment create API.

Request Response

Param_Name Description
status_code Status code "200" indicates that the request was successfully processed.
status Indicates the request status: success or failed.
message Provides details about the response.
Example: Transaction found
data (Returned if status_code is "200")
invoice_number The unique invoice number for the transaction.
Example: 90011335545343
trx_status Current transaction status. Possible values: processing, success, failed, refund.
Example: processing
trx_id Unique Payment Transaction ID. (Empty if not available)
payment_amount The transaction amount.
Example: 1.00
order_date_time The date and time of the transaction.
Example: 2025-02-17 13:03:21
payer_mobile_no Payer's mobile number. (Empty if not available)
payment_method Payment method used (bKash/Nagad/Rocket/Upay/Mastercard/Visa). (Empty if not available)
reference Reference information sent during the payment creation.
Example: Some Ref Info
checkout_items The checkout items sent in the payment create API.
Example: Some text or JSON

Sample Request & Response

						
1.PHP CURL REQUEST : 
						
$header=array(
    'merchantId:104-1653730183'                                                       
);
$body=array(
    'invoice_number' => "2021252525"
);

$url = curl_init("https://api.paystation.com.bd/transaction-status");
curl_setopt($url,CURLOPT_HTTPHEADER, $header);
curl_setopt($url,CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($url,CURLOPT_RETURNTRANSFER, true);
curl_setopt($url,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($url,CURLOPT_POSTFIELDS, $body);
curl_setopt($url,CURLOPT_FOLLOWLOCATION, 1);
$responseData=curl_exec($url);
curl_close($url);


2. SUCCESS RESPONSE (json format):
{
    "status_code":"200",
    "status":"success",
    "message":"Transaction found.",
    "data":
    {
       "invoice_number":"2021252525", 
       "trx_status":"Success",
       "trx_id":"10XB9900",
       "payment_amount":"120",
       "order_date_time":"2022-12-25 10:25:30",
       "payer_mobile_no":"01700000001",
       "payment_method":"bkash",
       "reference":"102030",
       "checkout_items":"orderItems",
    }
}

3. SUCCESS RESPONSE (BUT TRANSACTION FAILED):
{
    "status_code": "200",
    "status": "success",
    "message": "Transaction found",
    "data": {
        "invoice_number": "2021252525",
        "trx_status": "Failed",
        "trx_id": "",
        "payment_amount": "120.00",
        "order_date_time": "2023-01-14 11:04:42",
        "payer_mobile_no": "",
        "payment_method": "",
        "reference": "102030",
        "checkout_items": "orderItems"
    }
}

3. FAILED RESPONSE (json format):
{
    "status_code":"2001",
    "status":"failed",
    "message":"Invalid Token."
}