Label Tutorial
Last updated
Was this helpful?
Last updated
Was this helpful?
To label a product with a specific information, follow these steps:
Create a label
Add a label image
Update a product with the label information
To create a new label, send the request to the Creating a label endpoint.
curl -i -X POST \
https://api.emporix.io/label/labels \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"name": "Worldwide Shipment",
"description": "<p>Worldwide Shipment</p>"
}'
Executing a request to create a label returns a response that includes an "id" field, which should then be used in the next steps.
Firstly, create and add an image for a new label. Design the image and upload it to your media repository. Send a request to the Creating an asset endpoint.
The labelId
is necessary to provide.
curl -L \
--request POST \
--url 'https://api.emporix.io/media/{tenant}/assets' \
--header 'Content-Type: multipart/form-data' \
--data '{
"file": {
"externalValue": "https://res.cloudinary.com/saas-ag/image/upload/v1695804155/emporix-logo-white-2f5e621206edefea6015fb4793959376_nswfbz.png"
},
"body": {
"type": "BLOB",
"access": "PUBLIC",
"refIds": [
{
"id": "66fe65e83132e30001e6be29",
"type": "LABEL"
}
],
"details": {
"filename": "theBestImage",
"mimeType": "image/jpg"
}
}
}'
You can now update a product with a newly created label to indicate that shipping is available worldwide for this product. Send the request to the Partially updating a product endpoint.
To specify a brand for a product, you need to provide the labelId
field on product level which should be used. You can add brands either during the creation of the product, or by updating a product that already exists in the system.
curl -i -X PATCH \
'https://api.emporix.io/product/{tenant}/products/{productId}?skipVariantGeneration=false&doIndex=true' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Language: string' \
-H 'Content-Type: application/json' \
-d '{
"published": true
"labelIds": ["66fe65e83132e30001e6be29"]
}'
As a result, the product is marked with a new label.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.