Core API - Inventory V1¶
Setup and manage properties (hotels, etc.) and all the entites in them to rent out: Units such as rooms, parking lots, beds, meeting rooms, etc. Units can be combined into groups (single rooms, double rooms).
| Apaleo Core API · Inventory V1 | |
|---|---|
| Swagger UI | https://api.apaleo.com/swagger/index.html?urls.primaryName=Inventory+V1 |
| Client | ApaleoAPIClient |
| API | ApaleoAPIClient.core |
| Version | ApaleoAPIClient.core.v1 |
| Resource | ApaleoAPIClient.core.v1.inventory |
| Centralized Type Imports | from apaleoapi.apaleo.core.v1.inventory import ... |
Methods¶
Method-focused reference for Apaleo Core API's Inventory V1.
Warning
Params and payloads are fully typed for maximum developer experience, but you can also use plain dictionaries if you prefer a more dynamic approach. The SDK will handle validation and serialization for you.
The documentation examples show both approaches, but always just one of them which does not mean that the other one is not supported. Use whatever works best for you!
Responses are always fully typed. If you want to work with plain dictionaries, you can always convert the response objects using asdict() function from the dataclasses module.
Property¶
list_properties¶
Returns a list of properties with optional filters.
Endpoint Mapping
GET /inventory/v1/properties
SDK Method
list_properties(self, params: PropertyListParams | dict[str, Any] | None = None) -> PropertyList
params = PropertyListParams(page_size=50, page_number=1)
properties = await client.core.v1.inventory.list_properties(params)
print(properties.count)
for item in properties.items:
print(item.id, item.name)
Concurrent pagination is supported
You can fetch multiple pages concurrently by setting batch_size and is_concurrently=True on PropertyListParams.
params = PropertyListParams(batch_size=100, is_concurrently=True)
properties = await client.core.v1.inventory.list_properties(params)
print(properties.count)
create_property¶
Creates a new property.
Endpoint Mapping
POST /inventory/v1/properties
SDK Method
create_property(self, payload: CreateProperty | dict[str, Any], idempotency_key: str | None = None) -> PropertyCreated
payload = {
"code": "BER",
"name": {"en": "Berlin Hotel"},
"company_name": "Berlin Hotel GmbH",
"commercial_register_entry": "HRB 123456",
"tax_id": "DE123456789",
"location": {
"address_line1": "Alexanderplatz 1",
"postal_code": "10178",
"city": "Berlin",
"country_code": "DE",
},
"time_zone": "Europe/Berlin",
"default_check_in_time": "15:00:00",
"default_check_out_time": "11:00:00",
"currency_code": "EUR",
}
property_created = await client.core.v1.inventory.create_property(
payload=payload,
idempotency_key="property-ber-creation-001",
)
print(property_created.id)
Idempotency is supported
Pass a unique idempotency_key for each create request to avoid duplicate property creation when retrying requests.
count_properties¶
Returns the total number of properties.
Endpoint Mapping
GET /inventory/v1/properties/$count
SDK Method
count_properties(self) -> int
property_count = await client.core.v1.inventory.count_properties()
print(property_count)
get_property¶
Returns the details for a specific property by ID.
Endpoint Mapping
GET /inventory/v1/properties/{id}
SDK Method
get_property(self, property_id: str, params: PropertyGetParams | dict[str, Any] | None = None) -> Property
params = PropertyGetParams(languages=["en"], expand=["unitGroups"])
property_item = await client.core.v1.inventory.get_property(
property_id="BER",
params=params,
)
print(property_item.id)
print(property_item.name)
update_property¶
Updates property details by ID.
Endpoint Mapping
PATCH /inventory/v1/properties/{id}
SDK Method
update_property(self, property_id: str, payload: list[Operation] | list[dict[str, Any]]) -> None
payload = [
Operation(
op="replace",
path="/name/en",
value="Berlin Hotel Central",
),
Operation(
op="replace",
path="/defaultCheckInTime",
value="16:00:00",
),
]
await client.core.v1.inventory.update_property(
property_id="BER",
payload=payload,
)
delete_property¶
Deletes a property by ID.
Endpoint Mapping
DELETE /inventory/v1/properties/{id}
SDK Method
delete_property(self, property_id: str) -> None
await client.core.v1.inventory.delete_property(property_id="BER")
Property Actions¶
Types¶
list_countries¶
Returns a list of supported countries.
Endpoint Mapping
GET /inventory/v1/types/countries
SDK Method
list_countries(self) -> CountryList
countries = await client.core.v1.inventory.list_countries()
print(countries.count)
print(countries.items[:5])