⚡List Products
This endpoint retrieves a list of products based on specified criteria such as product name, SKU, barcode, category, stock status, and expiration status.
Endpoint
GET https://api.keepup.store/v2.0/products
Headers
Authorization: Bearer API_KEY
Query Parameters
optional
Stock status to filter by, options are 'in_stock', 'out_of_stock', 'low_stock', 'all'. Example: "in_stock"
optional
Filter for products based on expiration, options are 'yes', 'no'. Example: "no"
Sample Requests
const axios = require('axios');
const config = {
method: 'get',
url: 'https://api.keepup.store/v2.0/inventory',
headers: {
'Authorization': 'Bearer API_KEY' // Replace 'API_KEY' with your actual API key
},
params: {
product_name: "Widget A",
SKU: "SKU12345",
barcode: "0123456789012",
category: "Electronics",
status: "in_stock",
expired: "no",
limit: "10",
page: "1"
}
};
axios(config).then(function (response) {
console.log(JSON.stringify(response.data));
}).catch(function (error) {
console.error(error);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.keepup.store/v2.0/inventory?product_name=Widget%20A&sku=SKU12345&barcode=0123456789012&category=Electronics&status=in_stock&expired=no&limit=10&page=1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer API_KEY' // Replace 'API_KEY' with your actual API key
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import requests
url = 'https://example.com/api/inventory'
headers = {'Authorization': 'Bearer your_access_token'}
params = {
'product_name': 'Widget A',
'SKU': 'SKU12345',
'barcode': '0123456789012',
'category': 'Electronics',
'status': 'in_stock',
'expired': 'no',
'limit': '10',
'page': '1'
}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
print(response.json())
else:
print('Failed to retrieve products:', response.status_code, response.text)
Sample Response
{
"status": 200,
"message": "products found: 1",
"data": {
"meta": {
"total_records": 1,
"total_quantity": 0,
"total_products_in_stock": 0,
"total_products_out_of_stock": 1,
"selling_price_total_amount": "0.00",
"cost_price_total_amount": "0.00",
"total_expired_products": 0,
"total_soon_to_expired_products": 0
},
"products": [
{
"product_id": 19842,
"product_name": "6:16",
"description": "<p>6:16 description</p>",
"cost_price": "0.00",
"selling_price": "37.00",
"stock_limit": "unlimited",
"stock_status": "out_of_stock",
"quantity": 0,
"images": [],
"restock_level": 1,
"barcode": null,
"SKU": null,
"location": null,
"category": null,
"show_on_storefront": "yes",
"featured_product": "no",
"created_at": "2024-05-11 16:18",
"updated_at": "2024-05-11 17:00"
}
]
}
}{
"status": 401,
"error": "Authentication invalid"
}Last updated