> ## 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.

# Workflow

> Required call sequence and reference lifecycle.

This is the recommended integration sequence, aligned with backend validation rules.
The flow is:
`Content Accommodations -> Search -> Quote -> Book -> Cancel`.

## Step 0: Prepare Credentials

1. Admin creates partner user(s) and connection(s)
2. Partner admin creates API key(s)
3. Integrator stores:
   * `api-key`
   * `connection code` (`settings.access.code`)

## Step 1: Pull Content Accommodations

```http theme={null}
POST /api/v1/content/accommodations
```

Output to keep:

* accommodation `code` = `data.accommodations[].code`

Usage in search:

* For content-driven flow, build `searchCriteria.destinations.accommodations[]` from accommodation codes
* One accommodation object maps to one content accommodation, e.g. `{ "type": "Hotel", "code": "<accommodation_code>" }`

Pagination notes:

* Use `nextPageToken` until `hasMore = false`
* Default `size = 10`, max `size = 100`

## Step 2: Search

```http theme={null}
POST /api/search
```

Input requirements:

* Search selector is mutually exclusive; choose exactly one of:
  * `searchCriteria.destinations.accommodations[]`
  * `searchCriteria.geo` (`lat/lng`, optional `radiusKm <= 60`, optional `limit <= 1000`)
  * `searchCriteria.accommodationName`
* For this workflow, `searchCriteria.destinations.accommodations[]` should come from content accommodation codes
* `settings.access.code` must belong to current partner

Output to keep:

* `optionId` = `data.accommodations[].options[].id`

Lifecycle:

* Search option payload is cached by backend with \~24 hour TTL
* Option payload includes occupancy and stay snapshot for quote validation

## Step 3: Quote

```http theme={null}
POST /api/quote
```

Input requirements:

* `quoteCriteria.optionId` from search response
* `accommodation`, `checkIn/checkOut`, `occupancies` must match cached search payload

Output to keep:

* `quoteId` = `data.id`

Lifecycle:

* Quote payload is cached for book flow with \~30 minute TTL

## Step 4: Book

```http theme={null}
POST /api/book
```

Input requirements:

* `bookCriteria.quoteId` from quote response
* `bookCriteria.partnerReference` required
* `bookCriteria.holder.name/surName` required
* `settings.access.code` must belong to current partner

Output to keep:

* `bookingReference` = `data.bookingReference`

## Step 5: Cancel

```http theme={null}
POST /api/cancel
```

Input requirements:

* `input.reference.bookingReference` required
* Booking must be owned by partner
* Booking must be cancellable according to policy and current time

## Important Validation Rules

* `settings.access.code` is mandatory in all core APIs
* Quote fails if price changed against search snapshot (`"Price changed"`)
* Book fails when quote reference expired/invalid
* Cancel fails after check-in date or for non-refundable bookings

## Rate Limiting

Rate limit is applied on:

* `POST /api/search`
* `POST /api/quote`

Headers returned:

* `X-RateLimit-Limit`
* `X-RateLimit-Remaining`
* `X-RateLimit-Reset`
* `Retry-After` when limited (`429`)
