Payments Academy
Webhook notifications PAYMENT OPERATIONS STARTED LIVE 01 Webhook notifications - notification the bank sends to the client ACTIVE 02 Webhook body and event identifier - also carries an event identifier QUEUED 03 Signature verification first - client must never act on a webhook whose QUEUED 04 Timestamp and state ordering - client must therefore process webhooks QUEUED 05 HTTPS verification - bank must also verify that the URL uses HTTPS QUEUED 06 Missed webhook recovery - client that has no way to recover missed QUEUED A webhook is a notification the bank sends to the client when something happens to a payment, so the client does not have to keep asking. Step 1 of 6 Webhook notifications STARTED Webhook notifications notification the bank sends to the client ACTIVE Webhook body and event identifier also carries an event identifier QUEUED Signature verification first client must never act on a webhook whose QUEUED Timestamp and state ordering client must therefore process webhooks QUEUED HTTPS verification bank must also verify that the URL uses QUEUED Missed webhook recovery client that has no way to recover missed QUEUED A webhook is a notification the bank sends to the client when something happens to a payment, so the client does not have to keep asking.
Webhook body and event identifier PAYMENT OPERATIONS IN PROGRESS LIVE 01 Webhook notifications - notification the bank sends to the client DONE 02 Webhook body and event identifier - also carries an event identifier ACTIVE 03 Signature verification first - client must never act on a webhook whose QUEUED 04 Timestamp and state ordering - client must therefore process webhooks QUEUED 05 HTTPS verification - bank must also verify that the URL uses HTTPS QUEUED 06 Missed webhook recovery - client that has no way to recover missed QUEUED The body also carries an event identifier, a unique value for this delivery, so the client can detect duplicates. Step 2 of 6 Webhook body and event identifier IN PROGRESS Webhook notifications notification the bank sends to the client DONE Webhook body and event identifier also carries an event identifier ACTIVE Signature verification first client must never act on a webhook whose QUEUED Timestamp and state ordering client must therefore process webhooks QUEUED HTTPS verification bank must also verify that the URL uses QUEUED Missed webhook recovery client that has no way to recover missed QUEUED The body also carries an event identifier, a unique value for this delivery, so the client can detect duplicates.
Signature verification first PAYMENT OPERATIONS IN PROGRESS LIVE 01 Webhook notifications - notification the bank sends to the client DONE 02 Webhook body and event identifier - also carries an event identifier DONE 03 Signature verification first - client must never act on a webhook whose ACTIVE 04 Timestamp and state ordering - client must therefore process webhooks QUEUED 05 HTTPS verification - bank must also verify that the URL uses HTTPS QUEUED 06 Missed webhook recovery - client that has no way to recover missed QUEUED The client must never act on a webhook whose signature it has not verified Step 3 of 6 Signature verification first IN PROGRESS Webhook notifications notification the bank sends to the client DONE Webhook body and event identifier also carries an event identifier DONE Signature verification first client must never act on a webhook whose ACTIVE Timestamp and state ordering client must therefore process webhooks QUEUED HTTPS verification bank must also verify that the URL uses QUEUED Missed webhook recovery client that has no way to recover missed QUEUED The client must never act on a webhook whose signature it has not verified
Timestamp and state ordering PAYMENT OPERATIONS IN PROGRESS LIVE 01 Webhook notifications - notification the bank sends to the client DONE 02 Webhook body and event identifier - also carries an event identifier DONE 03 Signature verification first - client must never act on a webhook whose DONE 04 Timestamp and state ordering - client must therefore process webhooks ACTIVE 05 HTTPS verification - bank must also verify that the URL uses HTTPS QUEUED 06 Missed webhook recovery - client that has no way to recover missed QUEUED The client must therefore process webhooks by timestamp and state Step 4 of 6 Timestamp and state ordering IN PROGRESS Webhook notifications notification the bank sends to the client DONE Webhook body and event identifier also carries an event identifier DONE Signature verification first client must never act on a webhook whose DONE Timestamp and state ordering client must therefore process webhooks ACTIVE HTTPS verification bank must also verify that the URL uses QUEUED Missed webhook recovery client that has no way to recover missed QUEUED The client must therefore process webhooks by timestamp and state
HTTPS verification for webhook URLs PAYMENT OPERATIONS IN PROGRESS LIVE 01 Webhook notifications - notification the bank sends to the client DONE 02 Webhook body and event identifier - also carries an event identifier DONE 03 Signature verification first - client must never act on a webhook whose DONE 04 Timestamp and state ordering - client must therefore process webhooks DONE 05 HTTPS verification - bank must also verify that the URL uses HTTPS ACTIVE 06 Missed webhook recovery - client that has no way to recover missed QUEUED The bank must also verify that the URL uses HTTPS, because a webhook sent over plain HTTP can be intercepted and read or modified. Step 5 of 6 HTTPS verification for webhook URLs IN PROGRESS Webhook notifications notification the bank sends to the client DONE Webhook body and event identifier also carries an event identifier DONE Signature verification first client must never act on a webhook whose DONE Timestamp and state ordering client must therefore process webhooks DONE HTTPS verification bank must also verify that the URL uses ACTIVE Missed webhook recovery client that has no way to recover missed QUEUED The bank must also verify that the URL uses HTTPS, because a webhook sent over plain HTTP can be intercepted and read or modified.
Missed webhook recovery PAYMENT OPERATIONS COMPLETE LIVE 01 Webhook notifications - notification the bank sends to the client DONE 02 Webhook body and event identifier - also carries an event identifier DONE 03 Signature verification first - client must never act on a webhook whose DONE 04 Timestamp and state ordering - client must therefore process webhooks DONE 05 HTTPS verification - bank must also verify that the URL uses HTTPS DONE 06 Missed webhook recovery - client that has no way to recover missed ACTIVE A client that has no way to recover missed webhooks must poll the status endpoint for every payment, which defeats the purpose of webhooks. Step 6 of 6 Missed webhook recovery COMPLETE Webhook notifications notification the bank sends to the client DONE Webhook body and event identifier also carries an event identifier DONE Signature verification first client must never act on a webhook whose DONE Timestamp and state ordering client must therefore process webhooks DONE HTTPS verification bank must also verify that the URL uses DONE Missed webhook recovery client that has no way to recover missed ACTIVE A client that has no way to recover missed webhooks must poll the status endpoint for every payment, which defeats the purpose of webhooks.

