### Example GET Request for Bookings Source: https://api.checkfront.com/overview/requests.html This example demonstrates a GET request to retrieve a list of bookings with a specific status and date range. It includes common headers for authentication and client identification. ```http GET /api/3.0/booking/index?start_date=today&status_id=PAID HTTP/1.1 Host: your-company.checkfront.com Accept: application/json X-Forwarded-For: 66.228.55.142 X-On-Behalf: 1 Authorization: Basic M2JlOTg2NDFmMDc0NWI2ZmU3ZGFjYzJkZjk0N2FkYmMxZGE3MzEyZDo0YzRkNTk4YTVkOTQwZjA4ZmRiNDM1YjY5YWY5ODZjNzBmMjIwNmRk ``` -------------------------------- ### Example GET Request Source: https://api.checkfront.com/_sources/overview/requests.rst.txt Demonstrates a GET request to retrieve bookings with specific criteria. Ensure to include necessary headers for authentication and client identification. ```http GET /api/3.0/booking/index?start_date=today&status_id=PAID HTTP/1.1 Host: your-company.checkfront.com Accept: application/json X-Forwarded-For: 66.228.55.142 X-On-Behalf: 1 Authorization: Basic M2JlOTg2NDFmMDc0NWI2ZmU3ZGFjYzJkZjk0N2FkYmMxZGE3MzEyZDo0YzRkNTk4YTVkOTQwZjA4ZmRiNDM1YjY5YWY5ODZjNzBmMjIwNmRk ``` -------------------------------- ### Example HTTP GET Request Source: https://api.checkfront.com/_sources/guide/sdk_setup.rst.txt Demonstrates how to make a GET request to the Checkfront API using the SDK's abstraction. This is useful for retrieving data like bookings with specific parameters. ```http GET /api/3.0/booking/index?start_date=today&status_id=PAID HTTP/1.1 Host: your-company.checkfront.com ``` ```php $data = array( 'start_date' => 'today', 'status_id' => 'PAID' ); $Checkfront->get('booking/index', $data); ``` -------------------------------- ### GET /api/3.0/* Source: https://api.checkfront.com/_sources/overview/requests.rst.txt Example of a GET request to query bookings with specific criteria. It demonstrates how to include query parameters and essential headers for authentication and client information. ```APIDOC ## GET /api/3.0/* ### Description Queries a list of bookings with specified criteria, such as start date and status. ### Method GET ### Endpoint /api/3.0/booking/index ### Query Parameters - **start_date** (string) - Required - The starting date for the query (e.g., 'today'). - **status_id** (string) - Required - The status of the bookings to filter by (e.g., 'PAID'). ### Headers - **Accept**: application/json - **X-Forwarded-For** (string) - Required - The IP address of the connecting client. - **X-On-Behalf** (string) - Optional - The staff account to act on behalf of. Use 'off' to act as a customer. - **Authorization** (string) - Required - Credentials used to query the API. See :ref:`auth-token` or :ref:`oauth2-ref`. ### Request Example ```http GET /api/3.0/booking/index?start_date=today&status_id=PAID HTTP/1.1 Host: your-company.checkfront.com Accept: application/json X-Forwarded-For: 66.228.55.142 X-On-Behalf: 1 Authorization: Basic M2JlOTg2NDFmMDc0NWI2ZmU3ZGFjYzJkZjk0N2FkYmMxZGE3MzEyZDo0YzRkNTk4YTVkOTQwZjA4ZmRiNDM1YjY5YWY5ODZjNzBmMjIwNmRk ``` ### Response #### Success Response (200) - **bookings** (array) - A list of booking objects matching the query criteria. #### Response Example ```json { "example": "[booking objects]" } ``` ``` -------------------------------- ### Customer API Response Example Source: https://api.checkfront.com/_sources/ref/customer.rst.txt This JSON snippet shows an example of the response structure when retrieving customer data. ```json { "customer": { "id": 1, "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com", "phone": "123-456-7890", "created_at": "2023-01-01T10:00:00Z", "updated_at": "2023-01-01T10:00:00Z" } } ``` -------------------------------- ### Booking Index Response Example Source: https://api.checkfront.com/_sources/ref/booking/index.rst.txt This JSON snippet shows an example response when retrieving a list of bookings. It includes details such as booking ID, status, customer information, and financial totals. ```json { "response": { "bookings": [ { "booking_id": 1, "code": "A1B2C3D4E5", "status_id": "CONFIRMED", "status_name": "Confirmed", "created_date": "2014-01-01T10:00:00Z", "total": 100.00, "tax_total": 10.00, "paid_total": 100.00, "customer_name": "John Doe", "customer_email": "john.doe@example.com", "summary": "Standard Room - 2 Nights", "date_desc": "2014-01-01 to 2014-01-03", "token": "a1b2c3d4e5f6g7h8i9j0" } ], "total_results": 1, "page_count": 1, "current_page": 1, "limit": 100 } } ``` -------------------------------- ### HTTP Basic Authentication Header Example Source: https://api.checkfront.com/_sources/overview/auth.rst.txt This example shows the format of the Authorization header when using HTTP Basic authentication with API Key and API Secret. The credentials are base64 encoded. ```http GET /booking/1 HTTP/1.1 Authorization: Basic M2JlOTg2NDFmMDc0NWI2ZmU3ZGFjYzJkZjk0N2FkYmMxZGE3MzEyZDo0YzRkNTk4YTVkOTQwZjA4ZmRiNDM1YjY5YWY5ODZjNzBmMjIwNmRk ``` -------------------------------- ### Ping API Response Example Source: https://api.checkfront.com/_sources/ref/ping.rst.txt This JSON snippet shows an example response from the /api/3.0/ping endpoint, detailing API connection information and latency. ```json { "status": "ok", "time": 1678886400, "latency": 0.015 } ``` -------------------------------- ### Company API Response Example Source: https://api.checkfront.com/_sources/ref/company.rst.txt This JSON snippet shows an example response from the /api/3.0/company endpoint, detailing various company configuration settings. ```json { "url": "https://your-domain.checkfront.com", "name": "Your Company Name", "plan_id": 1, "email": "info@yourcompany.com", "address": "123 Main Street", "city": "Anytown", "postal_zip": "12345", "region": "CA", "region_id": "5", "country_id": "US", "currency_id": "USD", "timezone": "America/Los_Angeles", "locale_id": "en_US", "lang_id": "en", "date_format": "YYYY-MM-DD", "time_format": "HH:mm:ss" } ``` -------------------------------- ### Checkfront API Item Response Example Source: https://api.checkfront.com/ref/item.html This is an example of a JSON response when requesting item details from the Checkfront API. It includes general account and request information, as well as detailed attributes of the requested item. ```json { "version": "3.0", "account_id": 1, "host_id": "your-company.checkfront.com", "name": "Your Company", "locale": { "id": "en_US", "lang": "en", "currency": "CAD" }, "request": { "status": "OK", "resource": "item", "id": "18", "records": 0, "limit": 0, "page": 1, "pages": 1, "time": 0.0027, "method": "get" }, "query": [], "item": { "unit": "D", "item_id": 18, "sku": "bungeejumpingfromthetopoftheo2arena", "url": "", "lock": 1, "visibility": "*", "name": "Bungee Jumping from the Top of the O2 Arena", "pos": 0, "summary": "

