Skip to content

Start

Quickstart

Sell your first ticket in 10 minutes, in test mode: the kit for a site, then curl or the SDK.

View as Markdown

This page makes an event, puts it on sale, holds two tickets, pays with a test card and reads the tickets back. Nothing real moves: a test key only ever touches test data.

Adding a checkout to a site? Start with the kit#

The fastest way to a working checkout on a site you already have is the kit: code you copy in, with every step of the buyer's page and a small server of yours that holds the key. An agent or a person can do it in about five minutes:

  1. Have a test key and an event id (evt_...). Step 2 below makes an event if you have none.
  2. Fetch https://rcms-tickets-test.web.app/kit/manifest.json and follow its steps: run its install tool, apply the recipe for Next.js or Vite, put RCMS_TICKETS_KEY and RCMS_TICKETS_EVENT in .env.local.
  3. Run the site, open /tickets, and buy a ticket. The kit reads the event's name, date, venue, tickets and add-ons from the API: you write none of them.
  4. In test mode the payment step shows four test cards (Works, Declined, Not enough funds, Processor error). Press one, then Pay.

The rest of this page is the API underneath, with curl and then the SDK: use it to make the event, or when you build your own checkout.

What you need#

  • A test key, which starts with rt_test_. A key is made by a person, never by another key: sign in to the dashboard, open Developers, then API keys, then Create API key, pick scope Full, and copy the secret. The dashboard makes a test key. It is shown once. Authentication says why, and how an agent can sign in as the person instead of holding a key.
  • The key in your server's environment as RCMS_TICKETS_KEY. A key never goes in a browser or a mobile app: there is no publishable key.
  • For curl: curl and jq. Each step is shown with curl first, which needs nothing else, and then with the TypeScript SDK (Node 20.3 or later). The SDK is not published yet: install it from this site, or stay with curl.
  • A list answers { object: 'list', data: [...] }: the items are under .data.

Everything on this page is run against the real API handlers in a test, every time the docs are built, so a sample here that stops working fails the build.

1. Check the key#

Ask the key what it is before you write anything. It answers its mode and scope.

export API=https://rcms-tickets-test.web.app/v1
rt() { curl -sS --fail-with-body "$@" -H "Authorization: Bearer $RCMS_TICKETS_KEY" -H "Content-Type: application/json"; }

rt "$API/keys/current" | jq '{mode, scope}'

Every SDK call is one HTTP call: the operation's id, its SDK name and its MCP tool, if it has one, are on its reference page.

2. Make an event#

One call makes the event, its days, its ticket types, an add-on and a promo code, all or nothing. The ref names are yours: they let the items point at each other inside this one request, and come back next to the real ids.

The dates below are 45 days from today. Replace them with your event's real dates; a day's times are instants, and timezone is the venue's.

DAY=$(date -u -d '+45 days' +%F 2>/dev/null || date -u -v+45d +%F)

SETUP=$(rt "$API/events/setup" -H "Idempotency-Key: $(uuidgen)" -d @- <<JSON
{
  "event": {
    "name": "Riverfront Fest",
    "currency": "usd",
    "venue": {
      "name": "Riverfront Stage",
      "address": { "line1": "100 Example Ave", "line2": null, "city": "Detroit", "region": "MI", "postal_code": "48201", "country": "US" },
      "timezone": "America/Detroit",
      "location": null
    },
    "days": [{ "date": "$DAY", "name": "Friday", "doors_at": "${DAY}T20:00:00Z", "starts_at": "${DAY}T21:00:00Z", "ends_at": "${DAY}T23:30:00Z" }]
  },
  "ticket_types": [
    { "ref": "ga", "name": "General admission", "price": { "amount": 5000, "currency": "usd" }, "capacity": 100 },
    { "ref": "vip", "name": "VIP", "price": { "amount": 12000, "currency": "usd" }, "capacity": 20 }
  ],
  "add_ons": [
    { "ref": "parking", "name": "Parking", "price": { "amount": 2000, "currency": "usd" }, "per": "order", "capacity": 30 }
  ],
  "codes": [
    { "code": "WELCOME10", "discount": { "amount_off": null, "percent_off_bps": 1000 }, "applies_to": ["ga"] }
  ]
}
JSON
)

