Events

Webhooks

Receive XXPayUS events on your server as they happen.

Add an https:// endpoint in Developers → Webhooks and choose the events to receive. XXPayUS sends each event as a POST request with a JSON body.

Event types

EventSent when
payment.createdA payment is created
payment.completedA payment completes
payment.failedA payment fails
tag_payment.completedA Tag Payment is approved by an administrator
tag_payment.failedA Tag Payment is rejected by an administrator
withdrawal.requestedA withdrawal is requested
withdrawal.approvedA withdrawal is approved
withdrawal.rejectedA withdrawal is rejected

Payload

json
{
  "id": "0f6c2c1e-…",
  "event": "payment.created",
  "created_at": "2026-10-06T16:00:00.000Z",
  "data": {
    "transaction_id": "TX8F2K1Q",
    "method": "cashapp",
    "amount": 50,
    "status": "pending",
    "expires_at": "2026-10-06T16:30:00.000Z"
  }
}

Tag Payment webhook payloads

Tag Payment events are sent to subscribed webhook endpoints. The completed event includes the approved settlement reference and platform fee. The failed event includes the rejection reason and refunded total charge. These events reflect administrator decisions, not automated external payouts.

tag_payment.completed
{
  "id": "WEBHOOK_EVENT_UUID",
  "event": "tag_payment.completed",
  "created_at": "2026-11-11T16:00:00.000Z",
  "data": {
    "tag_payment_id": "TAG_PAYMENT_UUID",
    "transaction_id": "TAGREQ-EXAMPLE",
    "method": "cashapp",
    "amount": 100,
    "status": "approved",
    "settlement_id": "SETTLEMENT_REFERENCE",
    "platform_fee": 0.40
  }
}
tag_payment.failed
{
  "id": "WEBHOOK_EVENT_UUID",
  "event": "tag_payment.failed",
  "created_at": "2026-11-11T16:00:00.000Z",
  "data": {
    "tag_payment_id": "TAG_PAYMENT_UUID",
    "transaction_id": "TAGREQ-EXAMPLE",
    "method": "cashapp",
    "amount": 100,
    "status": "rejected",
    "failure_reason": "Request rejected",
    "total_charge_refunded": 103.40,
    "refunded": true
  }
}

Headers

HeaderDescription
x-xxpayus-eventEvent type
x-xxpayus-deliveryUnique delivery ID
x-xxpayus-signaturesha256=<HMAC-SHA256 of the raw body, hex>

Verify the signature

Compute an HMAC-SHA256 of the raw request body with your endpoint's signing secret (whsec_…) and compare it with the header using a constant-time comparison. Reject the request if they differ.

Node.js
import crypto from "crypto";

export function verify(rawBody, header, secret) {
  const expected = "sha256=" +
    crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
  const a = Buffer.from(expected);
  const b = Buffer.from(header || "");
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

Delivery and retries

  1. 1Accept HTTPS POST requests containing a JSON payload. Return any HTTP 2xx status within 10 seconds to acknowledge successful processing.
  2. 2Failed deliveries are retried automatically using exponential backoff: 2, 4, 8, 16, then 32 minutes between attempts, capped at 60 minutes. Delivery attempts are limited by the configured maximum.
  3. 3Verify the x-xxpayus-signature header using your endpoint signing secret before processing any event.
  4. 4Use the x-xxpayus-delivery header to deduplicate retries. Store processed payment transaction IDs to prevent duplicate fulfillment.
  5. 5Your webhook URL must have a working POST handler. HTTP 404, 401, 403, 429, and 5xx responses are treated as failed deliveries.
  6. 6Webhook retries are processed automatically approximately every minute when due. Every delivery and its latest result is visible in Developers → Webhook Logs.