Gen-Endpoint
Back to API List
Inventory Management API
Track stock levels, handle reservations, manage warehouses, and process stock adjustments.
E-commerce
Internal API - Hosted by this App
API Endpoints & Usage
Explore and interact with the available endpoints for the Inventory Management API. These API routes are live! The paths shown below are relative to your application's base URL. For example, if this application is hosted at https://gen-endpoint.com, an endpoint path for this API, such as /api/inventory/{productId}, would be accessible at https://gen-endpoint.com/api/inventory/{productId}. You can use the "Try it out" section for each endpoint or use tools like curl, Postman, or your browser's address bar (for GET requests) to interact with them.
GET

/api/inventory/{productId}

Get current stock levels and availability across warehouses. Replace {productId} with an actual product ID.

Show Static Examples

Example Response:

{
  "productId": "prod_123",
  "totalStock": 150,
  "reserved": 25,
  "available": 125,
  "warehouses": [
    {
      "id": "wh_1",
      "location": "NYC",
      "stock": 75
    },
    {
      "id": "wh_2",
      "location": "LA",
      "stock": 75
    }
  ],
  "lowStockThreshold": 20
}
Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).

POST

/api/inventory/reserve

Reserve items for orders with automatic expiration.

Show Static Examples

Example Request Body:

{
  "items": [
    {"productId": "prod_123", "quantity": 2, "warehouseId": "wh_1"}
  ],
  "orderId": "order_456",
  "expiresAt": "2024-08-16T13:00:00Z"
}

Example Response:

{
  "reservationId": "res_789",
  "status": "confirmed",
  "items": [
    {
      "productId": "prod_123",
      "quantity": 2,
      "reserved": true
    }
  ],
  "expiresAt": "2024-08-16T13:00:00Z"
}
Try it out
PUT

/api/inventory/adjust

Adjust stock levels with reason tracking.

Show Static Examples

Example Request Body:

{
  "productId": "prod_123",
  "adjustment": -5,
  "reason": "damaged_goods",
  "warehouseId": "wh_1",
  "notes": "Water damage during storage"
}

Example Response:

{
  "success": true,
  "productId": "prod_123",
  "previousStock": 150,
  "newStock": 145,
  "adjustmentId": "adj_321"
}
Try it out