Key points of this lesson, in order.

0:00 / 5:53 Step 1 of 6

Webhooks and event delivery: signatures, retries, ordering and replay

API design standards and integration patterns, Lesson 7 of 7, Narration 5:53, D10 APIs and integration

WebhookRejectScheme

What you will learn

Your objective. By the end of this lesson, you will be able to explain webhooks and event delivery: signatures, retries, ordering and replay and apply it to a real banking scenario.

Why it matters. For a business analyst, the requirement is to define the event types, the delivery guarantees, the retry schedule, the signature scheme, and the client behaviour for duplicates and out of order delivery, and to test each with a real webhook.

Chapter objective: How payment APIs are designed, versioned, secured and integrated

Key learning points

  • Webhook notifications
  • Webhook body and event identifier
  • Signature verification first
  • Timestamp and state ordering
  • HTTPS verification for webhook URLs
  • Missed webhook recovery

Key terms

Webhook: A method where a server sends an event notification to a client system as soon as something happens, instead of the client polling for updates.

Reject: A payment instruction that is refused before settlement because it fails validation, screening or account checks.

Scheme: A card or payment network that sets the rules, standards and fees for transactions between issuers and acquirers.

Payment flow diagram showing Webhooks and event delivery: signatures, retries, ordering and replay.

Insights and practice scenarios

Worked insights and practice scenarios for this lesson. Each one is a reusable PaymentForge case, so the same case may appear in more than one lesson.

Practise this lesson

Exercise

Write the request and the expected response for the API call described in this lesson.

Use the API resources, operations and fields named in this lesson.

  1. What to do. Write the JSON request with the required fields, the success response, and one error response with its error code.

Correct result. A correct request has all mandatory fields, a valid idempotency key, and the right resource and operation. The success response confirms acceptance, and the error response names the field or rule that failed.

Why. An API contract is a promise between two systems. If the request is wrong, the API must reject it cleanly, not fail silently.

Check your understanding

Practice question

Which of the following best describes webhooks and event delivery: signatures, retries, ordering and replay?

Takeaway and next step

What to remember

The client must never act on a webhook whose signature it has not verified, because an attacker who can forge a payment.credited webhook can trick the client into releasing goods or crediting a customer for a payment that never happened.

Follow EUR 25,000 through every stage, from instruction to beneficiary credit, and note where it can stop.

