### Install Dependencies and Start Development Server Source: https://developer.camping.care/docs/appstore/getting-started Navigate to the project directory, install required packages, and launch the local development server. ```bash cd npm install npm run dev ``` -------------------------------- ### Example Booking URL Structure Source: https://developer.camping.care/docs/booking-engine/parameters Demonstrates the format for sending GET parameters to the booking engine. Replace 'demo' with your specific camping slug. ```url https://booking.camping.care/demo?arrival=2022-07-31&departure=2022-08-06&category=rent&guests= ``` -------------------------------- ### Start Development Server Source: https://developer.camping.care/docs/tutorials/basic-app-vue Start up your development server to run the application locally. The app will be accessible at a URL like http://localhost:5173/. ```bash npm run dev ``` -------------------------------- ### Install Node Modules with npm Source: https://developer.camping.care/docs/tutorials/basic-app-vue Install the necessary node_modules for the project using npm. ```bash npm install ``` -------------------------------- ### Install Composer Dependencies Source: https://developer.camping.care/docs/tutorials/basic-app-laravel Install the necessary project dependencies using Composer after cloning the repository. ```bash composer install ``` -------------------------------- ### Example cURL Request for Accommodation Search Source: https://developer.camping.care/docs/tutorials/accommodation-search Use this cURL command to make a GET request to the accommodation search endpoint. Ensure you replace 'YOUR_PUBLIC_KEY' with your actual API key. ```bash curl --location --request GET 'https://api.camping.care/v3/accommodations/search' \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_PUBLIC_KEY" ``` -------------------------------- ### HTML Booking Form Example Source: https://developer.camping.care/docs/booking-engine/parameters A sample HTML form that utilizes GET parameters for selecting accommodation category, arrival, and departure dates. The form action should be updated to your booking URL. ```html






