# In-Play

## Event Ordering <a href="#event-ordering" id="event-ordering"></a>

After you've created all the technical parts and set up listeners to process all incoming messages, you are ready to order events.

You have 2 options to order events:

### Admin Panel <a href="#admin-panel" id="admin-panel"></a>

***

You can easily order events from our admin panel.

By navigating to - OddService > InPlay > Event Ordering > All Events

Or just click [here](https://client.lsports.eu/OddService/EventOrdering)

The web interface is very friendly and allows you to filter the events you can order by bookmakers offering, sports, countries, and leagues, as shown in the following image:

![](https://2846470291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftv77Uhe1UsyYNAhnfDk8%2Fuploads%2Fgit-blob-ffd70663e71dc2aa87f6803064037956c450e0eb%2Flegacy-inplay-ext-01.png?alt=media)

***

### Schedule API Calls <a href="#schedule-api-calls" id="schedule-api-calls"></a>

Below are all the API calls, relevant to

#### **Schedule** <a href="#schedule" id="schedule"></a>

To see events that are available in our schedule: [https://inplay.lsports.eu/api/schedule/GetInPlaySchedule?username={username}\&password={password}\&packageid={packageId}](https://inplay.lsports.eu/api/schedule/GetInPlaySchedule?username=%7Busername%7D\&password=%7Bpassword%7D\&packageid=%7BpackageId%7D)

**Optional parameter breakdown**

| **Action**  | **Description**                                                                                         |
| ----------- | ------------------------------------------------------------------------------------------------------- |
| SportIds    | <p>Comma separated list of sport IDs<br><strong>Default value:</strong> All sports in package</p>       |
| ProviderIds | <p>Comma separated list of provider IDs<br><strong>Default value</strong>: All providers in package</p> |

#### Orders <a href="#orders" id="orders"></a>

To order new events: [https://inplay.lsports.eu/api/schedule/OrderFixtures?username={username}\&password={password}\&packageid={packageId}\&fixtureIds={fixtureIds}](https://inplay.lsports.eu/api/schedule/OrderFixtures?username=%7Busername%7D\&password=%7Bpassword%7D\&packageid=%7BpackageId%7D\&fixtureIds=%7BfixtureIds%7D)

`Note: After ordering an event, you will receive a snapshot message with available data. You can find the structure of the message in the Snapshot section.`

**Parameter breakdown**

| **Action**  | **Description**                                                                                         |
| ----------- | ------------------------------------------------------------------------------------------------------- |
| FixtureIds  | Comma separated list of fixture IDs                                                                     |
| SportIds    | Comma separated list of sport IDs                                                                       |
| ProviderIds | <p>Comma separated list of provider IDs<br><strong>Default value</strong>: All providers in package</p> |

#### **Order cancellation** <a href="#order-cancellation" id="order-cancellation"></a>

To cancel event orders: [https://inplay.lsports.eu/api/schedule/CancelFixtureOrders?username={username}\&password={password}\&packageid={packageId}\&fixtureIds={fixtureIds}](https://inplay.lsports.eu/api/schedule/CancelFixtureOrders?username=%7Busername%7D\&password=%7Bpassword%7D\&packageid=%7BpackageId%7D\&fixtureIds=%7BfixtureIds%7D)

`Note: You cannot cancel orders for events that had already started.`

**Parameter breakdown**

| **Action**  | **Description**                                                                                         |
| ----------- | ------------------------------------------------------------------------------------------------------- |
| FixtureIds  | Comma separated list of fixture IDs                                                                     |
| SportIds    | Comma separated list of sport IDs                                                                       |
| ProviderIds | <p>Comma separated list of provider IDs<br><strong>Default value</strong>: All providers in package</p> |

#### **View ordered events** <a href="#view-ordered-events" id="view-ordered-events"></a>

To receive a list of ordered events: [https://inplay.lsports.eu/api/schedule/GetOrderedFixtures?username={username}\&password={password}\&packageid={packageId}\&fixtureIds={fixtureIds}](https://inplay.lsports.eu/api/schedule/GetOrderedFixtures?username=%7Busername%7D\&password=%7Bpassword%7D\&packageid=%7BpackageId%7D\&fixtureIds=%7BfixtureIds%7D)

**Parameter breakdown**

| **Action**  | **Description**                                                                                                             |
| ----------- | --------------------------------------------------------------------------------------------------------------------------- |
| FixtureIDs  | <p><em>\[Optional]</em> Comma separated list of fixture IDs<br><strong>Default value</strong>: All fixtures</p>             |
| ProviderIDs | <p><em>\[Optional]</em> Comma separated list of fixture IDs<br><strong>Default value</strong>: All providers in package</p> |
| FromDate    | *\[Optional]* Unix timestamp of minimum ordering date                                                                       |
| ToDate      | *\[Optional]* Unix timestamp of maximum ordering date                                                                       |

***

## Snapshot <a href="#snapshot" id="snapshot"></a>

When subscribing to the AMQP service and connecting to our queue, you will only receive updates. In order to receive the full snapshot for all of the events, results, and markets that you have ordered, you need to request a snapshot.

`Note: It is only necessary to request the snapshot on startup, afterwards you will receive all new entries and updates via RMQ`

You can request a snapshot from our API service via the following URL: [https://inplay.lsports.eu/api/Snapshot/{action}?username={username}\&password={password}\&packageid={packageId}\&fixtureIds={comma-separated-list}](https://inplay.lsports.eu/api/Snapshot/%7Baction%7D?username=%7Busername%7D\&password=%7Bpassword%7D\&packageid=%7BpackageId%7D\&fixtureIds=%7Bcomma-separated-list%7D)

**Action breakdown**

| **Action**                 | **Description**                                                                     |
| -------------------------- | ----------------------------------------------------------------------------------- |
| GetSnapshotXml             | Used to receive a full snapshot in XML format                                       |
| GetSnapshotJson            | Used to receive a full snapshot in JSON format                                      |
| GetSnapshotProtocolBuffers | Used to receive a full snapshot in Binary format, serialized using Protocol Buffers |

**Parameter breakdown**

| **Parameter**         | **Description**                       |
| --------------------- | ------------------------------------- |
| Username              | Username as it appears in the package |
| Password              | Password as it appears the package    |
| <p>FixtureIds<br></p> | Comma-separated list of fixture IDs   |

### Response Scheme <a href="#response-scheme" id="response-scheme"></a>

```xml
<xs:element name="Message">
      <xs:complexType>
            <xs:sequence>
                  <xs:element name="Header">
                        <xs:complexType>
                              <xs:sequence>
                                    <xs:element name="Type" type="xs:int"></xs:element>
                                    <xs:element name="MsgGuid" type="xs:string"></xs:element>
                                    <xs:element name="ServerTimestamp" type="xs:int"></xs:element>
                              </xs:sequence>
                        </xs:complexType>
                  </xs:element>
                  <xs:element name="MessageBody">
                        <xs:complexType>
                              <xs:sequence>
                                    <xs:element name="Events">
                                          <xs:complexType>
                                                <xs:sequence>
                                                      <xs:element name="Event" maxOccurs="unbounded">
                                                            <xs:complexType>
                                                                  <xs:sequence>
                                                                        <xs:element name="Fixture">
                                                                              <xs:complexType>
                                                                                    <xs:sequence>
                                                                                          <xs:element name="Sport">
                                                                                                <xs:complexType>
                                                                                                      <xs:attribute name="Id" type="xs:int"></xs:attribute>
                                                                                                      <xs:attribute name="Name" type="xs:string"></xs:attribute>
                                                                                                </xs:complexType>
                                                                                          </xs:element>
                                                                                          <xs:element name="Location">
                                                                                                <xs:complexType>
                                                                                                      <xs:attribute name="Id" type="xs:int"></xs:attribute>
                                                                                                      <xs:attribute name="Name" type="xs:string"></xs:attribute>
                                                                                                </xs:complexType>
                                                                                          </xs:element>
                                                                                          <xs:element name="League">
                                                                                                <xs:complexType>
                                                                                                      <xs:attribute name="Id" type="xs:int"></xs:attribute>
                                                                                                      <xs:attribute name="Name" type="xs:string"></xs:attribute>
                                                                                                </xs:complexType>
                                                                                          </xs:element>
                                                                                          <xs:element name="StartDate" type="xs:string"></xs:element>
                                                                                          <xs:element name="Status" type="xs:int"></xs:element>
                                                                                          <xs:element name="Participants">
                                                                                                <xs:complexType>
                                                                                                      <xs:sequence>
                                                                                                            <xs:element name="Participant" maxOccurs="unbounded">
                                                                                                                  <xs:complexType>
                                                                                                                        <xs:attribute name="Id" type="xs:int"></xs:attribute>
                                                                                                                        <xs:attribute name="Name" type="xs:string"></xs:attribute>
                                                                                                                        <xs:attribute name="Position" type="xs:int"></xs:attribute>
                                                                                                                  </xs:complexType>
                                                                                                            </xs:element>
                                                                                                      </xs:sequence>
                                                                                                </xs:complexType>
                                                                                          </xs:element>
                                                                                    </xs:sequence>
                                                                                    <xs:attribute name="LastUpdate" type="xs:string"></xs:attribute>
                                                                              </xs:complexType>
                                                                        </xs:element>
                                                                        <xs:element name="Livescore">
                                                                              <xs:complexType>
                                                                                    <xs:sequence>
                                                                                          <xs:element name="Scoreboard">
                                                                                                <xs:complexType>
                                                                                                      <xs:sequence>
                                                                                                            <xs:element name="Score" maxOccurs="unbounded" type="xs:int">
                                                                                                                  <xs:complexType>
                                                                                                                        <xs:attribute name="Position" type="xs:int"></xs:attribute>
                                                                                                                  </xs:complexType>
                                                                                                            </xs:element>
                                                                                                      </xs:sequence>
                                                                                                      <xs:attribute name="Status" type="xs:int"></xs:attribute>
                                                                                                      <xs:attribute name="Description" type="xs:string"></xs:attribute>
                                                                                                      <xs:attribute name="CurrentPeriod" type="xs:int"></xs:attribute>
                                                                                                      <xs:attribute name="Time" type="xs:int"></xs:attribute>
                                                                                                </xs:complexType>
                                                                                          </xs:element>
                                                                                          <xs:element name="Periods">
                                                                                                <xs:complexType>
                                                                                                      <xs:sequence>
                                                                                                            <xs:element name="Period">
                                                                                                                  <xs:complexType>
                                                                                                                        <xs:sequence>
                                                                                                                              <xs:element name="Score" maxOccurs="unbounded" type="xs:int">
                                                                                                                                    <xs:complexType>
                                                                                                                                          <xs:attribute name="Position" type="xs:int"></xs:attribute>
                                                                                                                                    </xs:complexType>
                                                                                                                              </xs:element>
                                                                                                                        </xs:sequence>
                                                                                                                        <xs:attribute name="Type" type="xs:int"></xs:attribute>
                                                                                                                        <xs:attribute name="IsFinished" type="xs:string"></xs:attribute>
                                                                                                                        <xs:attribute name="IsConfirmed" type="xs:string"></xs:attribute>
                                                                                                                  </xs:complexType>
                                                                                                            </xs:element>
                                                                                                      </xs:sequence>
                                                                                                </xs:complexType>
                                                                                          </xs:element>
                                                                                          <xs:element name="Statistics">
                                                                                                <xs:complexType>
                                                                                                      <xs:sequence>
                                                                                                            <xs:element name="Statistic" maxOccurs="unbounded">
                                                                                                                  <xs:complexType>
                                                                                                                        <xs:sequence>
                                                                                                                              <xs:element name="Value" maxOccurs="unbounded" type="xs:int">
                                                                                                                                    <xs:complexType>
                                                                                                                                          <xs:attribute name="Position" type="xs:int"></xs:attribute>
                                                                                                                                    </xs:complexType>
                                                                                                                              </xs:element>
                                                                                                                        </xs:sequence>
                                                                                                                        <xs:attribute name="Type" type="xs:int"></xs:attribute>
                                                                                                                  </xs:complexType>
                                                                                                            </xs:element>
                                                                                                      </xs:sequence>
                                                                                                </xs:complexType>
                                                                                          </xs:element>
                                                                                          <xs:element name="LivescoreExtraData"></xs:element>
                                                                                    </xs:sequence>
                                                                              </xs:complexType>
                                                                        </xs:element>
                                                                        <xs:element name="Markets">
                                                                              <xs:complexType>
                                                                                    <xs:sequence>
                                                                                          <xs:element name="Market" maxOccurs="unbounded">
                                                                                                <xs:complexType>
                                                                                                      <xs:sequence>
                                                                                                            <xs:element name="Provider">
                                                                                                                  <xs:complexType>
                                                                                                                        <xs:sequence>
                                                                                                                              <xs:element name="Bet" maxOccurs="unbounded">
                                                                                                                                    <xs:complexType>
                                                                                                                                          <xs:attribute name="Id" type="xs:int"></xs:attribute>
                                                                                                                                          <xs:attribute name="Name" type="xs:string"></xs:attribute>
                                                                                                                                          <xs:attribute name="Line" type="xs:double"></xs:attribute>
                                                                                                                                          <xs:attribute name="BaseLine" type="xs:double"></xs:attribute>
                                                                                                                                          <xs:attribute name="Status" type="xs:int"></xs:attribute>
                                                                                                                                          <xs:attribute name="StartPrice" type="xs:int"></xs:attribute>
                                                                                                                                          <xs:attribute name="Price" type="xs:int"></xs:attribute>
                                                                                                                                          <xs:attribute name="Settlement" type="xs:int"></xs:attribute>
                                                                                                                                          <xs:attribute name="LastUpdate" type="xs:string"></xs:attribute>
                                                                                                                                    </xs:complexType>
                                                                                                                              </xs:element>
                                                                                                                        </xs:sequence>
                                                                                                                        <xs:attribute name="Id" type="xs:int"></xs:attribute>
                                                                                                                        <xs:attribute name="Name" type="xs:string"></xs:attribute>
                                                                                                                        <xs:attribute name="LastUpdate" type="xs:string"></xs:attribute>
                                                                                                                  </xs:complexType>
                                                                                                            </xs:element>
                                                                                                      </xs:sequence>
                                                                                                      <xs:attribute name="Id" type="xs:int"></xs:attribute>
                                                                                                      <xs:attribute name="Name" type="xs:string"></xs:attribute>
                                                                                                </xs:complexType>
                                                                                          </xs:element>
                                                                                    </xs:sequence>
                                                                              </xs:complexType>
                                                                        </xs:element>
                                                                  </xs:sequence>
                                                                  <xs:attribute name="FixtureId" type="xs:int"></xs:attribute>
                                                            </xs:complexType>
                                                      </xs:element>
                                                </xs:sequence>
                                          </xs:complexType>
                                    </xs:element>
                              </xs:sequence>
                        </xs:complexType>
                  </xs:element>
            </xs:sequence>
      </xs:complexType>
</xs:element>
   
```

***

## In-Play Package Control <a href="#in-play-package-control" id="in-play-package-control"></a>

You can control your package's status (enable/disable) by sending a request to the following URL

Enable: [https:/inplay.lsports.eu/api/Package/EnablePackage?username={username}\&password={password}\&packageid={packageId}](https://app.stoplight.io/inplay.lsports.eu/api/Package/EnablePackage?username=%7Busername%7D\&password=%7Bpassword%7D\&packageid=%7BpackageId%7D)

Disable: [https:/inplay.lsports.eu/api/Package/DisablePackage?username={username}\&password={password}\&packageid={packageId}](https://app.stoplight.io/inplay.lsports.eu/api/Package/DisablePackage?username=%7Busername%7D\&password=%7Bpassword%7D\&packageid=%7BpackageId%7D)

**Parameter breakdown**

| **Parameter** | **Description**                       | **Optional Field** |
| ------------- | ------------------------------------- | ------------------ |
| Username      | Username as it apparrs in the package | **X**              |
| Password      | Password as it appears the package    | **X**              |
| PackageId     | ID of the package                     | **X**              |
