Bulk update variants.
curl --request POST \
--url https://api.platformdtc.com/api/v1/agent/v1/products/variants/bulk_update \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Agent-Key: <api-key>' \
--data '
{
"variants": [
{
"id": "01J8…",
"price": "24.99",
"compare_at_price": "29.99"
},
{
"id": "01J9…",
"price": "19.00",
"compare_at_price": null
}
]
}
'import requests
url = "https://api.platformdtc.com/api/v1/agent/v1/products/variants/bulk_update"
payload = { "variants": [
{
"id": "01J8…",
"price": "24.99",
"compare_at_price": "29.99"
},
{
"id": "01J9…",
"price": "19.00",
"compare_at_price": None
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Agent-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Agent-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
variants: [
{id: '01J8…', price: '24.99', compare_at_price: '29.99'},
{id: '01J9…', price: '19.00', compare_at_price: null}
]
})
};
fetch('https://api.platformdtc.com/api/v1/agent/v1/products/variants/bulk_update', 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/bulk_update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variants' => [
[
'id' => '01J8…',
'price' => '24.99',
'compare_at_price' => '29.99'
],
[
'id' => '01J9…',
'price' => '19.00',
'compare_at_price' => null
]
]
]),
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/variants/bulk_update"
payload := strings.NewReader("{\n \"variants\": [\n {\n \"id\": \"01J8…\",\n \"price\": \"24.99\",\n \"compare_at_price\": \"29.99\"\n },\n {\n \"id\": \"01J9…\",\n \"price\": \"19.00\",\n \"compare_at_price\": null\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.platformdtc.com/api/v1/agent/v1/products/variants/bulk_update")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Agent-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"variants\": [\n {\n \"id\": \"01J8…\",\n \"price\": \"24.99\",\n \"compare_at_price\": \"29.99\"\n },\n {\n \"id\": \"01J9…\",\n \"price\": \"19.00\",\n \"compare_at_price\": null\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platformdtc.com/api/v1/agent/v1/products/variants/bulk_update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Agent-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"variants\": [\n {\n \"id\": \"01J8…\",\n \"price\": \"24.99\",\n \"compare_at_price\": \"29.99\"\n },\n {\n \"id\": \"01J9…\",\n \"price\": \"19.00\",\n \"compare_at_price\": null\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"results": [
{
"id": "<string>",
"status": "updated",
"variant": {
"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"
},
"error": {
"code": "not_found",
"message": "<string>"
}
}
],
"updated_count": 123,
"failed_count": 123
},
"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": {}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {}
}products
Bulk update variants.
Each variant is validated and written in its own transaction, with the same rules as PATCH /products/variants/{variant_id} (for example, compare-at must be higher than price). One variant failing does not roll back the others: read data.results[] even on 200. Emits one products/update webhook per product touched and one storefront refresh. Counts as one request against your rate limit. A replay with the same Idempotency-Key and body returns the first response.
POST
/
products
/
variants
/
bulk_update
Bulk update variants.
curl --request POST \
--url https://api.platformdtc.com/api/v1/agent/v1/products/variants/bulk_update \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Agent-Key: <api-key>' \
--data '
{
"variants": [
{
"id": "01J8…",
"price": "24.99",
"compare_at_price": "29.99"
},
{
"id": "01J9…",
"price": "19.00",
"compare_at_price": null
}
]
}
'import requests
url = "https://api.platformdtc.com/api/v1/agent/v1/products/variants/bulk_update"
payload = { "variants": [
{
"id": "01J8…",
"price": "24.99",
"compare_at_price": "29.99"
},
{
"id": "01J9…",
"price": "19.00",
"compare_at_price": None
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Agent-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Agent-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
variants: [
{id: '01J8…', price: '24.99', compare_at_price: '29.99'},
{id: '01J9…', price: '19.00', compare_at_price: null}
]
})
};
fetch('https://api.platformdtc.com/api/v1/agent/v1/products/variants/bulk_update', 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/bulk_update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variants' => [
[
'id' => '01J8…',
'price' => '24.99',
'compare_at_price' => '29.99'
],
[
'id' => '01J9…',
'price' => '19.00',
'compare_at_price' => null
]
]
]),
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/variants/bulk_update"
payload := strings.NewReader("{\n \"variants\": [\n {\n \"id\": \"01J8…\",\n \"price\": \"24.99\",\n \"compare_at_price\": \"29.99\"\n },\n {\n \"id\": \"01J9…\",\n \"price\": \"19.00\",\n \"compare_at_price\": null\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.platformdtc.com/api/v1/agent/v1/products/variants/bulk_update")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Agent-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"variants\": [\n {\n \"id\": \"01J8…\",\n \"price\": \"24.99\",\n \"compare_at_price\": \"29.99\"\n },\n {\n \"id\": \"01J9…\",\n \"price\": \"19.00\",\n \"compare_at_price\": null\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platformdtc.com/api/v1/agent/v1/products/variants/bulk_update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Agent-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"variants\": [\n {\n \"id\": \"01J8…\",\n \"price\": \"24.99\",\n \"compare_at_price\": \"29.99\"\n },\n {\n \"id\": \"01J9…\",\n \"price\": \"19.00\",\n \"compare_at_price\": null\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"results": [
{
"id": "<string>",
"status": "updated",
"variant": {
"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"
},
"error": {
"code": "not_found",
"message": "<string>"
}
}
],
"updated_count": 123,
"failed_count": 123
},
"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": {}
}{
"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.
Body
application/json
Unique variant ids.
Required array length:
1 - 250 elementsShow child attributes
Show child attributes