``` -------------------------------- ### Start Laravel Development Server Source: https://developer.camping.care/docs/tutorials/basic-app-laravel Start the built-in development server to test your Laravel application locally. The application will typically run on http://localhost:8000. ```bash php artisan serve ``` -------------------------------- ### Set Up Laravel Environment and Generate Key Source: https://developer.camping.care/docs/tutorials/basic-app-laravel Copy the example environment file and generate a new application key for Laravel. This is essential for security and configuration. ```bash cp .env.example .env php artisan key:generate ``` -------------------------------- ### Pricing Grid Widget with Parameters Source: https://developer.camping.care/docs/booking-engine/widgets/grid This example demonstrates how to use the Pricing Grid widget with specific parameters, such as the 'accommodation' parameter, which is required for this widget. ```APIDOC ## Parameters You can use all the default parameters as described at this page: Booking Parameters. Instead of adding these parameters to the query, they can be used like this: ### Code Example ```html ``` ### Important The `accommodation` parameter is required for this widget. ``` -------------------------------- ### My Reservation Widget with Parameters Source: https://developer.camping.care/docs/booking-engine/widgets/my-reservation This example shows the basic structure of the booking-engine tag. Custom parameters are added as described in the 'Booking Parameters' documentation. ```html ``` -------------------------------- ### Guest Age Table Input Example Source: https://developer.camping.care/docs/booking-engine/parameters Shows the JSON/URL-encoded string format for specifying guest counts and their age table IDs. ```json [{"id": 12345, "count": 2}, {"id": 12346, "count": 1}] ``` -------------------------------- ### Clone Basic Laravel App Source: https://developer.camping.care/docs/tutorials/basic-app-laravel Clone the basic Laravel app repository to your local machine to start your project. Navigate into the cloned directory. ```bash git clone https://github.com/CampingCare/basic-app-laravel.git cd basic-app-laravel/ ``` -------------------------------- ### Reservation Widget URL Parameters Source: https://developer.camping.care/docs/appstore/widgets/reservation-tab Example URL structure for the reservation widget, including parameters for ID, authentication token, and language. ```url https://example.widget?id={id}&authtoken={authtoken}}&lang=en ``` -------------------------------- ### Create Reservation Request Source: https://developer.camping.care/docs/tutorials/create-reservations/price-calculation-private-key Example payload for creating a reservation using a calculation draft ID and traveler information. ```php updatePriceCalculationOption($caclulation_draft_id, $args); { "accommodation_id" : 12345, "calculation_draft_id" : "{calculation_draft_id from price calculation}" "mainTraveler" : { "gender": "male", "first_name": "John", "last_name": "Doe", "address": "Canal Street", "address_number": "1", "zipcode": "1234AA", "city": 'Amsterdam', "phone" : '0031123456789', "email" : "john@doe.com" }, "language" : "nl", "meta" : [], } ``` -------------------------------- ### Price Calculation Response Source: https://developer.camping.care/docs/tutorials/create-reservations/price-calculation-private-key Example response structure for a price calculation, including available options and total price breakdown. ```json { "arrival": "2021-08-01", "departure": "2021-08-15", "duration": 14, "persons": 3, "accommodation_id": 12345, "calculation_id": 1, "calculation_draft_id": "kyzr8m******2hhw2", "total_price": 560, // the part which is calculated by for example pre season price, specific arrangement etc "total_guests": 70, // the part which is calcutated fot the extra guests "total_taxes": 0, // the part of for example tourist tax which have to be paid "total_options": 0, // total of option prices (this will be used when options are added with the Add Option Method "total_required_options": 10, // the required options which are in this calculation "total_discounts": 0, // the discount on this price "total": 640, // the total of the price, this is a sum of the parameters: total_price, total_guests, total_taxes, total_options, total_required_options and total_discounts "rows": [ // this will hold the exact same rows as the Price Calculation Method (See the Price Calculation Example above) { "......" : "....." } ], "option_rows": [ { "id": null, "row_id": null, "type": "product_option", "type_id": 1, "description": "Dog", "amount": 2, "total": 112, "data": { "pay_on_location": 0, "apply_to_payment_terms": 0, "discard_on_discounts": 0 }, "translations": [] } ], "available_option_rows": [ // this will hold the exact same rows as the Price Calculation Method (See the Price Calculation Example above) { "......" : "....." } ], // information about the age tables which are available "age_tables": [ // this will hold the exact same rows as the Price Calculation Method (See the Price Calculation Example above) { "......" : "....." } ], // the chosen age table information "age_table_data": [ // this will hold the exact same rows as the Price Calculation Method (See the Price Calculation Example above) { "......" : "....." } ], // the deposit which have to be paid for the calculation "deposit": 752 } ``` -------------------------------- ### Get User Information with Private API Key Source: https://developer.camping.care/docs/api/authentication Use this cURL command to make a GET request to retrieve user information. Ensure you replace `{privateApiKey}` with your actual private API key and include the necessary Authorization header. ```curl curl --location --request GET 'https://api.camping.care/v21/users/me' \ -H "Accept: application/json" \ -H "Authorization: Bearer {privateApiKey}" ``` -------------------------------- ### Guest Birthdates Input Example Source: https://developer.camping.care/docs/booking-engine/parameters Illustrates the JSON format for providing guest birthdates, which the system converts to age tables. The JSON object should be URL encoded. ```json [{"birthdate":"2015-01-01","amount":1}, {"birthdate":"2004-02-01","amount":2}] ``` -------------------------------- ### GET /widget Source: https://developer.camping.care/docs/appstore/widgets/cart Configuration of the Booking Engine Form widget via URL query parameters. ```APIDOC ## GET /widget ### Description This widget is loaded at the Booking Engine Form to allow customization of the booking experience. ### Method GET ### Parameters #### Query Parameters - **cart_id** (string) - Required - The unique id of the shopping cart session (UUID format). - **admin_id** (string) - Required - The unique administration ID. - **draft_id** (string) - Required - The price calculation draft id. - **lang** (string) - Optional - The language of the user. - **public_api_key** (string) - Required - The public api key. ### Request Example https://example.widget?id={id}&authtoken={authtoken}&lang=en ``` -------------------------------- ### Price calculation request parameters Source: https://developer.camping.care/docs/tutorials/create-reservations/price-calculation-private-key Example JSON payload for initiating a price calculation using age tables to define guest demographics. ```json { "accommodation_id": 12345, "arrival": "2021-08-15", "departure": "2021-08-15", "get_guests_price": true, "get_taxes_price": true, "get_discounts_price": true, "get_options": true, "get_deposit" : true, "age_tables" : [ { "id" : 12345, "count" : 2 }, { "id" : 12346, "count" : 0 } ] } ``` -------------------------------- ### GET /accommodations/search Source: https://developer.camping.care/docs/tutorials/accommodation-search Search for accommodation pricing and availability within an administration or campsite group. ```APIDOC ## GET https://api.camping.care/v3/accommodations/search ### Description Search for the basic price of all accommodations within your administration or campsite group. The price is calculated based on the provided arrival and departure dates, and availability information is returned. ### Method GET ### Endpoint https://api.camping.care/v3/accommodations/search ### Parameters #### Query Parameters - **arrival** (string) - Required - Arrival date in YYYY-MM-DD format. - **departure** (string) - Required - Departure date in YYYY-MM-DD format. - **age_table_categories** (array) - Optional - Specify the number of persons per age category (e.g., [{"id":"adults", "count":"2"}]). - **persons** (integer) - Optional - Total number of travelers if age_table_categories is not specified. - **accommodation_id** (string) - Optional - Filter by a specific accommodation ID. - **tags** (array) - Optional - Filter accommodations by tags using groups of tagIds. - **type** (object) - Optional - Filter by accommodation type (e.g., {type: 'bungalow', operator: 'EQ'}). - **stock** (object) - Optional - Filter by stock availability (e.g., {stock: 1, operator: 'GTE'}). ### Headers - **Authorization** (string) - Required - Bearer token using a public API key. - **X-Admin-Id** (string) - Optional - Specify an administration ID to receive data from a specific administration. ``` -------------------------------- ### Remove Git Directory Source: https://developer.camping.care/docs/tutorials/basic-app-laravel Remove the .git directory to start with a fresh Git repository for your project. ```bash rm -rf .git ``` -------------------------------- ### Get Auth Token Source: https://developer.camping.care/docs/appstore/authentication Obtain an idToken and refreshToken using an authtoken. ```APIDOC ## POST /v21/oauth/token ### Description Exchanges an `authtoken` for an `idToken` and `refreshToken`. ### Method POST ### Endpoint `https://api.camping.care/v21/oauth/token` ### Parameters #### Form Parameters - **auth_token** (string) - Required - The authentication token obtained from the widget or app default page. ### Request Example ```json { "auth_token": "..." } ``` ### Response #### Success Response (200) - **kind** (string) - Type of response. - **idToken** (string) - The JWT id token for API authentication. - **refreshToken** (string) - The refresh token to obtain a new idToken. - **expiresIn** (string) - The validity period of the idToken in seconds. - **isNewUser** (boolean) - Indicates if the user is new. #### Response Example ```json { "kind":"identitytoolkit#VerifyCustomTokenResponse", "idToken":"....JWTidToken", "refreshToken":"....RefreshToken", "expiresIn":"3600", "isNewUser":false } ``` ``` -------------------------------- ### GET /v3/accommodations/search Source: https://developer.camping.care/docs/tutorials/accommodation-search Retrieves a list of accommodations based on search criteria, supporting pagination and custom sorting. ```APIDOC ## GET /v3/accommodations/search ### Description Search for accommodations across the platform. Supports pagination and complex sorting. ### Method GET ### Endpoint https://api.camping.care/v3/accommodations/search ### Parameters #### Query Parameters - **offset** (integer) - Optional - The pagination page to return (e.g., 1, 2, 3). - **limit** (integer) - Optional - The amount of results to return (max 20). - **count** (boolean) - Optional - Returns the total number of accommodations found. - **sorts** (array) - Optional - Sorting configuration. Example: `[{"column": "price_total", "order": "desc"}]`. Supported columns: available_stock, rank, price_total, persons_max, persons_min, name, rating. Supported directions: asc, desc. ### Request Example curl --location --request GET 'https://api.camping.care/v3/accommodations/search' \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_PUBLIC_KEY" ### Response #### Success Response (200) - **id** (string) - Unique identifier for the accommodation. - **numeric_id** (integer) - Numeric identifier. - **price_total** (number) - Total price. - **available_stock** (integer) - Current stock available. - **name** (string) - Name of the accommodation. - **rating** (object) - Rating details including average and amount. - **labels** (array) - List of amenities or labels. #### Response Example [ { "id": "acc_1701b61a20ec4chd85b3b7323c055d83", "numeric_id": 54, "price_total": 400, "available_stock": 56, "name": "Standard plaats", "rating": { "amount": "542", "avarage": "9" } } ] ``` -------------------------------- ### Get User Data Source: https://developer.camping.care/docs/appstore/authentication Retrieve the logged-in user's data using an idToken. ```APIDOC ## GET /v21/users/me ### Description Retrieves the data of the currently logged-in user via OAuth 2.0. ### Method GET ### Endpoint `https://api.camping.care/v21/users/me` ### Parameters #### Headers - **Accept** (string) - Required - `application/json` - **Authorization** (string) - Required - `Bearer {idToken}` - **x-admin-id** (string) - Required - The administration ID, necessary for most requests when a user operates multiple administrations. ### Request Example ```bash curl --location --request GET 'https://api.camping.care/v21/users/me' \ -H "Accept: application/json" \ -H "Authorization: Bearer {idToken}" \ -H "x-admin-id: {adminId}" ``` ### Response #### Success Response (200) - **[User Data Fields]** (object) - The user's profile information. (Specific fields not detailed in source text) #### Response Example (Response example not provided in source text) ``` -------------------------------- ### API Request with Bearer Token using cURL Source: https://developer.camping.care/docs/appstore/authentication This cURL command demonstrates how to make an authenticated GET request to the /users/me endpoint. Replace {idToken}, {adminId}, and ensure the 'Authorization' and 'x-admin-id' headers are correctly set. ```bash curl --location --request GET 'https://api.camping.care/v21/users/me' \ -H "Accept: application/json" \ -H "Authorization: Bearer {idToken}" \ -H "x-admin-id: {adminId}" ``` -------------------------------- ### Create a Forced Reservation Payload Source: https://developer.camping.care/docs/tutorials/create-reservations/forced-booking Example payload for submitting a reservation with forced pricing, including birth tables and main traveler details. ```json { "accommodation_id": 12345, "arrival": "2021-08-15", "departure": "2021-08-15", "birth_tables" : [ { "birthdate" : "1980-01-01", "count" : 2 }, { "birthdate" : "2018-01-01", "count" : 0 } ], "force": true, "forced_rows" : [ { "type":"product", "type_id":"1234", "description": "Pitch description", "amount":"2", "total":"200" }, { "type":"product", "type_id":"1234", "description": "Guest price description", "amount":"2", "total":"50" } ], "mainTraveler" : { "gender": "male", "first_name": "John", "last_name": "Doe", "address": "Canal Street", "address_number": "1", "zipcode": "1234AA", "city": "Amsterdam", "phone" : "0031123456789", "email" : "john@doe.com" }, "meta" : [], } ``` -------------------------------- ### Accommodation Search Sorting Example Source: https://developer.camping.care/docs/tutorials/accommodation-search This JSON array defines the sorting criteria for accommodation searches. Use 'column' to specify the field and 'order' for the direction (asc/desc). ```json [ { "column": "price_total", "order": "desc" }, { "column": "rank", "order": "asc" }, { "column": "name", "order": "asc" } ] ``` -------------------------------- ### Get Auth Token using cURL Source: https://developer.camping.care/docs/appstore/authentication Use this cURL command to exchange an authtoken for an idToken and refreshToken. Ensure you replace '...' with your actual authtoken. ```bash curl --location --request POST 'https://api.camping.care/v21/oauth/token' \ --form 'auth_token="..."' ``` -------------------------------- ### Initialize Vue JS Project Source: https://developer.camping.care/docs/appstore/getting-started Use the official Vue scaffolding tool to create a new project. ```bash npm init vue@latest ``` -------------------------------- ### Run Database Migrations Source: https://developer.camping.care/docs/tutorials/basic-app-laravel Apply the database migrations to set up the necessary tables in your MySQL database. ```bash php artisan migrate ``` -------------------------------- ### Reservation Widget Integration Source: https://developer.camping.care/docs/appstore/widgets/reservation Details on how to initialize the reservation widget using query parameters and how to handle supported events. ```APIDOC ## Reservation Widget ### Description This widget is loaded at the reservation popup or page to display information relevant to a specific reservation. ### Query Parameters - **id** (string) - Required - The unique id of the reservation. - **authtoken** (string) - Required - The token used to login the user and communicate with the API. - **lang** (string) - Optional - The language of the user. ### Events The widget supports the following event object: - **height** (number) - The height of the widget in pixels. - **refresh** (boolean) - If true, the widget will refresh the reservation. ``` -------------------------------- ### Integrate My Reservation Widget Source: https://developer.camping.care/docs/booking-engine/widgets/my-reservation Copy this code and paste it into your website's HTML. Ensure the administration slug is replaced with your actual administration slug. ```html ``` -------------------------------- ### Configure Pricing Grid Parameters Source: https://developer.camping.care/docs/booking-engine/widgets/grid Pass additional parameters directly to the widget tag. The accommodation parameter is mandatory for this widget. ```html ``` -------------------------------- ### Create a new device Source: https://developer.camping.care/docs/tutorials/pin-terminal Required parameters to register a new pin_terminal device. ```json { name: 'Terminal Reception', type: 'pin_terminal' } ``` -------------------------------- ### Integrate Pricing Grid Widget Source: https://developer.camping.care/docs/booking-engine/widgets/grid Copy and paste this snippet into your CMS to render the pricing grid. Ensure the administration slug is replaced with your specific value. ```html ``` -------------------------------- ### Website Integration Source: https://developer.camping.care/docs/booking-engine/widgets/grid This snippet shows how to import the Pricing Grid widget into your website by copying and pasting the provided code. It is compatible with popular CMS tools. ```APIDOC ## Website Integration Importing this widget to your website is very easy. Just copy the code below and paste it into your website. This works with all the popular CMS tools like Wordpress or Wix ### Code Example ```html ``` ``` -------------------------------- ### Clone Basic Vue App Repository Source: https://developer.camping.care/docs/tutorials/basic-app-vue Clone the basic Vue app GIT repository to your local machine using the GitHub CLI. ```bash git clone https://github.com/CampingCare/basic-app-vue.git cd basic-app-vue/ ``` -------------------------------- ### Configure Widget Parameters Source: https://developer.camping.care/docs/booking-engine/widgets/filter Pass additional configuration parameters directly as attributes on the booking-engine element. ```html ``` -------------------------------- ### Widget with Arrival and Departure Dates Source: https://developer.camping.care/docs/booking-engine/widgets/search-and-book Set specific arrival and departure dates directly within the widget by adding the 'arrival' and 'departure' parameters. Replace '{Your administration slug}' with your administration identifier. ```html ``` -------------------------------- ### Sample Accommodation Search Response Source: https://developer.camping.care/docs/tutorials/accommodation-search This is a sample JSON response for an accommodation search. It includes details like ID, pricing, ratings, labels, and descriptions. ```json [ { "id": "acc_1701b61a20ec4chd85b3b7323c055d83", "numeric_id": 54, "price": 400, "price_fixed": 0, "price_per_night": 0, "price_total": 400, "available_stock": 56, "thumbnail": "https://lh3.googleusercontent.com/_rS020CQtMZDPuTEUGuAaSTFhGe7SfUpyKa2Bb2oM0__-UGpTohl4XmjKagWXGY8dTJeGT0-Keu7OlqfWqr1zwJ1=s250", "rating": { "amount": "542", "avarage": "9" }, "labels": [ { "id": "be9b19e0-d856-4c85-854f-cd89a3g8dfee", "icon": "mdi-account-multiple-outline", "color": "blue", "description": "6", "translations": { "de": { "description": "" }, "nl": { "name": "6", "description": "" } } }, { "id": "pets", "icon": "mdi-paw", "color": "green", "description": "Pets allowed", "translations": { "de": { "description": "" }, "nl": { "name": "Pets allowed", "description": "" } } }, { "id": "wifi", "icon": "mdi-wifi", "color": "green", "description": "Wifi", "translations": { "de": { "description": "" }, "nl": { "name": "Wifi", "description": "" } } }, { "id": "dishwasher", "icon": "mdi-dishwasher", "color": "green", "description": "Dishwasher", "translations": { "de": { "description": "" }, "nl": { "name": "Dishwasher", "description": "" }, } } ], "persons_max": 6, "persons_min": 1, "rank": 1, "closed": true, "name": "Standard plaats", "name_translations": { "de": { "description": "" }, "nl": { "description": "Standard plaats" } }, "description": "Lekker terug naar de basis......", "description_translations": { "de": { "description": "" }, "nl": { "description": "Lekker terug naar de basis......" } } } ] ``` -------------------------------- ### Available accommodation types Source: https://developer.camping.care/docs/tutorials/accommodation-search List of supported accommodation types and their corresponding values. ```json [ { title: 'Other' value: 'other' }, { title: 'Pitch' value: 'campsite' }, { title: 'Apartment' value: 'apartment' }, { title: 'Camping barrel' value: 'camping_barrel' }, { title: 'Bungalow tent' value: 'bungalow_tent' }, { title: 'Bungalow' value: 'bungalow' }, { title: 'Caravan' value: 'caravan' }, { title: 'Chalet' value: 'chalet' }, { title: 'Hiker\'s cabin' value: 'hiker_cabin' }, { title: 'Holiday home' value: 'holiday_home' }, { title: 'Hotel Room' value: 'hotelroom' }, { title: 'Lodge tent' value: 'lodge_tent' }, { title: 'Mobile home' value: 'mobilehome' }, { title: 'Studio' value: 'studio' }, { title: 'Tipitent' value: 'tipitent' }, { title: 'Treehouse' value: 'treehouse' }, { title: 'Villa' value: 'villa' }, { title: 'Gypsy wagon' value: 'gipsywagon' }, { title: 'Safari Tent' value: 'safari_tent' }, { title: 'POD' value: 'pod' }, ] ``` -------------------------------- ### Create Reservation Source: https://developer.camping.care/docs/tutorials/create-reservations/price-calculation-private-key Creates a reservation after options have been updated in the price calculation. ```APIDOC ## POST /api/reservations/create ### Description Creates a reservation using the calculation draft ID obtained from the price calculation and option update steps. ### Method POST ### Endpoint /api/reservations/create ### Parameters #### Request Body - **accommodation_id** (integer) - Required - The ID of the accommodation. - **calculation_draft_id** (string) - Required - The draft ID from the price calculation. - **mainTraveler** (object) - Required - Information about the main traveler. - **gender** (string) - Required - Gender of the traveler. - **first_name** (string) - Required - First name of the traveler. - **last_name** (string) - Required - Last name of the traveler. - **address** (string) - Required - Address of the traveler. - **address_number** (string) - Required - Address number. - **zipcode** (string) - Required - Zip code. - **city** (string) - Required - City. - **phone** (string) - Required - Phone number. - **email** (string) - Required - Email address. - **language** (string) - Required - Language code for the reservation (e.g., 'nl'). - **meta** (array) - Optional - Additional metadata. ### Request Example ```json { "accommodation_id" : 12345, "calculation_draft_id" : "{calculation_draft_id from price calculation}", "mainTraveler" : { "gender": "male", "first_name": "John", "last_name": "Doe", "address": "Canal Street", "address_number": "1", "zipcode": "1234AA", "city": "Amsterdam", "phone" : "0031123456789", "email" : "john@doe.com" }, "language" : "nl", "meta" : [] } ``` ### Response #### Success Response (200) (Response details not provided in the source text.) #### Response Example (Response example not provided in the source text.) ``` -------------------------------- ### Embed Search and Book Widget Source: https://developer.camping.care/docs/booking-engine/widgets Copy this code and paste it into your website to integrate the 'Search and Book' widget. Ensure you replace '{Your administration slug}' with your actual administration slug. ```html ``` -------------------------------- ### Website Integration Source: https://developer.camping.care/docs/booking-engine/widgets/filter This snippet shows how to import the Accommodation Filter widget into your website. Simply copy and paste the provided HTML code into your website's source. ```APIDOC ## Website Integration Importing this widget to your website is very easy. Just copy the code below and paste it into your website. This works with all the popular CMS tools like Wordpress or Wix ```html ``` ``` -------------------------------- ### Configure MySQL Database in .env Source: https://developer.camping.care/docs/tutorials/basic-app-laravel Update the .env file with your MySQL database connection details, including the connection type, host, port, database name, username, and password. ```dotenv DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD=password ``` -------------------------------- ### App URL Query Parameters Source: https://developer.camping.care/docs/appstore/widgets/app-url Details the parameters passed to the app URL when the platform interacts with the widget. ```APIDOC ## App URL Query Parameters ### Description The platform appends these parameters to the app URL to provide context about the current session and administration. ### Query Parameters - **action** (string) - Required - Can be 'open', 'install', or 'uninstall'. - **authtoken** (string) - Optional - Provided only if the app is installed. - **admin_id** (string) - Required - Unique identifier of the administration. - **chain_id** (integer) - Required - Defaults to 0, unless the administration is part of a chain. - **app_id** (string) - Required - Unique identifier of the app. - **lang** (string) - Required - The language of the user. ``` -------------------------------- ### Widget Parameters Source: https://developer.camping.care/docs/booking-engine/widgets/filter You can customize the widget by adding default parameters. These parameters can be added directly as attributes to the `` tag. ```APIDOC ## Parameters You can use all the default parameters as described at this page: Booking Parameters. Instead of adding these parameters to the query, they can be used like this: ```html ``` ``` -------------------------------- ### Contact Tab Widget Integration Source: https://developer.camping.care/docs/appstore/widgets/contact-tab Details on the query parameters required to initialize the contact tab widget. ```APIDOC ## GET /contact-widget ### Description Initializes the contact tab widget for guest interactions. ### Query Parameters - **id** (string) - Required - The unique id of the contact. - **authtoken** (string) - Required - The token used to login the user and communicate with the API. - **lang** (string) - Optional - The language of the user. ``` -------------------------------- ### Configure device metadata Source: https://developer.camping.care/docs/tutorials/pin-terminal Metadata keys used to define endpoints and timeouts for the terminal. ```json { key: "payment_endpoint", value: "https://your-app-url.com/payment-request" } ``` ```json { key: "payment_timeout", // (Optional) value: 120 } ``` ```json { key: "cancellation_request", // (Optional) value: "https://your-app-url.com/cancellation-request" } ``` -------------------------------- ### POST Widget Height Event Source: https://developer.camping.care/docs/appstore/widgets/app-url Describes how to send a postMessage event to the platform to update the widget height. ```APIDOC ## POST Widget Height Event ### Description Sends a postMessage to the parent window to adjust the widget height, preventing scrollbars or excessive whitespace. ### Request Body - **height** (integer) - Required - The height of the widget in pixels. ### Request Example ```json { "height": 300 } ``` ### Implementation Example ```javascript window.top.postMessage({ height: 300 }, '*'); ``` ``` -------------------------------- ### Widget with Custom Linkout URL Source: https://developer.camping.care/docs/booking-engine/widgets/search-and-book Redirect users to your custom accommodation list page by setting the 'linkout_page' parameter. Replace '{Your administration slug}' with your administration identifier and update the URL to your custom page. ```html ``` -------------------------------- ### Widget Events Source: https://developer.camping.care/docs/appstore/widgets/cart Supported events for the reservation widget. ```APIDOC ## Widget Events ### Description Supported event object parameters for the reservation widget. ### Response - **height** (integer) - Height in pixels. - **refresh** (boolean) - If true, the reservation will be refreshed. ### Response Example { "height": 300, "refresh": true } ``` -------------------------------- ### Reservation Widget Events Source: https://developer.camping.care/docs/appstore/widgets/reservation-tab Defines supported events for the reservation widget, such as setting height and triggering a refresh. These events can be fired via App URL. ```javascript { height: 300 // height in pixels refresh: true // if we get this parameter we will refresh the reservation } ``` -------------------------------- ### Handle payment request Source: https://developer.camping.care/docs/tutorials/pin-terminal The payload received at the payment_endpoint when a user initiates a payment. ```json { id: 123456, payment_uid: "pay_dfngjdnfg........." } ``` -------------------------------- ### Dashboard Widget Event Configuration Source: https://developer.camping.care/docs/appstore/widgets/dashboard Defines the event object structure for the dashboard widget. Currently supports setting the widget height in pixels. ```json { height: 300 // height in pixels } ``` -------------------------------- ### Automate Widget Height with ResizeObserver Source: https://developer.camping.care/docs/appstore/widgets/app-url This snippet automatically updates the widget's height based on its content's scroll height. It uses ResizeObserver to monitor body size changes and sends updates via post message. Call updateSize() initially to set the height. ```javascript const updateSize = () => { window.top.postMessage({ height: document.body.scrollHeight // height in pixels }, '*') ; } updateSize() ; // set the heigth for the first time // monitor on size changes and update the height based on those events. // create an Observer instance to check if the screen changes const resizeObserver = new ResizeObserver((entries) => { updateSize() ; }) // start observing a DOM node resizeObserver.observe(document.body) ``` -------------------------------- ### Integrate Accommodation Filter Widget Source: https://developer.camping.care/docs/booking-engine/widgets/filter Embed the widget by adding the custom booking-engine element and the required JavaScript module script. ```html ``` -------------------------------- ### Set Widget Height with Post Message Source: https://developer.camping.care/docs/appstore/widgets/app-url Use this code to send a post message to the platform to set a fixed height for the widget. Ensure the target origin is correctly specified. ```javascript window.top.postMessage({ height: 300 // height in pixels }, '*') ; ``` -------------------------------- ### Contact Widget Endpoint Source: https://developer.camping.care/docs/appstore/widgets/contact The Contact widget can be loaded with specific parameters to customize its behavior and display. ```APIDOC ## GET /websites/developer_camping_care/contact ### Description This endpoint loads the Contact widget, which can display custom information. It supports query parameters for customization. ### Method GET ### Endpoint /websites/developer_camping_care/contact ### Query Parameters - **id** (string) - Required - The unique ID of the contact. - **authtoken** (string) - Required - The authentication token for API communication. - **lang** (string) - Optional - The preferred language for the widget. ### Request Example ``` https://example.widget?id={id}&authtoken={authtoken}&lang=en ``` ### Response #### Success Response (200) - **message** (string) - A success message. #### Response Example ```json { "message": "Contact widget loaded successfully" } ``` ``` -------------------------------- ### Add Option to Calculation Request Source: https://developer.camping.care/docs/tutorials/create-reservations/price-calculation-private-key JSON payload for adding options to an existing price calculation. ```json { "option_ids": [1], "value": 2 } ``` -------------------------------- ### Supported Reservation Widget Events Source: https://developer.camping.care/docs/appstore/widgets/cart The object structure for events supported by the reservation widget, including height configuration and refresh triggers. ```json { height: 300 // height in pixels refresh: true // if we get this parameter we will refresh the reservation } ``` -------------------------------- ### Supported Contact Widget Events Source: https://developer.camping.care/docs/appstore/widgets/contact-tab The event object defines configuration for widget height and refresh behavior. ```json { height: 300 // height in pixels refresh: true // if we get this parameter we will refresh the contact } ``` -------------------------------- ### Widget Events Source: https://developer.camping.care/docs/appstore/widgets/contact-tab Supported event object structure for the contact widget. ```APIDOC ### Event Object - **height** (integer) - The height of the widget in pixels. - **refresh** (boolean) - If true, the contact widget will refresh. ### Example { "height": 300, "refresh": true } ``` -------------------------------- ### Return payment response Source: https://developer.camping.care/docs/tutorials/pin-terminal JSON responses for successful payment processing or error reporting. ```json { result: "success" } ``` ```json { error: { message: "Clearify what is going wrong in an error message." } } ``` -------------------------------- ### Age table categories parameter Source: https://developer.camping.care/docs/tutorials/accommodation-search JSON structure for specifying the number of persons per age category. ```json [ { "id":"adults", "count":"2" }, { "id":"childern", "count":"0" } ] ``` -------------------------------- ### Stock filter parameter Source: https://developer.camping.care/docs/tutorials/accommodation-search Filter object for restricting results based on minimum available stock. ```json { stock: 1, operator: 'GTE' } ``` -------------------------------- ### Reservation Response Structure Source: https://developer.camping.care/docs/tutorials/create-reservations/price-calculation-private-key The structure of the reservation object returned by the API, containing details about the booking, payment status, and associated line items. ```APIDOC ## Reservation Response ### Description Returns the full details of a reservation, including internal IDs, status, payment information, and a breakdown of reservation rows. ### Response #### Success Response (200) - **id** (integer) - The camping.care internal reservation id - **reservation_id** (integer) - The reservation id used by the campsite - **admin_id** (integer) - Admin identifier - **contact_id** (integer) - Contact identifier (0 if not yet available) - **accommodation_id** (integer) - The accommodation booked - **place_id** (integer) - Preferred place ID if chosen - **channel_id** (integer) - Channel ID (1 for Camping.care bookings) - **status** (string) - Current status (e.g., "pending") - **payment** (string) - Payment status (e.g., "unpaid") - **arrival** (string) - Arrival timestamp - **departure** (string) - Departure timestamp - **create_date** (string) - Creation timestamp - **draft_id** (string) - Reservation draft identifier - **total** (number) - Total reservation value - **meta** (object) - Additional reservation metadata - **rows** (array) - List of reservation line items - **contact** (object) - Contact details of the guest #### Response Example { "id": 12345678, "reservation_id": 1, "admin_id": 12345, "contact_id": 0, "accommodation_id": 12345, "place_id": 0, "channel_id": 1, "status": "pending", "payment": "unpaid", "arrival": "2021-08-01 12:00:00", "departure": "2021-08-15 11:59:59", "create_date": "2021-07-27 09:01:13", "draft_id": "bbd***ue2r", "total": 794, "meta": { "persons": 3, "pay_method": "mollie", "language": "en" }, "rows": [ { "id": 1, "description": "Bungalow", "total": 0 } ], "contact": { "last_name": "Doe", "first_name": "John" } } ``` -------------------------------- ### Reservation Response Placeholder Source: https://developer.camping.care/docs/tutorials/create-reservations/forced-booking Placeholder for the API response structure. ```javascript // reservation ``` -------------------------------- ### Widget Height Event Object Source: https://developer.camping.care/docs/appstore/widgets/app-url This is the structure of the event object used to communicate the widget's height to the platform. It expects a 'height' property in pixels. ```json { height: 300 // height in pixels } ``` -------------------------------- ### Widget Hiding Accommodation Selection Source: https://developer.camping.care/docs/booking-engine/widgets/search-and-book Prevent users from selecting specific accommodations by setting 'hide_accommodations' to '1'. Replace '{Your administration slug}' with your administration identifier. ```html ``` -------------------------------- ### Define Forced Reservation Rows Source: https://developer.camping.care/docs/tutorials/create-reservations/forced-booking The rows parameter requires a JSON array where each object specifies the type, description, amount, and total cost for the reservation. ```json [ { "type":"rate", "type_id":"1234", "description": "Pitch description", "amount":"2", "total":"200" }, { "type":"guest", "type_id":"1234", "description": "Guest price description", "amount":"2", "total":"50" } ] ``` -------------------------------- ### Search endpoint Source: https://developer.camping.care/docs/tutorials/accommodation-search The base endpoint for retrieving accommodation search results using a Bearer token. ```http GET https://api.camping.care/v3/accommodations/search ``` -------------------------------- ### Contact Widget Events Source: https://developer.camping.care/docs/appstore/widgets/contact The Contact widget supports specific events that can be triggered to control its behavior, such as setting height or refreshing content. ```APIDOC ## Contact Widget Events ### Description These are the events supported by the Contact widget. They are typically fired via URL parameters or JavaScript interactions. ### Events - **height** (number) - Sets the height of the widget in pixels. - **refresh** (boolean) - If set to `true`, the widget will refresh its content. ### Usage Example (URL Parameters) To set the height to 300 pixels and refresh the widget: ``` https://example.widget?height=300&refresh=true ``` ### Usage Example (JavaScript - Conceptual) ```javascript // Assuming 'widget' is a reference to the Contact widget instance widget.setHeight(300); widget.refreshContent(); ``` ```