Skip to main content

Promotion Object

Represents the promotion that allow creating discounts based on given conditions, and is visible to all the customers.

type Promotion implements Node, ObjectWithMetadata {
id: ID!
privateMetadata: [MetadataItem!]!
privateMetafield(
key: String!
): String
privateMetafields(
keys: [String!]
): Metadata
metadata: [MetadataItem!]!
metafield(
key: String!
): String
metafields(
keys: [String!]
): Metadata
name: String!
type: PromotionTypeEnum
description: JSON
startDate: DateTime!
endDate: DateTime
createdAt: DateTime!
updatedAt: DateTime!
rules: [PromotionRule!]
translation(
languageCode: LanguageCodeEnum!
): PromotionTranslation
events: [PromotionEvent!]
}

Fields

id ● ID!

privateMetadata ● [MetadataItem!]!

List of private metadata items. Requires staff permissions to access.

privateMetafield ● String

A single key from private metadata. Requires staff permissions to access.

Tip: Use GraphQL aliases to fetch multiple keys.

key ● String!

privateMetafields ● Metadata

Private metadata. Requires staff permissions to access. Use keys to control which fields you want to include. The default is to include everything.

keys ● [String!]

metadata ● [MetadataItem!]!

List of public metadata items. Can be accessed without permissions.

metafield ● String

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

key ● String!

metafields ● Metadata

Public metadata. Use keys to control which fields you want to include. The default is to include everything.

keys ● [String!]

name ● String!

Name of the promotion.

type ● PromotionTypeEnum

The type of the promotion. Implicate if the discount is applied on catalogue or order level.

Added in Saleor 3.19
This API is currently in Feature Preview and can be subject to changes at later point.

description ● JSON

Description of the promotion.

startDate ● DateTime!

Start date of the promotion.

endDate ● DateTime

End date of the promotion.

createdAt ● DateTime!

Date time of promotion creation.

updatedAt ● DateTime!

Date time of last update of promotion.

rules ● [PromotionRule!]

The list of promotion rules.

translation ● PromotionTranslation

Returns translated promotion fields for the given language code.

languageCode ● LanguageCodeEnum!

A language code to return the translation for promotion.

events ● [PromotionEvent!]

The list of events associated with the promotion.

Interfaces

Node

An object with an ID

ObjectWithMetadata

Returned By

promotion query

Member Of

PromotionCountableEdge object ● PromotionCreate object ● PromotionCreated object ● PromotionDelete object ● PromotionDeleted object ● PromotionEnded object ● PromotionRule object ● PromotionStarted object ● PromotionTranslate object ● PromotionUpdate object ● PromotionUpdated object