Add

[POST] .../v1/docmovement/add

Creates a new document movement. Use this method to create a stock movement document that will later receive item lines through MovementOperation/Add and be posted through DocMovement/Perform. The request body must contain date, stock_sender_id and stock_receiver_id; sender and receiver stocks must be different, must exist, must belong to the same firm and must be available to the current request user. If attached_user_id is omitted or 0, the API attaches the current request user to the document; description is optional and limited to 300 characters. The caller must have document movement add permission; missing body, invalid required fields, unavailable tariff, stock access errors, cross-firm stocks, denied access, database failures or webhook failures are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
attached_user_id Int64 Optional Responsible user ID. If omitted or 0, the API uses the current request user.
date Int64 Required Document date as Unix time in seconds.
description String Optional Additional description. Maximum length is 300 characters.
stock_receiver_id Int64 Required Recipient stock ID.
stock_sender_id Int64 Required Sender stock ID.

Request Example

{
  "date": 1767225600,
  "stock_sender_id": 11,
  "stock_receiver_id": 12,
  "description": "Transfer coffee to downtown shop"
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Insert Created record result.

Response Example

{
  "ok": true,
  "result": {
    "new_id": 4201
  }
}