Skip to content
ShopentlyLearn

Data schemas · Discounts

Fields, types and constraints of data accepted or returned by the API.

Data schemas

ApiResponse[CampaignData]

ApiResponse_CampaignData_ · Fields, types and constraints of data accepted or returned by the API.
dataCampaignData Required

Successful response payload.

Example: {"created_at":"2026-10-07T10:00:00Z","created_by":{"kind":"admin","label":"Editorial integration","reference":"learn-api-key"},"enabled":false,"id":"example-campaign","kind":"coupon","markets":[{"currency":"PLN","market_id":"poland","minor_units":0}],"name":"Autumn guide offer","updated_at":"2026-10-07T10:00:00Z","used_count":0,"version":1}
metaContextPageMeta ContextMeta PageMeta RequestMeta Required

Response metadata.

Example: {"locale":"example","market_code":"example","market_id":"poland","pagination":{"has_more":false,"limit":1,"next_cursor":null},"request_id":"learn-example-request"}

Additional fields: No

ApiResponse[list[CampaignData]]

ApiResponse_list_CampaignData__ · Fields, types and constraints of data accepted or returned by the API.
dataArray <CampaignData > Required

Successful response payload.

Example: []
metaContextPageMeta ContextMeta PageMeta RequestMeta Required

Response metadata.

Example: {"locale":"example","market_code":"example","market_id":"poland","pagination":{"has_more":false,"limit":1,"next_cursor":null},"request_id":"learn-example-request"}

Additional fields: No

CampaignCreate

CampaignCreate · Fields, types and constraints of data accepted or returned by the API.
audienceStringOptional

Customers

Constraints
enum
["all", "guest", "customer", "selected"]
Default: "all"
benefit_typeStringOptional

Variant of the data structure described by its allowed values.

Constraints
enum
["percentage", "fixed", "none"]
Default: "percentage"
category_idsArray <String> Optional

Identifiers of related categories.

maxItems: 1000
Constraints · Array 1
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
codeString nullOptional

Stable machine-readable code.

Constraints · String 1
pattern
"^[A-Za-z0-9]{6,16}$"
Example: "LEARN10"
combine_couponsBooleanOptional

Combine with other codes

Default: false
combine_promotionsBooleanOptional

Allow this code on products with automatic promotions

Default: false
customer_idsArray <String> Optional

Customer information recorded for this resource.

maxItems: 1000
Constraints · Array 1
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
ends_atString nullOptional

Active until

String:format: "date-time"
free_shippingBooleanOptional

Free shipping

Default: false
marketsArray <MarketData-Input > Required

Markets available in the store context.

minItems: 1maxItems: 1000
Example: [{"currency":"PLN","market_id":"poland","minor_units":2}]
minimum_quantityIntegerOptional

Minimum number of items in cart

minimum: 1maximum: 2147483647
Default: 1
nameStringRequired

Resource name in the relevant context.

minLength: 1maxLength: 160
Example: "Autumn guide offer"
per_customer_limitIntegerOptional

Usage limit per customer

minimum: -1maximum: 2147483647
Default: -1
percentageStringOptional

Percentage

maxLength: 19
Constraints
pattern
"^(0|[1-9][0-9]{0,13})(\\.[0-9]{1,4})?$"
Default: "10"
product_idsArray <String> Optional

Identifiers of related products.

maxItems: 1000
Constraints · Array 1
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
product_scopeStringOptional

Products

Constraints
enum
["all", "selected"]
Default: "all"
show_accountBooleanOptional

In the customer account

Default: false
show_cartBooleanOptional

In the cart

Default: false
show_productBooleanOptional

On product pages

Default: false
starts_atString nullOptional

Active from

String:format: "date-time"
usage_limitIntegerOptional

Usage limit

minimum: -1maximum: 2147483647
Default: -1

Additional fields: No

CampaignData

CampaignData · Fields, types and constraints of data accepted or returned by the API.
audienceStringOptional

Customers

Constraints
enum
["all", "guest", "customer", "selected"]
Default: "all"
benefit_typeStringOptional

Variant of the data structure described by its allowed values.

Constraints
enum
["percentage", "fixed", "none"]
Default: "percentage"
category_idsArray <String> Optional

Identifiers of related categories.

