> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flyskye.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Signed events when payment is captured and when a booking is ticketed, pending or failed.

Add an HTTPS endpoint in the [partner console](https://dashboard.flyskye.ai) under **Webhooks** and pick its events. The console
shows the endpoint's signing secret once, sends a signed test event on demand, and lists recent deliveries. Up to 3 endpoints;
each gets both sandbox and live events, and `mode` says which.

## Events

| Event | When |
| - | - |
| `payment.captured` | The traveller's payment was taken. |
| `booking.ticketed` | The ticket is issued. `data.pnr` is set. |
| `booking.pending` | Paid and waiting on the airline to confirm. |
| `booking.failed` | Booking failed; the traveller is refunded. |

## Payload

```json theme={"system"}
{
  "id": "evt_...",
  "type": "booking.ticketed",
  "created": "2026-11-19T17:05:00.000Z",
  "mode": "live",
  "data": {
    "sessionId": "5b0c...",
    "status": "ticketed",
    "bookingId": "...",
    "pnr": "ABC123",
    "paymentId": "pay_...",
    "amount": 6412,
    "currency": "INR"
  }
}
```

## Verify the signature

Each delivery carries three headers:

| Header | Value |
| - | - |
| `Skye-Event-Id` | The event id. Deduplicate on it. |
| `Skye-Event-Type` | The event type. |
| `Skye-Signature` | `t=<unix seconds>,v1=<hex>`, where `v1` is the HMAC SHA256 of `t.rawBody` with your secret. |

Verify against the raw request body, before parsing it. Return any 2xx.

```js Node.js theme={"system"}
import crypto from "node:crypto";

export function verifySkyeSignature(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false; // stale
  const expected = crypto.createHmac("sha256", secret).update(parts.t + "." + rawBody).digest("hex");
  const a = Buffer.from(parts.v1 ?? ""), b = Buffer.from(expected);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}
```

```python Python theme={"system"}
import hashlib, hmac, time

def verify_skye_signature(raw_body: bytes, header: str, secret: str) -> bool:
    parts = dict(p.split("=", 1) for p in header.split(","))
    if abs(time.time() - int(parts["t"])) > 300:  # stale
        return False
    signed = parts["t"].encode() + b"." + raw_body
    expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
    return hmac.compare_digest(parts.get("v1", ""), expected)
```

> [!NOTE]
>
> Failed deliveries are retried up to 8 times over several hours, so deduplicate on the event id.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.