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.
Base URL : https://sandbox.aamarpay.com
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
Property | Required | Type | Description |
---|---|---|---|
store_id | Yes | String | Your Merchant ID – Provided by aamarPay (Example: aamarpaytest) |
signature_key | Yes | String | You will need to provide the Signature Key issued by aamarPay, which serves as a unique authentication key. (Example: dbb74894e82415a2f7ff0ec3a97e4183 ) |
tran_id | Yes | String | The 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. |
amount | Yes | Decimal | Ensure 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. |
currency | Yes | String | The currency field should only contain uppercase letters corresponding to the desired currency (e.g., "USD" or "BDT"). |
desc | Yes | String | The 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_name | Yes | String | Customer Full Name |
cus_email | Yes | String | Email address of the customer who is making the payment. |
cus_phone | Yes | String | Phone number of the customer who is making the payment. |
success_url | Yes | String | The 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_url | Yes | String | The 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_url | Yes | String | URL to return customers to your product page or home page. |
type | Yes | String | The value of this parameter is always "json". |
cus_add1 | No | String | Customer’s address (e.g. street) |
cus_add2 | No | String | Customer’s address (e.g. town) |
cus_city | No | String | Customers city |
cus_state | No | String | Customer state or region |
cus_country | No | String | Customer Country |
opt_a | No | String | Optional Parameter 1 |
opt_b | No | String | Optional Parameter 1 |
opt_c | No | String | Optional Parameter 1 |
opt_d | No | String | Optional 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.
Check The "status_code" field and "amount" field
If you encounter any issues during the integration process, please reach out to Integration support team for assistance.