/
Retrieving data from pages

Retrieving data from pages

 

Entities called on pages

Each page retrieves information via API from a single entity, which may be orders, endpoint_orders, containers or piece_groups. To find out which entity is called on which page, see the mapping below:

Page name

Entity called via API

Page name

Entity called via API

bag

containers

bag_multi

piece_groups

bag_scan

endpoint_orders

bag_scan_select

containers

boxing

endpoint_orders

carry

orders

claim

orders

collect

orders

consolidation

endpoint_orders

customer_search

orders/{id}

dispatch

orders

moving

endpoint_orders

orders_list

endpoint_orders

pack

containers

pack_scan

endpoint_orders

pack_scan_select

containers

picking

piece_groups

picking_select

endpoint_orders

prepare_select

endpoint_orders

receive

orders

reserve

containers

sorting

endpoint_orders

Body of the request

Body structure

For all pages, the API calls made are constructed as follows :

  • Filters - Enables filtering on the correct entities, so that the right data is displayed in the Store App of the stock location. In general, this will include at least the endpoint_id, the initial state and the destination state. But other fields can be added to filter further.

  • Fields - Enables requesting the necessary fields that will be used for the display.

Example of the pack page :

The API call is requested on the containers entity. We filter to retrieve only the boxes in the new state, which can transit to the packed state, from the endpoint and the user currently connected.

The fields requested are used for the display of the pack page. Fields at the root relate to the container itself, but we can browse the structures to find for information in the piece_groups, endpoint_orders or the order itself.

Default bodies

The bodies of the queries have been designed to filter exactly on the desired entities. To see the default configurations, unfold the banner below.

Page name

Default bodies

Page name

Default bodies

Bag

{ "container_type": "bag", "endpoint_id": "%endpoint.id%", "fields": [ "state", "type", "endpoint_order_id", "content_ids", "container_id", "piece_groups.item_id", "piece_groups.state", "piece_groups.quantity", "piece_groups.container_id", "piece_groups.order_item_id", "piece_groups.order_item.pricing_details", "piece_groups.order_item.quantity", "piece_groups.line_item_index_ranges", "piece_groups.item.rfid_enabled", "piece_groups.last_update", "date", "parcel.documents.dispatch_note", "parcel.line_item_index_ranges", "parcel.order_id", "parcel.date", "parcel.delivery.type", "parcel.cutoffs_sets", "parcel.order.date", "endpoint_order.id", "endpoint_order.order_id", "endpoint_order.line_item_index_ranges", "endpoint_order.date", "containers.cell.id", "containers.cell.name", "containers.cell.type" ], "from": [ "new" ], "to": "bagged", "user_id": "%user.id%" }

Bag scan

{ "endpoint_id": "%endpoint.id%", "fields": [ "containers.bag.name", "containers.bag.state", "containers.bag.type", "containers.bag.endpoint_order_id", "containers.bag.content_ids", "containers.bag.piece_groups.item_id", "containers.bag.piece_groups.state", "containers.bag.piece_groups.quantity", "containers.bag.piece_groups.last_update", "containers.bag.piece_groups.item.rfid_enabled", "containers.bag.piece_groups.line_item_index_ranges", "containers.bag.piece_groups.container_id", "containers.bag.piece_groups.order_item_id", "containers.bag.piece_groups.order_item.pricing_details", "containers.bag.piece_groups.order_item.quantity", "containers.bag.container_id", "containers.bag.containers.cell.id", "containers.bag.containers.cell.type", "containers.bag.containers.cell.name", "containers.bag.date", "containers.bag.parcel.documents.dispatch_note", "containers.bag.parcel.line_item_index_ranges", "containers.bag.parcel.order_id", "containers.bag.parcel.date", "containers.bag.parcel.delivery.type", "containers.bag.parcel.cutoffs_sets", "piece_group_ids", "line_item_index_ranges", "order_id", "order.id", "order.date", "order.delivery", "order.line_item_groups.index_ranges" ], "from": [ "new", "baggable" ], "ids": [ "%endpointOrderID%" ], "user_id": "%user.id%" }

Bag scan select

{ "container_type": "bag", "endpoint_id": "%endpoint.id%", "fields": [ "state", "type", "endpoint_order_id", "content_ids", "piece_groups.id", "piece_groups.quantity", "piece_groups.container_id", "piece_groups.item_id", "piece_groups.line_item_index_ranges", "piece_groups.last_update", "piece_groups.order_item_id", "piece_groups.order_item.pricing_details", "piece_groups.order_item.quantity", "date", "parcel.documents.dispatch_note", "parcel.line_item_index_ranges", "parcel.order_id", "parcel.date", "parcel.delivery.type", "parcel.cutoffs_sets", "parcel.order.date", "endpoint_order.id", "endpoint_order.order_id", "endpoint_order.line_item_index_ranges", "endpoint_order.date", "endpoint_order.order.date", "containers.cell.id", "containers.cell.name", "containers.cell.type" ], "from": [ "new" ], "to": "bagged", "user_id": "%user.id%" }

Boxing

Carry

Claim

Collect

ConsolidationCu

Customer order

Customer search

Dispatch

Moving

Orders list

Pack

Pack scan

Pack scan select

Picking

Picking select

Prepare select

Receive

Reserve

Sorting

Users

Fields overloading

99% of the time, query filters do not need to be overloaded. This is not the case for the requested fields. Quite often, the fields requested by default are incomplete and do not correspond exactly to your needs.

There are two ways of adding fields to your query:

My field is an item feature

It is very likely that you will need this field on several pages at once. This is why a general configuration of the Store App allows you to request additional item features on all pages. This configuration can be accessed from the Configuration > Store App > General settings backoffice page.

Once configured, these features will be automatically requested in the 'fields' structure of all pages.

My field is elsewhere than in the item

This field must be added page by page, in the Configuration > Store App > Pages > {Page name} > Additional fields configuration.

The path to request the right field is sometimes very complex and not very intuitive, so it is advisable to copy the paths already entered in the default configuration. (ex: to request the quantity of items in the pack page, the additional field must be "containers.box.piece_groups.order_item.quantity")

Entire body overloading

It is possible that the filters made in the request do not correspond exactly to your needs. In this case, it is possible to completely overload the requests.

To do this, you need to enter the new request body in the Configuration > Store App > Pages > {Page name} > Query overload page of the Backoffice.

Fully overloading a request is very complex and must be exceptional. This requires a thorough knowledge of our APIs, so please get in touch with your Onestock technical contact.

Check the response following modifications

Once you have modified the fields or the body of the query, it is important to check that this has worked before configuring display elements such as properties or filters.

To do this, open the console in the Store App, go to the ‘Network’ tab, filter on ‘Fetch/XHR’, and find the call corresponding to your page. Then:

  • Check the body sent to the API in the ‘Payload’ tab

  • Check the response received from the API in the ‘Preview’ tab

Example: I've added the ‘department’ feature to the ‘Request features’ configuration in the Store App. Before configuring the display, I check that my field is correctly requested, and that it is correctly received.

Payload

Response