OuiPay
Guides

Handle webhooks

Verify deliveries and keep your systems in sync.

1. Register a callback

In the Dashboard → Developer → your app → Webhooks, create a subscription with your HTTPS URL and the events you need. Store the signing secret.

2. Verify every POST

printf '%s.' "$TIMESTAMP" | cat - ./body.json \
  | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" \
  | awk '{print $2}'

3. Acknowledge quickly

Return 2xx after signature verification and durable enqueueing. Do heavy work asynchronously.

4. Confirm with the API

curl https://api.ouipay.africa/api/v1/external/transactions/$TRANSACTION_ID \
  -H "Authorization: Bearer $OUIPAY_SECRET_KEY"

Use the API response as the source of truth for status and amounts.