Create, complete or delete a stock transfer

distru-mutate-stock-transferWrite

Creates, completes or deletes one stock transfer: a move of batch-tracked or product-tracked stock between two of your locations.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
actionenum
CREATEUPDATEDELETE
Yes
idstringNoRequired for UPDATE and DELETE: a TRANSIT transfer. Resolve via distru-search-stock-transfers (statuses TRANSIT).
fromLocationIdstringNoRequired for CREATE. Resolve via distru-search-locations.
toLocationIdstringNoRequired for CREATE. Must differ from fromLocationId. Resolve via distru-search-locations.
itemsobject[]NoRequired for CREATE.
items[].batchIdstringNoSend exactly one of batchId or productId. A batch of a batch-tracked product. Resolve via distru-search-batches.
items[].productIdstringNoA product-tracked product. Resolve via distru-search-products.
items[].quantitystring or numberYesGreater than 0, in the product's unit type; at most the stock at fromLocationId, read with includeActiveQuantitiesByLocation on distru-get-batch (batchId) or distru-get-product (productId).
descriptionstringNo
statusenum
COMPLETEDTRANSIT
NoCREATE: default COMPLETED, the stock arrives at toLocationId now; TRANSIT, it leaves fromLocationId's active stock now, held aside there, and arrives only on UPDATE status COMPLETED. UPDATE: required, COMPLETED.
transferDatetimestringNoThe date the transfer shows. Defaults to now; does not change when the stock moves. ISO 8601 with a UTC offset, e.g. "2026-09-01T00:00:00-07:00"; the company timezone is on distru-get-me.
customFieldsobject[]NoCREATE only. Only the fields listed are set. Required custom fields must be set. One made required while the transfer is TRANSIT blocks UPDATE, which cannot set it.
customFields[].customFieldIdstringYesResolve via distru-search-custom-fields (entityType STOCK_TRANSFER).
customFields[].valuestring or string[]YesTEXT: the text. NUMBER: a plain decimal, such as "12.5". USER: the user's id (usr_…). DROPDOWN: the option name. CHECKBOX: an array of option names. DATE: YYYY-MM-DD, company timezone. "" or [] clears the field.

Output

This tool returns one of 2 shapes, depending on its inputs.

Presence on a nested field assumes its parent exists.

Result with stockTransfer

FieldTypePresence
stockTransferobjectAlways
stockTransfer.idstringAlways
stockTransfer.stockTransferNumberstringAlways
stockTransfer.statusenum
CANCELEDCOMPLETEDTRANSIT
Always
stockTransfer.transferDatetimestringCan be null
stockTransfer.completedAtstringCan be null
stockTransfer.descriptionstringCan be null
stockTransfer.customFieldsobject[]Always
stockTransfer.customFields[].customFieldobjectAlways
stockTransfer.customFields[].customField.idstringAlways
stockTransfer.customFields[].customField.namestringAlways
stockTransfer.customFields[].customField.fieldTypeenum
CHECKBOXDATEDROPDOWNNUMBERTEXTUSER
Always
stockTransfer.customFields[].valuestringCan be null
stockTransfer.fromLocationobjectCan be null
stockTransfer.fromLocation.idstringAlways
stockTransfer.fromLocation.namestringAlways
stockTransfer.toLocationobjectCan be null
stockTransfer.toLocation.idstringAlways
stockTransfer.toLocation.namestringAlways
stockTransfer.itemsobject[]Always
stockTransfer.items[].quantitystringCan be null
stockTransfer.items[].productobjectAlways
stockTransfer.items[].product.idstringAlways
stockTransfer.items[].product.namestringAlways
stockTransfer.items[].batchobjectCan be null
stockTransfer.items[].batch.idstringAlways
stockTransfer.items[].batch.namestringAlways
stockTransfer.items[].packageobjectCan be null
stockTransfer.items[].package.idstringAlways
stockTransfer.items[].package.metrcLabelstringAlways

Result with id

FieldTypePresence
idstringAlways
What the AI reads

Creates, completes or deletes one stock transfer: a move of batch-tracked or product-tracked stock between two of your locations. Package-tracked products move as whole packages with distru-move-packages. CREATE moves the stock, completed at once (default) or left in transit (status TRANSIT); not idempotent: each CREATE moves the stock again. UPDATE and DELETE act only on a TRANSIT transfer between locations, or between users holding the stock instead of a location (fromLocation or toLocation null), whether made with this tool or in Distru's web app; never a Metrc compliance transfer; refused on any other. UPDATE with status COMPLETED receives it: the stock held aside at fromLocation arrives at toLocation and completedAt is now; this can't be undone. DELETE removes the transfer, which is how Distru cancels one: its stock returns to fromLocation's active stock. Distru inventory only; nothing is sent to Metrc. CREATE and UPDATE return the transfer with its lines as distru-search-stock-transfers does (batch is null on product-tracked lines); DELETE returns its id. Sparse update: status is UPDATE's only field.