Restful JSON

This specification use JSON Protocol Messaging as programming language, provide Payment Information page for customers, and can be used for loan merchants. The integration available is via the API.

Restful JSON Payment Flow

Figure 1. Restful JSON Payment Flow
  1. The customer places an order on merchant website and proceed to checkout.

  2. Merchant sends payment request using a JSON POST request to E2pay.

  3. Merchant receive response (URL) from E2Pay then redirect user to E2Pay landing payment page.

  4. Customer review order detail and select payment method, and E2Pay direct user to issuer website.

  5. After Customer lands on issuer website then he / she performs transaction.

  6. E2pay get the payment status from issuer and pass it to merchant.

  7. Merchant will show success/fail screen to customer.

  8. E2Pay OPSG server send merchant H2H payment status notification.

  9. Response status will be updated on E2Pay OPSG server until E2Pay OPSG receives “OK” response from merchant.

Hit URL to E2Pay

Merchant Request URL: [provided by merchant before the integration] Definition : Merchant Request URL is a checkout page at merchant website that submits the required parameter/value to E2Pay OPSG. Merchant Response URL: [can be specify with ResponseURL in request page] Definition : Response page URL is the page at merchant website that will receive payment status from E2Pay OPSG.

Payment Request

Request & Response Parameter

Merchants send parameters via JSON as a request to E2Pay. Here are some parameters as a request:

Parameter

Type (Size)

M/O

Description

Sample

PaymentId

Integer

M

Unique payment channel id

7

MerchantCode

Varchar (20)

M

The merchant code provided by e2pay and use to uniquely identify the merchant

EP00103

RefNo

Varchar (20)

M

Provided by merchant. A Unique merchant transaction number.

BL1912FDJRAMINV

VaNumber

Varchar (13)

O

● Indicates virtual account number based on merchant unique number. Example: customer phone number

● This parameter is mandatory for static VA

1245678910

Currency

Varchar (5)

M

Only IDR

IDR

Amount

Currency

M

Total value of the transaction must be paid by customer

300000 (represent amount Rp 300.000)

InvoiceRefNo

Varchar (20)

O

● Mandatory for Invoice system.

● Invoice number provided by merchant.

BL1912FDJRAMINV

FirstName

Varchar (50)

M

Customer first name

Sidney

LastName

Varchar (50)

M

Customer last name

Sheldon

UserEmail

Varchar (100)

M

Customer email

product.team @e2pay.co.id

UserContact

Varchar (16)

M

Customer phone number Eliminate plus (+); convert 62xxx to 0XXXX; Format : 08XXXXXXX

628988363937

Lang

Varchar (100)

O

● Bahasa Indonesia

● English

ENG

Remark

Varchar (1000)

O

Merchant remarks

ResponseURL

Varchar (200)

M

Payment response page.

BackendURL

Varchar (200)

M

Backend response page URL

Signature

Varchar (64)

M

SHA1 signature

OSsMZwT0jH4Wib3G2o/ZTQ RSYPM=

PurchaseItem

List(n)

M

List of products ordered by customers. Refer to PurchaseItem

BillingAddress

Address

M

● Mandatory for LOAN

issuer.

● Billing address of the customer/shopper

ShippingAddress

Address

M

● Mandatory for LOAN issuer. ● Shipping address of the customer/shopper. shipping is required for goods (excluding ticket/voucher)

Sellers

List(n)

M

● Refer to Seller

● Mandatory for marketplaces. ● Details of the seller for marketplaces.

InstallmentType

Varchar (12)

M

● This parameter ONLY applicable for LOAN issuer.

● Instalment type chosen by the customer: a. 30_days b. 3_months c. 6_months d. 12_months

30_days

TokenizeUser

Boolean

M

● This parameter ONLY applicable for LOAN issuer.

● The value can be true or false

false

UserToken

Varchar

M

● This parameter ONLY applicable for LOAN issuer.

● If user token is set, this will be used to authenticate user.

XXXX-XXXX

PurchaseItem

Parameter

Type (Size)

M/O

Description

Sample

Id

Varchar (18)

M

Product ID

123456

Name

Varchar (100)

M

Product name

Iphone 6S

Type

Varchar (50)

O

Product category

Smartphone

Qty

Varchar (4)

M

Product quantity

1

Price

Varchar (12)

M

Product price

1000000

Url

Varchar (150)

