Products

When a new reservation is created the packages may not yet be known (i.e. only products are known, but how shall those be packaged is unknown). This means that multiple products may form a package in the future.

Description

Input attributes

The new products attribute is a collection and one or more products can be provided instead of packages. Each product must have the following attributes:

  • depth

  • height

  • width

  • quantity

  • code - Product specific unique identification with max length of 30 characters

  • weight - Optional

The weight attribute may be supplied, however it is the only optional attribute for a product.

Please note that when creating a new reservation, either packages or products must be supplied . If neither of these is provided, the reservation will not be created and a specific error will be returned.

Response

The response structure of the POST request remains the same.

Products vs Packages

As briefly mentioned above, packages logically contain one or more products. However so far products used to create reservations are not linked to packages (which were added via both POST or PATCH).

The structure is used to make slot calculations more accurate. In the end, reservation must contain some package because it has a barcode that is used for several operations when operating the AlzaBox physically.

Request example

An example of a POST request for a reservation:

POST /parcel-lockers/v2/reservation { "data": { "reservation": { "id": "RES123", "attributes": { ... "products": [ { "depth": 3.5, "height": 2.8, "width": 4.2, "quantity": 1, "code": "PROD123", "weight": 1.3 }, { "depth": 3.5, "height": 2.8, "width": 4.2, "quantity": 1, "code": "PROD123", //NOTE: Note the missing weight attribute, since it is optional } ] }, "relationships": { "box": { "id": 1234, "pid": "PID9876" } } } } }