Payment Webhooks
Payment webhooks let Bead send real-time payment updates to your system. Instead of polling, your server receives an HTTP POST whenever a payment's statusCode changes, and whenever the progress of a reclaim return to the payer changes.
Payment webhook notifications are typically used together with the Payments and Reporting APIs.
When to use payment webhooks
Use payment webhooks when you want to:
update orders or invoices as soon as a payment is paid (
completedoroverpaid)react to
underpaid,expired,abandoned,invalid, orcancelledoutcomesfollow a reclaim return to the payer through
refundLifecycleStatustrigger downstream workflows such as fulfilment, customer notifications, or support tickets
track payments without polling
GET /Payments/{paymentId}/tracking
How payment webhooks work
You configure a default webhook URL for a terminal, or provide
webhookUrlswhen creating a payment.Bead delivers an HTTP
POSTwhen a payment status changes or when its reclaim progress changes.Your server verifies the webhook signature using the stored
signingSecret.Your system records the event and updates internal state.
If needed, your system confirms the latest state using
GET /Payments/{paymentId}/tracking.
Configure payment webhook delivery
Payment webhooks are configured per terminal.
Default terminal webhook
Use the terminal webhook endpoint to set the default payment webhook URL for a terminal:
PUT /Terminals/{id}/webhook
Send a JSON body with one field, url, the HTTPS endpoint you control where Bead should deliver payment events. This call uses your admin API key, not a terminal payments API key.
A successful response returns status and signingSecret. It does not repeat the url.
Store signingSecret securely. You will use it to verify incoming payment webhooks.
For the full request and response example, see Webhook Management.
Optional per-payment webhook URLs
When creating a payment with POST /Payments, you can also provide webhookUrls for payment-specific delivery in addition to the terminal's default webhook.
Use this when you want a payment to notify a specific backend flow without changing the terminal's default webhook configuration.
Where to get the signing secret
The payment webhook signing secret is associated with the terminal webhook configuration and should be stored securely when the webhook is set.
Important notes:
do not expose
signingSecretin client-side codedo not expect the incoming webhook payload to include the secret
do not compare the incoming signature header directly to the secret itself
The correct verification pattern is:
configure the webhook
save the
signingSecretreceive the webhook delivery
verify the signature using the steps below
only trust the event if verification passes
Event delivery
For each payment update, Bead sends a POST request to your webhook URL.
General behavior:
method:
POSTcontent type:
application/jsonone event per payment status change, and one event per reclaim progress change
retries occur if your endpoint does not return a successful
2xxresponse
Your webhook handler should:
log every webhook request for debugging and audit
preserve the raw request body before JSON parsing
preserve request headers
verify the signature before processing the payload
return a successful response quickly after safely persisting or queueing the event
Current payment signature header
Current payment webhook deliveries include the signature in:
Example:
t
Unix epoch timestamp in milliseconds when Bead generated the event
s
Base64-encoded HMAC-SHA256 digest of the signed message t + "." + rawBody, computed using the decoded bytes of the terminal's signingSecret
Verifying the webhook
Always verify the payment webhook before processing the JSON body.
Capture the raw request body exactly as received. Do not parse or reserialize JSON before this step.
Read the
x-webhook-signatureheader and parse thetandsvalues.Validate the timestamp by confirming
t(in milliseconds) is within 5 minutes of the current time. Reject requests outside this window to prevent replay attacks.Decode
signingSecretfrom base64 to raw bytes. Use those bytes as the HMAC key.Construct the signed message by concatenating
t, a literal period, and the raw request body:message = t + "." + rawBody.Compute
HMAC-SHA256(key=decodedSecretBytes, message=message)and base64-encode the digest.Compare your computed base64 digest to
susing constant-time equality. Reject the request if they do not match.
For a full code example, see How do I verify that a webhook really came from Bead?
Example payload
The example shows an overpaid payment after the excess was returned to the payer. statusCode stays overpaid; refundLifecycleStatus shows the completed return. The same payload shape is returned by GET /Payments/{paymentId}/tracking.
Payment status values
Payment webhook events may include created, processing, completed, overpaid, underpaid, expired, abandoned, invalid, and cancelled.
Your system should treat statusCode as the primary event classifier. completed and overpaid mean the payment is paid. underpaid, expired, abandoned, invalid, and cancelled mean it is not paid. Every status other than created and processing is final: it does not change once reached. See Payment Statuses for the full outcome table.
Payments that Bead closes automatically (
abandonedandexpired): Bead closes unpaid payments automatically 24 hours after the payment was created. Closure runs on a periodic check, so the status change and its webhook can arrive shortly after the 24 hour point rather than at the exact moment. A payment that was created but never started is closed asabandoned. A payment where the customer started an attempt but did not complete it is closed asexpired. Bead sends a payment webhook for each automatic closure, the same as for any other status change. If your system may have missed one, confirm the final status withGET /Payments/{paymentId}/tracking. See Payment Statuses and Why is my payment still Created or In Progress?.
Reclaim progress webhooks
When a payment ends as overpaid, underpaid, expired, invalid, or cancelled, Bead returns crypto to the payer through the reclaim process. For overpaid, only the excess is returned.
Bead sends a payment webhook each time the payment's refundLifecycleStatus changes (emailSent, customerClaimed, processing, completed, failed, rejected). The webhook uses the same payload as other payment webhooks and goes to the terminal webhook URL and to any webhookUrls set on the payment.
Reclaim progress webhooks carry the payment's final statusCode, unchanged. When the return completes, refundLifecycleStatus is completed and refundCompletedAt is set. An overpaid payment stays overpaid and an underpaid payment stays underpaid.
Use these events to update your records. They do not change the fulfillment decision you made on the earlier outcome. See Tracking Reclaim Status.
Partners can also receive reclaim progress for every merchant under them through the reclaimStatusChanged partner webhook event. See Partner Webhooks.
Key fields
paymentId
This is the primary identifier for the payment. Use it to call GET /Payments/{paymentId}/tracking to confirm or refresh payment state, correlate status checks with your internal payment or order record, and as part of the recommended key for de-duplicating webhook deliveries (see Idempotency and duplicate handling below).
trackingId
This is a legacy identifier. paymentId replaced trackingId as the primary payment identifier in the June 2, 2026 partner-wide update. trackingId is deprecated but is still included on webhook payloads for backward compatibility. Do not use trackingId for identification, correlation, or de-duplication in new or updated integrations; use paymentId instead.
paymentCode
This is the hosted payment code associated with the checkout.
statusCode
This tells you the payment's current status.
refundLifecycleStatus
This tells you where a reclaim return to the payer stands. A value of null means the same as notStarted.
terminalId
This identifies the terminal that produced the payment.
merchantId
This identifies the merchant associated with the payment.
receivedTime
This is the timestamp associated with the event payload.
Recommended processing model
Receive the request.
Preserve the raw request body and headers.
Read
x-webhook-signatureand parsetands.Validate the timestamp, confirming
t(in milliseconds) is within 5 minutes of the current time.Decode
signingSecretfrom base64 to bytes. Build the signed message ast + "." + rawBody. ComputeHMAC-SHA256(key=decodedSecretBytes, message=signedMessage)and base64-encode the digest.Compare the computed digest to
susing constant-time equality. Reject the request if they do not match.Parse the JSON payload only after verification succeeds.
Persist the event or enqueue it for processing.
Update your internal order or invoice state based on
statusCode, and your reclaim tracking based onrefundLifecycleStatus.Return a
2xxresponse quickly.
Idempotency and duplicate handling
Treat payment webhook delivery as at least once.
A good idempotent processing strategy uses paymentId + statusCode + refundLifecycleStatus as the primary key, with the raw body hash or received timestamp optionally stored for debugging. Reclaim progress events carry the payment's final statusCode, so a key without refundLifecycleStatus would treat them as duplicates. trackingId is deprecated and should not be used as part of your idempotency key, even though it is still present on the payload for backward compatibility.
Your system should be able to safely ignore duplicate deliveries without creating duplicate business actions.
Delivery mechanics
respond quickly, ideally in under one second when possible
do heavy work asynchronously after the event is safely persisted or queued
expect retries with backoff when your endpoint fails or times out
rely on signature verification rather than source IP allowlisting unless Bead explicitly publishes and supports source IP controls for your environment
Confirming status with the Tracking endpoint
If you need to confirm the latest state during support, reconciliation, or after a missed event, call the tracking endpoint using the payment's paymentId.
Endpoint
GET /Payments/{paymentId}/tracking
Headers
X-Api-Key: {apiKey}Accept: application/json
Notes
apiKeyis the secret credentialmaskedApiKeyis not usablethe header name must be exactly
X-Api-Key
Testing webhooks in Sandbox
Configure a webhook URL for your Sandbox terminal.
Create a Sandbox payment with
POST /Payments.Complete the payment on the hosted page.
Confirm your webhook received payment status updates.
Confirm your listener captures
x-webhook-signature.Verify the signature using the stored
signingSecret.Optionally confirm the latest state using
GET /Payments/{paymentId}/tracking.
Troubleshooting
I am receiving the webhook but verification fails
Check:
you are signing
t + "." + rawBody, not the raw body aloneyou are decoding
signingSecretfrom base64 to bytes before using it as the HMAC keyyou are using the raw request body, not a reserialized JSON body
you are producing a base64 digest, not a hex digest
you are using the
signingSecretfor the correct terminal
Webhook not received
Check:
the terminal has a webhook URL configured
your endpoint is publicly reachable over HTTPS
your endpoint returns a successful
2xxresponse quicklyyour server logs show inbound requests and any verification or parsing failures
Receiving repeated webhook events
This usually means your endpoint is timing out or returning a non-2xx response. Return success quickly after safely persisting or queueing the event, and make your processing idempotent. Events for the same paymentId and statusCode with a different refundLifecycleStatus are reclaim progress updates, not duplicates.
401 Unauthorized when checking status
Payments endpoints use X-Api-Key. Confirm the API key is present, valid for the environment, and that the header name is exactly X-Api-Key.
403 Forbidden when checking status
The API key is valid but not permitted for the payment context, or you are mixing environments. Confirm you are using the correct environment base URL and the correct terminal API key.
Next steps
Review Payment Statuses for the full list of
statusCodevalues and outcomesReview Tracking Reclaim Status for following a reclaim return
Review Create Payment for
webhookUrlssupport when you need per-payment deliveryReview Webhook Event Reference for the shared signature and delivery reference
Use Reporting and Settlement for historical views and reconciliation
Last updated