maxItems: 1000
Constraints · Array 1
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
codeString nullOptional

Stable machine-readable code.

Constraints · String 1
pattern
"^[A-Za-z0-9]{6,16}$"
combine_couponsBooleanOptional

Combine with other codes

Default: false
combine_promotionsBooleanOptional

Allow this code on products with automatic promotions

Default: false
created_atStringRequired

Creation time.

format: "date-time"
Example: "2026-10-07T10:00:00Z"
created_byCreatorData Required

Created by

Example: {"kind":"admin","label":"Editorial integration","reference":"learn-api-key"}
customer_idsArray <String> Optional

Customer information recorded for this resource.

maxItems: 1000
Constraints · Array 1
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
enabledBooleanRequired

Whether this setting is enabled.

Example: false
ends_atString nullOptional

Active until

String:format: "date-time"
free_shippingBooleanOptional

Free shipping

Default: false
idStringRequired

Resource identifier; preserve it as returned.

Example: "example-campaign"
kindStringRequired

Variant of the data structure described by its allowed values.

Constraints
enum
["coupon", "promotion"]
Example: "coupon"
marketsArray <shopently_engine__domains__discounts__adapters__public_http__schemas__MarketData > Required

Markets available in the store context.

minItems: 1maxItems: 1000
Example: [{"currency":"PLN","market_id":"poland","minor_units":0}]
minimum_quantityIntegerOptional

Minimum number of items in cart

minimum: 1maximum: 2147483647
Default: 1
nameStringRequired

Resource name in the relevant context.

minLength: 1maxLength: 160
Example: "Autumn guide offer"
per_customer_limitIntegerOptional

Usage limit per customer

minimum: -1maximum: 2147483647
Default: -1
percentageStringOptional

Percentage

maxLength: 19
Constraints
pattern
"^(0|[1-9][0-9]{0,13})(\\.[0-9]{1,4})?$"
Default: "10"
product_idsArray <String> Optional

Identifiers of related products.

maxItems: 1000
Constraints · Array 1
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
product_scopeStringOptional

Products

Constraints
enum
["all", "selected"]
Default: "all"
show_accountBooleanOptional

In the customer account

Default: false
show_cartBooleanOptional

In the cart

Default: false
show_productBooleanOptional

On product pages

Default: false
starts_atString nullOptional

Active from

String:format: "date-time"
updated_atStringRequired

Most recent update time.

format: "date-time"
Example: "2026-10-07T10:00:00Z"
usage_limitIntegerOptional

Usage limit

minimum: -1maximum: 2147483647
Default: -1
used_countIntegerRequired

Times used

Example: 0
versionIntegerRequired

Resource version used for concurrency control.

Example: 1

Additional fields: No

CampaignStatus

CampaignStatus · Fields, types and constraints of data accepted or returned by the API.
enabledBooleanRequired

Whether this setting is enabled.

Example: false
expected_versionIntegerRequired

Version read before the write; a mismatch rejects the update.

minimum: 1maximum: 9223372036854775807
Example: 1

Additional fields: No

CampaignUpdate

CampaignUpdate · Fields, types and constraints of data accepted or returned by the API.
audienceStringOptional

Customers

Constraints
enum
["all", "guest", "customer", "selected"]
Default: "all"
benefit_typeStringOptional

Variant of the data structure described by its allowed values.

Constraints
enum
["percentage", "fixed", "none"]
Default: "percentage"
category_idsArray <String> Optional

Identifiers of related categories.

maxItems: 1000
Constraints · Array 1
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
codeString nullOptional

Stable machine-readable code.

Constraints · String 1
pattern
"^[A-Za-z0-9]{6,16}$"
Example: "LEARN10"
combine_couponsBooleanOptional

Combine with other codes

Default: false
combine_promotionsBooleanOptional

Allow this code on products with automatic promotions

Default: false
customer_idsArray <String> Optional

Customer information recorded for this resource.

maxItems: 1000
Constraints · Array 1
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
ends_atString nullOptional

Active until

String:format: "date-time"
expected_versionIntegerRequired

Version read before the write; a mismatch rejects the update.

minimum: 1maximum: 9223372036854775807
Example: 1
free_shippingBooleanOptional

Free shipping

Default: false
marketsArray <MarketData-Input > Required

