Post an ad

API reference

Booth API

Everything you do on the market, from your own servers: read offers, post and fund ads, open and run trades, and hear about every step through webhooks or an event feed.

Mainnet, real funds

The API moves real HYPE and USDC on Elysium, exactly like the site.

Overview

A JSON API over HTTPS. Your key acts as your account: the same rules, limits and escrow as on the site.

Base URL

Base URL
https://www.booth.cash/api/v1

Bodies and answers are JSON. Public reads (/config, /methods, /market, /ads/{id}) need no key.

Quick start

  1. 1

    Create a key

    On the Developers page, signed in with X. Pick what it may do.
  2. 2

    Call the API

    From your server, with the key in the Authorization header.
  3. 3

    Listen

    Add a webhook, or poll /events, to react when a trade moves.
Terminal
curl https://www.booth.cash/api/v1/market?side=sell&method=paypal

curl https://www.booth.cash/api/v1/me \
  -H "Authorization: Bearer $BOOTH_API_KEY"

SDK

One file, no dependencies, for Node 20+, Deno and Bun: booth.mjs. It sets idempotency keys, retries safely, refuses to run in a browser and verifies webhook signatures.

Node
// curl -o booth.mjs https://www.booth.cash/sdk/booth.mjs
import { createClient } from "./booth.mjs";

const booth = createClient({ apiKey: process.env.BOOTH_API_KEY });
const { ads } = await booth.market({ side: "sell", method: "paypal" });
const { trade } = await booth.trades.open({ adId: ads[0].id, fiatCents: 2500, method: "paypal" });
console.log(trade.payee); // where to send the $25

Authentication

Personal keys, sent as a bearer token. Server to server only.

API keys

Header
Authorization: Bearer booth_sk_<id>_<secret>
  • A key acts as the account that created it. Up to 5 active keys per account; revoke one any time.
  • We store only a hash. The full key is shown once, when you create it.
  • Keep it on a server. A request that carries a browser's Origin header is refused (browser_not_allowed).

Scopes

ScopeLets the key
readRead your account, ads, trades, messages and events; build deposit calldata.Always on
tradePost, pause and close ads, withdraw free escrow, open trades, mark paid, cancel, dispute, chat.Opt-in
releaseSubmit a release the seller signed with the wallet that locked the escrow. Only for a server that checks your payments itself.Opt-in

A key alone can't release

A release needs the seller's signature, made with the wallet that locked the escrow, so a leaked key can't move your funds. A server that signs on the buyer's word can: sign only after your server has seen the money land in your account.

What a key can't do

  • There is no API to change your wallet or where you get paid. Those are set on the site only.
  • Trades use your saved wallet and payees; withdrawals go back to the wallet that funded the ad.
  • Deposits and releases are signed by your own wallet. Booth never holds your keys.
  • No admin powers: disputes are decided by the Booth team, on the site.

Conventions

Errors

A status code, and a body with a stable error code and a human message:

JSON
{ "error": "insufficient_scope", "message": "This key doesn't have the \"release\" scope…" }
StatusCodes
400Validation, or a trading rule (the message says which).bad_request
401missing_api_key · invalid_api_key · revoked_api_key
403insufficient_scope · stake_required · browser_not_allowed
404not_found
409idempotency_conflict · conflict
413 / 415body_too_large · unsupported_media_type
429Wait Retry-After seconds.rate_limited
503Price feed or chain RPC down: retry.unavailable

Rate limits

60 requests a minute per key, 300 per IP. Over it: 429 rate_limited with a Retry-After header. The market's own limits apply too: at most 20 trades opened a day and 3 open at a time.

Idempotency

Send Idempotency-Key on every POST and PATCH. A retry with the same key and the same request gets the first answer back (header Idempotent-Replayed: true), so a timeout can't open two trades. Keys live 24 hours; the same key with a different request is a 409 idempotency_conflict.

Units

HYPE amounts"1500000000000000000" = 1.5 HYPE on Elysium.18 decimals, as strings
USDC amounts"20000000" = 20 USDC on Elysium. Every ad and trade says its asset.6 decimals, as strings
Dollar amountsfiatCents: 2500 = $25.00.integer cents
PricesA number, e.g. 65.12 per HYPE, 1 per USDC.USD per whole unit
TimesISO 8601, UTC

Market

Public: no key needed.

GET/configpublic
Chain id, escrow address, assets, fee (1%), trade limits and payment windows. Check deposits and releases against escrow.
GET/methodspublic
Every payment method: id, label, category, region.
GET/market?side=sell&method=paypal&amountCents=2500public
Listed ads, best price first. side=sell: people selling (you buy); side=buy: people buying. asset=HYPE (default) or asset=USDC.
GET/ads/{id}public
One ad, with its price now.

