# Hostrail Sandbox

Markdown companion for [https://hostrail.dev/sandbox](https://hostrail.dev/sandbox).

> Public evaluator lane for testing machine-readable booking discovery and execution.

## Runtime Probes

- Health: https://api.agenthotel.dev/healthz -> Issue (404)
- Readiness: https://api.agenthotel.dev/readyz -> Issue (404)
- Agent Card: https://api.agenthotel.dev/.well-known/agent-card.json -> Issue (404)
- OpenAPI: https://api.agenthotel.dev/openapi.json -> Issue (404)

## Evaluator Flow

1. Discover: fetch the Agent Card and OpenAPI before attempting writes.
2. Quote: use one concrete property, room type, and rate plan.
3. Confirm: preserve quote, hold, and receipt identifiers between calls.

## Live Sample Supply

- Live sample supply is temporarily unavailable. Keep using placeholder IDs until the commerce API is reachable again.
- Sample property name: unavailable
- Property ID: <property_id>
- Room type ID: <room_type_id>
- Rate plan ID: <rate_plan_id>

## Example Flow

```bash
curl -s 'https://api.agenthotel.dev/v1/properties' \
  -H 'accept: application/json'
```

```bash
curl -s -X POST 'https://api.agenthotel.dev/v1/quotes' \
  -H 'content-type: application/json' \
  -d '{
    "hotel_id": "<property_id>",
    "room_type_id": "<room_type_id>",
    "rate_plan_id": "<rate_plan_id>",
    "check_in": "2026-05-02",
    "check_out": "2026-05-04",
    "adults": 2
  }'
```

```bash
curl -s -X POST 'https://api.agenthotel.dev/v1/holds' \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer <agent_secret>' \
  -H 'Idempotency-Key: sandbox-hold-001' \
  -d '{ "quote_id": "<quote_id>" }'
```

```bash
curl -s -X POST 'https://api.agenthotel.dev/v1/bookings' \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer <agent_secret>' \
  -H 'Idempotency-Key: sandbox-booking-001' \
  -d '{
    "quote_id": "<quote_id>",
    "hold_id": "<hold_id>",
    "payment_intent_id": "<payment_intent_id>",
    "guest": {
      "full_name": "Alex Nguyen",
      "email": "alex@example.com",
      "phone": "+84900111222"
    }
  }'
```

## Delegated Booking

- The extended delegated-payment path lives in the admin sandbox and delegated smoke script.

```bash
cd apps/commerce-api
pnpm smoke:delegated-booking
```

## Related Pages

- For Agents: https://hostrail.dev/for-agents
- Machine context: https://hostrail.dev/llms-full.txt
- For Hotels: https://hostrail.dev/for-hotels
- Partner intake: https://hostrail.dev/for-hotels
