Skip to content

docs: add webhooks integration guide#87

Merged
Cali93 merged 8 commits into
mainfrom
docs/webhooks
Jul 22, 2026
Merged

docs: add webhooks integration guide#87
Cali93 merged 8 commits into
mainfrom
docs/webhooks

Conversation

@Cali93

@Cali93 Cali93 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a Webhooks page (payments/webhooks) to the Payments docs, placed in the nav directly after Test mode (in both the 2026-02-18 and 2026-02-19.preview versions).

The guide covers:

  • Webhooks vs. polling — webhooks as the trigger, status polling as the source of truth for the critical path
  • Event catalog — all seven payment.* event types with a lifecycle diagram
  • Payload contract — envelope (id, type, api_version, created_at, data), full-snapshot semantics, a complete payment.succeeded example, and a warning to parse tolerantly (additive-only contract)
  • Delivery guarantees — at-least-once (dedupe by event id), out-of-order delivery (compare payment_state_version), 2xx acknowledgment, and the ~28-hour retry schedule with manual recovery after exhaustion
  • Setup steps — registering the endpoint per mode, Svix signature verification (Node.js + Python examples, raw-body caveat, 24h secret rotation overlap), and testing via test events + test-mode simulation
  • Go live — separate endpoint/secret per mode, data.live check before real fulfillment

Facts (retry schedule, event types, payload fields, signature scheme, one-endpoint-per-mode, rotation window) were sourced from the Svix integration in pay-merchant-experience (services/merchant-api partner-webhooks module and the frozen public payload schema).

🤖 Generated with Claude Code

Linear: WCPM-530
Dashboard link PR: WalletConnect/pay-merchant-experience#874

Merge dependencies

  • Svix plan upgrade + white-label setting enabled on all three environments, so deliveries send the documented webhook-* headers instead of svix-* (per @xikimay approval note).
  • Merge before WalletConnect/pay-merchant-experience#874 so the dashboard link does not 404.

Adds payments/webhooks covering event types, payload contract,
delivery guarantees (at-least-once, ordering, ~28h retry schedule),
signature verification, test delivery, and go-live checklist.
Nav item placed directly after Test mode in both doc versions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Cali93
Cali93 marked this pull request as ready for review July 21, 2026 13:40
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
wc-pay-docs 🟢 Ready View Preview Jul 21, 2026, 1:42 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify

mintlify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
wc-pay-docs 🟡 Building Jul 21, 2026, 1:41 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

- Remove nav entry; page is accessible by direct URL only
- Remove rollout disclaimer
- Trim page description
- Reframe webhooks vs. polling: webhooks notify, polling decides;
  relax poll interval (e.g. 5s) and confirm state on webhook receipt
- Replace all em-dashes with natural connectors

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace Svix-library examples with dependency-free stdlib
implementations (Node.js, Python, Go, Java, C#, PHP, Ruby),
document the HMAC scheme explicitly, and add a copyable agent
prompt with the Svix test vector for one-shot implementation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The full prompt no longer renders on the page; it lives in
copy-agent-prompt.js (Mintlify injects content-directory .js files
on every page) and is copied to the clipboard by a Copy prompt
button via event delegation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@xikimay xikimay left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the doc! I have some suggestions and some corrections

Comment thread payments/webhooks.mdx Outdated
Comment thread payments/webhooks.mdx Outdated
Comment thread payments/webhooks.mdx
Comment thread payments/webhooks.mdx Outdated
Comment thread payments/webhooks.mdx Outdated
Comment thread payments/webhooks.mdx Outdated
Comment thread copy-agent-prompt.js Outdated
Comment thread payments/webhooks.mdx Outdated
Comment thread payments/webhooks.mdx
Comment thread payments/webhooks.mdx Outdated
@xikimay
xikimay dismissed their stale review July 22, 2026 10:30

Not blocking, treating this as comments

- Reframe polling as primary, webhooks as enhancement; no API call
  needed inside the handler (full versioned snapshots)
- Drop the follow-up GET rule from out-of-order section
- Use the golden payment-succeeded fixture verbatim (includes fee)
- Add fee.kind extensibility and failure/cancellation_reason rules
- Add 15s response deadline and 5-day endpoint auto-disable
- Recommend a periodic reconciliation job over manual recovery
- Add processing->cancelled and created->failed diagram edges
- Note payment.settled carries status succeeded
- tx_id is chain-specific and nullable
- Rename signature headers to white-labeled webhook-*
- Agent prompt: persist/enqueue before responding 200

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Cali93
Cali93 requested a review from xikimay July 22, 2026 12:25
@Cali93

Cali93 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@xikimay all 13 comments addressed in 3454379 (replies on each thread). The two flagged-for-later items (disable toggle, message replay) are acknowledged and left for when those features ship. Re-requesting your review.

Comment thread payments/webhooks.mdx Outdated
Comment thread payments/webhooks.mdx
Comment thread payments/webhooks.mdx Outdated
Comment thread payments/webhooks.mdx Outdated

@xikimay xikimay left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One dependency before merging: the white-labeled webhook-* headers documented here require the Svix plan upgrade and the white-label setting on all three environments. Deliveries still send svix-* until that lands.

- Intro frames webhooks as enhancing the integration (riveign)
- Agent copy-prompt option now comes before the manual
  implementations in the verify step (riveign)
- Go-live checklist drops the status-poll-before-irreversible
  leftover (xikimay)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Cali93
Cali93 requested a review from riveign July 22, 2026 13:53
@Cali93
Cali93 merged commit 267d75f into main Jul 22, 2026
4 checks passed
@Cali93
Cali93 deleted the docs/webhooks branch July 22, 2026 13:55
Comment thread payments/webhooks.mdx
<Step title="Register the endpoint" stepNumber="1">

1. In the [dashboard](https://merchant.pay.walletconnect.com), make sure the **Test / Live** selector matches the mode you're setting up, since endpoints are configured separately per mode.
2. Open **Webhooks** and add your endpoint: a publicly reachable **HTTPS** URL, and the event types you want (all seven by default).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up for later, no change needed now: on the upgraded plan, deliveries come from a guaranteed static set of source IPs (EU region for us). Partners with strict firewalls will ask for the allowlist, so this register-endpoint step is where we should document them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants