Create or update up to 200 product relations
curl --request POST \
--url https://wisepim.com/api/public/v1/product-relations/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"relation_type": "<string>",
"position": 1073741823,
"quantity": 1,
"is_required": true,
"product": 4611686018427388000,
"product_sku": "<string>",
"related_product": 4611686018427388000,
"related_product_sku": "<string>"
}
]
}
'import requests
url = "https://wisepim.com/api/public/v1/product-relations/batch"
payload = { "items": [
{
"relation_type": "<string>",
"position": 1073741823,
"quantity": 1,
"is_required": True,
"product": 4611686018427388000,
"product_sku": "<string>",
"related_product": 4611686018427388000,
"related_product_sku": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
relation_type: '<string>',
position: 1073741823,
quantity: 1,
is_required: true,
product: 4611686018427388000,
product_sku: '<string>',
related_product: 4611686018427388000,
related_product_sku: '<string>'
}
]
})
};
fetch('https://wisepim.com/api/public/v1/product-relations/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"results": [
{
"index": 123,
"id": 123,
"action": "<string>"
}
],
"summary": {}
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"errors": [
{}
],
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}Batch upsert product relations
POST /product-relations/batch: create or update up to 200 relations atomically, by id or SKU, optionally replacing a product’s relations of a type. Requires product-relations:write.
POST
/
api
/
public
/
v1
/
product-relations
/
batch
Create or update up to 200 product relations
curl --request POST \
--url https://wisepim.com/api/public/v1/product-relations/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"relation_type": "<string>",
"position": 1073741823,
"quantity": 1,
"is_required": true,
"product": 4611686018427388000,
"product_sku": "<string>",
"related_product": 4611686018427388000,
"related_product_sku": "<string>"
}
]
}
'import requests
url = "https://wisepim.com/api/public/v1/product-relations/batch"
payload = { "items": [
{
"relation_type": "<string>",
"position": 1073741823,
"quantity": 1,
"is_required": True,
"product": 4611686018427388000,
"product_sku": "<string>",
"related_product": 4611686018427388000,
"related_product_sku": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
relation_type: '<string>',
position: 1073741823,
quantity: 1,
is_required: true,
product: 4611686018427388000,
product_sku: '<string>',
related_product: 4611686018427388000,
related_product_sku: '<string>'
}
]
})
};
fetch('https://wisepim.com/api/public/v1/product-relations/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"results": [
{
"index": 123,
"id": 123,
"action": "<string>"
}
],
"summary": {}
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"errors": [
{}
],
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}Authorizations
Use a project API key from Settings > API Access. Send it as Authorization: Bearer wpk_.... See authentication and scopes for setup and permissions.
Headers
Body
application/json

