Skip to main content

Overview

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

Register Your Webhook

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.
Hero Dark

Platform webhooks

Converting to a Platform Account does not automatically start sending webhooks. The platform must register webhook endpoints on its own HitPay account first. For sub-account payments created via Platform APIs (requests include both X-BUSINESS-API-KEY for the sub-account and X-PLATFORM-KEY for the platform):
  • Successful/failed charge events (charge.created, charge.failed, charge.updated) are delivered to webhook endpoints registered on the platform account — not the sub-account’s endpoints.
  • The payload is for the sub-account’s transaction; use the charge or payment-request data (and business_id in the payload) to identify which sub-account it belongs to.
  • Payment request events (payment_request.completed, payment_request.failed) are currently sent to the sub-account’s registered webhook endpoints.

Webhook Payload

Headers that are included in the webhook HTTP POST request 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-Objectto determine the object type of webhooks for charge payout invoice order transfer

Event examples for charge invoice order

Event examples for payout transfer

Note: List of failure codes for transfer.failed event

Event examples for payment_request

Validating Webhook

HitPay uses two different salt values depending on the integration. Use the right one for the callback you are handling.

API-key salt (Developers page)

This salt belongs to your business API key and is shown on the Developers page alongside your API key. It signs older payment-request and charge callbacks, plus plugin integrations—the API-driven payment flow where an hmac value is returned with the payment status. Used for:
  • Payment Request webhook and redirect callbacks
  • Recurring payment callbacks
  • Order and checkout callbacks (Shop, Order webhook, Hardware order)
  • Plugin HMAC validation (Shopify, Wix, Xero)
How it works: Sort and concatenate the callback parameters, then compute HMAC-SHA256 using the API-key salt. The signature is sent in the hmac field in the payload, not in a header.

Per-webhook salt (Developers → Webhooks)

Each webhook endpoint you register under Developers → Webhooks has its own salt. This is the salt for event webhooks on this page (for example charge.completed, order.updated). How it works: Compute HMAC-SHA256 of the raw request body using that webhook’s salt. The signature is sent in the Hitpay-Signature header. Find the salt on the webhook’s detail view in the dashboard after you create the webhook endpoint.

The differences

The steps below apply to event webhooks and use the per-webhook salt.

Validate Hitpay-Signature

  1. Collect data: Read the raw JSON body and the Hitpay-Signature header from the incoming request.
  2. Prepare key: Use the salt for that webhook endpoint (from Developers → Webhooks), not the API-key salt on the main Developers page.
  3. Compute HMAC: Generate HMAC-SHA256 over the raw body bytes with that webhook’s salt as the key.
  4. Compare signatures: Compare the computed HMAC to Hitpay-Signature. If they match, the request is authentic and unmodified.
Last modified on July 3, 2026