Open the Payment Lifecycle Simulator →

Builds on "REST resource modelling for payments: resources, state and transitions".

Transcript and full text

Show transcript

A webhook is a notification the bank sends to the client when something happens to a payment, so the client does not have to keep asking. When a payment is accepted, settled, credited or rejected, the bank sends an HTTP POST to a URL the client registered, with a JSON body describing the event. Webhooks are how a client learns about a payment outcome in near real time, without polling the status endpoint every few seconds. But webhooks introduce their own problems, and a payments SME must understand them, because a webhook that is lost, duplicated, or forged can cause a client to credit a customer twice or not at all. Source: webhook delivery guidance; bank API developer documentation; Stripe webhook documentation as an industry reference pattern. The webhook body carries the event type, the payment identifier, the new status, and a timestamp. For example, when a payment of EUR 25,000 is credited to the beneficiary, the bank sends an event of type payment.credited with the payment identifier PAY-20261105-8841, the status ACCC, and the timestamp. The body also carries an event identifier, a unique value for this delivery, so the client can detect duplicates. The client must acknowledge the webhook by returning a 2xx HTTP status within a short window, typically 5 seconds. If the client does not acknowledge, the bank retries. The client must not assume a webhook will arrive exactly once: it may arrive twice, or not at all, and the client must handle both cases. The defence against duplicates is the event identifier: the client stores the identifiers it has already processed, and ignores a webhook whose identifier it has seen before. Signatures prove the webhook came from the bank and was not tampered with. The bank signs the webhook body with a secret shared with the client, using HMAC SHA-256, and sends the signature in a header. The client recomputes the signature from the body and the secret, and compares it with the header. If they match, the webhook is genuine; if they do not, the webhook is forged or corrupted and the client must reject it. The client must never act on a webhook whose signature it has not verified, because an attacker who can forge a payment.credited webhook can trick the client into releasing goods or crediting a customer for a payment that never happened. The secret must be rotated periodically, and the bank must support two secrets during rotation so that webhooks signed with either the old or the new secret are accepted for a transition period. Retries and ordering are the two delivery problems a client must handle. If the client's endpoint is down when the bank sends a webhook, the bank retries with exponential backoff: after 1 minute, then 5 minutes, then 15 minutes, then 1 hour, up to a maximum number of attempts, typically 24 hours. After the maximum, the bank stops retrying and the client must enquire about the payment status through the API. Ordering is not guaranteed: a payment.accepted webhook and a payment.credited webhook for the same payment may arrive out of order, or the credited webhook may arrive before the accepted one. The client must therefore process webhooks by timestamp and state, not by arrival order: if it receives a credited event for a payment it has not yet seen as accepted, it records the credited state and does not assume the accepted event was lost. For a business analyst, the requirement is to define the event types, the delivery guarantees, the retry schedule, the signature scheme, and the client behaviour for duplicates and out of order delivery, and to test each with a real webhook. Webhook endpoint registration is a security decision, not just a configuration step. When a client registers a webhook URL, the bank must verify that the client owns that URL, typically by sending a challenge to it and requiring the client to return the challenge value. Without this verification, an attacker could register a webhook URL that points to a server it controls, and receive notifications about payments it has no right to see. The bank must also verify that the URL uses HTTPS, because a webhook sent over plain HTTP can be intercepted and read or modified. A client that registers an HTTP URL must be rejected with a clear error. For a business analyst, the requirement is to define the registration process, the verification challenge, the HTTPS requirement, and the process for changing or deleting a registered URL. For a business analyst, the requirement is to define this behaviour in the API specification, because the client builds against the specification and nothing else. Webhook delivery must be monitored like any other part of the payment flow. The bank must track, for each client, how many webhooks were sent, how many were acknowledged, how many were retried, and how many failed permanently. A client whose endpoint has been failing for a day is a client that is not receiving payment notifications, and the bank should alert it. The bank should also provide a way for the client to replay missed webhooks, for example by listing the events for a payment through the API and re-sending the ones the client missed. A client that has no way to recover missed webhooks must poll the status endpoint for every payment, which defeats the purpose of webhooks. For a business analyst, the requirement is to define the delivery monitoring, the alert thresholds, and the replay mechanism, and to test them with a real client endpoint. Further reading: webhook delivery guidance; bank API developer documentation. Last reviewed 7 November 2026.

A webhook is a notification the bank sends to the client when something happens to a payment, so the client does not have to keep asking. When a payment is accepted, settled, credited or rejected, the bank sends an HTTP POST to a URL the client registered, with a JSON body describing the event. Webhooks are how a client learns about a payment outcome in near real time, without polling the status endpoint every few seconds. But webhooks introduce their own problems, and a payments SME must understand them, because a webhook that is lost, duplicated, or forged can cause a client to credit a customer twice or not at all. Source: webhook delivery guidance; bank API developer documentation; Stripe webhook documentation as an industry reference pattern.

The webhook body carries the event type, the payment identifier, the new status, and a timestamp. For example, when a payment of EUR 25,000 is credited to the beneficiary, the bank sends an event of type payment.credited with the payment identifier PAY-20261105-8841, the status ACCC, and the timestamp. The body also carries an event identifier, a unique value for this delivery, so the client can detect duplicates.

The client must acknowledge the webhook by returning a 2xx HTTP status within a short window, typically 5 seconds. If the client does not acknowledge, the bank retries. The client must not assume a webhook will arrive exactly once: it may arrive twice, or not at all, and the client must handle both cases. The defence against duplicates is the event identifier: the client stores the identifiers it has already processed, and ignores a webhook whose identifier it has seen before.

Signatures prove the webhook came from the bank and was not tampered with. The bank signs the webhook body with a secret shared with the client, using HMAC SHA-256, and sends the signature in a header. The client recomputes the signature from the body and the secret, and compares it with the header. If they match, the webhook is genuine; if they do not, the webhook is forged or corrupted and the client must reject it.

The client must never act on a webhook whose signature it has not verified, because an attacker who can forge a payment.credited webhook can trick the client into releasing goods or crediting a customer for a payment that never happened. The secret must be rotated periodically, and the bank must support two secrets during rotation so that webhooks signed with either the old or the new secret are accepted for a transition period.

Retries and ordering are the two delivery problems a client must handle. If the client's endpoint is down when the bank sends a webhook, the bank retries with exponential backoff: after 1 minute, then 5 minutes, then 15 minutes, then 1 hour, up to a maximum number of attempts, typically 24 hours. After the maximum, the bank stops retrying and the client must enquire about the payment status through the API. Ordering is not guaranteed: a payment.accepted webhook and a payment.credited webhook for the same payment may arrive out of order, or the credited webhook may arrive before the accepted one.

The client must therefore process webhooks by timestamp and state, not by arrival order: if it receives a credited event for a payment it has not yet seen as accepted, it records the credited state and does not assume the accepted event was lost. For a business analyst, the requirement is to define the event types, the delivery guarantees, the retry schedule, the signature scheme, and the client behaviour for duplicates and out of order delivery, and to test each with a real webhook.

Webhook endpoint registration is a security decision, not just a configuration step. When a client registers a webhook URL, the bank must verify that the client owns that URL, typically by sending a challenge to it and requiring the client to return the challenge value. Without this verification, an attacker could register a webhook URL that points to a server it controls, and receive notifications about payments it has no right to see.

The bank must also verify that the URL uses HTTPS, because a webhook sent over plain HTTP can be intercepted and read or modified. A client that registers an HTTP URL must be rejected with a clear error. For a business analyst, the requirement is to define the registration process, the verification challenge, the HTTPS requirement, and the process for changing or deleting a registered URL. For a business analyst, the requirement is to define this behaviour in the API specification, because the client builds against the specification and nothing else.

Webhook delivery must be monitored like any other part of the payment flow. The bank must track, for each client, how many webhooks were sent, how many were acknowledged, how many were retried, and how many failed permanently. A client whose endpoint has been failing for a day is a client that is not receiving payment notifications, and the bank should alert it. The bank should also provide a way for the client to replay missed webhooks, for example by listing the events for a payment through the API and re-sending the ones the client missed.

A client that has no way to recover missed webhooks must poll the status endpoint for every payment, which defeats the purpose of webhooks. For a business analyst, the requirement is to define the delivery monitoring, the alert thresholds, and the replay mechanism, and to test them with a real client endpoint. Further reading: webhook delivery guidance; bank API developer documentation. Last reviewed 7 November 2026.

Full lesson text (all scenes)

Completing a lesson updates your progress dashboard on the homepage.

Scene timestamps are estimated by allocating the narration text proportionally across the real audio length. The audio playback position is the source of truth: pause freezes the visual, seeking restores the correct scene, replay restarts the scene animation.