API Change Protocol - 20230321 - Usage of the box's slots

What we want to change:

Provide information about the usage of the specific type of slots inside each box

Why we want to change:

  • To get information about current usage of the slots inside box

When we want to change:

Test environment: TBD

Production environemnt: TBD

Affected enpoints

GET /v2/box?fields[box]=slots

GET /v2/boxes?fields[box]=slots

Example of change:

When a caller wants to get information about slots he must use slots fields filter in request qyery string as follows on the first line of the first example. On the second example it is possible to see original response with the dimensions and other informations about the slots. On the third example is a new response proposal with the new fields, size and used, inside attributes of the slots. The same rules will be apply for both endpoints.

Request:

GET /parcel-lockers/v2/box?filter%5Bid%5D=5&fields%5Bbox%5D=slots

Original response:

{ "data": { "box": { "id": 5, "pid": "19907", "attributes": { "slots": [ { "depth": 61, "height": 8.5, "width": 44, "count": 24, "type": "Extra Small", "slotId": 1 }, { "depth": 61, "height": 18.8, "width": 44, "count": 18, "type": "Small", "slotId": 2 }, { "depth": 61, "height": 37.7, "width": 44, "count": 12, "type": "Medium", "slotId": 3 } ] } } }, "metadata": null, "errors": null }

New response:

{ "data": { "box": { "id": 5, "pid": "19907", "attributes": { "slots": [ { "depth": 61, "height": 8.5, "width": 44, "count": 24, "type": "Extra Small", "slotId": 1, "size": "XS", "used": 3 }, { "depth": 61, "height": 18.8, "width": 44, "count": 18, "type": "Small", "slotId": 2, "size": "S", "used": 4 }, { "depth": 61, "height": 37.7, "width": 44, "count": 12, "type": "Medium", "slotId": 3, "size": "M", "used": 1 } ] } } }, "metadata": null, "errors": null }

API specification diff:

TBD