Tagih.id

Payment Notification

Payment Notification is a service that Espay uses to notify you that an invoice payment has been successfully made. You must respond in the specified format and register your Payment Notification URL in the Espay Sandbox Portal.

Flow

Whenever an invoice payment is successfully collected, Tagih.id will send a request to your server via the Payment Notification URL registered in the Espay Sandbox Portal. You are required to respond in JSON format using the format provided.

API URL

Method URL
HTTPS
https://yourwebsite.com/payment

HTTP Headers

Key Value
Method
POST
HTTP Version
HTTP/1.1
Accept
*/*
Content-Type
application/x-www-form-urlencoded
Content-Length
<dynamic>

Parameter Request

Parameter Type Mandatory Description
rq_uuid
String (64)
Y
Request identifier. A unique ID used to identify messages

Format:
UUID V.4 Recommendation
rq_datetime
String
Y
Date and time of the transaction request.

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

Format:
2024-03-14 07:49:28
password
String (32)
Y
Password from Espay team. Merchant uses the password to identify and validate request.
member_code
String (32)
Y
Member code.
comm_code
String (32)
Y
Merchant region code.

Example:
SGWYESSISHOP
trx_id
String (16)
Y
Transaction ID from Espay.
trx_date
String
Y
Transaction date and time.

Format:
Y-m-d H:i:s

Example:
2024-12-16 14:30:45
total_amount
String (13.2)
Y
Total amount has been collected.

Format:
250000
outstanding_amount
String (13.2)
Y
Total outstanding amount.

Format:
150000
invoice
JSON
Y
Invoice details.
collector
String (50)
Y
Collector identity.
pay_type
String (10)
Y
Payment type.
signature
String
Y
Code used to validate transactions. Learn how to make a Tagih.id | Hash-Based Signature.
Y: Yes, O: Optional, C: Conditional

Parameter Response

Parameter Type Mandatory Description
rq_uuid
String (64)
Y
Request identifier. A unique ID used to identify messages
rs_datetime
String
Y
Date and time of the transaction response.

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

Format:
2024-03-14 07:49:28
error_code
String (4)
Y
Response code:

Format:
  • Success: 0000
  • Failure: XXXX
error_message
String
Y
Response description.
trx_id
String (16)
Y
Transaction ID from Espay.
reconcile_id
String (20)
Y
Reconciliation ID. Used to confirm that the partner has successfully received the notification.
reconcile_datetime
String
Y
Reconciliation date and time.

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 /rest/tagih/merchantpaymentnotif HTTP/1.1
Host: sandbox-api.espay.id
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Accept: */*


rq_uuid=4445a53b-4bac-4159-ac69-f02149f53302&
rq_datetime=2021-06-23 13:29:49&
password=y1eh1rg&
comm_code=SGWMERCHANTTGR&
trx_id=ESP162442973 2I2O3&
trx_date=2021-06-23 13:29:49&
total_amount=4000&
outstanding_amount=4000&
invoice={
    "invoice number": "21190633",
    "0020510494": "442055",
    "0020510495": "5175625",
    "0020510496": "22982074",
    "0020510497": "11032255",
    "0020510498": "157317",
    "20210004046882": "-74171",
    "20210004046883": "-18052",
    "20210004046884": "-1272000",
    "20210004046885": "-4033000",
    "20210004046886": "-1250000",
    "20210004046887": "-2500000",
    "20210004046888": "-2250000",
    "20210004048138": "-600000",
    "20210004048139": "-2092934",
    "20210004048140": "-600000",
    "20210004048141": "-1597893",
    "20210004048168": "-550000"
}&
[email protected]&
pay_type=cash&
signature=437cd81ccdc09d0f2776bfdf5cdc5f13419b9566fb6ffb5e20af18742db27b98
             
























Sample Response

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




CURL

...
           





Scroll to Top