Pre-Association 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

Label/Trim suppliers can generate Items for a Product and retrieve QR codes for label creation. This is done for an initial item code generation. These QR codes are then attached to their intended physical products at time of production.

Data Flow

  1. Create Product if it does not yet exist.
  2. Generate the desired number of items for that product.
  3. Get notified that the item creation has been completed.
  4. Retrieve the details of the items generated, i.e. QR code url.

API Calls

1. Create Product

Product creation must be completed before generating items. If the product already exists do not use this call, it will create another product. Use one of the update calls instead.

API Endpoint: POST {{base_url}}/products/
Auth Header: Device-Api-Key: {{device_key}}

Only name is required when creating a product.

Request Body Example:

1 {  
2    "name": "{{product_name}}",
3    "sku": "{{sku}}",
4    "gtin": "{{gtin}}",
5    "color_name": "{{color_name}}",
6    "style_number": "{{style_number}}",
7    "custom_tags": ["{{tag1}}","{{tag2}}"] 
8}

2. Generate Items

The estimated number of items for the product are created in this step. This value can be increased later. This is an asynchronous call, an optional callback_url can be provided in the request, which will be hit once the asynchronous job completes(this callback URL will need to be safe-listed prior to testing this api call).

A quantity and product identifier must be used. The identifier can be gtin, eid, or internal_id. Items will be tagged with the date and a batch_id UUID. It is strongly recommended to provide custom tags as well.

API Endpoint: POST {{base_url}}/products/generate-batch/

Auth Header: Device-Api-Key: {{device_key}}

Request Body Example:

1{
2    "products": [
3        {
4            "gtin": "{{gtin}}",
5            "quantity":"{{qty}}"
6        }
7    ],
8    "tags": ["{{tag1}}", "{{tag2}}"],
9     "callback_url": "{{callback_url}}”
10}

Response Body Example:

1{
2    "status": "Scheduled",
3    "batch_id": "5c92186b-d77f-41df-8487-5666a8e9c4b8"
4}

3. Get Notified

If you defined a call back url, EON will post to that url once the job has completed. Otherwise, follow step 4 and make a query call to items with your `batch_id`.

4. Get Label Ids

The batch_id is returned in the response from the Generate Batch API.  Use the value in the label_urls field to encode the QR. In this example the QR code URL will be https://cnnct.id/r/qEP7PZPMoAJannh2kgQWfhg/

API Endpoint: GET {{base_url}}/items/?batch_id={{batch_id}}

Auth Header: Device-Api-Key: {{device_key}}

1 {
2  "count": 1,
3    "next": null,
4    "previous": null,
5    "results": [
6        {
7            "product": "https://app.eongroup.co/api/v1/products/eid/44911/",
8            "gtin": "0000000",
9            "eid": "44911",
10            "serial": "650",
11            "qr_url": "https://cnnct.id/e/44911/s/650/?q",
12            "label_urls": [
13                "https://cnnct.id/r/qEP7PZPMoAJannh2kgQWfhg/"
14            ],
15            "created": "2023-07-21T10:07:06.764695-04:00",
16            "modified": "2023-07-21T10:07:06.764727-04:00"
17        },
18}