Perkenalan

Bagian ini menjelaskan ePayindo payment gateway API.


ePayindo The Payment API is simple to integrate into your company's software. Our API takes cURL requests, has well-formatted URLs, and produces JSON responses.

The API can be used in test mode without affecting your real data. The request is authenticated using the API key, which also establishes whether the payment is legitimate or not. For test mode just use the sandbox URL and In case of live mode use the live URL from section Memulai Pembayaran .

Mata Uang yang Didukung

The supported currencies by ePayindo are given below.


Currency Simbol Mata Uang
IDR-VA IDR-VA
IDR-QRIS IDR-QRIS

Get The Api Key

How to obtain the api key is explained in this part.


To access your ePayindo merchant account, please log in. In case you don't have an account, you can Klik Disini.

Now go to the Account > Settings > API Key from the merchant panel.

The api keys can be found there which is Public key and Secret key. Use these keys to initiate the API request. Every time you can generate new API key by clicking Generate Api Key button. Remember do not share these keys with anyone.

Memulai Pembayaran

In this section, the procedure for initiating the payment is explained.


To begin the payment process, use the sample code provided, and pay close attention to the parameters. The API endpoints mentioned below will need to be used to make the request.

Live End Point: https://www.epayindo.com/payment/initiate

Test End Point: https://www.epayindo.com/test/payment/initiate

Request to the end point with the following parameters below.

