createWarehouseStock

Topics: Logistics

Create a warehouse stock record in the caller's tenant with a server-assigned WarehouseStock TypeID. Returns validation errors rather than a record when the quantities are invalid. Emits a warehouse-stock created event. Requires write access to warehouse stock.

Returns

WarehouseStockPayload!

Arguments

State of the stock record to create.

Examples

Record Logistics Opening Stock

mutation RecordLogisticsOpeningStock($input: CreateWarehouseStockInput!) {
  createWarehouseStock(input: $input) {
    warehouseStock { id quantity reservedQuantity availableQuantity unit }
    errors { path message }
  }
}

Variables

{
  "input": {
    "locationId": "wlc_000000448h848r248h248h248h",
    "stockableType": "SUBSTRATE",
    "stockableId": "job_000000648h848r248h248h248h",
    "quantity": 3000,
    "unit": "SHEET",
    "batchNumber": "PAPER-2026-042",
    "notes": "Opening balance from verified physical stock; not a second receipt."
  }
}
Exact field SDL
"""
Create a warehouse stock record in the caller's tenant with a server-assigned WarehouseStock TypeID. Returns validation errors rather than a record when the quantities are invalid. Emits a warehouse-stock created event. Requires write access to warehouse stock.
"""
createWarehouseStock(
  """State of the stock record to create."""
  input: CreateWarehouseStockInput!
): WarehouseStockPayload! @topic(names: ["logistics"]) @topic_example(names: ["logistics.record-opening-stock"])

Declared on Mutation. Access is checked by the platform for each operation.