CopyOperationsFromDocPurchase

[POST] .../v1/wholesaleoperation/copyoperationsfromdocpurchase

Copies operations from a purchase document to a shipment-to-partner document. Fill a DocWholeSale shipment document from a receipt-from-partner document when shipment lines should mirror purchased items and costs. The request body must contain doc_from_id of the purchase document and doc_to_id of the target shipment document; both documents must exist and be locked as required by their document lock services. The caller must have shipment operation add permission; missing ids, denied access, missing source or target documents, lock conflicts, no copied rows or persistence errors are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
doc_from_id Int64 Required Source document ID to copy operations from.
doc_to_id Int64 Required Destination document ID to copy operations into.

Request Example

{
  "doc_from_id": 4101,
  "doc_to_id": 4601
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Update Update operation result.

Response Example

{
  "ok": true,
  "result": {
    "row_affected": 1,
    "ids": [
      8601
    ]
  }
}