Paystation Logo
Paystation Logo
Documentation Menu
API v1 & v2

Documentation for Integration

Integrate secure payment processing, transaction verification, and payout services using our REST APIs.

Your Store
Secure Checkout
Amount
USD 100.00
Choose a payment method
VISA
AMEX
Pay
Secured by Pay

Choose Your Integration

REST API

Full control for custom applications and mobile apps.

Shopify

Install the plugin and start accepting payments in minutes.

OpenCart

OpenCart

Upload the extension, configure credentials, and test checkout.

Odoo

Odoo

Connect Sales, Invoicing and Website checkout seamlessly.

Overview

Welcome to PayStation Integration guide. PayStation provides a secure, flexible, and robust payment gateway solution in Bangladesh. Whether you are selling physical goods, software services, online bookings, or managing payouts, our developer suite offers rich tools for integration.

Hosted Checkout

Redirect customers to our beautiful checkout page supporting cards, mobile wallets, and internet banking.

API Ref Verification

Server-to-server endpoints to verify transaction status and details via secure API keys.

Environments

We maintain separate environments for sandbox testing and production live payments. Ensure you are using the correct credentials and endpoints.

Secret Key Protection

Always keep your store passwords and secret keys securely stored on your backend servers. Do not expose them in clients, frontend scripts, or public GitHub repositories.

EnvironmentBase URLPurpose
Sandbox (Test)https://sandbox.paystation.com.bdFor building, verifying, and mock payment simulations.
Production (Live)https://api.paystation.com.bdFor routing live customer cards and transaction clearing.

Authentication

PayStation verifies incoming requests via combination headers and body parameters. For the Initiate Payment API, parameters like `merchantId` and `password` are provided in the payload body. For the Transaction Status APIs, `merchantId` must be supplied inside the HTTP headers.

Error Codes

When an API call returns a response, the `status_code` field reports the outcome.

Status CodeStatus NameMeaning / Notes
200SuccessThe request was successfully authenticated and executed.
1008Duplicate InvoiceThe requested unique invoice number has already been processed.
2001Invalid Token / Not FoundTransaction details could not be resolved or secret key mismatch.

Hosted Checkout

Redirect the customer to the PayStation Hosted Checkout. Our system lists all native cards, EMI choices, mobile wallets (bKash, Nagad, Rocket, Upay), and bank channels automatically. Once payment is complete, we direct the customer back to your `callback_url` with parameters indicating payment outcomes.

Checkout Integration Flow

  • 1Your backend initiates payment to PayStation
  • 2Retrieve the secure checkout URL in response
  • 3Redirect customer browser to checkout portal
  • 4Return callback to success page and capture parameters
Checkout Page
POST /initiate-payment
URL: https://api.paystation.com.bd/initiate-payment

Request Body Parameters

ParamTypeRequirementDescription
merchantIdstringRequiredYour Merchant ID will be provided by PayStation.
Example: 204-16537301811
passwordstringRequiredYour Password will be provided by PayStation.
Example: gamepass
invoice_numberstringRequiredUnique invoice number for the transaction.
Example: 90011355
currencystringOptionalCurrency code for the transaction.
Example: BDT
payment_amountintegerRequiredTransaction amount.
Example: 1
pay_with_chargeintegerOptionalWill the merchant bear the payment charge or not. If 1, the customer will bear the charge; if 0, the merchant will bear the charge.
Example: 1
referencestringOptionalReference information for the transaction.
Example: Some Ref Info
cust_namestringRequiredCustomer's full name.
Example: MM
cust_phonestringRequiredCustomer's phone number.
Example: 01726315133
cust_emailstringRequiredCustomer's email address.
Example: [email protected]
cust_addressstringOptionalCustomer's physical address.
Example: Customer address
callback_urlstring (URL)RequiredURL to receive transaction status updates.
Example: https://api.paystation.com.bd/payment-success/104
checkout_itemsstring / JSONOptionalDetails of the purchased items.
Example: Some text or JSON
opt_astring / JSONOptionalAny optional information.
Example: Some text or JSON
opt_bstring / JSONOptionalAny optional information.
Example: Some text or JSON
opt_cstring / JSONOptionalAny optional information.
Example: Some text or JSON
emiintegerOptionalSend this if you want to do an EMI transaction, otherwise ignore it.
Example: 1
Request Snippet
curl -X POST https://api.paystation.com.bd/initiate-payment \
  -H "Accept: application/json" \
  -d "merchantId=204-16537301811" \
  -d "password=gamepass" \
  -d "invoice_number=90011355" \
  -d "currency=BDT" \
  -d "payment_amount=1" \
  -d "reference=Some Ref Info" \
  -d "cust_name=MM" \
  -d "cust_phone=01726315133" \
  -d "[email protected]" \
  -d "cust_address=Customer address" \
  -d "callback_url=https://api.paystation.com.bd/payment-success/104" \
  -d "checkout_items=Some text or JSON"

