Edit

[POST] .../v1/docorderdelivery/edit

Edits retail order document. Use this method to update editable retail order delivery header fields while the order is still in a state that permits editing. The request requires id, locks the document by id during the update, validates optional delivery coordinates and applies only supplied fields such as date, delivery date, address, external code, description, phone, source, stock, customer, retail card, price type, delivery type, payment type, courier, location and fiscal QR URL. The method requires the retail order edit permission, checks document state and locks in the persistent layer, writes the action log, sends the edited webhook and returns row_affected. Business errors such as a missing request body, invalid id, invalid coordinates, denied access, disabled tariff, locked or deleted document state, no changed fields, invalid related records, missing active row or persistence failures are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
address String Optional Order delivery address.
card_id Int64 Optional Customer card ID.
courier_id Int64 Optional Courier ID.
customer_id Int64 Optional Customer ID.
date Int64 Optional Retail order document date as Unix time in seconds.
delivery_date Int64 Optional Retail order delivery date as Unix time in seconds.
delivery_type_id Int64 Optional Delivery type ID.
description String Optional Additional description.
external_code String Optional Order code in the external system.
from_id Int64 Optional Retail order source ID.
id Int64 Required Retail order document ID.
location Location Optional Delivery location.
payment_type_id Int64 Optional Payment type ID.
phone String Optional Phone number.
price_type_id Int64 Optional Price type ID.
qrcodeurl String Optional Fiscal cheque link printed in the QR code.
stock_id Int64 Optional Stock ID.

Request Example

{
  "address": "string",
  "card_id": 1,
  "courier_id": 1,
  "customer_id": 1,
  "date": 1,
  "delivery_date": 1,
  "delivery_type_id": 1,
  "description": "string",
  "external_code": "string",
  "from_id": 1,
  "id": 1,
  "location": {
    "latitude": 1.0,
    "longitude": 1.0
  },
  "payment_type_id": 1,
  "phone": "string",
  "price_type_id": 1,
  "qrcodeurl": "string",
  "stock_id": 1
}

Response Parameters

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

Response Example

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