API - Planyo Web Services - list_reservations

Vous êtes ici: Planyo » Aide » API » list_reservations

list_reservations

Description:

Lists all reservations that either start within given time period or that were entered into the system within given time period (when list_by_creation_date is true). A maximum of 500 reservations will be listed. For further items use the 'page' parameter.

Input:

start_time DateTime required
Start of time period
end_time DateTime required
End of time period
resource_id int optional
Optionally you can only list reservations for a single resource by specifying its ID here
resource_ids string optional
Optionally you can only list reservations for selected resources by specifying their IDs as a comma-separated list
site_id int optional
Planyo site ID (needed if using a metasite api key and you only want the results to come from a single site)
list_by_creation_date bool optional
If true, this function returns reservations created between given start and end time. If false (default value), the function returns reservations that begin between given start and end times. Note: if this is set to false, you can use an additional parameter: must_include_time_point DateTime if you want to only list rentals which go over a specific point in time (alternatively pass must_include_time_range_start AND must_include_time_range_end DateTime in order to list only rentals which go over a specific time range). If using must_include_time_point or must_include_time_range_start/end you still must pass start_time and end time.
sort string optional
Optional sort field. One of: user, user_id, email, phone, resource_id, cart_id, resource, reservation_id, start_time, end_time
sort_reverse bool optional
If true, the ordering (sort field) will be reversed (descending order)
detail_level int optional
Sum of one or more of the following integers (ORed value): 1=reservation info (all except for price and custom properties), 2=reservation properties (reservation form items), 4=pricing info, payments and flexible package assignments, 8=custom resource properties, 16=site properties, 32=user properties, 64=custom and additional products, 128=photos (site and resource). Default value is 1.
user_id int optional
You can optionally pass the user ID of a customer if you want the reservation listing to be limited to that customer only.
user_email string optional
You can optionally pass the email address of a customer if you want the reservation listing to be limited to that customer only.
assignment string optional
You can optionally pass a unit name (assignment) which must be present in all the reservations returned by this function.
rental_prop_xyz string optional
You can optionally filter the results by a reservation form item (reservation property). E.g. if you define additional reservation property 'number of children', this should be passed as rental_prop_number_of_children (where '_' replaces all space characters). You can also pass the voucher code in rental_prop_voucher.
required_status ReservationStatus optional
You can optionally filter the results to only include reservations with desired status. The value can be a single status value (e.g. 4 for confirmed reservations) or a bitwise OR if multiple status values are required (e.g. checked-in and confirmed).
excluded_status ReservationStatus optional
You can optionally filter the results to exclude reservations with specific statuses. The value can be a single status value (e.g. 4 for confirmed reservations) or a bitwise OR if multiple status values are to be excluded (e.g. 24 if you want to exclude all reservations cancelled EITHER by admin OR by user).
page int optional
Zero-based page number. The default is 0. Each page lists max 500 reservations.
modified_since DateTime optional
You can pass an optional date/time (UTC timezone) if you'd like to limit the results to the reservations that have been modified in any way since given time
method string required
must be set to list_reservations
language string optional
by specifying a 2-letter (ISO 639-1) language code (all capital letters e.g. EN, DE, FR, ES, IT) you can change the language of the text values returned
api_key string required
your API key - Click here to get your key. If your API key uses a hash key, you must also include the parameters hash_key and hash_timestamp.

Output:

results array
Array whose items are named arrays with the following keys: reservation_id, start_time, end_time, creation_time, quantity, user_notes, admin_notes, unit_assignment, custom_color, night_reservation, first_name, last_name, login, user_id, email, phone, phone_country_code, mobile_number, mobile_country_code, address, city, zip, country, cart_id, resource_id, name (resource name), status. In case detail_level is set, this can also include: properties (named array), total_price, amount_paid and original_price, resources assigned in a flexible package (flexible_package_assignment_X), resource_properties, custom_products, site_photos, resource_photos, reservation_products or site_properties. For waiting list requests, waiting_list_position is returned.

API playground:

Click here to test this function in the API playground.