curl --location --request POST 'https://api.stateset.com/v1/products/bulk-update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"updates": [
{
"id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"price": {
"amount": 11999
},
"tags": ["electronics", "audio", "sale", "clearance"]
},
{
"id": "prod_abc123def456",
"price": {
"amount": 6999
},
"inventory": {
"low_stock_threshold": 25
}
},
{
"id": "prod_xyz789ghi012",
"status": "archived"
}
]
}'
mutation BulkUpdateProducts($updates: [ProductUpdate!]!) {
bulkUpdateProducts(updates: $updates) {
updated {
id
name
sku
updated_at
}
errors {
product_id
error
}
summary {
total
successful
failed
}
}
}
const result = await stateset.products.bulkUpdate({
updates: [
{
id: "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
price: { amount: 11999 },
tags: ["electronics", "audio", "sale", "clearance"]
},
{
id: "prod_abc123def456",
price: { amount: 6999 },
inventory: { low_stock_threshold: 25 }
},
{
id: "prod_xyz789ghi012",
status: "archived"
}
]
});
result = stateset.products.bulk_update({
"updates": [
{
"id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"price": {"amount": 11999},
"tags": ["electronics", "audio", "sale", "clearance"]
},
{
"id": "prod_abc123def456",
"price": {"amount": 6999},
"inventory": {"low_stock_threshold": 25}
},
{
"id": "prod_xyz789ghi012",
"status": "archived"
}
]
})
{
"updated": [
{
"id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"name": "Wireless Bluetooth Headphones",
"sku": "WBH-001",
"updated_at": "2024-01-15T17:30:00Z"
},
{
"id": "prod_abc123def456",
"name": "Sport Wireless Earbuds",
"sku": "SWE-001",
"updated_at": "2024-01-15T17:30:00Z"
}
],
"errors": [
{
"product_id": "prod_xyz789ghi012",
"error": "Product not found"
}
],
"summary": {
"total": 3,
"successful": 2,
"failed": 1
}
}
Bulk Update Products
Update multiple products in a single request
POST
/
v1
/
products
/
bulk-update
curl --location --request POST 'https://api.stateset.com/v1/products/bulk-update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"updates": [
{
"id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"price": {
"amount": 11999
},
"tags": ["electronics", "audio", "sale", "clearance"]
},
{
"id": "prod_abc123def456",
"price": {
"amount": 6999
},
"inventory": {
"low_stock_threshold": 25
}
},
{
"id": "prod_xyz789ghi012",
"status": "archived"
}
]
}'
mutation BulkUpdateProducts($updates: [ProductUpdate!]!) {
bulkUpdateProducts(updates: $updates) {
updated {
id
name
sku
updated_at
}
errors {
product_id
error
}
summary {
total
successful
failed
}
}
}
const result = await stateset.products.bulkUpdate({
updates: [
{
id: "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
price: { amount: 11999 },
tags: ["electronics", "audio", "sale", "clearance"]
},
{
id: "prod_abc123def456",
price: { amount: 6999 },
inventory: { low_stock_threshold: 25 }
},
{
id: "prod_xyz789ghi012",
status: "archived"
}
]
});
result = stateset.products.bulk_update({
"updates": [
{
"id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"price": {"amount": 11999},
"tags": ["electronics", "audio", "sale", "clearance"]
},
{
"id": "prod_abc123def456",
"price": {"amount": 6999},
"inventory": {"low_stock_threshold": 25}
},
{
"id": "prod_xyz789ghi012",
"status": "archived"
}
]
})
{
"updated": [
{
"id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"name": "Wireless Bluetooth Headphones",
"sku": "WBH-001",
"updated_at": "2024-01-15T17:30:00Z"
},
{
"id": "prod_abc123def456",
"name": "Sport Wireless Earbuds",
"sku": "SWE-001",
"updated_at": "2024-01-15T17:30:00Z"
}
],
"errors": [
{
"product_id": "prod_xyz789ghi012",
"error": "Product not found"
}
],
"summary": {
"total": 3,
"successful": 2,
"failed": 1
}
}
This endpoint allows updating up to 100 products in a single request. Use this for bulk price changes, inventory updates, or status changes.
Request Body
array
required
boolean
If true, validates the updates without applying them (default: false)
Response
array
Successfully updated products
array
Products that failed to update with error details
object
curl --location --request POST 'https://api.stateset.com/v1/products/bulk-update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"updates": [
{
"id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"price": {
"amount": 11999
},
"tags": ["electronics", "audio", "sale", "clearance"]
},
{
"id": "prod_abc123def456",
"price": {
"amount": 6999
},
"inventory": {
"low_stock_threshold": 25
}
},
{
"id": "prod_xyz789ghi012",
"status": "archived"
}
]
}'
mutation BulkUpdateProducts($updates: [ProductUpdate!]!) {
bulkUpdateProducts(updates: $updates) {
updated {
id
name
sku
updated_at
}
errors {
product_id
error
}
summary {
total
successful
failed
}
}
}
const result = await stateset.products.bulkUpdate({
updates: [
{
id: "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
price: { amount: 11999 },
tags: ["electronics", "audio", "sale", "clearance"]
},
{
id: "prod_abc123def456",
price: { amount: 6999 },
inventory: { low_stock_threshold: 25 }
},
{
id: "prod_xyz789ghi012",
status: "archived"
}
]
});
result = stateset.products.bulk_update({
"updates": [
{
"id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"price": {"amount": 11999},
"tags": ["electronics", "audio", "sale", "clearance"]
},
{
"id": "prod_abc123def456",
"price": {"amount": 6999},
"inventory": {"low_stock_threshold": 25}
},
{
"id": "prod_xyz789ghi012",
"status": "archived"
}
]
})
{
"updated": [
{
"id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"name": "Wireless Bluetooth Headphones",
"sku": "WBH-001",
"updated_at": "2024-01-15T17:30:00Z"
},
{
"id": "prod_abc123def456",
"name": "Sport Wireless Earbuds",
"sku": "SWE-001",
"updated_at": "2024-01-15T17:30:00Z"
}
],
"errors": [
{
"product_id": "prod_xyz789ghi012",
"error": "Product not found"
}
],
"summary": {
"total": 3,
"successful": 2,
"failed": 1
}
}
โI