EVENT=$(echo "$SETUP" | jq -r .event.id)
GA=$(echo "$SETUP" | jq -r '.ticket_types[] | select(.ref == "ga") | .id')
PARKING=$(echo "$SETUP" | jq -r '.add_ons[] | select(.ref == "parking") | .id')
echo "$EVENT $GA $PARKING"

Prices are integers in the currency's smallest unit: 5000 is $50.00. A float is refused.

What you can leave out#

  • A ticket type needs only ref, name and price. Left out, it has no capacity of its own (only the day's and the event's apply), it is good for every day, a buyer may take 1 to 10 in an order, it is public, and it has no fees.
  • The venue's address needs line1, city, region, postal_code and country. line2 and location must be there, and may be null.
  • Times are instants: write them in UTC (…Z) or with an offset. 2027-07-16T20:00:00Z is 4 PM in Detroit. timezone is the venue's, and it decides what "today" is at the door.
  • ref is yours, and only means something inside this one request (applies_to: ['ga']). The real ids come back beside it, and a hold takes the real ids and a code's text.
  • Add-ons and codes are optional. A ticket type alone is a valid event.
  • A bundle (a 5-pack) is one purchase that issues several tickets: add tickets_per_unit: 5. price is for the whole bundle, capacity counts tickets, and per_order_min and per_order_max count bundles. See bundles.
  • A day's date is the local date of its doors_at at the venue, and doors_at ≤ starts_at < ends_at.

Before you commit to a big setup, add dry_run: true: the answer says what would be made, or why not, and nothing is written.

3. Put it on sale#

An event starts as a draft. Nothing is for sale until you publish it.

rt -X POST "$API/events/$EVENT/publish" -H "Idempotency-Key: $(uuidgen)" | jq -r .status

4. Hold two tickets#

A hold reserves the tickets for 10 minutes and answers the one price you may show: lines, discount, fees, tax and total. Show exactly that. Never work out a price yourself.

HOLD=$(rt "$API/holds" -H "Idempotency-Key: $(uuidgen)" -d "{
  \"event\": \"$EVENT\",
  \"items\": [{ \"ticket_type\": \"$GA\", \"quantity\": 2 }, { \"add_on\": \"$PARKING\", \"quantity\": 1 }],
  \"code\": \"WELCOME10\"
}")

HOLD_ID=$(echo "$HOLD" | jq -r .id)
echo "$HOLD" | jq '{id, expires_at, total: .price.total}'

Two GA tickets at $50.00 are $100.00, the code takes 10% off them ($10.00), and parking is $20.00: $110.00, which is 11000.

5. Pay and make the order#

In your own checkout you charge the card with your payment processor, then send the order with the amount you charged. In test mode you can skip the processor: the test provider takes a test token.

ORDER=$(rt "$API/orders" -H "Idempotency-Key: $(uuidgen)" -d "{
  \"hold\": \"$HOLD_ID\",
  \"buyer\": { \"name\": \"Maria Delgado\", \"email\": \"maria@example.com\" },
  \"payment\": { \"provider\": \"test\", \"token\": \"tok_success\" }
}")

ORDER_ID=$(echo "$ORDER" | jq -r .id)
echo "$ORDER" | jq '{id, number, status, tickets_status, paid: .amount_paid}'

The order is paid. Its number (like 7KQ2-M9XD) is the one the buyer reads on a confirmation page and in the email, and the one a person at the door can search by. Its tickets are issued a moment after, by a background step, and the confirmation email goes to the buyer (example.com is a reserved name that delivers nowhere, and in test mode mail reaches only members of your organization; send notify: { email: false } to send nothing). The answer waits up to three seconds for the tickets, so order.tickets is usually full. When tickets_status is still pending, wait a second and read the order again, or wait for the order.tickets_issued webhook. A few reads is plenty. Tickets still pending after a minute is a fault: quote the order id to support.

6. Read the tickets#

rt "$API/orders/$ORDER_ID" | jq '{tickets_status, tickets: [.tickets[] | {id, status}]}'

To list an event's orders, GET /v1/orders?event=evt_... (.data[]; it also takes status). To read an order's tickets without the order, GET /v1/tickets?order=ord_... lists them (.data[]; the same filter takes event, ticket_type and status). Each ticket has its own private page, ticket.url, which a holder opens on a phone, and ticket.wallet.apple_url and ticket.wallet.google_url for Wallet. Treat these links as secrets: anyone who has one can use the ticket.

Where next#