NAV Navbar
javascript

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

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

Dekstop

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:

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)

  1. User transacts to any merchant supported by Empatkali
  2. Merchant will then send request to Empatkali API to create payment
  3. Empatkali will send response after processing the create payment request from merchant
  4. If success, merchant will connect via socket and be process by Empatkali server
  5. 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:

  1. X-Append-Notification
  2. 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:

  1. https://example.com
  2. https://example.com/test1, and
  3. 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:

  1. https://example.com/test1 and
  2. 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) PDP Snippet

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 PDP Snippet Info

Bahasa
atau 4 kali cicilan 0% Rp (nilai item / 4) pakai with PDP Snippet 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

  1. Download the plugin by clicking this link then upload the zip file.
  2. Just activate it, no dependencies required, no codes to embed
    activate the plugin
  3. Done!
    final result

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.

  1. Copy the codes on the right side.
  2. Navigate to Shopify Admin.
  3. Navigate to: ‘Sales Channels‘ > ‘Online Store‘ > ‘Themes‘. integration-step-no-3

  4. Navigate to ‘Actions’ > ‘Edit Code’. integration-step-no-4

  5. Under the ‘Layout’ folder, click on ‘theme.liquid’. integration-step-no-5

  6. Scroll to the bottom of the ‘theme.liquid’ file. integration-step-no-6

  7. Paste the copied text (Step 1), at the bottom of the ‘theme.liquid’ file. integration-step-no-7

  8. Click Save
  9. Navigate to the website and review the product page for Empatkali assets. Example below
    integration-step-no-9

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)

qr code integration

(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