Skip to main content
Version: 3.x

Sale

Sales allow creating discounts for categories, collections or products and are visible to all the customers.

DEPRECATED: this type will be removed in Saleor 4.0. Use Promotion type instead.

type Sale 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: SaleType!
startDate: DateTime!
endDate: DateTime
created: DateTime!
updatedAt: DateTime!
categories(
before: String
after: String
first: Int
last: Int
): CategoryCountableConnection
collections(
before: String
after: String
first: Int
last: Int
): CollectionCountableConnection
products(
before: String
after: String
first: Int
last: Int
): ProductCountableConnection
variants(
before: String
after: String
first: Int
last: Int
): ProductVariantCountableConnection
translation(languageCode: LanguageCodeEnum!): SaleTranslation
channelListings: [SaleChannelListing!]
discountValue: Float
currency: String
}
Expand ▼

Fields

Sale.id ● ID! non-null scalar

The ID of the sale.

Sale.privateMetadata ● [MetadataItem!]! non-null object

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

Sale.privateMetafield ● String scalar

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

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.3
Sale.privateMetafield.key ● String! non-null scalar

Sale.privateMetafields ● Metadata scalar

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

Added in Saleor 3.3
Sale.privateMetafields.keys ● [String!] list scalar

Sale.metadata ● [MetadataItem!]! non-null object

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

Sale.metafield ● String scalar

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.3
Sale.metafield.key ● String! non-null scalar

Sale.metafields ● Metadata scalar

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

Added in Saleor 3.3
Sale.metafields.keys ● [String!] list scalar

Sale.name ● String! non-null scalar

The name of the sale.

Sale.type ● SaleType! non-null enum

Type of the sale, fixed or percentage.

Sale.startDate ● DateTime! non-null scalar

The start date and time of the sale.

Sale.endDate ● DateTime scalar

The end date and time of the sale.

Sale.created ● DateTime! non-null scalar

The date and time when the sale was created.

Sale.updatedAt ● DateTime! non-null scalar

The date and time when the sale was updated.

Sale.categories ● CategoryCountableConnection object

List of categories this sale applies to.

Sale.categories.before ● String scalar

Return the elements in the list that come before the specified cursor.

Sale.categories.after ● String scalar

Return the elements in the list that come after the specified cursor.

Sale.categories.first ● Int scalar

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

Sale.categories.last ● Int scalar

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

Sale.collections ● CollectionCountableConnection object

List of collections this sale applies to.

Requires MANAGE_DISCOUNTSpermission.
Sale.collections.before ● String scalar

Return the elements in the list that come before the specified cursor.

Sale.collections.after ● String scalar

Return the elements in the list that come after the specified cursor.

Sale.collections.first ● Int scalar

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

Sale.collections.last ● Int scalar

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

Sale.products ● ProductCountableConnection object

List of products this sale applies to.

Requires MANAGE_DISCOUNTSpermission.
Sale.products.before ● String scalar

Return the elements in the list that come before the specified cursor.

Sale.products.after ● String scalar

Return the elements in the list that come after the specified cursor.

Sale.products.first ● Int scalar

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

Sale.products.last ● Int scalar

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

Sale.variants ● ProductVariantCountableConnection object

List of product variants this sale applies to.

Added in Saleor 3.1
Requires MANAGE_DISCOUNTSpermission.
Sale.variants.before ● String scalar

Return the elements in the list that come before the specified cursor.

Sale.variants.after ● String scalar

Return the elements in the list that come after the specified cursor.

Sale.variants.first ● Int scalar

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

Sale.variants.last ● Int scalar

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

Sale.translation ● SaleTranslation object

Returns translated sale fields for the given language code.

Sale.translation.languageCode ● LanguageCodeEnum! non-null enum

A language code to return the translation for sale.

Sale.channelListings ● [SaleChannelListing!] list object

List of channels available for the sale.

Requires MANAGE_DISCOUNTSpermission.

Sale.discountValue ● Float scalar

Sale value.

Sale.currency ● String scalar

Currency code for sale.

Interfaces

Node interface

An object with an ID

ObjectWithMetadata interface

Returned by

sale query

Member of

SaleAddCatalogues object ● SaleChannelListingUpdate object ● SaleCountableEdge object ● SaleCreate object ● SaleCreated object ● SaleDelete object ● SaleDeleted object ● SaleRemoveCatalogues object ● SaleToggle object ● SaleTranslatableContent object ● SaleTranslate object ● SaleUpdate object ● SaleUpdated object


Was this page helpful?