Payment Notification

When customers have completed the payment, Espay system directly notifies merchant’s system about the payment status of the transaction being processed.


Espay system will send the the request and once the merchant receives the request, merchant is expected to respond with comma (,) separator as shown in this template

success_flag,error message,reconcile_id , order_id,reconcile_datetime

Example of success response from merchant side :

0, Success, 0123162509216347301, TOP130123EBS58, 2013-01-23 16:26:00

Example of error response from merchant side :

1, Invalid Order Id,,,

Flow

ESPAY -> Merchant

Method

HTTP Post

API URL

http://www.yourwebsite.com/payment.php or
https://www.yourwebsite.com/payment.php



Parameter Request:
Parameter Name Max Length Mandatory Description
rq_uuid 64 Yes ESPAY request identifier. Unique id for each request
rq_datetime 19 Yes Date and time in ESPAY system when request sent
password 32 No Password used for identification and validation mechanisms by merchant to verify that a request is completely derived from the ESPAY system
signature 64 Yes Request signature, refer to API Signature
member_id 20 No Customer code if registered on ESPAY system
comm_code 32 Yes Merchant code was registered on ESPAY system
order_id 20 Yes Transaction Number / Invoice Id / unique id that identify the order / billing / invoice
ccy 3 Yes Transaction’s currency code. ex: IDR
amount 13.2 Yes Amount paid by the customer
Format : 100000.00
debit_from_bank 20 Yes Bank code of source account. ex:
008/016/002/etc
debit_from 19 No Source accounts (debited account)
debit_from_name 64 No Source account name
credit_to_bank 20 Yes Bank code of source account. ex:
008/016/002/etc
credit_to 19 No Destination account (credited account)
credit_to_name 64 No Destination account name
product_code 32 Yes Product code payment
card_expiry 6 No Credit card expired. Format (YYYYMM)
Example: 202512
message 32 No Additional information of payment
payment_datetime 19 Yes Date and time of payment listed on the ESPAY
application Format : YYYY-MM-DD hh:mm:ss
payment_ref 20 Yes Transaction reference number (used as transaction identity) recorded on the Espay system
approval_code_full_bca 4 No Approval code from BCA if using bca’s debit card transaction
approval_code_installment_bca 4 No Approval code from BCA if using bca’s credit card transaction


Parameter Response:
Parameter Name Max Length Mandatory Description
rq_uuid 64 Yes ESPAY request identifier. Unique id for each request
rs_datetime 19 Yes Response datetone on Merchant system when request sent
error_code 4 Yes Merchant will give the information about the request based on this field.
0 or 0000 = Success, process in merchant side is success
Others = Failed, process in merchant side fails(validation error, business process does not match, or other issues)
error_message 32 Yes If error_code is not Success, please put the message or description of the error on this field
signature 64 Yes Response signature, ESPAY will validate this signature. Refer to API Signature
order_id 20 Yes Transaction Number / Invoice Id / unique id that identifies the order / billing / invoice
reconcile_id 20 Yes Unique string / number as proof of acknowledgment / confirmation that partner has successfully received the notification.
reconcile_datetime 19 Yes Transaction date in merchant’s server Format :
YYYY-MM-DD hh:ii:ss
  

Sample Request:

POST /path/for/notification HTTP/1.1 Host: merchant.domain Connection: keep-alive Content-Length: 250 Content-Type: application/x-www-form-urlencoded Accept: */* rq_uuid=ebf8e9df-639e-424f-8148-94d2741edd03 &rq_datetime=2020-10-01T22:55:14+07:00 &password=ServicePassword &signature=1e6be48271e94f8f08ca0ad52d4ee4c8b1d2155b471a7d34720bcca09d80e220 &member_id=SGWMERCHANT&comm_code=SGWMERCHANT &order_id=ESPTRX21183111 &ccy=IDR &amount=150000.00 &debit_from_bank=014 &debit_from=2731726215 &debit_from_name=PaulWeller &credit_to_bank=014 &credit_to=5250287544 &credit_to_name=SteveMarriott &product_code=KLIKPAY &message= &payment_datetime=2020-10-0124:55:14 &payment_ref=338746162U313G &approval_code_full_bca= &approval_code_installment_bca=
  

Sample Response - Positive Response:

{ Content-Type: application/json { "rq_uuid":"ebf8e9df-639e-424f-8148-94d2741edd03", "rs_datetime":"2020-10-01T22:55:14+07:00", "error_code":"0000", "error_message":"Success", "order_id":"ESPTRX21183111", "reconcile_id":"2020100121183111", "reconcile_datetime":"2020-10-01 22:56:13", "signature": "" }
    

Sample Response - Negative Response:

{ Content-Type: application/json { "rq_uuid":"ebf8e9df-639e-424f-8148-94d2741edd03", "rs_datetime":"2020-10-01T22:55:14+07:00", "error_code":"0014", "error_message":"invalid order id" }