Update Product
curl --request PUT \
--url https://api.example.com/api/dashboard/products/{product_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"vendor": "<string>",
"product_type": "<string>",
"tags": [
"<string>"
],
"price": 1,
"compare_at_price": 1,
"cost_per_item": 1,
"currency": "<string>",
"images": [
{
"url": "<string>",
"alt": "<string>",
"position": 0
}
],
"options": [
{
"name": "<string>",
"values": [
"<string>"
]
}
],
"track_inventory": true,
"status": "<string>"
}
'import requests
url = "https://api.example.com/api/dashboard/products/{product_id}"
payload = {
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"vendor": "<string>",
"product_type": "<string>",
"tags": ["<string>"],
"price": 1,
"compare_at_price": 1,
"cost_per_item": 1,
"currency": "<string>",
"images": [
{
"url": "<string>",
"alt": "<string>",
"position": 0
}
],
"options": [
{
"name": "<string>",
"values": ["<string>"]
}
],
"track_inventory": True,
"status": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
slug: '<string>',
description: '<string>',
vendor: '<string>',
product_type: '<string>',
tags: ['<string>'],
price: 1,
compare_at_price: 1,
cost_per_item: 1,
currency: '<string>',
images: [{url: '<string>', alt: '<string>', position: 0}],
options: [{name: '<string>', values: ['<string>']}],
track_inventory: true,
status: '<string>'
})
};
fetch('https://api.example.com/api/dashboard/products/{product_id}', 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://api.example.com/api/dashboard/products/{product_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'slug' => '<string>',
'description' => '<string>',
'vendor' => '<string>',
'product_type' => '<string>',
'tags' => [
'<string>'
],
'price' => 1,
'compare_at_price' => 1,
'cost_per_item' => 1,
'currency' => '<string>',
'images' => [
[
'url' => '<string>',
'alt' => '<string>',
'position' => 0
]
],
'options' => [
[
'name' => '<string>',
'values' => [
'<string>'
]
]
],
'track_inventory' => true,
'status' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/dashboard/products/{product_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"vendor\": \"<string>\",\n \"product_type\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"price\": 1,\n \"compare_at_price\": 1,\n \"cost_per_item\": 1,\n \"currency\": \"<string>\",\n \"images\": [\n {\n \"url\": \"<string>\",\n \"alt\": \"<string>\",\n \"position\": 0\n }\n ],\n \"options\": [\n {\n \"name\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"track_inventory\": true,\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.example.com/api/dashboard/products/{product_id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"vendor\": \"<string>\",\n \"product_type\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"price\": 1,\n \"compare_at_price\": 1,\n \"cost_per_item\": 1,\n \"currency\": \"<string>\",\n \"images\": [\n {\n \"url\": \"<string>\",\n \"alt\": \"<string>\",\n \"position\": 0\n }\n ],\n \"options\": [\n {\n \"name\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"track_inventory\": true,\n \"status\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/dashboard/products/{product_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"vendor\": \"<string>\",\n \"product_type\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"price\": 1,\n \"compare_at_price\": 1,\n \"cost_per_item\": 1,\n \"currency\": \"<string>\",\n \"images\": [\n {\n \"url\": \"<string>\",\n \"alt\": \"<string>\",\n \"position\": 0\n }\n ],\n \"options\": [\n {\n \"name\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"track_inventory\": true,\n \"status\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"vendor": "<string>",
"product_type": "<string>",
"tags": [
"<string>"
],
"price": "<string>",
"compare_at_price": "<string>",
"cost_per_item": "<string>",
"currency": "<string>",
"images": [
{}
],
"has_variants": true,
"options": [
{}
],
"variants": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sku": "<string>",
"barcode": "<string>",
"option1": "<string>",
"option2": "<string>",
"option3": "<string>",
"price": "<string>",
"compare_at_price": "<string>",
"cost_per_item": "<string>",
"inventory_quantity": 123,
"inventory_policy": "<string>",
"low_stock_threshold": 123,
"weight": "<string>",
"weight_unit": "<string>",
"requires_shipping": true,
"image_url": "<string>",
"available": true,
"is_low_stock": true,
"is_out_of_stock": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"track_inventory": true,
"total_inventory": 123,
"in_stock": true,
"status": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Dashboard
Update Product
Update a product.
PUT
/
api
/
dashboard
/
products
/
{product_id}
Update Product
curl --request PUT \
--url https://api.example.com/api/dashboard/products/{product_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"vendor": "<string>",
"product_type": "<string>",
"tags": [
"<string>"
],
"price": 1,
"compare_at_price": 1,
"cost_per_item": 1,
"currency": "<string>",
"images": [
{
"url": "<string>",
"alt": "<string>",
"position": 0
}
],
"options": [
{
"name": "<string>",
"values": [
"<string>"
]
}
],
"track_inventory": true,
"status": "<string>"
}
'import requests
url = "https://api.example.com/api/dashboard/products/{product_id}"
payload = {
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"vendor": "<string>",
"product_type": "<string>",
"tags": ["<string>"],
"price": 1,
"compare_at_price": 1,
"cost_per_item": 1,
"currency": "<string>",
"images": [
{
"url": "<string>",
"alt": "<string>",
"position": 0
}
],
"options": [
{
"name": "<string>",
"values": ["<string>"]
}
],
"track_inventory": True,
"status": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
slug: '<string>',
description: '<string>',
vendor: '<string>',
product_type: '<string>',
tags: ['<string>'],
price: 1,
compare_at_price: 1,
cost_per_item: 1,
currency: '<string>',
images: [{url: '<string>', alt: '<string>', position: 0}],
options: [{name: '<string>', values: ['<string>']}],
track_inventory: true,
status: '<string>'
})
};
fetch('https://api.example.com/api/dashboard/products/{product_id}', 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://api.example.com/api/dashboard/products/{product_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'slug' => '<string>',
'description' => '<string>',
'vendor' => '<string>',
'product_type' => '<string>',
'tags' => [
'<string>'
],
'price' => 1,
'compare_at_price' => 1,
'cost_per_item' => 1,
'currency' => '<string>',
'images' => [
[
'url' => '<string>',
'alt' => '<string>',
'position' => 0
]
],
'options' => [
[
'name' => '<string>',
'values' => [
'<string>'
]
]
],
'track_inventory' => true,
'status' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/dashboard/products/{product_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"vendor\": \"<string>\",\n \"product_type\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"price\": 1,\n \"compare_at_price\": 1,\n \"cost_per_item\": 1,\n \"currency\": \"<string>\",\n \"images\": [\n {\n \"url\": \"<string>\",\n \"alt\": \"<string>\",\n \"position\": 0\n }\n ],\n \"options\": [\n {\n \"name\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"track_inventory\": true,\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.example.com/api/dashboard/products/{product_id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"vendor\": \"<string>\",\n \"product_type\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"price\": 1,\n \"compare_at_price\": 1,\n \"cost_per_item\": 1,\n \"currency\": \"<string>\",\n \"images\": [\n {\n \"url\": \"<string>\",\n \"alt\": \"<string>\",\n \"position\": 0\n }\n ],\n \"options\": [\n {\n \"name\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"track_inventory\": true,\n \"status\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/dashboard/products/{product_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"vendor\": \"<string>\",\n \"product_type\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"price\": 1,\n \"compare_at_price\": 1,\n \"cost_per_item\": 1,\n \"currency\": \"<string>\",\n \"images\": [\n {\n \"url\": \"<string>\",\n \"alt\": \"<string>\",\n \"position\": 0\n }\n ],\n \"options\": [\n {\n \"name\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"track_inventory\": true,\n \"status\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"vendor": "<string>",
"product_type": "<string>",
"tags": [
"<string>"
],
"price": "<string>",
"compare_at_price": "<string>",
"cost_per_item": "<string>",
"currency": "<string>",
"images": [
{}
],
"has_variants": true,
"options": [
{}
],
"variants": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sku": "<string>",
"barcode": "<string>",
"option1": "<string>",
"option2": "<string>",
"option3": "<string>",
"price": "<string>",
"compare_at_price": "<string>",
"cost_per_item": "<string>",
"inventory_quantity": 123,
"inventory_policy": "<string>",
"low_stock_threshold": 123,
"weight": "<string>",
"weight_unit": "<string>",
"requires_shipping": true,
"image_url": "<string>",
"available": true,
"is_low_stock": true,
"is_out_of_stock": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"track_inventory": true,
"total_inventory": 123,
"in_stock": true,
"status": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
Body
application/json
Schema for updating a product.
Maximum string length:
255Maximum string length:
255Maximum string length:
255Maximum string length:
255Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0Maximum string length:
3Show child attributes
Show child attributes
Show child attributes
Show child attributes
Pattern:
^(active|draft|archived)$Response
Successful Response
Schema for product in responses.
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Show child attributes
Show child attributes