Retrieve resort period information

  • Product Information
  • Resort content
  • 2 routes
How do I retrieve the operating, event, and closure periods of a resort?

This scenario shows how to retrieve the operating, event, and closure periods of a resort through the product periods endpoint.

Overview

Use GET/v1/products/{product_id}/periods_info to access the resort period information attached to a product. This is useful to expose opening windows, event periods, or closure periods in a product information context.

Prerequisites

  • product_id must be known.
  • accept-language and x-api-key headers are required.
  • Additional query options are not fully visible in the available source material.

Process workflow

Legend:
Mandatory
Optional
1

Retrieve resort operating periods

Mandatory

Use GET/v1/products/{product_id}/periods_info to retrieve the period entries exposed for a product, including operation windows that can be surfaced in a resort information page.

Prerequisites

  • Header accept-language
  • Header x-api-key
  • Optional header authorization
  • Path product_id

Calling CURL

curl -X GET "https://api.clubmed.com/v1/products/MPAC/periods_info" \
  -H "accept-language: en-US" \
  -H "x-api-key: <your-api-key>"

Example answer

[
  {
    "type": "EXCLUSIVITY",
    "start_date": "2020-12-01",
    "end_date": "2020-12-31"
  }
]

info: Start by storing the raw period entries as returned by the API. They provide the base dataset for calendars, product pages or operational labels in downstream channels.


Response codes

  • 200: period entries returned successfully.
  • 400: bad request or validation error.
  • 401: unauthorized when a protected context is requested.
  • 403: forbidden.
  • 404: unknown product.
GET/v1/products/{product_id}/periods_info
See more
2

Identify closure and event periods

Mandatory

Use the same GET/v1/products/{product_id}/periods_info response to interpret the returned type values and distinguish operating, closure or event periods in your channel logic.

Prerequisites

  • Header accept-language
  • Header x-api-key
  • Optional header authorization
  • Path product_id

Calling CURL

curl -X GET "https://api.clubmed.com/v1/products/MPAC/periods_info" \
  -H "accept-language: en-US" \
  -H "x-api-key: <your-api-key>"

Example answer

[
  {
    "type": "EXCLUSIVITY",
    "start_date": "2020-12-01",
    "end_date": "2020-12-31"
  }
]

info: The route returns one flat list of period entries. Your application must interpret the type field to decide whether a period should be shown as an opening window, an exclusivity period, a closure or an event-related label.


Response codes

  • 200: period entries returned successfully.
  • 400: bad request or validation error.
  • 401: unauthorized when a protected context is requested.
  • 403: forbidden.
  • 404: unknown product.
GET/v1/products/{product_id}/periods_info
See more