Skip to main content

Set webhook URL

Payments

Add callback_url to the request body when you call POST /offramp/initiate to create a payment for stablecoin to local currency conversion. See Stablecoin to NGN for a guide.

Wallets

Add callback_url when you call POST /wallet/create, or update it later on the wallet, so you can get webhook notifications about deposits and withdrawals on your wallet. See Create stablecoin wallet.

How notifications work

Switch sends each notification as:
  • Method: POST
  • Headers: Content-Type: application/json, x-switch-signature (HMAC-SHA256 hex digest of the raw body), x-switch-timestamp (when the request was sent; use for optional replay windows)
  • Body: JSON payload (depending on context; see Payment webhooks or Wallet webhooks)
Your server should acknowledge the request by returning any 2xx status quickly for successfully received notifications. Switch will retry delivery up to 3 times if the server does not acknowledge the request.

Verify webhooks

Always verify that incoming requests comes from Switch before you trust.

How to verify

  1. Read the body and the x-switch-signature header from the incoming request.
  2. Compute the expected webhook signature using your switch service key and the body.
  3. Compare the computed signature to the x-switch-signature from request header.
If verification fails, ignore the webhook and do not process it.

Payment webhooks

You receive these notifications whenever callback_url is set on your payment initiation request payload.

Payment status

Example payload

For a USDC on Base to Nigeria Naira (NGN) in AWAITING_DEPOSIT status.

Payload field reference

meta.session_id is only present when the bank payment has been initiated and is successfully processed.
meta.explorer_url and meta.hash are only present when the deposit has been made on-chain to the provided deposit address.

Wallet webhooks

You receive these notifications whenever callback_url is set on your wallet (at creation or via update) and the wallet receives or sends funds.

Example wallet payload

Incoming USDC on Base to the wallet address.

Wallet payload field reference

Need Help?

Email

Send us a message

Call

Book a call with us