Skip to main content
The Update Inventory API allows the user to bulk update the inventory for multiple items. Use this endpoint to update the available quantity and out-of-stock purchase settings for multiple items in the inventory.
POST https://services.leadconnectorhq.com/products/inventory

Autorización

Authorization
string
required
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
altType
string
required
Posibles valores: ‘account’
items
object[]
required
Array of items to update in the inventory.

Respuestas

status
boolean
default:"True"
required
Status of api action
message
string
default:"Successfully created"
Success message
{
  "status": true,
  "message": "Successfully created"
}
{}
{}
{}

Ejemplo

curl -X POST 'https://services.leadconnectorhq.com/products/inventory' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "altId": "6578278e879ad2646715ba9c",
  "altType": "account",
  "items": [
    {
      "priceId": "5e9f8f8f8f8f8f8f8f8f8f8",
      "availableQuantity": 10,
      "allowOutOfStockPurchases": false
    }
  ]
}'
const response = await fetch('https://services.leadconnectorhq.com/products/inventory', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
    Version: '2021-07-28',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "items": [{"priceId": "5e9f8f8f8f8f8f8f8f8f8f8", "availableQuantity": 10, "allowOutOfStockPurchases": false}]}),
});
const data = await response.json();
import os, requests
response = requests.request(
    'POST',
    'https://services.leadconnectorhq.com/products/inventory',
    headers={
        'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
        'Version': '2021-07-28',
        'Content-Type': 'application/json',
    },
    json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "items": [{"priceId": "5e9f8f8f8f8f8f8f8f8f8f8", "availableQuantity": 10, "allowOutOfStockPurchases": false}]},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/products/inventory');
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', 'items': [{'priceId': '5e9f8f8f8f8f8f8f8f8f8f8', 'availableQuantity': 10, 'allowOutOfStockPurchases': false}]}),
]);
$data = json_decode(curl_exec($ch), true);