Events
Note
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.
List of Events
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 |
invoice.updated | Once the invoice is marked as paid or partially paid |
Register Your Webhook
The first thing you need to do before you can receive the webhook is to register the URL. Navigate to "Payment Gateway > API Keys" and enter the name and the URL you wish to receive the webhook.

Webhook Payload
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 |
User-Agent | HitPay v2.0 |
HTTP request body is a JSON object and the object structure can be any of the above 4 types. Refer to the header value Hitpay-Event-Object
to determine the object type
{
"id": "98f18bb9-42a3-4cd2-a263-b6ed7d49a1cc",
"business_id": "9130c422-bf97-4bd1-b370-07a3a6f40708",
"channel": "point_of_sale",
"customer_id": null,
"status": "succeeded",
"customer": null,
"currency": "sgd",
"amount": 1.11,
"refunded_amount": 0,
"refunded_at": null,
"fixed_fee": 0.6,
"discount_fee": 0.04,
"discount_fee_rate": 3.65,
"failed_reason": null,
"order": {
"id": "98f18bb8-08b8-4cec-bb3c-f2c9c90103aa",
"order_display_number": 3350,
"business_id": "9130c422-bf97-4bd1-b370-07a3a6f40708",
"channel": "quick_sale",
"version": "2.0",
"customer_id": null,
"business_customer_id": null,
"customer": null,
"customer_pickup": false,
"currency": "sgd",
"order_discount_name": null,
"status": "requires_business_action",
"remark": null,
"products_count": 0,
"created_at": "2023-04-16T15:59:46+08:00",
"updated_at": "2023-04-16T15:59:55+08:00",
"closed_at": null,
"location_id": "97062e9f-3f27-443c-900f-16186f0540e1",
"location": {
"id": "97062e9f-3f27-443c-900f-16186f0540e1",
"name": "Location 5"
},
"business_user_id": "34",
"slot_date": null,
"slot_time": null,
"messages": null,
"products": [],
"charges": [],
"line_items": [
{
"id": "98f18bb8-9e85-425f-b0f9-60fa54219297",
"name": "Quick Sale",
"item_type": "quick_sale",
"quantity": 1,
"related_id": "98f18bb8-08b8-4cec-bb3c-f2c9c90103aa",
"unit_price": 1.11,
"line_item_amount": 1.11,
"children": []
}
],
"order_form": [],
"order_form_response": [],
"payment_status": "paid",
"fulfilment_status": "Pending - Shipping",
"line_items_total": 1.11,
"order_discount_amount": 0,
"line_item_discount_amount": 0,
"line_item_tax_amount": 0,
"additional_discount_amount": 0,
"total_discount_amount": 0,
"line_item_price": 0,
"shipping_amount": 0,
"total_coupon_amount": 0,
"amount": 1.11,
"subtotal": 1.11
},
"order_id": "98f18bb8-08b8-4cec-bb3c-f2c9c90103aa",
"remark": null,
"payment_intents": [],
"payment_provider": {
"code": "stripe_sg",
"account_id": "acct_1GT5CuAkj749QHik",
"charge": {
"type": "charge",
"id": "ch_3MxQUxAMHowMCIhZ0bU4tKfe",
"method": "card_present",
"transfer_type": "application_fee",
"details": {
"brand": "Visa",
"last4": "4242",
"country": null,
"country_code": "US"
}
}
},
"created_at": "2023-04-16T15:59:47+08:00",
"updated_at": "2023-04-16T15:59:58+08:00",
"closed_at": "2023-04-16T15:59:55+08:00",
"location_id": "97062e9f-3f27-443c-900f-16186f0540e1",
"location": {
"id": "97062e9f-3f27-443c-900f-16186f0540e1",
"name": "Location 5"
},
"business_user_id": "34",
"business_user_display": "Nitin Muthyala Test1",
"terminal_id": "WPC32SIMULATOR1",
"name": "Location 5"
}
{
"id": "98f59d86-1cf3-4378-950a-9b113c745439",
"order_display_number": 1340,
"business_id": "98567029-f559-49f9-916b-042a4255b32a",
"channel": "quick_sale",
"version": "2.0",
"customer_id": null,
"business_customer_id": null,
"customer": null,
"customer_pickup": false,
"currency": "sgd",
"order_discount_name": null,
"status": "requires_payment_method",
"remark": null,
"products_count": 0,
"created_at": "2023-04-18T16:32:52+08:00",
"updated_at": "2023-04-18T16:32:59+08:00",
"closed_at": null,
"location_id": "98a525ca-777f-4fd3-b482-4ff417e05377",
"location": {
"id": "98a525ca-777f-4fd3-b482-4ff417e05377",
"name": "Automation_1678350710"
},
"business_user_id": "1306",
"slot_date": null,
"slot_time": null,
"messages": null,
"products": [],
"charges": [],
"line_items": [],
"order_form": [],
"order_form_response": [],
"payment_status": null,
"fulfilment_status": "Payment in progress",
"line_items_total": 34.98,
"order_discount_amount": 0,
"line_item_discount_amount": 0,
"line_item_tax_amount": 0,
"additional_discount_amount": 0,
"total_discount_amount": 0,
"line_item_price": 0,
"shipping_amount": 0,
"total_coupon_amount": 0,
"amount": 23.33,
"subtotal": 27.99
}
{
"id": "98f2a4dd-7685-409c-8f6e-a504760a533e",
"bank_name": null,
"bank_switf_code": null,
"bank_swift_code": null,
"bank_account_number": "acct_233mmmuNxCM62r",
"currency": "sgd",
"amount": 1636.16,
"remark": "HitPay Payouts for 2023-04-17",
"status": "paid",
"source_type": null,
"created_at": "2023-04-17T05:05:54+08:00"
}
{
"id": "98f5a7b1-664a-42ba-9c31-cfbc4af93029",
"business_id": "98567029-f559-49f9-916b-042a4255b32a",
"business_customer_id": "985ec5dc-52a9-4176-b506-0f757d03ce5b",
"payment_request_id": "98f5a7b1-6c4c-4a4f-b33e-455fb721daa7",
"reference": "reference_1681808478",
"invoice_number": "INV-ONGF-20230418",
"email": "[email protected]",
"status": "pending",
"currency": "SGD",
"amount": 100,
"customer": {
"id": "985ec5dc-52a9-4176-b506-0f757d03ce5b",
"business_id": "98567029-f559-49f9-916b-042a4255b32a",
"name": "Customer_Name.",
"birth_date": null,
"gender": null,
"email": "[email protected]",
"phone_number": "449595995",
"street": "236 Harvey Drive Mays Landing",
"city": "London",
"state": "New South Wales",
"postal_code": "533416",
"country": "vn",
"remark": null,
"hotglue_customer_id": null,
"created_at": "2023-02-02T08:55:38.000000Z",
"updated_at": "2023-02-25T17:02:06.000000Z"
},
"send_email_by_default": true,
"tax_setting": {
"id": "98874ffb-ac06-4227-a5b7-7c369ba5235f",
"name": "VAT_Tax_1677461624",
"rate": 0.1
},
"amount_no_tax": 100,
"subtotal": 10000,
"products": [],
"stackable_discounts": [],
"invoice_type": "payment_by_fixed_amount",
"memo": "Memo_2023-04-18T09:01:17.947Z",
"attached_file": null,
"created_at": "2023-04-18T17:01:18+08:00",
"updated_at": "2023-04-18T17:01:18+08:00",
"invoice_date": "2023-04-18 09:01:18",
"due_date": "2023-04-19 23:59:59",
"charges": [],
"allow_partial_payments": 1,
"partial_payments": [
{
"id": "98f5a7b1-7baa-4b6d-8b3d-554569750f4c",
"invoice_id": "98f5a7b1-664a-42ba-9c31-cfbc4af93029",
"payment_request_id": "98f5a7b1-77f2-4492-8741-90d329a8528f",
"amount": 50,
"due_date": "2023-04-19",
"created_at": "2023-04-18T09:01:18.000000Z",
"updated_at": "2023-04-18T09:01:18.000000Z",
"payment_request": {
"id": "98f5a7b1-77f2-4492-8741-90d329a8528f",
"business_id": "98567029-f559-49f9-916b-042a4255b32a",
"amount": "50.00",
"currency": "SGD",
"name": null,
"email": "[email protected]",
"payment_methods": [
"card"
],
"purpose": "reference_1681808478",
"reference_number": "INV-ONGF-20230418",
"url": "https://securecheckout.staging.hit-pay.com/payment-request/@testingsg/98f5a7b1-77f2-4492-8741-90d329a8528f/checkout",
"redirect_url": "https://invoice.staging.hit-pay.com/98567029-f559-49f9-916b-042a4255b32a/98f5a7b1-664a-42ba-9c31-cfbc4af93029",
"webhook": null,
"send_sms": 1,
"send_email": 1,
"allow_repeated_payments": 0,
"expiry_date": null,
"created_at": "2023-04-18T09:01:18.000000Z",
"updated_at": "2023-04-18T09:01:18.000000Z",
"phone": null,
"status": "pending",
"sms_status": "pending",
"email_status": "pending",
"is_default": 0,
"platform_business_id": null,
"commission_rate": "0.0000",
"channel": "invoice",
"add_admin_fee": 0,
"wifi_terminal_id": null,
"address": null,
"line_items": null,
"current_status": "pending",
"is_expired": false
}
},
{
"id": "98f5a7b1-8384-4205-a251-ccd5ccd9baf4",
"invoice_id": "98f5a7b1-664a-42ba-9c31-cfbc4af93029",
"payment_request_id": "98f5a7b1-7fb7-4c0f-8122-dd673ed571de",
"amount": 50,
"due_date": "2023-04-19",
"created_at": "2023-04-18T09:01:18.000000Z",
"updated_at": "2023-04-18T09:01:18.000000Z",
"payment_request": {
"id": "98f5a7b1-7fb7-4c0f-8122-dd673ed571de",
"business_id": "98567029-f559-49f9-916b-042a4255b32a",
"amount": "50.00",
"currency": "SGD",
"name": null,
"email": "[email protected]",
"payment_methods": [
"card"
],
"purpose": "reference_1681808478",
"reference_number": "INV-ONGF-20230418",
"url": "https://securecheckout.staging.hit-pay.com/payment-request/@testingsg/98f5a7b1-7fb7-4c0f-8122-dd673ed571de/checkout",
"redirect_url": "https://invoice.staging.hit-pay.com/98567029-f559-49f9-916b-042a4255b32a/98f5a7b1-664a-42ba-9c31-cfbc4af93029",
"webhook": null,
"send_sms": 1,
"send_email": 1,
"allow_repeated_payments": 0,
"expiry_date": null,
"created_at": "2023-04-18T09:01:18.000000Z",
"updated_at": "2023-04-18T09:01:18.000000Z",
"phone": null,
"status": "pending",
"sms_status": "pending",
"email_status": "pending",
"is_default": 0,
"platform_business_id": null,
"commission_rate": "0.0000",
"channel": "invoice",
"add_admin_fee": 0,
"wifi_terminal_id": null,
"address": null,
"line_items": null,
"current_status": "pending",
"is_expired": false
}
}
],
"payment_detail_pending": 100,
"payment_detail_paid": 0,
"invoice_link": "https://staging.hitpay.shop/s/j8335a",
"footer": null,
"payment_methods": [
"card"
]
}
Updated about 1 month ago