Back to documentation

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 caseURL 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/stock

Endpoints

GET/api/ping

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"
}
GET/api/stock

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:

FieldTypeDescription
idintegerUnique record ID
DeviceNamestringDevice/location identifier
DeviceListstringComma-separated list of devices (when applicable)
SKUstringStock keeping unit
DescriptionstringProduct description
MinQtyintegerMinimum quantity (reorder level)
MaxQtyintegerMaximum quantity
PhysicalintegerCurrent physical stock count
LocationstringStorage location code
LocationAliasstringHuman-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

CodeMeaning
200Success
401Missing, invalid, or expired API key
403Valid key but insufficient permissions / IP not allowed
429Rate limit exceeded
500Internal 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 GET

cURL

curl -X GET "{base}/api/stock" -H "X-API-Key: YOUR_API_KEY"

Testing the API

Postman

  1. Create a new GET request
  2. URL: {base}/api/stock
  3. Headers → Add: X-API-Key = your key
  4. Send

Excel (Power Query)

  1. Data → Get Data → From Other Sources → From Web → Advanced
  2. URL: your Stock API URL
  3. HTTP Header parameters: Name X-API-Key, Value your key
  4. 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

MistakeFix
Sending key as ?X-API-Key=... in URLUse the X-API-Key HTTP header
Typo in header nameUse exactly X-API-Key (case matters)
Key expired or deactivatedRequest a new key from the Integrations portal
Wrong base URLConfirm 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 issuesContact us