Quickstart

Create an event, book it in test mode and read the booking back

This quickstart takes about five minutes. You'll end with a real event you can open and a test booking you can read through the API.

To start, you need a Checkout Page account and an API key that can write events and read bookings.

1. Save your API key

export CHECKOUTPAGE_API_KEY="sk_live_..."

2. Create an event

testmode: true makes every booking on this event a test booking. No money is taken.

curl https://api.checkoutpage.com/v1/events \
  -H "Authorization: Bearer $CHECKOUTPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Spring gala",
    "title": "Riverside Trust spring gala",
    "status": "published",
    "testmode": true,
    "fields": [
      { "label": "Name", "element": "text", "type": "name", "required": true },
      { "label": "Email address", "element": "email", "type": "email", "required": true }
    ],
    "eventDetails": {
      "type": "in_person",
      "currency": "usd",
      "startDate": "2027-05-14T23:00:00.000Z",
      "endDate": "2027-05-15T03:00:00.000Z",
      "timezone": "America/New_York"
    },
    "ticketGroups": [
      {
        "name": "Tickets",
        "ticketTypes": [{ "name": "Standard", "pricing": "paid", "price": 6000 }]
      }
    ]
  }'
npm install @checkoutpage/sdk
import { createCheckoutPageClient } from '@checkoutpage/sdk';

const checkoutpage = createCheckoutPageClient({
  apiKey: process.env.CHECKOUTPAGE_API_KEY!,
});

const { data: event } = await checkoutpage.events.create({
  name: 'Spring gala',
  title: 'Riverside Trust spring gala',
  status: 'published',
  testmode: true,
  fields: [
    { label: 'Name', element: 'text', type: 'name', required: true },
    { label: 'Email address', element: 'email', type: 'email', required: true },
  ],
  eventDetails: {
    type: 'in_person',
    currency: 'usd',
    startDate: '2027-05-14T23:00:00.000Z',
    endDate: '2027-05-15T03:00:00.000Z',
    timezone: 'America/New_York',
  },
  ticketGroups: [
    {
      name: 'Tickets',
      ticketTypes: [{ name: 'Standard', pricing: 'paid', price: 6000 }],
    },
  ],
});

console.log(event.url);

Prices are in the smallest currency unit, so 6000 is $60.00.

3. Open your event

The response has the event's url. Open it in your browser, choose a ticket and book it with an email address you can read. Pay with the test card 4242 4242 4242 4242, any future expiry date and any CVC. Real cards are refused in test mode. A "Test payments only" banner shows that no money is taken.

You get the same confirmation email and ticket PDF your attendees will.

4. Read the booking

With a live key, test bookings are left out unless you ask for them with livemode=false:

curl "https://api.checkoutpage.com/v1/bookings?livemode=false&limit=1" \
  -H "Authorization: Bearer $CHECKOUTPAGE_API_KEY"

Your booking is the first item in data.

5. Go live

Turn test mode off when you are ready to sell. Use the id from step 2:

curl -X PATCH https://api.checkoutpage.com/v1/events/EVENT_ID \
  -H "Authorization: Bearer $CHECKOUTPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "testmode": false }'

Next steps

On this page