The “List Inventory API allows the user to retrieve a paginated list of inventory items. Use this endpoint to fetch details for multiple items in the inventory based on the provided query parameters.
GET https://services.leadconnectorhq.com/products/inventory
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación .
Version
string
default: "2021-07-28"
required
Versión de la API.
Query parameters
The maximum number of items to be included in a single page of results
The starting index of the page, indicating the position from which the results should be retrieved.
altId
string
default: "6578278e879ad2646715ba9c"
required
Account Id or Agency Id
search
string
default: "Product Name"
Search string for Variant Search
Respuestas
200 - Successful response
List of inventory items _id
string
default: "6241712be68f7a98102ba272"
required
The unique identifier for the price
name
string
default: "Medium T-shirt"
required
Name of the price/variant
availableQuantity
number
default: "50"
required
Available quantity in inventory
sku
string
default: "TSHIRT-MED-001"
required
SKU for the product variant
allowOutOfStockPurchases
boolean
default: "False"
required
Whether out of stock purchases are allowed
product
string
default: "6241712be68f7a98102ba270"
required
Product ID this price belongs to
updatedAt
string
default: "2023-12-12T09:27:42.355Z"
required
Last update timestamp
image
string
default: "https://example.com/images/product.jpg"
Product image URL
Total count of inventory items
{
"inventory" : [
{
"_id" : "6241712be68f7a98102ba272" ,
"name" : "Medium T-shirt" ,
"availableQuantity" : 50 ,
"sku" : "TSHIRT-MED-001" ,
"allowOutOfStockPurchases" : false ,
"product" : "6241712be68f7a98102ba270" ,
"updatedAt" : "2023-12-12T09:27:42.355Z" ,
"image" : "https://example.com/images/product.jpg" ,
"productName" : "T-shirt"
}
],
"total" : {
"total" : 100
}
}
422 - Unprocessable Entity
Ejemplo
curl -X GET 'https://services.leadconnectorhq.com/products/inventory' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28'
const response = await fetch ( 'https://services.leadconnectorhq.com/products/inventory' , {
method: 'GET' ,
headers: {
Authorization: `Bearer ${ process . env . LEADWAY_TOKEN } ` ,
Version: '2021-07-28' ,
},
});
const data = await response . json ();
import os, requests
response = requests.request(
'GET' ,
'https://services.leadconnectorhq.com/products/inventory' ,
headers = {
'Authorization' : f "Bearer { os.environ[ 'LEADWAY_TOKEN' ] } " ,
'Version' : '2021-07-28' ,
},
)
data = response.json()
<? php
$ch = curl_init ( 'https://services.leadconnectorhq.com/products/inventory' );
curl_setopt_array ( $ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_CUSTOMREQUEST => 'GET' ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv ( 'LEADWAY_TOKEN' ),
'Version: 2021-07-28' ,
],
]);
$data = json_decode ( curl_exec ( $ch ), true );