WinShopAPI docs
ReferenceDocumentsOrdersSupplier

Check whether an item variant can be deleted

Advisory pre-flight for `DELETE {documentId}/items/{itemId}/variants/{variantId}`. `blockingReasons` holds `ITEM_VARIANT_BLOCKED` when the variant is still referenced elsewhere. Requires `Permissions.OrderSupplier.Delete`.

GET
/api/documents/orders/supplier/{documentId}/items/{itemId}/variants/{variantId}/check-delete

Authorization

Bearer
headerAuthorizationBearer <token>

OAuth 2.0 client credentials. Obtain a client id/secret from Winshop support ([email protected]), then POST to the token URL.

Path Parameters

documentId*integer
Formatint32
itemId*integer
Formatint32
variantId*integer
Formatint32

Response Body

application/json
  1. response
blockingReasons*array<string>

Stable reason codes, see DocumentDeleteBlockingReasons. Empty when the delete is allowed.

canBeDeleted*boolean

True when nothing currently blocks the delete. The delete re-checks in its own transaction, so this is an indication rather than a guarantee.

curl -X GET 'https://<your-instance>/api/documents/orders/supplier/0/items/0/variants/0/check-delete' \  -H 'Authorization: Bearer <access-token>'
{  "blockingReasons": [    "string"  ],  "canBeDeleted": true}