Account

GET/meread
Your handle, saved wallet, payment accounts, and this key's scopes.
GET/me/adsread
Your ads, with their escrow: availableWei, listed, toListWei, and escrowDepositor, the wallet that funds a sell ad.

Ads

POST/adstrade
Post an ad. Sell ads need a saved payee for each method and are funded from your saved wallet; buy ads receive on it (both set on the site).
PATCH/ads/{id}trade
{ "status": "active" | "paused" | "closed" }
GET/ads/{id}/deposit?amountWei=…read
The transaction that locks HYPE or USDC in your sell ad's escrow (amount in base units), to send from the ad's funding wallet.
POST/ads/{id}/withdrawtrade
Send the ad's free escrow (not committed to open trades) back to the wallet that funded it.
POST /ads
{
  "side": "sell",
  "asset": "HYPE",             // or "USDC" (priced at $1)
  "priceType": "market",       // or "fixed" with "fixedPriceUsd"
  "marginBps": 150,            // +1.5% over the market price
  "minCents": 1000,
  "maxCents": 50000,
  "methods": ["paypal", "xmoney", "revolut"],
  "paymentWindowMin": 30,      // 15, 30, 45, 60
  "terms": "PayPal friends & family only"
}

Funding a sell ad

A sell ad shows on the market once its escrow covers the minimum trade and the 1% fee (toListWei says how much is missing). Ask for the transaction, check to against escrow in /config and chainId, then sign and send it on Elysium from from, the ad's funding wallet. The escrow keys each slot by the wallet that deposits, so funds sent from another wallet don't count for the ad. A HYPE ad sends the HYPE as value. A USDC ad answers with an approve call to send first, so the escrow can pull the USDC; its value is 0:

Response
{ "deposit": {
  "chainId": 99901,
  "from": "0x5a3e…",           // the ad's funding wallet: send from this one
  "to": "<escrow>",
  "value": "1500000000000000000",
  "data": "0xeb2243f8…",       // deposit(token, routeId, amount)
  "routeId": "0x…",
  "token": null,               // the USDC contract on a USDC ad
  "amount": "1500000000000000000",
  "approve": null              // USDC: { "to": <USDC>, "data": approve(escrow, amount) }
} }

Trades

The flow

  1. 1

    Open

    POST /trades on an ad. On a sell ad you buy: the funds are already locked. On a buy ad you sell: lock them with trade.deposit, from trade.escrowDepositor.
  2. 2

    Pay

    The buyer sends the money to trade.payee, then POST /trades/{id}/paid.
  3. 3

    Release

    The seller checks the money arrived, signs trade.release with the wallet that locked the escrow (no gas), then POST /trades/{id}/release with the signature. Booth submits it and the escrow pays the buyer.

The buyer only sees payee once the funds are locked. The seller has 30 minutes to lock on a buy ad; the buyer has the ad's payment window to pay. trade.release is EIP-712 typed data (domain Booth, version 1, the escrow as verifyingContract): it pays amount to the buyer's wallet and fee to Booth. Check message.to and message.amount before you sign. Each read of the trade carries a fresh deadline, 7 days out; send the signature while it has more than an hour left.

Node + viem
// The seller's server, once the money is in the account. The wallet must be trade.escrowDepositor.
const { trade } = await booth.trades.get(tradeId);
const m = trade.release.message;
const signature = await wallet.signTypedData({
  ...trade.release,
  message: { ...m, amount: BigInt(m.amount), fee: BigInt(m.fee), deadline: BigInt(m.deadline) },
});
await booth.trades.release(trade.id, { signature, deadline: m.deadline });

// Or in one call, with the same checks against /config and the trade:
await booth.trades.signAndRelease(tradeId, (typedData) => wallet.signTypedData(typedData));

Endpoints

GET/trades?status=open|closed|all&limit=50&cursor=…read
Your trades, newest first. Follow nextCursor for more.
GET/trades/{id}read
The whole trade: status, amounts, payee, deadlines, the escrow's wallet, what the seller signs (deposit, release), and the payouts with their transactions.
POST/tradestrade
{ "adId", "fiatCents", "method" }. Between $10 and $5,000, within the ad's limits.
POST/trades/{id}/paidtrade
Buyer: the payment is sent. Optional { "note" }, like a reference.
POST/trades/{id}/releaserelease
Seller: the money arrived. { "signature", "deadline" }: your signature of trade.release and its message.deadline. Without them, a 400.
POST/trades/{id}/canceltrade
Buyer before paying, or seller before locking.
POST/trades/{id}/disputetrade
{ "reason" }. Once the payment is marked as sent.
GET/trades/{id}/messages?after={messageId}read
The trade chat, oldest first.
POST/trades/{id}/messagestrade
{ "body" }, up to 1,000 characters.

