Listen to key events in HitPay including payments, orders and more
If you are using Payment Request APIs, we suggest using the “webhook” parameter and webhook v1
HitPay provides event webhooks that are HTTP post requests triggered after key events that happen on the hitpay platform. These webhooks can be used to build your own automation and processes.
These are the list of events you can listen to
Event Name | When does it trigger? |
---|---|
charge.created | Once a payment is successfully completed |
charge.updated | Once a payment is refunded / partially refunded |
payout.created | Once a payout is successfully completed |
order.created | Once an order is created successfully |
order.updated | Once an order status is updated |
invoice.created | Once the invoice is created |
transfer.created | Once the transfer is created |
transfer.updated | Once the transfer is updated |
transfer.processing | Once the transfer is processed |
transfer.scheduled | Once the transfer is scheduled |
transfer.paid | Once the transfer is paid |
transfer.failed | Once the transfer is failed |
transfer.canceled | Once the transfer is canceled |
The first thing you need to do before you can receive the webhook is to register the URL. Navigate to “API Keys” and enter the name and the URL you wish to receive the webhook.
Headers that are included in the webhook HTTP POST request
HTTP header | details |
---|---|
Hitpay-Signature | SHA 256 of the JSON payload. Derived from the salt value |
Hitpay-Event-Type | created / updated based on the event |
Hitpay-Event-Object | The type of object. It can be charge /payout /invoice /order /transfer |
User-Agent | HitPay v2.0 |
HTTP request body is a JSON object and the object structure can be any of the above 5 types. Refer to the header value Hitpay-Event-Object
to determine the object type of webhooks for charge
payout
invoice
order
transfer
charge
invoice
order
payout
transfer
Note: List of failure codes for transfer.failed
event
Code | Description |
---|---|
100101 | Invalid account number |
100102 | Invalid bank branch code |
100103 | Invalid SWIFT/BIC code |
100104 | Invalid correspondent bank information |
100105 | Invalid bank information |
100106 | Invalid proxy details |
100107 | Transaction not supported |
100108 | Account type not supported |
100201 | Beneficiary name mismatch |
100202 | Account currency mismatch |
100301 | Invalid beneficiary details |
100302 | Invalid special character in beneficiary details |
100303 | Invalid beneficiary country |
100401 | Screening error |
100402 | Regulatory restriction |
100501 | Insufficient balance |
100601 | Account closed |
100602 | Account inactive or dormant |
100603 | Account under restriction |
100604 | Beneficiary deceased |
100701 | Beneficiary requested |
100702 | Beneficiary bank returned |
100801 | China local transfer beneficiary validation error |
100802 | China local transfer order error |
100803 | Beneficiary account type not supported |
100804 | China company registration number error |
100805 | China local transfer processing failure |
100901 | Recall requested |
100902 | Client requested |
101001 | Invalid payment purpose |
101002 | Wrong amount |
101003 | Amount exceeds limit |
101101 | System error |
101102 | Channel timeout |
101103 | Bank offline |
101201 | Other error |
101202 | Duplicate payment |
To validate a Hitpay-Signature: