From e90d7916fbf8bba54dd96433507c53fd5eb88211 Mon Sep 17 00:00:00 2001 From: rcsh <163504257+rcsh1@users.noreply.github.com> Date: Thu, 18 Jun 2026 11:04:54 +0800 Subject: [PATCH] docs: add webhook delivery semantics, retry behavior, and self-diagnosis guide --- v2/guides/webhooks-callbacks/introduction.mdx | 15 +++++++++++++++ v2/guides/webhooks-callbacks/set-up-endpoint.mdx | 16 ++++++++++------ .../webhooks-callbacks/webhook-event-type.mdx | 2 ++ v2_cn/guides/webhooks-callbacks/introduction.mdx | 16 ++++++++++++++++ .../webhooks-callbacks/set-up-endpoint.mdx | 16 ++++++++++------ .../webhooks-callbacks/webhook-event-type.mdx | 1 + 6 files changed, 54 insertions(+), 12 deletions(-) diff --git a/v2/guides/webhooks-callbacks/introduction.mdx b/v2/guides/webhooks-callbacks/introduction.mdx index 056db567..7412f3ba 100644 --- a/v2/guides/webhooks-callbacks/introduction.mdx +++ b/v2/guides/webhooks-callbacks/introduction.mdx @@ -45,6 +45,21 @@ To learn more about event types and event data types, see [Webhook event type an To manage webhook events using Cobo CLI, refer to the following guides: [Listen and Forward Events](/v2/developer-tools/cobo-cli/listen-and-forward-events), [Trigger Webhook Events](/v2/developer-tools/cobo-cli/trigger-events), and [List Event Types](/v2/developer-tools/cobo-cli/event-types). +## Delivery semantics + +Review the following rules so you can tell whether a missing notification is expected behavior or a problem to investigate. + +- **Event triggers.** A transaction emits webhook events as its status changes. To track the full lifecycle of a transaction with a single subscription, subscribe to `wallets.transaction.updated`, which covers creation, updates, completion, and failure. For the full list of events, see [Webhook event types and data types](/v2/guides/webhooks-callbacks/webhook-event-type). +- **Ordering and retries.** Event ordering is not guaranteed, and the same event may be delivered more than once, so deduplicate by a unique identifier. Failed deliveries are retried automatically. See [Retry behavior](/v2/guides/webhooks-callbacks/set-up-endpoint#retry-behavior) and [Delivery guarantees](/v2/guides/webhooks-callbacks/set-up-endpoint#delivery-guarantees). + +### No webhook received? Self-diagnosis + +If your endpoint does not receive an expected webhook event, work through the following checklist: + +1. Confirm that your endpoint subscribes to the relevant event type, in particular `wallets.transaction.updated` for transaction status changes. +2. Confirm that the event you expect is one the WaaS service emits, using [Webhook event types and data types](/v2/guides/webhooks-callbacks/webhook-event-type). +3. Inspect the delivery logs on **Cobo Portal** > **Developer** > **Webhook Events**, then click the event to view each delivery attempt, its response code, and its response body. +4. If the event status is `Failed`, resolve the cause (see [Common delivery failures](/v2/guides/webhooks-callbacks/set-up-endpoint#common-delivery-failures)), then click **Retry** to resend the event. ## Notes on upgrading from WaaS 1.0 to Waas 2.0 diff --git a/v2/guides/webhooks-callbacks/set-up-endpoint.mdx b/v2/guides/webhooks-callbacks/set-up-endpoint.mdx index 05944a50..b5232761 100644 --- a/v2/guides/webhooks-callbacks/set-up-endpoint.mdx +++ b/v2/guides/webhooks-callbacks/set-up-endpoint.mdx @@ -80,15 +80,19 @@ Properly responding to webhook events and callback messages is crucial for ensur When your webhook endpoint receives a webhook event, it should respond with a status code of `200` or `201` to indicate that the event has been successfully received and processed. Once this response is sent, the WaaS service will stop retrying to send the event and the event status will become `Delivered` on Cobo Portal. -The default timeout for each webhook event is 2 seconds. If the webhook endpoint does not respond or responds with a status code other than `200` or `201`, the WaaS service will continue to retry sending the event. If the number of retry attempts reaches 10 , the WaaS service will stop sending the event and the event status will become `Failed`· You can resend the event by clicking **Retry** on **Cobo Portal** > **Developer** > **WaaS 2.0** > **Webhook Events**. +##### Retry behavior -Cobo does not guarantee that events will be delivered in the order they are generated. For example, creating a transfer will generate the following events: +The default timeout for each webhook event is 2 seconds. The WaaS service evaluates your endpoint's response as follows: -- `wallets.transaction.created` -- `wallets.transaction.updated` -- `wallets.transaction.succeeded` +- A status code of `200` or `201` is treated as success. The event status becomes `Delivered` and no further delivery attempts are made. +- Any other status code, an invalid response, or no response within the timeout is treated as a retryable failure, and the WaaS service retries delivery. -Your endpoint should not assume that events will arrive in this sequence and must handle delivery appropriately. +The WaaS service attempts delivery up to 10 times. After the 10th failed attempt, the WaaS service stops sending the event and the event status becomes `Failed`. You can resend a failed event by clicking **Retry** on **Cobo Portal** > **Developer** > **WaaS 2.0** > **Webhook Events**. + +##### Delivery guarantees + +- **Ordering is not guaranteed.** The WaaS service does not guarantee that events are delivered in the order they are generated. For example, creating a transfer generates `wallets.transaction.created`, `wallets.transaction.updated`, and `wallets.transaction.succeeded`; your endpoint must not assume the events arrive in that sequence. +- **Duplicate delivery is possible.** Because events are retried, your endpoint may receive the same event more than once. Deduplicate using a unique identifier such as the event ID, transaction hash, or transaction ID, and ignore events you have already processed. #### Callback messages diff --git a/v2/guides/webhooks-callbacks/webhook-event-type.mdx b/v2/guides/webhooks-callbacks/webhook-event-type.mdx index 324358a3..cb4015e5 100644 --- a/v2/guides/webhooks-callbacks/webhook-event-type.mdx +++ b/v2/guides/webhooks-callbacks/webhook-event-type.mdx @@ -63,6 +63,8 @@ For payment webhook events, please refer to [Order Status and Events](/v2/paymen +To see the full list of statuses a transaction passes through, see [Transaction statuses and sub-statuses](/v2/guides/transactions/status). + ### Fee Station events