Param Name Param Type Penjelasan
public_key string (50) Diperlukan Your Public API key
identifier string (20) Diperlukan Identifier is basically for identify payment at your end
currency string (4) Diperlukan Currency Code, Must be in Upper Case. e.g. USD,EUR
amount decimal Diperlukan Payment amount
details string (100) Diperlukan Details of your payment or transaction
ipn_url string Diperlukan The url of instant payment notification
success_url string Diperlukan Payment success redirect url
cancel_url string Diperlukan Payment cancel redirect url
site_name string Diperlukan Your business site name
site_logo string/url Opsional Your business site logo
checkout_theme string Opsional Checkout form theme dark/light. Default theme is light
Customer
customer[] array Diperlukan customer must be an array
customer.first_name string Diperlukan Customer's first name
customer.last_name string Diperlukan Customer's last name
customer.email string Diperlukan Customer's valid email
customer.mobile string Diperlukan Customer's valid mobile
Shipping info
shipping_info[] array Opsional shipping_info must be an array
shipping_info.address_one string Opsional Customer's address one
shipping_info.address_two string Opsional Customer's address two
shipping_info.area string Opsional Shipping area of customer
shipping_info.city string Opsional Shipping city of customer
shipping_info.sub_city string Opsional Shipping sub city of customer
shipping_info.state string Opsional Shipping state
shipping_info.postcode string Opsional Shipping postcode
shipping_info.country string Opsional Shipping country
shipping_info.others string Opsional Others info
Billing info
billing_info[] array Opsional billing_info must be an array
billing_info.address_one string Opsional Customer's address one
billing_info.address_two string Opsional Customer's address two
billing_info.area string Opsional Billing area of customer
billing_info.city string Opsional Billing city of customer
billing_info.sub_city string Opsional Billing sub city of customer
billing_info.state string Opsional Billing state
billing_info.postcode string Opsional Billing postcode
billing_info.country string Opsional Billing country
billing_info.others string Opsional Others info
Example PHP code
<?php
    $parameters = [
        'identifier' => 'DFU80XZIKS',
        'currency' => 'USD',
        'amount' => 11.00,
        'gateway_methods' => [
            // Please write the name of the gateway method you want to use
        ],
        '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',
        'public_key' => 'your_public_key',
        '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 end point
    $url = 'https://www.epayindo.com/payment/initiate';

    //test end point
    $url = 'https://www.epayindo.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);

?>
Example Responses
//Error Response.
{
    "status": "error",
    "message": [
        "Invalid api key"
    ]
}

//Success Response.
{
    "status": "success",
    "message": [
        "Payment initiated"
    ],
    "redirect_url": "https://example.com/payment/checkout?payment_trx=eyJpdiI6IkFyNllSNU1lOFdkYTlPTW52cytPNGc9PSIsInZhbHVlIjoiWWowRTRjdzZ1S1BBRm4ydS81OWR1WjdXeFIxcjE1WkZRVE9BcmZYeXpzND0iLCJtYWMiOiJjNDdhODUzYzY2NmZlZGJjZTI5ODQyMmRkYzdjYjRmM2NiNjg4M2RiMWZjN2EyMzFkODI4OWMwYjk3ZWYwNGQwIiwidGFnIjoiIn0%3D"
}

Memulai Pembayaran ePayindo

In this section, the procedure for initiating the ePayindo payment is explained.


To begin the payment process, use the sample code provided, and pay close attention to the parameters. The API endpoints mentioned below will need to be used to make the request.

Live End Point: https://www.epayindo.com/payment/initiate

Test End Point: https://www.epayindo.com/test/payment/initiate

Request to the end point with the following parameters below.

Param Name Param Type Penjelasan
public_key string (50) Diperlukan Your Public API key
identifier string (20) Diperlukan Identifier is basically for identify payment at your end
currency string (7) Diperlukan Currency Code, Must be in Upper Case. [IDR-VA, IDR-QRIS]
amount decimal Diperlukan Payment amount
details string (100) Diperlukan Details of your payment or transaction
ipn_url string Diperlukan The url of instant payment notification
success_url string Diperlukan Payment success redirect url
cancel_url string Diperlukan Payment cancel redirect url
site_name string Diperlukan Your business site name
site_logo string/url Opsional Your business site logo
checkout_theme string Opsional Checkout form theme dark/light. Default theme is light
Customer
customer[] array Diperlukan customer must be an array
customer.first_name string Diperlukan Customer's first name
customer.last_name string Diperlukan Customer's last name
customer.email string Diperlukan Customer's valid email
customer.mobile string Diperlukan Customer's valid mobile
Shipping info
shipping_info[] array Opsional shipping_info must be an array
shipping_info.address_one string Opsional Customer's address one
shipping_info.address_two string Opsional Customer's address two
shipping_info.area string Opsional Shipping area of customer
shipping_info.city string Opsional Shipping city of customer
shipping_info.sub_city string Opsional Shipping sub city of customer
shipping_info.state string Opsional Shipping state
shipping_info.postcode string Opsional Shipping postcode
shipping_info.country string Opsional Shipping country
shipping_info.others string Opsional Others info
Billing info
billing_info[] array Opsional billing_info must be an array
billing_info.address_one string Opsional Customer's address one
billing_info.address_two string Opsional Customer's address two
billing_info.area string Opsional Billing area of customer
billing_info.city string Opsional Billing city of customer
billing_info.sub_city string Opsional Billing sub city of customer
billing_info.state string Opsional Billing state
billing_info.postcode string Opsional Billing postcode
billing_info.country string Opsional Billing country
billing_info.others string Opsional Others info
Example PHP code
<?php
    $parameters = [
        'identifier' => 'DFU80XZIKS',
        'currency' => 'IDR-VA', // just choose only one for currency (IDR-VA or IDR-QRIS)
        'amount' => 15000,
        'gateway_methods' => ['LinkQu'], // only LinkQu can be show LinkQu gateway
        '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',
        'public_key' => 'your_public_key',
        '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 end point
    $url = 'https://www.epayindo.com/payment/initiate';

    //test end point
    $url = 'https://www.epayindo.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);

?>
Example Responses
//Error Response.
{
    "status": "error",
    "message": [
        "Invalid api key"
    ]
}

//Success Response.
{
    "status": "success",
    "message": [
        "Payment initiated"
    ],
    "redirect_url": "https://example.com/payment/checkout?payment_trx=eyJpdiI6IkFyNllSNU1lOFdkYTlPTW52cytPNGc9PSIsInZhbHVlIjoiWWowRTRjdzZ1S1BBRm4ydS81OWR1WjdXeFIxcjE1WkZRVE9BcmZYeXpzND0iLCJtYWMiOiJjNDdhODUzYzY2NmZlZGJjZTI5ODQyMmRkYzdjYjRmM2NiNjg4M2RiMWZjN2EyMzFkODI4OWMwYjk3ZWYwNGQwIiwidGFnIjoiIn0%3D"
}

Validate The Payment and IPN

This section describes the process to get your instant payment notification.


To initiate the payment follow the example code and be careful with the perameters. You will need to make request with these following API end points.

End Point: Your business application ipn url.

Request Method: POST

You will get following parameters below.

Param Name Penjelasan
status Payment success status.
identifier Identifier is basically for identify payment at your end.
signature A hash signature to verify your payment at your end.
data Data contains some basic information with charges, amount, currency, payment transaction id etc.
Example PHP code
<?php
    //Receive the response parameter
    $status = $_POST['status'];
    $signature = $_POST['signature'];
    $identifier = $_POST['identifier'];
    $data = $_POST['data'];

    // Generate your signature
    $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
    }
?>

Check Balance

This section describes the process to get balance.


To get the balance follow the example code and be careful with the perameters. You will need to make request with these following API end points.

End Point: https://www.epayindo.com/withdraw/balance-check

Bearer Token: Your secret_key

Request Method: POST

You will get following parameters below.

Param Name Penjelasan
public_key Diperlukan Your Public API key
Example PHP code
<?php
    //Receive the response parameter


    $token = 'YOUR_PROD_SECRET_KEY'; // your prod secret key

    $headers = [
        'Content-Type: application/json',
        'Authorization: Bearer ' . $token,
    ];

    $body = [
        'public_key' => 'YOUR_PROD_PUBLIC_KEY', // your prod public key
    ];

    //live end point
    $url = 'https://www.epayindo.com/withdraw/balance-check';

    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($body));

    $response = curl_exec($curl);

