Skip to content

Examples using cURL

These examples walk through the complete Workflow with cURL. For every parameter and response field see the API reference; to try the same requests in a graphical tool, use the Postman Collection.

The examples read your API key from an environment variable (see Environments & Authorization#Authorization):

export APIXV_API_KEY="<your API key>"

Identifiers such as AXO-... come from the previous step's response; replace them with your own values.

1. List the static datasets

curl -H "Authorization: ApiKey $APIXV_API_KEY" \
  "https://demo.apixv.com/hotelxv/api/v2/datasets"

Each dataset has a download URL (href) to a gzipped NDJSON file.

2. Get hotel content

All hotels available to you, 100 per page. Pass the next_page_token of the response as page_token to get the next page:

curl -H "Authorization: ApiKey $APIXV_API_KEY" \
  "https://demo.apixv.com/hotelxv/api/v2/hotels?size=100"

Specific hotels:

curl -H "Authorization: ApiKey $APIXV_API_KEY" \
  "https://demo.apixv.com/hotelxv/api/v2/hotels?hotel_uids=AXH-XNL4fK9Tq2,AXH-XNLb7Rm2Pz"

3. Search availability

Two adults and a 9-year-old child in one room, for two nights:

curl -H "Authorization: ApiKey $APIXV_API_KEY" \
  "https://demo.apixv.com/hotelxv/api/v2/options?hotel_uids=AXH-XNL4fK9Tq2,AXH-XNLb7Rm2Pz&check_in=2027-03-01&check_out=2027-03-03&occupancy=A-A-C9&currency=USD&market=NL&language=en&nationality=NL"

See Occupancy Format for the occupancy value. market and nationality are uppercase two-letter country codes. Each option in the response has an option_uid.

4. Confirm an option

curl -X POST -H "Authorization: ApiKey $APIXV_API_KEY" -H "Content-Type: application/json" \
  -d '{"price_tolerance": 5}' \
  "https://demo.apixv.com/hotelxv/api/v2/options/AXO-LjA3EWynZKvCNXAHT3Ji/actions/confirm"

The response contains the confirmation_uid and the guest details the booking requires (required_fields_holder, required_fields_guests).

5. Book

curl -X POST -H "Authorization: ApiKey $APIXV_API_KEY" -H "Content-Type: application/json" \
  -d '{
        "client_reference": "my-reference-123",
        "price_tolerance": 5,
        "holder": {"title": "Mr", "first_name": "John", "last_name": "Appleseed", "birth_date": "1985-04-12",
                   "email": "john.appleseed@example.com", "phone": "+1 555 0100", "country": "US"},
        "guests": [
          {"title": "Mr", "first_name": "John", "last_name": "Appleseed", "birth_date": "1985-04-12"},
          {"title": "Mrs", "first_name": "Jane", "last_name": "Appleseed", "birth_date": "1987-09-30"},
          {"title": "Miss", "first_name": "Emma", "last_name": "Appleseed", "birth_date": "2017-06-15"}
        ]
      }' \
  "https://demo.apixv.com/hotelxv/api/v2/confirmations/AXCO-2nyaSSwKw42h3jwGy2KSWTGZshCrhM9XrhL/actions/book"

Send all booking fields, including client_reference, price_tolerance and remarks, in the JSON body. List the guests in the order of the occupancy. Give every guest a title (Mr, Mrs, Ms or Miss) and a birth date, and the holder an email address and phone number: many hotels require them. The response contains the booking_uid and the booking status.

6. Retrieve bookings

All your bookings, page by page:

curl -H "Authorization: ApiKey $APIXV_API_KEY" \
  "https://demo.apixv.com/hotelxv/api/v2/bookings"

Specific bookings:

curl -H "Authorization: ApiKey $APIXV_API_KEY" \
  "https://demo.apixv.com/hotelxv/api/v2/bookings?booking_uids=AXB-01JA6ZQ3V8K2M4N5P6Q7R8S9TW"

7. Cancel a booking

curl -X POST -H "Authorization: ApiKey $APIXV_API_KEY" \
  "https://demo.apixv.com/hotelxv/api/v2/bookings/AXB-01JA6ZQ3V8K2M4N5P6Q7R8S9TW/actions/cancel"

The response contains the cancellation_uid, the cancellation status and the cancellation fee (price).