Universal QR Code API (1.0.1)

Download OpenAPI specification:Download

Sample API for Universal QR Codes

Authentication

Bearer Token

Any users may generate a bearer API token from their account page on a respective labeling site. Tokens are only needed for write operations - all read operations can happen without authentication.

Security Scheme Type HTTP
HTTP Authorization Scheme bearer
Bearer format "JWT"

endpoint

What is this:

URL to get the hostname from a QR code label - potentially hosted on a different server. This endpoint should also provide the vendor for the label, in order to assist in developers matching their API tokens to the correct endpoints.

Usage:

View a JSON schema of this inside the /wellknown/cannabis-api.schema.json The 'vendor' tag allows a developer to easily match their stored API keys to the endpoint.

Additional Endpoints:

If you would like additional endpoints to be stored in the cannabis-api.json file, you can specify them with fieldname-endpoint. For example 'distributor-endpoint' or 'pos-endpoint'. You should always have an endpoint entry, however.

/.well-known/cannabis-api.json

Authorizations:
Bearer Token (write)

Responses

Response samples

Content type
application/json
{
  • "endpoint": "qr.example.com/uapi/v1/",
  • "path-components": "qr.example.com/i/:id",
  • "vendor": "nabis",
  • "*-endpoint": "qr-poc.example.com/uapi/v1/"
}

product

Information about product details like product name, description, doses, etc

/product/{id}

Authorizations:
Bearer Token (write)
path Parameters
id
required
string

id of record to look up

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  • "updatedOn": "2019-08-24T14:15:22Z",
  • "name": "Kush OG",
  • "sku": "string",
  • "upc": "string",
  • "barcode": "string",
  • "productLine": "string",
  • "productType": "balm",
  • "usage": "medical",
  • "variety": "cbd",
  • "strain": "string",
  • "totalCannabinoids": {
    },
  • "totalThc": {
    },
  • "totalCbd": {
    },
  • "thcCbdRatio": "5:1",
  • "servings": 0,
  • "servingSize": {
    },
  • "packageSize": {
    },
  • "description": "string",
  • "testsDescription": "string",
  • "testingMethodology": "string",
  • "usageRecommendation": "string",
  • "aboutIngredients": "string",
  • "ingredients": [
    ],
  • "specialDiet": "glutenFree",
  • "images": {
    }
}

batch

Information about batch details like testing and THC content

/batch/{id}

Authorizations:
Bearer Token (write)
path Parameters
id
required
string

id of record to look up

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  • "name": "string",
  • "regulatoryEvents": [
    ],
  • "producedOn": "2019-08-24",
  • "coaIds": [
    ],
  • "updatedOn": "2019-08-24T14:15:22Z"
}

case

Case matching input id - a case comes from a manufacturer and is a collection of items that are all the same. It cannot contain different item types.

/case/{id}

Authorizations:
Bearer Token (write)
path Parameters
id
required
string

id to look up

query Parameters
excludedFields
Array of strings
Example: excludedFields=product,batch

comma separated list of fields to exclude in the request body

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "eaches": [
    ],
  • "regulatorEvents": [
    ]
}

/case/{id}

Authorizations:
Bearer Token (write)
path Parameters
id
required
string

id to look up

Request Body schema: application/json

Body for a put / post with regulator information

One of
id
required
string <uuid> (Id)

Unique ID for an object. Format of uuid is platform dependent. Client implementations should expect that uuid values are always unique within a given implementation, but should not assume any particular format for the uuid itself other than string. Note that depending on platform implementation, it may be possible to convert the string to a valid UUID, however the specifics of such a conversion must be determined from the platform implementation.

parent
string <uuid> (Id)

Unique ID for an object. Format of uuid is platform dependent. Client implementations should expect that uuid values are always unique within a given implementation, but should not assume any particular format for the uuid itself other than string. Note that depending on platform implementation, it may be possible to convert the string to a valid UUID, however the specifics of such a conversion must be determined from the platform implementation.

kind
required
string
Enum: "batch" "transfer" "manifest"

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "parent": "42e2bc1b-6741-4e2e-b138-97b4a342c999",
  • "kind": "batch"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "eaches": [
    ],
  • "regulatorEvents": [
    ]
}

each

Information and updating a serialized package - single unit of a product / batch

/each/{id}

Authorizations:
Bearer Token (write)
path Parameters
id
required
string

id to look up

query Parameters
excludedFields
Array of strings
Example: excludedFields=product,batch

comma separated list of fields to exclude in the request body

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113",
  • "batchId": "5579c111-9c50-47e2-af92-f16d52e63189",
  • "caseId": "af51d69f-996a-4891-a745-aadfcdec225a",
  • "regulatorEvents": [
    ]
}

/each/{id}

Authorizations:
Bearer Token (write)
path Parameters
id
required
string

id to look up

Request Body schema: application/json

Body for a put / post with regulator information

One of
id
required
string <uuid> (Id)

Unique ID for an object. Format of uuid is platform dependent. Client implementations should expect that uuid values are always unique within a given implementation, but should not assume any particular format for the uuid itself other than string. Note that depending on platform implementation, it may be possible to convert the string to a valid UUID, however the specifics of such a conversion must be determined from the platform implementation.

parent
string <uuid> (Id)

Unique ID for an object. Format of uuid is platform dependent. Client implementations should expect that uuid values are always unique within a given implementation, but should not assume any particular format for the uuid itself other than string. Note that depending on platform implementation, it may be possible to convert the string to a valid UUID, however the specifics of such a conversion must be determined from the platform implementation.

kind
required
string
Enum: "batch" "transfer" "manifest"

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "parent": "42e2bc1b-6741-4e2e-b138-97b4a342c999",
  • "kind": "batch"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113",
  • "batchId": "5579c111-9c50-47e2-af92-f16d52e63189",
  • "caseId": "af51d69f-996a-4891-a745-aadfcdec225a",
  • "regulatorEvents": [
    ]
}

regulator

Query for details about regulator tags

/regulator/{id}

Authorizations:
Bearer Token (write)
path Parameters
id
required
string

id to look up

Responses

Response samples

Content type
application/json
{
  • "eaches": [
    ],
  • "cases": [
    ],
  • "regulatorEvents": [
    ]
}

/regulator/{id}

Authorizations:
Bearer Token (write)
path Parameters
id
required
string

id to look up

Request Body schema: application/json

Body for a request to put a regulator id on multiple items

ids
Array of strings <uuid> (Id)

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "parent": "42e2bc1b-6741-4e2e-b138-97b4a342c999",
  • "kind": "batch"
}

manifest

Get details from an order (probably from a distributor), describing child package to QR code url mappings The contents field contains an array of QR codes that represent all scanned cases or items, allowing a lookup on a per-vendor basis of the data about those cases or items. In order to use the cases in your system, just perform a lookup on the case information endpoint and get the each IDs - then use those to identify the scanned out QR codes. The regulatorEvent entry represents the transfer ID (if applicable). Using the manifest endpoint, a retailer can scan a single barcode on a box and then use subsequent API calls using the standard (to multiple vendors) to get information about the associated regulator tags and product information.

/manifest/{id}

Authorizations:
Bearer Token (write)
path Parameters
id
required
string

id to look up

Responses

Response samples

Content type
application/json
{
  • "regulatorEvent": {
    },
  • "contents": [
    ]
}