This API will provide the current status of a specific payment.
Introduction
The eStorePay Verify Payment API allows you to retrieve the current status of a specific payment. After initiating a payment through the Create Charge API, eStorePay sends the paymentID as a query parameter to the success URL. You can use this paymentID to call the Verify Payment API at any time to check the payment status.
Request URL
To create a payment request, use the following API endpoint:
Payment Panel
Where {base_URL} is the location of your eStorePay installation, such as https://pay.your-domain.com.
Request Headers
Include the following request headers:
Header Name | Value |
---|---|
Content-Type | "application/json" |
Accept | "application/json" |
ESP-API-KEY | Collect API KEY From Dashboard |
Request Parameters
The API expects the following parameter in the request:
Property | Presence | Type | Description |
---|---|---|---|
paymentID | Mandatory | string | The invoice_id is received as a query parameter from the success URL provided during payment creation. |
Success Response Parameters
Upon a successful API request, the response will contain the following parameters:
Property | Type | Description |
---|---|---|
fullname | string | Full Name value which was passed along with the payment request. |
emailaddress | string | Email value which was passed along with the payment request. |
paymentMethod | string | Payment Method of the payment transaction. (bKash/Rocket/Nagad/Upay or Bank) |
transactionID | string | Transaction ID of the payment transaction. |
amount | string | Amount value which was passed along with the payment request. |
fees | string | Fee of the payment transaction. |
metadata | JSON object | Any related JSON object that was passed along with the payment request. |
status | string | completed or pending or refunded Status of the payment. |
date | string | Date of the payment transaction. |
Error Response Parameters
In case of an error, the response will contain the following parameters:
Property | Type | Description |
---|---|---|
status | string | 0 |
message | string | Message associated with the status, explaining the status. |
Sample Request
<?php
$baseURL = 'https://pay.yourdomain.com/api/';
$apiKEY = '523452345234523';
$fields = [
'paymentID' => '23452352352353'
];
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $baseURL . "verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($fields),
CURLOPT_HTTPHEADER => [
"ESP-API-KEY: " . $apiKEY,
"accept: application/json",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
curl --request POST \
--url https://pay.yourdomain.com/api/verify \
--header 'ESP-API-KEY : 2345234523523523' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"paymentID": "2523452345234523"
}
'
const axios = require('axios');
const options = {
method: 'POST',
url: 'https://pay.yourdomain.com/api/verify',
headers: {
accept: 'application/json',
'ESP-API-KEY': '4563456343464',
'content-type': 'application/json'
},
data: {paymentID: '23523453235234'}
};
axios
.request(options)
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.error(error);
});
import requests
url = "https://pay.yourdomain.com/api/verify"
payload = {"paymentID": "24523453534"}
headers = {
"accept": "application/json",
"ESP-API-KEY": "2523453245234",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
Sample Response
{
"fullname": "John Doe",
"emailaddress": "userEmail@gmail.com",
"amount": "100.00",
"fees": "0.00",
"metadata": {
"user_id": "10",
"order_id": "50"
},
"paymentMethod": "bkash",
"transactionID": "TESTTRANS1",
"date": "2023-01-07 14:00:50",
"status": "completed"
}