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

# Getting started

Authenticate with the Distribution Partner API and make your first request.

Use these steps to obtain a credential, request an access token, and call a live endpoint.

## Base URL

The Distribution Partner API uses this base URL:

```
https://ari.console.adrasis.com/api/v1
```

Use HTTPS and `application/json` for JSON request bodies. Field names use `snake_case`, dates use ISO 8601, currencies use ISO 4217 codes, and `public_id` values are opaque identifiers. The access token identifies the partner account, so requests do not need a tenant path segment or header.

## Building and certifying against this host

Integration, certification, and live requests use the same host. There is no separate sandbox.

Pilot credentials are limited to a demonstration catalogue. Its rates and availability are generated for integration testing. Test bookings do not affect real allotment or generate charges.

When running certification tests:

* Cancel every booking. A booking holds demonstration allotment until it is cancelled. Repeated tests that do not cancel can return `SOLD_OUT`.
* Use dates several months ahead to reduce collisions between test runs.

Ask your onboarding contact for a designated certification property with availability published well into the future.

When an OAuth credential is promoted to live supply, its `client_id`, base URL, and integration flow stay the same. Promotion changes the catalogue available to the credential.

## Step 1: Obtain a credential

Create credentials from the account detail in **Partner Network → Partner Accounts**. One account can own multiple independently named credentials; a credential never selects a profile. Each credential can have either or both scopes:

* `distribution:read`: content, availability, and search endpoints.
* `distribution:booking`: prebook, book, and cancel endpoints.

Three authentication mechanisms are available:

| Mechanism                                      | Use case                                                                  |
| ---------------------------------------------- | ------------------------------------------------------------------------- |
| **OAuth 2.0 client credentials** (recommended) | Default for new integrations. Provides a `client_id` and `client_secret`. |
| **HTTP Basic**                                 | For partners that cannot exchange credentials for a token.                |
| **API key**                                    | For simple machine-to-machine clients.                                    |

The plaintext secret (`client_secret`, Basic password, or API key) is displayed only once when the credential is created. Store it securely. If it is lost, rotate the credential.

The examples below use OAuth 2.0. See [Authentication](/developer/authentication.md) for the Basic and API key options.

## Step 2: Request an access token

Exchange the OAuth credential for an access token with the `client_credentials` grant:

```bash
curl -s -X POST \
  https://ari.console.adrasis.com/api/v1/oauth/token \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'grant_type=client_credentials' \
  -d 'client_id=YOUR_CLIENT_ID' \
  -d 'client_secret=YOUR_CLIENT_SECRET'
```

The response is a short-lived bearer token:

```json
{
  "access_token": "<ACCESS_TOKEN>",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "distribution:read distribution:booking",
  "issued_at": 1748851200
}
```

The token is valid for `expires_in` seconds, which is `3600` in this example. This grant does not issue a refresh token. Request a new access token after it expires.

## Step 3: Make an authenticated request

Send the token in the `Authorization` header.

### List your properties

```bash
curl -s \
  https://ari.console.adrasis.com/api/v1/properties?limit=2 \
  -H 'Authorization: Bearer <ACCESS_TOKEN>'
```

```json
{
  "properties": [
    {
      "public_id": "7gQ2kPa9",
      "name": "Grand Bosphorus Hotel",
      "slug": "grand-bosphorus-hotel",
      "star_rating": 5,
      "property_type": {
        "public_id": "propertyTypePublicId",
        "code": "property_type.hotel",
        "name": "Hotel"
      },
      "location": {
        "country_code": "TR",
        "latitude": "40.9906",
        "longitude": "29.0274",
        "address": "Caferağa, Kadıköy, İstanbul",
        "administrative_areas": [
          {
            "public_id": "istanbulProvincePlacePublicId",
            "place_type": "province_state",
            "name": "Istanbul"
          },
          {
            "public_id": "kadikoyPlacePublicId",
            "place_type": "district",
            "name": "Kadıköy"
          },
          {
            "public_id": "caferagaPlacePublicId",
            "place_type": "neighborhood",
            "name": "Caferağa"
          }
        ],
        "destinations": [
          {
            "public_id": "kadikoyPlacePublicId",
            "place_type": "district",
            "name": "Kadıköy"
          },
          {
            "public_id": "istanbulCityPlacePublicId",
            "place_type": "city",
            "name": "Istanbul"
          },
          {
            "public_id": "istanbulProvincePlacePublicId",
            "place_type": "province_state",
            "name": "Istanbul"
          }
        ]
      },
      "currency_code": "TRY",
      "timezone_iana": "Europe/Istanbul",
      "content_updated_at": "2026-06-01T08:30:00Z"
    }
  ],
  "pagination": {
    "limit": 2,
    "has_more": true,
    "next_cursor": "<OPAQUE_CURSOR>"
  }
}
```

When `has_more` is `true`, send the returned `next_cursor` unchanged as `cursor` and repeat the first request's filters. Continue until `has_more` is `false`; never parse or construct a cursor:

```bash
curl -s \
  'https://ari.console.adrasis.com/api/v1/properties?limit=2&cursor=<OPAQUE_CURSOR>' \
  -H 'Authorization: Bearer <ACCESS_TOKEN>'
```

### Or run an availability search

```bash
curl -s -X POST \
  https://ari.console.adrasis.com/api/v1/properties/availability \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
    "property_ids": ["7gQ2kPa9"],
    "checkin": "2026-06-10",
    "checkout": "2026-06-13",
    "occupancy": [{ "adults": 2 }],
    "allocation_strategy": "flexible",
    "currency_code": "TRY",
    "country_code": "TR"
  }'
```

```json
{
  "currency_code": "TRY",
  "request_time": "2026-08-18T12:00:00Z",
  "selection_token_expires_at": "2026-08-18T12:15:00Z",
  "results": [
    {
      "property_id": "7gQ2kPa9",
      "allocations": [
        {
          "allocation_id": "alc_5f3a9c1d8e7b4a2f6c0d9e8b7a6f5c4d",
          "selection_token": "sel1.active.<opaque>",
          "rooms": 1,
          "strategy": "single-room",
          "grand_total": "9000.00",
          "grand_total_before_promotion": "9000.00",
          "currency_code": "TRY",
          "slots": [
            {
              "room_public_id": "r3Tz9Lm0",
              "rate_plan_public_id": "rp_bar",
              "currency_code": "TRY",
              "stay_total": "9000.00",
              "status": "AVAILABLE"
            }
          ]
        }
      ]
    }
  ]
}
```

Bulk search accepts 1..100 unique `property_ids` and returns exactly the best zero-or-one allocation per property. It never accepts `max_offers`, `limit`, or alternative breadth fields. `allocations[0]` is the lowest exact canonical partner-payable allocation. To inspect choices for one property, use `POST /properties/{property_public_id}/offers/search`, which returns at most twenty allocations and a required `has_more` flag.

Pass the chosen `selection_token`, not `allocation_id` or reconstructed search fields, to accommodation prebook. Then pass the returned `prebook_token` to book. See [The booking flow](/developer/booking-flow.md) for the complete request.

## Next steps

* [Authentication](/developer/authentication.md): token lifecycle, scopes, Basic authentication, and API keys.
* [Property content](/developer/property-content.md): catalogue creation and delta refreshes.
* [The booking flow](/developer/booking-flow.md): search, prebook, book, and cancel.
* [Idempotency](/developer/idempotency.md): safe retries for `POST /book`.
* [Errors](/developer/errors.md): error format and status codes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://adrasis.gitbook.io/developer/getting-started.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
