Settlement Notification

Settlement Notification is a service Espay Payment Gateway uses to inform your system that the bill has been paid.

Flow

Each time a bill is settled, Espay Payment Gateway will send a request to your server via the Settlement Notification URL you have registered on the Espay Sandbox Portal. You must respond to this request using the JSON format provided.
Key Value
Method
HTTP Post
Connection
keep-alive
Content-Length
250
Content-Type
application/x-www-form-urlencoded
Accept
*/*

API URL

Description URL Merchant Endpoint
HTTP
http://yourdomain.com
.../api/espay/settlementnotification
HTTP
https://yourdomain.com
.../api/espay/settlementnotification

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 Espay server.

Format:
yyyy-MM-dd hh:mi:ss

Example:
2024-03-14 07:49:28
receiver_id
String (10)
Y
Merchant community code is registered with Espay.
password
String (20)
Y
Merchant password set by Espay.
data
JSON
Y
   tx_id
String (20)
Y
Transaction ID from Espay.
   payment_id
String (50)
Y
Unique ID for payments from Espay.
   settlement_amount
String (19)
Y
Total settlement.

Format:
Desimal .00 (ISO 4217)

Example:
150000.00
   settlement_date
String (19)
Y
Settlement date.

Format:
yyyy-MM-dd

Example:
2024-03-14
   settlement_remark
String (50)
Y
Settlement description.
comm_code
String (10)
Y
Merchant code from Espay team.

Example:
SGWYESSISHOP
settlement_fee
String (16.2)
Y
Settlement fee.

Format:
Desimal .00 (ISO 4217)

Example:
5000.00
bank_ref
String (32)
Y
Bank reference number.
amount
String (16.2)
Y
Total settlement amount

Format:
Desimal .00 (ISO 4217)

Example:
5000.00
count_trx
String (16.2)
Y
Total count of transaction.

Format:
Desimal .00 (ISO 4217)

Example:
150000.00
signature
String (64)
Y
Code used to validate transactions. Learn signature
Y: Yes, O: Optional, C: Conditional

Response Parameter

Parameter Type Mandatory Description
error_code
String (4)
Y
Response Code.

Format:
  • 0000: The validation process on the merchant side was successful.
  • Other code: The Validation process on the merchant side failed.
error_message
String (32)
Y
Response description.
settlement_remark
String (255)
O
Settlement description.
date_settle
String (19)
Y
Date and time of the Espay system.

Format:
yyyy-MM-dd hh:mi:ss

Example:
2024-03-14 07:49:28
Y: Yes, O: Optional, C: Conditional

URL Registration

Ensure that the URL format and the response you create comply with the guidelines in this documentation. Next, immediately register your Settlement Notification URL via Espay Sandbox portal. Read how to add a URL here.



































Sample Request

Host: payment.daftarsekolah.com
Accept: */*
User-Agent: ESPay WebServices (Pembayaran Lintas Usaha Sukses, PT) Content-Length: 541
Content-Type: application/x-www-form-urlencoded
             
rq_uuid=9f75543e-4684-4d06-a8a2-870b9d0f8830
&rq_datetime=2021-09-28 09:30:09
&sender_id=GOWORLDPG
&receiver_id=SGWBARKAHPANGHURIANSC
&password=FHNGNYDB &data=[{"tx_id":"ESP1632751045TRBI","payment_id":"NNN0002021092700006","settl ement_amount":"50000.00","settlement_date":"2021-09- 28","settlement_remark":"SGWBA2709270921YNQ"}] &comm_code=SGWBARKAHPANGHURIANSC
&settlement_fee=7000.00 
&bank_ref=permata
&amount=50000
&count_trx=1 &signature=4b31a51eca1sbdb9d86677da522d8d0f3d882d3c0
       































































Sample Response

{
    "error_code":"0000", 
    "error_message":"Success", 
    "settlement_remark":"notes here", 
    "date_settle":"2021-10-17 12:30:45"
}
             












CURL

curl --location 'https://digallery-me.xyz/api/espay/settlementnotification' \
--header 'Content-Length: 250' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'rq_uuid=9f75543e-4684-4d06-a8a2-870b9d0f8830' \
--data-urlencode 'rq_datetime=2024-03-14 07:49:28' \
--data-urlencode 'receiver_id=SGWDIGALLERY' \
--data-urlencode 'password=sgwdigallery!' \
--data-urlencode 'data=[{"tx_id":"ESP1632751045TRBI","payment_id":"NNN0002021092700006","settl ement_amount":"50000.00","settlement_date":"2021-09- 28","settlement_remark":"SGWBA2709270921YNQ"}]' \
--data-urlencode 'comm_code=FHNGNYDB' \
--data-urlencode 'settlement_fee=5000.00' \
--data-urlencode 'bank_ref=permata' \
--data-urlencode 'amount=50000.00' \
--data-urlencode 'count_trx=5' \
--data-urlencode 'signature=4b31a51eca1sbdb9d86677da522d8d0f3d882d3c0'
           
Scroll to Top