repull 0.2.15 → 0.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/repull/api/airbnb_api.rb +149 -54
- data/lib/repull/api/billing_api.rb +4 -4
- data/lib/repull/api/booking_com_api.rb +122 -29
- data/lib/repull/api/conversations_api.rb +398 -4
- data/lib/repull/api/guests_api.rb +2 -2
- data/lib/repull/api/listings_api.rb +186 -16
- data/lib/repull/api/reservations_api.rb +157 -6
- data/lib/repull/api/webhooks_api.rb +10 -3
- data/lib/repull/models/accept_reservation_request200_response.rb +321 -0
- data/lib/repull/models/account_created_event.rb +95 -31
- data/lib/repull/models/account_disconnected_event.rb +95 -31
- data/lib/repull/models/ai_operation_completed_event.rb +95 -31
- data/lib/repull/models/ai_operation_failed_event.rb +95 -31
- data/lib/repull/models/airbnb_publish_result.rb +41 -2
- data/lib/repull/models/airbnb_reservation_action200_response.rb +157 -0
- data/lib/repull/models/airbnb_reservation_action_request.rb +248 -0
- data/lib/repull/models/booking_availability_update.rb +4 -20
- data/lib/repull/models/booking_availability_update_date_range.rb +193 -0
- data/lib/repull/models/booking_availability_update_request.rb +14 -3
- data/lib/repull/models/booking_pricing_rate_update.rb +32 -4
- data/lib/repull/models/booking_pricing_rate_update_date_range.rb +3 -0
- data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +10 -10
- data/lib/repull/models/booking_pricing_response.rb +16 -4
- data/lib/repull/models/booking_pricing_update_response.rb +82 -18
- data/lib/repull/models/booking_property.rb +107 -36
- data/lib/repull/models/booking_property_action_request.rb +176 -0
- data/lib/repull/models/booking_property_action_response.rb +281 -0
- data/lib/repull/models/booking_property_listings_inner.rb +244 -0
- data/lib/repull/models/booking_publish_result.rb +245 -0
- data/lib/repull/models/booking_publish_section_error.rb +220 -0
- data/lib/repull/models/booking_rate_write_occupancy.rb +187 -0
- data/lib/repull/models/booking_rate_write_price_half.rb +188 -0
- data/lib/repull/models/booking_rate_write_restriction_half.rb +212 -0
- data/lib/repull/models/booking_rate_write_verification.rb +200 -0
- data/lib/repull/models/booking_rate_write_verification_row.rb +196 -0
- data/lib/repull/models/booking_restriction_request_row.rb +199 -0
- data/lib/repull/models/booking_restriction_verification.rb +208 -0
- data/lib/repull/models/booking_restriction_verification_row.rb +203 -0
- data/lib/repull/models/booking_restriction_verification_row_booking_value.rb +105 -0
- data/lib/repull/models/booking_restriction_verification_row_expected.rb +105 -0
- data/lib/repull/models/booking_rooms_rates_response.rb +41 -7
- data/lib/repull/models/booking_rooms_rates_response_rooms_inner.rb +12 -1
- data/lib/repull/models/booking_rooms_rates_response_rooms_inner_rates_inner.rb +1 -0
- data/lib/repull/models/booking_setup_request.rb +44 -5
- data/lib/repull/models/booking_setup_request_legal_entity.rb +235 -0
- data/lib/repull/models/booking_upstream_failure.rb +204 -0
- data/lib/repull/models/calendar_updated_event.rb +95 -31
- data/lib/repull/models/channel_market_state_item.rb +291 -0
- data/lib/repull/models/conversation_message_attachment.rb +28 -1
- data/lib/repull/models/create_airbnb_offer_request.rb +93 -8
- data/lib/repull/models/create_airbnb_offer_request_guest_details.rb +279 -0
- data/lib/repull/models/create_conversation_special_offer201_response.rb +293 -0
- data/lib/repull/models/create_conversation_special_offer201_response_guests.rb +189 -0
- data/lib/repull/models/create_conversation_special_offer_request.rb +263 -0
- data/lib/repull/models/create_conversation_special_offer_request_guests.rb +263 -0
- data/lib/repull/models/decline_reservation_request_request.rb +234 -0
- data/lib/repull/models/error_error.rb +11 -1
- data/lib/repull/models/get_airbnb_offer200_response.rb +289 -0
- data/lib/repull/models/get_usage_summary200_response.rb +10 -1
- data/lib/repull/models/get_usage_summary200_response_limits.rb +11 -1
- data/lib/repull/models/get_usage_summary200_response_remaining.rb +11 -1
- data/lib/repull/models/get_usage_summary200_response_used.rb +10 -1
- data/lib/repull/models/get_usage_tier200_response.rb +10 -1
- data/lib/repull/models/get_usage_tier200_response_limits.rb +11 -1
- data/lib/repull/models/get_usage_tier200_response_remaining.rb +11 -1
- data/lib/repull/models/get_usage_tier200_response_used.rb +10 -1
- data/lib/repull/models/inquiry_created_event.rb +281 -0
- data/lib/repull/models/inquiry_created_payload.rb +185 -0
- data/lib/repull/models/inquiry_updated_event.rb +281 -0
- data/lib/repull/models/inquiry_updated_payload.rb +213 -0
- data/lib/repull/models/inquiry_webhook_object.rb +323 -0
- data/lib/repull/models/inquiry_webhook_object_expected_payout.rb +158 -0
- data/lib/repull/models/inquiry_webhook_object_guests.rb +188 -0
- data/lib/repull/models/list_airbnb_thread_messages200_response.rb +170 -0
- data/lib/repull/models/list_airbnb_thread_messages200_response_data_inner.rb +274 -0
- data/lib/repull/models/list_airbnb_thread_messages200_response_pagination.rb +158 -0
- data/lib/repull/models/list_inquiries200_response.rb +192 -0
- data/lib/repull/models/list_inquiries200_response_data_inner.rb +418 -0
- data/lib/repull/models/list_inquiries200_response_data_inner_expected_payout.rb +159 -0
- data/lib/repull/models/list_inquiries200_response_data_inner_guests.rb +188 -0
- data/lib/repull/models/listing_address_readiness.rb +171 -0
- data/lib/repull/models/listing_content_update_request_address.rb +40 -3
- data/lib/repull/models/listing_create_request.rb +48 -2
- data/lib/repull/models/listing_created_event.rb +95 -31
- data/lib/repull/models/listing_deleted_event.rb +95 -31
- data/lib/repull/models/listing_deleted_payload.rb +55 -21
- data/lib/repull/models/listing_market_state_request.rb +149 -0
- data/lib/repull/models/listing_market_state_response.rb +221 -0
- data/lib/repull/models/listing_publish_booking_request.rb +149 -0
- data/lib/repull/models/{listing_publish_response.rb → listing_publish_booking_response.rb} +4 -5
- data/lib/repull/models/listing_publish_status_channel.rb +32 -1
- data/lib/repull/models/listing_publish_status_connection.rb +17 -5
- data/lib/repull/models/listing_publish_status_response.rb +13 -1
- data/lib/repull/models/listing_reactivated_event.rb +281 -0
- data/lib/repull/models/listing_suspended_event.rb +281 -0
- data/lib/repull/models/listing_suspension_payload.rb +202 -0
- data/lib/repull/models/listing_updated_event.rb +95 -31
- data/lib/repull/models/listing_updated_payload.rb +50 -22
- data/lib/repull/models/listing_webhook_object.rb +291 -0
- data/lib/repull/models/listing_webhook_object_address.rb +168 -0
- data/lib/repull/models/listing_webhook_object_channels_inner.rb +184 -0
- data/lib/repull/models/message.rb +1 -0
- data/lib/repull/models/payment_completed_event.rb +95 -31
- data/lib/repull/models/payment_completed_payload.rb +46 -44
- data/lib/repull/models/payment_refunded_event.rb +95 -31
- data/lib/repull/models/payment_refunded_payload.rb +46 -44
- data/lib/repull/models/payment_webhook_object.rb +351 -0
- data/lib/repull/models/preapprove_conversation201_response.rb +253 -0
- data/lib/repull/models/preapprove_conversation_request.rb +150 -0
- data/lib/repull/models/replay_webhook_delivery_request.rb +150 -0
- data/lib/repull/models/repull_ping_event.rb +95 -31
- data/lib/repull/models/reservation.rb +22 -2
- data/lib/repull/models/reservation_alteration_created_event.rb +95 -31
- data/lib/repull/models/reservation_alteration_responded_event.rb +95 -31
- data/lib/repull/models/reservation_cancelled_event.rb +95 -31
- data/lib/repull/models/reservation_created_event.rb +95 -32
- data/lib/repull/models/reservation_message_received_event.rb +95 -31
- data/lib/repull/models/reservation_message_received_payload.rb +17 -4
- data/lib/repull/models/reservation_request_created_event.rb +281 -0
- data/lib/repull/models/reservation_request_created_payload.rb +224 -0
- data/lib/repull/models/reservation_request_updated_event.rb +281 -0
- data/lib/repull/models/reservation_request_updated_payload.rb +251 -0
- data/lib/repull/models/reservation_updated_event.rb +95 -31
- data/lib/repull/models/review_created_event.rb +95 -31
- data/lib/repull/models/review_responded_event.rb +95 -31
- data/lib/repull/models/send_airbnb_message201_response.rb +104 -0
- data/lib/repull/models/send_airbnb_message_request.rb +4 -20
- data/lib/repull/models/send_message_attachment.rb +225 -0
- data/lib/repull/models/send_message_part.rb +201 -0
- data/lib/repull/models/send_message_request.rb +44 -19
- data/lib/repull/models/send_message_response.rb +29 -5
- data/lib/repull/models/sent_attachment.rb +196 -0
- data/lib/repull/models/usage_quota_warning_event.rb +281 -0
- data/lib/repull/models/usage_quota_warning_payload.rb +224 -0
- data/lib/repull/models/usage_quota_warning_payload_top_operation.rb +167 -0
- data/lib/repull/models/webhook_event.rb +17 -3
- data/lib/repull/models/webhook_event_account.rb +171 -0
- data/lib/repull/models/webhook_event_type.rb +8 -1
- data/lib/repull/models/withdraw_conversation_special_offer200_response.rb +240 -0
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +71 -1
- data/openapi/v1.json +19706 -13248
- data/scripts/regen.sh +1 -1
- metadata +73 -3
|
@@ -87,8 +87,92 @@ module Repull
|
|
|
87
87
|
return data, status_code, headers
|
|
88
88
|
end
|
|
89
89
|
|
|
90
|
+
# Take a property off sale / put it back (unlist/relist)
|
|
91
|
+
# Stop this listing's Booking.com property being sold, or start it again. `id` is a **Repull listing id**, not a Booking.com hotel id, as on the GET. **Booking.com has no unlist, so this is an availability write.** Airbnb has a real deactivate; Booking.com does not. `unlist` closes the mapped room across the whole forward window, so the property stops selling. `relist` is not its mirror image: it re-syncs the true calendar, so dates that are genuinely blocked (a reservation, an owner stay) stay blocked and only the closure `unlist` wrote lifts. Re-opening everything would sell dates that are not for sale. **Which property gets closed.** A listing can be mapped to more than one Booking.com property — the same unit re-listed under a new property keeps its old mapping, and workspaces routinely sit on five or six. With exactly one, send nothing. With several, name one with `hotelId` (or `?hotel_id=`); omit it and the request is refused with **`409 ambiguous_booking_mapping`** listing the candidates, and nothing is written. That refusal matters more here than on a publish: writing content into the wrong property is recoverable, closing the wrong property's availability takes real inventory off sale while the property you meant keeps selling. Naming a property this listing is not mapped to is a `404` that names the ones it is. **This does not change the listing in Repull.** `active` — what Repull bills and serves — is untouched by both actions and is deliberately not echoed in the response, so the two ideas can never be read as one field. To take a listing off the market on every channel at once, use `POST /v1/listings/{id}/offline`. Any other action returns a structured `422` naming the ones that are supported. To push content use `POST /v1/listings/{id}/publish/booking`; to map rooms use `POST /v1/connect/booking/map-rooms`. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
92
|
+
# @param id [Integer] Repull listing id — NOT a Booking.com hotel id.
|
|
93
|
+
# @param booking_property_action_request [BookingPropertyActionRequest]
|
|
94
|
+
# @param [Hash] opts the optional parameters
|
|
95
|
+
# @option opts [String] :hotel_id Booking.com property to act on, for a listing mapped to more than one. The query-string spelling of the body's `hotelId`; the body wins when both are sent.
|
|
96
|
+
# @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged `Idempotency-Status: cached` — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → `409 idempotency_key_in_use`. - Same key with a DIFFERENT payload → `422 idempotency_key_reused`. Generate a new key per distinct request; reuse one only when retrying that exact request. - Retryable outcomes are deliberately not stored, so a retry with the same key runs for real: any status >= 500, `408`, `425` and `429`, and the refusals that happen before anything is done and tell you to fix something outside the request first — `connection_reauth_required`, `listing_inactive`, and the rate/daily limits. Every other answer, including a final refusal such as `422 airbnb_rejected`, is stored and replayed.
|
|
97
|
+
# @return [BookingPropertyActionResponse]
|
|
98
|
+
def booking_property_action(id, booking_property_action_request, opts = {})
|
|
99
|
+
data, _status_code, _headers = booking_property_action_with_http_info(id, booking_property_action_request, opts)
|
|
100
|
+
data
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Take a property off sale / put it back (unlist/relist)
|
|
104
|
+
# Stop this listing's Booking.com property being sold, or start it again. `id` is a **Repull listing id**, not a Booking.com hotel id, as on the GET. **Booking.com has no unlist, so this is an availability write.** Airbnb has a real deactivate; Booking.com does not. `unlist` closes the mapped room across the whole forward window, so the property stops selling. `relist` is not its mirror image: it re-syncs the true calendar, so dates that are genuinely blocked (a reservation, an owner stay) stay blocked and only the closure `unlist` wrote lifts. Re-opening everything would sell dates that are not for sale. **Which property gets closed.** A listing can be mapped to more than one Booking.com property — the same unit re-listed under a new property keeps its old mapping, and workspaces routinely sit on five or six. With exactly one, send nothing. With several, name one with `hotelId` (or `?hotel_id=`); omit it and the request is refused with **`409 ambiguous_booking_mapping`** listing the candidates, and nothing is written. That refusal matters more here than on a publish: writing content into the wrong property is recoverable, closing the wrong property's availability takes real inventory off sale while the property you meant keeps selling. Naming a property this listing is not mapped to is a `404` that names the ones it is. **This does not change the listing in Repull.** `active` — what Repull bills and serves — is untouched by both actions and is deliberately not echoed in the response, so the two ideas can never be read as one field. To take a listing off the market on every channel at once, use `POST /v1/listings/{id}/offline`. Any other action returns a structured `422` naming the ones that are supported. To push content use `POST /v1/listings/{id}/publish/booking`; to map rooms use `POST /v1/connect/booking/map-rooms`. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
105
|
+
# @param id [Integer] Repull listing id — NOT a Booking.com hotel id.
|
|
106
|
+
# @param booking_property_action_request [BookingPropertyActionRequest]
|
|
107
|
+
# @param [Hash] opts the optional parameters
|
|
108
|
+
# @option opts [String] :hotel_id Booking.com property to act on, for a listing mapped to more than one. The query-string spelling of the body's `hotelId`; the body wins when both are sent.
|
|
109
|
+
# @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged `Idempotency-Status: cached` — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → `409 idempotency_key_in_use`. - Same key with a DIFFERENT payload → `422 idempotency_key_reused`. Generate a new key per distinct request; reuse one only when retrying that exact request. - Retryable outcomes are deliberately not stored, so a retry with the same key runs for real: any status >= 500, `408`, `425` and `429`, and the refusals that happen before anything is done and tell you to fix something outside the request first — `connection_reauth_required`, `listing_inactive`, and the rate/daily limits. Every other answer, including a final refusal such as `422 airbnb_rejected`, is stored and replayed.
|
|
110
|
+
# @return [Array<(BookingPropertyActionResponse, Integer, Hash)>] BookingPropertyActionResponse data, response status code and response headers
|
|
111
|
+
def booking_property_action_with_http_info(id, booking_property_action_request, opts = {})
|
|
112
|
+
if @api_client.config.debugging
|
|
113
|
+
@api_client.config.logger.debug 'Calling API: BookingComApi.booking_property_action ...'
|
|
114
|
+
end
|
|
115
|
+
# verify the required parameter 'id' is set
|
|
116
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
117
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling BookingComApi.booking_property_action"
|
|
118
|
+
end
|
|
119
|
+
# verify the required parameter 'booking_property_action_request' is set
|
|
120
|
+
if @api_client.config.client_side_validation && booking_property_action_request.nil?
|
|
121
|
+
fail ArgumentError, "Missing the required parameter 'booking_property_action_request' when calling BookingComApi.booking_property_action"
|
|
122
|
+
end
|
|
123
|
+
if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
|
|
124
|
+
fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling BookingComApi.booking_property_action, the character length must be smaller than or equal to 255.'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# resource path
|
|
128
|
+
local_var_path = '/v1/channels/booking/properties/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
129
|
+
|
|
130
|
+
# query parameters
|
|
131
|
+
query_params = opts[:query_params] || {}
|
|
132
|
+
query_params[:'hotel_id'] = opts[:'hotel_id'] if !opts[:'hotel_id'].nil?
|
|
133
|
+
|
|
134
|
+
# header parameters
|
|
135
|
+
header_params = opts[:header_params] || {}
|
|
136
|
+
# HTTP header 'Accept' (if needed)
|
|
137
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
138
|
+
# HTTP header 'Content-Type'
|
|
139
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
140
|
+
if !content_type.nil?
|
|
141
|
+
header_params['Content-Type'] = content_type
|
|
142
|
+
end
|
|
143
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
144
|
+
|
|
145
|
+
# form parameters
|
|
146
|
+
form_params = opts[:form_params] || {}
|
|
147
|
+
|
|
148
|
+
# http body (model)
|
|
149
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(booking_property_action_request)
|
|
150
|
+
|
|
151
|
+
# return_type
|
|
152
|
+
return_type = opts[:debug_return_type] || 'BookingPropertyActionResponse'
|
|
153
|
+
|
|
154
|
+
# auth_names
|
|
155
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
156
|
+
|
|
157
|
+
new_options = opts.merge(
|
|
158
|
+
:operation => :"BookingComApi.booking_property_action",
|
|
159
|
+
:header_params => header_params,
|
|
160
|
+
:query_params => query_params,
|
|
161
|
+
:form_params => form_params,
|
|
162
|
+
:body => post_body,
|
|
163
|
+
:auth_names => auth_names,
|
|
164
|
+
:return_type => return_type
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
168
|
+
if @api_client.config.debugging
|
|
169
|
+
@api_client.config.logger.debug "API called: BookingComApi#booking_property_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
170
|
+
end
|
|
171
|
+
return data, status_code, headers
|
|
172
|
+
end
|
|
173
|
+
|
|
90
174
|
# Booking.com property setup actions
|
|
91
|
-
# Action-router for
|
|
175
|
+
# Action-router for putting a property onto Booking.com — including building one from nothing. Select the step with `action`. ## Opening a property - `create-property` — create a NEW Booking.com property for a Repull listing (`listing_id`). Creates the property, its first room, a rate plan and the room-rate product that makes the room sellable, seeds availability and rates, syncs the calendar, then sends the notification that starts Booking's validation. Returns 201. - `add-room` — add another room type (and its sellable product) to a property (`listing_id`, `property_id`). Returns 201. - `add-unit` — raise the number of identical units on an existing room (`listing_id`, `property_id`, `room_id`). - `advance` — re-send the summary notification for a property (`property_id`) to move it out of the \"XML: Being built\" stage. ## Account and policy steps - `create-legal-entity` — register a legal entity directly (returns 201). Not normally needed: see the legal-entity rules below. - `check-legal-status` — always `404`. A legal entity's details are readable for any id on the connectivity-provider credentials every workspace shares, and nothing records which workspace registered which entity, so no entity can be shown to be yours. `create-property` resolves it for you. - `check-readiness` — check whether a property is ready to open (`property_id`). - `open-property` — open the property for sale (`property_id`). - `set-contacts` — set property contacts (`property_id`, `contacts`). - `set-policies` — set property policies (`property_id`, plus policy fields). ## Three things about Booking.com that cost real money **A newly created property is NOT sellable.** Booking holds it at \"XML: Being built\" until it validates the summary notification. `create-property` sends that notification, but it can fail on its own after everything else succeeded — the response always reports `status: \"being_built\"` and `sellable: false`, never a guess. Use `advance` to re-send it, and check the Extranet for the stage. **A room with no ACTIVE rate plan is invisible.** Booking only renders rooms that have at least one active product linkage (room × rate plan). A room can be created successfully, return a `roomId`, and never appear on the property page. If `rateId` comes back `null` from `create-property` or `add-room`, that is exactly what happened: activate a rate plan on the property in the Extranet, then add the room again. **The room name is shown to travellers.** It is taken from the listing's name and appears on the Booking.com property page. Internal nicknames belong on the property's partner reference, not on the room. ## The legal entity is resolved, not asked for A property is created against the legal entity Booking.com contracts with, invoices and pays. You do not normally send one: 1. If this workspace already creates properties under a legal entity, that one is reused. A second is never registered. 2. If it has none and the request carries `legal_entity` (`company_name`, `legal_contact_name`, `legal_contact_email`), one is registered and used. Booking.com emails the legal contact a contract; creation only succeeds once it is signed. 3. If it has none and no `legal_entity`, the request is refused with `422 legal_entity_required` naming the fields — a contracted company is never invented. `legal_entity_id` overrides all of that. An id that already carries another workspace's properties is refused with `403 legal_entity_not_yours` before anything is created. ## What you do not control Properties are created against Booking's **production** target only. A test-target property cannot be sold through and there is no route back from one, so `target` is not a parameter — sending it changes nothing. These are fixed on every created property and are not parameters: property category (Apartment), initial room count (1), and the property contact record (a placeholder name, email and phone). Set the real contacts afterwards with `set-contacts`. Latitude and longitude come from the listing and are adjusted slightly to clear Booking.com's duplicate detection — send the property's true position on the listing and do not pre-adjust it yourself. The listing's name, check-in/check-out times, currency, capacity and price come from the listing. Its postal code is taken from the listing's own `postalCode`; when the listing has none, it falls back to a connected Airbnb listing. A listing with neither is created without a postal code, so set `postalCode` on the listing first. ## Guards Every action that takes a `property_id` requires a property connected to this workspace; any other id returns `404 not_found`. Every action that takes a `listing_id` requires a listing in this workspace; any other id returns `404 not_found`. `create-property` refuses a listing with no coordinates (`422 missing_coordinates`) before anything is created — creating a Booking.com property cannot be undone. `create-property` is subject to the same published-listing gate as the dashboard: no plan, or the plan's listing limit reached, returns `403 billing_error` with `used` and `limit`, and nothing is created. Returns `403 listing_inactive` when the listing — or any listing mapped to the Booking.com property — is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated. If a property is created and a later step fails, the response is `422 booking_create_partial` carrying `property_id`. The property EXISTS. Do not retry `create-property`, which would open a second one — continue with `add-room` and `advance`.
|
|
92
176
|
# @param booking_setup_request [BookingSetupRequest]
|
|
93
177
|
# @param [Hash] opts the optional parameters
|
|
94
178
|
# @return [nil]
|
|
@@ -98,7 +182,7 @@ module Repull
|
|
|
98
182
|
end
|
|
99
183
|
|
|
100
184
|
# Booking.com property setup actions
|
|
101
|
-
# Action-router for
|
|
185
|
+
# Action-router for putting a property onto Booking.com — including building one from nothing. Select the step with `action`. ## Opening a property - `create-property` — create a NEW Booking.com property for a Repull listing (`listing_id`). Creates the property, its first room, a rate plan and the room-rate product that makes the room sellable, seeds availability and rates, syncs the calendar, then sends the notification that starts Booking's validation. Returns 201. - `add-room` — add another room type (and its sellable product) to a property (`listing_id`, `property_id`). Returns 201. - `add-unit` — raise the number of identical units on an existing room (`listing_id`, `property_id`, `room_id`). - `advance` — re-send the summary notification for a property (`property_id`) to move it out of the \"XML: Being built\" stage. ## Account and policy steps - `create-legal-entity` — register a legal entity directly (returns 201). Not normally needed: see the legal-entity rules below. - `check-legal-status` — always `404`. A legal entity's details are readable for any id on the connectivity-provider credentials every workspace shares, and nothing records which workspace registered which entity, so no entity can be shown to be yours. `create-property` resolves it for you. - `check-readiness` — check whether a property is ready to open (`property_id`). - `open-property` — open the property for sale (`property_id`). - `set-contacts` — set property contacts (`property_id`, `contacts`). - `set-policies` — set property policies (`property_id`, plus policy fields). ## Three things about Booking.com that cost real money **A newly created property is NOT sellable.** Booking holds it at \"XML: Being built\" until it validates the summary notification. `create-property` sends that notification, but it can fail on its own after everything else succeeded — the response always reports `status: \"being_built\"` and `sellable: false`, never a guess. Use `advance` to re-send it, and check the Extranet for the stage. **A room with no ACTIVE rate plan is invisible.** Booking only renders rooms that have at least one active product linkage (room × rate plan). A room can be created successfully, return a `roomId`, and never appear on the property page. If `rateId` comes back `null` from `create-property` or `add-room`, that is exactly what happened: activate a rate plan on the property in the Extranet, then add the room again. **The room name is shown to travellers.** It is taken from the listing's name and appears on the Booking.com property page. Internal nicknames belong on the property's partner reference, not on the room. ## The legal entity is resolved, not asked for A property is created against the legal entity Booking.com contracts with, invoices and pays. You do not normally send one: 1. If this workspace already creates properties under a legal entity, that one is reused. A second is never registered. 2. If it has none and the request carries `legal_entity` (`company_name`, `legal_contact_name`, `legal_contact_email`), one is registered and used. Booking.com emails the legal contact a contract; creation only succeeds once it is signed. 3. If it has none and no `legal_entity`, the request is refused with `422 legal_entity_required` naming the fields — a contracted company is never invented. `legal_entity_id` overrides all of that. An id that already carries another workspace's properties is refused with `403 legal_entity_not_yours` before anything is created. ## What you do not control Properties are created against Booking's **production** target only. A test-target property cannot be sold through and there is no route back from one, so `target` is not a parameter — sending it changes nothing. These are fixed on every created property and are not parameters: property category (Apartment), initial room count (1), and the property contact record (a placeholder name, email and phone). Set the real contacts afterwards with `set-contacts`. Latitude and longitude come from the listing and are adjusted slightly to clear Booking.com's duplicate detection — send the property's true position on the listing and do not pre-adjust it yourself. The listing's name, check-in/check-out times, currency, capacity and price come from the listing. Its postal code is taken from the listing's own `postalCode`; when the listing has none, it falls back to a connected Airbnb listing. A listing with neither is created without a postal code, so set `postalCode` on the listing first. ## Guards Every action that takes a `property_id` requires a property connected to this workspace; any other id returns `404 not_found`. Every action that takes a `listing_id` requires a listing in this workspace; any other id returns `404 not_found`. `create-property` refuses a listing with no coordinates (`422 missing_coordinates`) before anything is created — creating a Booking.com property cannot be undone. `create-property` is subject to the same published-listing gate as the dashboard: no plan, or the plan's listing limit reached, returns `403 billing_error` with `used` and `limit`, and nothing is created. Returns `403 listing_inactive` when the listing — or any listing mapped to the Booking.com property — is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated. If a property is created and a later step fails, the response is `422 booking_create_partial` carrying `property_id`. The property EXISTS. Do not retry `create-property`, which would open a second one — continue with `add-room` and `advance`.
|
|
102
186
|
# @param booking_setup_request [BookingSetupRequest]
|
|
103
187
|
# @param [Hash] opts the optional parameters
|
|
104
188
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
@@ -485,13 +569,14 @@ module Repull
|
|
|
485
569
|
end
|
|
486
570
|
|
|
487
571
|
# Get Booking.com pricing for a listing
|
|
488
|
-
# Resolves the
|
|
489
|
-
# @param id [Integer]
|
|
572
|
+
# Resolves the Repull listing id to its Booking.com `hotel_id` (via the room mapping the Connect flow records for the authenticated workspace), then proxies Booking's `getRoomRateAvailability` for the requested window. Pricing on Booking is per-room/per-rate-plan, so `room_id` and `room_level` flow through query params unchanged. Mirrors the per-channel `/listings/{id}/pricing` shape used by Airbnb so SDK consumers can carry a Repull listing id across channels. `id` is a Repull listing id, never a Booking.com hotel id — the hotel-id surface is `/v1/channels/booking/availability`. A listing can be published under several Booking.com properties. GET uses the oldest and reports the rest in `otherHotelIds`; PUT refuses with `409 ambiguous_booking_mapping` rather than push rates into a property it guessed at. `?hotel_id=` names the property explicitly for either. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
573
|
+
# @param id [Integer] Repull listing id — NOT a Booking.com hotel id. Resolved to a Booking.com hotel id via the workspace mapping.
|
|
490
574
|
# @param [Hash] opts the optional parameters
|
|
491
575
|
# @option opts [Date] :start_date
|
|
492
576
|
# @option opts [Integer] :number_of_days
|
|
493
577
|
# @option opts [String] :room_id
|
|
494
578
|
# @option opts [Boolean] :room_level When true, returns room-level (vs rate-plan-level) availability.
|
|
579
|
+
# @option opts [String] :hotel_id Booking.com hotel id, when this listing is published under more than one property. Omit it and a read uses the oldest mapping (reporting the rest in `otherHotelIds`), while a write is refused with `409 ambiguous_booking_mapping` rather than guess. `GET /v1/channels/booking/properties` lists the valid ids.
|
|
495
580
|
# @return [BookingPricingResponse]
|
|
496
581
|
def get_booking_listing_pricing(id, opts = {})
|
|
497
582
|
data, _status_code, _headers = get_booking_listing_pricing_with_http_info(id, opts)
|
|
@@ -499,13 +584,14 @@ module Repull
|
|
|
499
584
|
end
|
|
500
585
|
|
|
501
586
|
# Get Booking.com pricing for a listing
|
|
502
|
-
# Resolves the
|
|
503
|
-
# @param id [Integer]
|
|
587
|
+
# Resolves the Repull listing id to its Booking.com `hotel_id` (via the room mapping the Connect flow records for the authenticated workspace), then proxies Booking's `getRoomRateAvailability` for the requested window. Pricing on Booking is per-room/per-rate-plan, so `room_id` and `room_level` flow through query params unchanged. Mirrors the per-channel `/listings/{id}/pricing` shape used by Airbnb so SDK consumers can carry a Repull listing id across channels. `id` is a Repull listing id, never a Booking.com hotel id — the hotel-id surface is `/v1/channels/booking/availability`. A listing can be published under several Booking.com properties. GET uses the oldest and reports the rest in `otherHotelIds`; PUT refuses with `409 ambiguous_booking_mapping` rather than push rates into a property it guessed at. `?hotel_id=` names the property explicitly for either. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
588
|
+
# @param id [Integer] Repull listing id — NOT a Booking.com hotel id. Resolved to a Booking.com hotel id via the workspace mapping.
|
|
504
589
|
# @param [Hash] opts the optional parameters
|
|
505
590
|
# @option opts [Date] :start_date
|
|
506
591
|
# @option opts [Integer] :number_of_days
|
|
507
592
|
# @option opts [String] :room_id
|
|
508
593
|
# @option opts [Boolean] :room_level When true, returns room-level (vs rate-plan-level) availability.
|
|
594
|
+
# @option opts [String] :hotel_id Booking.com hotel id, when this listing is published under more than one property. Omit it and a read uses the oldest mapping (reporting the rest in `otherHotelIds`), while a write is refused with `409 ambiguous_booking_mapping` rather than guess. `GET /v1/channels/booking/properties` lists the valid ids.
|
|
509
595
|
# @return [Array<(BookingPricingResponse, Integer, Hash)>] BookingPricingResponse data, response status code and response headers
|
|
510
596
|
def get_booking_listing_pricing_with_http_info(id, opts = {})
|
|
511
597
|
if @api_client.config.debugging
|
|
@@ -524,6 +610,7 @@ module Repull
|
|
|
524
610
|
query_params[:'number_of_days'] = opts[:'number_of_days'] if !opts[:'number_of_days'].nil?
|
|
525
611
|
query_params[:'room_id'] = opts[:'room_id'] if !opts[:'room_id'].nil?
|
|
526
612
|
query_params[:'room_level'] = opts[:'room_level'] if !opts[:'room_level'].nil?
|
|
613
|
+
query_params[:'hotel_id'] = opts[:'hotel_id'] if !opts[:'hotel_id'].nil?
|
|
527
614
|
|
|
528
615
|
# header parameters
|
|
529
616
|
header_params = opts[:header_params] || {}
|
|
@@ -560,8 +647,8 @@ module Repull
|
|
|
560
647
|
end
|
|
561
648
|
|
|
562
649
|
# Get Booking.com connection for a listing
|
|
563
|
-
# Return the Booking.com connection record(s) for a
|
|
564
|
-
# @param id [Integer]
|
|
650
|
+
# Return the Booking.com connection record(s) for a Repull listing — the linked Booking hotel id, sync flags, markup, sync category, suspension state, and the Booking room the mapping runs through. `id` is a **Repull listing id**, not a Booking.com hotel id, despite the `properties` segment. (The hotel-id surface is `/v1/channels/booking/availability`.) The mapping is read from wherever the Connect flow recorded it — `listings_booking_rooms` for anything mapped through `POST /v1/connect/booking/map-rooms`, which is essentially every live mapping. An ARRAY, because one listing can be published under several Booking.com properties at once; `mappedVia` says which record carries each mapping. A listing with no Booking.com mapping returns 404, and the message says which id space the path takes. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
651
|
+
# @param id [Integer] Repull listing id — NOT a Booking.com hotel id.
|
|
565
652
|
# @param [Hash] opts the optional parameters
|
|
566
653
|
# @return [nil]
|
|
567
654
|
def get_booking_property(id, opts = {})
|
|
@@ -570,8 +657,8 @@ module Repull
|
|
|
570
657
|
end
|
|
571
658
|
|
|
572
659
|
# Get Booking.com connection for a listing
|
|
573
|
-
# Return the Booking.com connection record(s) for a
|
|
574
|
-
# @param id [Integer]
|
|
660
|
+
# Return the Booking.com connection record(s) for a Repull listing — the linked Booking hotel id, sync flags, markup, sync category, suspension state, and the Booking room the mapping runs through. `id` is a **Repull listing id**, not a Booking.com hotel id, despite the `properties` segment. (The hotel-id surface is `/v1/channels/booking/availability`.) The mapping is read from wherever the Connect flow recorded it — `listings_booking_rooms` for anything mapped through `POST /v1/connect/booking/map-rooms`, which is essentially every live mapping. An ARRAY, because one listing can be published under several Booking.com properties at once; `mappedVia` says which record carries each mapping. A listing with no Booking.com mapping returns 404, and the message says which id space the path takes. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
661
|
+
# @param id [Integer] Repull listing id — NOT a Booking.com hotel id.
|
|
575
662
|
# @param [Hash] opts the optional parameters
|
|
576
663
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
577
664
|
def get_booking_property_with_http_info(id, opts = {})
|
|
@@ -680,7 +767,7 @@ module Repull
|
|
|
680
767
|
end
|
|
681
768
|
|
|
682
769
|
# List Booking.com properties
|
|
683
|
-
# List Booking.com
|
|
770
|
+
# List every Booking.com property this workspace holds. Each property is returned ONCE, with the Repull listings mapped under it. A Booking.com property is a building; its rooms are what guests book, and each room is mapped to one Repull listing — so one property routinely carries many listings. `listings[].roomBookingId` is the Booking.com room id an ARI write takes. A property whose rooms are not mapped yet is still listed, with `mappingStatus: \"unmapped\"` and an empty `listings` array. That is a real mid-onboarding state, not an error: finish `POST /v1/connect/booking/map-rooms` and the listings appear. Such a property used to be dropped silently, which made a mapped-but-unreadable workspace indistinguishable from one with no Booking connection at all. Inactive listings are left out of `listings`; they keep syncing and reappear once activated. Use `GET /v1/listings?status=inactive` to find them.
|
|
684
771
|
# @param [Hash] opts the optional parameters
|
|
685
772
|
# @return [Array<BookingProperty>]
|
|
686
773
|
def list_booking_properties(opts = {})
|
|
@@ -689,7 +776,7 @@ module Repull
|
|
|
689
776
|
end
|
|
690
777
|
|
|
691
778
|
# List Booking.com properties
|
|
692
|
-
# List Booking.com
|
|
779
|
+
# List every Booking.com property this workspace holds. Each property is returned ONCE, with the Repull listings mapped under it. A Booking.com property is a building; its rooms are what guests book, and each room is mapped to one Repull listing — so one property routinely carries many listings. `listings[].roomBookingId` is the Booking.com room id an ARI write takes. A property whose rooms are not mapped yet is still listed, with `mappingStatus: \"unmapped\"` and an empty `listings` array. That is a real mid-onboarding state, not an error: finish `POST /v1/connect/booking/map-rooms` and the listings appear. Such a property used to be dropped silently, which made a mapped-but-unreadable workspace indistinguishable from one with no Booking connection at all. Inactive listings are left out of `listings`; they keep syncing and reappear once activated. Use `GET /v1/listings?status=inactive` to find them.
|
|
693
780
|
# @param [Hash] opts the optional parameters
|
|
694
781
|
# @return [Array<(Array<BookingProperty>, Integer, Hash)>] Array<BookingProperty> data, response status code and response headers
|
|
695
782
|
def list_booking_properties_with_http_info(opts = {})
|
|
@@ -737,9 +824,10 @@ module Repull
|
|
|
737
824
|
end
|
|
738
825
|
|
|
739
826
|
# List Booking.com rooms + rate-plan ids for a listing
|
|
740
|
-
# Return every Booking.com room and its rate plans for a listing, each with the `roomId` / `rateId` needed to assemble a restriction write via `PUT /v1/channels/booking/availability`. `id` is a
|
|
741
|
-
# @param id [Integer]
|
|
827
|
+
# Return every Booking.com room and its rate plans for a listing, each with the `roomId` / `rateId` needed to assemble a restriction write via `PUT /v1/channels/booking/availability`. `id` is a **Repull listing id**, not a Booking.com hotel id, despite the `properties` segment — resolved to the Booking `hotel_id` through the workspace mapping, read from wherever the Connect flow recorded it (`listings_booking_rooms` for anything mapped through `POST /v1/connect/booking/map-rooms`). A listing with no active Booking.com mapping returns 404, and the message says which id space the path takes. When the listing is published under several properties the oldest is used, the rest come back in `otherHotelIds`, and `?hotel_id=` names a different one. Sourced from Booking's B.XML roomrates feed, which returns rooms and rate plans together (the rooms-unit feed alone omits rate-plan ids). This is the API-key surface for the room/rate ids that were previously only reachable inside the hosted Connect room-mapping flow. `source` says where the answer came from. `booking` means it was read live just now. If Booking.com returns nothing usable for the property, the rooms and rate plans recorded at the last import are served instead, `source` is `mirror`, and `mirrorReason` names what went wrong live — the ids are Booking.com's own and can be written against, but they can be stale, and `maxPersons`, `policy`, `policyId`, `pricingType` and `isChildRate` come back `null` because only the live feed states them. `rooms` is empty only when Booking.com and the last import both have nothing; a read that failed is an error, never an empty list. Each rate plan carries `maxPersons` — the party size that rate plan prices, which is the `occupancy` a rate amount must be written at. Each room carries `maxAdults`, Booking.com's capacity for the room, which is what a rate write falls back to when the rate plan states no `maxPersons`. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
828
|
+
# @param id [Integer] Repull listing id — NOT a Booking.com hotel id. Resolved to a Booking.com hotel id via the workspace mapping.
|
|
742
829
|
# @param [Hash] opts the optional parameters
|
|
830
|
+
# @option opts [String] :hotel_id Booking.com hotel id, when this listing is published under more than one property. Omit it and a read uses the oldest mapping (reporting the rest in `otherHotelIds`), while a write is refused with `409 ambiguous_booking_mapping` rather than guess. `GET /v1/channels/booking/properties` lists the valid ids.
|
|
743
831
|
# @return [BookingRoomsRatesResponse]
|
|
744
832
|
def list_booking_property_rooms(id, opts = {})
|
|
745
833
|
data, _status_code, _headers = list_booking_property_rooms_with_http_info(id, opts)
|
|
@@ -747,9 +835,10 @@ module Repull
|
|
|
747
835
|
end
|
|
748
836
|
|
|
749
837
|
# List Booking.com rooms + rate-plan ids for a listing
|
|
750
|
-
# Return every Booking.com room and its rate plans for a listing, each with the `roomId` / `rateId` needed to assemble a restriction write via `PUT /v1/channels/booking/availability`. `id` is a
|
|
751
|
-
# @param id [Integer]
|
|
838
|
+
# Return every Booking.com room and its rate plans for a listing, each with the `roomId` / `rateId` needed to assemble a restriction write via `PUT /v1/channels/booking/availability`. `id` is a **Repull listing id**, not a Booking.com hotel id, despite the `properties` segment — resolved to the Booking `hotel_id` through the workspace mapping, read from wherever the Connect flow recorded it (`listings_booking_rooms` for anything mapped through `POST /v1/connect/booking/map-rooms`). A listing with no active Booking.com mapping returns 404, and the message says which id space the path takes. When the listing is published under several properties the oldest is used, the rest come back in `otherHotelIds`, and `?hotel_id=` names a different one. Sourced from Booking's B.XML roomrates feed, which returns rooms and rate plans together (the rooms-unit feed alone omits rate-plan ids). This is the API-key surface for the room/rate ids that were previously only reachable inside the hosted Connect room-mapping flow. `source` says where the answer came from. `booking` means it was read live just now. If Booking.com returns nothing usable for the property, the rooms and rate plans recorded at the last import are served instead, `source` is `mirror`, and `mirrorReason` names what went wrong live — the ids are Booking.com's own and can be written against, but they can be stale, and `maxPersons`, `policy`, `policyId`, `pricingType` and `isChildRate` come back `null` because only the live feed states them. `rooms` is empty only when Booking.com and the last import both have nothing; a read that failed is an error, never an empty list. Each rate plan carries `maxPersons` — the party size that rate plan prices, which is the `occupancy` a rate amount must be written at. Each room carries `maxAdults`, Booking.com's capacity for the room, which is what a rate write falls back to when the rate plan states no `maxPersons`. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
839
|
+
# @param id [Integer] Repull listing id — NOT a Booking.com hotel id. Resolved to a Booking.com hotel id via the workspace mapping.
|
|
752
840
|
# @param [Hash] opts the optional parameters
|
|
841
|
+
# @option opts [String] :hotel_id Booking.com hotel id, when this listing is published under more than one property. Omit it and a read uses the oldest mapping (reporting the rest in `otherHotelIds`), while a write is refused with `409 ambiguous_booking_mapping` rather than guess. `GET /v1/channels/booking/properties` lists the valid ids.
|
|
753
842
|
# @return [Array<(BookingRoomsRatesResponse, Integer, Hash)>] BookingRoomsRatesResponse data, response status code and response headers
|
|
754
843
|
def list_booking_property_rooms_with_http_info(id, opts = {})
|
|
755
844
|
if @api_client.config.debugging
|
|
@@ -764,6 +853,7 @@ module Repull
|
|
|
764
853
|
|
|
765
854
|
# query parameters
|
|
766
855
|
query_params = opts[:query_params] || {}
|
|
856
|
+
query_params[:'hotel_id'] = opts[:'hotel_id'] if !opts[:'hotel_id'].nil?
|
|
767
857
|
|
|
768
858
|
# header parameters
|
|
769
859
|
header_params = opts[:header_params] || {}
|
|
@@ -1059,7 +1149,7 @@ module Repull
|
|
|
1059
1149
|
end
|
|
1060
1150
|
|
|
1061
1151
|
# Send Booking.com message
|
|
1062
|
-
# Send a message in a Booking.com conversation as the host. Booking enforces content rules similar to Airbnb. `property_id` must be a Booking.com property connected to this workspace (`GET /v1/channels/booking/properties` lists them). Any other id — including one connected to a different workspace — returns `404 not_found`, the same answer as an id that does not exist. Returns `403 listing_inactive` when any listing mapped to the Booking.com property is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
1152
|
+
# Send a text message in a Booking.com conversation as the host. Booking enforces content rules similar to Airbnb. **Text only.** To send photos, use `POST /v1/conversations/{id}/messages` with `attachments` (JPEG or PNG, up to 10 MB each, with message text) — it uploads the files to Booking.com and records them in the conversation. Passing `attachments`, `attachment_ids` or `mediaUrl` here returns `422 attachments_not_supported` and sends nothing. `property_id` must be a Booking.com property connected to this workspace (`GET /v1/channels/booking/properties` lists them). Any other id — including one connected to a different workspace — returns `404 not_found`, the same answer as an id that does not exist. Returns `403 listing_inactive` when any listing mapped to the Booking.com property is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
1063
1153
|
# @param send_booking_message_request [SendBookingMessageRequest]
|
|
1064
1154
|
# @param [Hash] opts the optional parameters
|
|
1065
1155
|
# @return [nil]
|
|
@@ -1069,7 +1159,7 @@ module Repull
|
|
|
1069
1159
|
end
|
|
1070
1160
|
|
|
1071
1161
|
# Send Booking.com message
|
|
1072
|
-
# Send a message in a Booking.com conversation as the host. Booking enforces content rules similar to Airbnb. `property_id` must be a Booking.com property connected to this workspace (`GET /v1/channels/booking/properties` lists them). Any other id — including one connected to a different workspace — returns `404 not_found`, the same answer as an id that does not exist. Returns `403 listing_inactive` when any listing mapped to the Booking.com property is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
1162
|
+
# Send a text message in a Booking.com conversation as the host. Booking enforces content rules similar to Airbnb. **Text only.** To send photos, use `POST /v1/conversations/{id}/messages` with `attachments` (JPEG or PNG, up to 10 MB each, with message text) — it uploads the files to Booking.com and records them in the conversation. Passing `attachments`, `attachment_ids` or `mediaUrl` here returns `422 attachments_not_supported` and sends nothing. `property_id` must be a Booking.com property connected to this workspace (`GET /v1/channels/booking/properties` lists them). Any other id — including one connected to a different workspace — returns `404 not_found`, the same answer as an id that does not exist. Returns `403 listing_inactive` when any listing mapped to the Booking.com property is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
1073
1163
|
# @param send_booking_message_request [SendBookingMessageRequest]
|
|
1074
1164
|
# @param [Hash] opts the optional parameters
|
|
1075
1165
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
@@ -1127,20 +1217,20 @@ module Repull
|
|
|
1127
1217
|
end
|
|
1128
1218
|
|
|
1129
1219
|
# Update Booking.com rates/availability
|
|
1130
|
-
#
|
|
1220
|
+
# Write rates, availability and restrictions to a Booking.com property. `type` selects the write: - `rates` — nightly prices, plus any length-of-stay / arrival restrictions sent with them. - `availability` — inventory (`availableRooms`), the stop-sell flag (`closed`), and restrictions. Omit `availableRooms` and `closed` for a restriction-only write. - `derived-pricing` — occupancy-derived pricing rules. **Dates are inclusive at both ends.** `{ \"start\": \"2026-11-04\", \"end\": \"2026-11-04\" }` is exactly one night. **A rate amount needs an occupancy.** Booking.com stores the amount against the party size the rate plan prices: sent above that number it declines the price in silence, sent below it it answers 400. Send `occupancy`, or omit it and Repull resolves it from Booking.com's own data and echoes the value and its `source` back in `occupancy[]`. If it cannot be resolved the write is refused with `422` naming `updates[N].occupancy`. **Restrictions are sent in the same call, on their own wire.** A price and a minimum stay are two writes on Booking.com's side. Send them together and the response reports each separately: `price` and `restrictions` carry their own state, their own read-back, and — when refused — Booking.com's own reason. The top-level `applied` is `partial` when they disagree, so a price that landed is never reported as a failure. `minStay`, `maxStay`, `minStayArrival`, `maxStayArrival`, `closedToArrival` and `closedToDeparture` are written; `exactStayArrival`, `minAdvanceRes` and `maxAdvanceRes` are refused with `422 restriction_not_supported` because Booking.com's notification has no element for them — set those on the rate plan in the Extranet. Nothing you send is ever silently ignored. **Inventory is not part of a rate update.** `roomsToSell` on a `rates` update returns `422 inventory_not_in_rate_update`; send it as `type: \"availability\"` instead. **The response says what is known.** Booking.com acknowledges a write with no per-date status, so the nights are read back — prices and restrictions out of the same read: `applied` is `verified`, `mismatch`, `partial`, `rejected` or `unverified` (send `verify: false` to skip the read-back). A bare acknowledgement is never reported as \"all updates applied\". Booking.com stores a 1-night minimum as no minimum, so `minStay: 1` reads back as `0` and still counts as applied. Restrictions never leak across channels — this endpoint writes only to Booking.com. When Booking.com refuses a write outright, their own reason comes back as `422 booking_rejected` with `booking_ruid`; a genuine outage on their side is `502 booking_error`. `property_id` must be a Booking.com property connected to this workspace (`GET /v1/channels/booking/properties` lists them). Any other id — including one connected to a different workspace — returns `404 not_found`, the same answer as an id that does not exist. Returns `403 listing_inactive` when any listing mapped to the Booking.com property is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
1131
1221
|
# @param booking_availability_update_request [BookingAvailabilityUpdateRequest]
|
|
1132
1222
|
# @param [Hash] opts the optional parameters
|
|
1133
|
-
# @return [
|
|
1223
|
+
# @return [BookingPricingUpdateResponse]
|
|
1134
1224
|
def update_booking_availability(booking_availability_update_request, opts = {})
|
|
1135
|
-
update_booking_availability_with_http_info(booking_availability_update_request, opts)
|
|
1136
|
-
|
|
1225
|
+
data, _status_code, _headers = update_booking_availability_with_http_info(booking_availability_update_request, opts)
|
|
1226
|
+
data
|
|
1137
1227
|
end
|
|
1138
1228
|
|
|
1139
1229
|
# Update Booking.com rates/availability
|
|
1140
|
-
#
|
|
1230
|
+
# Write rates, availability and restrictions to a Booking.com property. `type` selects the write: - `rates` — nightly prices, plus any length-of-stay / arrival restrictions sent with them. - `availability` — inventory (`availableRooms`), the stop-sell flag (`closed`), and restrictions. Omit `availableRooms` and `closed` for a restriction-only write. - `derived-pricing` — occupancy-derived pricing rules. **Dates are inclusive at both ends.** `{ \"start\": \"2026-11-04\", \"end\": \"2026-11-04\" }` is exactly one night. **A rate amount needs an occupancy.** Booking.com stores the amount against the party size the rate plan prices: sent above that number it declines the price in silence, sent below it it answers 400. Send `occupancy`, or omit it and Repull resolves it from Booking.com's own data and echoes the value and its `source` back in `occupancy[]`. If it cannot be resolved the write is refused with `422` naming `updates[N].occupancy`. **Restrictions are sent in the same call, on their own wire.** A price and a minimum stay are two writes on Booking.com's side. Send them together and the response reports each separately: `price` and `restrictions` carry their own state, their own read-back, and — when refused — Booking.com's own reason. The top-level `applied` is `partial` when they disagree, so a price that landed is never reported as a failure. `minStay`, `maxStay`, `minStayArrival`, `maxStayArrival`, `closedToArrival` and `closedToDeparture` are written; `exactStayArrival`, `minAdvanceRes` and `maxAdvanceRes` are refused with `422 restriction_not_supported` because Booking.com's notification has no element for them — set those on the rate plan in the Extranet. Nothing you send is ever silently ignored. **Inventory is not part of a rate update.** `roomsToSell` on a `rates` update returns `422 inventory_not_in_rate_update`; send it as `type: \"availability\"` instead. **The response says what is known.** Booking.com acknowledges a write with no per-date status, so the nights are read back — prices and restrictions out of the same read: `applied` is `verified`, `mismatch`, `partial`, `rejected` or `unverified` (send `verify: false` to skip the read-back). A bare acknowledgement is never reported as \"all updates applied\". Booking.com stores a 1-night minimum as no minimum, so `minStay: 1` reads back as `0` and still counts as applied. Restrictions never leak across channels — this endpoint writes only to Booking.com. When Booking.com refuses a write outright, their own reason comes back as `422 booking_rejected` with `booking_ruid`; a genuine outage on their side is `502 booking_error`. `property_id` must be a Booking.com property connected to this workspace (`GET /v1/channels/booking/properties` lists them). Any other id — including one connected to a different workspace — returns `404 not_found`, the same answer as an id that does not exist. Returns `403 listing_inactive` when any listing mapped to the Booking.com property is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
1141
1231
|
# @param booking_availability_update_request [BookingAvailabilityUpdateRequest]
|
|
1142
1232
|
# @param [Hash] opts the optional parameters
|
|
1143
|
-
# @return [Array<(
|
|
1233
|
+
# @return [Array<(BookingPricingUpdateResponse, Integer, Hash)>] BookingPricingUpdateResponse data, response status code and response headers
|
|
1144
1234
|
def update_booking_availability_with_http_info(booking_availability_update_request, opts = {})
|
|
1145
1235
|
if @api_client.config.debugging
|
|
1146
1236
|
@api_client.config.logger.debug 'Calling API: BookingComApi.update_booking_availability ...'
|
|
@@ -1172,7 +1262,7 @@ module Repull
|
|
|
1172
1262
|
post_body = opts[:debug_body] || @api_client.object_to_http_body(booking_availability_update_request)
|
|
1173
1263
|
|
|
1174
1264
|
# return_type
|
|
1175
|
-
return_type = opts[:debug_return_type]
|
|
1265
|
+
return_type = opts[:debug_return_type] || 'BookingPricingUpdateResponse'
|
|
1176
1266
|
|
|
1177
1267
|
# auth_names
|
|
1178
1268
|
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
@@ -1320,10 +1410,11 @@ module Repull
|
|
|
1320
1410
|
end
|
|
1321
1411
|
|
|
1322
1412
|
# Update Booking.com pricing for a listing
|
|
1323
|
-
#
|
|
1324
|
-
# @param id [Integer]
|
|
1413
|
+
# Writes nightly prices for a listing's Booking.com room + rate plan. Each update needs `roomId` + `rateId` + `dateRange` + `price` + `currency`; `dateRange` is inclusive at both ends, so `start` equal to `end` writes exactly one night. **Occupancy.** Booking.com stores a rate amount against the party size the rate plan prices. Send `occupancy` and that is what is used; omit it and it is resolved from Booking.com's own data for that (room, rate plan) and echoed back in `occupancy[]` with its `source`. When it cannot be resolved the write is refused with `422` naming `updates[N].occupancy` — a price is never sent at a guessed party size, because Booking.com declines such an amount without saying so. **Inventory is a separate write.** `roomsToSell` on a rate update returns `422 inventory_not_in_rate_update`; use `PUT /v1/channels/booking/availability` with `type: \"availability\"`. **Restrictions ride along, on their own wire.** Send `restrictions` with the price and Booking.com receives two writes; the response reports each separately in `price` and `restrictions`, each with its own state, read-back and — when refused — Booking.com's own reason. `minStay`, `maxStay`, `minStayArrival`, `maxStayArrival`, `closedToArrival` and `closedToDeparture` are written; `exactStayArrival`, `minAdvanceRes` and `maxAdvanceRes` are refused with `422 restriction_not_supported` (Booking.com's notification has no element for them — set those on the rate plan in the Extranet). Nothing you send is silently ignored. **The response says what is known.** Booking.com acknowledges a write without per-date status, so the affected nights are read back — prices and restrictions out of the same read — and `applied` reports `verified`, `mismatch`, `partial`, `rejected` or `unverified`. `partial` means one half landed and the other did not, which is never reported as a total failure. Send `verify: false` to skip the read-back; `applied` is then `unverified`. Booking.com stores a 1-night minimum as no minimum, so `minStay: 1` reads back as `0` and still counts as applied. `id` is a Repull listing id. When it is published under several Booking.com properties this returns `409 ambiguous_booking_mapping` and pushes nothing — name the property with `?hotel_id=` instead. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
1414
|
+
# @param id [Integer] Repull listing id — NOT a Booking.com hotel id.
|
|
1325
1415
|
# @param booking_pricing_update_request [BookingPricingUpdateRequest]
|
|
1326
1416
|
# @param [Hash] opts the optional parameters
|
|
1417
|
+
# @option opts [String] :hotel_id Booking.com hotel id, when this listing is published under more than one property. Omit it and a read uses the oldest mapping (reporting the rest in `otherHotelIds`), while a write is refused with `409 ambiguous_booking_mapping` rather than guess. `GET /v1/channels/booking/properties` lists the valid ids.
|
|
1327
1418
|
# @return [BookingPricingUpdateResponse]
|
|
1328
1419
|
def update_booking_listing_pricing(id, booking_pricing_update_request, opts = {})
|
|
1329
1420
|
data, _status_code, _headers = update_booking_listing_pricing_with_http_info(id, booking_pricing_update_request, opts)
|
|
@@ -1331,10 +1422,11 @@ module Repull
|
|
|
1331
1422
|
end
|
|
1332
1423
|
|
|
1333
1424
|
# Update Booking.com pricing for a listing
|
|
1334
|
-
#
|
|
1335
|
-
# @param id [Integer]
|
|
1425
|
+
# Writes nightly prices for a listing's Booking.com room + rate plan. Each update needs `roomId` + `rateId` + `dateRange` + `price` + `currency`; `dateRange` is inclusive at both ends, so `start` equal to `end` writes exactly one night. **Occupancy.** Booking.com stores a rate amount against the party size the rate plan prices. Send `occupancy` and that is what is used; omit it and it is resolved from Booking.com's own data for that (room, rate plan) and echoed back in `occupancy[]` with its `source`. When it cannot be resolved the write is refused with `422` naming `updates[N].occupancy` — a price is never sent at a guessed party size, because Booking.com declines such an amount without saying so. **Inventory is a separate write.** `roomsToSell` on a rate update returns `422 inventory_not_in_rate_update`; use `PUT /v1/channels/booking/availability` with `type: \"availability\"`. **Restrictions ride along, on their own wire.** Send `restrictions` with the price and Booking.com receives two writes; the response reports each separately in `price` and `restrictions`, each with its own state, read-back and — when refused — Booking.com's own reason. `minStay`, `maxStay`, `minStayArrival`, `maxStayArrival`, `closedToArrival` and `closedToDeparture` are written; `exactStayArrival`, `minAdvanceRes` and `maxAdvanceRes` are refused with `422 restriction_not_supported` (Booking.com's notification has no element for them — set those on the rate plan in the Extranet). Nothing you send is silently ignored. **The response says what is known.** Booking.com acknowledges a write without per-date status, so the affected nights are read back — prices and restrictions out of the same read — and `applied` reports `verified`, `mismatch`, `partial`, `rejected` or `unverified`. `partial` means one half landed and the other did not, which is never reported as a total failure. Send `verify: false` to skip the read-back; `applied` is then `unverified`. Booking.com stores a 1-night minimum as no minimum, so `minStay: 1` reads back as `0` and still counts as applied. `id` is a Repull listing id. When it is published under several Booking.com properties this returns `409 ambiguous_booking_mapping` and pushes nothing — name the property with `?hotel_id=` instead. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
|
|
1426
|
+
# @param id [Integer] Repull listing id — NOT a Booking.com hotel id.
|
|
1336
1427
|
# @param booking_pricing_update_request [BookingPricingUpdateRequest]
|
|
1337
1428
|
# @param [Hash] opts the optional parameters
|
|
1429
|
+
# @option opts [String] :hotel_id Booking.com hotel id, when this listing is published under more than one property. Omit it and a read uses the oldest mapping (reporting the rest in `otherHotelIds`), while a write is refused with `409 ambiguous_booking_mapping` rather than guess. `GET /v1/channels/booking/properties` lists the valid ids.
|
|
1338
1430
|
# @return [Array<(BookingPricingUpdateResponse, Integer, Hash)>] BookingPricingUpdateResponse data, response status code and response headers
|
|
1339
1431
|
def update_booking_listing_pricing_with_http_info(id, booking_pricing_update_request, opts = {})
|
|
1340
1432
|
if @api_client.config.debugging
|
|
@@ -1353,6 +1445,7 @@ module Repull
|
|
|
1353
1445
|
|
|
1354
1446
|
# query parameters
|
|
1355
1447
|
query_params = opts[:query_params] || {}
|
|
1448
|
+
query_params[:'hotel_id'] = opts[:'hotel_id'] if !opts[:'hotel_id'].nil?
|
|
1356
1449
|
|
|
1357
1450
|
# header parameters
|
|
1358
1451
|
header_params = opts[:header_params] || {}
|