Docs · API Reference
API Reference
Tip: hover (or keyboard-focus) any term with a dotted underline for a short, non-technical explanation.
Overview
The PartLogic API provides secure access to stock data for your account. Other systems (Zapier, Excel, Postman, custom software) connect through REST endpoints. Rows are filtered using device permissions linked to your API key.
Client (Zapier, Excel, Postman, etc.)
↓ HTTP + X-API-Key header
PartLogic Stock API
↓
Stock data (filtered by your API key)For the existing Zapier connector, please see the Zapier guide. You can also try the API interactively from your browser.
Custom endpoints
The stock endpoint shown here is one example. We can set up custom endpoints with whichever fields and data your integration requires—whether you need a different structure, additional fields, or a completely bespoke API. Contact us to discuss your requirements.
Authentication
All endpoints (except /ping) require an API key in the X-API-Key HTTP header.
Header
X-API-Key: <your-api-key>
⚠️ Do not send the API key as a query parameter (e.g. ?X-API-Key=...). It will be rejected. Use the header only.
API keys are generated in the PartLogic Integrations portal. For step-by-step screenshots, see the Portal API key guide. Keys are tied to your user and device permissions.
Base URLs
The public Stock API host below matches the OpenAPI spec and Try API. General pattern:
| Use case | URL pattern |
|---|---|
| Stock API | {base}/api |
Public Stock API (same host as the OpenAPI spec and Try API):
Base URL (no trailing slash)
PartLogic Stock API (production host)Stock endpoint
PartLogic Stock API — /api/stockEndpoints
Verifies the API is reachable. No authentication required.
Request
curl -X GET "{base}/api/ping"cURL is a developer command-line tester; you can ignore it if you use Postman or Sheets instead.
Response (200)
{
"ok": true,
"time": "2026-01-01T12:00:00.000Z"
}Returns stock rows as JSON, filtered by devices tied to your API key. Works well with Postman, Excel, Zapier, and scripts. Custom endpoints are available on request.
Request
curl -X GET "{base}/api/stock" \
-H "X-API-Key: YOUR_API_KEY"Response (200) – Array format
[
{
"id": 187674,
"DeviceName": "BarcodeScanner4",
"SKU": "1234567899",
"Description": "Testcode - This a code used for testing",
"MinQty": 0,
"MaxQty": 1,
"Physical": 5,
"Location": "MAIN-01",
"LocationAlias": "Main Rack"
}
]Some deployments return an envelope: { "rows": [...], "count": N }
Data model: Stock view fields
Stock data is returned as an array of row objects (each row is a set of named fields) with the following columns:
| Field | Type | Description |
|---|---|---|
| id | integer | Unique record ID |
| DeviceName | string | Device/location identifier |
| DeviceList | string | Comma-separated list of devices (when applicable) |
| SKU | string | Stock keeping unit |
| Description | string | Product description |
| MinQty | integer | Minimum quantity (reorder level) |
| MaxQty | integer | Maximum quantity |
| Physical | integer | Current physical stock count |
| Location | string | Storage location code |
| LocationAlias | string | Human-readable location name |
GTIN and other fields may be available. Need different fields or a custom data structure? We can configure endpoints with exactly the fields you require—contact us to discuss.
Errors & HTTP status codes
| Code | Meaning |
|---|---|
| 200 | Success |
| 401 | Missing, invalid, or expired API key |
| 403 | Valid key but insufficient permissions / IP not allowed |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Error response format
401 – Missing or invalid API key:
{ "error": "missing api key" }
{ "error": "invalid api key" }If you receive 200 with an empty array, your key is valid but has no matching data. Check device permissions with your administrator.
Code examples
JavaScript / Node.js
const response = await fetch('{base}/api/stock', {
headers: { 'X-API-Key': process.env.PARTLOGIC_API_KEY }
});
const stock = await response.json();Python
import requests
r = requests.get(
'{base}/api/stock',
headers={'X-API-Key': 'YOUR_API_KEY'}
)
stock = r.json()PowerShell
Invoke-WebRequest -Uri "{base}/api/stock" -Headers @{ "X-API-Key" = "YOUR_API_KEY" } -Method GETcURL
curl -X GET "{base}/api/stock" -H "X-API-Key: YOUR_API_KEY"Testing the API
Postman
- Create a new GET request
- URL:
{base}/api/stock - Headers → Add:
X-API-Key= your key - Send
Excel (Power Query)
- Data → Get Data → From Other Sources → From Web → Advanced
- URL: your Stock API URL
- HTTP Header parameters: Name
X-API-Key, Value your key - OK → Expand the data → Close & Load
Google Sheets
Built-in functions cannot send the X-API-Key header. Use Google Apps Script (UrlFetchApp) or Zapier. Step-by-step instructions and a sample script are in the Google Sheets guide.
Zapier
Use webhooks with X-API-Key in headers (not as a query parameter). See the Zapier guide for full setup.
Common mistakes
| Mistake | Fix |
|---|---|
Sending key as ?X-API-Key=... in URL | Use the X-API-Key HTTP header |
| Typo in header name | Use exactly X-API-Key (case matters) |
| Key expired or deactivated | Request a new key from the Integrations portal |
| Wrong base URL | Confirm the URL with your administrator |
Need help?
- 401 errors — Verify your API key in the Integrations portal
- Empty results — Check device permissions with your administrator
- Other issues — Contact us