Open Inventory / Docs
EndpointsScan workflowsStockScansExecute

Apply a previously reviewed stock scan to its selected targets

The API runs on your application instance. Schemas and field names come directly from the OpenAPI specification. Session-authenticated requests require a session on that instance.

POST
/stock/scans/execute

Authorization

bearerAuth
headerAuthorizationBearer <inv_ token>

Header Parameters

Idempotency-Key?string

UUID identifying one queue operation; safe to reuse for retries.

Formatuuid
X-Organization-ID?string

Organization membership selected for this request. User-bound credentials may select any active membership; standalone tokens may only repeat their pinned organization ID.

Formatuuid

Request Body

application/json
  1. body
expectedPlanHash?string

Required for action chains. Prefer the dedicated action-chains endpoints.

Match^[a-f0-9]{64}$
workflowId*string
Formatuuid
revision*integer
Range1 <= value
code*string
Length1 <= length <= 2048
codeType?|null
expectedResourceUpdatedAt*string

Copy exactly from the resolve response.

Formatdate-time
expectedUnitId*|

Copy exactly from resolve; must be null together with expectedUnitUpdatedAt or non-null together with it.

expectedUnitUpdatedAt*|

Copy exactly from resolve; must be null together with expectedUnitId or non-null together with it.

selectedResourceIds?array<>
Itemsitems <= 24
expectedTargets?array<>
Itemsitems <= 24
inputs?

Operator-provided workflow fields. May be omitted when the workflow has no input fields.

Propertiesproperties <= 24
Default{}

Response Body

Replayed the original scan execution response

application/json
  1. response
workflowId*string
Formatuuid
revision*integer
Range1 <= value
resource*
operation*||
unit*|null
movement*|null
created*boolean
metadataBefore*|null
metadataAfter*
[key: string]?any
Example Request
curl -X POST 'https://inventory.example.com/api/v1/stock/scans/execute' \  -H 'Content-Type: application/json' \  -d '{  "workflowId": "43c4fa9b-0cbc-4b57-a121-9d7d46a3eaa4",  "revision": 1,  "code": "string",  "expectedResourceUpdatedAt": "2019-08-24T14:15:22Z",  "expectedUnitId": "8fc0bcdb-84d5-44bf-ba9f-1b2906c142c9",  "expectedUnitUpdatedAt": "2019-08-24T14:15:22Z"}'
Example Response
{  "workflowId": "43c4fa9b-0cbc-4b57-a121-9d7d46a3eaa4",  "revision": 1,  "resource": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "quantity": 0  },  "operation": {    "type": "unit"  },  "unit": {    "status": "available",    "location": "string",    "locationResourceId": "cad4fbcc-0e81-4c59-9f5c-423e9329e3ec",    "metadata": {},    "customFields": {      "property1": "string",      "property2": "string"    },    "occurredAt": "2019-08-24T14:15:22Z",    "reason": "string",    "note": "string",    "totalPriceCents": -2000000000,    "priceCurrency": "str",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "resourceId": "026d60bb-63a8-407e-bf67-01dcfc6022e6",    "code": "string",    "acquisitionCostCents": 0,    "costCurrency": "string",    "acquiredAt": "2019-08-24T14:15:22Z",    "lastMovedAt": "2019-08-24T14:15:22Z",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  },  "movement": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "resourceId": "026d60bb-63a8-407e-bf67-01dcfc6022e6",    "contactId": "b5ec5d98-4bee-4da1-ad24-dde86346cb1d",    "unitId": "b3eb5f92-604a-46b9-9881-9d84000fd7ed",    "assemblyBuildId": "fce8760b-ec68-46b1-8ce8-e67517308663",    "purchaseReceiptId": "5e357173-740c-410a-a418-e608849f94b4",    "delta": 0,    "quantity": 0,    "totalPriceCents": -2000000000,    "priceCurrency": "string",    "costCents": 0,    "costCurrency": "string",    "costEstimated": true,    "balanceAfter": 0,    "fromLocationBalanceAfter": 0,    "toLocationBalanceAfter": 0,    "type": "string",    "reason": "string",    "note": "string",    "location": "string",    "fromLocationResourceId": "7955d755-17bf-453b-b4c8-103f9d6ec7e9",    "toLocationResourceId": "378306b8-97fc-46c0-ba39-c215088585bd",    "occurredAt": "2019-08-24T14:15:22Z",    "createdAt": "2019-08-24T14:15:22Z",    "createdBy": "string"  },  "created": true,  "metadataBefore": {},  "metadataAfter": {}}