Balance Change Notification (IPN)
When receiving any transaction belonging to a bank account managed by the Merchant, SePay will notify the Merchant by calling the balance change notification API (IPN) that the Merchant provided earlier.
The Merchant can freely choose the path structure to receive balance change notifications and notify SePay to configure the integration.
IPN JSON Payload Format
{
"gateway": "string",
"transaction_date": "Y-m-d H:i:s",
"account_number": "string",
"bank_account_xid": "string",
"va": "string | null",
"payment_code": "string | null",
"content": "string",
"transfer_type": "credit | debit",
"amount": "number",
"reference_code": "string",
"accumulated": "number",
"transaction_id": "string"
}IPN JSON Description
gatewaystringGateway name that executed the transaction. Example: MBBank, OCB.
transaction_datestringTransaction received time (ISO 8601 or timestamp).
account_numberstringBank account number.
bank_account_xidstringCorresponding bank account ID in the system.
vastring | nullVirtual Account number, if applicable.
payment_codestring | nullPayment code, if applicable.
contentstringTransaction content/description.
transfer_typestringTransaction type: credit (incoming) or debit (outgoing).
amountnumberTransaction amount (non-negative number).
reference_codestring | nullFT reference code.
accumulatednumberBalance after transaction (currently not supported, default = 0).
transaction_idstringTransaction ID.
Response Requirements
- Response content with
Content-Typeasapplication/json - JSON fragment format:
{
"success": true
}Security Requirements
- The IPN URL provided by the Merchant must support SSL
- By default, SePay calls the Merchant's IPN with an
Authorizationheader with valueApikey {API_KEY}, where{API_KEY}is the security key that SePay will provide to the Merchant beforehand. The Merchant can verify the correctness of theAuthorizationheader to confirm that the request is from SePay. - Alternatively, the Merchant can filter the calling IP address. SePay will provide IP addresses for the Merchant to add to the whitelist.
- Or the Merchant can apply both security layers above.
Conditions for SePay to Send IPN Notifications to Merchant
For a company (organization) under Merchant management to receive IPN notifications from SePay, the following conditions must be met:
- The company (organization) owning the receiving bank account must be in Active status (
status: Activeandactive: 1). See more at API to query company (organization) details. - The
transaction_amountconfiguration of the company (organization) owning the payment receiving bank account must have a value greater than 0 or valueUnlimited. See more at API to query company (organization) configuration.
Retry Mechanism
SePay will retry notifying new transactions to the Merchant's IPN if and only if a network error occurs (network connection failure). The retry interval is in minutes, increasing according to the Fibonacci sequence.
- Maximum retry attempts: 7 times
- Maximum duration: 5 hours from the first failed call
- SePay's network connect timeout: 5 seconds
- SePay's maximum response wait time: 8 seconds
Transaction Deduplication Requirements
To avoid transaction duplication when issues occur with merchant's IPN connection during the retry mechanism, SePay recommends merchants implement transaction deduplication when receiving transaction change notifications from SePay through IPN
Next Steps
After configuring IPN successfully, you can:
- Webhook Events - Receive notifications for account linking/unlinking events
- Transaction List API - Query transaction history
- Transaction Detail API - View specific transaction details
- Update Webhook API - Manage webhook configuration
Ensure you handle transaction deduplication by checking transaction_id before processing IPN.