Tranzak Docs
tranzak.co Dashboard
Docs  /  Payouts

Payout webhooks

Receive a signed webhook when a payout is completed or fails, with the payload, headers, retry schedule and signature verification.

Tranzak sends a webhook to your server as soon as the result of a payout is known, so you do not need to poll.

Event Sent when
payout.completed The money was sent to the beneficiary.
payout.failed The payout could not be completed. The amount and the fee were returned to the payout wallet of the network.

A payout that is only delayed (pending) does not send a webhook: it will send payout.completed or payout.failed when it ends.

Where it is sent

To the callback URL of the website that owns the API key used to create the payout. Set it, and read your webhook secret, in the dashboard under Developers. The URL must be a public https address.

If the payout was created from the dashboard, Tranzak uses the first of your websites that has a callback URL.

Request

POST to your callback URL with a JSON body and these headers:

Header Value
X-Tranzak-Signature hex(HMAC-SHA256(webhook_secret, raw body))
X-Tranzak-Event payout.completed or payout.failed
X-Tranzak-Timestamp Unix time of the event
Content-Type application/json

payout.completed

{
  "event": "payout.completed",
  "timestamp": 1760366400,
  "data": {
    "payout_id": "PAY_3B1D0A77C4E21F90",
    "reference": "PAYROLL-2026-10-001",
    "network": "moncash",
    "receiver": "50937000000",
    "description": "October salary",
    "amount": 1000,
    "fee": 35,
    "total_debited": 1035,
    "currency": "HTG",
    "status": "completed",
    "failure_reason": null,
    "created_at": "2026-10-13T14:31:02.000000Z",
    "completed_at": "2026-10-13T14:31:09.000000Z"
  }
}

payout.failed

{
  "event": "payout.failed",
  "timestamp": 1760366460,
  "data": {
    "payout_id": "PAY_7C2E9B10A5D34F18",
    "reference": "PAYROLL-2026-10-002",
    "network": "moncash",
    "receiver": "50937000001",
    "amount": 500,
    "fee": 17.5,
    "total_debited": 517.5,
    "currency": "HTG",
    "status": "failed",
    "failure_code": "receiver_not_found",
    "failure_message": "The receiver number is incorrect or does not exist on the selected network. Check the number. Your Treasury account was refunded.",
    "retryable": true,
    "failure_reason": "receiver_not_found",
    "refund_status": "refunded",
    "refunded_at": "2026-10-13T14:32:09.000000Z",
    "refunded_to": "wallet_moncash",
    "total_refunded": 517.5,
    "created_at": "2026-10-13T14:32:00.000000Z",
    "completed_at": null
  }
}

Use failure_code (stable) in your logic. The values and what to do for each one are listed in Payouts API → Failed payouts. failure_reason repeats failure_code and is kept for compatibility.

A payout.failed event means the money was already refunded to your wallet (see the refund_* fields): you do not need to wait for your webhook to be delivered, and you do not need to ask for a refund.

Verify the signature

Always verify the signature on the raw request body before you trust the request. The method is the same as for payment webhooks: see Verify the signature.

$raw = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_TRANZAK_SIGNATURE'] ?? '';

if (!hash_equals(hash_hmac('sha256', $raw, $secret), $signature)) {
    http_response_code(403);
    exit;
}

$event = json_decode($raw, true);
// $event['event'] is payout.completed or payout.failed
const crypto = require('crypto');

// rawBody is a Buffer (Express: express.raw({ type: 'application/json' }))
const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
const ok = signature.length === expected.length &&
  crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature));

Answer, retries and idempotency

  • Answer with any 2xx status within 15 seconds once you have stored the event.
  • Any other answer, or a timeout, is retried 4 more times after 1 minute, 5 minutes, 15 minutes and 1 hour.
  • Webhooks can be delivered more than once. Make your handler idempotent: ignore an event if you already processed this data.payout_id for this event.
  • If a webhook never reaches you, poll GET /payouts/{payout_id}: the payout status is always available there.

Test locally

Your callback URL must be a public https address. While developing, expose your machine with a tunnel and register the tunnel URL as your callback URL. The payout status can always be read with the API, with or without webhooks.