M

Url of the item from merchant site

ParentType

Varchar (100)

O

This is either the seller or item

SELLER

ParentId

Varchar (100)

O

This parameter can be filled with Seller ID if the ParentType parameter contains Seller or filled with Item ID if the ParentType parameter contains Item.

SELLER456

Address

Parameter

Type (Size)

M/O

Description

Sample

FirstName

Varchar (50)

M

sidney

LastName

Varchar (50)

M

sheldon

Address

Varchar (255)

M

Jalan Rasuna Said

City

Varchar (50)

M

Jakarta Selatan

PostalCode

Varchar (5)

M

12950

Phone

Varchar (16)

M

628123456789

CountryCode

Varchar (3)

M

Refer to ISO 3166-1

alpha-3

IDN

Seller

Parameter

Type (Size)

M/O

Description

Sample

Id

Varchar

M

Seller's Id

SELLER123

Name

Varchar

M

Seller's name

sidney

Url

Varchar

M

Seller's url

https://onlineshop/seller/sunrise

SellerIdNumber

Varchar

O

Seller's legal Id (KTP, SIM or passport number)

Email

Varchar

M

Seller's email

seller@e2pay.co.id

Address

Address

M

Seller's residential address

Request & Response Sample

POST /rest/authorize Accept: application/json

{
    "PaymentId": 32,
    "MerchantCode": "[your merchantCode]",
    "Currency": "IDR",
    "RefNo": "[your trx refno]",
    "VaNumber" : "",
    "Amount": 300000,
    "InvoiceRefNo": "",
    "FirstName": "jon",
    "LastName": "tan",
    "UserEmail": "testing@testing.com",
    "UserContact": "628988363937",
    "Lang": "ENG", 
    "Remark": "abcdef",
    "ResponseURL": "https://abc.co.id/ResponseUrl",
    "BackendURL": "http://abc.co.id/BackendUrl",
    "Signature":"[your trx signature]",
    
    "PurchaseItem":
    [{
        "Id"     : 123456,
        "Name"   : "Iphone 6S",
        "Type"   : "smartphone",
        "Qty"    : 3,
        "Price"  : 1000000000,
        "Url"    : "http://merchant.com/cellphones/iphone6s_64g"
    },
    {
        "Id"     : 123456,
        "Name"   : "Iphone 6S",
        "Type"   : "smartphone",
        "Qty"    : 3,
        "Price"  : 1000000000,
        "Url"    : "http://merchant.com/cellphones/iphone6s_64g"
    }
    ],
    
    "BillingAddress":
    {
        "FirstName"     : "Customer first name",
        "LastName"      : "Customer last name",
        "Address"       : "Jalan H.R Rasuna Said",
        "City"          : "Jakarta Selatan",
        "PostalCode"    : "12950",
        "Phone"         : "628123456789",
        "CountryCode"   : "ID"
    },
    
    "ShippingAddress":
    {
        "FirstName"     : "Customer first name",
        "LastName"      : "Customer last name",
        "Address"       : "Jalan H.R Rasuna Said",
        "City"          : "Jakarta Selatan",
        "PostalCode"    : "12950",
        "Phone"         : "628123456789",
        "CountryCode"   : "ID"
    },
    
    "Sellers":
    [{
        "Id"             : "your-seller-id",
        "Name"           : "Your Seller Name",
        "Url"            : "https://your-seller-site",
        "SellerIdNumber" : "your-seller-id-number",
        "Email"          : "saller@e2pay.co.id",
        
    "Address":
    {
        "FirstName"     : "Seller first name",
        "LastName"      : "Seller last name",
        "Address"       : "Jalan H.R Rasuna Said",
        "City"          : "Jakarta Selatan",
        "PostalCode"    : "12950",
        "Phone"         : "628123456789",
        "CountryCode"   : "ID"
    }
    }],
    
    "InstallmentType" : "30_days",
    "TokenizeUser"    : false,
    "UserToken"       : "XXXXX-XXXXX"
}

Send Transaction Status

The following are the parameters used when getting a response from E2Pay.

Request Parameter

The following is the request with HTTPS POST from E2Pay to the merchant after the payment process is completed.

Parameter

Type (Size)

M/O

Description

Sample

PaymentId

Integer

M

Unique payment channel id

7

MerchantCode

Varchar (20)

M

The merchant code provided by e2pay and use to uniquely identify the merchant

