Linkit

SKUs

Per-branch inventory records — stock levels, pricing, and availability

SKUs

A SKU (Stock Keeping Unit) represents a product at a specific branch. SKUs are the intersection of the product catalog and your physical locations — they track stock quantities, branch-specific pricing, and availability.

SKUs are auto-generated

Do not create SKUs manually. They are generated automatically when you create a product (one SKU per existing branch) or a branch (one SKU per existing product). Use this API to read and update SKU data — primarily stock levels and pricing.


The SKU Object

{
  "id": "r1234567890abcdef",
  "iv_id": "PROD-001_STORE-001",
  "organization_id": "org_abc123",
  "product_iv_id": "PROD-001",
  "branch_iv_id": "STORE-001",
  "qty": 150,
  "price": 15.50,
  "cost": 8.25,
  "available": true,
  "created": "2024-01-15T10:30:00Z",
  "updated": "2024-01-16T14:22:00Z"
}

Fields

FieldTypeDescription
idstringInternal Linkit ID (auto-generated)
iv_idstringAuto-generated: {product_iv_id}_{branch_iv_id}
product_iv_idstringParent product's external ID
branch_iv_idstringParent branch's external ID
qtyintegerCurrent stock quantity
pricenumberBranch-specific selling price
costnumberCost price
availablebooleanWhether the SKU is available for sale

List SKUs

GET /api/v1/skus

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger20Items per page (max 100)
product_iv_idstring-Filter by product
branch_iv_idstring-Filter by branch
availableboolean-Filter by availability
min_qtyinteger-Minimum stock quantity
max_qtyinteger-Maximum stock quantity

Example Request

curl -X GET "https://linkit.works/api/v1/skus?branch_iv_id=STORE-001&available=true" \
  -H "Authorization: Bearer your_token_here"
const response = await fetch(
  'https://linkit.works/api/v1/skus?branch_iv_id=STORE-001&available=true',
  { headers: { 'Authorization': 'Bearer your_token_here' } }
);
const skus = await response.json();
import requests

response = requests.get(
    'https://linkit.works/api/v1/skus',
    params={'branch_iv_id': 'STORE-001', 'available': True},
    headers={'Authorization': 'Bearer your_token_here'}
)
skus = response.json()

Response

{
  "data": [
    {
      "id": "r1234567890abcdef",
      "iv_id": "PROD-001_STORE-001",
      "product_iv_id": "PROD-001",
      "branch_iv_id": "STORE-001",
      "qty": 150,
      "price": 15.50,
      "available": true
    }
  ],
  "count": 20,
  "total_count": 1500,
  "page": 1,
  "limit": 20,
  "has_next": true,
  "meta": {}
}

Get Single SKU

GET /api/v1/skus/code/{ivId}
ParameterTypeDescription
ivIdstringSKU's auto-generated ID ({product_iv_id}_{branch_iv_id})

Returns the full SKU object.


Update SKU

Update stock levels, pricing, or availability for a specific SKU.

PUT /api/v1/skus/code/{ivId}

Request Body

{
  "qty": 200,
  "price": 16.99,
  "cost": 8.50,
  "available": true
}

Updatable Fields

FieldTypeDescription
qtyintegerStock quantity (>= 0)
pricenumberSelling price (>= 0)
costnumberCost price (>= 0)
availablebooleanAvailability flag

Example

curl -X PUT "https://linkit.works/api/v1/skus/code/PROD-001_STORE-001" \
  -H "Authorization: Bearer your_token_here" \
  -H "Content-Type: application/json" \
  -d '{"qty": 200, "price": 16.99, "available": true}'
const response = await fetch(
  'https://linkit.works/api/v1/skus/code/PROD-001_STORE-001',
  {
    method: 'PUT',
    headers: {
      'Authorization': 'Bearer your_token_here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ qty: 200, price: 16.99, available: true })
  }
);
import requests

response = requests.put(
    'https://linkit.works/api/v1/skus/code/PROD-001_STORE-001',
    headers={'Authorization': 'Bearer your_token_here'},
    json={'qty': 200, 'price': 16.99, 'available': True}
)

Bulk Operations

Update stock levels across multiple SKUs in a single request.

POST /api/v1/skus/bulk

Request Body

{
  "mode": "upsert",
  "skus": [
    {
      "iv_id": "PROD-001_STORE-001",
      "branch_iv_id": "STORE-001",
      "product_iv_id": "PROD-001",
      "qty": 100,
      "price": 15.50,
      "available": true
    },
    {
      "iv_id": "PROD-002_STORE-001",
      "branch_iv_id": "STORE-001",
      "product_iv_id": "PROD-002",
      "qty": 50,
      "price": 29.99,
      "available": true
    }
  ]
}

Response

{
  "success": true,
  "message": "Processed 500 SKUs successfully",
  "data": {
    "succeeded": 498,
    "failed": 2,
    "errors": {
      "BAD-SKU_STORE-001": "Product BAD-SKU not found",
      "PROD-003_MISSING": "Branch MISSING not found"
    }
  },
  "timestamp": "2024-01-15T10:30:00Z"
}

Common Patterns

Inventory Sync

import requests

def sync_inventory(updates, token):
    """Sync stock levels from warehouse management system."""
    skus = [{
        'iv_id': f"{item['product']}_{item['warehouse']}",
        'branch_iv_id': item['warehouse'],
        'product_iv_id': item['product'],
        'qty': item['qty'],
        'available': item['qty'] > 0
    } for item in updates]

    response = requests.post(
        'https://linkit.works/api/v1/skus/bulk',
        headers={'Authorization': f'Bearer {token}'},
        json={'mode': 'upsert', 'skus': skus}
    )

    result = response.json()
    return result['data']['succeeded'], result['data']['failed']

Find Low Stock

curl -X GET "https://linkit.works/api/v1/skus?max_qty=10&available=true" \
  -H "Authorization: Bearer your_token_here"

Error Responses

404 Not Found

{
  "code": 404,
  "error": "SKU not found",
  "details": { "iv_id": "NONEXISTENT_STORE-001" }
}

422 Validation Error

{
  "code": 422,
  "error": "Validation failed",
  "details": { "qty": "Must be >= 0" }
}