Update one variant.
curl --request PATCH \
--url https://api.platformdtc.com/api/v1/agent/v1/products/variants/{variant_id} \
--header 'Content-Type: application/json' \
--header 'X-Agent-Key: <api-key>' \
--data '
{
"price": "19.99",
"compare_at_price": "19.99",
"sku": "<string>",
"title": "<string>",
"inventory_quantity": 1,
"inventory_tracked": true
}
'import requests
url = "https://api.platformdtc.com/api/v1/agent/v1/products/variants/{variant_id}"
payload = {
"price": "19.99",
"compare_at_price": "19.99",
"sku": "<string>",
"title": "<string>",
"inventory_quantity": 1,
"inventory_tracked": True
}
headers = {
"X-Agent-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Agent-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
price: '19.99',
compare_at_price: '19.99',
sku: '<string>',
title: '<string>',
inventory_quantity: 1,
inventory_tracked: true
})
};
fetch('https://api.platformdtc.com/api/v1/agent/v1/products/variants/{variant_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/variants/{variant_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([
'price' => '19.99',
'compare_at_price' => '19.99',
'sku' => '<string>',
'title' => '<string>',
'inventory_quantity' => 1,
'inventory_tracked' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/variants/{variant_id}"
payload := strings.NewReader("{\n \"price\": \"19.99\",\n \"compare_at_price\": \"19.99\",\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"inventory_quantity\": 1,\n \"inventory_tracked\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://api.platformdtc.com/api/v1/agent/v1/products/variants/{variant_id}")
.header("X-Agent-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"price\": \"19.99\",\n \"compare_at_price\": \"19.99\",\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"inventory_quantity\": 1,\n \"inventory_tracked\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platformdtc.com/api/v1/agent/v1/products/variants/{variant_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Agent-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"price\": \"19.99\",\n \"compare_at_price\": \"19.99\",\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"inventory_quantity\": 1,\n \"inventory_tracked\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"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"
},
"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 one variant.
Send only the fields to change. Money as decimal strings; compare_at_price null ends a sale.
PATCH
/
products
/
variants
/
{variant_id}
Update one variant.
curl --request PATCH \
--url https://api.platformdtc.com/api/v1/agent/v1/products/variants/{variant_id} \
--header 'Content-Type: application/json' \
--header 'X-Agent-Key: <api-key>' \
--data '
{
"price": "19.99",
"compare_at_price": "19.99",
"sku": "<string>",
"title": "<string>",
"inventory_quantity": 1,
"inventory_tracked": true
}
'import requests
url = "https://api.platformdtc.com/api/v1/agent/v1/products/variants/{variant_id}"
payload = {
"price": "19.99",
"compare_at_price": "19.99",
"sku": "<string>",
"title": "<string>",
"inventory_quantity": 1,
"inventory_tracked": True
}
headers = {
"X-Agent-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Agent-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
price: '19.99',
compare_at_price: '19.99',
sku: '<string>',
title: '<string>',
inventory_quantity: 1,
inventory_tracked: true
})
};
fetch('https://api.platformdtc.com/api/v1/agent/v1/products/variants/{variant_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/variants/{variant_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([
'price' => '19.99',
'compare_at_price' => '19.99',
'sku' => '<string>',
'title' => '<string>',
'inventory_quantity' => 1,
'inventory_tracked' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/variants/{variant_id}"
payload := strings.NewReader("{\n \"price\": \"19.99\",\n \"compare_at_price\": \"19.99\",\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"inventory_quantity\": 1,\n \"inventory_tracked\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://api.platformdtc.com/api/v1/agent/v1/products/variants/{variant_id}")
.header("X-Agent-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"price\": \"19.99\",\n \"compare_at_price\": \"19.99\",\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"inventory_quantity\": 1,\n \"inventory_tracked\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platformdtc.com/api/v1/agent/v1/products/variants/{variant_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Agent-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"price\": \"19.99\",\n \"compare_at_price\": \"19.99\",\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"inventory_quantity\": 1,\n \"inventory_tracked\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"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"
},
"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
Optional on the products domain API — absent, the request simply executes. When present, a replay with the same body returns the cached response and a different body returns 409. Send it on every write anyway.
Maximum string length:
200Target store; required when the key is bound to multiple stores.
Path Parameters
Body
application/json
Send only the fields to change.
Amount in major units as a decimal string (preferred) or a number. At most two decimals; negative values are rejected (422).
Example:
"19.99"
Must be higher than price. null ends a sale.
Example:
"19.99"
Required range:
x >= 0Available options:
continue, deny