Skip to main content
POST
/
api
/
antennas
/
{antenna_uuid}
/
product-epc
Create or update product and assign EPC on an antenna
curl --request POST \
  --url https://app.buylo.ai/api/antennas/{antenna_uuid}/product-epc \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "product_id": "ABC123",
  "name": {
    "en": "Brazil Santos Coffee",
    "cs": "Brazilská káva Santos"
  },
  "category": "Coffee",
  "description": {
    "en": "Roasted Arabica coffee beans from Brazil",
    "cs": "Pražená arabica z Brazílie"
  },
  "ean": "8591234567890",
  "brand": "CoffeeCo",
  "prices": [
    {
      "currency": "EUR",
      "price": 199.99
    },
    {
      "currency": "CZK",
      "price": 4999
    }
  ],
  "vat_rate": 21,
  "unit": "kg",
  "product_data": {
    "color": "red",
    "size": "L"
  }
}
'
import requests

url = "https://app.buylo.ai/api/antennas/{antenna_uuid}/product-epc"

payload = {
    "product_id": "ABC123",
    "name": {
        "en": "Brazil Santos Coffee",
        "cs": "Brazilská káva Santos"
    },
    "category": "Coffee",
    "description": {
        "en": "Roasted Arabica coffee beans from Brazil",
        "cs": "Pražená arabica z Brazílie"
    },
    "ean": "8591234567890",
    "brand": "CoffeeCo",
    "prices": [
        {
            "currency": "EUR",
            "price": 199.99
        },
        {
            "currency": "CZK",
            "price": 4999
        }
    ],
    "vat_rate": 21,
    "unit": "kg",
    "product_data": {
        "color": "red",
        "size": "L"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    product_id: 'ABC123',
    name: {en: 'Brazil Santos Coffee', cs: 'Brazilská káva Santos'},
    category: 'Coffee',
    description: {
      en: 'Roasted Arabica coffee beans from Brazil',
      cs: 'Pražená arabica z Brazílie'
    },
    ean: '8591234567890',
    brand: 'CoffeeCo',
    prices: [{currency: 'EUR', price: 199.99}, {currency: 'CZK', price: 4999}],
    vat_rate: 21,
    unit: 'kg',
    product_data: {color: 'red', size: 'L'}
  })
};