Events

Every step of your trades, in order. Poll it, or get the same events by webhook.

GET/events?after={eventId}&limit=100read
Events after after; keep the next you get back for the next call. Kept 30 days.
Node
for await (const event of booth.events.poll({ after: lastSeenId })) {
  if (event.type === "trade.paid" && event.data.trade.role === "seller") {
    // check your PayPal / bank, then sign the release
  }
}

Event types

trade.openedA trade was opened: on your ad, or by you.
trade.escrowedThe HYPE or USDC is locked in escrow. The buyer can pay.
trade.paidThe buyer marked the payment as sent. Seller: check your account.
trade.releasingThe release is on its way to the buyer.
trade.completedThe funds reached the buyer's wallet.
trade.disputedSomeone opened a dispute. The funds stay locked.
trade.cancelledThe trade ended without a release.
trade.messageA new chat message, yours included (check message.mine).
pingA test, sent from the Developers page (webhooks only).

Webhooks

One HTTPS endpoint per account. Each event is POSTed as JSON, signed with your secret.

Set up

Add the URL on the Developers page. You get a signing secret (whsec_…) once; send a test ping from there. Each request carries:

Headers
Content-Type: application/json
Booth-Event-Id: 1042
Booth-Event-Type: trade.paid
Booth-Signature: t=1791052376,v1=5f1c…

Verify the signature

v1 is the hex HMAC-SHA256 of <t>.<raw body> with your secret. Check it on the raw body, in constant time, and refuse a t more than 5 minutes off:

Node
import { verifyWebhook } from "./booth.mjs";

const event = await verifyWebhook({
  rawBody,                                   // the exact bytes received
  signatureHeader: req.headers["booth-signature"],
  secret: process.env.BOOTH_WEBHOOK_SECRET,
});

Retries

  • Answer 2xx within 10 seconds. Otherwise we retry after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h and 24 h, then mark it failed (you can resend it).
  • At least once, not in order: dedupe on the event id, and read the trade before acting on it.
  • Redirects aren't followed. Private and internal addresses are refused.

Objects

The main shapes. The full schema is in the OpenAPI file.

Ad

Ad
{
  "id": "d8db34f1-…", "side": "sell", "asset": "HYPE", "status": "active",
  "priceUsd": 66.08, "priceType": "market", "marginBps": 150, "fixedPriceUsd": null,
  "minCents": 1000, "maxCents": 50000,
  "methods": ["paypal", "xmoney"], "paymentWindowMin": 30, "terms": null,
  "availableWei": "8100000000000000000", "listed": true, "toListWei": null,
  "boostedUntil": null,
  "advertiser": { "handle": "nora", "verified": true, "trades": 48, "completion": 1 },
  "createdAt": "2026-11-03T17:19:30.000Z"
}

Trade

Trade
{
  "id": "b9c75c9a-…", "adId": "d8db34f1-…", "role": "seller", "status": "paid",
  "method": "paypal", "asset": "HYPE", "fiatCents": 2000, "priceUsd": 65.4,
  "amountWei": "305810397553516819", "feeWei": "3058103975535168",
  "buyerWallet": "0x81b1…", "sellerWallet": null,
  "payee": "you@example.com", "giftCard": false,
  "escrowRouteId": "0x…", "escrowSource": "ad", "escrowDepositor": "0x5a3e…",
  "payDeadline": "2026-11-03T18:03:09.000Z", "paidAt": "2026-11-03T17:48:41.000Z",
  "buyer": { "handle": "sam", … }, "seller": { "handle": "you", … },
  "legs": [], "deposit": null,
  "release": {
    "domain": { "name": "Booth", "version": "1", "chainId": 99901, "verifyingContract": "<escrow>" },
    "types": { "Release": [ … ] }, "primaryType": "Release",
    "message": {
      "depositor": "0x5a3e…", "token": "0x0000000000000000000000000000000000000000",
      "routeId": "0x…", "to": "0x81b1…",
      "amount": "305810397553516819", "fee": "3058103975535168",
      "ref": "0x…", "deadline": "1794332921"
    }
  },
  "createdAt": "…", "updatedAt": "…", "completedAt": null
}

Event

Event
{
  "id": "1042",
  "type": "trade.paid",
  "createdAt": "2026-11-03T17:48:41.000Z",
  "data": {
    "trade": { "id": "b9c75c9a-…", "role": "seller", "status": "paid", "method": "paypal",
               "asset": "HYPE", "fiatCents": 2000, "amountWei": "305810397553516819",
               "counterparty": { "handle": "sam", "avatarUrl": null }, … }
  }
}

v1New fields may be added to any object; existing ones won't change meaning within v1.