# Getting Started

This guide walks you through connecting to TRADE's RabbitMQ feed and receiving real-time odds data.

***

## Step 1: Get Your Credentials

Contact your **Customer Success Manager (CSM)** to receive:

| Credential     | Description                         |
| -------------- | ----------------------------------- |
| **Username**   | Your account email                  |
| **Password**   | Your account password               |
| **Package ID** | Your unique subscription identifier |

***

## Step 2: Enable Your Distribution

Before consuming messages, enable your distribution:

**Enable Distribution:**

```
POST https://stm-api.lsports.eu/Distribution/Start
```

**Request Body:**

```json
{
    "PackageId": "YOUR_PACKAGE_ID",
    "UserName": "YOUR_USERNAME",
    "Password": "YOUR_PASSWORD"
}
```

**Response:**

```json
{
    "Header": {
        "HttpStatusCode": 200
    },
    "Body": {
        "Message": "Success"
    }
}
```

To disable distribution, use `https://stm-api.lsports.eu/Distribution/Stop` with the same request body.

***

## Step 3: Connect to RabbitMQ

LSports uses **RabbitMQ** for real-time data streaming.

### Connection Details

| Parameter         | Value                                  |
| ----------------- | -------------------------------------- |
| **InPlay Host**   | `inplay-rmq.lsports.eu`                |
| **PreMatch Host** | `prematch-rmq.lsports.eu`              |
| **Port**          | `5672`                                 |
| **Virtual Host**  | `Customers`                            |
| **Queue Name**    | `_YOUR_PACKAGE_ID_` (with underscores) |

### Quick Start (C#)

```csharp
ConnectionFactory connectionFactory = new ConnectionFactory
{
    HostName = "inplay-rmq.lsports.eu",
    Port = 5672,
    UserName = "YOUR_USERNAME",
    Password = "YOUR_PASSWORD",
    AutomaticRecoveryEnabled = true,
    VirtualHost = "Customers",
    RequestedHeartbeat = 580,
    NetworkRecoveryInterval = TimeSpan.FromSeconds(1)
};

IConnection connection = connectionFactory.CreateConnection();
IModel model = connection.CreateModel();
model.BasicQos(prefetchSize: 0, prefetchCount: 100, global: false);

EventingBasicConsumer consumer = new EventingBasicConsumer(model);
consumer.Received += (sender, eventArgs) =>
{
    string message = Encoding.UTF8.GetString(eventArgs.Body);
    // Process message
};

model.BasicConsume(queue: "_YOUR_PACKAGE_ID_", noAck: true, consumer: consumer);
```

For more languages, see [Code Samples](/u/trade/integration/code-samples/rmq-consumer-c.md).

***

## Step 4: Request Initial Snapshot

RabbitMQ delivers **delta updates only**. On your initial connection, request a one-time snapshot:

* **InPlay Snapshot** — [Snapshot API](/u/trade/integration/apis/snapshot.md)
* **PreMatch Events** — [Subscription API](/u/trade/integration/apis/subscription.md)

***

## Step 5: Map Your Data

Ensure your internal market mapping aligns with LSports' structure:

* Use the [Metadata API](/u/trade/integration/apis/metadata.md) to retrieve available markets
* Review [Enumerations](/u/trade/enumerations.md) for status codes and field values
* See [Message Structure](/u/trade/integration/message-structure/message-types-overview.md) for payload formats

***

## Step 6: Stress Test

Before going live, perform a stress test:

1. Contact your CSM or Solution Engineer to schedule a test
2. Verify your system handles peak message volumes
3. Check latency and message processing times

***

## Step 7: Go Live

Once testing is complete:

1. Contact your CSM to schedule a go-live date
2. We'll switch your account from testing to production
3. Your ordered quota will be activated

**Congratulations!** You're now live with TRADE.

***

## Next Steps

* [**TRADE Concepts**](/u/trade/concepts.md) — Fixtures, markets, and settlements
* [**User Guide**](/u/trade/user-guide.md) — Configure providers and templates
* [**Integration Guide**](/u/trade/integration.md) — Full technical reference
* [**Support**](/u/resources/support.md) — Get help when you need it


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lsports.eu/u/trade/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
