Skip to Content
HomeLink Hub
Webhooks

Receive Pandascrow escrow webhook events

POST
/webhooks/pandascrow

Access: No user token. The request is verified by its signature header.

Server-to-server endpoint called by Pandascrow (the escrow provider); not for client use. It is mounted on the app root, outside /api/v1, and its responses use Pandascrow's { status: boolean, message? } shape rather than the standard envelope.

Verification. The raw request bytes are captured before JSON parsing (any content type, 1 MB limit). X-Pandascrow-Signature must be the hex HMAC-SHA256 of that raw body keyed with the Pandascrow secret key; the header is trimmed and lower-cased and compared in constant time. If X-Pandascrow-Timestamp (Unix seconds) is present and numeric, it must be within 5 minutes of server time; a missing timestamp is tolerated. The event name is read from the body's event, falling back to the X-Pandascrow-Event header.

Events. The escrow is looked up by EscrowTransaction.pandascrowEscrowId = data.escrow_id (or data.escrow_data._id). EscrowTransaction.status is one of pending, funded, completed, disputed, cancelled.

  • escrow.paid: pending -> funded only (so a late or repeated delivery never rolls a completed/disputed escrow back) and paymentNotifiedAt is set. The buyer, seller and commission-earning agent get an escrow_funded notification, and the buyer's socket room receives escrow:status_updated with { escrowTxId, status: "funded" }.
  • escrow.completed: status -> completed with completedAt, from any previous status. escrow_completed notifications go out only if it was not already completed. Disbursement is then triggered in the background (records the seller's release, pays the agent commission and platform fee; idempotent), and the buyer receives escrow:status_updated with status: "completed".
  • escrow.dispute.opened / escrow.disputed: status -> disputed unless already disputed; parties get an escrow_disputed notification once.
  • escrow.payout.completed: records the outcome of Pandascrow's release to the seller's bank from data.payout on the seller-proceeds Payout row: bank_succeeded -> success; bank failed but the platform wallet was credited (wallet_succeeded) -> failed, which returns the proceeds to the seller's withdrawable balance; anything else stays processing for manual review. Ignored when the escrow is unknown or was opened without a seller bank account; a payout already recorded as success is never downgraded.
  • milestone.paid: escrow (id from data._id or data.escrow_id) -> funded with paymentNotifiedAt, with no status guard and no notification.
  • recurring.payment: logged only (not implemented).
  • escrow.created, invoice.paid, wallet.deposit.success: acknowledged, no action.
  • Any other event: logged as unknown and still acknowledged.

Every verified delivery is answered with exactly { "status": true }, including unknown events and escrow ids that match nothing, because Pandascrow treats any other body as a failed delivery and retries. A handler error returns 500 so Pandascrow retries.

Header Parameters

X-Pandascrow-Signature*string

Hex HMAC-SHA256 of the raw request body, keyed with the Pandascrow secret key.

X-Pandascrow-Timestamp?integer

Unix time in seconds; rejected when more than 5 minutes from server time.

X-Pandascrow-Event?string

Event name, used when the body has no event field.

Request Body

application/json
  1. body
event?string

Event name: escrow.paid, escrow.completed, escrow.dispute.opened, escrow.disputed, escrow.payout.completed, milestone.paid, recurring.payment, escrow.created, invoice.paid or wallet.deposit.success. Falls back to the X-Pandascrow-Event header.

data*

Event payload. The handler reads escrow_id (or escrow_data._id), escrow_data.amount / currency (logging only) and, for escrow.payout.completed, the payout object (bank_succeeded, wallet_succeeded, recipient_uuid, amount, reference, provider_reference, failure_reason, status).

timestamp?integer

Event time as sent by Pandascrow. Only logged; replay protection uses the header.

Response Body

Delivery verified and handled (or acknowledged with no action).

application/json
  1. response
status*boolean
Example Request
curl -X POST 'http://localhost:4000/webhooks/pandascrow' \  -H 'X-Pandascrow-Signature: string' \  -H 'Content-Type: application/json' \  -d '{  "event": "escrow.paid",  "timestamp": 1764062561,  "data": {    "escrow_id": 48213,    "escrow_data": {      "_id": 48213,      "status": "funded",      "amount": 4500000,      "currency": "NGN"    }  }}'
Example Response
{  "status": true}