Skip to main content

Inventory Module

Track stock levels across multiple locations with transfers, alerts, and movement history.

Base URL: https://app.proign.com/[tenant]/inventory/api

Overview

The Inventory module provides comprehensive stock management:

  • Multi-location stock tracking
  • Stock adjustments and movements
  • Transfer orders between locations
  • Low stock alerts and reorder points
  • Movement history and audit trail

Key Features

Locations

Define multiple inventory locations:

  • Warehouse - Main storage facility
  • Service Center - Repair and service location
  • Consignment - Third-party held inventory
  • Transit - In-transit between locations
  • Dealer - Dealer-held inventory
  • Returns - Returned items staging

Stock Movements

Track all inventory changes with movement types:

TypeEffect
inbound_purchase+quantity (new stock)
outbound_sale-quantity (sold)
inbound_transfer+quantity (from another location)
outbound_transfer-quantity (to another location)
adjustment_count+/- quantity (physical count)
reserveReserve for pending order

Transfer Orders

Move inventory between locations:

  1. Create transfer order (select from/to locations)
  2. Add items to transfer
  3. Mark as in-transit when shipped
  4. Complete transfer when received
  5. Stock automatically updates at both locations

Alerts

Get notified about inventory issues:

  • Low Stock - Quantity below reorder point
  • Out of Stock - Zero quantity
  • Reorder Needed - Time to replenish
  • Overstock - Above maximum threshold

API Endpoints

Stock

GET    /api/[tenant]/stock                  # List stock by location
POST   /api/[tenant]/stock                  # Adjust stock quantity

Locations

GET    /api/[tenant]/locations              # List all locations
POST   /api/[tenant]/locations              # Create location (admin)

Transfers

GET    /api/[tenant]/transfers              # List transfer orders
POST   /api/[tenant]/transfers              # Create transfer order
PATCH  /api/[tenant]/transfers              # Update transfer status

Movement History

GET    /api/[tenant]/movements              # Get movement history

Alerts

GET    /api/[tenant]/alerts                 # List alerts
POST   /api/[tenant]/alerts                 # Create alert
PATCH  /api/[tenant]/alerts                 # Acknowledge/resolve alert

Stock Levels

Each product at each location tracks multiple quantity dimensions:

FieldDescription
on_handTotal physical quantity at the location
reservedQuantity reserved for pending orders
availableon_hand - reserved (what can be sold)
reorder_pointThreshold that triggers low-stock alert
reorder_qtySuggested quantity to reorder

Transfer Order Lifecycle

Transfer orders between locations follow a managed lifecycle:

draft → approved → in_transit → received → completed
StatusStock Effect
draftNo stock changes yet
approvedSource quantity reserved for transfer
in_transitDeducted from source, tracked as in-transit
receivedAdded to destination location
completedTransfer finalized, movement history recorded

Request Examples

Query Stock Levels

GET /api/[tenant]/stock?location=warehouse-main&sku=FRM-001

// Response
{
  "data": [
    {
      "sku": "FRM-001",
      "product_name": "9mm Pistol",
      "location": "warehouse-main",
      "on_hand": 150,
      "reserved": 12,
      "available": 138,
      "reorder_point": 50,
      "reorder_qty": 100,
      "last_movement_at": "2026-02-20T14:30:00Z"
    }
  ]
}

Adjust Stock

POST /api/[tenant]/stock
Content-Type: application/json

{
  "sku": "FRM-001",
  "location": "warehouse-main",
  "type": "adjustment_count",
  "quantity": -3,
  "reason": "Physical count discrepancy",
  "reference": "COUNT-2026-02-21"
}

// Response (200 OK)
{
  "data": {
    "movement_id": "mv_abc123",
    "sku": "FRM-001",
    "previous_on_hand": 150,
    "new_on_hand": 147,
    "type": "adjustment_count",
    "recorded_at": "2026-02-21T10:00:00Z"
  }
}

Create Transfer

POST /api/[tenant]/transfers
Content-Type: application/json

{
  "from_location": "warehouse-main",
  "to_location": "service-center",
  "items": [
    { "sku": "FRM-001", "quantity": 10 },
    { "sku": "ACC-MAG-9MM", "quantity": 25 }
  ],
  "notes": "Restock service center for Q1"
}

// Response (201 Created)
{
  "data": {
    "id": "tfr_xyz789",
    "status": "draft",
    "from_location": "warehouse-main",
    "to_location": "service-center",
    "items": 2,
    "total_quantity": 35,
    "created_at": "2026-02-21T10:00:00Z"
  }
}

Alert Configuration

Configure alerts per product and location:

POST /api/[tenant]/alerts
Content-Type: application/json

{
  "sku": "FRM-001",
  "location": "warehouse-main",
  "type": "low_stock",
  "threshold": 50,
  "notify": ["email", "events"],
  "recipients": ["warehouse@company.com"]
}

Alerts can notify via email or publish events to the Events module for cross-module automation. The stock.low event type is available for webhook subscriptions.

Integration

Inventory integrates with other modules:

  • Fulfillment - Auto-deduct on shipment, reserve on order creation
  • Aftersale - RMA returns automatically add stock back to the returns location
  • Events - Publishes stock.low and stock.adjusted events
  • Catalog - Syncs product data (SKU, name) from the catalog registry

Related