Products
Bulk price & stock
Up to 100 changes per call. Each line uses id, external_id or barcode (or addon_id / addon_external_id), and reports its own result.
POST
/
items
/
batch
Update many items
curl --request POST \
--url https://staging2.xfaster.net/api/partner/v1/items/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"changes": [
{
"barcode": "7290000066318",
"price": 590,
"stock": 40
},
{
"external_id": "BURG-SMASH",
"available": false
},
{
"addon_external_id": "ADD-CHEDDAR",
"available": false
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
changes: [
{barcode: '7290000066318', price: 590, stock: 40},
{external_id: 'BURG-SMASH', available: false},
{addon_external_id: 'ADD-CHEDDAR', available: false}
]
})
};
fetch('https://staging2.xfaster.net/api/partner/v1/items/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://staging2.xfaster.net/api/partner/v1/items/batch"
payload = { "changes": [
{
"barcode": "7290000066318",
"price": 590,
"stock": 40
},
{
"external_id": "BURG-SMASH",
"available": False
},
{
"addon_external_id": "ADD-CHEDDAR",
"available": False
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging2.xfaster.net/api/partner/v1/items/batch",
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([
'changes' => [
[
'barcode' => '7290000066318',
'price' => 590,
'stock' => 40
],
[
'external_id' => 'BURG-SMASH',
'available' => false
],
[
'addon_external_id' => 'ADD-CHEDDAR',
'available' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"results": [
{
"ok": true
},
{
"ok": true
},
{
"ok": false,
"error": {
"code": "not_found",
"message": "No item of this store matches this change."
}
}
]
}Authorizations
apiKeyapiKey & storeHeader
The store's API key (xfp_test_… on the sandbox, xfp_live_… on live). XFaster creates it and shows it once. An integrator key (one key for a POS company) also sends X-XFaster-Store.
Headers
Any unique string. Repeating a request with the same key within 24 hours returns the first answer instead of acting twice.
Example:
"5f0c3d1e-8b6a-4e1f-9c2d-7a1b0e4f6d21"
Body
application/json
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
Response
200 - application/json
One result per line
⌘I
Update many items
curl --request POST \
--url https://staging2.xfaster.net/api/partner/v1/items/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"changes": [
{
"barcode": "7290000066318",
"price": 590,
"stock": 40
},
{
"external_id": "BURG-SMASH",
"available": false
},
{
"addon_external_id": "ADD-CHEDDAR",
"available": false
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
changes: [
{barcode: '7290000066318', price: 590, stock: 40},
{external_id: 'BURG-SMASH', available: false},
{addon_external_id: 'ADD-CHEDDAR', available: false}
]
})
};
fetch('https://staging2.xfaster.net/api/partner/v1/items/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://staging2.xfaster.net/api/partner/v1/items/batch"
payload = { "changes": [
{
"barcode": "7290000066318",
"price": 590,
"stock": 40
},
{
"external_id": "BURG-SMASH",
"available": False
},
{
"addon_external_id": "ADD-CHEDDAR",
"available": False
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging2.xfaster.net/api/partner/v1/items/batch",
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([
'changes' => [
[
'barcode' => '7290000066318',
'price' => 590,
'stock' => 40
],
[
'external_id' => 'BURG-SMASH',
'available' => false
],
[
'addon_external_id' => 'ADD-CHEDDAR',
'available' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"results": [
{
"ok": true
},
{
"ok": true
},
{
"ok": false,
"error": {
"code": "not_found",
"message": "No item of this store matches this change."
}
}
]
}