API to bulk update products (price, availability, collections, delete)
POST https://services.leadconnectorhq.com/products/bulk-update
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.
Body
altId
string
default:"6578278e879ad2646715ba9c"
required
Account Id or Agency Id
Posibles valores: ‘account’
type
string
default:"bulk-update-price"
required
Type of bulk update operation Posibles valores: ‘bulk-update-price’, ‘bulk-update-availability’, ‘bulk-update-product-collection’, ‘bulk-delete-products’, ‘bulk-update-currency’
Filters to apply when selectAll is true
Price update configuration
Compare at price update configuration
Respuestas
201 - Products updated successfully
status
boolean
default:"True"
required
Status of api action
message
string
default:"Successfully created"
Success message
{
"status": true,
"message": "Successfully created"
}
422 - Unprocessable Entity
Ejemplo
curl -X POST 'https://services.leadconnectorhq.com/products/bulk-update' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"type": "bulk-update-price",
"productIds": [
"5f8d0d55b54764421b7156c1"
],
"availability": true,
"collectionIds": [
"string"
],
"currency": "USD"
}'
const response = await fetch('https://services.leadconnectorhq.com/products/bulk-update', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "type": "bulk-update-price", "productIds": ["5f8d0d55b54764421b7156c1"], "availability": true, "collectionIds": ["string"], "currency": "USD"}),
});
const data = await response.json();
import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/products/bulk-update',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "type": "bulk-update-price", "productIds": ["5f8d0d55b54764421b7156c1"], "availability": true, "collectionIds": ["string"], "currency": "USD"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/products/bulk-update');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'account', 'type': 'bulk-update-price', 'productIds': ['5f8d0d55b54764421b7156c1'], 'availability': true, 'collectionIds': ['string'], 'currency': 'USD'}),
]);
$data = json_decode(curl_exec($ch), true);