?>
Example Responses

    //Error Response.
    {
        "status": false,
        "message": [
            "Invalid api key"
        ]
    }

    //Success Response.
    {
        "status": true,
        "message": "Successfully get balance",
        "data": {
            "user": {
                "first_name": "van",
                "last_name": "nababan"
            },
            "currency": "IDR",
            "balance": 29200000
        }
    }
    

Get Bank & Emoney ePayindo.

This section describes the process to get bank and emoney ePayindo.


To get the bank and emoney code follow the example code and be careful with the perameters. You will need to make request with these following API end points.

End Point: https://www.epayindo.com/withdraw/bank-emoney-list

Request Method: GET

You will get following parameters below.

Param Name Penjelasan
Example PHP code
<?php
    //Receive the response parameter
    $headers = [
        'Content-Type: application/json',
    ];

    //live end point
    $url = 'https://www.epayindo.com/withdraw/bank-emoney-list';

    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

    $response = curl_exec($curl);

?>
Example Responses

    //Error Response.
    {
        "status": false,
        "message": [
            "not found!"
        ]
    }

    //Success Response.
    {
        "status": true,
        "message": "Successfully get balance",
        "data": {
            "banks": [
                {
                    "code": "008",
                    "name": "MANDIRI",
                    "url_image": "https://api-mitra.linkqu.id/app/assets/008-6E25554009454B2C39C31A7DA1EA342E.png"
                },
                ....
            ],
            "emoney" : [
                {
                    "code": "DANA",
                    "name": "DANA EWALLET",
                    "url_image": "https://vectrostudio.com/wp-content/uploads/2020/03/Dana-Logo-Vector2-300x202.jpg"
                },
                ....
            ]
        }
    }
    

Withdraw Initiate ePayindo

This section describes the process to initiate withdraw.


To initate withdraw, follow the example code and be careful with the perameters. You will need to make request with these following API end points.
Make sure the response of account number and account name is same before issue.

End Point: https://www.epayindo.com/withdraw/initiate

Bearer Token: Your secret_key

Request Method: POST

You will get following parameters below.

Param Name Penjelasan
public_key Diperlukan Your Public API key
amount Diperlukan Amount transfer to your account
code Diperlukan Bank or emoney code
account_number Diperlukan Your Account Number
account_name Diperlukan Your Account Name
Example PHP code
<?php
    $token = 'YOUR_PROD_SECRET_KEY'; // your prod secret key

    $headers = [
        'Content-Type: application/json',
        'Authorization: Bearer ' . $token,
    ];

    $body = [
        'public_key' => 'YOUR_PROD_PUBLIC_KEY', // your prod public key
        'amount' => 5000000,
        'code' => '014', // bank or emoney code
        'account_number' => '123456789' // your account number
        'account_name' => "Polan Nabadia" // your account name
    ];

    //live end point
    $url = 'https://www.epayindo.com/withdraw/initiate';

    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($body));

    $response = curl_exec($curl);

?>
Example Responses

    //Success Response.
    {
        "status": true,
        "message": "successfully initiate withdraw",
        "data": {
            "id_trx": "21BAU7M66XOK",
            "bank_code": "014",
            "bank_name": "BANK BCA",
            "account_number": "123456789",
            "account_name": "Polan Nabadia",
            "amount": 5000000,
            "fee": 50001,
            "final_amount": 4949999
        }
    }
    

Withdraw Issue ePayindo

This section describes the process to issue withdraw.


To issue withdraw, follow the example code and be careful with the perameters. You will need to make request with these following API end points.
This is the end of the withdraw steps.

End Point: https://www.epayindo.com/withdraw/issue

Bearer Token: Your secret_key

Request Method: POST

You will get following parameters below.

Param Name Penjelasan
public_key Diperlukan Your Public API key
id_trx Diperlukan Your id_trx from withdraw initiate
Example PHP code
<?php
    $token = 'YOUR_PROD_SECRET_KEY'; // your prod secret key

    $headers = [
        'Content-Type: application/json',
        'Authorization: Bearer ' . $token,
    ];

    $body = [
        'public_key' => 'YOUR_PROD_PUBLIC_KEY', // your prod public key
        'id_trx' => '21BAU7M66XOK', // your id trx from request
    ];

    //live end point
    $url = 'https://www.epayindo.com/withdraw/issue';

    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($body));

    $response = curl_exec($curl);

?>
Example Responses


    // Error response
    {
        "status": false,
        "message": "invalid id trx!"
    }

    //Success Response.
    {
        "status": true,
        "message": "successfully issue",
        "data": {
            "id_trx": "21BAU7M66XOK",
            "bank_code": "014",
            "bank_name": "BANK BCA",
            "account_number": "0343602275",
            "account_name": "Henda Sujiadi",
            "amount": 5000000,
            "fee": 50001,
            "final_amount": 4949999
        }
    }
    

We may use cookies or any other tracking technologies when you visit our website, including any other media form, mobile website, or mobile application related or connected to help customize the Site and improve your experience. learn more

Allow