Skip to content

Count products a service copy would change

GET
/stores/{storeRef}/products/{productId}/services/copy-stats
curl --request GET \
--url 'https://apibase.ecomweb.app/api/v1/stores/example/products/1/services/copy-stats?scope=all' \
--header 'x-api-key: <x-api-key>'

Returns how many other active products would receive this product’s services in a bulk copy. scope=all counts every other active product; scope=category counts those in the same category as this product, and is refused with a 400 error if this product has no category.

Required scopes: read:products

productId
required
integer

The product ID.

storeRef
required
string

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

scope
required
string
Allowed values: all category

Example

all

Scope of bulk copy operation

Media typeapplication/json
object
affected_products_count
required

Number of products that will be affected

number

Example

{
"affected_products_count": 42
}

The request is malformed or failed validation.

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 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"
}