ac_get_stock
Description
Returns stock information for the given accommodation type. If not split, a structure consisting of a number of key/value pairs where the key is a date and the value is the number of rooms available for that date. If split, a structure is returned containing each requested stock split. The key is the name of the stock split and the value is in turn a structure consisting of a number of key/value pairs where the key is a date and the value is the number of rooms for that split on that date.Returns stock information for the given accommodation type.
Version
Available from version 5.5.0.
Access
Read-only, master access not required, user must have read access to the “Availability calendar” function.
Parameters
Number | Name | O/R | Version | Usage |
---|---|---|---|---|
1 | Auth | Required | 5.5.0+ | Authentication structure.* |
2 | Accommodation | Required | 5.5.0+ | “Id” of the accommodation type to return stock for. Case sensitive. |
3 | From | Optional | 5.5.0+ | Date from which stock should be returned. If left blank the current date is used. |
4 | To | Optional | 5.5.0+ | Date to which stock should be returned. If left blank a date 6 days after the from date is used. |
5 | Agent override | Optional | 5.20.0+ | “Id” of the agent to use for looking up allocations. Only allowed for internal users. This parameter may also be set to “linked” to specify that the linked agent should be used. |
6 | Split stock | Optional | 5.20.0+ | Allows for the stock to be split into “total”, “provisional” and “allocations”. The “provisional” split is only allowed for users that have access to toggle provisionals on their user group. If this field is a string and not empty then all splits. Alternatively this field may be populated with an array to specify which splits to return – see table below. |
7 | Cache override | Optional | Skips the specified cache layers. Only admin bridge users allowed access. If empty, all caching available will be used. The following values may be used alone or added together to skip the appropriate cache level – see table below. |
*See call structure explanation.
6. Split stock Key structures:
Array key | Structure key | Description |
---|---|---|
0 | total | If not empty then a split containing the total available stock for each day is added. |
1 | provisional | If not empty then a split containing the total stock used by provisional reservations is added. |
2 | allocation | If not empty then a split containing the allocations available for each day is added. |
7. Cache level:
Value | Cache level |
---|---|
1 | ResRequest memory cache |
2 | Bridge memory cache |
4 | Bridge database cache |
Example
Request
{ "method": "ac_get_stock", "params": [ { "bridge_username":"username", "bridge_password":"password", "link_id":"4" }, "WB7", "2018-02-17", "2018-02-20", "", { "total":"1", "provisional":"0", "allocation":"1" }, "" ], "id": 1 }
Response
{ "id": 1, "error": null, "result": { "total": { "2018-02-17": 1, "2018-02-18": 1, "2018-02-19": 1, "2018-02-20": 1 }, "allocation": { "2018-02-17": 0, "2018-02-18": 0, "2018-02-19": 0, "2018-02-20": 0 } } }
Keep up to date with us
Menu
Visit our website
ResRequest Modules
- Business Intelligence
- Central Reservations
- Channel Management
- Customer Relationship Management
- Developer
- Email Series 2022
- Email Series 2023
- Financial Management
- Marketing tools
- Payment Gateways
- Point of sale
- Product
- Professional Services
- Property Management
- ResConnect
- ResInsite
- ResNova
- System Setup
- Technical Alerts
- Technical Tips
- Telephone Management
- Webinars Index