> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pageonetravel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Integrate the PageOne Travel B2B OTA API in 7 steps.

## Before you start

You need:

* `Base URL` provided by PageOne Travel
* One partner `api-key` (for `content/search/quote/book/cancel`)
* One partner JWT user account (for user/API key/partner-connection management)

## End-to-end flow

<Steps>
  <Step title="Step 1: Login as partner user (JWT)">
    ```bash theme={null}
    curl -X POST "$BASE_URL/api/auth/login" \
      -H "Content-Type: application/json" \
      -d '{
        "accountType": "email",
        "accountValue": "ops@partner.com",
        "password": "<MD5_PASSWORD_HASH>"
      }'
    ```

    Keep `data.token.accessToken` for management APIs.
  </Step>

  <Step title="Step 2: Create or list API keys">
    ```bash theme={null}
    curl -X GET "$BASE_URL/api/partner/api-keys" \
      -H "Authorization: Bearer $PARTNER_JWT"
    ```

    Use the returned `apiKey` in header `api-key` for OTA flow APIs.
  </Step>

  <Step title="Step 3: Pull accommodation content codes">
    ```bash theme={null}
    curl -X POST "$BASE_URL/api/v1/content/accommodations" \
      -H "Content-Type: application/json" \
      -H "api-key: $API_KEY" \
      -d '{
        "type": "inventory",
        "countries": ["US"],
        "size": 100
      }'
    ```

    Save `data.accommodations[].code` values. These are the accommodation codes used by search when you choose the `destinations.accommodations` selector.
  </Step>

  <Step title="Step 4: Search">
    ```bash theme={null}
    curl -X POST "$BASE_URL/api/search" \
      -H "Content-Type: application/json" \
      -H "api-key: $API_KEY" \
      -d '{
        "searchCriteria": {
          "destinations": {
            "accommodations": [
              { "type": "Hotel", "code": "CONTENT_ACCOMMODATION_CODE_1" },
              { "type": "Hotel", "code": "CONTENT_ACCOMMODATION_CODE_2" }
            ]
          },
          "occupancies": [
            { "occupancyId": 1, "paxes": [ { "age": 30 }, { "age": 28 } ] }
          ],
          "checkIn": "2026-03-01",
          "checkOut": "2026-03-03",
          "currency": "USD",
          "language": "EN"
        },
        "settings": {
          "access": { "code": 10001 },
          "businessRules": { "businessRuleType": "DEFAULT", "optionsQuota": 5 }
        }
      }'
    ```

    Search selectors are mutually exclusive. Choose exactly one of:

    * `searchCriteria.destinations.accommodations[]`
    * `searchCriteria.geo` (`lat/lng`, optional `radiusKm <= 60`, optional `limit <= 1000`)
    * `searchCriteria.accommodationName`

    This quickstart uses `searchCriteria.destinations.accommodations`, built from content accommodation codes (one object per accommodation).
    Save `data.accommodations[].options[].id` as `optionId`.
  </Step>

  <Step title="Step 5: Quote">
    ```bash theme={null}
    curl -X POST "$BASE_URL/api/quote" \
      -H "Content-Type: application/json" \
      -H "api-key: $API_KEY" \
      -d '{
        "quoteCriteria": {
          "optionId": "OPTION_ID_FROM_SEARCH",
          "accommodation": { "type": "Hotel", "code": "CONTENT_ACCOMMODATION_CODE_1" },
          "occupancies": [
            { "occupancyId": 1, "paxes": [ { "age": 30 }, { "age": 28 } ] }
          ],
          "checkIn": "2026-03-01",
          "checkOut": "2026-03-03",
          "currency": "USD",
          "language": "EN"
        },
        "settings": { "access": { "code": 10001 } }
      }'
    ```

    Save `data.id` as `quoteId`.
  </Step>

  <Step title="Step 6: Book">
    ```bash theme={null}
    curl -X POST "$BASE_URL/api/book" \
      -H "Content-Type: application/json" \
      -H "api-key: $API_KEY" \
      -d '{
        "bookCriteria": {
          "quoteId": "QUOTE_ID_FROM_QUOTE",
          "accommodation": { "type": "Hotel", "code": "CONTENT_ACCOMMODATION_CODE_1" },
          "partnerReference": "partner-ref-10001",
          "holder": { "name": "John", "surName": "Smith" },
          "checkIn": "2026-03-01",
          "checkOut": "2026-03-03",
          "currency": "USD",
          "language": "EN"
        },
        "settings": { "access": { "code": 10001 } }
      }'
    ```

    Save `data.bookingReference`.
  </Step>

  <Step title="Step 7: Cancel">
    ```bash theme={null}
    curl -X POST "$BASE_URL/api/cancel" \
      -H "Content-Type: application/json" \
      -H "api-key: $API_KEY" \
      -d '{
        "input": {
          "reference": { "bookingReference": "BOOKING_REFERENCE_FROM_BOOK" },
          "language": "EN"
        },
        "settings": { "access": { "code": 10001 } }
      }'
    ```
  </Step>
</Steps>

<Note>
  All successful responses are wrapped by the backend as:

  ```json theme={null}
  {
    "data": {},
    "message": "success"
  }
  ```
</Note>

## Next

* Detailed call chain: `/api-reference/workflow`
* Content API: `/api-reference/content/accommodations`
* Core endpoints: `/api-reference/core/search`, `/api-reference/core/quote`, `/api-reference/core/book`, `/api-reference/core/cancel`
* Management endpoints: `/api-reference/management/auth-login`, `/api-reference/management/users`, `/api-reference/management/api-keys`
