Ticket and drop scalping

Give limited releases to fans, not bots.

10 minutes

Concert tickets and sneaker drops sell out to scripts in seconds. Spot automated checkouts and one buyer behind many carts.

What you will build: a check on the action you protect that allows normal users, asks doubtful ones to verify, and blocks the clear cases. See the ticket and drop scalping overview for the attack in pictures.

Before you start

Finish one Web quickstart (for example JavaScript or React) and one Server quickstart (for example Node.js). The decision code below is TypeScript; every server SDK returns the same event.

How the attack works

  • Checkout bots. Carts filled faster than any person can click.
  • Account armies. Many accounts to beat per-person limits.
  • Cloud fleets. Hundreds of headless browsers at release time.

What to look at

FieldWhy it matters here
automatedInputClicks and keys no person produces.
botHeadless and automated browsers.
multiAccountOne device behind many buyer accounts.
  1. 1

    Identify on the action

    Call the browser SDK when the user performs the action, not on page load, and send the eventId with the request. Pass your own user id as linkedId whenever you have one: the account signals count by it.

    TypeScript
    const { eventId } = await trace.get({ linkedId: user?.id, tags: { action: 'scalping' } });
  2. 2

    Verify on your server

    import { verifyEvent } from '@trace-id/sdk-node';
    
    const event = await verifyEvent(eventId, { secretKey: process.env.TRACE_SECRET_KEY!, endpoint, timeoutMs: 1500 }).catch(() => null);

    Events can be verified for 60 minutes. If verification fails, decide whether to fail open or closed; for most of this flow, fail open.

  3. 3

    Decide

    TypeScript
    const { signals, deviceId } = await trace.verify(eventId);
    
    if (signals.bot.detected || signals.automatedInput.detected) return soldOut();
    if (await db.orders.exists({ dropId, deviceId })) return limitReached();

    trace.verify() is the embedded call; with a server SDK, use the event from step 2 instead. The thresholds are yours. Trace scores and explains; event.reasons lists which signals added how much, so log it with every decision.

Example decisions

Orders in the first minute of a drop, illustrative:

AccountTime to checkoutDecisionWhy
@fan_lina48 sAllowNormal buyer
@omar35 sAllowNormal buyer
@buyer_172 sBlockautomatedInput
@buyer_182 sBlockSame device as @buyer_17

Roll it out

  1. Ship steps 1 to 3 with logging only: record the decision, block nothing.
  2. After a week, look at who would have been blocked or asked to verify. Shared computers, offices and privacy tools are the usual false positives.
  3. Turn on Verify first, then Block for the clearest cases.
Suggest an edit

Spotted something wrong or unclear? Tell us on GitHub and we will fix it.