By integrating our API, you will be able to interact with our payment gateway, securely transmitting payment requests and receiving responses in real-time.

Payment Process Environment

🚧

Sandbox Environment

All operations conducted in this environment are considered as trial transaction.

Store ID : aamarpaytest

Signature Key : dbb74894e82415a2f7ff0ec3a97e4183

Live Environment

Please note that all transactions carried out in this environment are considered authentic, and the URL begins with https://secure.aamarpay.com

ℹ️

Obtain Live Credentials

For acquiring the necessary live credentials to process payments, please don't hesitate to contact our Support Team at [email protected]. They are readily available to guide you throughout the procedure and provide the essential credentials to facilitate live payment transactions on your platform.

🌐

API Endpoints

API Endpoint (Sandbox Environment) : https://sandbox.aamarpay.com/index.php

API Endpoint (Live Environment) : https://secure.aamarpay.com/index.php

Method : POST

Using Form Data

Request Parameters

PropertyRequiredTypeDescription
store_idYesStringYour Merchant ID – Provided by aamarPay (Example: aamarpaytest)
signature_keyYesStringYou will need to provide the Signature Key issued by aamarPay, which serves as a unique authentication key. (Example: dbb74894e82415a2f7ff0ec3a97e4183 )
tran_idYesStringThe identification number or order ID, or invoice number, given by the merchant, is unique for each payment transaction. The maximum allowed length for this identifier is 32 characters.
amountYesDecimalEnsure that you input the total amount you wish to pay for the transaction. Do not include any currency symbols or commas. The amount should be a numerical value only. If there are decimals, use a period (.) as the decimal separator. For example, if your payment amount is $50.99, simply enter '50.99' in the field.
currencyYesStringThe currency field should only contain uppercase letters corresponding to the desired currency (e.g., "USD" or "BDT").
descYesStringThe description field allows the payer to provide additional information or notes related to the payment. It is an opportunity to add context or details about the purpose of the transaction.
cus_nameYesStringCustomer Full Name
cus_emailYesStringEmail address of the customer who is making the payment.
cus_phoneYesStringPhone number of the customer who is making the payment.
success_urlYesStringThe success_url is the designated URL to which the payment gateway will redirect customers after a successful payment transaction. When the customer completes the payment process, the payment gateway will initiate a POST request to the success_url to notify your system about the successful transaction and share the relevant payment details.
fail_urlYesStringThe fail_url is the designated URL to which the payment gateway will redirect customers after a failed payment transaction. When the customer completes the payment process, the payment gateway will initiate a POST request to the fail_url to notify your system about the failed transaction and share the relevant payment details.
cancel_urlYesStringURL to return customers to your product page or home page.
typeYesStringThe value of this parameter is always "json".
cus_add1NoStringCustomer’s address (e.g. street)
cus_add2NoStringCustomer’s address (e.g. town)
cus_cityNoStringCustomers city
cus_stateNoStringCustomer state or region
cus_countryNoStringCustomer Country
opt_aNoStringOptional Parameter 1
opt_bNoStringOptional Parameter 1
opt_cNoStringOptional Parameter 1
opt_dNoStringOptional Parameter 1

Sample Request

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.aamarpay.com/index.php',
  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('store_id' => 'aamarpaytest','signature_key' => 'dbb74894e82415a2f7ff0ec3a97e4183','cus_name' => 'Customer Name','cus_email' => '[email protected]','cus_phone' => '01870******','amount' => '10','currency' => 'BDT','tran_id' => '238uyasfdsfs234sdfp','desc' => 'test transaction','success_url' => 'http://localhost/aamarpay/callback/success.php','fail_url' => 'http://localhost/aamarpay/callback/failed.php','cancel_url' => 'http://localhost/aamarpay/callback/cancel.php','type' => 'json'),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

import requests

url = "https://sandbox.aamarpay.com/index.php"

payload = {'store_id': 'aamarpaytest',
'signature_key': 'dbb74894e82415a2f7ff0ec3a97e4183',
'cus_name': 'Customer Name',
'cus_email': '[email protected]',
'cus_phone': '01870******',
'amount': '10',
'currency': 'BDT',
'tran_id': '238uyasfdsfs234sdfp',
'desc': 'test transaction',
'success_url': 'http://localhost/aamarpay/callback/success.php',
'fail_url': 'http://localhost/aamarpay/callback/failed.php',
'cancel_url': 'http://localhost/aamarpay/callback/cancel.php',
'type': 'json'}
files=[

]
headers = {}

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

print(response.text)

Sample Response

{
    "result": "true",
    "payment_url": "https://sandbox.aamarpay.com/paynow.php?track=AAM1690275828103929"
}

Ensure that the URL redirection to the payment gateway is implemented correctly in your application.

📘

Please ensure that you have completed the necessary steps to enable aamarPay on your aamarPay account and obtained the required Store ID and Signature key before switching to live mode. Please reach out to Support team for assistance.

If you encounter any issues during the integration process, please reach out to Integration support team for assistance.