Payment Notification

Payment is a service Espay Payment Gateway uses to notify you that your customer’s payment has been successfully made. You are asked to respond according to the format provided and register your Payment URL on the Espay Sandbox Portal.

Flow

Every time your customer completes a payment, the Espay Payment Gateway sends a request to your server via the Payment URL registered on the Espay Sandbox Portal. You are required to respond in JSON using the provided format.

HTTP Headers

Key Value
Method
HTTP Post
Connection
keep-alive
Content-Length
250
Content-Type
application/json
Accept
*/*

API URL

Method URL
HTTP
http://www.yourwebsite.com/payment.php
HTTPS
https://www.yourwebsite.com/payment.php

Request Parameters

Parameter Type Mandatory Description
rq_uuid
String (64)
Y
Request identifier. A unique ID used to identify messages.
rq_datetime
String (19)
Y
Date and time of the transaction request from the merchant's server.
password
String (32)
O
Password from Espay team.
signature
String (64)
Y
Code used to validate transactions. Learn Payment Gateway | Hash-Based Signature.
member_id
String (20)
O
Merchant code from Espay team.
comm_code
String (32)
Y
Merchant code from Espay team.

Example:
SGWYESSISHOP
order_id
String (20)
Y
Unique code to identify the order/billing/invoice.

Example:
Transaction number, invoice ID, etc.
ccy
String (3)
Y
Transaction currency code.

Format:
  • Rupiah: IDR
amount
String (13.2)
Y
Paid amount.

Format:
Decimal .00

Example: 150000.00
debit_from_bank
String (20)
Y
Destination account bank code.

Example:
008, 016, 002, etc.
debit_from
String (19)
O
Source account (debited account).
debit_from_name
String (64)
O
Source account name.
credit_to_bank
String (20)
Y
Source account bank code.

Example :
008/016/002/etc.
credit_to
String (19)
O
Destination account (credited account).
credit_to_name
String (64)
O
Destination account name.
product_code
String (32)
Y
Product code. See product codes here.
product_value
String (64)
O
Product number.

Example:
  • Tipe Kartu: VISA
  • Bank Acquirer: MANDIRI VISA
  • Bin / Acquirer Code: 002
  • Masked Card Number: 411111xxxxxx1111
card_expiry
String (6)
O
Credit card expiration date.

Format:
YYYYMM

Example:
202512
message
String (32)
O
Additional information.
payment_datetime
String (19)
Y
The date and time of the payment recorded in the Espay system.

Format:
YYYY-MM-DD hh:mm:ss
payment_ref
String (20)
Y
Transaction ID from Espay.
approval_code_full_bca
String (4)
C
Approval code from BCA. Mandatory for transactions using BCA debit cards.
approval_code_installment_bca
String (4)
C
Approval code from BCA. Mandatory for transactions using BCA debit cards.
Y: Yes, O: Optional, C: Conditional

Response Parameters

Parameter Type Mandatory Description
rq_uuid
String (64)
Y
Request identifier. A unique ID used to identify messages.
rs_datetime
String (19)
Y
Date and time of the transaction response from the merchant server.
error_code
String (4)
Y
Response code.

Format:
  • 0 or 0000:
    Validation process on the merchant side succeeded (Successful).
  • Other codes:
    The validation process on the merchant’s side Unsuccessful (Failed).
error_message
String(32)
Y
Response description.
signature
String (64)
Y
Code used to validate transactions. Learn Payment Gateway | Hash-Based Signature.
order_id
String (20)
Y
Unique code to identify the order/billing/invoice.

Example:
Transaction number, invoice ID, etc.
reconcile_id
String (20)
Y
ID Rekonsiliasi sebagai bukti konfirmasi bahwa merchant telah berhasil menerima notifikasi.

Format:
String atau angka
reconcile_datetime
String (19)
Y
Tanggal dan waktu rekonsiliasi.

Format:
yyyy-MM- ddThh:mi:ssTZD (ISO 8601).

Example:
2022-08-21T14:56:11+07:00
Y: Yes, O: Optional, C: Conditional

URL Registration

Ensure your URL format and response comply with this documentation guidelines. Next, immediately register your Payment URL via the Espay Sandbox portal. Read how to add a URL here.




































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

{
  "rq_uuid": "ebf8e9df-639e-424f-8148-94d2741edd03",
  "rs_datetime": "2024-04-01T22:55:14+07:00",
  "error_code": "0000",
  "error_message": "Success",
  "signature": "952b489cc6bb70fca23cbb0716f1f9bbb5c9c5918056427ed8d375ebb9ff0f18",
  "order_id": "ESPTRX21183111",
  "reconcile_id": "2020100121183111",
  "reconcile_datetime": "2024-04-01T22:56:14+07:00"
}
              


Sample Response Negative

{
  "rq_uuid":"ebf8e9df-639e-424f-8148-94d2741edd03",
  "rs_datetime":"2024-04-01T22:55:14+07:00",
  "error_code":"0014",
  "error_message":"invalid order id"
}
              


CURL


curl --location 'https://yourwebsite.xyz//payment' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'rq_uuid=ebf8e9df-639e-424f-8148-94d2741edd03' \
--data-urlencode 'rq_datetime=2024-04-01T22:55:14+07:00' \
--data-urlencode 'password=ServicePassword' \
--data-urlencode 'signature=e8666bc49b291c3cb49808dd2e4cf05efeaaae3db49045ad420c3b6d393dc76c' \
--data-urlencode 'member_id=' \
--data-urlencode 'comm_code=SGWDIGALLERY' \
--data-urlencode 'order_id=ESPTRX21183111' \
--data-urlencode 'ccy=IDR' \
--data-urlencode 'amount=150000.00' \
--data-urlencode 'debit_from_bank=014' \
--data-urlencode 'debit_from=2731726215' \
--data-urlencode 'debit_from_name=PaulWeller' \
--data-urlencode 'credit_to_bank=014' \
--data-urlencode 'credit_to=5250287544' \
--data-urlencode 'credit_to_name=SteveMarriott' \
--data-urlencode 'product_code=KLIKPAY' \
--data-urlencode 'card_expiry=202512' \
--data-urlencode 'message=' \
--data-urlencode 'payment_datetime=2024-04-01T22:55:14+07:00' \
--data-urlencode 'payment_ref=338746162U313G' \
--data-urlencode 'approval_code_full_bca=' \
--data-urlencode 'approval_code_installment_bca='
           
Scroll to Top