Skip to content
Reference

Webhooks

We POST a signed JSON event to your endpoint every time a payment or payout changes state.

Endpoints

There are two ways to receive events:

  • Webhook endpoints — add URLs under Developers → Webhooks, subscribe each to specific events, payment.*/payout.* wildcards or *. Each endpoint has its own signing secret (whsec_…).
  • ipn_callback_url — set on a payment, invoice or payout to receive that object's events. These are signed with your account's IPN secret for the mode, shown in the dashboard.

URLs must be HTTPS on a public host. Endpoints are per mode: test events only go to test endpoints.

Events

EventWhen
payment.waitingA customer picked a coin on an invoice checkout (payment created).
payment.confirmingA transfer was detected and is gaining confirmations.
payment.partially_paidConfirmed amount is short of the requested amount.
payment.confirmedFully paid; forward sweep queued (forward settlement).
payment.sendingForward sweep broadcast.
payment.finishedFulfil the order. Credited (hold) or swept to your wallet (forward).
payment.expiredWindow closed with no funds.
payout.awaiting_approvalPayout needs compliance approval.
payout.processingPayout queued for broadcast.
payout.broadcastPayout sent; txid available.
payout.finishedPayout confirmed.
payout.failed / payout.rejectedPayout not sent; funds returned to your balance.
For hold settlement a payment goes straight to finished once confirmed. If you settle by forwarding, you can fulfil on payment.confirmed — the funds are final on-chain; finished only means the sweep to your wallet landed.

Payload

Every delivery has the same envelope. data is the full object, exactly as the API returns it.

POST your-endpoint
{
  "id": "evt_0Nf3kRbX9dS2aW5pT0dU4zOe",
  "type": "payment.finished",
  "created": 1795432800,
  "livemode": false,
  "data": {
    "id": "pay_0Nf3kQ8z4Hc2xT7mP1aR9wLb",
    "object": "payment",
    "status": "finished",
    "livemode": false,
    "order_id": "order_1042",
    "description": null,
    "price_amount": "49",
    "price_currency": "USD",
    "pay_asset": "USDT_TRC20",
    "pay_asset_label": "USDT · TRC20",
    "network": "tron",
    "pay_amount": "49",
    "pay_address": "TQ5b8mC1xJ2v9L7aHkR3pW4nYdE6sF0gUt",
    "memo": null,
    "rate": "1",
    "amount_received": "49",
    "amount_pending": "0",
    "fee_amount": "0.245",
    "net_amount": "48.755",
    "settlement": "hold",
    "forward_txid": null,
    "flags": [],
    "invoice_id": null,
    "checkout_url": "https://lipacoin.io/i/pay_0Nf3kQ8z4Hc2xT7mP1aR9wLb",
    "customer_email": null,
    "metadata": {},
    "transactions": [],
    "required_confirmations": 20,
    "expires_at": "2026-11-23T11:00:00.000Z",
    "created_at": "2026-11-23T10:00:00.000Z",
    "updated_at": "2026-11-23T10:00:00.000Z",
    "finished_at": null
  }
}
HeaderValue
Content-Typeapplication/json
Lipacoin-Signaturet=1795432800,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd
X-Event-IdThe event id — use it to de-duplicate.
User-AgentLipacoin-Webhooks/1.0

Verifying signatures

The signature is an HMAC-SHA256, keyed with your signing secret, over the timestamp, a literal dot and the raw request body:

Signed payload
v1 = hex( HMAC_SHA256( secret, t + "." + raw_body ) )
  1. Split the header on , and read t and v1.
  2. Compute the HMAC over ${t}.${raw_body} using the raw bytes you received — re-serialized JSON won't match.
  3. Compare in constant time, and reject timestamps older than ~5 minutes to stop replays.
import crypto from "node:crypto";

// Use the RAW request body — not a re-serialized JSON object.
export function verifyLipacoin(rawBody, header, secret, toleranceSec = 300) {
  const parts = Object.fromEntries(
    String(header).split(",").map((p) => p.trim().split("=", 2)),
  );
  const t = Number(parts.t);
  if (!t || !parts.v1) return false;
  if (Math.abs(Date.now() / 1000 - t) > toleranceSec) return false; // replay guard

  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${t}.${rawBody}`)
    .digest("hex");
  const a = Buffer.from(expected), b = Buffer.from(parts.v1);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

// Express
app.post("/webhooks/lipacoin", express.raw({ type: "application/json" }), (req, res) => {
  const raw = req.body.toString("utf8");
  if (!verifyLipacoin(raw, req.get("Lipacoin-Signature"), process.env.LIPACOIN_WEBHOOK_SECRET)) {
    return res.sendStatus(400);
  }
  const event = JSON.parse(raw);
  if (event.type === "payment.finished") fulfil(event.data.order_id);
  res.sendStatus(200);
});

Delivery & retries

Respond with any 2xx within 10 seconds. Anything else — a non-2xx status, a timeout, a connection error, or a redirect (redirects aren't followed) — is retried with backoff:

attempt 1→+1 minute (attempt 2)→+5 minutes (attempt 3)→+30 minutes (attempt 4)→+2 hours (attempt 5)→+6 hours (attempt 6)→+24 hours (attempt 7)

That's 7 attempts over roughly 33 hours, after which the delivery is marked failed. You can inspect and manually resend any delivery from the dashboard.

Make handlers idempotent
Delivery is at-least-once and events can arrive out of order. Key your processing on the event id, and when ordering matters re-fetch the object (GET /v1/payments/:id) for its current status.