Introduction
Welcome to Empatkali API!
Empatkali API is a RESTful Web Service served as a communication bridge between merchants and our payment channels.
API Base URL
Sandbox : https://sb-transaction.empatkali.co.id/api
Production : https://transaction.empatkali.co.id/api
Overview
- User performs the checkout operation
- Merchant site doing authantication contain some payload
- EMPATKALI server will verify the request
- Will redirecting to EMPATKALI portal page
- EMPATKALI User fill in "Phone Number" and "Kode Pembayaran" from empatkali apps for doing transaction
- EMPATKALI server will verify the request and process the payment
- If the payment success EMPATKALI will send EMAIL to registered Merchant email and EMPATKALI User Email
- If the payment success EMPATKALI backend will send HTTPS POST Request to Merchant registered callback URL containing transaction information.
Supported Browsers
We try to support the latest versions of all major browsers. The list below provides the minimum supported version of each browser in Mobile and Desktop platform :
Mobile
- Chrome 32 and above
- Android 6.1 and above
- Safari 10 and above
- BlackBerry 10 and above
Dekstop
- Chrome 26 and above
- Firefox 29 and above
- Internet Explorer 10 and above
- Safari 10 and above
On Board With EMPATKALI
To start using EMPATKALI plugin, you have to register for EMPATKALI merchant account here.
Once you have registered on website, EMPATKALI will check your data and send you the credential for login to Merchant Dashboard
Example:
- Username :
Username_Merchant
- Password :
xxxxxxxxxxx
- Secret Key :
EMPATKALI Will provide this key
Note:
Production key and URL will be provided when going live
Integration Process
Overview
Flow on how the redirect integration process
(click image to enlarge)
- User transacts to any merchant supported by Empatkali
- Merchant will then send request to Empatkali API to create payment
- Empatkali will send response after processing the create payment request from merchant
- If success, merchant will connect via socket and be process by Empatkali server
- Once processed, Empatkali will send a callback
Implementation
A step-by-step implementation of the NEW redirect integration process.
See sample on the right side regarding the required fields under that parameter.
Sample Request
{
"transactionNumber": "TRAC4X001",
"total": 1000000,
"redirectURL": "https://redirect-after-success.com",
"failedURL": "https://redirect-after-failed.com",
"detail": {
"items": [
{
"sku_id": "sku_id",
"sku_product_name": "sku_product_name",
"sku_category": "sku_category",
"sku_price": "testing",
"sku_quantity": "sku_quantity"
},
{
"sku_id": "sku_id",
"sku_product_name": "sku_product_name",
"sku_category": [
"sku_category",
"sku_category",
"sku_category"
],
"sku_price": "testing",
"sku_quantity": "sku_quantity"
},
{
"sku_id": "sku_id",
"sku_product_name": "sku_product_name",
"sku_category": [
"sku_category",
"sku_category"
],
"sku_price": "testing",
"sku_quantity": "sku_quantity"
}
],
"otherFields": {
"checkout_name": "firstname and last name user",
"checkout_email": "email user on checkout",
"checkout_phone": "123456",
"checkout_shipping_address": {
"street": "Jl. Sultan Sharir",
"number": "666",
"city": "jakarta",
"postal_code": "12210",
"province": "jakarta"
},
"billing_name": "firstname and last name user",
"billing_email": "email user on checkout",
"billing_phone": "123456",
"billing_shipping_address": {
"street": "Jl. Sultan Sharir",
"number": "666",
"city": "jakarta",
"postal_code": "12210",
"province": "jakarta"
}
}
}
}
Sample Response
{
"redirect_url": "https://dev-empatkali.co.id/5fd3c2c74c96a68f41d6dcc5/fa1fdbe552c62b16c1c96992150dc894",
"qr": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAAAklExxxxxxxx"
}
1. Authenticate
Validate your credentials i.e. store id
and secret key
for authentication. If success, the API will return a redirect_url
response that contains the URL value which will then be used for redirection to the portal.
API Base URL
Sandbox : https://sb-transaction.empatkali.co.id/api
Production : https://transaction.empatkali.co.id/api
API Method
Endpoint | HTTP Method |
---|---|
BASE_URL/generate_authentication |
POST |
Request Header
Use Basic authentication scheme for authorization and use the store id
and the secret key
provided to you by EmpatKali as the username (store id) and password (secret key). For example on how to implement Basic authentication, click this link.
Request Body
Parameter | Type | Description |
---|---|---|
transactionNumber |
String | Transaction Number |
total |
Float | Total transaction amount |
redirectURL |
String | Redirect to success transaction page merchant |
failedURL |
String | Redirect to failed transaction page merchant |
detail |
Object | |
detail.items |
Array | Contains SKU data |
detail.otherFields |
Object |
2. Redirection
If verified by our system (Step 1), you will be provided a response from the API, and one of it is the redirect_url
. You may use that response to redirect to EmpatKali portal.
Take a noted kindly change the domain from the response
Sandbox :
from https://sandbox-portal.empatkali.co.id/
to https://dev-portal.empatkali.co.id/
Production :
from https://release-portal.empatkali.co.id/
to https://v2-portal.empatkali.co.id/
Example
from
https://sandbox-empatkali.co.id/5fd3c2c74c96a68f41d6dcc5/fa1fdbe552c62b16c1c96992150dc894
to
https://dev-empatkali.co.id/5fd3c2c74c96a68f41d6dcc5/fa1fdbe552c62b16c1c96992150dc894
Override Notification URL
Merchant can opt to change or add custom notification urls on every transaction. It can be achieved by adding additional HTTP headers into charge request.
There are two headers we provide:
X-Append-Notification
X-Override-Notification
Both header can only receive up to maximum of 3 urls.
Sample case
Assuming merchant has set https://example.com as their notification url on the dashboard.
If they set X-Append-Notification
with values https://example.com/test1, https://example.com/test2
. Then every HTTP notification for that specific transaction will be sent to:
- https://example.com
- https://example.com/test1, and
- https://example.com/test2
Else if they set X-Override-Notification
with values https://example.com/test1, http://example.com/test2
. Then, every HTTP notification for that specific transaction will be sent to:
- https://example.com/test1 and
- https://example.com/test2
PDP Snippet Custom Merchant
Overview
Integrating EmpatKali PDP (Product Display Page) Snippet for custom website.
For other supported e-commerce platforms:
- WooCommerce
- Shopify
Sample screenshot of how it should look (click image to enlarge)
Implementation
Below are the steps on implementing the PDP
(1) Copy the text
Make sure to copy the provided text below depending on the language you are using. Currently we support 2 versions i.e. Bahasa and English.
English
or 4 interest-free payment of IDR (Amount of item / 4)
with Info
Bahasa
atau 4 kali cicilan 0% Rp (nilai item / 4)
pakai with Info lebih lanjut
For the EmpatKali logo, you may download it here
(2) Popup Content
When "info" is clicked, it should trigger a popup that contains EmpatKali information. You may use vanilla JS or a variety of libraries such as Fancybox for example, or use bootstrap modal. Then inside that modal, just create an iframe and call the URL that contains EmpatKali information (see below for the link) based on the language that you support (Bahasa or English version).
For Bahasa
https://static.empatkali.co.id/info-lebih-lanjut.html
For English
https://static.empatkali.co.id/en/info-lebih-lanjut.html
(3) That's it
WooCommerce Integration
Overview
Install EmpatKali plugin as one of your payment gateway during checkout.
Download the plugin here
https://wordpress.org/plugins/woo-empatkali-checkout-gateway/
Usage
Step By Step
1. After Download and install
2. In side Menu Wordpress choose woocomerce and then click sub menu setting
3. then click payment tab -> enable radio button
4. then click empatkali woocomerce plugin -> input storeId and
secret key ( get from email : Subject create Store )
Follow instructions below on how to setup EmpatKali on WooCommerce.
Enabling the plugin (click image to enlarge)
Setting up the payment gateway
Click Select environment then choose Production.
Input the Production Store Id and Production Secret Key on the right environment field (click image to enlarge).
Sample transaction using Empatkali payment gateway (click image to enlarge)
```
WooCommerce Product Snippet Integration
Overview
Install Product Snippet which will then display to your single product page.
Installation
- Download the plugin by clicking this link then upload the zip file.
-
Just activate it, no dependencies required, no codes to embed
-
Done!
Shopify
Snippet Integration on Product Page
Copy the codes (Step #1)
<script type="text/javascript">
// Non-editable fields
var empatkali_shop_currency = {{ shop.currency | json }};
var empatkali_shop_money_format = {{ shop.money_format | json }};
var empatkali_shop_permanent_domain = {{ shop.permanent_domain | json }};
var empatkali_theme_name = {{ theme.name | json }};
var empatkali_product = {{ product | json }};
var empatkali_current_variant = {{ product.selected_or_first_available_variant | json }};
var empatkali_cart_total_price = {{ cart.total_price | json }};
var empatkali_js_snippet_version = '1.0.0';
</script>
<script type="text/javascript" src="https://static.empatkali.co.id/shopify-empatkali.js"></script>
The Empatkali logo and instalment amounts will appear on the Shopify Product Pages.
Note: The display may differ depending on site-specific theme and layout.
Configuration
Completing the steps on the right section will position the Empatkali Product Page assets on your Shopify website.
- Copy the codes on the right side.
- Navigate to Shopify Admin.
-
Navigate to: ‘Sales Channels‘ > ‘Online Store‘ > ‘Themes‘.
-
Navigate to ‘Actions’ > ‘Edit Code’.
-
Under the ‘Layout’ folder, click on ‘theme.liquid’.
-
Scroll to the bottom of the ‘theme.liquid’ file.
-
Paste the copied text (Step 1), at the bottom of the ‘theme.liquid’ file.
- Click Save
-
Navigate to the website and review the product page for Empatkali assets.
Example below
Sirclo Integration
Overview
Empatkali payment gateway will allow you to purchase products on your website during checkout
Usage
Step By Step
1. Go to Sirclo Admin Dashboard
2. In side Menu Sirclo choose “Setting”
3. Please Search Empatkali and Check the checkbox to allow user to use Empatkali Payment
4. Then input Store ID and Secret Key (get from email with Subject Create Store)
5. Then Click SAVE
In your Sirclo payment settings, input the required fields such as the idStore and secret key and make sure that it is working. If all is well, then you should see Empatkali as one of your payment gateway during checkout.
See screenshots below
STEP 01 (click image to enlarge)
STEP 02 (click image to enlarge)
QR Code Integration
Process Flow Diagram
A Process flow diagram on how to integrate qr code to your app
(click image to enlarge)
(1) Generate QR
Generate a QR code
Sample Request
{
"storeId": "xxxxxxxxxxxxxxxxx",
"total": "1000000",
"transactionNumber":"AABBCC123456"
// note : aditional parameter
"customField1": xxxxxxxxx,
"customField2": xxxxxxxxx,
"customField3": xxxxxxxxx,
"customField4": xxxxxxxxx,
"customField5": xxxxxxxxx
}
Sample Response
{
"md5": "f9fe0f79ddef11c1590980267662608b",
"qr": "data:image/png;base64,A3lAvp/2dqdlAAAAAElFTkSuQmCC....."
}
Endpoint | HTTP Method |
---|---|
/api/approvedtransactions/generateal |
POST |
Keep the qr
value from the response for creating a transaction.
Custom Field
Response
{
"storeId": __yourStore_Id__,
"secret": __yourstore_secret__,
"total": 1000000,
"transactionNumber": __yourTransactionID__,
"customField1": xxxxxxxxx,
"customField2": xxxxxxxxx,
"customField3": xxxxxxxxx,
"customField4": xxxxxxxxx,
"customField5": xxxxxxxxx
}
Set Custom Fields is a feature that enables merchants to charge a transaction with a unique data according to the merchant's need. EMPATKALI provides merchants with 5 custom fields that can be used for various utilities. Convention of a custom field can be set when merchant request transaction
JSON Attribute | Type | Description |
---|---|---|
customField1 | String() | The value of custom field 1 |
customField2 | String() | The value of custom field 2 |
customField3 | String() | The value of custom field 3 |
customField4 | String() | The value of custom field 4 |
customField5 | String() | The value of custom field 5 |
Callback
Response
{
"gross_amount": float
"status_message": String
"status_code": String,
"success": Boolean,
"transaction_number": String,
"transaction_id": String,
}
Status Code | Success | Status Message |
---|---|---|
200 | true | Success |
201 | false | OTP not valid |
202 | false | Duplicate Invoice Number |
203 | false | Insufficient Users Balance |
204 | false | MD5 not valid |
205 | false | User is not allowed |
206 | false | Cannot charge the card |
207 | false | User not found |
208 | false | Store not found |
209 | false | Card not found |
210 | false | Unexpected error |
300 | false | Transaction cancelled |