Skip to content

Get promotion statistics

GET
/stores/{storeRef}/promotions/stats/overview
curl --request GET \
--url https://apibase.ecomweb.app/api/v1/stores/example/promotions/stats/overview \
--header 'x-api-key: <x-api-key>'

Returns how many promotions the store has in each status, how many times promotions were used on orders that are not cancelled, the total discount given and the five most used promotions.

Required scopes: read:promotions

storeRef
required
string

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

Media typeapplication/json
object
top_promotions
required

The five most used promotions.

Array<object>
object
id
required

Promotion ID.

number
name
required

Promotion name.

string
usage_count
required

Number of live orders that used the promotion.

number
discount_amount
required

Total discount the promotion gave across those orders.

number
total_promotions
required

Number of promotions, deleted ones excluded.

number
active_promotions
required

Number of ACTIVE promotions.

number
draft_promotions
required

Number of DRAFT promotions.

number
expired_promotions
required

Number of EXPIRED promotions.

number
disabled_promotions
required

Number of DISABLED promotions.

number
total_usage
required

Number of order uses of promotions, counting orders that are not cancelled.

number
total_discount_amount
required

Total discount given through promotions on those orders.

number

Example generated

{
"top_promotions": [
{
"id": 1,
"name": "example",
"usage_count": 1,
"discount_amount": 1
}
],
"total_promotions": 1,
"active_promotions": 1,
"draft_promotions": 1,
"expired_promotions": 1,
"disabled_promotions": 1,
"total_usage": 1,
"total_discount_amount": 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"
}