Update
curl --request PATCH \
--url https://{defaultHost}/v1/products/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product": {
"name": "Updated Product",
"dimensions": {
"length": 20,
"width": 10,
"height": 5,
"unit": "in"
},
"hs_code": "6109.10",
"country_of_origin": "US",
"manufacturer_code": "ACME-TS"
}
}
'import requests
url = "https://{defaultHost}/v1/products/{id}"
payload = { "product": {
"name": "Updated Product",
"dimensions": {
"length": 20,
"width": 10,
"height": 5,
"unit": "in"
},
"hs_code": "6109.10",
"country_of_origin": "US",
"manufacturer_code": "ACME-TS"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product: {
name: 'Updated Product',
dimensions: {length: 20, width: 10, height: 5, unit: 'in'},
hs_code: '6109.10',
country_of_origin: 'US',
manufacturer_code: 'ACME-TS'
}
})
};
fetch('https://{defaultHost}/v1/products/{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://{defaultHost}/v1/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'product' => [
'name' => 'Updated Product',
'dimensions' => [
'length' => 20,
'width' => 10,
'height' => 5,
'unit' => 'in'
],
'hs_code' => '6109.10',
'country_of_origin' => 'US',
'manufacturer_code' => 'ACME-TS'
]
]),
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://{defaultHost}/v1/products/{id}"
payload := strings.NewReader("{\n \"product\": {\n \"name\": \"Updated Product\",\n \"dimensions\": {\n \"length\": 20,\n \"width\": 10,\n \"height\": 5,\n \"unit\": \"in\"\n },\n \"hs_code\": \"6109.10\",\n \"country_of_origin\": \"US\",\n \"manufacturer_code\": \"ACME-TS\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://{defaultHost}/v1/products/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product\": {\n \"name\": \"Updated Product\",\n \"dimensions\": {\n \"length\": 20,\n \"width\": 10,\n \"height\": 5,\n \"unit\": \"in\"\n },\n \"hs_code\": \"6109.10\",\n \"country_of_origin\": \"US\",\n \"manufacturer_code\": \"ACME-TS\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product\": {\n \"name\": \"Updated Product\",\n \"dimensions\": {\n \"length\": 20,\n \"width\": 10,\n \"height\": 5,\n \"unit\": \"in\"\n },\n \"hs_code\": \"6109.10\",\n \"country_of_origin\": \"US\",\n \"manufacturer_code\": \"ACME-TS\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "ab3a12b1-8586-4cb9-a0df-eeee68c13db0",
"object": "product",
"allow_out_of_stock_purchases": false,
"archived": false,
"archived_at": null,
"auto_fulfill_enabled": false,
"available_stock": 0,
"average_stars": "0.0",
"bundle": false,
"description": null,
"dimensions": {
"length": 20,
"width": 10,
"height": 5,
"unit": "in"
},
"held_stock": 0,
"featured": false,
"licensing_enabled": false,
"license_activation_limit": null,
"metadata": {},
"purchase_limit": null,
"metrics": {
"currency": "usd",
"max_price_amount": 2900,
"min_price_amount": 2900,
"prices_count": 1
},
"name": "Updated Product",
"recurring": true,
"reviews_breakdown": {},
"reviews_enabled": true,
"shipping_enabled": false,
"sku": null,
"slug": "test-product",
"solicit_reviews": true,
"status": "draft",
"stock": 0,
"stock_enabled": false,
"tax_enabled": false,
"tax_category": "tangible",
"hs_code": "6109.10",
"country_of_origin": "US",
"manufacturer_code": "ACME-TS",
"weight": 0,
"weight_unit": "lb",
"commission_structure": null,
"featured_product_media": null,
"product_group": null,
"current_release_download": null,
"shipping_profile": null,
"cataloged_at": 1793796939,
"discarded_at": null,
"created_at": 1793796939,
"updated_at": 1793796939
}Products
Update
Updates a specific product.
PATCH
/
v1
/
products
/
{id}
Update
curl --request PATCH \
--url https://{defaultHost}/v1/products/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product": {
"name": "Updated Product",
"dimensions": {
"length": 20,
"width": 10,
"height": 5,
"unit": "in"
},
"hs_code": "6109.10",
"country_of_origin": "US",
"manufacturer_code": "ACME-TS"
}
}
'import requests
url = "https://{defaultHost}/v1/products/{id}"
payload = { "product": {
"name": "Updated Product",
"dimensions": {
"length": 20,
"width": 10,
"height": 5,
"unit": "in"
},
"hs_code": "6109.10",
"country_of_origin": "US",
"manufacturer_code": "ACME-TS"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product: {
name: 'Updated Product',
dimensions: {length: 20, width: 10, height: 5, unit: 'in'},
hs_code: '6109.10',
country_of_origin: 'US',
manufacturer_code: 'ACME-TS'
}
})
};
fetch('https://{defaultHost}/v1/products/{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://{defaultHost}/v1/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'product' => [
'name' => 'Updated Product',
'dimensions' => [
'length' => 20,
'width' => 10,
'height' => 5,
'unit' => 'in'
],
'hs_code' => '6109.10',
'country_of_origin' => 'US',
'manufacturer_code' => 'ACME-TS'
]
]),
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://{defaultHost}/v1/products/{id}"
payload := strings.NewReader("{\n \"product\": {\n \"name\": \"Updated Product\",\n \"dimensions\": {\n \"length\": 20,\n \"width\": 10,\n \"height\": 5,\n \"unit\": \"in\"\n },\n \"hs_code\": \"6109.10\",\n \"country_of_origin\": \"US\",\n \"manufacturer_code\": \"ACME-TS\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://{defaultHost}/v1/products/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product\": {\n \"name\": \"Updated Product\",\n \"dimensions\": {\n \"length\": 20,\n \"width\": 10,\n \"height\": 5,\n \"unit\": \"in\"\n },\n \"hs_code\": \"6109.10\",\n \"country_of_origin\": \"US\",\n \"manufacturer_code\": \"ACME-TS\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product\": {\n \"name\": \"Updated Product\",\n \"dimensions\": {\n \"length\": 20,\n \"width\": 10,\n \"height\": 5,\n \"unit\": \"in\"\n },\n \"hs_code\": \"6109.10\",\n \"country_of_origin\": \"US\",\n \"manufacturer_code\": \"ACME-TS\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "ab3a12b1-8586-4cb9-a0df-eeee68c13db0",
"object": "product",
"allow_out_of_stock_purchases": false,
"archived": false,
"archived_at": null,
"auto_fulfill_enabled": false,
"available_stock": 0,
"average_stars": "0.0",
"bundle": false,
"description": null,
"dimensions": {
"length": 20,
"width": 10,
"height": 5,
"unit": "in"
},
"held_stock": 0,
"featured": false,
"licensing_enabled": false,
"license_activation_limit": null,
"metadata": {},
"purchase_limit": null,
"metrics": {
"currency": "usd",
"max_price_amount": 2900,
"min_price_amount": 2900,
"prices_count": 1
},
"name": "Updated Product",
"recurring": true,
"reviews_breakdown": {},
"reviews_enabled": true,
"shipping_enabled": false,
"sku": null,
"slug": "test-product",
"solicit_reviews": true,
"status": "draft",
"stock": 0,
"stock_enabled": false,
"tax_enabled": false,
"tax_category": "tangible",
"hs_code": "6109.10",
"country_of_origin": "US",
"manufacturer_code": "ACME-TS",
"weight": 0,
"weight_unit": "lb",
"commission_structure": null,
"featured_product_media": null,
"product_group": null,
"current_release_download": null,
"shipping_profile": null,
"cataloged_at": 1793796939,
"discarded_at": null,
"created_at": 1793796939,
"updated_at": 1793796939
}Authorizations
Response
200 - application/json
Success
Expandable – Property not returned unless expanded.
Expandable – The associated commission structure ID.
Expandable – The associated download ID.
Expandable – Property not returned unless expanded.
The featured (first) product media.
Expandable – The associated product media ID.
Expandable – Property not returned unless expanded.
Expandable – Property not returned unless expanded.
Expandable – The associated product group ID.
Expandable – Property not returned unless expanded.
Expandable – The associated shipping profile ID.
Expandable – Property not returned unless expanded.
Expandable – Property not returned unless expanded.
Expandable – Property not returned unless expanded.
Was this page helpful?