Merchant Request APIs
PG has prepared plenty of merchant tools for merchants to initiate status requery and cancellation/void of transaction. However, merchants are not allowed to send in requests too frequently (maximum 1 query every 5 seconds). Massive incoming query will lead to IP blocking without prior notice. There will be a validity duration to initiate a status requery API call, generally within 1 hour after the initiated time for online payment and the due time for offline payment.
The back-end services available are:
Direct Status Requery - merchant send status query to processing bank directly
Indirect Status Requery - merchant send status query to PG system
Daily Transaction Report (Reconciliation) - list all transactions of a specific date
Void Pending-Cash API
Direct Status Requery
This will trigger a query to the payment channel or bank status server and there are cases that bank status server is not in-sync with its payment server that might give different results, that leads to a defer update and will trigger a callback from PG server, once the status is synced and changed. Note : No result available for transaction more than 7 days.
Request
URL: https://api.e2pay.co.id/RMS/API/gate-query/index.php
Method: POST or GET
amount
2 decimal points numeric value
The payment amount
txID
integer, 10 digits
Unique transaction ID for tracking purpose.
domain
alphanumeric, 32 chars
Merchant ID in PG system.
skey
32 chars hexadecimal string
This is the data integrity protection hash string.
url
optional, URL for POST response
The URL to receive POST response from PG
type
optional, 1-digit integer, obsoleted in new API sets
0 = plain text result (default)
1 = result via POST method
Response
Amount
2 decimal points numeric value
The payment amount
TranID
integer, 10 digits
Unique transaction ID for tracking purpose.
Domain
alphanumeric, 32 chars
Merchant ID in PG system.
Channel
alphanumeric, 100 chars
Payment via Channel
VrfKey
32 chars hexadecimal string
This is the data integrity protection hash string.
StatCode
2-digit numeric
00 = Success
11 = Failure
22 = Pending
StatName
alphanumeric
Success: captured, settled, authorized
Failure: failed, cancelled, chargeback, release, reject/hold, blocked, ReqCancel, ReqChargeback
Pending: Pending, Unknown
Currency
3 chars ISO-4217 currency code
The payment currency. E.g. MYR, USD, EUR, AUD, SGD, CNY, IDR
ErrorCode
alphanumeric
Error code defined by channel for failed transactions only
Formula of Skey & VrfKey
Example of Direct Status Requery for PHP
Example of Response
StatCode=00
StatName=captured
TranID=65234
Amount=3899.00
Domain=shopA
Channel=fpx
VrfKey=456cf69e5bddfe8ed47371096
Currency=MYR
ErrorCode=
ErrorDesc=
$_POST [StatCode] => “00”;
$_POST [StatName] => “captured”;
$_POST [TranID] => “65234”;
$_POST [Amount] => “3899.00”;
$_POST [Domain] => “shopA”;
$_POST[Channel] => “fpx”;
$_POST[VrfKey:]=> “456cf69e5bddfe8ed47371096”;
$_POST[Currency] => “MYR”;
$_POST[ErrorCode] => “”;
$_POST[ErrorDesc] => “”;
Indirect Status Requery
There are several types of status requery on PG system:-
Query by unique transaction ID (recommended)
Query by order ID & get latest matched result (single output) (not recommended)
Query by order ID & get all matched results (batch output) (strongly not recommended)
Query by multiple order ID (batch output) (strongly not recommended)
Query by multiple transaction ID (batch output) (strongly not recommended)
*For bulk requery, best practice is to utilize the 4th or 5th APIs once every half an hour for unknown status transactions only
Note : No result available for transaction more than 7 days.
1. Query by unique transaction ID
Request
Method: POST or GET
*Request & Response parameters are the same as Direct Status Requery but the format and parameters order of the responses are slightly different.
merchantID
alphanumeric, 32 chars
Merchant ID in PG system.
amount
2 decimal points numeric value
The payment amount
txID
integer, 10 digits
Unique transaction ID for tracking purpose.
domain
alphanumeric, 32 chars
Merchant ID in PG system.
skey
32 chars hexadecimal string
This is the data integrity protection hash string.
url
Conditional , URL for POST response
The URL to receive POST response from PG, it is mandatory for type=1
type
optional, 1-digit integer
0 = plain text result (default)
1 = result via POST method
req4token
optional, 1-digit integer
0 = No (default)
1 = Yes for more card related information
Sample Request
Example of Response
StatCode: 00 StatName: captured TranID: 10645406 Amount: 138.99 Domain: ShopB VrfKey: 9862acf1099b625c00b225887e715861 Channel: credit
OrderID: ABC123
Currency: MYR
ErrorCode:
ErrorDesc:
$_POST [StatCode] => “00”;
$_POST [StatName] => “captured”;
$_POST [TranID] => “10565234”;
$_POST [Amount] => “3899.00”;
$_POST [Domain] => “shopC”;
$_POST[VrfKey:] => “456cf69e5bddfe8ed47371096”;
$_POST[Channel] => “credit”;
$_POST[OrderID] => “ABC123”;
$_POST[Currency] => “MYR”;
$_POST[ErrorCode] => “”;
$_POST[ErrorDesc] => “”;
2. Query by order ID (single output)
Request
URL: https://api.e2pay.co.id/RMS/query/q_by_oid.php
Method: POST or GET
amount
2 decimal points numeric value
The payment amount
oID
alphanumeric, 32 chars
Merchant order ID, which might be duplicated.
domain
alphanumeric, 32 chars
Merchant ID in PG system.
skey
32 chars hexadecimal string
This is the data integrity protection hash string.
url
Conditional , URL for POST response
The URL to receive POST response from PG, it is mandatory for type=1
type
optional, 1-digit integer
0 = plain text result (default)
1 = result via POST method
req4token
optional, 1-digit integer
0 = No (default)
1 = Yes for more card related information
Response
StatCode
2-digit numeric
00 = Success
11 = Failure
22 = Pending
StatName
alphanumeric
Success: captured, settled, authorized
Failure: failed, canceled, chargeback, release, reject/hold, blocked, ReqCancel, ReqChargeback
Pending: Pending, Unknown
OrderID
alphanumeric, 32 chars
Invoice or order number from merchant system.
Amount
2 decimal points numeric value
The payment amount
TranID
integer, 10 digits
Unique transaction ID for tracking purpose.
Domain
alphanumeric, 32 chars
Merchant ID in PG system.
BillingDate
date (YYYY-MM-DD HH:mm:ss)
Transaction date/time
BillingName
alphanumeric, 128 chars
Buyer full name
VrfKey
32 chars hexadecimal string
This is the data integrity protection hash string.
Channel
alphanumeric, 100 chars
Payment via channel
Currency
3 chars ISO-4217 currency code
The payment currency. E.g. MYR, USD, EUR, AUD, SGD, CNY, IDR
ErrorCode
alphanumeric
Error code defined by channel for failed transactions only
ErrorDesc
alphanumeric
Error description defined by channel for failed transactions only
token
optional, with req4token=1
Card payment only: if PAN has been tokenized
ccbrand
optional, with req4token=1
Card payment only: Visa, MasterCard, AMEX
cclast4
optional, 4-digit numeric with req4token=1
Card payment only: Last 4-digit of PAN
cctype
optional, with req4token=1
Card payment only: Credit, Debit, Prepaid
Formula of Skey & VrfKey
3. Query by order ID (batch output)
Request
URL: https://api.e2pay.co.id/RMS/query/q_oid_batch.php
Method: POST or GET
oID
alphanumeric, 32 chars
Merchant order ID, which might be duplicated.
domain
alphanumeric, 32 chars
Merchant ID in PG system.
skey
32 chars hexadecimal string
This is the data integrity protection hash string.
url
optional, URL for POST response
The URL to receive POST response from PG
type
optional, 1-digit integer
0 = plain text result (default)
1 = result via POST method
format
optional, 1-digit integer, for type=1 only
0 = result string with delimiter ( | )
1 = result in array
req4token
optional, 1-digit integer
0 = No (default)
1 = Yes for more card related information
Response
TranID
integer, 10 digits
Unique transaction ID for tracking purpose.
BillingDate
date (YYYY-MM-DD HH:mm:ss)
Transaction date
StatCode
2-digit numeric
00 = Success
11 = Failure
22 = Pending
StatName
alphanumeric
Success: captured, settled, authorized
Failure: failed, cancelled, chargeback, release, reject/hold, blocked, ReqCancel, ReqChargeback
Pending: Pending, Unknown
Amount
2 decimal points numeric value
The payment amount
BillingName
alphanumeric, 128 chars
Buyer full name
Currency
3 chars ISO-4217 currency code
The payment currency. E.g. MYR, USD, EUR, AUD, SGD, CNY, IDR
ErrorCode
alphanumeric
Error code defined by channel for failed transactions only
ErrorDesc
alphanumeric
Error description defined by channel for failed transactions only
token
optional, with req4token=1
Card payment only: if PAN has been tokenized
ccbrand
optional, with req4token=1
Card payment only: Visa, MasterCard, AMEX
cclast4
optional, 4-digit numeric, with req4token=1
Card payment only: Last 4-digit of PAN
cctype
optional, with req4token=1
Card payment only: Credit, Debit, Prepaid
Formula of skey
Example of Response
type=0,
plain text output, newline with single or two TAB character(s)
TranID BillingDate StatCode StatName Amount BillingName Currency ErrorCode ErrorDesc
418607 2009-11-26 22 pending 25.00 Lenka IDR
418603 2009-11-26 00 captured 125.10 Mika IDR
418583 2009-11-26 00 captured 71.10 Ciara IDR
type=1, format=0,
POST variables with delimiter “|”
$_POST[TranID] = “418607|418603|418583”;
$_POST[BillingDate] = “2009-11-26|2009-11-26|2009-11-26”;
$_POST[StatCode] = “22|00|00”;
$_POST[StatName] = “pending|captured|captured”;
$_POST[Amount] = “25.00|125.10|71.10”;
$_POST[BillingName] = “Lenka|Mika|Ciara”;
$_POST[Currency] = “IDR|IDR|IDR”;
$_POST[ErrorCode] = “||”;
$_POST[ErrorDesc] = “||”;
type=1, format=1,
POST variables in array
$_POST[0][TranID] = “418607”;
$_POST[0][BillingDate] = “2009-11-26”;
$_POST[0][StatCode] = “22”;
$_POST[0][StatName] = “pending”;
$_POST[0] [Amount] = “25.00”;
$_POST[0] [BillingName] = “Lenka”;
$_POST[0] [Currency] = “IDR”;
$_POST[0] [ErrorCode] = “”;
$_POST[0] [ErrorDesc] = “”;
$_POST[1] [TranID] = “418603”;
$_POST[1] [BillingDate] = “2009-11-26”;
$_POST[1] [StatCode] = “00”;
$_POST[1] [StatName] = “captured”;
$_POST[1] [Amount] = “125.10”;
$_POST[1] [BillingName] = “Mika”;
$_POST[1] [Currency] = “IDR”;
$_POST[1] [ErrorCode] = “”;
$_POST[1] [ErrorDesc] = “”;
$_POST[2] [TranID] = “418583”;
$_POST[2] [BillingDate] = “2009-11-26”;
$_POST[2] [StatCode] = “00”;
$_POST[2] [StatName] = “captured”;
$_POST[2] [Amount] = “71.10”;
$_POST[2] [BillingName] = “Ciara”;
$_POST[2] [Currency] = “IDR”;
$_POST[2] [ErrorCode] = “”;
$_POST[2] [ErrorDesc] = “”;
*If you find Example Type One is unclear
type=0,
plain text output, newline with single or two TAB character(s)
TransID 418607 418603 418583
BillingDate 2009-11-26 2009-11-26 2009-11-26
StatCode 22 20 00
StatName pending captured captured
Amount 25.00 125.10 71.10
BillingName Lenka Mika Ciara
Currency IDR IDR IDR
ErrorCode
ErrorDesc
4. Query by multiple order ID (batch output)
Request
URL: https://api.e2pay.co.id/RMS/query/q_by_oids.php
Method: POST or GET
oIDs
alphanumeric, up to 100 orders
Merchant order ID, must be URLencoded.
delimiter
single character, default is “|”
Avoid using any symbol that might exist in order ID, and also any of these: “,%, *, <, >, ? , \, $, &, =
domain
alphanumeric, 32 chars
Merchant ID in PG system.
skey
32 chars hexadecimal string
This is the data integrity protection hash string.
url
optional, URL for POST response
The URL to receive POST response from PG
type
optional, 1-digit integer
0 = plain text result (default)
1 = result via POST method
format
optional, 1-digit integer, apply for type=1 only
result string with TAB-newline (default)
0 = result string with delimiter ( | )
1 = result in array
req4token
optional, 1-digit integer
0 = No (default)
1 = Yes for more card related information
Response
OrderID
alphanumeric, 32 chars
Merchant order ID for tracking purpose.
TranID
integer, 10 digits
Unique transaction ID for tracking purpose.
BillingDate
date (YYYY-MM-DD HH:mm:ss)
Transaction date
StatCode
2-digit numeric
00 = Success
11 = Failure
22 = Pending
StatName
alphanumeric
Success: captured, settled, authorized
Failure: failed, cancelled, chargeback, release, reject/hold, blocked, ReqCancel, ReqChargeback
Pending: Pending, Unknown
Amount
2 decimal points numeric value
The payment amount
BillingName
alphanumeric, 128 chars
Buyer full name
VrfKey
32 chars hexadecimal string
This is the data integrity protection hash string.
Channel
alphanumeric, 100 chars
Payment via channel
Currency
3 chars ISO-4217 currency code
The payment currency. E.g. MYR, USD, EUR, AUD, SGD, CNY, IDR
ErrorCode
alphanumeric
Error code defined by channel for failed transactions only
ErrorDesc
alphanumeric
Error description defined by channel for failed transactions only
token
optional, with req4token=1
Card payment only: if PAN has been tokenized
ccbrand
optional, with req4token=1
Card payment only: Visa, MasterCard, AMEX
cclast4
optional, 4-digit numeric, with req4token=1
Card payment only: Last 4-digit of PAN
cctype
optional, with req4token=1
Card payment only: Credit, Debit, Prepaid
Formula of Skey and VrfKey
Example of response
type=1
format=1
[oid1] => Array
(
[TranID] => 9994238
[BillingDate] => 2016-11-28 16:32:08
[StatCode] => 00
[StatName] => captured
[Amount] => 30.00
[BillingName] => kimyoon
[VrfKey] => 311d72c16e0d3b3fc7994ae93467a2d9
[Channel] => credit
[Currency] => IDR
[ErrorCode] =>
[ErrorDesc] =>
)
[oid2] => Array
(
[TranID] => 10004613
[BillingDate] => 2016-11-29 09:56:02 [StatCode] => 11 [StatName] => failed [Amount] => 58.00 [BillingName] => MohdAli [VrfKey] => f9f06b47e23410e624df5e272accb27dc [Channel] => e2Pay_DANA
[Currency] => IDR
[ErrorCode] =>
[ErrorDesc] =>
)
...
[oidN] => Array
(
[TranID] => -
[BillingDate] => -
[StatCode] => -
[StatName] => -
[Amount] => -
[BillingName] => -
[VrfKey] => -
[Channel] => -
[Currency] => -
[ErrorCode] => -
[ErrorDesc] => -
)
type=1
format=0
delimiter=|
[OrderID] => oid1|oid2|...|oidN
[TranID] => 9994238|10004613|...|-
[BillingDate] => 2016-11-28 16:32:08|2016-11-29 09:56:02|...|-
[StatCode] => 00|11|...|-
[StatName] => captured|failed|...|-
[Amount] => 30.00|58.00|...|-
[BillingName] => Nurbaizura|KUMARASAN|...|-
[VrfKey] => 311d72c16e0d3b3fc7994ae93467a2d9|f9f06b47e23410e624df5e272accb27dc|...|-
[Channel] => mb2u|fpx|...|-
[Currency] => IDR|IDR|...|-
[ErrorCode] => ||...|-
[ErrorDesc] => ||...|-
5. Query by multiple transaction ID (batch output)
Request
URL: https://api.e2pay.co.id/RMS/query/q_by_tids.php
Method: POST or GET
tIDs
concatenated transaction ID with “|” up to 100 items
A group of transaction ID, must be URLencoded
domain
alphanumeric, 32 chars
Merchant ID in PG system
skey
32 chars hexadecimal string
This is the data integrity protection hash string
url
optional, URL for POST response
The URL to receive POST response from PG
type
optional, 1-digit integer
0 = plain text result (default)
1 = result via POST method
format
optional, 1-digit integer, apply for type=1 only
0 = result string with delimiter ( | )
1 = result in array
req4token
optional, 1-digit integer
0 = No (default)
1 = Yes for more card related information
Response
Variable / Parameter
Type Format / Max Length
Description / Example
TranID
integer, 10 digits
Unique transaction ID for tracking purpose.
Amount
2 decimal points numeric value
The payment amount
BillingDate
date (YYYY-MM-DD HH:mm:ss)
Transaction date
BillingName
alphanumeric, 128 chars
Buyer full name
VrfKey
32 chars hexadecimal string
This is the data integrity protection hash string.
StatCode
2-digit numeric
00 = Success
11 = Failure
22 = Pending
StatName
alphanumeric
Success: captured, settled, authorized
Failure: failed, cancelled, chargeback, release, reject/hold, blocked, ReqCancel, ReqChargeback
Pending: Pending, Unknown
OrderID
alphanumeric, 32 chars
Merchant order ID for tracking purpose.
Currency
3 chars ISO-4217 currency code
The payment currency. E.g. MYR, USD, EUR, AUD, SGD, CNY, IDR
ErrorCode
alphanumeric
Error code defined by channel for failed transactions only
ErrorDesc
alphanumeric
Error description defined by channel for failed transactions only
token
optional, with req4token=1
Card payment only: if PAN has been tokenized
ccbrand
optional, with req4token=1
Card payment only: Visa, MasterCard, AMEX
cclast4
optional, 4-digit numeric, with req4token=1
Card payment only: Last 4-digit of PAN
cctype
optional, with req4token=1
Card payment only: Credit, Debit, Prepaid
Formula of skey and VrfKey
Daily Transaction Report (Reconciliation)
PG Daily Transaction Report provides merchant end-of-day (EoD) reconciliation or to verify all transactions for a specific date.
Request
URL: https://api.e2pay.co.id/RMS/API/PSQ/psq-daily.php
Method: POST or GET
merchantID
alphanumeric, 32 chars
Merchant ID in PG system.
skey
32 chars hexadecimal string
This is the data integrity protection hash string.
rdate
date (YYYY-MM-DD) or date(YYYY-MM-DD HH:ii:ss)
The date or beginning time of transactions to query
2020-10-10 or 2020-10-10 07:11:24
rduration
optional, second in numeric
Without rduration, the search duration is 24 hours or 86400 seconds starting from rdate
status
optional, alphanumeric, 32 chars
00 - success
11 - failed
22 - pending
Combine with delimiter “|” for multiple status or left empty for all status.
version
version
2 or 3
additional_fields
[New from Version 2]
optional, predefined tags
BillingEmail - billing email
TransactionRate - transaction rate
BillingInfo - billing info
TransactionCost - transaction cost
Channel - channel
BillingMobileNumber - billing mobile
TransactionFee - transaction fee
GST - GST (tax)
NetAmount - net amount
IPAddress - IP address
BankName - bank name
BIN - card no (hidden)
ExpiryDate - card expiry date
StatusDescription - status description
SettlementDate - settlement date
PaidDate - paid date
TerminalID - terminal ID
PayTransactionID - transaction ID
BuyerName - buyer name CaptureRefID - Capture Reference ID (Only in v3) RefundRefID - Refund Reference ID (Only in v3)
all - for all additional fields
Combine with delimiter “,” for multiple fields
response_type [New from Version 2]
optional
Response format in either text/json/csv(only in v2 and v3)
Formula of Skey
Response
(plain text with newline & TAB characters)
BillingDate
date/time (YYYY-MM-DD HH:mm:ss)
Transaction date/time
OrderID
alphanumeric, 32 chars
Invoice or order number from merchant system.
TranID
integer, 10 digits
Unique transaction ID for tracking purpose.
Channel
Predefined string in PG system
Channel references for the merchant system.
Amount
2 decimal points numeric value
The payment amount
StatCode
2-digit numeric
00 = Success
11 = Failure
22 = Pending
StatName
word
Success: captured, settled, authorized
Failure: failed, cancelled, chargeback, release, reject/hold, blocked, ReqCancel, ReqChargeback
Pending: Pending, Unknown
BillingName
alphanumeric, 128 chars
Buyer full name
ServiceItem
text
Billing Information / Description (newline will be replaced by whitespace)
Additional fields:
BillingEmail
TransactionRate
TransactionCost
BillingMobileNumber
TransactionFee
GST
NetAmount
IPAddress
BankName
ExpiryDate
StatusDescription
SettlementDate
PaidDate
TerminalID PayTransactionID BuyerName
text (default) or JSON string
BillingEmail = ABC@e2pay.co.id
TransactionRate = 0.0290
TransactionCost = 0.0000
BillingMobileNumber = 0123456789
TransactionFee = 100.0
GST = 0
NetAmount = 1900.0
IPAddress = 192.168.0.1
BankName = unknownbank
ExpiryDate = 2020
StatusDescription = This is status description
SettlementDate = 2020-05-26 10:51:51
PaidDate = 2020-05-31 10:51:51
TerminalID = 999
Void Pending-Cash API
For merchants to cancel and void the cash payment request order, before getting paid or the expiry time, and force-to-expired.
Request
URL: https://api.e2pay.co.id/RMS/API/VoidPendingCash/index.php
Method: POST or GET
tranID
n{1..10}
M
PG Transaction ID
amount
n{10,2}
M
The total amount to be paid in one purchase order. 2 decimal points, comma( , ) is not allowed.
merchantID
an{1..32}
M
Merchant ID provided by PG
checksum
an{32}
M
This is request integrity protection hash string.
Checksum= md5( tranID . amount . merchantID . verify_key )
Response
PG responds JSON format to merchant upon a successful request
StatCode
n{2}
M
00 = Success (voided)
11 = Missing required parameter (<FieldName>).
12 = Merchant info not found
13 = Invalid checksum value.
14 = Transaction not found
15 = Transaction not Pending
99 = System is busy now, temporary out of services. Please try again later.
tranID
n{1..10}
O
PG Transaction ID
orderid
an{1..32}
O
Merchant order
amount
n{10,2}
O
The total amount to be paid in one purchase order
merchantID
an{1..32}
O
Merchant ID provided by PG
channel
an{1..32}
O
Channel references for the merchant system
Last updated