Update a write-off
Updates the write-off header and the items sent in the body. Pass `removeItemsNotInRequest=true` to also delete the items the body leaves out. Requires `Permissions.WriteOffs.Update`.
BearerAuthorizationBearer <token>OAuth 2.0 client credentials. Obtain a client id/secret from Winshop support ([email protected]), then POST to the token URL.
documentId*integerint32removeItemsNotInRequest?boolean|nullapplication/json- body
id?|Row id of the document. Read-only; the server assigns it.
int32internalNumber?|Internal document number, unique within the document type and reserved when the document is created. Read-only.
int32items?array<>|The document's items. Null when the document was loaded without them.
branchId?|int32cancellationInternalNumber?|int32createdAt?|date-timecustomerId?|int32dateOfAccountingPosting?|date-timedateOfOrder?|date-timedateOfProcessing?|date-timedateOfTransfer?|date-timedeliveryDate?|date-timedocumentStateId?|int32formNumber?|length <= 150guid?|guidisCancellation?boolean|nullisConfirmed?boolean|nullisExported?boolean|nullisImported?boolean|nullisLocked?boolean|nullisPartialCancellation?boolean|nullisPrinted?boolean|nullisProcessed?boolean|nulllastModify?|date-timelockOwner?|length <= 80note?string|nullorderInternalNumber?|int32orderText?|length <= 50partialCancellationInternalNumber?|int32processedByUserId?|int32reasonForIssuanceOfGoodsId?|int32routeId?|int32totalDiscount?|decimaltotalNumberOfItems?|int32totalNumberOfPieces?|decimaltotalPrice?|decimaltotalPriceWoVat?|decimaltotalStockPrice?|decimaltotalStockPriceWoVat?|decimaltransportDriverId?|int32transportTypeId?|int32userId?|int32warehouseId?|int32butcheringStockIntakeInternalNumber?|int32cashRegisterId?|int32dateOfCancellation?|date-timeinvoice?|int32isButchering?boolean|nullisInternal?boolean|nullisProduction?boolean|nulloriginalInternalNumber?|int32sectorId?|int32application/json- response
id?|Row id of the document. Read-only; the server assigns it.
int32internalNumber?|Internal document number, unique within the document type and reserved when the document is created. Read-only.
int32items?array<>|The document's items. Null when the document was loaded without them.
branchId?|int32cancellationInternalNumber?|int32createdAt?|date-timecustomerId?|int32dateOfAccountingPosting?|date-timedateOfOrder?|date-timedateOfProcessing?|date-timedateOfTransfer?|date-timedeliveryDate?|date-timedocumentStateId?|int32formNumber?|length <= 150guid?|guidisCancellation?boolean|nullisConfirmed?boolean|nullisExported?boolean|nullisImported?boolean|nullisLocked?boolean|nullisPartialCancellation?boolean|nullisPrinted?boolean|nullisProcessed?boolean|nulllastModify?|date-timelockOwner?|length <= 80note?string|nullorderInternalNumber?|int32orderText?|length <= 50partialCancellationInternalNumber?|int32processedByUserId?|int32reasonForIssuanceOfGoodsId?|int32routeId?|int32totalDiscount?|decimaltotalNumberOfItems?|int32totalNumberOfPieces?|decimaltotalPrice?|decimaltotalPriceWoVat?|decimaltotalStockPrice?|decimaltotalStockPriceWoVat?|decimaltransportDriverId?|int32transportTypeId?|int32userId?|int32warehouseId?|int32butcheringStockIntakeInternalNumber?|int32cashRegisterId?|int32dateOfCancellation?|date-timeinvoice?|int32isButchering?boolean|nullisInternal?boolean|nullisProduction?boolean|nulloriginalInternalNumber?|int32sectorId?|int32curl -X PUT 'https://<your-instance>/api/documents/expedition/write-offs/0' \ -H 'Authorization: Bearer <access-token>' \ -H 'Content-Type: application/json' \ -d '{ "note": "Updated write-off notes"}'{ "id": 0, "internalNumber": 0, "items": [ { "id": 0, "internalNumber": 0, "item": 0, "productId": 0, "variants": [ { "colorId": 0, "dimensionId": 0, "id": 0, "itemId": 0, "lengthId": 0, "quantity": 0, "sizeId": 0, "orderCustomerItemVariantId": 0, "orderInternetItemVariantId": 0, "price": 0, "priceWoVat": 0, "reservationItemVariantId": 0 } ], "barcode": "string", "batchId": 0, "createdAt": "2019-08-24T14:15:22Z", "discount": 0, "exchangeRate": 0, "foreignCurrency": "str", "foreignCurrencyId": 0, "guid": "string", "isCancellation": true, "isPartialCancellation": true, "lastModify": "2019-08-24T14:15:22Z", "locationId": 0, "note": "string", "orderInternalNumber": 0, "orderInternetItemId": 0, "orderItemId": 0, "packageId": 0, "packagePrice": 0, "price": 0, "priceWoVat": 0, "priceWoVatIssued": 0, "promotionId": 0, "quantity": 0, "quantityCoefficient": 0, "quantityIssued": 0, "recyclingFee": 0, "recyclingFeeId": 0, "referencePrice": 0, "reservationItemId": 0, "retailPrice": 0, "royalty": 0, "royaltyId": 0, "setPrice": 0, "stockPrice": 0, "totalForeignPrice": 0, "unitId": 0, "unitIdIssued": 0, "userId": 0, "variantId": 0, "vatRate": 0, "warehouseSellingPrice": 0, "weight": 0, "cashRegisterId": 0, "reasonForIssuanceOfGoodsId": 0 } ], "branchId": 0, "cancellationInternalNumber": 0, "createdAt": "2019-08-24T14:15:22Z", "customerId": 0, "dateOfAccountingPosting": "2019-08-24T14:15:22Z", "dateOfOrder": "2019-08-24T14:15:22Z", "dateOfProcessing": "2019-08-24T14:15:22Z", "dateOfTransfer": "2019-08-24T14:15:22Z", "deliveryDate": "2019-08-24T14:15:22Z", "documentStateId": 0, "formNumber": "string", "guid": "string", "isCancellation": true, "isConfirmed": true, "isExported": true, "isImported": true, "isLocked": true, "isPartialCancellation": true, "isPrinted": true, "isProcessed": true, "lastModify": "2019-08-24T14:15:22Z", "lockOwner": "string", "note": "string", "orderInternalNumber": 0, "orderText": "string", "partialCancellationInternalNumber": 0, "processedByUserId": 0, "reasonForIssuanceOfGoodsId": 0, "routeId": 0, "totalDiscount": 0, "totalNumberOfItems": 0, "totalNumberOfPieces": 0, "totalPrice": 0, "totalPriceWoVat": 0, "totalStockPrice": 0, "totalStockPriceWoVat": 0, "transportDriverId": 0, "transportTypeId": 0, "userId": 0, "warehouseId": 0, "butcheringStockIntakeInternalNumber": 0, "cashRegisterId": 0, "dateOfCancellation": "2019-08-24T14:15:22Z", "invoice": 0, "isButchering": true, "isInternal": true, "isProduction": true, "originalInternalNumber": 0, "sectorId": 0}Delete a write-off DELETE
Deletes the write-off together with its items and item variants. Cannot be undone. Call `GET {documentId}/check-delete` first to find out whether the delete is allowed. Requires `Permissions.WriteOffs.Delete`.
Check whether a write-off can be deleted GET
Advisory pre-flight for `DELETE {documentId}`. `canBeDeleted` is false when `blockingReasons` holds `HEADER_BLOCKED` or `ITEMS_BLOCKED`. The delete re-checks inside its own transaction, so a positive answer here is an indication rather than a guarantee. Requires `Permissions.WriteOffs.Delete`.