EP00103

RefNo

Varchar (20)

M

Provided by merchant. A Unique merchant transaction number.

BL1912FDJRAMINV

Currency

Varchar (5)

M

Only Indonesian Rupiah (IDR)

IDR

TransId

Varchar (30)

M

E2Pay OPSG Transaction ID

P1295102400

AuthCode

Varchar (20)

M

Bank approval code

RB5033786857

Amount

Integer

M

Total value of the transaction

300000 (represent amount Rp 300.000)

Status

Varchar (12)

M

Payment transaction status

● Success

● Pending

● Failed

SUCCESS

ErrDesc

Varchar (128)

M

Failure message from acquirer/issuer if there is

Payment fail

UniqueId

Varchar (64)

O

Unique Customer Id from Issuer

4f8b5361e1f130902574f5e 27616b10ef373b4c05b6139 ab1145abdf411db2c

Signature

Varchar (64)

M

SHA1 signature

OSsMZwT0jH4Wib3G2o/ZT QRSYPM=

Request Sample

Content-Type: application/json Location: /api/payment

{
    "PaymentId"    : 7,
    "MerchantCode" : “EP00103”,
    "RefNo "       : “BL1912FDJRAMINV”,
    "Amount"       : 300000,
    "Currency"     : “IDR”,
    "AuthCode"     : “RB5033786857”,
    "TransId"      : “P1295102400”,
    "Status"       : "SUCCESS",
    "ErrDesc"      : "",
    “UniqueId”     :”4f8b5361e1f130902574f5e27616b10ef373b4c05b6139ab1145abdf411db2c”,
    "Signature"    : " OSsMZwT0jH4Wib3G2o/ZTQRSYPM="
}

Backend H2H Payment Status Notification

The Backend H2H payment status notification feature is server to server technology where it does not depend on the customer web browser to return payment response data to merchant website. With this feature implemented, your system still can get the payment status on the backend (asynchronously) even if the merchant normal response page fails to get status from E2Pay which may be due to a closed web browser, internet connection timeout and etc. E2pay will send a transaction status notification after the transaction is completed. If the merchant does not get the status notification, you can use the inquiry status to check the transaction status. E2pay will set a timeout of 15 seconds. It is expected that merchants can respond in less than 5 seconds. Merchant to provide Backend URL to E2Pay for H2H Payment status notification

Request & Response Parameter

Parameter

Type (Size)

M/O

Description

Sample

PaymentId

Integer

M

Unique payment channel id

7

MerchantCode

Varchar (8)

M

The merchant code provided by e2pay and use to uniquely identify the merchant

EP00103

Currency

Varchar (5)

M

Indonesian Rupiah (IDR)

IDR

TransId

Varchar (20)

M

Payment Transaction Unique ID degenerated by e2pay

P1293365900

RefNo

Varchar (20)

M

Unique merchant transaction number

BL1912FDJRAMINV

Amount

Integer

M

Total value of the transaction

300000 (represent amount Rp 300.000)

AuthCode

Varchar (32)

M

Specific code from acquirer/issuer defines transaction authorization status

RB5033786857

Remark

Varchar (1000)

O

Merchant remarks (for Unique Value Like RRN for QRIS M-Bayar and VA Number for Channel Virtual Account)

179331572490 (RRN)

Status

Varchar (12)

M

Payment transaction status

as follow:

● Success

● Pending

● Failed

SUCCESS

ErrDesc

Varchar (128)

M

Failure message from

acquirer/issuer

Payment fail

ErrorCode

Varchar (7)

M

Error code Refer to Error Code

pge2101

UniqueId

Varchar (64)

O

Unique Customer Id from Issuer

4f8b5361e1f130902574f 5e27616b10ef373b4c05 b6139ab1145abdf411db 2c

Signature

Varchar (64)

M

SHA1 signature

OSsMZwT0jH4Wib3G2o/ ZTQRSYPM=

Request Sample

POST /api/payment Accept: application/json

{
    "PaymentId" : 7,
    "MerchantCode" : “EP00103”,
    "Currency" : "IDR",
    "TransId" : “P1293365900”,
    "RefNo " : “BL1912FDJRAMINV”,
    "Amount" : 300000,
    "AuthCode" : "RB5033786857"
    "Status" : "SUCCESS”,
    "ErrDesc" : "”,
    "ErrorCode" : “pge2101”,
    “UniqueId”:”4f8b5361e1f130902574f5e27616b10ef373b4c05b6139ab1145abdf411db2c”,
    "Signature" : "OSsMZwT0jH4Wib3G2o/ZTQRSYPM="
}

