Developer Documentation

Build with Part Tracker

Integrate your inventory management with our powerful REST API and real-time webhooks. Available on Professional Plus and Enterprise plans.

Getting Started

Your first API request in minutes

1. Get Your API Key

Navigate to Settings → API Keys in your dashboard. Only available on Professional Plus and Enterprise plans.

Professional Plus: 1,000 requests/hour
Enterprise: Unlimited requests/hour

2. Make Your First Request

curl https://api.parttracker.com/api/v1/parts \
  -H "Authorization: Bearer api_live_xxxxxxxxxxxxxxxxxxxxxxx"
  
# Response
{
  "success": true,
  "data": [...],
  "pagination": { ... }
}

3. Handle the Response

All API responses follow a consistent format with success, data, and optional pagination or error fields.

Authentication

Secure your API requests with API keys

API Key Authentication

Include your API key in the Authorization header of every request:

Authorization: Bearer api_live_xxxxxxxxxxxxxxxxxxxxxxx

✅ Best Practices

  • • Store API keys in environment variables
  • • Never commit keys to version control
  • • Rotate keys regularly
  • • Use different keys for dev/production

❌ Security Warnings

  • • Don't expose keys in client-side code
  • • Don't share keys between environments
  • • Don't log full API keys
  • • Revoke compromised keys immediately

Rate Limiting

API requests are rate-limited based on your plan. Check response headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 987
X-RateLimit-Reset: 1698765432

API Endpoints

Complete API reference

GET
/api/v1/parts

List all parts with filtering and pagination

Query Parameters:

page(integer)- Page number (default: 1)
limit(integer)- Items per page (default: 50)
search(string)- Search by article number or name
supplier_id(string)- Filter by supplier
low_stock(boolean)- Show only low stock items
Example Request
curl https://api.parttracker.com/api/v1/parts?page=1&limit=10 \
  -H "Authorization: Bearer api_live_xxx"
GET
/api/v1/parts/:id

Get a specific part by ID

Example Request
curl https://api.parttracker.com/api/v1/parts/part_123 \
  -H "Authorization: Bearer api_live_xxx"
POST
/api/v1/parts

Create a new part

Request Body:

{
  "article_number": "P-001",
  "name": "Circuit Board",
  "price": 50,
  "stock_quantity": 100,
  "minimum_stock": 10
}
Example Request
curl -X POST https://api.parttracker.com/api/v1/parts \
  -H "Authorization: Bearer api_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"article_number":"P-001","name":"Circuit Board","price":50}'
POST
/api/v1/parts/:id/adjust-stock

Adjust stock quantity (add or subtract)

Request Body:

{
  "operation": "add",
  "quantity": 50,
  "reason": "Received new shipment"
}
Example Request
curl -X POST https://api.parttracker.com/api/v1/parts/part_123/adjust-stock \
  -H "Authorization: Bearer api_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"operation":"add","quantity":50,"reason":"Restock"}'

Webhooks

Real-time event notifications

Webhooks allow you to receive real-time notifications when events occur in your Part Tracker organization.

Available Events

Parts Events

part.created
part.updated
part.deleted
part.stock_changed

Products Events

product.created
product.updated
product.stock_changed

Orders Events

supplier_order.created
supplier_order.delivered
production_order.completed

E-commerce Events

shopify_order.created
woocommerce_order.created
distributor_order.shipped

Creating a Webhook

curl -X POST https://api.parttracker.com/api/v1/webhooks \
  -H "Authorization: Bearer api_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-server.com/webhook",
    "events": ["part.created", "part.stock_changed"]
  }'

Webhook Payload

{
  "event": "part.created",
  "timestamp": "2025-10-21T14:30:00.000Z",
  "organization_id": "org_123",
  "data": {
    "part": {
      "id": "part_123",
      "article_number": "P-001",
      "name": "Circuit Board",
      "stock_quantity": 100,
      ...
    }
  }
}

Verifying Webhook Signatures

All webhooks include a signature in the X-Webhook-Signature header. Verify it to ensure authenticity:

const crypto = require('crypto');
const WEBHOOK_SECRET = process.env.WEBHOOK_SECRET;

function verifyWebhook(payload, signature, secret) {
  const hmac = crypto.createHmac('sha256', secret);
  const digest = hmac.update(payload).digest('hex');
  return digest === signature;
}

// Express example
app.post('/webhook', (req, res) => {
  const signature = req.headers['x-webhook-signature'];
  const payload = JSON.stringify(req.body);
  
  if (!verifyWebhook(payload, signature, WEBHOOK_SECRET)) {
    return res.status(401).send('Invalid signature');
  }
  
  // Process webhook...
  res.status(200).send('OK');
});

Error Handling

Understanding API error responses

The API uses conventional HTTP response codes to indicate success or failure:

200
OK- Request succeeded
201
Created- Resource created successfully
400
Bad Request- Invalid request parameters
401
Unauthorized- Invalid or missing API key
403
Forbidden- Insufficient permissions
404
Not Found- Resource not found
429
Too Many Requests- Rate limit exceeded
500
Internal Server Error- Server error
// Error response format
{
  "success": false,
  "error": "Rate limit exceeded",
  "message": "You have exceeded your rate limit of 1000 requests per hour",
  "retryAfter": 3600
}

Code Examples

Integration examples in different languages

// Using fetch
const apiKey = 'api_live_xxxxxxxxxxxxxxxxxxxxxxx';

async function getParts() {
  const response = await fetch('https://api.parttracker.com/api/v1/parts', {
    headers: {
      'Authorization': 'Bearer ' + apiKey
    }
  });
  
  const data = await response.json();
  return data.data;
}

// Create a new part
async function createPart(partData) {
  const response = await fetch('https://api.parttracker.com/api/v1/parts', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer ' + apiKey,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(partData)
  });
  
  return await response.json();
}

Need Help?

We're here to support your integration

📧 Email Support

contact@parttracker.io

Enterprise customers: Get dedicated API support and higher rate limits.Upgrade to Enterprise →