For the complete documentation index, see llms.txt. This page is also available as Markdown.

Webhooks

Receive real-time notifications when payment events occur. Webhooks allow your application to react instantly to completed payments without polling.

Looking for Vault webhooks? This page covers merchant payment webhooks (payment.* events). Vault deposit and withdrawal webhooks (deposit.*, withdrawal.*) use a separate configuration and signature scheme — see Vault → Webhooks.


Overview

┌─────────────────┐         ┌─────────────────┐         ┌─────────────────┐
│    Customer     │         │    MakaPay      │         │   Your Server   │
│                 │         │                 │         │                 │
│  Sends payment  │ ──────→ │  Processes      │         │                 │
│                 │         │  payment        │         │                 │
│                 │         │       ↓         │         │                 │
│                 │         │  Sends webhook  │ ──────→ │  Receives POST  │
│                 │         │                 │         │  request        │
│                 │         │                 │         │       ↓         │
│                 │         │                 │         │  Fulfills order │
└─────────────────┘         └─────────────────┘         └─────────────────┘

Native app status: iOS and macOS apps can subscribe to the read-only Convex query payment:getPublicCheckout for payer-facing, real-time UI updates. This does not replace signed merchant webhooks: fulfillment must be driven from the merchant backend, and a MakaPay API key must never be shipped in a mobile app. See Native App Real-Time Checkout.


Setup

Prerequisites

  • An active API key (required for webhook authentication)

  • An HTTPS endpoint on your server

Option A: Configure via Dashboard

  1. Go to Dashboard → Webhooks

  2. Enter your webhook URL (must be HTTPS)

  3. Toggle Active to enable

  4. Click Save

Option B: Configure via API

You can manage webhooks programmatically using the Payment Webhook Configuration API:

See the API Reference for full details.

Webhook Signing Secret

When you create a webhook via the API, a dedicated signing secret (whsec_...) is generated. This secret is used to sign webhook payloads instead of your API key, providing better security isolation.

  • The full secret is only returned on creation and regeneration

  • Subsequent reads show a masked preview: whsec_************************abcd1234

  • Use POST /api/v1/webhooks with {"action": "regenerate-secret"} to rotate the secret

  • Existing webhooks created via the dashboard continue using the API key for signing (backward compatible)

Event Filtering

Subscribe only to the events you need:

  • payment.detected — Expected amount observed before final confirmation (opt-in; Universal USDC)

  • payment.bridging — CCTP source burn confirmed; destination mint pending (opt-in; Universal USDC)

  • payment.completed — Payment confirmed (default)

  • payment.withdrawn — Funds sent to merchant wallet (default)

  • payment.awaiting_gas — Gas tank needs top-up

  • payment.failed — Payment failed

  • payment.expired — Payment expired

If no events are specified, defaults to ["payment.completed", "payment.withdrawn"].

Generate API Key

If you don't have an API key:

  1. Go to Dashboard → API Keys

  2. Click Create New Key

  3. Save the key securely


Webhook Events

payment.detected

Opt-in early signal for Universal USDC. Sent once when cumulative matching USDC reaches the expected amount, before the configured confirmation threshold and before settlement. Never fulfill an order from this event; wait for payment.completed.

Subscribe explicitly through PUT /api/v1/webhooks:

The event uses the same signing secret, X-Signature algorithm, delivery logs, and three-attempt retry policy as other payment webhooks. It is not included in the default event list.

For a fiat-denominated Universal USDC payment, amount and cryptoAmount are the locked payable USDC amount. The original bill and immutable quote fields are present on every Universal lifecycle webhook, including payment.completed; fulfillment must never recalculate the amount from a current FX rate.

For routed Universal USDC, every lifecycle webhook also contains cctpDeliveryMode, with the exact forwarding or self-relay value snapshotted when the payment intent was created. This field describes MakaPay's delivery path; it is not an instruction for the merchant to relay the CCTP message. Self-relay remains pending through attestation and destination claim, so fulfillment must still wait for payment.completed.

payment.bridging

Opt-in signal for routed Universal USDC. Sent after the source-chain sweep and CCTP burn are confirmed. The merchant does not have the funds yet; fulfill only after payment.completed. The payload includes settlementMode: "routed", the destination chain/address, and bridge source/destination identifiers plus the burn transaction hash.

payment.completed

Sent when a payment is successfully settled to your wallet.