fetch('https://app.buylo.ai/api/antennas/{antenna_uuid}/product-epc', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://app.buylo.ai/api/antennas/{antenna_uuid}/product-epc",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'product_id' => 'ABC123',
    'name' => [
        'en' => 'Brazil Santos Coffee',
        'cs' => 'Brazilská káva Santos'
    ],
    'category' => 'Coffee',
    'description' => [
        'en' => 'Roasted Arabica coffee beans from Brazil',
        'cs' => 'Pražená arabica z Brazílie'
    ],
    'ean' => '8591234567890',
    'brand' => 'CoffeeCo',
    'prices' => [
        [
                'currency' => 'EUR',
                'price' => 199.99
        ],
        [
                'currency' => 'CZK',
                'price' => 4999
        ]
    ],
    'vat_rate' => 21,
    'unit' => 'kg',
    'product_data' => [
        'color' => 'red',
        'size' => 'L'
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.buylo.ai/api/antennas/{antenna_uuid}/product-epc"

	payload := strings.NewReader("{\n  \"product_id\": \"ABC123\",\n  \"name\": {\n    \"en\": \"Brazil Santos Coffee\",\n    \"cs\": \"Brazilská káva Santos\"\n  },\n  \"category\": \"Coffee\",\n  \"description\": {\n    \"en\": \"Roasted Arabica coffee beans from Brazil\",\n    \"cs\": \"Pražená arabica z Brazílie\"\n  },\n  \"ean\": \"8591234567890\",\n  \"brand\": \"CoffeeCo\",\n  \"prices\": [\n    {\n      \"currency\": \"EUR\",\n      \"price\": 199.99\n    },\n    {\n      \"currency\": \"CZK\",\n      \"price\": 4999\n    }\n  ],\n  \"vat_rate\": 21,\n  \"unit\": \"kg\",\n  \"product_data\": {\n    \"color\": \"red\",\n    \"size\": \"L\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://app.buylo.ai/api/antennas/{antenna_uuid}/product-epc")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"product_id\": \"ABC123\",\n  \"name\": {\n    \"en\": \"Brazil Santos Coffee\",\n    \"cs\": \"Brazilská káva Santos\"\n  },\n  \"category\": \"Coffee\",\n  \"description\": {\n    \"en\": \"Roasted Arabica coffee beans from Brazil\",\n    \"cs\": \"Pražená arabica z Brazílie\"\n  },\n  \"ean\": \"8591234567890\",\n  \"brand\": \"CoffeeCo\",\n  \"prices\": [\n    {\n      \"currency\": \"EUR\",\n      \"price\": 199.99\n    },\n    {\n      \"currency\": \"CZK\",\n      \"price\": 4999\n    }\n  ],\n  \"vat_rate\": 21,\n  \"unit\": \"kg\",\n  \"product_data\": {\n    \"color\": \"red\",\n    \"size\": \"L\"\n  }\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://app.buylo.ai/api/antennas/{antenna_uuid}/product-epc")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"product_id\": \"ABC123\",\n  \"name\": {\n    \"en\": \"Brazil Santos Coffee\",\n    \"cs\": \"Brazilská káva Santos\"\n  },\n  \"category\": \"Coffee\",\n  \"description\": {\n    \"en\": \"Roasted Arabica coffee beans from Brazil\",\n    \"cs\": \"Pražená arabica z Brazílie\"\n  },\n  \"ean\": \"8591234567890\",\n  \"brand\": \"CoffeeCo\",\n  \"prices\": [\n    {\n      \"currency\": \"EUR\",\n      \"price\": 199.99\n    },\n    {\n      \"currency\": \"CZK\",\n      \"price\": 4999\n    }\n  ],\n  \"vat_rate\": 21,\n  \"unit\": \"kg\",\n  \"product_data\": {\n    \"color\": \"red\",\n    \"size\": \"L\"\n  }\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "product_epc_hashes": [
      "8aaedfc3559d0ce545ca55bcea31aad2",
      "2b1c7f8c2aab4e33a5e09a2d77f3b611"
    ]
  }
}
{
  "message": "<string>"
}
{
  "message": "<string>"
}
{
  "message": "<string>"
}
{
  "message": "<string>"
}
{
  "message": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

antenna_uuid
string
required

Query Parameters

allowed_tags_on_antenna
number
default:1

Allowed number of RFID tags detected on the antenna. Defaults to 1.

Body

application/json
product_id
string
required

Your Unique product identifier

Example:

"ABC123"

name
object | null

Product name with translations

Example:
{
  "en": "Brazil Santos Coffee",
  "cs": "Brazilská káva Santos"
}
category
string | null

Product category

Maximum string length: 255
Example:

"Coffee"

description
object | null

Product description with translations

Example:
{
  "en": "Roasted Arabica coffee beans from Brazil",
  "cs": "Pražená arabica z Brazílie"
}
ean
string | null

European Article Number

Maximum string length: 255
Example:

"8591234567890"

brand
string | null

Brand name of the product

Maximum string length: 255
Example:

"CoffeeCo"

prices
object[] | null

Array of prices in different currencies

Example:
[
  { "currency": "EUR", "price": 199.99 },
  { "currency": "CZK", "price": 4999 }
]
vat_rate
number<float> | null

VAT rate percentage

Required range: x >= 0
Example:

21

unit
string | null

Unit of measurement

Maximum string length: 50
Example:

"kg"

product_data
object | null

Free additional product data

Example:
{ "color": "red", "size": "L" }

Response

Created or updated product and assigned EPC

data
object
required