Post-Associated QR Code Labels

EON uses a hierarchical relationship between entities. A product has one to many items and each of those items has one to many labels. EON supports four label types, QR code, Verifiable QR code, NFC tag and RFID tag. An item can only have one label of each type, i.e. you cannot have two NFC tags.

Use Case

When labels have been created and delivered to the factory, but have not been associated with an item. This recipe outlines the necessary steps to create an application that will associate existing labels to items.

Label suppliers can request a bulk volume of serialized QR codes, that are not yet associated to any Product/Item in the EON cloud. These QR codes are then attached to physical products at time of production, and then leveraging either EON’s Association API or EON Partner Access app will be associated to a Product/Item in the EON Cloud

Data Flow

Pre-requisites: Product must exist on the EON Product Cloud

  1. Create the number of QR codes needed for the items being labeled
  2. Lookup created QR codes by batch
  3. Associate Label to Item

API Calls

1. Create QR codes

Since this is a bulk request that can create many QR codes it is asynchronous, so the results of the batch request will be looked up in a subsequent call. It is recommended that tags be used to identify the batch request.

API Endpoint: POST/labels/bulk-create-qr/
Auth Header: Device-Api-Key:

Only name is required when creating a product.

Request Body Example:

1{   
2    "quantity": 3,
3    "tags": ["collar","Label_Vendor", "Device_Name"]
4}

Response code: 202 Accepted
Response Body:

1{
2     "batch_id": "d4a2e161-763a-4f8a-b1ee-4226981499c0"
3}

2. Get QR codes

Using the batch id from the Create QR codes response, filter the labels collection to get those just created. id and reference_id will be needed in the next step to associate the QR codes with labels.

API Endpoint: GET/labels/?batch=d4a2e161-763a-4f8a-b1ee-4226981499c0

API Endpoint: GET/labels/?tags=batch-d4a2e161-763a-4f8a-b1ee-4226981499c0

Auth Header: Device-Api-Key:

Response Code: 200 OK
Response Body Example:

1{
2    "count": 3,
3    "next": null,
4    "previous": null,
5    "results": [
6        {
7            "id": 41136838,
8            "is_associated": false,
9            "item": null,
10            "reference_id": "qguCovZDjh3M78vAD2BAa2M",
11            "type": "QR",
12            "reference_id_namespace": null
13        },
14        {
15            "id": 41136839,
16            "is_associated": false,
17            "item": null,
18            "reference_id": "qoHWht6kiH46EC6MMPRvezH",
19            "type": "QR",
20            "reference_id_namespace": null
21        },
22        {
23            "id": 41136840,
24            "is_associated": false,
25            "item": null,
26            "reference_id": "qnhpFNywzdF6rF8e9Ds5qTn",
27            "type": "QR",
28            "reference_id_namespace": null
29        }
30    ]
31}

3. Associate QR code to label

This request requires the id and reference_id from the previous call as well as a product identifier: gtin, internal_id (e.g. SKU) or eid. Each label QR code will need to be updated as they are attached to the item. The serial is the identifier for the specific item.

API Endpoint: POST/labels/associate/
Auth Header: Device-Api-Key:

Request Body Example:

1{
2  "id": 40482878,
3  "eid": "44911",
4  "reference_ids": [
5      "qnhpFNywzdF6rF8e9Ds5qTn"
6      ]
7}

Response Code: 201 Created
Response Body Example:

1{
2    "reference_ids": [
3        "qnhpFNywzdF6rF8e9Ds5qTn"
4    ],
5    "eid": 44911,
6    "serial": "10721"
7}

If one of the submitted reference_ids has already been associated with a label then the entire request will fail.

Response Code: 400 Bad Request
Response Body:

1{
2    "reference_ids": [
3        "Label with reference_id q6DQBnk5Kb9Zf5Dbt4ibzCX is already associated to Item with Product EID 44911 and Serial 10720."
4    ]
5}