/product/:id

Save a product to the database. This request does not count toward your API limit.


Definition

https://api.upcdatabase.org/product/{id}/{api_key}


Response

{
    "upc": "5705831011120",
    "name": "Pink highlighter",
    "alias": "Highlighter",
    "description": "It's a pink highlighter. Here's some more information as well.",
    "brand": "Q-CONNECT",
    "msrp": 0.99,
    "status": 200,
    "error": false
}
{
    "message": "Bad Request. The code you are trying to enter does not contain all digits.",
    "status": 400,
    "error": true
}
{
    "message": "Forbidden. Are you using the right authentication method and API token?",
    "status": 403,
    "error": true
}

Example PHP

$data = array(
    'title' => 'General Item Name',
    'alias' => 'ShortName',
    'description' => 'A sentence or two describing the item. It should cover the basics.',
    "brand" => "",
    "category" => "",
    "size" => "",
    "color" => "",
    "gender" => "",
    "age" => "",
    "msrp" => ""
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_URL, 'https://api.upcdatabase.org/product');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($ch);

var_dump($result);