Introduction - Afriex Business API

Afriex Webhooks Documentation

Afriex sends real-time webhook notifications to your configured endpoint when important resource changes happen.

How webhooks work

Afriex delivers event notifications for customer, payment method, transaction, and checkout session updates to the webhook URL you configure in your dashboard.

Set up your webhook endpoint

  1. Open the Dashboard.
  2. Go to Developers.
  3. Select the Webhooks tab.
  4. Save your webhook URL.

Example webhook URLs:

After you save your webhook URL, you can copy your webhook public key from the same screen.

Afriex IP addresses

Allowlist these IPs before going live. To receive webhook deliveries, your server must allow inbound traffic from the following Afriex IP addresses:

Environment IP Address
Sandbox 34.234.189.210
Production 34.197.33.100

Add these to your firewall allowlist. Without this, Afriex webhook requests will be blocked.

Security and signature validation

Every webhook request includes an x-webhook-signature header. You must validate this signature before processing the payload.

Always verify against the raw request body bytes. Do not verify parsed JSON.

import crypto from "crypto";

function verifySignature(
  signature: string,
  rawBody: string | Buffer,
  publicKey: string
): boolean {
  try {
    const verifier = crypto.createVerify("RSA-SHA256");
    verifier.update(rawBody);
    return verifier.verify(publicKey, signature, "base64");
  } catch {
    return false;
  }
}

Response and retries

Return a success response quickly after verification and processing.

The intended retry schedule is:

Webhook event references