Markets available in the store context.

minItems: 1maxItems: 1000
Example: [{"currency":"PLN","market_id":"poland","minor_units":2}]
minimum_quantityIntegerOptional

Minimum number of items in cart

minimum: 1maximum: 2147483647
Default: 1
nameStringRequired

Resource name in the relevant context.

minLength: 1maxLength: 160
Example: "Autumn guide offer"
per_customer_limitIntegerOptional

Usage limit per customer

minimum: -1maximum: 2147483647
Default: -1
percentageStringOptional

Percentage

maxLength: 19
Constraints
pattern
"^(0|[1-9][0-9]{0,13})(\\.[0-9]{1,4})?$"
Default: "10"
product_idsArray <String> Optional

Identifiers of related products.

maxItems: 1000
Constraints · Array 1
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
product_scopeStringOptional

Products

Constraints
enum
["all", "selected"]
Default: "all"
show_accountBooleanOptional

In the customer account

Default: false
show_cartBooleanOptional

In the cart

Default: false
show_productBooleanOptional

On product pages

Default: false
starts_atString nullOptional

Active from

String:format: "date-time"
usage_limitIntegerOptional

Usage limit

minimum: -1maximum: 2147483647
Default: -1

Additional fields: No

CreatorData

CreatorData · Fields, types and constraints of data accepted or returned by the API.
kindStringRequired

Variant of the data structure described by its allowed values.

Constraints
enum
["admin", "api"]
Example: "admin"
labelStringRequired

Resource name in the relevant context.

Example: "Editorial integration"
referenceStringRequired

Identifier of the referenced entity.

Example: "learn-api-key"

Additional fields: No

MarketData

MarketData-Input · Fields, types and constraints of data accepted or returned by the API.
currencyStringRequired

Currency code for the amount.

Constraints
pattern
"^[A-Z]{3}$"
Example: "PLN"
fixed_amountStringOptional

Discount amount

maxLength: 19
Constraints
pattern
"^(0|[1-9][0-9]{0,13})(\\.[0-9]{1,4})?$"
Default: "0"
market_idStringRequired

Market identifier returned by the context endpoint.

Constraints
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
Example: "poland"
maximum_priceString nullOptional

Maximum product price

String:maxLength: 19
Constraints · String 1
pattern
"^(0|[1-9][0-9]{0,13})(\\.[0-9]{1,4})?$"
minimum_priceString nullOptional

Minimum product price

String:maxLength: 19
Constraints · String 1
pattern
"^(0|[1-9][0-9]{0,13})(\\.[0-9]{1,4})?$"
minimum_subtotalStringOptional

Minimum cart value

maxLength: 19
Constraints
pattern
"^(0|[1-9][0-9]{0,13})(\\.[0-9]{1,4})?$"
Default: "0"
minor_unitsIntegerRequired

Number of fractional digits used by the currency.

minimum: 0maximum: 4
Example: 2

Additional fields: No

MarketData

shopently_engine__domains__discounts__adapters__public_http__schemas__MarketData · Fields, types and constraints of data accepted or returned by the API.
currencyStringRequired

Currency code for the amount.

Constraints
pattern
"^[A-Z]{3}$"
Example: "PLN"
fixed_amountStringOptional

Discount amount

maxLength: 19
Constraints
pattern
"^(0|[1-9][0-9]{0,13})(\\.[0-9]{1,4})?$"
Default: "0"
market_idStringRequired

Market identifier returned by the context endpoint.

Constraints
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
Example: "poland"
maximum_priceString nullOptional

Maximum product price

String:maxLength: 19
Constraints · String 1
pattern
"^(0|[1-9][0-9]{0,13})(\\.[0-9]{1,4})?$"
minimum_priceString nullOptional

Minimum product price

String:maxLength: 19
Constraints · String 1
pattern
"^(0|[1-9][0-9]{0,13})(\\.[0-9]{1,4})?$"
minimum_subtotalStringOptional

Minimum cart value

maxLength: 19
Constraints
pattern
"^(0|[1-9][0-9]{0,13})(\\.[0-9]{1,4})?$"
Default: "0"
minor_unitsIntegerRequired

Number of fractional digits used by the currency.

minimum: 0maximum: 4
Example: 0

Additional fields: No