> For the complete documentation index, see [llms.txt](https://developers.tix.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.tix.xyz/getting-started/readme.md).

# Get started

Connect your marketplace backend to the TIX Developer Platform (TDP) for secondary ticket resale. This walkthrough uses the TypeScript SDK to make a read-only request in the sandbox, then discover resale listings.

New to TDP? Read [How TDP works](/getting-started/overview.md) first for environments and how wallets are custodied. Using another language? Every endpoint in the **API** reference in the sidebar has a cURL example, and the key check below works from any terminal.

## 1. Before you start

You'll need:

* A dashboard invitation from TDP.
* Node.js 22 or later.

Keep this integration server-side; never ship an API key in a browser or mobile app.

## 2. Create a sandbox API key

Open the dashboard link in your invitation email and sign in with the supplied email address and temporary password. Contact your TDP representative if you haven't received an invitation.

1. Select **Sandbox** and open **API Keys**.
2. Click **New key**.
3. Enter a name, such as `Query events API key`.
4. Under **Permissions**, deselect everything except **Query Solana** (read-only access to events and listings).
5. Click **Generate key**.

![Create a sandbox API key with only Query Solana selected](https://1118189004-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1MN3dyIh0vs7z7VJSuTc%2Fuploads%2Fgit-blob-689a5319c259ceb4fb0e144c6705778dc539491e%2Fcreate-sandbox-api-key.png?alt=media)

Copy the key before closing the panel; you won't be able to view it again. If **New key** isn't available, ask your organization's dashboard administrator for access. See [Authentication and environments](/integration-guides/authentication.md) for key handling.

## 3. Check your key

Export the key in the terminal you'll work from, and don't commit it to Git:

```bash
export TDP_API_KEY=your_sandbox_api_key
```

Then make one request:

```bash
curl --silent --show-error --include \
  --header "x-api-key: $TDP_API_KEY" \
  'https://api.sandbox.tix.xyz/tix-indexer/events/upcoming?limit=1'
```

HTTP 200 means the key works, even if `items` is empty. A 401 means the key is incomplete or wasn't created in **Sandbox**; a 403 means it lacks **Query Solana** permission.

## 4. Install the SDK

Create a scratch project and install [`@tixprotocol/tdp-sdk`](https://www.npmjs.com/package/@tixprotocol/tdp-sdk):

```bash
mkdir tdp-quickstart
cd tdp-quickstart
npm init --yes
npm pkg set type=module
npm install @tixprotocol/tdp-sdk
npm install --save-dev tsx
```

Already have a Node.js backend? Install the SDK there instead and adapt the examples below. The [TDP examples repository](https://github.com/KYDLabs/tdp-examples) has the same examples as a ready-to-run project.

## 5. Query upcoming events

Create `list-events.ts`:

```typescript
import { createTdpClient } from "@tixprotocol/tdp-sdk";

const apiKey = process.env.TDP_API_KEY;
if (!apiKey) throw new Error("Set TDP_API_KEY to your sandbox API key.");

const client = createTdpClient({
  baseApiUrl: "https://api.sandbox.tix.xyz",
  apiKey,
});

const events = await client.indexer.listUpcomingEvents({ limit: 10 });
console.log(JSON.stringify(events, null, 2));
```

Run it in the same terminal:

```bash
npx tsx list-events.ts
```

The script prints one page of up to 10 events. An empty page is still a success:

```json
{
  "items": [],
  "next_cursor": null
}
```

Each item includes fields such as `event_id`, `name`, and `start_at`. See [API conventions](/integration-guides/api-basics.md) for pagination and identifier handling.

## 6. Find active listings

Create `list-listings.ts`. It takes an optional event ID and lists that event's active listings, or listings across all events without one:

```typescript
import { createTdpClient } from "@tixprotocol/tdp-sdk";

const apiKey = process.env.TDP_API_KEY;
if (!apiKey) throw new Error("Set TDP_API_KEY to your sandbox API key.");

const client = createTdpClient({
  baseApiUrl: "https://api.sandbox.tix.xyz",
  apiKey,
});

const eventId = process.argv[2]; // optional: an event_id from list-events
const listings = await client.indexer.listActiveListings({
  limit: 10,
  ...(eventId ? { eventId } : {}),
});
console.log(JSON.stringify(listings, null, 2));
```

Run it with a non-null `event_id` from the events output, or with no argument:

```bash
npx tsx list-listings.ts 16159443462307518117
```

A listing is discovery data, not a reservation. Continue with [Secondary resale integration](/integration-guides/secondary-resale.md) to interpret listings and plan purchases.

## Troubleshooting

* **401 or 403:** see [Check your key](#3-check-your-key). Errors thrown by the SDK carry the HTTP `status`.
* **Empty `items`:** the request succeeded; the sandbox has no upcoming events or listings. Ask your TDP representative for sandbox data.

Don't include your API key when asking for help.

## Next steps

* [Set up KYD Labs](/getting-started/kyd-setup.md): what the fan side needs before you buy or sell.
* [Secondary resale integration](/integration-guides/secondary-resale.md): money, validation, purchase, and delivery.
* [Authentication and environments](/integration-guides/authentication.md): permissions and production credentials.
* [API conventions](/integration-guides/api-basics.md): pagination, identifiers, errors, and retries.
* **API** in the sidebar: complete endpoint schemas, grouped by resource.
