Wallet

Wallet webhooks

Funding and transfer events. HMAC-SHA512 on the raw body. De-duplicate by eventId.

PayInvert POSTs wallet events to the same webhook URL as payment notifications, under Settings โ†’ API Keys & Webhooks. Payment events still use x-api-key โ€” see Webhooks. These events are signed.

Delivery

  • POST with Content-Type: application/json.
  • Reply with any 2xx within 15 seconds. Redirects are not followed.
  • Retries grow (about 1, 2, 4, 8, 16 minutes, then up to every 2 hours). 12 attempts over about 10 hours, then it stops. Use the GET endpoints to catch anything you missed.
  • De-duplicate by eventId. Events can arrive out of order โ€” act on data.status.
  • Test and live both go to the same URL. Every event has environment (test or live) and X-PayInvert-Environment. Verify with the secret key for that world. Never act on a test event in live.
HeaderValue
X-PayInvert-Event-IdSame as eventId in the body
X-PayInvert-Environmenttest or live
X-PayInvert-TimestampUnix time in seconds when this attempt was sent
X-PayInvert-Signaturesha512= followed by lowercase hex HMAC

Verify the signature

  1. Read the raw request body. Do not parse and re-serialise it first.
  2. Build <X-PayInvert-Timestamp>.<raw body>.
  3. HMAC-SHA512 of that string, keyed with your secret key for that world.
  4. Prefix sha512= to the lowercase hex, and compare with a constant-time comparison.

Each retry is signed again with a new timestamp. If you reject old timestamps, base that on when you received the event, and still de-duplicate by eventId.

javascript
const crypto = require("crypto");
const express = require("express");
const app = express();

function isValid(rawBody, timestamp, signature, secretKey) {
  const expected = "sha512=" + crypto
    .createHmac("sha512", secretKey)
    .update(`${timestamp}.${rawBody}`)
    .digest("hex");
  const a = Buffer.from(expected);
  const b = Buffer.from(signature || "");
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

app.post("/webhooks/payinvert", express.raw({ type: "application/json" }), (req, res) => {
  const raw = req.body.toString("utf8");
  const ok = isValid(raw, req.get("X-PayInvert-Timestamp"), req.get("X-PayInvert-Signature"), process.env.PAYINVERT_SECRET_KEY);
  if (!ok) return res.sendStatus(401);
  const event = JSON.parse(raw);
  // De-duplicate on event.eventId, then queue the work and reply fast.
  res.sendStatus(200);
});
csharp
using System.Security.Cryptography;
using System.Text;

static bool IsValid(string rawBody, string timestamp, string signature, string secretKey)
{
    using var hmac = new HMACSHA512(Encoding.UTF8.GetBytes(secretKey));
    var hash = hmac.ComputeHash(Encoding.UTF8.GetBytes($"{timestamp}.{rawBody}"));
    var expected = "sha512=" + Convert.ToHexString(hash).ToLowerInvariant();
    return CryptographicOperations.FixedTimeEquals(
        Encoding.UTF8.GetBytes(expected), Encoding.UTF8.GetBytes(signature ?? ""));
}
InputValue
Secret keyyour-test-secret-key
Timestamp1763373672
Body{"eventId":"evt_example","type":"funding.received","schemaVersion":1}
Signaturesha512=cae76f24f73d86bac1a9f520f7cf1a55c0d4f1bb31c9c4f42283f85f145ab2da958b587362b91a3444090a8ddf22aaa31e91f856ab7ef4de6d889da2de26d568

Events

typeSent when
funding.receivedMoney sent to your funding account was credited to Main
transfer.pendingThe transfer is accepted and money is held, or it has been sent to the bank
transfer.succeededThe beneficiary was paid
transfer.failedFailed, rejected, or cancelled. Can arrive twice: failed_recovery_pending then failed_released.
transfer.reversedA paid transfer was returned; the amount (not the fee) is credited back to Main

funding.received

json
{
  "eventId": "evt_7k2m9q4w1x8r0t5v3n6b2c4d9f",
  "type": "funding.received",
  "environment": "live",
  "schemaVersion": 1,
  "occurredAt": "2026-11-17T09:41:12Z",
  "data": {
    "receiptId": "frc_48213",
    "status": "posted",
    "grossMinor": 2500000,
    "providerFeeMinor": 0,
    "payinvertFeeMinor": 0,
    "netMinor": 2500000,
    "currency": "NGN",
    "senderName": "ADA OKAFOR",
    "senderBank": "Access Bank",
    "bankReference": "000013261117094058123456789012",
    "receivedAt": "2026-11-17T09:40:58Z",
    "postedAt": "2026-11-17T09:41:11Z"
  }
}

transfer.*

json
{
  "eventId": "evt_5g1h4j7k0l3z6x9c2v5b8n1m",
  "type": "transfer.succeeded",
  "environment": "live",
  "schemaVersion": 1,
  "occurredAt": "2026-11-17T10:16:10Z",
  "data": {
    "transferId": "trf_7k2m9q0x4v8n3b1c6d5e0f9a",
    "reference": "PAYOUT-2026-0001",
    "status": "succeeded",
    "amountMinor": 150000,
    "feeMinor": 5000,
    "currency": "NGN",
    "sourceWallet": "main",
    "provider": "BANK",
    "providerReference": "PIT4K9Q2M7X1R8T5V3NB",
    "beneficiary": {
      "bankCode": "000013",
      "accountName": "JOHN DOE",
      "accountNumberMasked": "******6789"
    },
    "fundsReleased": false,
    "failureReason": null
  }
}