- Webhook API modules —
vivawallet.webhooks,marketplace.webhooks, andvivaIsv.webhookmanage webhook subscriptions and verification keys. - Receiver helper functions — package-root helpers build verification responses, verify Data Services signatures, extract identity/idempotency keys, and soft-validate event payloads.
Webhook Helpers
Use the detailed helper guide when implementing your webhook receiver. It documents every exported helper and when to use it.
A receiver should acknowledge Viva quickly. For slow work, return
200 OK after basic checks and process the event asynchronously.Manage Merchant and Marketplace Subscriptions
Usevivawallet.webhooks for standard merchant webhook subscriptions. The Marketplace client exposes the same webhooks module for platform credentials.
Retrieve a Webhook Verification Key
Merchant and marketplace webhook verification uses a key returned byretrieveWebhookKey().
buildVivaMerchantWebhookVerificationBody() or buildVivaMerchantWebhookVerificationResponse() when Viva verifies your endpoint. See Webhook Helpers for receiver examples.
Create ISV Webhooks
VivaISV exposes webhook.create(options) for ISV webhook setup. The alias webhooks points to the same module.
buildVivaIsvWebhookVerificationBody() or buildVivaIsvWebhookVerificationResponse() for ISV endpoint verification.
Type Incoming Payloads
For lightweight payload typing, useVivaWebhookDatas<T> with a known event-data type.
SmartCheckoutWebhookEventDatas and ConnectedAccountWebhookEventDatas aliases.
Receiver Checklist
- Answer Viva’s endpoint verification challenge with the right helper: merchant/marketplace responses use
Key, ISV responses usekey. - For signed Data Services webhooks, verify
Viva-Signature-256orViva-Signatureagainst the raw body before trusting the payload. - Extract identity and an idempotency key before processing so retries do not duplicate side effects.
- Run the event-specific soft validator for the webhook family you are handling.
- Persist the event or enqueue background work, then return
200 OKquickly when the delivery is accepted.