/v1/labels/{id}/formats (POST)
POST
/v1/labels/{id}/formats
const url = 'https://example.com/v1/labels/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/formats';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"ref":"example","quantity":1,"gtin":"example","consumer_product_variant":"example","lot":"example","internal_reference":"example","shop_url":"example","available_from":"example","image_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/labels/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/formats \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "ref": "example", "quantity": 1, "gtin": "example", "consumer_product_variant": "example", "lot": "example", "internal_reference": "example", "shop_url": "example", "available_from": "example", "image_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Add a format to a label. quantity is in MILLILITRES (750, 1500). Omit ref to generate a random 10-character base62 reference, the same scheme used for all Glasswise refs.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
ref
Public short-link reference. Omit to generate a random 10-character base62 ref, the same scheme used for all Glasswise refs.
string
quantity
Fill volume in MILLILITRES, e.g. 750 or 1500
integer
gtin
string
consumer_product_variant
string
lot
string
internal_reference
string
shop_url
string
available_from
ISO date from which the e-label is valid
string
image_id
string format: uuid
Examplegenerated
{ "ref": "example", "quantity": 1, "gtin": "example", "consumer_product_variant": "example", "lot": "example", "internal_reference": "example", "shop_url": "example", "available_from": "example", "image_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Section titled “ Responses ”The created format
Media typeapplication/json
object
id
required
string format: uuid
label_id
required
string format: uuid
ref
required
string | null
quantity
required
Fill volume in MILLILITRES, e.g. 750 or 1500
number | null
gtin
required
string | null
consumer_product_variant
required
string | null
lot
required
string | null
internal_reference
required
string | null
shop_url
required
string | null
short_url
required
string | null
available_from
required
string | null
image_id
required
string | null format: uuid
created_at
required
string | null
updated_at
required
string | null
Examplegenerated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "label_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "ref": "example", "quantity": 1, "gtin": "example", "consumer_product_variant": "example", "lot": "example", "internal_reference": "example", "shop_url": "example", "short_url": "example", "available_from": "example", "image_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "created_at": "example", "updated_at": "example"}Invalid body
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Missing or invalid bearer token
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Label not writable
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Upstream error
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}