Open Inventory / Docs
EndpointsStockResourcesIdStockMovementsMovementid

Correct a manual bulk stock movement

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.

PATCH
/resources/{id}/stock/movements/{movementId}

System-linked movements and inbound movements whose cost layer has already been consumed cannot be changed.

Authorization

bearerAuth
headerAuthorizationBearer <inv_ token>

Path Parameters

id*string
Formatuuid
movementId*string
Formatuuid

Header Parameters

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
delta*integer

Positive receipts and negative issues. Structured transfers require zero because the global balance does not change.

Range-2000000000 <= value <= 2000000000
quantity?integer

Required and positive for a structured transfer; otherwise it must equal the absolute delta when provided.

Range0 <= value <= 2000000000
type*string
Value in"receipt""issue""adjustment""return""waste""transfer"
reason?|
Lengthlength <= 240
note?string
Lengthlength <= 20000
location?|
Lengthlength <= 240
fromLocationResourceId?|

Structured source location for an issue or transfer.

Formatuuid
toLocationResourceId?|

Structured destination location for a receipt or transfer.

Formatuuid
contactId?|

Active customer or supplier associated with this movement.

Formatuuid
occurredAt?string
Formatdate-time
totalPriceCents?|

Signed transaction value; negative values can represent outbound revenue. Inbound prices must be nonnegative.

Range-2000000000 <= value <= 2000000000
priceCurrency?|
Length3 <= length <= 3

Response Body

Movement and current balance updated atomically

application/json
  1. response
resource*
movement*
Example Request
curl -X PATCH 'https://inventory.example.com/api/v1/resources/497f6eca-6276-4993-bfeb-53cbbbba6f08/stock/movements/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{  "delta": -2000000000,  "type": "receipt"}'
Example Response
{  "resource": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "quantity": 0  },  "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"  }}