Skip to main content

Webhook Payload Examples

This guide provides complete webhook payload examples for each supported currency. Mavapay sends webhooks for two main event types: payment.received (DEPOSIT) and payment.sent (WITHDRAWAL).

Event Types

Bitcoin (BTC) Webhooks

payment.received (Deposit)

Triggered when Bitcoin payment is received via Lightning Network.

Key Fields

payment.sent (On-Chain Withdrawal)

Triggered when Bitcoin is sent on-chain to a beneficiary address.

On-Chain Specific Fields

On-chain withdrawals remain in PENDING status until there are 3 block confirmations, after which the status changes to SUCCESS.

USDT Webhooks

USDT deposits and withdrawals use the same payment.received and payment.sent events as other currencies. Metadata is on stablecoinTransactionMetadata. The transaction currency is "USDT".
Amounts are in USDT cents (2 decimal places). Divide by 100 to get USDT. For example, 1000 = 10 USDT, 300 = 3 USDT.

payment.received (Deposit)

Fired after the on-chain deposit has been processed by Mavapay core.
  • status: "SUCCESS" — the funds are available in your USDT wallet
  • status: "FAILED" — the deposit was not credited. This can happen if the sending address is blacklisted, or in rare undocumented cases

Key Fields

A FAILED deposit means the on-chain transfer was not credited to your wallet. Handle FAILED the same way you handle SUCCESS: acknowledge the webhook and update the customer. Do not retry crediting the funds yourself.

payment.sent (Withdrawal initiated)

Fired when you call Withdraw stablecoin. The transfer is not on-chain yet: status is PENDING and hash is null.

payment.sent (Withdrawal completed)

Fired when the withdrawal is completed. status is SUCCESS and hash is now set. The transaction id is the same as the pending webhook.

Withdrawal Fields

Treat the pending and completed payment.sent events as the same withdrawal (data.id does not change). Use idempotency so you do not double-process the completed event.
Triggered when a Payment Link transaction is fully settled (after block confirmations for on-chain).

Key Fields

Nigerian Naira (NGN) Webhooks

payment.received (Deposit)

Triggered when NGN payment is received in your Mavapay account.

Key Fields

NGN amounts are in kobo. Divide by 100 to get the amount in Naira.

South African Rand (ZAR) Webhooks

payment.sent (Withdrawal)

Triggered when ZAR payment is sent to a beneficiary.

Key Fields

ZAR amounts are in cents. Divide by 100 to get the amount in Rand.

Kenyan Shilling (KES) Webhooks

payment.sent (Withdrawal)

Triggered when KES payment is sent via mobile money (M-Pesa or Airtel) or M-Pesa paybill/till.

Key Fields

KES amounts are in cents. Divide by 100 to get the amount in Shillings.

Ghanaian Cedi (GHS) Webhooks

payment.sent (Withdrawal)

Triggered when GHS payment is sent via MTN Mobile Money.

Key Fields

GHS amounts are in pesewa. Divide by 100 to get the amount in Cedis.

Transaction Status Values

Handling Webhooks

1. Verify Webhook Signature

Always verify the webhook signature to ensure it’s from Mavapay:

2. Process Webhook Events

3. Implement Idempotency

Use the transaction ID to prevent duplicate processing:

Best Practices

  1. Respond Quickly: Return a 200 status within 5 seconds to acknowledge receipt
  2. Process Asynchronously: Handle heavy processing in background jobs
  3. Store Raw Payloads: Log raw webhook payloads for debugging
  4. Handle Retries: Implement idempotency to handle duplicate webhooks
  5. Monitor Failures: Set up alerts for failed webhook deliveries

Testing Webhooks

Use our staging environment to test webhook integration:
Consider using tools like:

Next Steps