This section describes the API NEPAL payment gateway API.
API NEPAL provides a seamless API for integrating payments into your business software. Our API supports cURL requests, uses well-structured URLs, and returns JSON responses for easy integration.
Test the API in sandbox mode without affecting live data. Authentication is handled via API keys, ensuring secure and legitimate transactions. Use the sandbox URL for testing and the live URL for production, as detailed in the Initiate Payment section.
Below is a list of currencies supported by API NEPAL.
| Currency | Currency Symbol |
|---|---|
| NPR | रु |
Learn how to obtain your API keys for integration.
Log in to your API NEPAL merchant account. If you don’t have an account, create one here.
Navigate to Account > Settings > API Key in the merchant panel to find your Public Key and Secret Key.
Use these keys to authenticate API requests. Generate new keys anytime using the Generate API Key button. Keep your keys secure and never share them.
This section explains how to initiate a payment using the API.
Use the provided endpoints and parameters to initiate a payment. Ensure all required parameters are included in your request.
Live Endpoint: https://apinepal.com/payment/initiate
Test Endpoint: https://apinepal.com/test/payment/initiate
| Param Name | Param Type | Description |
|---|---|---|
| public_key | string (50) | Required Your Public API key |
| secret_key | string | Required Your Secret API key for authentication |
| identifier | string (20) | Required Unique identifier for the payment |
| currency | string (4) | Required Currency code in uppercase, e.g., NPR |
| amount | decimal | Required Payment amount |
| details | string (100) | Required Payment or transaction details |
| ipn_url | string | Required Instant Payment Notification URL |
| success_url | string | Required Redirect URL for successful payment |
| cancel_url | string | Required Redirect URL for canceled payment |
| site_name | string | Required Your business site name |
| site_logo | string/url | Optional Your business site logo URL |
| checkout_theme | string | Optional Checkout form theme (dark/light, default: light) |
| Customer | ||
| customer[] | array | Required Customer information array |
| customer.first_name | string | Required Customer's first name |
| customer.last_name | string | Required Customer's last name |
| customer.email | string | Required Customer's valid email |
| customer.mobile | string | Required Customer's valid mobile number |
| Shipping Info | ||
| shipping_info[] | array | Optional Shipping information array |
| shipping_info.address_one | string | Optional Customer's address line one |
| shipping_info.address_two | string | Optional Customer's address line two |
| shipping_info.area | string | Optional Shipping area |
| shipping_info.city | string | Optional Shipping city |
| shipping_info.sub_city | string | Optional Shipping sub-city |
| shipping_info.state | string | Optional Shipping state |
| shipping_info.postcode | string | Optional Shipping postcode |
| shipping_info.country | string | Optional Shipping country |
| shipping_info.others | string | Optional Additional shipping info |
| Billing Info | ||
| billing_info[] | array | Optional Billing information array |
| billing_info.address_one | string | Optional Customer's address line one |
| billing_info.address_two | string | Optional Customer's address line two |
| billing_info.area | string | Optional Billing area |
| billing_info.city | string | Optional Billing city |
| billing_info.sub_city | string | Optional Billing sub-city |
| billing_info.state | string | Optional Billing state |
| billing_info.postcode | string | Optional Billing postcode |
| billing_info.country | string | Optional Billing country |
| billing_info.others | string | Optional Additional billing info |
Below are the parameters included in the payment initiation response:
| Param Name | Status |
|---|---|
| status | Status of the request (e.g., success or error) |
| message | Response message describing the result |
| trx_number | Unique encrypted transaction number used to track the payment |
| redirect_url | URL to redirect the user to the hosted payment page (if using redirect flow) |
| qr.qr_string | Raw QR string data used to generate the QR code |
| qr.qr_image_base64 | Base64-encoded QR image for direct display |
The redirect_url is only available for redirect-based payment methods.
For QR payments (e.g., Fonepayqr), no redirect_url will be returned. You can directly display the provided QR data to the user.
You can choose to use either the QR string or the base64 image depending on your implementation.
Even if you only use the QR (without redirect), the payment notification (IPN) will still be triggered once the payment is completed.
Note: In the future, when selecting QR-based methods like Fonepayqr, the redirect_url will no longer be available. For now, it is still returned, but we recommend updating your integration to handle direct QR payments accordingly.
<?php
$parameters = [
'public_key' => 'your_public_key',
'secret_key' => 'your_secret_key',
'identifier' => 'DFU80XZIKS',
'currency' => 'NPR',
'amount' => 11.00,
'gateway_methods' => [],
'details' => 'Purchase T-shirt',
'ipn_url' => 'http://example.com/ipn_url.php',
'cancel_url' => 'http://example.com/cancel_url.php',
'success_url' => 'http://example.com/success_url.php',
'site_name' => 'your_site_name',
'site_logo' => 'http://yoursite.com/logo.png',
'checkout_theme' => 'light',
'customer' => [
'first_name' => 'John',
'last_name' => 'Doe',
'email' => '[email protected]',
'mobile' => '12345789',
],
'shipping_info' => [
'address_one' => '',
'address_two' => '',
'area' => '',
'city' => '',
'sub_city' => '',
'state' => '',
'postcode' => '',
'country' => '',
'others' => '',
],
'billing_info' => [
'address_one' => '',
'address_two' => '',
'area' => '',
'city' => '',
'sub_city' => '',
'state' => '',
'postcode' => '',
'country' => '',
'others' => '',
]
];
$parameters = http_build_query($parameters);
// Live endpoint
$url = 'https://apinepal.com/payment/initiate';
// Test endpoint
// $url = 'https://apinepal.com/test/payment/initiate';
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
?>
{
"status": "error",
"message": ["Invalid api key"]
}
{
"status": "success",
"message": ["Payment initiated"],
"redirect_url": "https://example.com/payment/checkout?payment_trx=eyJpdiI6IkFyNllSNU1lOFdkYTlPTW52cytPNGc9PSIsInZhbHVlIjoiWWowRTRjdzZ1S1BBRm4ydS81OWR1WjdXeFIxcjE1WkZRVE9BcmZYeXpzND0iLCJtYWMiOiJjNDdhODUzYzY2NmZlZGJjZTI5ODQyMmRkYzdjYjRmM2NiNjg4M2RiMWZjN2EyMzFkODI4OWMwYjk3ZWYwNGQwIiwidGFnIjoiIn0%3D",
"trx_number": "eyJpdiI6IkFyNllSNU1lOFdkYTlPTW52cytPNGc9PSIsInZhbHVlIjoiWWowRTRjdzZ1S1BBRm4ydS81OWR1WjdXeFIxcjE1WkZRVE9BcmZYeXpzND0iLCJtYWMiOiJjNDdhODUzYzY2NmZlZGJjZTI5ODQyMmRkYzdjYjRmM2NiNjg4M2RiMWZjN2EyMzFkODI4OWMwYjk3ZWYwNGQwIiwidGFnIjoiIn0%3D",
"qr": {
"qr_string": "000201010212265800110607156453507162222030016544780090849705864520451935303524540512BTJ4AI1651D7070716995420822DFU80XZIKSasd;123457896304f335",
"qr_image_base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAFACAIAAABC8jL9AAAACXBIW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MwQQYggkwBBNgCCbAEEyAIZgAQzABhmD/BTvZNsvaJEzKAAAAAElFTkSuQmCC"
},
}
Learn how to validate payments and handle Instant Payment Notifications (IPN).
Use the following endpoint and parameters to validate payments and receive IPN notifications.
Endpoint: Your business application IPN URL
Request Method: POST
| Param Name | Description |
|---|---|
| status | Payment success status |
| identifier | Unique identifier for the payment |
| signature | Hash signature to verify the payment |
| data | Contains payment details like charges, amount, currency, and transaction ID |
<?php
$status = $_POST['status'];
$signature = $_POST['signature'];
$identifier = $_POST['identifier'];
$data = $_POST['data'];
$customKey = $data['amount'] . $identifier;
$secret = 'YOUR_SECRET_KEY';
$mySignature = strtoupper(hash_hmac('sha256', $customKey, $secret));
$myIdentifier = 'YOUR_GIVEN_IDENTIFIER';
if ($status == "success" && $signature == $mySignature && $identifier == $myIdentifier) {
// Your operation logic
}
?>
This section explains how to check payment status using the API.
Use this endpoint to manually check the payment status if IPN is delayed or not received.
The trx_number is provided in the response when initiating a payment.
The payment status returned by the API can be one of the following:
Live Endpoint: https://apinepal.com/payment/payment-status
Request Method: POST
| Param Name | Param Type | Description |
|---|---|---|
| public_key | string (50) | Required Your Public API key |
| secret_key | string | Required Your Secret API key for authentication |
| trx_number | string | Required Encrypted transaction number |
<?php
$parameters = [
'public_key' => 'your_public_key',
'secret_key' => 'your_secret_key',
'trx_number' => 'eyJpdiI6IkFyNllSNU1lOFdkYTlPTW52cytPNGc9PSIsInZhbHVlIjoiWWowRTRjdzZ1S1BBRm4ydS81OWR1WjdXeFIxcjE1WkZRVE9BcmZYeXpzND0iLCJtYWMiOiJjNDdhODUzYzY2NmZlZGJjZTI5ODQyMmRkYzdjYjRmM2NiNjg4M2RiMWZjN2EyMzFkODI4OWMwYjk3ZWYwNGQwIiwidGFnIjoiIn0%3D',
];
$parameters = http_build_query($parameters);
// Live endpoint
$url = 'https://apinepal.com/payment/payment-status';
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
?>
{
"status": "error",
"message": ["Invalid api key"]
}
{
"status": "success",
"data": {
"trx_number": "eyJpdiI6IkFyNllSNU1lOFdkYTlPTW52cytPNGc9PSIsInZhbHVlIjoiWWowRTRjdzZ1S1BBRm4ydS81OWR1WjdXeFIxcjE1WkZRVE9BcmZYeXpzND0iLCJtYWMiOiJjNDdhODUzYzY2NmZlZGJjZTI5ODQyMmRkYzdjYjRmM2NiNjg4M2RiMWZjN2EyMzFkODI4OWMwYjk3ZWYwNGQwIiwidGFnIjoiIn0%3D",
"payment_status": "Success",
"amount": "11"
}
}
Integrate the API NEPAL Checkout SDK to display the payment page in a popup without redirecting users away from your website.
The Checkout SDK uses the sdk_url returned from the Initiate Payment to open the payment page in a modal popup.
Include the Checkout SDK script in your HTML:
<script src="https://apinepal.com/assets/sdk/[email protected]"></script>
We recommend locking to a specific SDK version in production to prevent unexpected breaking changes..
Open the checkout popup by calling ApiNepalCheckout.open() with the provided sdk_url
const sdkUrl = 'SDK_URL_FROM_INITIATE_PAYMENT';
ApiNepalCheckout.open(sdkUrl, {
onSuccess(payload) {
// Option 1: redirect to success page
// window.location.href = 'YOUR_SUCCESS_URL';
// Option 2: close the payment modal
ApiNepalCheckout.close();
// Option 3: handle success with custom logic
// console.log('Payment success', payload);
},
onFailed(payload) {
// Option 1: redirect to failed page
// window.location.href = 'YOUR_FAILED_URL';
// Option 2: close the payment modal
ApiNepalCheckout.close();
// Option 3: handle failure with custom logic
// console.log('Payment failed', payload);
},
onClose() {
console.log('Payment popup closed');
}
});
Replace SDK_URL_FROM_INITIATE_PAYMENT,
YOUR_SUCCESS_URL,
and YOUR_FAILED_URL
with your actual values.
Integrate the API NEPAL payment gateway into your WordPress site.
Download our WordPress plugin to easily integrate the payment gateway. Follow the installation instructions in your WordPress dashboard.
Download PluginTest the payment API by entering your API keys, amount, and other required parameters.
Use the form below to simulate a payment request. Toggle between test and live modes. On success, you will be redirected to the payment checkout page. You can also download the Postman collection for advanced testing.
View the complete Postman collection for the API NEPAL payment gateway API.
The following JSON represents the Postman collection for testing the API. You can download and import it into Postman for advanced testing.
{
"info": {
"_postman_id": "b7f3e2a1-9c2d-4f7e-8e3f-5a6b7c8d9e0f",
"name": "API NEPAL Payment Gateway API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"description": "API documentation for integrating the API NEPAL payment gateway."
},
"item": [
{
"name": "Initiate Payment (Test)",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded",
"type": "text"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "public_key",
"value": "your_public_key",
"type": "text",
"description": "Your Public API key (Required)"
},
{
"key": "secret_key",
"value": "your_secret_key",
"type": "text",
"description": "Your Secret API key (Required)"
},
{
"key": "identifier",
"value": "DFU80XZIKS",
"type": "text",
"description": "Unique identifier for the payment (Required)"
},
{
"key": "currency",
"value": "NPR",
"type": "text",
"description": "Currency code in uppercase, e.g., NPR (Required)"
},
{
"key": "amount",
"value": "11.00",
"type": "text",
"description": "Payment amount (Required)"
},
{
"key": "details",
"value": "Purchase T-shirt",
"type": "text",
"description": "Payment or transaction details (Required)"
},
{
"key": "ipn_url",
"value": "http://example.com/ipn_url.php",
"type": "text",
"description": "Instant Payment Notification URL (Required)"
},
{
"key": "success_url",
"value": "http://example.com/success_url.php",
"type": "text",
"description": "Redirect URL for successful payment (Required)"
},
{
"key": "cancel_url",
"value": "http://example.com/cancel_url.php",
"type": "text",
"description": "Redirect URL for canceled payment (Required)"
},
{
"key": "site_name",
"value": "your_site_name",
"type": "text",
"description": "Your business site name (Required)"
},
{
"key": "site_logo",
"value": "http://yoursite.com/logo.png",
"type": "text",
"description": "Your business site logo URL (Optional)"
},
{
"key": "checkout_theme",
"value": "light",
"type": "text",
"description": "Checkout form theme (dark/light, default: light) (Optional)"
},
{
"key": "customer[first_name]",
"value": "John",
"type": "text",
"description": "Customer's first name (Required)"
},
{
"key": "customer[last_name]",
"value": "Doe",
"type": "text",
"description": "Customer's last name (Required)"
},
{
"key": "customer[email]",
"value": "[email protected]",
"type": "text",
"description": "Customer's valid email (Required)"
},
{
"key": "customer[mobile]",
"value": "12345789",
"type": "text",
"description": "Customer's valid mobile number (Required)"
},
{
"key": "shipping_info[address_one]",
"value": "",
"type": "text",
"description": "Customer's address line one (Optional)"
},
{
"key": "shipping_info[address_two]",
"value": "",
"type": "text",
"description": "Customer's address line two (Optional)"
},
{
"key": "shipping_info[area]",
"value": "",
"type": "text",
"description": "Shipping area (Optional)"
},
{
"key": "shipping_info[city]",
"value": "",
"type": "text",
"description": "Shipping city (Optional)"
},
{
"key": "shipping_info[sub_city]",
"value": "",
"type": "text",
"description": "Shipping sub-city (Optional)"
},
{
"key": "shipping_info[state]",
"value": "",
"type": "text",
"description": "Shipping state (Optional)"
},
{
"key": "shipping_info[postcode]",
"value": "",
"type": "text",
"description": "Shipping postcode (Optional)"
},
{
"key": "shipping_info[country]",
"value": "",
"type": "text",
"description": "Shipping country (Optional)"
},
{
"key": "shipping_info[others]",
"value": "",
"type": "text",
"description": "Additional shipping info (Optional)"
},
{
"key": "billing_info[address_one]",
"value": "",
"type": "text",
"description": "Customer's address line one (Optional)"
},
{
"key": "billing_info[address_two]",
"value": "",
"type": "text",
"description": "Customer's address line two (Optional)"
},
{
"key": "billing_info[area]",
"value": "",
"type": "text",
"description": "Billing area (Optional)"
},
{
"key": "billing_info[city]",
"value": "",
"type": "text",
"description": "Billing city (Optional)"
},
{
"key": "billing_info[sub_city]",
"value": "",
"type": "text",
"description": "Billing sub-city (Optional)"
},
{
"key": "billing_info[state]",
"value": "",
"type": "text",
"description": "Billing state (Optional)"
},
{
"key": "billing_info[postcode]",
"value": "",
"type": "text",
"description": "Billing postcode (Optional)"
},
{
"key": "billing_info[country]",
"value": "",
"type": "text",
"description": "Billing country (Optional)"
},
{
"key": "billing_info[others]",
"value": "",
"type": "text",
"description": "Additional billing info (Optional)"
}
]
},
"url": {
"raw": "https://apinepal.com/test/payment/initiate",
"host": ["apinepal.com"],
"path": ["test/payment/initiate"]
},
"description": "Initiate a payment in test mode."
},
"response": [
{
"name": "Success Response",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "public_key",
"value": "your_public_key"
},
{
"key": "secret_key",
"value": "your_secret_key"
},
{
"key": "identifier",
"value": "DFU80XZIKS"
},
{
"key": "currency",
"value": "NPR"
},
{
"key": "amount",
"value": "11.00"
},
{
"key": "details",
"value": "Purchase T-shirt"
},
{
"key": "ipn_url",
"value": "http://example.com/ipn_url.php"
},
{
"key": "success_url",
"value": "http://example.com/success_url.php"
},
{
"key": "cancel_url",
"value": "http://example.com/cancel_url.php"
},
{
"key": "site_name",
"value": "your_site_name"
},
{
"key": "site_logo",
"value": "http://yoursite.com/logo.png"
},
{
"key": "checkout_theme",
"value": "light"
},
{
"key": "customer[first_name]",
"value": "John"
},
{
"key": "customer[last_name]",
"value": "Doe"
},
{
"key": "customer[email]",
"value": "[email protected]"
},
{
"key": "customer[mobile]",
"value": "12345789"
}
]
},
"url": {
"raw": "https://apinepal.com/test/payment/initiate",
"host": ["apinepal.com"],
"path": ["test/payment/initiate"]
}
},
"status": "OK",
"code": 200,
"body": "{\n \"status\": \"success\",\n \"message\": [\"Payment initiated\"],\n \"redirect_url\": \"https://example.com/payment/checkout?payment_trx=eyJpdiI6IkFyNllSNU1lOFdkYTlPTW52cytPNGc9PSIsInZhbHVlIjoiWWowRTRjdzZ1S1BBRm4ydS81OWR1WjdXeFIxcjE1WkZRVE9BcmZYeXpzND0iLCJtYWMiOiJjNDdhODUzYzY2NmZlZGJjZTI5ODQyMmRkYzdjYjRmM2NiNjg4M2RiMWZjN2EyMzFkODI4OWMwYjk3ZWYwNGQwIiwidGFnIjoiIn0%3D\"\n}"
},
{
"name": "Error Response",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "public_key",
"value": "invalid_public_key"
},
{
"key": "secret_key",
"value": "invalid_secret_key"
}
]
},
"url": {
"raw": "https://apinepal.com/test/payment/initiate",
"host": ["apinepal.com"],
"path": ["test/payment/initiate"]
}
},
"status": "Bad Request",
"code": 400,
"body": "{\n \"status\": \"error\",\n \"message\": [\"Invalid api key\"]\n}"
}
]
},
{
"name": "Initiate Payment (Live)",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded",
"type": "text"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "public_key",
"value": "your_public_key",
"type": "text",
"description": "Your Public API key (Required)"
},
{
"key": "secret_key",
"value": "your_secret_key",
"type": "text",
"description": "Your Secret API key (Required)"
},
{
"key": "identifier",
"value": "DFU80XZIKS",
"type": "text",
"description": "Unique identifier for the payment (Required)"
},
{
"key": "currency",
"value": "NPR",
"type": "text",
"description": "Currency code in uppercase, e.g., NPR (Required)"
},
{
"key": "amount",
"value": "11.00",
"type": "text",
"description": "Payment amount (Required)"
},
{
"key": "details",
"value": "Purchase T-shirt",
"type": "text",
"description": "Payment or transaction details (Required)"
},
{
"key": "ipn_url",
"value": "http://example.com/ipn_url.php",
"type": "text",
"description": "Instant Payment Notification URL (Required)"
},
{
"key": "success_url",
"value": "http://example.com/success_url.php",
"type": "text",
"description": "Redirect URL for successful payment (Required)"
},
{
"key": "cancel_url",
"value": "http://example.com/cancel_url.php",
"type": "text",
"description": "Redirect URL for canceled payment (Required)"
},
{
"key": "site_name",
"value": "your_site_name",
"type": "text",
"description": "Your business site name (Required)"
},
{
"key": "site_logo",
"value": "http://yoursite.com/logo.png",
"type": "text",
"description": "Your business site logo URL (Optional)"
},
{
"key": "checkout_theme",
"value": "light",
"type": "text",
"description": "Checkout form theme (dark/light, default: light) (Optional)"
},
{
"key": "customer[first_name]",
"value": "John",
"type": "text",
"description": "Customer's first name (Required)"
},
{
"key": "customer[last_name]",
"value": "Doe",
"type": "text",
"description": "Customer's last name (Required)"
},
{
"key": "customer[email]",
"value": "[email protected]",
"type": "text",
"description": "Customer's valid email (Required)"
},
{
"key": "customer[mobile]",
"value": "12345789",
"type": "text",
"description": "Customer's valid mobile number (Required)"
},
{
"key": "shipping_info[address_one]",
"value": "",
"type": "text",
"description": "Customer's address line one (Optional)"
},
{
"key": "shipping_info[address_two]",
"value": "",
"type": "text",
"description": "Customer's address line two (Optional)"
},
{
"key": "shipping_info[area]",
"value": "",
"type": "text",
"description": "Shipping area (Optional)"
},
{
"key": "shipping_info[city]",
"value": "",
"type": "text",
"description": "Shipping city (Optional)"
},
{
"key": "shipping_info[sub_city]",
"value": "",
"type": "text",
"description": "Shipping sub-city (Optional)"
},
{
"key": "shipping_info[state]",
"value": "",
"type": "text",
"description": "Shipping state (Optional)"
},
{
"key": "shipping_info[postcode]",
"value": "",
"type": "text",
"description": "Shipping postcode (Optional)"
},
{
"key": "shipping_info[country]",
"value": "",
"type": "text",
"description": "Shipping country (Optional)"
},
{
"key": "shipping_info[others]",
"value": "",
"type": "text",
"description": "Additional shipping info (Optional)"
},
{
"key": "billing_info[address_one]",
"value": "",
"type": "text",
"description": "Customer's address line one (Optional)"
},
{
"key": "billing_info[address_two]",
"value": "",
"type": "text",
"description": "Customer's address line two (Optional)"
},
{
"key": "billing_info[area]",
"value": "",
"type": "text",
"description": "Billing area (Optional)"
},
{
"key": "billing_info[city]",
"value": "",
"type": "text",
"description": "Billing city (Optional)"
},
{
"key": "billing_info[sub_city]",
"value": "",
"type": "text",
"description": "Billing sub-city (Optional)"
},
{
"key": "billing_info[state]",
"value": "",
"type": "text",
"description": "Billing state (Optional)"
},
{
"key": "billing_info[postcode]",
"value": "",
"type": "text",
"description": "Billing postcode (Optional)"
},
{
"key": "billing_info[country]",
"value": "",
"type": "text",
"description": "Billing country (Optional)"
},
{
"key": "billing_info[others]",
"value": "",
"type": "text",
"description": "Additional billing info (Optional)"
}
]
},
"url": {
"raw": "https://apinepal.com/payment/initiate",
"host": ["apinepal.com"],
"path": ["payment/initiate"]
},
"description": "Initiate a payment in live mode."
},
"response": [
{
"name": "Success Response",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "public_key",
"value": "your_public_key"
},
{
"key": "secret_key",
"value": "your_secret_key"
},
{
"key": "identifier",
"value": "DFU80XZIKS"
},
{
"key": "currency",
"value": "NPR"
},
{
"key": "amount",
"value": "11.00"
},
{
"key": "details",
"value": "Purchase T-shirt"
},
{
"key": "ipn_url",
"value": "http://example.com/ipn_url.php"
},
{
"key": "success_url",
"value": "http://example.com/success_url.php"
},
{
"key": "cancel_url",
"value": "http://example.com/cancel_url.php"
},
{
"key": "site_name",
"value": "your_site_name"
},
{
"key": "site_logo",
"value": "http://yoursite.com/logo.png"
},
{
"key": "checkout_theme",
"value": "light"
},
{
"key": "customer[first_name]",
"value": "John"
},
{
"key": "customer[last_name]",
"value": "Doe"
},
{
"key": "customer[email]",
"value": "[email protected]"
},
{
"key": "customer[mobile]",
"value": "12345789"
}
]
},
"url": {
"raw": "https://apinepal.com/payment/initiate",
"host": ["apinepal.com"],
"path": ["payment/initiate"]
}
},
"status": "OK",
"code": 200,
"body": "{\n \"status\": \"success\",\n \"message\": [\"Payment initiated\"],\n \"redirect_url\": \"https://example.com/payment/checkout?payment_trx=eyJpdiI6IkFyNllSNU1lOFdkYTlPTW52cytPNGc9PSIsInZhbHVlIjoiWWowRTRjdzZ1S1BBRm4ydS81OWR1WjdXeFIxcjE1WkZRVE9BcmZYeXpzND0iLCJtYWMiOiJjNDdhODUzYzY2NmZlZGJjZTI5ODQyMmRkYzdjYjRmM2NiNjg4M2RiMWZjN2EyMzFkODI4OWMwYjk3ZWYwNGQwIiwidGFnIjoiIn0%3D\"\n}"
},
{
"name": "Error Response",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "public_key",
"value": "invalid_public_key"
},
{
"key": "secret_key",
"value": "invalid_secret_key"
}
]
},
"url": {
"raw": "https://apinepal.com/payment/initiate",
"host": ["apinepal.com"],
"path": ["payment/initiate"]
}
},
"status": "Bad Request",
"code": 400,
"body": "{\n \"status\": \"error\",\n \"message\": [\"Invalid api key\"]\n}"
}
]
},
{
"name": "Validate Payment (IPN)",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded",
"type": "text"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "status",
"value": "success",
"type": "text",
"description": "Payment success status"
},
{
"key": "identifier",
"value": "DFU80XZIKS",
"type": "text",
"description": "Unique identifier for the payment"
},
{
"key": "signature",
"value": "your_signature",
"type": "text",
"description": "Hash signature to verify the payment"
},
{
"key": "data",
"value": "{\"amount\": 11.00, \"currency\": \"NPR\", \"transaction_id\": \"TRX123\"}",
"type": "text",
"description": "Contains payment details like charges, amount, currency, and transaction ID"
}
]
},
"url": {
"raw": "http://example.com/ipn_url.php",
"host": ["example.com"],
"path": ["ipn_url.php"]
},
"description": "Handle Instant Payment Notifications (IPN) to validate payments."
},
"response": []
}
]
}