H2H Payment Status Re-Query

H2H Payment Status Re-query is used by merchants to get the status of transactions that have been made.

Request & Response Parameter

Parameter

Type (Size)

M/O

Description

Sample

PaymentId

Integer

M

Unique payment channel id

7

MerchantCode

Varchar (8)

M

The merchant code provided by e2pay and use to uniquely identify the merchant

EP00103

Currency

Varchar (5)

M

Indonesian Rupiah (IDR)

IDR

TransId

Varchar (20)

M

Payment Transaction Unique ID degenerated by e2pay

P1293365900

RefNo

Varchar (20)

M

Unique merchant transaction number

BL1912FDJRAMINV

Signature

Varchar (64)

M

SHA1 signature

OSsMZwT0jH4Wib3G2o/ZT QRSYPM=

Request Sample

  • POST /api/paymentStatusInquiry

  • Accept: application/json

{
    "PaymentId" : 7,
    "MerchantCode" : “EP00103”,
    "Currency" : "IDR",
    "TransId" : “P1293365900”,
    "RefNo" : “BL1912FDJRAMINV”,
    "Signature" : "OSsMZwT0jH4Wib3G2o/ZTQRSYPM="
}

Digital Signature

This signature must be included in the request of every transaction. This hash signature for a request is a hash of the following five fields:

Parameter
Type (Size)
M/O

SecretKey

Varchar(12)

M

MerchantCode

Varchar(8)

M

RefNo

Varchar(20)

M

Amount

Integer

M

Currency

Varchar(5)

M

The fields must set in the following order: (SecretKey & MerchantCode & RefNo & Amount & Currency) Example : SecretKey = merchantkey MerchantCode = EP00005 RefNo = 19201970148AM Amount = 300000 (Note: 300000 represent amount Rp 300.000) Currency = IDR The hash would be calculated on the following string: merchantkeyEP0000519201970148AM300000IDR The resulting has signature value equals to (using SHA1 base64 hash algorithm) 01sh+jPUL2wdqCcWJTgiuNuiiTI=

Example

<?PHP
    function E2Pay_signature($source)
    {
        return base64_encode(hex2bin(sha1($source)));
    }
    
    function hex2bin($hexSource)
    {
        for ($i=0;$i<strlen($hexSource);$i=$i+2)
    {
            $bin .= chr(hexdec(substr($hexSource,$i,2)));
    }
        return $bin;
    }
?>
  1. Please upload the js file to your server.

  2. Include the js file in your production payment page in order to use the signature function.

  3. Concatenate the value to be hash

  4. Call the following function in your javascript tag by passing in your string to hash to generate the signature..

    <script type="text/javascript" src="sha1.js"></script>

    <script language="javascript">

    document.write(e2paySignature(strToHash));

    </script>

  5. Pass the signature generated to e2pay payment page in the form element call "Signature".

Error Code

Code
Message
Description

pge2101

Invalid parameters

Some parameter posted to E2Pay is invalid or empty

pge2103

Invalid merchant code

The merchant code does not exist or incorrect

pge2104

Duplicate reference member

Do not re-use Reference Number that previously payment success for transaction.

pge2203

Signature not match

Signature on request page which pass to E2Pay is incorrectly generated. Refer section 8 for more information about Signature for request page.

Payment ID

Payment Channel
Payment ID

E2Pay Checkout Page

0

Danamon

8

CIMB Rekpon

9

Mbayar Auth

18

Indomaret

19

CIMB Octo Mobile QRIS

42

Mbayar QR

21

Permata VA

22

Kredivo

23

Alfamart

24

LinkAja WCO

25

CIMB Octo Clicks

26

OVO

27

BNI VA

28

LinkAja Applink

29

LinkAja QRIS

30

DANA

32

ShopeePay QRIS

34

ShopeePay JumpApp

36

CIMB VA

37

BCA VA

38

BRI VA

40

Gopay

41

Mandiri VA

44

Additional Note for BRI Virtual Account

Minimum User Contact: 10 Character (Only Number)

Maximum User Contact: 14 Character (Only Number)

Last updated