# Depots

# Locations

# Get Offers

The customer can choose if a Keycard or SwissPass should be immediately associated to the depot or if that should happen later on. This is done via the permissionType filter, which can be either initial (media associated immediately) or deferred (media associated later on). The type of media is controlled via the media filter. This one can be either keycard or swisspass. Note that if permissionType is deferred the offer variant will always be valid for keycard and swisspass despite the offer variant only listing one value if filtering for a media type. If the permissionType is initial you will get separate variants for keycard and swisspass as those require different personalization. There is also a rentalPeriod filter where you can specify in which periods you expect rental prices to change (depending on the intended duration of rental). Currently daily, seasonal and yearly is possible here. For how many periods the depot will be rented depends on the date interval which is then fitted to the rental periods. Note that the real rental period can then deviate from the selected date interval.

The system assigns a random depot in the selected room (and location). depotRestriction could be also used in the request to input a specific selection of a depot which has been before selected on some map. However, this is not yet implemented.

# Cart


  1. Access Management

Several media can be associated to the depot to unlock it. While it is only possible to associate one media during purchase this can be changed after the depot is in cart or after purchase. The order item reports if it can be edited witha a flag editable at the item options. Each media gets an ID and is listed with the order item (typeSpecific part):


    {
        "depotInfo": {
            "location": {
                "value": "depot-den",
                "label": "Depot Den"
            },
            "room": {
                "value": "depot-den-room-a",
                "label": "Room A"
            },
            "depot": {
                "value": "depot-35",
                "label": "35"
            }
        },
        "permissions": [
            {
                "id": "N9811008-TF5-XYM",
                "name": "N9811008-TF5-XYM",
                "type": "keycard",
                "securityCode": "1234"
            }
        ]
    }

or in a dedicated endpoint GET v1/depot/permissions that needs orderId and orderItemId as query parameters. orderId needs to be either the ID of the order before purchase (the eCommerce core calls that quote) or the ID of the order after purchase (the eCommerce core calls that increment ID). The orderItemId is the ID of a order item associated to such an order. The order must belong to the authenticated customer or to the current session. The order item must be of type depot. The dedicated endpoint also tells us how many media can be associated to the depot and how many media must remain:


    {
        "min": 1,
        "max": 4,
        "permissions": [
            {
                "id": "N9811008-TF5-XYM",
                "name": "N9811008-TF5-XYM",
                "type": "keycard",
                "securityCode": "1234"
            }
        ]
    }

Media can then added to or removed from this list. To add media call POST v1/depot/permissions with


    [
        {
            "orderId": 3500000088,
            "orderItemId": 1537846,
            "type": "keycard",
            "typeSpecific": {
                "keycardId": "N9811008-TF5-XYM"
            }
        }
    ]

This adds a keycard to a already purchased depot item. You could also add a SwissPass but would have to substitute the typeSpecific part for it. Adding permissions supports bulk adding which means you can add more than one permission at once. When adding one permission fails none of the permissions in the request will be added.

Similarly, you an remove media with DELETE v1/depot/permissions and body


    {
        "orderId": 3500000088,
        "orderItemId": 1537846,
        "mediaId": "N9811008-TF5-XYM"
    }

where the mediaId is the id of a certain permission from the list.