Paystation Logo
Paystation Logo

Documentation for Integration


In this section you'll find basic information about PayStation and how to install and use it properly. If you're a first-time user, you should read the Getting Started section first.

Hosted Checkout

Hosted Checkout Integration

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

Checkout Page

Payment Process Environment

We have both Live and Test/Sandbox environments in PayStation. You just need to use the proper URL and Store ID to process payments. We provide separate store IDs for live and test.

Live Environment

All transactions made using this environment are counted as real transactions. The 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_NAMEDATA_TYPE DESCRIPTION
merchantIdstring(Mandatory) Your Merchant ID will be provided by PayStation.
Example: 204-16537301811
passwordstring(Mandatory) Your Password will be provided by PayStation.
Example: gamepass
invoice_numberstring(Mandatory) Unique invoice number for the transaction.
Example: 90011355
currencystringCurrency code for the transaction.
Example: BDT
payment_amountinteger(Mandatory) Transaction amount.
Example: 1
pay_with_chargeintegerWill the merchant bear the payment charge or not.
Example: 1
referencestringReference information for the transaction.
Example: Some Ref Info
cust_namestring(Mandatory) Customer's full name.
Example: MM
cust_phonestring(Mandatory) Customer's phone number.
Example: 01726315133
cust_emailstring(Mandatory) Customer's email address.
Example: [email protected]
cust_addressstringCustomer's physical address.
Example: Customer address
callback_urlstring (URL)(Mandatory) URL to receive transaction status updates.
Example: https://api.paystation.com.bd/payment-success/104
checkout_itemsstring / JSONDetails of the purchased items.
Example: Some text or JSON
opt_astring / JSONAny optional information.
Example: Some text or JSON
opt_bstring / JSONAny optional information.
Example: Some text or JSON
opt_cstring / JSONAny optional information.
Example: Some text or JSON
emiintegerSend this if you want to do an EMI transaction, otherwise ignore it.
Example: 1

Request Response

PARAM_NAMEDESCRIPTION
status_codeStatus code 200 indicates the request was successful. Any other code indicates failure.
statusIndicates the status of the request: success or failed.
messageProvides additional details about the response.
Example: Payment Link Created Successfully.
payment_amountThe amount for the payment.
Example: 1
invoice_numberThe unique invoice number for the transaction.
Example: 90011335545343
payment_urlThe 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' => '[email protected]',
    '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_NAMEDESCRIPTION
statusPayment Status: Successful/Failed/Canceled
invoice_numberYour unique invoice_number that you sent in the payment create API.
invoice_numberPayment Transaction ID (you will get trx_id for successful payments only).

Transaction Status

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

Request Data

PARAM_NAMEDESCRIPTION
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 sent in the initiate payment create API.

Request Response

PARAM_NAMEDESCRIPTION
status_codeStatus code 200 indicates that the request was successfully processed.
statusIndicates the request status: success or failed.
messageProvides details about the response.
Example: Transaction found
data (Returned if status_code is 200)
invoice_numberThe unique invoice number for the transaction.
Example: 90011335545343
trx_statusCurrent transaction status. Possible values: processing, success, failed, refund.
Example: processing.
Processing: This status indicates that the customer has initiated the payment process but has not yet completed the transaction.
trx_idUnique Payment Transaction ID. (Empty if not available)
payment_amountThe transaction amount.
Example: 1.00
order_date_timeThe date and time of the transaction.
Example: 2025-02-17 13:03:21
payer_mobile_noPayer's mobile number. (Empty if not available)
payment_methodPayment method used (bKash/Nagad/Rocket/Upay/Mastercard/Visa). (Empty if not available)
referenceReference information sent during the payment creation.
Example: Some Ref Info
checkout_itemsThe 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"
    }
}

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








Transaction Status

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

Request Data

PARAM_NAMEDESCRIPTION
Request Header Parameter
merchantId(Mandatory)Your Merchant ID provided by PayStation.
Example: 204-16537301811
Request Body
trxId(Mandatory)Your unique trxId that you sent in the payment create API.

Request Response

PARAM_NAMEDESCRIPTION
status_codeStatus code 200 indicates that the request was successfully processed.
statusIndicates the request status: success or failed.
messageProvides details about the response.
Example: Transaction found
data (Returned if status_code is 200)
invoice_numberThe unique invoice number for the transaction.
Example: 90011335545343
trx_statusCurrent transaction status. Possible values: processing, success, failed, refund.
Example: processing.
Processing: This status indicates that the customer has initiated the payment process but has not yet completed the transaction.
trx_idUnique Payment Transaction ID. (Empty if not available)
Example: CG20D8AYB4
trx_amountThe actual transaction amount.
Example: 2
trx_dateThe date when the transaction was made.
Format: YYYY-MM-DD
Example: 2025-07-02
request_amountThe amount requested for the transaction.
Example: 2.00
payment_amountThe payment amount processed.
Example: 2.00
order_date_timeThe exact date and time of order creation.
Format: YYYY-MM-DD HH:MM:SS
Example: 2025-07-02 20:21:13
payer_mobile_noPayer mobile number. (Empty if not available)
Example: 01811361428
payment_methodPayment method used. Possible values: bKash, Nagad, Rocket, Upay, Mastercard, Visa. (Empty if not available)
Example: bKash
referenceReference information sent during the payment creation.
Example: Event Ticket

Sample Request & Response

1. PHP CURL REQUEST:
$header = array(
  'merchantId:104-1653730183'
);
$body = array(
  'trxId' => "2021252525"
);
curl --location 'https://api.paystation.com.bd/v2/transaction-status' --header 'merchantId: ***********' --header 'Content-Type: application/json' --data '{
    "trxId":""
}'

2. SUCCESS RESPONSE (json format):
{
    "status_code": "200",
    "status": "success",
    "message": "Transaction found",
    "data": {
        "invoice_number": "59734251219",
        "trx_status": "success",
        "trx_id": "CG20D8AYB4121",
        "trx_amount": 2,
        "trx_date": "2025-07-02",
        "request_amount": "2.00",
        "payment_amount": "2.00",
        "order_date_time": "2025-07-02 20:21:13",
        "payer_mobile_no": "018*******",
        "payment_method": "bKash",
        "reference": "Event Ticket"
    }
}
}


3. FAILED RESPONSE (json format):
{
    "status_code": "2001",
    "status": "failed",
    "message": "Transaction not found in system"
}