Update a product.
curl --request PUT \
--url https://api.platformdtc.com/api/v1/agent/v1/products/{product_id} \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Agent-Key: <api-key>' \
--data '
{
"title": "<string>",
"handle": "<string>",
"product_type": "<string>",
"vendor": "<string>",
"tags": [
"<string>"
],
"price": "19.99",
"description": "<string>",
"category": "<string>"
}
'import requests
url = "https://api.platformdtc.com/api/v1/agent/v1/products/{product_id}"
payload = {
"title": "<string>",
"handle": "<string>",
"product_type": "<string>",
"vendor": "<string>",
"tags": ["<string>"],
"price": "19.99",
"description": "<string>",
"category": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Agent-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Agent-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: '<string>',
handle: '<string>',
product_type: '<string>',
vendor: '<string>',
tags: ['<string>'],
price: '19.99',
description: '<string>',
category: '<string>'
})
};
fetch('https://api.platformdtc.com/api/v1/agent/v1/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.platformdtc.com/api/v1/agent/v1/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([
'title' => '<string>',
'handle' => '<string>',
'product_type' => '<string>',
'vendor' => '<string>',
'tags' => [
'<string>'
],
'price' => '19.99',
'description' => '<string>',
'category' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Agent-Key: <api-key>"
],
]);
$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.platformdtc.com/api/v1/agent/v1/products/{product_id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"product_type\": \"<string>\",\n \"vendor\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"price\": \"19.99\",\n \"description\": \"<string>\",\n \"category\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Agent-Key", "<api-key>")
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.platformdtc.com/api/v1/agent/v1/products/{product_id}")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Agent-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"product_type\": \"<string>\",\n \"vendor\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"price\": \"19.99\",\n \"description\": \"<string>\",\n \"category\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platformdtc.com/api/v1/agent/v1/products/{product_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Agent-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"product_type\": \"<string>\",\n \"vendor\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"price\": \"19.99\",\n \"description\": \"<string>\",\n \"category\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"id": "<string>",
"store_id": "<string>",
"title": "<string>",
"handle": "<string>",
"product_type": "<string>",
"vendor": "<string>",
"tags": [
"<string>"
],
"options": [
"<string>"
],
"status": 0,
"status_label": "draft",
"price": "19.99",
"currency": "USD",
"image_url": "<string>",
"images": [
{
"id": "<string>",
"url": "<string>",
"width": "<string>",
"height": "<string>"
}
],
"link": "<string>",
"template_suffix": "<string>",
"is_published": true,
"variants_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"variants": [
{
"id": "<string>",
"product_id": "<string>",
"title": "<string>",
"sku": "<string>",
"price": "19.99",
"compare_at_price": "19.99",
"option1": "<string>",
"option2": "<string>",
"option3": "<string>",
"position": 123,
"weight": 123,
"weight_unit": "<string>",
"image_url": "<string>",
"inventory_quantity": 123,
"inventory_tracked": true,
"inventory_policy": "continue",
"created_at": "2023-11-07T05:31:56Z"
}
],
"description": "<string>",
"category": "<string>"
},
"meta": {}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {}
}products
Update a product.
PUT
/
products
/
{product_id}
Update a product.
curl --request PUT \
--url https://api.platformdtc.com/api/v1/agent/v1/products/{product_id} \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Agent-Key: <api-key>' \
--data '
{
"title": "<string>",
"handle": "<string>",
"product_type": "<string>",
"vendor": "<string>",
"tags": [
"<string>"
],
"price": "19.99",
"description": "<string>",
"category": "<string>"
}
'import requests
url = "https://api.platformdtc.com/api/v1/agent/v1/products/{product_id}"
payload = {
"title": "<string>",
"handle": "<string>",
"product_type": "<string>",
"vendor": "<string>",
"tags": ["<string>"],
"price": "19.99",
"description": "<string>",
"category": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Agent-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Agent-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: '<string>',
handle: '<string>',
product_type: '<string>',
vendor: '<string>',
tags: ['<string>'],
price: '19.99',
description: '<string>',
category: '<string>'
})
};
fetch('https://api.platformdtc.com/api/v1/agent/v1/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.platformdtc.com/api/v1/agent/v1/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([
'title' => '<string>',
'handle' => '<string>',
'product_type' => '<string>',
'vendor' => '<string>',
'tags' => [
'<string>'
],
'price' => '19.99',
'description' => '<string>',
'category' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Agent-Key: <api-key>"
],
]);
$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.platformdtc.com/api/v1/agent/v1/products/{product_id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"product_type\": \"<string>\",\n \"vendor\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"price\": \"19.99\",\n \"description\": \"<string>\",\n \"category\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Agent-Key", "<api-key>")
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.platformdtc.com/api/v1/agent/v1/products/{product_id}")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Agent-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"product_type\": \"<string>\",\n \"vendor\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"price\": \"19.99\",\n \"description\": \"<string>\",\n \"category\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platformdtc.com/api/v1/agent/v1/products/{product_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Agent-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"product_type\": \"<string>\",\n \"vendor\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"price\": \"19.99\",\n \"description\": \"<string>\",\n \"category\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"id": "<string>",
"store_id": "<string>",
"title": "<string>",
"handle": "<string>",
"product_type": "<string>",
"vendor": "<string>",
"tags": [
"<string>"
],
"options": [
"<string>"
],
"status": 0,
"status_label": "draft",
"price": "19.99",
"currency": "USD",
"image_url": "<string>",
"images": [
{
"id": "<string>",
"url": "<string>",
"width": "<string>",
"height": "<string>"
}
],
"link": "<string>",
"template_suffix": "<string>",
"is_published": true,
"variants_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"variants": [
{
"id": "<string>",
"product_id": "<string>",
"title": "<string>",
"sku": "<string>",
"price": "19.99",
"compare_at_price": "19.99",
"option1": "<string>",
"option2": "<string>",
"option3": "<string>",
"position": 123,
"weight": 123,
"weight_unit": "<string>",
"image_url": "<string>",
"inventory_quantity": 123,
"inventory_tracked": true,
"inventory_policy": "continue",
"created_at": "2023-11-07T05:31:56Z"
}
],
"description": "<string>",
"category": "<string>"
},
"meta": {}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {}
}Authorizations
Service-account key, format sq_agt_*. Carries least-privilege scopes.
Headers
Unique per logical operation; identical key+body returns the cached response, different body → 409.
Maximum string length:
200Target store; required when the key is bound to multiple stores.
Path Parameters
Body
application/json
Amount in major units as a decimal string (preferred) or a number. At most two decimals; negative values are rejected (422).
Example:
"19.99"
Case-insensitive.
Available options:
DRAFT, ACTIVE, ARCHIVED