Webhooks Preview
Sales reach your system the moment they happen.
Set up
Add an HTTPS endpoint in the portal under Developers, choose its events, and copy its signing secret. Every event is a JSON POST.
POST /collegeseats HTTP/1.1
Host: your-pos.example.com
Content-Type: application/json
CollegeSeats-Event: sale.created
CollegeSeats-Delivery: whd_01J9ZK3T8Q
CollegeSeats-Signature: t=1820246040,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd
{
"id": "evt_01J9ZK3T8Q",
"type": "sale.created",
"created": 1820246040,
"data": {
"sale_id": "sl_7Q2K9",
"your_id": "48117",
"section": "214",
"row": "8",
"quantity": 2,
"payout": "156.00",
"confirm_by": "2027-09-02T02:14:00Z"
}
}Verify the signature
CollegeSeats-Signature is t= (seconds since 1970) and v1=, the hex HMAC-SHA256 of {t}.{raw body} with your signing secret. Check it before you trust the body, and reject a timestamp more than five minutes old.
import hashlib
import hmac
import time
def verify(secret: str, header: str, body: bytes, tolerance: int = 300) -> bool:
"""True when CollegeSeats sent this body. Pass the raw bytes, not parsed JSON."""
parts = dict(item.split("=", 1) for item in header.split(","))
signed = parts["t"].encode() + b"." + body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
fresh = abs(time.time() - int(parts["t"])) <= tolerance
return fresh and hmac.compare_digest(expected, parts["v1"])import { createHmac, timingSafeEqual } from 'node:crypto';
// True when CollegeSeats sent this body. Pass the raw body, not parsed JSON.
export function verify(secret, header, rawBody, tolerance = 300) {
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
const expected = createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) <= tolerance;
const a = Buffer.from(expected);
const b = Buffer.from(parts.v1 ?? '');
return fresh && a.length === b.length && timingSafeEqual(a, b);
}Respond and retries
- Answer any 2xx within 10 seconds. Do slow work after you answer.
- We retry anything else for 24 hours, with backoff: 1 minute, 5, 30, then hourly.
- Deliveries can repeat and arrive out of order. Use the event
idto skip ones you have seen, and read the sale again if order matters. - We email you about every sale too, so a sale is never lost if your system is down.
Events
| Event | When | data |
|---|---|---|
sale.created | A buyer paid for one of your listings. Confirm or decline before confirm_by. | sale |
sale.expired | A sale was not confirmed in time. The buyer was not charged. | sale |
sale.cancelled | A confirmed sale was cancelled, for example the game was cancelled. | sale |
delivery.due | A reminder: a confirmed sale is due for delivery within 6 hours. | sale |
delivery.late | A confirmed sale passed deliver_by without a delivery. | sale |
file.processed | A file finished, with its results. Useful for SFTP, which has no response. | file |
payout.paid | A weekly payout left for your bank. | payout |