Skip to content

List suggested promotions

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

Returns up to 10 active discount-code promotions that have started and not ended and that the merchant enabled for checkout suggestions, so a checkout can offer them to the shopper.

storeRef
required
string

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

Media typeapplication/json
object
promotions
required

Up to 10 active discount-code promotions that have started and not ended and that the merchant enabled for checkout suggestions.

Array<object>
object
code

The discount code, stored upper-case.

string
nullable
description

Description, or null.

string
nullable
type
required

What the promotion does: PRODUCT_DISCOUNT, CART_DISCOUNT, FREE_SHIPPING, FIXED_PRICE or GIFT.

string
Allowed values: PRODUCT_DISCOUNT CART_DISCOUNT FREE_SHIPPING FIXED_PRICE GIFT
discount_method

PERCENTAGE or FIXED_AMOUNT. Null for promotions without a discount value.

string
nullable
Allowed values: PERCENTAGE FIXED_AMOUNT
discount_value

The discount: a percentage or an amount, depending on discount_method. Null when not set.

number
nullable
max_discount_amount

Cap on the discount for a percentage promotion. Null when there is none.

number
nullable
min_amount

Minimum order amount the promotion needs. Null when there is none.

number
nullable
min_quantity

Minimum number of items the promotion needs. Null when there is none.

number
nullable
end_at

When the promotion ends, as an ISO 8601 timestamp. Null when it has no end date.

string
nullable
id
required

Promotion ID.

number
name
required

Promotion name.

string
start_at
required

When the promotion starts, as an ISO 8601 timestamp.

string
success
required

Always true.

boolean

Example

{
"promotions": [
{
"type": "PRODUCT_DISCOUNT",
"discount_method": "PERCENTAGE"
}
]
}

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 on a Storefront route that needs a secret key, 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"
}