Response Fields

ParamDescription
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
Success Response (JSON)
{
    "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/ZzHkh..."
}
Failed Response (JSON)
{
    "status_code": "1008",
    "status": "failed",
    "message": "Duplicate invoice number."
}

Transaction Status (v1)

Query payment status server-to-server using the unique invoice number generated by your system.

POST /transaction-status
Headers: merchantId
Status v1 Snippet
curl -X POST https://api.paystation.com.bd/transaction-status \
  -H "merchantId: 104-1653730183" \
  -d "invoice_number=2021252525"

Request Parameters

ParamLocationTypeRequirementDescription
merchantIdHeaderstringRequiredYour Merchant ID provided by PayStation.
Example: 204-16537301811
invoice_numberBodystringRequiredYour unique invoice number that you sent in the initiate payment create API.

Response Fields

ParamDescription
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 object (Returned if status_code is 200)
data.invoice_numberThe unique invoice number for the transaction. Example: 90011335545343
data.trx_statusCurrent transaction status. Possible values: processing, success, failed, refund.
Processing: indicates the customer initiated the payment process but has not completed it yet.
data.trx_idUnique Payment Transaction ID. (Empty if not available)
data.payment_amountThe transaction amount. Example: 1.00
data.order_date_timeThe date and time of the transaction. Example: 2025-02-17 13:03:21
data.payer_mobile_noPayer's mobile number. (Empty if not available)
data.payment_methodPayment method used (bKash/Nagad/Rocket/Upay/Mastercard/Visa).
data.referenceReference information sent during the payment creation. Example: Some Ref Info
data.checkout_itemsThe checkout items sent in the payment create API. Example: Some text or JSON
Success Response (JSON)
{
    "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"
    }
}
Success but Failed Transaction
{
    "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"
    }
}
Failed Response (JSON)
{
    "status_code": "2001",
    "status": "failed",
    "message": "Invalid Token."
}

Transaction Status (v2)

Query payment status server-to-server using the unique `trxId` returned by PayStation after successful checkouts.

POST /v2/transaction-status
Headers: merchantId, Content-Type: application/json
Status v2 Snippet
curl -X POST https://api.paystation.com.bd/v2/transaction-status \
  -H "merchantId: 104-1653730183" \
  -H "Content-Type: application/json" \
  -d '{"trxId": "CG20D8AYB4"}'

Request Parameters

ParamLocationTypeRequirementDescription
merchantIdHeaderstringRequiredYour Merchant ID provided by PayStation.
Example: 204-16537301811
trxIdBody (JSON)stringRequiredYour unique trxId returned by PayStation in the payment creation response.

Response Fields

ParamDescription
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 object (Returned if status_code is 200)
data.invoice_numberThe unique invoice number for the transaction. Example: 90011335545343
data.trx_statusCurrent transaction status. Possible values: processing, success, failed, refund.
Processing: indicates the customer initiated the payment process but has not completed it yet.
data.trx_idUnique Payment Transaction ID. Example: CG20D8AYB4
data.trx_amountThe actual transaction amount. Example: 2
data.trx_dateThe date when the transaction was made. Format: YYYY-MM-DD. Example: 2025-07-02
data.request_amountThe amount requested for the transaction. Example: 2.00
data.payment_amountThe payment amount processed. Example: 2.00
data.order_date_timeThe exact date and time of order creation. Format: YYYY-MM-DD HH:MM:SS. Example: 2025-07-02 20:21:13
data.payer_mobile_noPayer mobile number. (Empty if not available). Example: 01811361428
data.payment_methodPayment method used. Possible values: bKash, Nagad, Rocket, Upay, Mastercard, Visa. Example: bKash
data.referenceReference information sent during the payment creation. Example: Event Ticket
Success Response (JSON)
{
    "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"
    }
}
Failed Response (JSON)
{
    "status_code": "2001",
    "status": "failed",
    "message": "Transaction not found in system"
}

Headers

API calls (particularly v2 endpoints) expect JSON body payload and appropriate headers:

Header NameValue / Description
merchantIdYour store ID provided by PayStation.
Content-Typeapplication/json (for POST requests)

Status Codes

PayStation maps statuses to clean parameters returned in the transaction query response:
success: Transaction paid successfully.
processing: Payment initialized by user, but not completed yet.
failed: Transaction failed at card/wallet authentication.

Support Center

If you encounter issues during payment gateway integration, testing, card transactions, or store registration verification, please contact our merchant onboarding team.