terminal is set when the payment originated from a POS business (the orderId follows POS-{CODE}-{CASHIER}-{TIMESTAMP}). It's null for regular payment-link payments and for POS payments whose business record has been deleted. terminalId is the stable identifier you should store; code is the short value embedded in orderId; name is the dashboard display Location. Same shape as the terminal field on GET /v1/payments.

For fiat-denominated USDC payments, amount remains the payable crypto amount; cryptoAmount and cryptoCurrency provide explicit aliases for integrations. fiatCurrency, fiatAmount, usdEquivalent, exchangeRate, spreadApplied, and rateLockedAt carry the immutable quote captured at payment creation. These fields are omitted for existing token-denominated payments.

payment.withdrawn

Sent when a partial payment is manually withdrawn.

payment.awaiting_gas

Sent when payment is received but Gas Tank balance is insufficient. Informational only - no retry on this event.


Webhook Security

Signature Verification

Every webhook includes a signature header for verification:

The signature is computed as SHA-256(payload + signingKey) — a SHA-256 hash of the raw JSON body concatenated with your signing key.

Signing key priority:

  • If you created/updated your webhook via the API and received a whsec_... secret, that secret is used as the signing key.

  • For legacy webhooks configured via the dashboard (before dedicated secrets were introduced), the API key is used as the signing key.

Verifying the Signature (Node.js)

Python Example


Retry Policy

Failed webhook deliveries are automatically retried:

Attempt
Delay

1st

Immediate

2nd

5 minutes

3rd

10 minutes

What Counts as Failure

  • HTTP status code outside 200-299

  • Connection timeout (30 seconds)

  • SSL/TLS errors

  • DNS resolution failure

After All Retries Fail

  • Webhook is marked as failed

  • No further automatic retries

  • You can manually retry from the dashboard


Best Practices

1. Respond Quickly

Return a 200 response as fast as possible. Do heavy processing asynchronously.

2. Implement Idempotency

Webhooks may be delivered more than once. Use paymentId to prevent duplicate processing.

3. Verify Signatures

Always verify the X-Signature header before processing.

4. Use HTTPS

Webhook URLs must use HTTPS. HTTP endpoints are rejected.

5. Handle All Event Types

Your endpoint should gracefully handle unknown event types:


Testing Webhooks

Manual Trigger

  1. Go to Dashboard → Payments

  2. Click on a completed payment

  3. Click Resend Webhook

  4. Check your webhook logs

Webhook Logs

View delivery history in Dashboard → Webhooks → Logs:

Column
Description

Payment ID

Associated payment

Status

success / failed / pending

Status Code

HTTP response code

Attempts

Delivery attempts made

Response

Server response (truncated)

Local Testing

Use a tunnel service like ngrok for local development:


Payload Reference

Common Fields

Field
Type
Description

event

string

Event type

paymentId

string

Unique payment identifier

orderId

string

Your order reference

merchant

string

Merchant wallet address

recipientAddress

string

Payment address

amount

string

Payment amount

token

string

Token contract address

chainId

number

Blockchain network ID

status

string

Payment status

timestamp

number

Unix timestamp (ms)

Optional Fields

Field
Type
When Present

description

string

If provided at creation

transactionHash

string

On completed payments

withdrawalTransactionHash

string

On withdrawals

amountWithdrawn

string

On partial withdrawals

overpayment

string

If customer overpaid

feeDetails

object

On completed payments

blockConfirmations

number

If confirmations required

intentVersion

number

2 for Universal USDC V2 intents

destinationChainId

number

Universal USDC destination chain

settlementMode

direct | routed

Universal USDC lifecycle webhooks

cctpDeliveryMode

forwarding | self-relay

Routed Universal USDC lifecycle webhooks

bridge

object

CCTP burn/mint state for cross-chain delivery


Troubleshooting

Webhook Not Received

  1. Check webhook is Active in dashboard

  2. Verify URL is correct and uses HTTPS

  3. Check your server logs for incoming requests

  4. Review webhook logs for delivery status

Signature Mismatch

  1. Ensure you're using the correct API key

  2. Verify you're hashing the raw JSON payload

  3. Check for encoding issues (UTF-8)

Timeouts

  1. Respond with 200 before processing

  2. Move heavy operations to background jobs

  3. Increase server timeout if needed

Duplicate Events

  1. Implement idempotency using paymentId

  2. Check webhook logs for retry attempts

  3. Review your response codes (non-2xx triggers retry)

Last updated