Take a trip to the top of London's most famous concert venue, the O2 Arena, and right back down again. This exhilarating chance of a lifetime starts with a tour through the Memorabilia Halls of the O2, and finishes with a 160 ft bungee jump. Days and space are limited, so book today!

", "details": "", "meta": "{\"display_mode\":\"dropdown\",\"item_package_rate\":\"\",\"delay\":0}", "stock": 15, "unlimited": 0, "video": { "id": "B6MwTLgmFMM", "start": 0 }, "image": { "1": { "title": "", "src": "18-1--1523520394960863", "path": "/media/M18-1--1523520394960863.jpg", "url": "https://storage.googleapis.com/cf-public-us/thelondonexperience-67672/media/L18-1?t=1523520395338205", "url_medium": "https://storage.googleapis.com/cf-public-us/thelondonexperience-67672/media/M18-1?t=1523520395617178", "url_small": "https://storage.googleapis.com/cf-public-us/thelondonexperience-67672/media/S18-1?t=1523520395895660" } }, "category_id": 6, "rated": 1, "product_group_type": "", "product_group_children": "", "type": "I", "status": "A", "alias_id": 0, "len": 1, "rules": "{\"param\":{\"adults\":{\"MIN\":\"0\",\"MAX\":\"0\"},\"children\":{\"MIN\":\"0\",\"MAX\":\"0\"}},\"fixed\":{\"start_time\":\"\"}}", "category": "Activities" } } ```