UiPath Documentation
industry-department-solutions
latest
false
  • Overview
  • API Resources

Supply Chain & Retail Solutions API guide

Stock

Overview

The stock resource represents inventory levels for products at specific locations on specific dates. This resource tracks stock quantities over time for inventory management.

Resource Endpoint

/api/v2/ingest/object/{prefix}STOCK{suffix}
/api/v2/ingest/object/{prefix}STOCK{suffix}

Supported Methods

MethodReturn TypeDescription
POSTResponseIngest (create/update) stock records via UPSERT operation

Request Headers

HeaderRequiredDescription
AuthorizationYesYour Personal Access Token (PAT) from platform.peak.ai
Content-TypeYesMust be application/json

Properties

Primary Keys

  • location_id (string) - Foreign key reference to locations
  • product_id (string) - Foreign key reference to products
  • stock_date_at (date) - Date for the stock snapshot

Attributes

About Required + Nullable: every attribute key must appear in each payload (Required: Yes). Nullable: Yes means the value can be null when you don't have data; Nullable: No means a non-null value is required. See Schema definition structure for the underlying rules.

AttributeData TypeRequiredNullableDescription
location_idstringYesNoLocation identifier (Primary Key, Foreign Key)
product_idstringYesNoProduct identifier (Primary Key, Foreign Key)
stock_date_atdateYesNoStock snapshot date (Primary Key)
stock_unitsintegerYesNoNumber of units in stock
stock_idstringYesYesAlternative stock record identifier
created_attimestampYesYesTimestamp when the record was created
updated_attimestampYesYesTimestamp when the record was last updated

Relationships

Outbound References

None

Inbound References

  • location - Foreign key location_id references location
  • product - Foreign key product_id references product

JSON Representation

{
  "solutionName": "QP_OOTB",
  "data": [
    {
      "location_id": "LOC-UK-001",
      "product_id": "PROD-001",
      "stock_date_at": "2025-01-28",
      "stock_units": 450,
      "stock_id": "STK-2025-001",
      "created_at": "2025-01-28T00:00:00Z",
      "updated_at": "2025-01-28T10:00:00Z"
    }
  ],
  "operationType": "UPSERT"
}
{
  "solutionName": "QP_OOTB",
  "data": [
    {
      "location_id": "LOC-UK-001",
      "product_id": "PROD-001",
      "stock_date_at": "2025-01-28",
      "stock_units": 450,
      "stock_id": "STK-2025-001",
      "created_at": "2025-01-28T00:00:00Z",
      "updated_at": "2025-01-28T10:00:00Z"
    }
  ],
  "operationType": "UPSERT"
}

Example Request

curl -X POST \
  'https://ingestion.peak.ai/api/v2/objects/QP_STOCK_OOTB' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "solutionName": "QP_OOTB",
    "data": [
      {
        "location_id": "LOC-UK-001",
        "product_id": "PROD-001",
        "stock_date_at": "2025-01-28",
        "stock_units": 450,
        "stock_id": "STK-2025-001",
        "created_at": "2025-01-28T00:00:00Z",
        "updated_at": "2025-01-28T10:00:00Z"
      }
    ],
    "operationType": "UPSERT"
  }'
curl -X POST \
  'https://ingestion.peak.ai/api/v2/objects/QP_STOCK_OOTB' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "solutionName": "QP_OOTB",
    "data": [
      {
        "location_id": "LOC-UK-001",
        "product_id": "PROD-001",
        "stock_date_at": "2025-01-28",
        "stock_units": 450,
        "stock_id": "STK-2025-001",
        "created_at": "2025-01-28T00:00:00Z",
        "updated_at": "2025-01-28T10:00:00Z"
      }
    ],
    "operationType": "UPSERT"
  }'

Important Notes

  • Foreign Key Dependencies: Requires valid product_id and location_id to exist in their respective tables
  • Daily Snapshots: Captures stock levels at specific dates for historical tracking
  • Location-Specific: Stock is tracked separately for each location
  • Inventory Management: Essential for stock level monitoring and replenishment planning
  • Custom Attributes: Additional custom attributes can be added using the /STOCK/add-attribute endpoint
  • Data Validation: All attributes are validated according to their defined data types

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated