Skip to content

Preview a variant deletion

GET
/stores/{storeRef}/products/{productId}/variants/{variantId}/deletion-impact
curl --request GET \
--url https://apibase.ecomweb.app/api/v1/stores/example/products/1/variants/1/deletion-impact \
--header 'x-api-key: <x-api-key>'

Returns what deleting the variant would affect, without deleting anything: order lines that would lose their link, cart lines left pointing at a missing variant, and stock-history rows that would be removed. The counts can change before you delete. Requires the write scope because it reveals order and cart activity.

Required scopes: write:products

productId
required
integer

The product ID.

variantId
required
integer

The variant ID.

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
orders_affected
required

Order lines that would lose their link to the variant.

number
carts_affected
required

Cart lines that would point at a variant that no longer exists.

number
inventory_history_entries
required

Stock-adjustment history rows that would be permanently deleted.

number

Example generated

{
"orders_affected": 1,
"carts_affected": 1,
"inventory_history_entries": 1
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The resource does not exist in this store.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}