From 0ee27808bb47c8b350ae4b4b0f436a1e28c32e77 Mon Sep 17 00:00:00 2001 From: Adrian Pilarczyk Date: Thu, 18 Apr 2024 09:17:11 +0200 Subject: [PATCH 01/37] Fix logger name in AcceptHostedGateway --- src/modules/authorize-net/gateways/accept-hosted-gateway.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/authorize-net/gateways/accept-hosted-gateway.ts b/src/modules/authorize-net/gateways/accept-hosted-gateway.ts index be9c16a..95d419f 100644 --- a/src/modules/authorize-net/gateways/accept-hosted-gateway.ts +++ b/src/modules/authorize-net/gateways/accept-hosted-gateway.ts @@ -59,7 +59,7 @@ export class AcceptHostedGateway implements PaymentGateway { private customerProfileManager: CustomerProfileManager; private logger = createLogger({ - name: "TransactionInitializeSessionService", + name: "AcceptHostedGateway", }); constructor() { From e8e0e6a8d0e71a20187447749aa980ef1e1d3b4d Mon Sep 17 00:00:00 2001 From: Adrian Pilarczyk Date: Thu, 18 Apr 2024 09:26:25 +0200 Subject: [PATCH 02/37] add comment about buildTransactionFromTransactionInitializePayload --- src/modules/authorize-net/authorize-transaction-builder.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/authorize-net/authorize-transaction-builder.ts b/src/modules/authorize-net/authorize-transaction-builder.ts index 33917e3..b850d49 100644 --- a/src/modules/authorize-net/authorize-transaction-builder.ts +++ b/src/modules/authorize-net/authorize-transaction-builder.ts @@ -43,6 +43,9 @@ function buildAuthorizeTransactionRequest({ return transactionRequest; } +/** + * @description This function is used to build a transaction request object that can be used to create an Authorize.net transaction. It is built from a transaction initialize payload. It includes the logic of connecting the Saleor transaction with the Authorize.net transaction. + */ function buildTransactionFromTransactionInitializePayload( payload: TransactionInitializeSessionEventFragment, ): AuthorizeNet.APIContracts.TransactionRequestType { From cd0533969b3dd1a4ddf37d3783a9e3a0dd46102b Mon Sep 17 00:00:00 2001 From: Adrian Pilarczyk Date: Thu, 18 Apr 2024 09:36:45 +0200 Subject: [PATCH 03/37] add basic boilerplate for accept.js --- .../gateways/accept-js-gateway.ts | 124 ++++++++++++++++++ .../payment-gateway-initialize-session.ts | 10 +- .../transaction-initialize-session.ts | 11 ++ .../payment-gateway-initialize-session.ts | 2 + 4 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 src/modules/authorize-net/gateways/accept-js-gateway.ts diff --git a/src/modules/authorize-net/gateways/accept-js-gateway.ts b/src/modules/authorize-net/gateways/accept-js-gateway.ts new file mode 100644 index 0000000..760dd72 --- /dev/null +++ b/src/modules/authorize-net/gateways/accept-js-gateway.ts @@ -0,0 +1,124 @@ +import type AuthorizeNet from "authorizenet"; +import { z } from "zod"; +import { getAuthorizeConfig, type AuthorizeConfig } from "../authorize-net-config"; +import { authorizeTransaction } from "../authorize-transaction-builder"; + +import { + CreateTransactionClient, + type CreateTransactionResponse, +} from "../client/create-transaction"; +import { gatewayUtils } from "./gateway-utils"; +import { + type PaymentGatewayInitializeSessionEventFragment, + type TransactionInitializeSessionEventFragment, +} from "generated/graphql"; + +import { IncorrectWebhookResponseDataError } from "@/errors"; +import { createLogger } from "@/lib/logger"; +import { type PaymentGateway } from "@/modules/webhooks/payment-gateway-initialize-session"; +import { type TransactionInitializeSessionResponse } from "@/schemas/TransactionInitializeSession/TransactionInitializeSessionResponse.mjs"; + +export const acceptJsPaymentGatewayDataSchema = z.object({}); + +type AcceptJsPaymentGatewayData = z.infer; + +// what should request `data` object include +export const acceptJsTransactionInitializeRequestDataSchema = gatewayUtils.createGatewayDataSchema( + "acceptJs", + z.object({}), +); + +// what should response `data` object include +const acceptJsTransactionInitializeResponseDataSchema = z.object({}); + +type AcceptJsTransactionInitializeResponseData = z.infer< + typeof acceptJsTransactionInitializeResponseDataSchema +>; + +const AcceptJsPaymentGatewayResponseDataError = IncorrectWebhookResponseDataError.subclass( + "AcceptJsPaymentGatewayResponseDataError", +); + +const AcceptJsTransactionInitializePayloadDataError = IncorrectWebhookResponseDataError.subclass( + "AcceptJsTransactionInitializePayloadDataError", +); + +export class AcceptJsGateway implements PaymentGateway { + private authorizeConfig: AuthorizeConfig; + + private logger = createLogger({ + name: "AcceptJsGateway", + }); + + constructor() { + this.authorizeConfig = getAuthorizeConfig(); + } + + private async buildTransactionFromPayload( + payload: TransactionInitializeSessionEventFragment, + ): Promise { + // Build initial transaction request + const transactionRequest = + authorizeTransaction.buildTransactionFromTransactionInitializePayload(payload); + + // Parse the payload `data` object + const parseResult = acceptJsTransactionInitializeRequestDataSchema.safeParse(payload.data); + + if (!parseResult.success) { + throw new AcceptJsTransactionInitializePayloadDataError( + "`data` object in the TransactionInitializeSession payload has an unexpected structure.", + { + errors: parseResult.error.errors, + }, + ); + } + + // START: Synchronize fields specific for Accept.js gateway + + // END: Synchronize fields specific for Accept.js gateway + + return transactionRequest; + } + + private mapResponseToTransactionInitializeData( + _response: CreateTransactionResponse, + ): AcceptJsTransactionInitializeResponseData { + const dataParseResult = acceptJsTransactionInitializeResponseDataSchema.safeParse({}); + + if (!dataParseResult.success) { + this.logger.error({ error: dataParseResult.error.format() }); + throw new AcceptJsPaymentGatewayResponseDataError("`data` object has unexpected structure.", { + cause: dataParseResult.error, + }); + } + + return dataParseResult.data; + } + + // If you need to return some data before creating the transaction with Accept.js, you can do it here + async initializePaymentGateway( + _payload: PaymentGatewayInitializeSessionEventFragment, + ): Promise { + return {}; + } + + async initializeTransaction( + payload: TransactionInitializeSessionEventFragment, + ): Promise { + const transactionInput = await this.buildTransactionFromPayload(payload); + const createTransactionClient = new CreateTransactionClient(); + + const createTransactionResponse = + await createTransactionClient.createTransaction(transactionInput); + + this.logger.trace("Successfully called createTransaction"); + + const data = this.mapResponseToTransactionInitializeData(createTransactionResponse); + + return { + amount: payload.action.amount, + result: "AUTHORIZATION_ACTION_REQUIRED", + data, + }; + } +} diff --git a/src/modules/webhooks/payment-gateway-initialize-session.ts b/src/modules/webhooks/payment-gateway-initialize-session.ts index 3303e7c..fc97c86 100644 --- a/src/modules/webhooks/payment-gateway-initialize-session.ts +++ b/src/modules/webhooks/payment-gateway-initialize-session.ts @@ -1,4 +1,5 @@ import { AcceptHostedGateway } from "../authorize-net/gateways/accept-hosted-gateway"; +import { AcceptJsGateway } from "../authorize-net/gateways/accept-js-gateway"; import { type PaymentGatewayInitializeSessionData } from "@/pages/api/webhooks/payment-gateway-initialize-session"; import { type PaymentGatewayInitializeSessionResponse } from "@/schemas/PaymentGatewayInitializeSession/PaymentGatewayInitializeSessionResponse.mjs"; import { type TransactionInitializeSessionResponse } from "@/schemas/TransactionInitializeSession/TransactionInitializeSessionResponse.mjs"; @@ -26,17 +27,24 @@ export class PaymentGatewayInitializeSessionService { payload: PaymentGatewayInitializeSessionEventFragment, ): Promise { const acceptHostedGateway = new AcceptHostedGateway(); + const acceptJsGateway = new AcceptJsGateway(); + const initializeAcceptHosted = acceptHostedGateway.initializePaymentGateway(payload); + const initializeAcceptJs = acceptJsGateway.initializePaymentGateway(payload); /** * @see: ApplePayGateway, PaypalGateway * Import once they are implemented. */ - const [acceptHosted] = await Promise.all([initializeAcceptHosted]); + const [acceptHosted, acceptJs] = await Promise.all([ + initializeAcceptHosted, + initializeAcceptJs, + ]); return { acceptHosted, + acceptJs, }; } } diff --git a/src/modules/webhooks/transaction-initialize-session.ts b/src/modules/webhooks/transaction-initialize-session.ts index 45b9323..d7956ed 100644 --- a/src/modules/webhooks/transaction-initialize-session.ts +++ b/src/modules/webhooks/transaction-initialize-session.ts @@ -11,6 +11,10 @@ import { PaypalGateway, paypalTransactionInitializeRequestDataSchema, } from "../authorize-net/gateways/paypal-gateway"; +import { + AcceptJsGateway, + acceptJsTransactionInitializeRequestDataSchema, +} from "../authorize-net/gateways/accept-js-gateway"; import { type TransactionInitializeSessionEventFragment } from "generated/graphql"; import { BaseError, IncorrectWebhookPayloadDataError } from "@/errors"; @@ -36,6 +40,7 @@ const transactionInitializeDataSchema = z.union([ applePayTransactionInitializeDataSchema, acceptHostedTransactionInitializeRequestDataSchema, paypalTransactionInitializeRequestDataSchema, + acceptJsTransactionInitializeRequestDataSchema, ]); const TransactionInitializePayloadDataError = IncorrectWebhookPayloadDataError.subclass( @@ -78,6 +83,12 @@ export class TransactionInitializeSessionService { return gateway.initializeTransaction(payload); } + case "acceptJs": { + const gateway = new AcceptJsGateway(); + + return gateway.initializeTransaction(payload); + } + default: throw new TransactionProcessUnsupportedPaymentMethodError( "Unsupported payment method type", diff --git a/src/pages/api/webhooks/payment-gateway-initialize-session.ts b/src/pages/api/webhooks/payment-gateway-initialize-session.ts index 5c64a86..92b6cad 100644 --- a/src/pages/api/webhooks/payment-gateway-initialize-session.ts +++ b/src/pages/api/webhooks/payment-gateway-initialize-session.ts @@ -14,6 +14,7 @@ import { } from "generated/graphql"; import { paypalPaymentGatewayResponseDataSchema } from "@/modules/authorize-net/gateways/paypal-gateway"; import { errorUtils } from "@/error-utils"; +import { acceptJsPaymentGatewayDataSchema } from "@/modules/authorize-net/gateways/accept-js-gateway"; const paymentGatewaySchema = z.union([ acceptHostedPaymentGatewayDataSchema, @@ -26,6 +27,7 @@ const dataSchema = z.object({ acceptHosted: acceptHostedPaymentGatewayDataSchema.optional(), applePay: applePayPaymentGatewayResponseDataSchema.optional(), paypal: paypalPaymentGatewayResponseDataSchema.optional(), + acceptJs: acceptJsPaymentGatewayDataSchema.optional(), }); export type PaymentGatewayInitializeSessionData = z.infer; From 9996d0c71d797190c1a5cc67171dbacd060f5e11 Mon Sep 17 00:00:00 2001 From: Adrian Pilarczyk Date: Thu, 18 Apr 2024 12:18:02 +0200 Subject: [PATCH 04/37] add comment --- .../authorize-net/gateways/accept-js-gateway.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/modules/authorize-net/gateways/accept-js-gateway.ts b/src/modules/authorize-net/gateways/accept-js-gateway.ts index 760dd72..ef2e98f 100644 --- a/src/modules/authorize-net/gateways/accept-js-gateway.ts +++ b/src/modules/authorize-net/gateways/accept-js-gateway.ts @@ -22,7 +22,9 @@ export const acceptJsPaymentGatewayDataSchema = z.object({}); type AcceptJsPaymentGatewayData = z.infer; -// what should request `data` object include +/** + * @example { data: { type: "acceptJs", data: { } } } + */ export const acceptJsTransactionInitializeRequestDataSchema = gatewayUtils.createGatewayDataSchema( "acceptJs", z.object({}), @@ -75,6 +77,15 @@ export class AcceptJsGateway implements PaymentGateway { // START: Synchronize fields specific for Accept.js gateway + // const payment = new AuthorizeNet.APIContracts.PaymentType(); + // const opaqueData = new AuthorizeNet.APIContracts.OpaqueDataType(); + + // opaqueData.setDataDescriptor(""); + // opaqueData.setDataValue(""); + + // payment.setOpaqueData(opaqueData); + // transactionRequest.setPayment(payment); + // END: Synchronize fields specific for Accept.js gateway return transactionRequest; From 09aaeb80496631fa2656a83eb332521e251c6c66 Mon Sep 17 00:00:00 2001 From: Adrian Pilarczyk Date: Thu, 18 Apr 2024 12:43:57 +0200 Subject: [PATCH 05/37] update saleor schema version --- .graphqlrc.yml | 1 + graphql/schema.graphql | 24833 ++++++++++++++++++++----------- graphql/subscriptions/.gitkeep | 0 package.json | 2 +- 4 files changed, 16110 insertions(+), 8726 deletions(-) delete mode 100644 graphql/subscriptions/.gitkeep diff --git a/.graphqlrc.yml b/.graphqlrc.yml index 38ba902..f496de7 100644 --- a/.graphqlrc.yml +++ b/.graphqlrc.yml @@ -18,6 +18,7 @@ extensions: scalars: _Any: "unknown" Date: "string" + Day: "number" DateTime: "string" Decimal: "number" Minute: "number" diff --git a/graphql/schema.graphql b/graphql/schema.graphql index df3369e..643a918 100644 --- a/graphql/schema.graphql +++ b/graphql/schema.graphql @@ -10,6 +10,15 @@ directive @doc( category: String! ) on ENUM | FIELD | FIELD_DEFINITION | INPUT_OBJECT | OBJECT +"""Webhook events triggered by a specific location.""" +directive @webhookEventsInfo( + """List of asynchronous webhook events triggered by a specific location.""" + asyncEvents: [WebhookEventTypeAsyncEnum!]! + + """List of synchronous webhook events triggered by a specific location.""" + syncEvents: [WebhookEventTypeSyncEnum!]! +) on FIELD | FIELD_DEFINITION | INPUT_OBJECT | OBJECT + type Query { """ Look up a webhook by ID. Requires one of the following permissions: MANAGE_APPS, OWNER. @@ -344,6 +353,15 @@ type Query { """Filtering options for categories.""" filter: CategoryFilterInput + """ + Where filtering options. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + where: CategoryWhereInput + """Sort categories.""" sortBy: CategorySortingInput @@ -397,6 +415,15 @@ type Query { """Filtering options for collections.""" filter: CollectionFilterInput + """ + Where filtering options. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + where: CollectionWhereInput + """Sort collections.""" sortBy: CollectionSortingInput @@ -448,9 +475,25 @@ type Query { """Filtering options for products.""" filter: ProductFilterInput + """ + Where filtering options. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + where: ProductWhereInput + """Sort products.""" sortBy: ProductOrder + """ + Search products. + + Added in Saleor 3.14. + """ + search: String + """Slug of a channel for which the data should be returned.""" channel: String @@ -536,6 +579,15 @@ type Query { """Filtering options for product variant.""" filter: ProductVariantFilterInput + """ + Where filtering options. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + where: ProductVariantWhereInput + """Sort products variants.""" sortBy: ProductVariantSortingInput @@ -583,7 +635,7 @@ type Query { Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. """ last: Int - ): ProductVariantCountableConnection @doc(category: "Products") + ): ProductVariantCountableConnection @doc(category: "Products") @deprecated(reason: "This field will be removed in Saleor 4.0.") """ Look up a payment by ID. @@ -631,8 +683,15 @@ type Query { Requires one of the following permissions: HANDLE_PAYMENTS. """ transaction( - """ID of a transaction.""" - id: ID! + """ + ID of a transaction. Either it or token is required to fetch the transaction data. + """ + id: ID + + """ + Token of a transaction. Either it or ID is required to fetch the transaction data. + """ + token: UUID ): TransactionItem @doc(category: "Payments") """Look up a page by ID or slug.""" @@ -721,7 +780,7 @@ type Query { Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. """ last: Int - ): OrderEventCountableConnection @doc(category: "Orders") + ): OrderEventCountableConnection @doc(category: "Orders") @deprecated(reason: "This field will be removed in Saleor 4.0.") """Look up an order by ID or external reference.""" order( @@ -808,7 +867,7 @@ type Query { """Slug of a channel for which the data should be returned.""" channel: String - ): TaxedMoney @doc(category: "Orders") + ): TaxedMoney @doc(category: "Orders") @deprecated(reason: "This field will be removed in Saleor 4.0.") """Look up an order by token.""" orderByToken( @@ -930,6 +989,15 @@ type Query { """ filter: GiftCardFilterInput + """ + Search gift cards by email and name of user, who created or used the gift card, and by code. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + search: String + """Return the elements in the list that come before the specified cursor.""" before: String @@ -1034,7 +1102,7 @@ type Query { """Slug of a channel for which the data should be returned.""" channel: String - ): Sale @doc(category: "Discounts") + ): Sale @doc(category: "Discounts") @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `promotion` query instead.") """ List of the shop's sales. @@ -1073,7 +1141,7 @@ type Query { Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. """ last: Int - ): SaleCountableConnection @doc(category: "Discounts") + ): SaleCountableConnection @doc(category: "Discounts") @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `promotions` query instead.") """ Look up a voucher by ID. @@ -1127,6 +1195,53 @@ type Query { last: Int ): VoucherCountableConnection @doc(category: "Discounts") + """ + Look up a promotion by ID. + + Added in Saleor 3.17. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + """ + promotion( + """ID of the promotion.""" + id: ID! + ): Promotion @doc(category: "Discounts") + + """ + List of the promotions. + + Added in Saleor 3.17. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + """ + promotions( + """Where filtering options.""" + where: PromotionWhereInput + + """Sort promotions.""" + sortBy: PromotionSortingInput + + """Return the elements in the list that come before the specified cursor.""" + before: String + + """Return the elements in the list that come after the specified cursor.""" + after: String + + """ + Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. + """ + first: Int + + """ + Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. + """ + last: Int + ): PromotionCountableConnection @doc(category: "Discounts") + """ Look up a export file by ID. @@ -1169,7 +1284,11 @@ type Query { """List of all tax rates available from tax gateway.""" taxTypes: [TaxType!] @doc(category: "Taxes") - """Look up a checkout by token and slug of channel.""" + """ + Look up a checkout by id. + + Requires one of the following permissions to query checkouts that belong to other users: MANAGE_CHECKOUTS, IMPERSONATE_USER. + """ checkout( """ The checkout's ID. @@ -1430,7 +1549,11 @@ type Query { cityArea: String ): AddressValidationData @doc(category: "Users") - """Look up an address by ID.""" + """ + Look up an address by ID. + + Requires one of the following permissions: MANAGE_USERS, OWNER. + """ address( """ID of an address.""" id: ID! @@ -1561,8 +1684,11 @@ type Query { """Webhook.""" type Webhook implements Node @doc(category: "Webhooks") { + """The ID of webhook.""" id: ID! - name: String! + + """The name of webhook.""" + name: String """List of webhook events.""" events: [WebhookEvent!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `asyncEvents` or `syncEvents` instead.") @@ -1572,6 +1698,8 @@ type Webhook implements Node @doc(category: "Webhooks") { """List of asynchronous webhook events.""" asyncEvents: [WebhookEventAsync!]! + + """The app associated with Webhook.""" app: App! """Event deliveries.""" @@ -1638,9 +1766,34 @@ type WebhookEvent @doc(category: "Webhooks") { """Enum determining type of webhook.""" enum WebhookEventTypeEnum @doc(category: "Webhooks") { - """All the events.""" + """ + All the events. + + DEPRECATED: this value will be removed in Saleor 4.0. + """ ANY_EVENTS + """An account confirmation is requested.""" + ACCOUNT_CONFIRMATION_REQUESTED + + """An account email change is requested.""" + ACCOUNT_CHANGE_EMAIL_REQUESTED + + """An account email was changed""" + ACCOUNT_EMAIL_CHANGED + + """Setting a new password for the account is requested.""" + ACCOUNT_SET_PASSWORD_REQUESTED + + """An account is confirmed.""" + ACCOUNT_CONFIRMED + + """An account delete is requested.""" + ACCOUNT_DELETE_REQUESTED + + """An account is deleted.""" + ACCOUNT_DELETED + """A new address created.""" ADDRESS_CREATED @@ -1701,6 +1854,9 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """A channel status is changed.""" CHANNEL_STATUS_CHANGED + """A channel metadata is updated.""" + CHANNEL_METADATA_UPDATED + """A new gift card created.""" GIFT_CARD_CREATED @@ -1729,6 +1885,13 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """ GIFT_CARD_METADATA_UPDATED + """ + A gift card export is completed. + + Added in Saleor 3.16. + """ + GIFT_CARD_EXPORT_COMPLETED + """A new menu created.""" MENU_CREATED @@ -1755,9 +1918,36 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """ ORDER_CONFIRMED + """ + Payment has been made. The order may be partially or fully paid. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + ORDER_PAID + """Payment is made and an order is fully paid.""" ORDER_FULLY_PAID + """ + The order received a refund. The order may be partially or fully refunded. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + ORDER_REFUNDED + + """ + The order is fully refunded. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + ORDER_FULLY_REFUNDED + """ An order is updated; triggered for all changes related to an order; covers all other order webhooks, except for ORDER_CREATED. """ @@ -1779,6 +1969,32 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """ ORDER_METADATA_UPDATED + """ + Orders are imported. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + ORDER_BULK_CREATED + + """A new fulfillment is created.""" + FULFILLMENT_CREATED + + """A fulfillment is cancelled.""" + FULFILLMENT_CANCELED + + """A fulfillment is approved.""" + FULFILLMENT_APPROVED + + """ + A fulfillment metadata is updated. + + Added in Saleor 3.8. + """ + FULFILLMENT_METADATA_UPDATED + FULFILLMENT_TRACKING_NUMBER_UPDATED + """A draft order is created.""" DRAFT_ORDER_CREATED @@ -1800,6 +2016,30 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """A sale is activated or deactivated.""" SALE_TOGGLE + """A promotion is created.""" + PROMOTION_CREATED + + """A promotion is updated.""" + PROMOTION_UPDATED + + """A promotion is deleted.""" + PROMOTION_DELETED + + """A promotion is activated.""" + PROMOTION_STARTED + + """A promotion is deactivated.""" + PROMOTION_ENDED + + """A promotion rule is created.""" + PROMOTION_RULE_CREATED + + """A promotion rule is updated.""" + PROMOTION_RULE_UPDATED + + """A promotion rule is deleted.""" + PROMOTION_RULE_DELETED + """An invoice for order requested.""" INVOICE_REQUESTED @@ -1850,6 +2090,20 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """A product is deleted.""" PRODUCT_DELETED + """ + A product metadata is updated. + + Added in Saleor 3.8. + """ + PRODUCT_METADATA_UPDATED + + """ + A product export is completed. + + Added in Saleor 3.16. + """ + PRODUCT_EXPORT_COMPLETED + """ A new product media is created. @@ -1871,22 +2125,24 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """ PRODUCT_MEDIA_DELETED - """ - A product metadata is updated. - - Added in Saleor 3.8. - """ - PRODUCT_METADATA_UPDATED - """A new product variant is created.""" PRODUCT_VARIANT_CREATED """A product variant is updated.""" PRODUCT_VARIANT_UPDATED - """A product variant is deleted.""" + """ + A product variant is deleted. Warning: this event will not be executed when parent product has been deleted. Check PRODUCT_DELETED. + """ PRODUCT_VARIANT_DELETED + """ + A product variant metadata is updated. + + Added in Saleor 3.8. + """ + PRODUCT_VARIANT_METADATA_UPDATED + """A product variant is out of stock.""" PRODUCT_VARIANT_OUT_OF_STOCK @@ -1896,13 +2152,6 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """A product variant stock is updated""" PRODUCT_VARIANT_STOCK_UPDATED - """ - A product variant metadata is updated. - - Added in Saleor 3.8. - """ - PRODUCT_VARIANT_METADATA_UPDATED - """A new checkout is created.""" CHECKOUT_CREATED @@ -1919,23 +2168,11 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """ CHECKOUT_METADATA_UPDATED - """A new fulfillment is created.""" - FULFILLMENT_CREATED - - """A fulfillment is cancelled.""" - FULFILLMENT_CANCELED - - """A fulfillment is approved.""" - FULFILLMENT_APPROVED - """ - A fulfillment metadata is updated. + User notification triggered. - Added in Saleor 3.8. + DEPRECATED: this value will be removed in Saleor 4.0. See the docs for more details about migrating from NOTIFY_USER to other events: https://docs.saleor.io/docs/next/upgrade-guides/notify-user-deprecation """ - FULFILLMENT_METADATA_UPDATED - - """User notification triggered.""" NOTIFY_USER """A new page is created.""" @@ -1999,12 +2236,8 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """A staff user is deleted.""" STAFF_DELETED - """ - An action requested for transaction. - - DEPRECATED: this subscription will be removed in Saleor 3.14 (Preview Feature). Use `TRANSACTION_CHARGE_REQUESTED`, `TRANSACTION_REFUND_REQUESTED`, `TRANSACTION_CANCELATION_REQUESTED` instead. - """ - TRANSACTION_ACTION_REQUEST + """Setting a new password for the staff account is requested.""" + STAFF_SET_PASSWORD_REQUESTED """ Transaction item metadata is updated. @@ -2043,6 +2276,8 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """A voucher is deleted.""" VOUCHER_DELETED + VOUCHER_CODES_CREATED + VOUCHER_CODES_DELETED """ A voucher metadata is updated. @@ -2051,6 +2286,13 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """ VOUCHER_METADATA_UPDATED + """ + A voucher code export is completed. + + Added in Saleor 3.18. + """ + VOUCHER_CODE_EXPORT_COMPLETED + """An observability event is created.""" OBSERVABILITY @@ -2061,26 +2303,47 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """ THUMBNAIL_CREATED + """ + Shop metadata is updated. + + Added in Saleor 3.15. + """ + SHOP_METADATA_UPDATED + + """Listing available payment gateways.""" + PAYMENT_LIST_GATEWAYS + """Authorize payment.""" PAYMENT_AUTHORIZE """Capture payment.""" PAYMENT_CAPTURE + """Refund payment.""" + PAYMENT_REFUND + + """Void payment.""" + PAYMENT_VOID + """Confirm payment.""" PAYMENT_CONFIRM - """Listing available payment gateways.""" - PAYMENT_LIST_GATEWAYS - """Process payment.""" PAYMENT_PROCESS - """Refund payment.""" - PAYMENT_REFUND + """ + Event called for checkout tax calculation. + + Added in Saleor 3.6. + """ + CHECKOUT_CALCULATE_TAXES - """Void payment.""" - PAYMENT_VOID + """ + Event called for order tax calculation. + + Added in Saleor 3.6. + """ + ORDER_CALCULATE_TAXES """ Event called when charge has been requested for transaction. @@ -2109,31 +2372,22 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") { """ TRANSACTION_CANCELATION_REQUESTED - """ - Event called for checkout tax calculation. - - Added in Saleor 3.6. - """ - CHECKOUT_CALCULATE_TAXES - - """ - Event called for order tax calculation. - - Added in Saleor 3.6. - """ - ORDER_CALCULATE_TAXES - """Fetch external shipping methods for checkout.""" SHIPPING_LIST_METHODS_FOR_CHECKOUT - """Filter shipping methods for order.""" - ORDER_FILTER_SHIPPING_METHODS - """Filter shipping methods for checkout.""" CHECKOUT_FILTER_SHIPPING_METHODS + + """Filter shipping methods for order.""" + ORDER_FILTER_SHIPPING_METHODS PAYMENT_GATEWAY_INITIALIZE_SESSION TRANSACTION_INITIALIZE_SESSION TRANSACTION_PROCESS_SESSION + LIST_STORED_PAYMENT_METHODS + STORED_PAYMENT_METHOD_DELETE_REQUESTED + PAYMENT_GATEWAY_INITIALIZE_TOKENIZATION_SESSION + PAYMENT_METHOD_INITIALIZE_TOKENIZATION_SESSION + PAYMENT_METHOD_PROCESS_TOKENIZATION_SESSION } """Synchronous webhook event.""" @@ -2147,26 +2401,40 @@ type WebhookEventSync @doc(category: "Webhooks") { """Enum determining type of webhook.""" enum WebhookEventTypeSyncEnum @doc(category: "Webhooks") { + """Listing available payment gateways.""" + PAYMENT_LIST_GATEWAYS + """Authorize payment.""" PAYMENT_AUTHORIZE """Capture payment.""" PAYMENT_CAPTURE + """Refund payment.""" + PAYMENT_REFUND + + """Void payment.""" + PAYMENT_VOID + """Confirm payment.""" PAYMENT_CONFIRM - """Listing available payment gateways.""" - PAYMENT_LIST_GATEWAYS - """Process payment.""" PAYMENT_PROCESS - """Refund payment.""" - PAYMENT_REFUND + """ + Event called for checkout tax calculation. + + Added in Saleor 3.6. + """ + CHECKOUT_CALCULATE_TAXES - """Void payment.""" - PAYMENT_VOID + """ + Event called for order tax calculation. + + Added in Saleor 3.6. + """ + ORDER_CALCULATE_TAXES """ Event called when charge has been requested for transaction. @@ -2195,31 +2463,22 @@ enum WebhookEventTypeSyncEnum @doc(category: "Webhooks") { """ TRANSACTION_CANCELATION_REQUESTED - """ - Event called for checkout tax calculation. - - Added in Saleor 3.6. - """ - CHECKOUT_CALCULATE_TAXES - - """ - Event called for order tax calculation. - - Added in Saleor 3.6. - """ - ORDER_CALCULATE_TAXES - """Fetch external shipping methods for checkout.""" SHIPPING_LIST_METHODS_FOR_CHECKOUT - """Filter shipping methods for order.""" - ORDER_FILTER_SHIPPING_METHODS - """Filter shipping methods for checkout.""" CHECKOUT_FILTER_SHIPPING_METHODS + + """Filter shipping methods for order.""" + ORDER_FILTER_SHIPPING_METHODS PAYMENT_GATEWAY_INITIALIZE_SESSION TRANSACTION_INITIALIZE_SESSION TRANSACTION_PROCESS_SESSION + LIST_STORED_PAYMENT_METHODS + STORED_PAYMENT_METHOD_DELETE_REQUESTED + PAYMENT_GATEWAY_INITIALIZE_TOKENIZATION_SESSION + PAYMENT_METHOD_INITIALIZE_TOKENIZATION_SESSION + PAYMENT_METHOD_PROCESS_TOKENIZATION_SESSION } """Asynchronous webhook event.""" @@ -2233,9 +2492,34 @@ type WebhookEventAsync @doc(category: "Webhooks") { """Enum determining type of webhook.""" enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { - """All the events.""" + """ + All the events. + + DEPRECATED: this value will be removed in Saleor 4.0. + """ ANY_EVENTS + """An account confirmation is requested.""" + ACCOUNT_CONFIRMATION_REQUESTED + + """An account email change is requested.""" + ACCOUNT_CHANGE_EMAIL_REQUESTED + + """An account email was changed""" + ACCOUNT_EMAIL_CHANGED + + """Setting a new password for the account is requested.""" + ACCOUNT_SET_PASSWORD_REQUESTED + + """An account is confirmed.""" + ACCOUNT_CONFIRMED + + """An account delete is requested.""" + ACCOUNT_DELETE_REQUESTED + + """An account is deleted.""" + ACCOUNT_DELETED + """A new address created.""" ADDRESS_CREATED @@ -2296,6 +2580,9 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { """A channel status is changed.""" CHANNEL_STATUS_CHANGED + """A channel metadata is updated.""" + CHANNEL_METADATA_UPDATED + """A new gift card created.""" GIFT_CARD_CREATED @@ -2324,6 +2611,13 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { """ GIFT_CARD_METADATA_UPDATED + """ + A gift card export is completed. + + Added in Saleor 3.16. + """ + GIFT_CARD_EXPORT_COMPLETED + """A new menu created.""" MENU_CREATED @@ -2350,9 +2644,36 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { """ ORDER_CONFIRMED + """ + Payment has been made. The order may be partially or fully paid. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + ORDER_PAID + """Payment is made and an order is fully paid.""" ORDER_FULLY_PAID + """ + The order received a refund. The order may be partially or fully refunded. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + ORDER_REFUNDED + + """ + The order is fully refunded. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + ORDER_FULLY_REFUNDED + """ An order is updated; triggered for all changes related to an order; covers all other order webhooks, except for ORDER_CREATED. """ @@ -2374,6 +2695,32 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { """ ORDER_METADATA_UPDATED + """ + Orders are imported. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + ORDER_BULK_CREATED + + """A new fulfillment is created.""" + FULFILLMENT_CREATED + + """A fulfillment is cancelled.""" + FULFILLMENT_CANCELED + + """A fulfillment is approved.""" + FULFILLMENT_APPROVED + + """ + A fulfillment metadata is updated. + + Added in Saleor 3.8. + """ + FULFILLMENT_METADATA_UPDATED + FULFILLMENT_TRACKING_NUMBER_UPDATED + """A draft order is created.""" DRAFT_ORDER_CREATED @@ -2395,6 +2742,30 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { """A sale is activated or deactivated.""" SALE_TOGGLE + """A promotion is created.""" + PROMOTION_CREATED + + """A promotion is updated.""" + PROMOTION_UPDATED + + """A promotion is deleted.""" + PROMOTION_DELETED + + """A promotion is activated.""" + PROMOTION_STARTED + + """A promotion is deactivated.""" + PROMOTION_ENDED + + """A promotion rule is created.""" + PROMOTION_RULE_CREATED + + """A promotion rule is updated.""" + PROMOTION_RULE_UPDATED + + """A promotion rule is deleted.""" + PROMOTION_RULE_DELETED + """An invoice for order requested.""" INVOICE_REQUESTED @@ -2445,6 +2816,20 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { """A product is deleted.""" PRODUCT_DELETED + """ + A product metadata is updated. + + Added in Saleor 3.8. + """ + PRODUCT_METADATA_UPDATED + + """ + A product export is completed. + + Added in Saleor 3.16. + """ + PRODUCT_EXPORT_COMPLETED + """ A new product media is created. @@ -2466,22 +2851,24 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { """ PRODUCT_MEDIA_DELETED - """ - A product metadata is updated. - - Added in Saleor 3.8. - """ - PRODUCT_METADATA_UPDATED - """A new product variant is created.""" PRODUCT_VARIANT_CREATED """A product variant is updated.""" PRODUCT_VARIANT_UPDATED - """A product variant is deleted.""" + """ + A product variant is deleted. Warning: this event will not be executed when parent product has been deleted. Check PRODUCT_DELETED. + """ PRODUCT_VARIANT_DELETED + """ + A product variant metadata is updated. + + Added in Saleor 3.8. + """ + PRODUCT_VARIANT_METADATA_UPDATED + """A product variant is out of stock.""" PRODUCT_VARIANT_OUT_OF_STOCK @@ -2491,13 +2878,6 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { """A product variant stock is updated""" PRODUCT_VARIANT_STOCK_UPDATED - """ - A product variant metadata is updated. - - Added in Saleor 3.8. - """ - PRODUCT_VARIANT_METADATA_UPDATED - """A new checkout is created.""" CHECKOUT_CREATED @@ -2514,23 +2894,11 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { """ CHECKOUT_METADATA_UPDATED - """A new fulfillment is created.""" - FULFILLMENT_CREATED - - """A fulfillment is cancelled.""" - FULFILLMENT_CANCELED - - """A fulfillment is approved.""" - FULFILLMENT_APPROVED - """ - A fulfillment metadata is updated. + User notification triggered. - Added in Saleor 3.8. + DEPRECATED: this value will be removed in Saleor 4.0. See the docs for more details about migrating from NOTIFY_USER to other events: https://docs.saleor.io/docs/next/upgrade-guides/notify-user-deprecation """ - FULFILLMENT_METADATA_UPDATED - - """User notification triggered.""" NOTIFY_USER """A new page is created.""" @@ -2594,12 +2962,8 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { """A staff user is deleted.""" STAFF_DELETED - """ - An action requested for transaction. - - DEPRECATED: this subscription will be removed in Saleor 3.14 (Preview Feature). Use `TRANSACTION_CHARGE_REQUESTED`, `TRANSACTION_REFUND_REQUESTED`, `TRANSACTION_CANCELATION_REQUESTED` instead. - """ - TRANSACTION_ACTION_REQUEST + """Setting a new password for the staff account is requested.""" + STAFF_SET_PASSWORD_REQUESTED """ Transaction item metadata is updated. @@ -2638,6 +3002,8 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { """A voucher is deleted.""" VOUCHER_DELETED + VOUCHER_CODES_CREATED + VOUCHER_CODES_DELETED """ A voucher metadata is updated. @@ -2646,6 +3012,13 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { """ VOUCHER_METADATA_UPDATED + """ + A voucher code export is completed. + + Added in Saleor 3.18. + """ + VOUCHER_CODE_EXPORT_COMPLETED + """An observability event is created.""" OBSERVABILITY @@ -2655,10 +3028,18 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") { Added in Saleor 3.12. """ THUMBNAIL_CREATED + + """ + Shop metadata is updated. + + Added in Saleor 3.15. + """ + SHOP_METADATA_UPDATED } """Represents app data.""" type App implements Node & ObjectWithMetadata @doc(category: "Apps") { + """The ID of the app.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -2670,8 +3051,6 @@ type App implements Node & ObjectWithMetadata @doc(category: "Apps") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -2679,8 +3058,6 @@ type App implements Node & ObjectWithMetadata @doc(category: "Apps") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -2693,8 +3070,6 @@ type App implements Node & ObjectWithMetadata @doc(category: "Apps") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -2702,11 +3077,16 @@ type App implements Node & ObjectWithMetadata @doc(category: "Apps") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + """ + Canonical app ID from the manifest + + Added in Saleor 3.19. + """ + identifier: String + """List of the app's permissions.""" permissions: [Permission!] @@ -2785,6 +3165,15 @@ type App implements Node & ObjectWithMetadata @doc(category: "Apps") { Added in Saleor 3.1. """ extensions: [AppExtension!]! + + """ + App's brand data. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + brand: AppBrand } interface ObjectWithMetadata { @@ -2865,6 +3254,7 @@ enum PermissionEnum @doc(category: "Users") { MANAGE_GIFT_CARD MANAGE_MENUS MANAGE_ORDERS + MANAGE_ORDERS_IMPORT MANAGE_PAGES MANAGE_PAGE_TYPES_AND_ATTRIBUTES HANDLE_PAYMENTS @@ -2898,6 +3288,7 @@ enum AppTypeEnum @doc(category: "Apps") { """Represents token data.""" type AppToken implements Node @doc(category: "Apps") { + """The ID of the app token.""" id: ID! """Name of the authenticated token.""" @@ -2909,6 +3300,7 @@ type AppToken implements Node @doc(category: "Apps") { """Represents app data.""" type AppExtension implements Node @doc(category: "Apps") { + """The ID of the app extension.""" id: ID! """List of the app extension's permissions.""" @@ -2925,9 +3317,11 @@ type AppExtension implements Node @doc(category: "Apps") { """Type of way how app extension will be opened.""" target: AppExtensionTargetEnum! + + """The app assigned to app extension.""" app: App! - """JWT token used to authenticate by thridparty app extension.""" + """JWT token used to authenticate by third-party app extension.""" accessToken: String } @@ -2961,6 +3355,62 @@ enum AppExtensionTargetEnum @doc(category: "Apps") { APP_PAGE } +""" +Represents the app's brand data. + +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type AppBrand @doc(category: "Apps") { + """ + App's logos details. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + logo: AppBrandLogo! +} + +""" +Represents the app's brand logo data. + +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type AppBrandLogo @doc(category: "Apps") { + """ + URL to the default logo image. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + default( + """ + Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended). + """ + size: Int + + """ + The format of the image. When not provided, format of the original image will be used. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + format: IconThumbnailFormatEnum = ORIGINAL + ): String! +} + +"""Thumbnail formats for icon images.""" +enum IconThumbnailFormatEnum { + ORIGINAL + WEBP +} + type EventDeliveryCountableConnection { """Pagination data for this connection.""" pageInfo: PageInfo! @@ -2997,7 +3447,10 @@ type EventDeliveryCountableEdge { """Event delivery.""" type EventDelivery implements Node { + """The ID of an event delivery.""" id: ID! + + """Creation time of an event delivery.""" createdAt: DateTime! """Event delivery status.""" @@ -3057,6 +3510,7 @@ type EventDeliveryAttemptCountableEdge { """Event delivery attempts.""" type EventDeliveryAttempt implements Node @doc(category: "Webhooks") { + """The ID of Event Delivery Attempt.""" id: ID! """Event delivery creation date and time.""" @@ -3127,6 +3581,13 @@ scalar JSONString """An enumeration.""" enum WebhookSampleEventTypeEnum @doc(category: "Webhooks") { + ACCOUNT_CONFIRMATION_REQUESTED + ACCOUNT_CHANGE_EMAIL_REQUESTED + ACCOUNT_EMAIL_CHANGED + ACCOUNT_SET_PASSWORD_REQUESTED + ACCOUNT_CONFIRMED + ACCOUNT_DELETE_REQUESTED + ACCOUNT_DELETED ADDRESS_CREATED ADDRESS_UPDATED ADDRESS_DELETED @@ -3147,12 +3608,14 @@ enum WebhookSampleEventTypeEnum @doc(category: "Webhooks") { CHANNEL_UPDATED CHANNEL_DELETED CHANNEL_STATUS_CHANGED + CHANNEL_METADATA_UPDATED GIFT_CARD_CREATED GIFT_CARD_UPDATED GIFT_CARD_DELETED GIFT_CARD_SENT GIFT_CARD_STATUS_CHANGED GIFT_CARD_METADATA_UPDATED + GIFT_CARD_EXPORT_COMPLETED MENU_CREATED MENU_UPDATED MENU_DELETED @@ -3161,12 +3624,21 @@ enum WebhookSampleEventTypeEnum @doc(category: "Webhooks") { MENU_ITEM_DELETED ORDER_CREATED ORDER_CONFIRMED + ORDER_PAID ORDER_FULLY_PAID + ORDER_REFUNDED + ORDER_FULLY_REFUNDED ORDER_UPDATED ORDER_CANCELLED ORDER_EXPIRED ORDER_FULFILLED ORDER_METADATA_UPDATED + ORDER_BULK_CREATED + FULFILLMENT_CREATED + FULFILLMENT_CANCELED + FULFILLMENT_APPROVED + FULFILLMENT_METADATA_UPDATED + FULFILLMENT_TRACKING_NUMBER_UPDATED DRAFT_ORDER_CREATED DRAFT_ORDER_UPDATED DRAFT_ORDER_DELETED @@ -3174,6 +3646,14 @@ enum WebhookSampleEventTypeEnum @doc(category: "Webhooks") { SALE_UPDATED SALE_DELETED SALE_TOGGLE + PROMOTION_CREATED + PROMOTION_UPDATED + PROMOTION_DELETED + PROMOTION_STARTED + PROMOTION_ENDED + PROMOTION_RULE_CREATED + PROMOTION_RULE_UPDATED + PROMOTION_RULE_DELETED INVOICE_REQUESTED INVOICE_DELETED INVOICE_SENT @@ -3188,25 +3668,22 @@ enum WebhookSampleEventTypeEnum @doc(category: "Webhooks") { PRODUCT_CREATED PRODUCT_UPDATED PRODUCT_DELETED + PRODUCT_METADATA_UPDATED + PRODUCT_EXPORT_COMPLETED PRODUCT_MEDIA_CREATED PRODUCT_MEDIA_UPDATED PRODUCT_MEDIA_DELETED - PRODUCT_METADATA_UPDATED PRODUCT_VARIANT_CREATED PRODUCT_VARIANT_UPDATED PRODUCT_VARIANT_DELETED + PRODUCT_VARIANT_METADATA_UPDATED PRODUCT_VARIANT_OUT_OF_STOCK PRODUCT_VARIANT_BACK_IN_STOCK PRODUCT_VARIANT_STOCK_UPDATED - PRODUCT_VARIANT_METADATA_UPDATED CHECKOUT_CREATED CHECKOUT_UPDATED CHECKOUT_FULLY_PAID CHECKOUT_METADATA_UPDATED - FULFILLMENT_CREATED - FULFILLMENT_CANCELED - FULFILLMENT_APPROVED - FULFILLMENT_METADATA_UPDATED NOTIFY_USER PAGE_CREATED PAGE_UPDATED @@ -3227,7 +3704,7 @@ enum WebhookSampleEventTypeEnum @doc(category: "Webhooks") { STAFF_CREATED STAFF_UPDATED STAFF_DELETED - TRANSACTION_ACTION_REQUEST + STAFF_SET_PASSWORD_REQUESTED TRANSACTION_ITEM_METADATA_UPDATED TRANSLATION_CREATED TRANSLATION_UPDATED @@ -3238,13 +3715,18 @@ enum WebhookSampleEventTypeEnum @doc(category: "Webhooks") { VOUCHER_CREATED VOUCHER_UPDATED VOUCHER_DELETED + VOUCHER_CODES_CREATED + VOUCHER_CODES_DELETED VOUCHER_METADATA_UPDATED + VOUCHER_CODE_EXPORT_COMPLETED OBSERVABILITY THUMBNAIL_CREATED + SHOP_METADATA_UPDATED } """Represents warehouse.""" type Warehouse implements Node & ObjectWithMetadata @doc(category: "Products") { + """The ID of the warehouse.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -3256,8 +3738,6 @@ type Warehouse implements Node & ObjectWithMetadata @doc(category: "Products") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -3265,8 +3745,6 @@ type Warehouse implements Node & ObjectWithMetadata @doc(category: "Products") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -3279,8 +3757,6 @@ type Warehouse implements Node & ObjectWithMetadata @doc(category: "Products") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -3288,14 +3764,22 @@ type Warehouse implements Node & ObjectWithMetadata @doc(category: "Products") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """Warehouse name.""" name: String! + + """Warehouse slug.""" slug: String! + + """Warehouse email.""" email: String! + + """Determine if the warehouse is private.""" isPrivate: Boolean! + + """Address of the warehouse.""" address: Address! """Warehouse company name.""" @@ -3307,6 +3791,8 @@ type Warehouse implements Node & ObjectWithMetadata @doc(category: "Products") { Added in Saleor 3.1. """ clickAndCollectOption: WarehouseClickAndCollectOptionEnum! + + """Shipping zones supported by the warehouse.""" shippingZones( """Return the elements in the list that come before the specified cursor.""" before: String @@ -3335,14 +3821,13 @@ type Warehouse implements Node & ObjectWithMetadata @doc(category: "Products") { """Represents user address data.""" type Address implements Node & ObjectWithMetadata @doc(category: "Users") { + """The ID of the address.""" id: ID! """ List of private metadata items. Requires staff permissions to access. Added in Saleor 3.10. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetadata: [MetadataItem!]! @@ -3352,8 +3837,6 @@ type Address implements Node & ObjectWithMetadata @doc(category: "Users") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.10. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -3361,8 +3844,6 @@ type Address implements Node & ObjectWithMetadata @doc(category: "Users") { 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.10. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -3370,8 +3851,6 @@ type Address implements Node & ObjectWithMetadata @doc(category: "Users") { List of public metadata items. Can be accessed without permissions. Added in Saleor 3.10. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metadata: [MetadataItem!]! @@ -3381,8 +3860,6 @@ type Address implements Node & ObjectWithMetadata @doc(category: "Users") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.10. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -3390,22 +3867,40 @@ type Address implements Node & ObjectWithMetadata @doc(category: "Users") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.10. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """The given name of the address.""" firstName: String! + + """The family name of the address.""" lastName: String! + + """Company or organization name.""" companyName: String! + + """The first line of the address.""" streetAddress1: String! + + """The second line of the address.""" streetAddress2: String! + + """The city of the address.""" city: String! + + """The district of the address.""" cityArea: String! + + """The postal code of the address.""" postalCode: String! - """Shop's default country.""" + """The country of the address.""" country: CountryDisplay! + + """The country area of the address.""" countryArea: String! + + """The phone number assigned the address.""" phone: String """Address is user's default shipping address.""" @@ -3423,7 +3918,7 @@ type CountryDisplay { country: String! """Country tax.""" - vat: VAT @deprecated(reason: "This field will be removed in Saleor 4.0. Use `TaxClassCountryRate` type to manage tax rates per country.") + vat: VAT @deprecated(reason: "This field will be removed in Saleor 4.0. Always returns `null`. Use `TaxClassCountryRate` type to manage tax rates per country.") } """Represents a VAT rate for a country.""" @@ -3475,6 +3970,7 @@ type ShippingZoneCountableEdge @doc(category: "Shipping") { Represents a shipping zone in the shop. Zones are the concept used only for grouping shipping methods in the dashboard, and are never exposed to the customers directly. """ type ShippingZone implements Node & ObjectWithMetadata @doc(category: "Shipping") { + """The ID of shipping zone.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -3486,8 +3982,6 @@ type ShippingZone implements Node & ObjectWithMetadata @doc(category: "Shipping" Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -3495,8 +3989,6 @@ type ShippingZone implements Node & ObjectWithMetadata @doc(category: "Shipping" 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -3509,8 +4001,6 @@ type ShippingZone implements Node & ObjectWithMetadata @doc(category: "Shipping" Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -3518,11 +4008,13 @@ type ShippingZone implements Node & ObjectWithMetadata @doc(category: "Shipping" Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """Shipping zone name.""" name: String! + + """Indicates if the shipping zone is default one.""" default: Boolean! """Lowest and highest prices for the shipping.""" @@ -3580,8 +4072,6 @@ type ShippingMethodType implements Node & ObjectWithMetadata @doc(category: "Shi Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -3589,8 +4079,6 @@ type ShippingMethodType implements Node & ObjectWithMetadata @doc(category: "Shi 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -3603,8 +4091,6 @@ type ShippingMethodType implements Node & ObjectWithMetadata @doc(category: "Shi Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -3612,8 +4098,6 @@ type ShippingMethodType implements Node & ObjectWithMetadata @doc(category: "Shi Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata @@ -3703,12 +4187,16 @@ enum ShippingMethodTypeEnum @doc(category: "Shipping") { WEIGHT } +"""Represents shipping method translations.""" type ShippingMethodTranslation implements Node @doc(category: "Shipping") { + """The ID of the shipping method translation.""" id: ID! """Translation language.""" language: LanguageDisplay! - name: String + + """Translated shipping method name.""" + name: String! """ Translated description of the shipping method. @@ -3716,6 +4204,13 @@ type ShippingMethodTranslation implements Node @doc(category: "Shipping") { Rich text format. For reference see https://editorjs.io/ """ description: JSONString + + """ + Represents the shipping method fields to translate. + + Added in Saleor 3.14. + """ + translatableContent: ShippingMethodTranslatableContent } type LanguageDisplay { @@ -4509,19 +5004,113 @@ enum LanguageCodeEnum { ZU_ZA } +""" +Represents shipping method's original translatable fields and related translations. +""" +type ShippingMethodTranslatableContent implements Node @doc(category: "Shipping") { + """The ID of the shipping method translatable content.""" + id: ID! + + """ + The ID of the shipping method to translate. + + Added in Saleor 3.14. + """ + shippingMethodId: ID! + + """Shipping method name to translate.""" + name: String! + + """ + Shipping method description to translate. + + Rich text format. For reference see https://editorjs.io/ + """ + description: JSONString + + """Returns translated shipping method fields for the given language code.""" + translation( + """A language code to return the translation for shipping method.""" + languageCode: LanguageCodeEnum! + ): ShippingMethodTranslation + + """ + Shipping method are the methods you'll use to get customer's orders to them. They are directly exposed to the customers. + + Requires one of the following permissions: MANAGE_SHIPPING. + """ + shippingMethod: ShippingMethodType @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") +} + """Represents shipping method channel listing.""" type ShippingMethodChannelListing implements Node @doc(category: "Shipping") { + """The ID of shipping method channel listing.""" id: ID! + + """The channel associated with the shipping method channel listing.""" channel: Channel! + + """Maximum order price.""" maximumOrderPrice: Money + + """Minimum order price.""" minimumOrderPrice: Money + + """Price of the shipping method in the associated channel.""" price: Money } """Represents channel.""" -type Channel implements Node @doc(category: "Channels") { +type Channel implements Node & ObjectWithMetadata @doc(category: "Channels") { + """The ID of the channel.""" id: ID! + """ + List of private metadata items. Requires staff permissions to access. + + Added in Saleor 3.15. + """ + privateMetadata: [MetadataItem!]! + + """ + A single key from private metadata. Requires staff permissions to access. + + Tip: Use GraphQL aliases to fetch multiple keys. + + Added in Saleor 3.15. + """ + privateMetafield(key: String!): String + + """ + 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.15. + """ + privateMetafields(keys: [String!]): Metadata + + """ + List of public metadata items. Can be accessed without permissions. + + Added in Saleor 3.15. + """ + metadata: [MetadataItem!]! + + """ + A single key from public metadata. + + Tip: Use GraphQL aliases to fetch multiple keys. + + Added in Saleor 3.15. + """ + metafield(key: String!): String + + """ + Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. + + Added in Saleor 3.15. + """ + metafields(keys: [String!]): Metadata + """Slug of the channel.""" slug: String! @@ -4602,6 +5191,35 @@ type Channel implements Node @doc(category: "Channels") { Requires one of the following permissions: MANAGE_CHANNELS, MANAGE_ORDERS. """ orderSettings: OrderSettings! + + """ + Channel-specific checkout settings. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_CHANNELS, MANAGE_CHECKOUTS. + """ + checkoutSettings: CheckoutSettings! + + """ + Channel-specific payment settings. + + Added in Saleor 3.16. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_CHANNELS, HANDLE_PAYMENTS. + """ + paymentSettings: PaymentSettings! + + """ + Channel specific tax configuration. + + Requires one of the following permissions: AUTHENTICATED_STAFF_USER, AUTHENTICATED_APP. + """ + taxConfiguration: TaxConfiguration! } """ @@ -4960,7 +5578,7 @@ type Weight { """Weight unit.""" unit: WeightUnitsEnum! - """Weight value.""" + """Weight value. Returns a value with maximal three decimal places""" value: Float! } @@ -5031,13 +5649,31 @@ type OrderSettings { markAsPaidStrategy: MarkAsPaidStrategyEnum! """ - Determine the transaction flow strategy to be used. Include the selected option in the payload sent to the payment app, as a requested action for the transaction. + The time in days after expired orders will be deleted. - Added in Saleor 3.13. + Added in Saleor 3.14. Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - defaultTransactionFlowStrategy: TransactionFlowStrategyEnum! + deleteExpiredOrdersAfter: Day! + + """ + Determine if it is possible to place unpdaid order by calling `checkoutComplete` mutation. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + allowUnpaidOrders: Boolean! + + """ + Determine if voucher applied on draft order should be count toward voucher usage. + + Added in Saleor 3.18. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + includeDraftOrderInVoucherUsage: Boolean! } """ @@ -5059,57 +5695,55 @@ enum MarkAsPaidStrategyEnum @doc(category: "Channels") { PAYMENT_FLOW } -""" -Determine the transaction flow strategy. +"""The `Day` scalar type represents number of days by integer value.""" +scalar Day - AUTHORIZATION - the processed transaction should be only authorized - CHARGE - the processed transaction should be charged. """ -enum TransactionFlowStrategyEnum @doc(category: "Payments") { - AUTHORIZATION - CHARGE -} - -"""Represents shipping method postal code rule.""" -type ShippingMethodPostalCodeRule implements Node @doc(category: "Shipping") { - """The ID of the object.""" - id: ID! - - """Start address range.""" - start: String +Represents the channel-specific checkout settings. - """End address range.""" - end: String +Added in Saleor 3.15. - """Inclusion type of the postal code rule.""" - inclusionType: PostalCodeRuleInclusionTypeEnum +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type CheckoutSettings { + """ + Default `true`. Determines if the checkout mutations should use legacy error flow. In legacy flow, all mutations can raise an exception unrelated to the requested action - (e.g. out-of-stock exception when updating checkoutShippingAddress.) If `false`, the errors will be aggregated in `checkout.problems` field. Some of the `problems` can block the finalizing checkout process. The legacy flow will be removed in Saleor 4.0. The flow with `checkout.problems` will be the default one. + + Added in Saleor 3.15.This field will be removed in Saleor 4.0. + """ + useLegacyErrorFlow: Boolean! } -"""An enumeration.""" -enum PostalCodeRuleInclusionTypeEnum @doc(category: "Shipping") { - INCLUDE - EXCLUDE +"""Represents the channel-specific payment settings.""" +type PaymentSettings { + """ + Determine the transaction flow strategy to be used. Include the selected option in the payload sent to the payment app, as a requested action for the transaction. + + Added in Saleor 3.16. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + defaultTransactionFlowStrategy: TransactionFlowStrategyEnum! } -type ProductCountableConnection @doc(category: "Products") { - """Pagination data for this connection.""" - pageInfo: PageInfo! - edges: [ProductCountableEdge!]! +""" +Determine the transaction flow strategy. - """A total count of items in the collection.""" - totalCount: Int + AUTHORIZATION - the processed transaction should be only authorized + CHARGE - the processed transaction should be charged. +""" +enum TransactionFlowStrategyEnum @doc(category: "Payments") { + AUTHORIZATION + CHARGE } -type ProductCountableEdge @doc(category: "Products") { - """The item at the end of the edge.""" - node: Product! - - """A cursor for use in pagination.""" - cursor: String! -} +""" +Channel-specific tax configuration. -"""Represents an individual item for sale in the storefront.""" -type Product implements Node & ObjectWithMetadata @doc(category: "Products") { +Added in Saleor 3.9. +""" +type TaxConfiguration implements Node & ObjectWithMetadata @doc(category: "Taxes") { + """The ID of the object.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -5121,8 +5755,6 @@ type Product implements Node & ObjectWithMetadata @doc(category: "Products") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -5130,8 +5762,6 @@ type Product implements Node & ObjectWithMetadata @doc(category: "Products") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -5144,8 +5774,6 @@ type Product implements Node & ObjectWithMetadata @doc(category: "Products") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -5153,28 +5781,190 @@ type Product implements Node & ObjectWithMetadata @doc(category: "Products") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata - seoTitle: String - seoDescription: String - name: String! + + """A channel to which the tax configuration applies to.""" + channel: Channel! + + """Determines whether taxes are charged in the given channel.""" + chargeTaxes: Boolean! """ - Description of the product. - - Rich text format. For reference see https://editorjs.io/ + The default strategy to use for tax calculation in the given channel. Taxes can be calculated either using user-defined flat rates or with a tax app. Empty value means that no method is selected and taxes are not calculated. """ - description: JSONString - productType: ProductType! - slug: String! - category: Category - created: DateTime! - updatedAt: DateTime! + taxCalculationStrategy: TaxCalculationStrategy + + """Determines whether displayed prices should include taxes.""" + displayGrossPrices: Boolean! + + """Determines whether prices are entered with the tax included.""" + pricesEnteredWithTax: Boolean! + + """List of country-specific exceptions in tax configuration.""" + countries: [TaxConfigurationPerCountry!]! + + """ + The tax app `App.identifier` that will be used to calculate the taxes for the given channel. Empty value for `TAX_APP` set as `taxCalculationStrategy` means that Saleor will iterate over all installed tax apps. If multiple tax apps exist with provided tax app id use the `App` with newest `created` date. Will become mandatory in 4.0 for `TAX_APP` `taxCalculationStrategy`. + + Added in Saleor 3.19. + """ + taxAppId: String +} + +enum TaxCalculationStrategy @doc(category: "Taxes") { + FLAT_RATES + TAX_APP +} + +""" +Country-specific exceptions of a channel's tax configuration. + +Added in Saleor 3.9. +""" +type TaxConfigurationPerCountry @doc(category: "Taxes") { + """Country in which this configuration applies.""" + country: CountryDisplay! + + """Determines whether taxes are charged in this country.""" + chargeTaxes: Boolean! + + """ + A country-specific strategy to use for tax calculation. Taxes can be calculated either using user-defined flat rates or with a tax app. If not provided, use the value from the channel's tax configuration. + """ + taxCalculationStrategy: TaxCalculationStrategy + + """ + Determines whether displayed prices should include taxes for this country. + """ + displayGrossPrices: Boolean! + + """ + The tax app `App.identifier` that will be used to calculate the taxes for the given channel and country. If not provided, use the value from the channel's tax configuration. + + Added in Saleor 3.19. + """ + taxAppId: String +} + +"""Represents shipping method postal code rule.""" +type ShippingMethodPostalCodeRule implements Node @doc(category: "Shipping") { + """The ID of the object.""" + id: ID! + + """Start address range.""" + start: String + + """End address range.""" + end: String + + """Inclusion type of the postal code rule.""" + inclusionType: PostalCodeRuleInclusionTypeEnum +} + +"""An enumeration.""" +enum PostalCodeRuleInclusionTypeEnum @doc(category: "Shipping") { + INCLUDE + EXCLUDE +} + +type ProductCountableConnection @doc(category: "Products") { + """Pagination data for this connection.""" + pageInfo: PageInfo! + edges: [ProductCountableEdge!]! + + """A total count of items in the collection.""" + totalCount: Int +} + +type ProductCountableEdge @doc(category: "Products") { + """The item at the end of the edge.""" + node: Product! + + """A cursor for use in pagination.""" + cursor: String! +} + +"""Represents an individual item for sale in the storefront.""" +type Product implements Node & ObjectWithMetadata @doc(category: "Products") { + """The ID of the product.""" + id: ID! + + """List of private metadata items. Requires staff permissions to access.""" + privateMetadata: [MetadataItem!]! + + """ + A single key from private metadata. Requires staff permissions to access. + + Tip: Use GraphQL aliases to fetch multiple keys. + + Added in Saleor 3.3. + """ + privateMetafield(key: String!): String + + """ + 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. + """ + privateMetafields(keys: [String!]): Metadata + + """List of public metadata items. Can be accessed without permissions.""" + metadata: [MetadataItem!]! + + """ + A single key from public metadata. + + Tip: Use GraphQL aliases to fetch multiple keys. + + Added in Saleor 3.3. + """ + metafield(key: String!): String + + """ + Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. + + Added in Saleor 3.3. + """ + metafields(keys: [String!]): Metadata + + """SEO title of the product.""" + seoTitle: String + + """SEO description of the product.""" + seoDescription: String + + """SEO description of the product.""" + name: String! + + """ + Description of the product. + + Rich text format. For reference see https://editorjs.io/ + """ + description: JSONString + + """Type of the product.""" + productType: ProductType! + + """Slug of the product.""" + slug: String! + category: Category + + """The date and time when the product was created.""" + created: DateTime! + + """The date and time when the product was last updated.""" + updatedAt: DateTime! chargeTaxes: Boolean! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `Channel.taxConfiguration` field to determine whether tax collection is enabled.") + + """Weight of the product.""" weight: Weight + + """Default variant of the product.""" defaultVariant: ProductVariant + + """Rating of the product.""" rating: Float """ @@ -5188,6 +5978,8 @@ type Product implements Node & ObjectWithMetadata @doc(category: "Products") { Rich text format. For reference see https://editorjs.io/ """ descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + + """Thumbnail of the product.""" thumbnail( """ Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended). @@ -5212,7 +6004,9 @@ type Product implements Node & ObjectWithMetadata @doc(category: "Products") { address: AddressInput ): ProductPricingInfo - """Whether the product is in stock and visible or not.""" + """ + Whether the product is in stock, set as available for purchase in the given channel, and published. + """ isAvailable( """ Destination address used to find warehouses where stock availability for this product is checked. If address is empty, uses `Shop.companyAddress` or fallbacks to server's `settings.DEFAULT_COUNTRY` configuration. @@ -5303,7 +6097,9 @@ type Product implements Node & ObjectWithMetadata @doc(category: "Products") { """Date when product is available for purchase.""" availableForPurchaseAt: DateTime - """Whether the product is available for purchase.""" + """ + Refers to a state that can be set by admins to control whether a product is available for purchase in storefronts. This does not guarantee the availability of stock. When set to `False`, this product is still visible to customers, but it cannot be purchased. + """ isAvailableForPurchase: Boolean """ @@ -5325,6 +6121,7 @@ type Product implements Node & ObjectWithMetadata @doc(category: "Products") { Represents a type of product. It defines what attributes are available to products of this type. """ type ProductType implements Node & ObjectWithMetadata @doc(category: "Products") { + """The ID of the product type.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -5336,8 +6133,6 @@ type ProductType implements Node & ObjectWithMetadata @doc(category: "Products") Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -5345,8 +6140,6 @@ type ProductType implements Node & ObjectWithMetadata @doc(category: "Products") 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -5359,8 +6152,6 @@ type ProductType implements Node & ObjectWithMetadata @doc(category: "Products") Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -5368,15 +6159,25 @@ type ProductType implements Node & ObjectWithMetadata @doc(category: "Products") Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """Name of the product type.""" name: String! + + """Slug of the product type.""" slug: String! + + """Whether the product type has variants.""" hasVariants: Boolean! + + """Whether shipping is required for this product type.""" isShippingRequired: Boolean! + + """Whether the product type is digital.""" isDigital: Boolean! + + """Weight of the product type.""" weight: Weight """The product type kind.""" @@ -5493,8 +6294,6 @@ type TaxClass implements Node & ObjectWithMetadata @doc(category: "Taxes") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -5502,8 +6301,6 @@ type TaxClass implements Node & ObjectWithMetadata @doc(category: "Taxes") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -5516,8 +6313,6 @@ type TaxClass implements Node & ObjectWithMetadata @doc(category: "Taxes") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -5525,8 +6320,6 @@ type TaxClass implements Node & ObjectWithMetadata @doc(category: "Taxes") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata @@ -5557,6 +6350,7 @@ type TaxClassCountryRate @doc(category: "Taxes") { Custom attribute of a product. Attributes can be assigned to products and variants at the product type level. """ type Attribute implements Node & ObjectWithMetadata @doc(category: "Attributes") { + """The ID of the attribute.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -5568,8 +6362,6 @@ type Attribute implements Node & ObjectWithMetadata @doc(category: "Attributes") Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -5577,8 +6369,6 @@ type Attribute implements Node & ObjectWithMetadata @doc(category: "Attributes") 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -5591,8 +6381,6 @@ type Attribute implements Node & ObjectWithMetadata @doc(category: "Attributes") Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -5600,8 +6388,6 @@ type Attribute implements Node & ObjectWithMetadata @doc(category: "Attributes") Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata @@ -5686,6 +6472,10 @@ type Attribute implements Node & ObjectWithMetadata @doc(category: "Attributes") """Flag indicating that attribute has predefined choices.""" withChoices: Boolean! + + """ + A list of product types that use this attribute as a product attribute. + """ productTypes( """Return the elements in the list that come before the specified cursor.""" before: String @@ -5703,6 +6493,10 @@ type Attribute implements Node & ObjectWithMetadata @doc(category: "Attributes") """ last: Int ): ProductTypeCountableConnection! + + """ + A list of product types that use this attribute as a product variant attribute. + """ productVariantTypes( """Return the elements in the list that come before the specified cursor.""" before: String @@ -5759,13 +6553,17 @@ enum AttributeTypeEnum @doc(category: "Attributes") { """An enumeration.""" enum MeasurementUnitsEnum { + MM CM + DM M KM FT YD INCH + SQ_MM SQ_CM + SQ_DM SQ_M SQ_KM SQ_FT @@ -5810,6 +6608,7 @@ type AttributeValueCountableEdge @doc(category: "Attributes") { """Represents a value of an attribute.""" type AttributeValue implements Node @doc(category: "Attributes") { + """The ID of the attribute value.""" id: ID! """Name of a value displayed in the interface.""" @@ -5867,69 +6666,163 @@ type AttributeValue implements Node @doc(category: "Attributes") { externalReference: String } +"""Represents attribute value translations.""" type AttributeValueTranslation implements Node @doc(category: "Attributes") { + """The ID of the attribute value translation.""" id: ID! """Translation language.""" language: LanguageDisplay! + + """Translated attribute value name.""" name: String! """ - Attribute value. + Translated rich-text attribute value. Rich text format. For reference see https://editorjs.io/ """ richText: JSONString - """Attribute plain text value.""" + """Translated plain text attribute value .""" plainText: String -} - -type File { - """The URL of the file.""" - url: String! - """Content type of the file.""" - contentType: String + """ + Represents the attribute value fields to translate. + + Added in Saleor 3.14. + """ + translatableContent: AttributeValueTranslatableContent } """ -The `Date` scalar type represents a Date -value as specified by -[iso8601](https://en.wikipedia.org/wiki/ISO_8601). +Represents attribute value's original translatable fields and related translations. """ -scalar Date - -input AttributeChoicesSortingInput @doc(category: "Attributes") { - """Specifies the direction in which to sort attribute choices.""" - direction: OrderDirection! +type AttributeValueTranslatableContent implements Node @doc(category: "Attributes") { + """The ID of the attribute value translatable content.""" + id: ID! - """Sort attribute choices by the selected field.""" - field: AttributeChoicesSortField! -} + """ + The ID of the attribute value to translate. + + Added in Saleor 3.14. + """ + attributeValueId: ID! -enum AttributeChoicesSortField @doc(category: "Attributes") { - """Sort attribute choice by name.""" - NAME + """Name of the attribute value to translate.""" + name: String! - """Sort attribute choice by slug.""" - SLUG -} + """ + Attribute value. + + Rich text format. For reference see https://editorjs.io/ + """ + richText: JSONString -input AttributeValueFilterInput @doc(category: "Attributes") { - search: String - ids: [ID!] -} + """Attribute plain text value.""" + plainText: String -type AttributeTranslation implements Node @doc(category: "Attributes") { - id: ID! + """Returns translated attribute value fields for the given language code.""" + translation( + """A language code to return the translation for attribute value.""" + languageCode: LanguageCodeEnum! + ): AttributeValueTranslation - """Translation language.""" - language: LanguageDisplay! - name: String! -} + """Represents a value of an attribute.""" + attributeValue: AttributeValue @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") -type ProductTypeCountableConnection @doc(category: "Products") { + """ + Associated attribute that can be translated. + + Added in Saleor 3.9. + """ + attribute: AttributeTranslatableContent +} + +""" +Represents attribute's original translatable fields and related translations. +""" +type AttributeTranslatableContent implements Node @doc(category: "Attributes") { + """The ID of the attribute translatable content.""" + id: ID! + + """ + The ID of the attribute to translate. + + Added in Saleor 3.14. + """ + attributeId: ID! + + """Name of the attribute to translate.""" + name: String! + + """Returns translated attribute fields for the given language code.""" + translation( + """A language code to return the translation for attribute.""" + languageCode: LanguageCodeEnum! + ): AttributeTranslation + + """Custom attribute of a product.""" + attribute: Attribute @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") +} + +"""Represents attribute translations.""" +type AttributeTranslation implements Node @doc(category: "Attributes") { + """The ID of the attribute translation.""" + id: ID! + + """Translation language.""" + language: LanguageDisplay! + + """Translated attribute name.""" + name: String! + + """ + Represents the attribute fields to translate. + + Added in Saleor 3.14. + """ + translatableContent: AttributeTranslatableContent +} + +type File { + """The URL of the file.""" + url: String! + + """Content type of the file.""" + contentType: String +} + +""" +The `Date` scalar type represents a Date +value as specified by +[iso8601](https://en.wikipedia.org/wiki/ISO_8601). +""" +scalar Date + +input AttributeChoicesSortingInput @doc(category: "Attributes") { + """Specifies the direction in which to sort attribute choices.""" + direction: OrderDirection! + + """Sort attribute choices by the selected field.""" + field: AttributeChoicesSortField! +} + +enum AttributeChoicesSortField @doc(category: "Attributes") { + """Sort attribute choice by name.""" + NAME + + """Sort attribute choice by slug.""" + SLUG +} + +input AttributeValueFilterInput @doc(category: "Attributes") { + search: String + ids: [ID!] + slugs: [String!] +} + +type ProductTypeCountableConnection @doc(category: "Products") { """Pagination data for this connection.""" pageInfo: PageInfo! edges: [ProductTypeCountableEdge!]! @@ -6023,9 +6916,6 @@ Added in Saleor 3.11. Note: this API is currently in Feature Preview and can be subject to changes at later point. """ input AttributeWhereInput @doc(category: "Attributes") { - valueRequired: Boolean - visibleInStorefront: Boolean - filterableInDashboard: Boolean metadata: [MetadataFilter!] ids: [ID!] name: StringFilterInput @@ -6037,6 +6927,9 @@ input AttributeWhereInput @doc(category: "Attributes") { unit: MeasurementUnitsEnumFilterInput inCollection: ID inCategory: ID + valueRequired: Boolean + visibleInStorefront: Boolean + filterableInDashboard: Boolean """List of conditions that must be met.""" AND: [AttributeWhereInput!] @@ -6096,6 +6989,7 @@ input MeasurementUnitsEnumFilterInput @doc(category: "Attributes") { Represents a single category of products. Categories allow to organize products in a tree-hierarchies which can be used for navigation in the storefront. """ type Category implements Node & ObjectWithMetadata @doc(category: "Products") { + """The ID of the category.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -6107,8 +7001,6 @@ type Category implements Node & ObjectWithMetadata @doc(category: "Products") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -6116,8 +7008,6 @@ type Category implements Node & ObjectWithMetadata @doc(category: "Products") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -6130,8 +7020,6 @@ type Category implements Node & ObjectWithMetadata @doc(category: "Products") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -6139,12 +7027,16 @@ type Category implements Node & ObjectWithMetadata @doc(category: "Products") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """SEO title of category.""" seoTitle: String + + """SEO description of category.""" seoDescription: String + + """Name of category""" name: String! """ @@ -6153,8 +7045,14 @@ type Category implements Node & ObjectWithMetadata @doc(category: "Products") { Rich text format. For reference see https://editorjs.io/ """ description: JSONString + + """Slug of the category.""" slug: String! + + """Parent category.""" parent: Category + + """Level of the category.""" level: Int! """ @@ -6164,6 +7062,13 @@ type Category implements Node & ObjectWithMetadata @doc(category: "Products") { """ descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + """ + The date and time when the category was last updated. + + Added in Saleor 3.17. + """ + updatedAt: DateTime! + """List of ancestors of the category.""" ancestors( """Return the elements in the list that come before the specified cursor.""" @@ -6194,6 +7099,15 @@ type Category implements Node & ObjectWithMetadata @doc(category: "Products") { """ filter: ProductFilterInput + """ + Filtering options for products. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + where: ProductWhereInput + """ Sort products. @@ -6239,6 +7153,8 @@ type Category implements Node & ObjectWithMetadata @doc(category: "Products") { """ last: Int ): CategoryCountableConnection + + """Background image of the category.""" backgroundImage( """ Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended). @@ -6404,6 +7320,141 @@ input PriceRangeInput { lte: Float } +input ProductWhereInput @doc(category: "Products") { + metadata: [MetadataFilter!] + ids: [ID!] + + """Filter by product name.""" + name: StringFilterInput + + """Filter by product slug.""" + slug: StringFilterInput + + """Filter by product type.""" + productType: GlobalIDFilterInput + + """Filter by product category.""" + category: GlobalIDFilterInput + + """Filter by collection.""" + collection: GlobalIDFilterInput + + """Filter by availability for purchase.""" + isAvailable: Boolean + + """Filter by public visibility.""" + isPublished: Boolean + + """Filter by visibility on the channel.""" + isVisibleInListing: Boolean + + """Filter by the publication date.""" + publishedFrom: DateTime + + """Filter by the date of availability for purchase.""" + availableFrom: DateTime + + """Filter by product with category assigned.""" + hasCategory: Boolean + + """Filter by product variant price.""" + price: DecimalFilterInput + + """Filter by the lowest variant price after discounts.""" + minimalPrice: DecimalFilterInput + + """Filter by attributes associated with the product.""" + attributes: [AttributeInput!] + + """Filter by variants having specific stock status.""" + stockAvailability: StockAvailability + + """Filter by stock of the product variant.""" + stocks: ProductStockFilterInput + + """Filter on whether product is a gift card or not.""" + giftCard: Boolean + + """Filter by product with preordered variants.""" + hasPreorderedVariants: Boolean + + """Filter by when was the most recent update.""" + updatedAt: DateTimeFilterInput + + """List of conditions that must be met.""" + AND: [ProductWhereInput!] + + """A list of conditions of which at least one must be met.""" + OR: [ProductWhereInput!] +} + +""" +Define the filtering options for foreign key fields. + +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +input GlobalIDFilterInput { + """The value equal to.""" + eq: ID + + """The value included in.""" + oneOf: [ID!] +} + +""" +Define the filtering options for decimal fields. + +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +input DecimalFilterInput { + """The value equal to.""" + eq: Decimal + + """The value included in.""" + oneOf: [Decimal!] + + """The value in range.""" + range: DecimalRangeInput +} + +""" +Custom Decimal implementation. + +Returns Decimal as a float in the API, +parses float to the Decimal on the way back. +""" +scalar Decimal + +input DecimalRangeInput { + """Decimal value greater than or equal to.""" + gte: Decimal + + """Decimal value less than or equal to.""" + lte: Decimal +} + +""" +Define the filtering options for date time fields. + +Added in Saleor 3.11. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +input DateTimeFilterInput { + """The value equal to.""" + eq: DateTime + + """The value included in.""" + oneOf: [DateTime!] + + """The value in range.""" + range: DateTimeRangeInput +} + input ProductOrder @doc(category: "Products") { """Specifies the direction in which to sort products.""" direction: OrderDirection! @@ -6515,13 +7566,21 @@ enum ThumbnailFormatEnum { WEBP } +"""Represents category translations.""" type CategoryTranslation implements Node @doc(category: "Products") { + """The ID of the category translation.""" id: ID! """Translation language.""" language: LanguageDisplay! + + """Translated SEO title.""" seoTitle: String + + """Translated SEO description.""" seoDescription: String + + """Translated category name.""" name: String """ @@ -6537,10 +7596,65 @@ type CategoryTranslation implements Node @doc(category: "Products") { Rich text format. For reference see https://editorjs.io/ """ descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + + """ + Represents the category fields to translate. + + Added in Saleor 3.14. + """ + translatableContent: CategoryTranslatableContent +} + +""" +Represents category original translatable fields and related translations. +""" +type CategoryTranslatableContent implements Node @doc(category: "Products") { + """The ID of the category translatable content.""" + id: ID! + + """ + The ID of the category to translate. + + Added in Saleor 3.14. + """ + categoryId: ID! + + """SEO title to translate.""" + seoTitle: String + + """SEO description to translate.""" + seoDescription: String + + """Name of the category translatable content.""" + name: String! + + """ + Category description to translate. + + Rich text format. For reference see https://editorjs.io/ + """ + description: JSONString + + """ + Description of the category. + + Rich text format. For reference see https://editorjs.io/ + """ + descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + + """Returns translated category fields for the given language code.""" + translation( + """A language code to return the translation for category.""" + languageCode: LanguageCodeEnum! + ): CategoryTranslation + + """Represents a single category of products.""" + category: Category @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") } """Represents a version of a product such as different size or color.""" type ProductVariant implements Node & ObjectWithMetadata @doc(category: "Products") { + """The ID of the product variant.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -6552,8 +7666,6 @@ type ProductVariant implements Node & ObjectWithMetadata @doc(category: "Product Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -6561,8 +7673,6 @@ type ProductVariant implements Node & ObjectWithMetadata @doc(category: "Product 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -6575,8 +7685,6 @@ type ProductVariant implements Node & ObjectWithMetadata @doc(category: "Product Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -6584,15 +7692,27 @@ type ProductVariant implements Node & ObjectWithMetadata @doc(category: "Product Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """The name of the product variant.""" name: String! + + """The SKU (stock keeping unit) of the product variant.""" sku: String + + """The product to which the variant belongs.""" product: Product! + + """ + Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. If the field is not provided, `Shop.trackInventoryByDefault` will be used. + """ trackInventory: Boolean! + + """The maximum quantity of this variant that a customer can purchase.""" quantityLimitPerCustomer: Int + + """The weight of the product variant.""" weight: Weight """ @@ -6701,7 +7821,11 @@ type ProductVariant implements Node & ObjectWithMetadata @doc(category: "Product Added in Saleor 3.1. """ preorder: PreorderData + + """The date and time when the product variant was created.""" created: DateTime! + + """The date and time when the product variant was last updated.""" updatedAt: DateTime! """ @@ -6712,10 +7836,15 @@ type ProductVariant implements Node & ObjectWithMetadata @doc(category: "Product externalReference: String } -"""Represents product varaint channel listing.""" +"""Represents product variant channel listing.""" type ProductVariantChannelListing implements Node @doc(category: "Products") { + """The ID of the variant channel listing.""" id: ID! + + """The channel to which the variant listing belongs.""" channel: Channel! + + """The price of the variant.""" price: Money """Cost price of the variant.""" @@ -6754,7 +7883,7 @@ type VariantPricingInfo @doc(category: "Products") { discount: TaxedMoney """The discount amount in the local currency.""" - discountLocalCurrency: TaxedMoney + discountLocalCurrency: TaxedMoney @deprecated(reason: "This field will be removed in Saleor 4.0. Always returns `null`.") """The price, with any discount subtracted.""" price: TaxedMoney @@ -6763,7 +7892,7 @@ type VariantPricingInfo @doc(category: "Products") { priceUndiscounted: TaxedMoney """The discounted price in the local currency.""" - priceLocalCurrency: TaxedMoney + priceLocalCurrency: TaxedMoney @deprecated(reason: "This field will be removed in Saleor 4.0. Always returns `null`.") } """ @@ -6814,8 +7943,27 @@ input AddressInput { """State or province.""" countryArea: String - """Phone number.""" + """ + Phone number. + + Phone numbers are validated with Google's [libphonenumber](https://github.com/google/libphonenumber) library. + """ phone: String + + """ + Address public metadata. + + Added in Saleor 3.15. + """ + metadata: [MetadataInput!] +} + +input MetadataInput { + """Key of a metadata item.""" + key: String! + + """Value of a metadata item.""" + value: String! } """Represents a custom attribute.""" @@ -6844,6 +7992,8 @@ type ProductImage @doc(category: "Products") { The new relative sorting position of the item (from -inf to +inf). 1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. """ sortOrder: Int + + """The URL of the image.""" url( """ Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended). @@ -6861,14 +8011,13 @@ type ProductImage @doc(category: "Products") { """Represents a product media.""" type ProductMedia implements Node & ObjectWithMetadata @doc(category: "Products") { + """The unique ID of the product media.""" id: ID! """ List of private metadata items. Requires staff permissions to access. Added in Saleor 3.12. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetadata: [MetadataItem!]! @@ -6878,8 +8027,6 @@ type ProductMedia implements Node & ObjectWithMetadata @doc(category: "Products" Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.12. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -6887,8 +8034,6 @@ type ProductMedia implements Node & ObjectWithMetadata @doc(category: "Products" 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.12. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -6896,8 +8041,6 @@ type ProductMedia implements Node & ObjectWithMetadata @doc(category: "Products" List of public metadata items. Can be accessed without permissions. Added in Saleor 3.12. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metadata: [MetadataItem!]! @@ -6907,8 +8050,6 @@ type ProductMedia implements Node & ObjectWithMetadata @doc(category: "Products" Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.12. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -6916,14 +8057,22 @@ type ProductMedia implements Node & ObjectWithMetadata @doc(category: "Products" Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.12. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """The sort order of the media.""" sortOrder: Int + + """The alt text of the media.""" alt: String! + + """The type of the media.""" type: ProductMediaType! + + """The oEmbed data of the media.""" oembedData: JSONString! + + """The URL of the media.""" url( """ Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended). @@ -6952,15 +8101,58 @@ enum ProductMediaType @doc(category: "Products") { VIDEO } +"""Represents product variant translations.""" type ProductVariantTranslation implements Node @doc(category: "Products") { + """The ID of the product variant translation.""" id: ID! """Translation language.""" language: LanguageDisplay! + + """Translated product variant name.""" + name: String! + + """ + Represents the product variant fields to translate. + + Added in Saleor 3.14. + """ + translatableContent: ProductVariantTranslatableContent +} + +""" +Represents product variant's original translatable fields and related translations. +""" +type ProductVariantTranslatableContent implements Node @doc(category: "Products") { + """The ID of the product variant translatable content.""" + id: ID! + + """ + The ID of the product variant to translate. + + Added in Saleor 3.14. + """ + productVariantId: ID! + + """Name of the product variant to translate.""" name: String! + + """Returns translated product variant fields for the given language code.""" + translation( + """A language code to return the translation for product variant.""" + languageCode: LanguageCodeEnum! + ): ProductVariantTranslation + + """Represents a version of a product such as different size or color.""" + productVariant: ProductVariant @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + + """List of product variant attribute values that can be translated.""" + attributeValues: [AttributeValueTranslatableContent!]! } +"""Represents digital content associated with a product variant.""" type DigitalContent implements Node & ObjectWithMetadata @doc(category: "Products") { + """The ID of the digital content.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -6972,8 +8164,6 @@ type DigitalContent implements Node & ObjectWithMetadata @doc(category: "Product Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -6981,8 +8171,6 @@ type DigitalContent implements Node & ObjectWithMetadata @doc(category: "Product 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -6995,8 +8183,6 @@ type DigitalContent implements Node & ObjectWithMetadata @doc(category: "Product Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -7004,14 +8190,22 @@ type DigitalContent implements Node & ObjectWithMetadata @doc(category: "Product Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """Default settings indicator for digital content.""" useDefaultSettings: Boolean! + + """Indicator for automatic fulfillment of digital content.""" automaticFulfillment: Boolean! + + """File associated with digital content.""" contentFile: String! + + """Maximum number of allowed downloads for the digital content.""" maxDownloads: Int + + """Number of days the URL for the digital content remains valid.""" urlValidDays: Int """List of URLs for the digital variant.""" @@ -7021,10 +8215,18 @@ type DigitalContent implements Node & ObjectWithMetadata @doc(category: "Product productVariant: ProductVariant! } +"""Represents a URL for digital content.""" type DigitalContentUrl implements Node @doc(category: "Products") { + """The ID of the digital content URL.""" id: ID! + + """Digital content associated with the URL.""" content: DigitalContent! + + """Date and time when the digital content URL was created.""" created: DateTime! + + """Number of times digital content has been downloaded.""" downloadNum: Int! """URL for digital content.""" @@ -7038,8 +8240,13 @@ scalar UUID """Represents stock.""" type Stock implements Node @doc(category: "Products") { + """The ID of stock.""" id: ID! + + """The warehouse associated with the stock.""" warehouse: Warehouse! + + """Information about the product variant.""" productVariant: ProductVariant! """ @@ -7093,7 +8300,14 @@ type ProductPricingInfo @doc(category: "Products") { discount: TaxedMoney """The discount amount in the local currency.""" - discountLocalCurrency: TaxedMoney + discountLocalCurrency: TaxedMoney @deprecated(reason: "This field will be removed in Saleor 4.0. Always returns `null`.") + + """ + Determines whether displayed prices should include taxes. + + Added in Saleor 3.9. + """ + displayGrossPrices: Boolean! """The discounted price range of the product variants.""" priceRange: TaxedMoneyRange @@ -7104,14 +8318,7 @@ type ProductPricingInfo @doc(category: "Products") { """ The discounted price range of the product variants in the local currency. """ - priceRangeLocalCurrency: TaxedMoneyRange - - """ - Determines whether this product's price displayed in a storefront should include taxes. - - Added in Saleor 3.9. - """ - displayGrossPrices: Boolean! + priceRangeLocalCurrency: TaxedMoneyRange @deprecated(reason: "This field will be removed in Saleor 4.0. Always returns `null`.") } """Represents a range of monetary values.""" @@ -7125,6 +8332,7 @@ type TaxedMoneyRange { """Represents product channel listing.""" type ProductChannelListing implements Node @doc(category: "Products") { + """The ID of the product channel listing.""" id: ID! publicationDate: Date @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `publishedAt` field to fetch the publication date.") @@ -7134,8 +8342,14 @@ type ProductChannelListing implements Node @doc(category: "Products") { Added in Saleor 3.3. """ publishedAt: DateTime + + """Indicates if the product is published in the channel.""" isPublished: Boolean! + + """The channel in which the product is listed.""" channel: Channel! + + """Indicates product visibility in the channel listings.""" visibleInListings: Boolean! availableForPurchase: Date @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `availableForPurchaseAt` field to fetch the available for purchase date.") @@ -7163,7 +8377,9 @@ type ProductChannelListing implements Node @doc(category: "Products") { """ margin: Margin - """Whether the product is available for purchase.""" + """ + Refers to a state that can be set by admins to control whether a product is available for purchase in storefronts in this channel. This does not guarantee the availability of stock. When set to `False`, this product is still visible to customers, but it cannot be purchased. + """ isAvailableForPurchase: Boolean """ @@ -7177,8 +8393,12 @@ type ProductChannelListing implements Node @doc(category: "Products") { ): ProductPricingInfo } +"""Metadata for the Margin class.""" type Margin @doc(category: "Products") { + """The starting value of the margin.""" start: Int + + """The ending value of the margin.""" stop: Int } @@ -7197,6 +8417,7 @@ enum MediaChoicesSortField @doc(category: "Products") { """Represents a collection of products.""" type Collection implements Node & ObjectWithMetadata @doc(category: "Products") { + """The ID of the collection.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -7208,8 +8429,6 @@ type Collection implements Node & ObjectWithMetadata @doc(category: "Products") Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -7217,8 +8436,6 @@ type Collection implements Node & ObjectWithMetadata @doc(category: "Products") 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -7231,8 +8448,6 @@ type Collection implements Node & ObjectWithMetadata @doc(category: "Products") Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -7240,12 +8455,16 @@ type Collection implements Node & ObjectWithMetadata @doc(category: "Products") Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """SEO title of the collection.""" seoTitle: String + + """SEO description of the collection.""" seoDescription: String + + """Name of the collection.""" name: String! """ @@ -7254,6 +8473,8 @@ type Collection implements Node & ObjectWithMetadata @doc(category: "Products") Rich text format. For reference see https://editorjs.io/ """ description: JSONString + + """Slug of the collection.""" slug: String! """ @@ -7273,6 +8494,15 @@ type Collection implements Node & ObjectWithMetadata @doc(category: "Products") """Filtering options for products.""" filter: ProductFilterInput + """ + Filtering options for products. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + where: ProductWhereInput + """Sort products.""" sortBy: ProductOrder @@ -7292,6 +8522,8 @@ type Collection implements Node & ObjectWithMetadata @doc(category: "Products") """ last: Int ): ProductCountableConnection + + """Background image of the collection.""" backgroundImage( """ Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended). @@ -7320,13 +8552,21 @@ type Collection implements Node & ObjectWithMetadata @doc(category: "Products") channelListings: [CollectionChannelListing!] } +"""Represents collection translations.""" type CollectionTranslation implements Node @doc(category: "Products") { + """The ID of the collection translation.""" id: ID! """Translation language.""" language: LanguageDisplay! + + """Translated SEO title.""" seoTitle: String + + """Translated SEO description.""" seoDescription: String + + """Translated collection name.""" name: String """ @@ -7342,10 +8582,65 @@ type CollectionTranslation implements Node @doc(category: "Products") { Rich text format. For reference see https://editorjs.io/ """ descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + + """ + Represents the collection fields to translate. + + Added in Saleor 3.14. + """ + translatableContent: CollectionTranslatableContent +} + +""" +Represents collection's original translatable fields and related translations. +""" +type CollectionTranslatableContent implements Node @doc(category: "Products") { + """The ID of the collection translatable content.""" + id: ID! + + """ + The ID of the collection to translate. + + Added in Saleor 3.14. + """ + collectionId: ID! + + """SEO title to translate.""" + seoTitle: String + + """SEO description to translate.""" + seoDescription: String + + """Collection's name to translate.""" + name: String! + + """ + Collection's description to translate. + + Rich text format. For reference see https://editorjs.io/ + """ + description: JSONString + + """ + Description of the collection. + + Rich text format. For reference see https://editorjs.io/ + """ + descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + + """Returns translated collection fields for the given language code.""" + translation( + """A language code to return the translation for collection.""" + languageCode: LanguageCodeEnum! + ): CollectionTranslation + + """Represents a collection of products.""" + collection: Collection @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") } """Represents collection channel listing.""" type CollectionChannelListing implements Node @doc(category: "Products") { + """The ID of the collection channel listing.""" id: ID! publicationDate: Date @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `publishedAt` field to fetch the publication date.") @@ -7355,17 +8650,29 @@ type CollectionChannelListing implements Node @doc(category: "Products") { Added in Saleor 3.3. """ publishedAt: DateTime + + """Indicates if the collection is published in the channel.""" isPublished: Boolean! + + """The channel to which the collection belongs.""" channel: Channel! } +"""Represents product translations.""" type ProductTranslation implements Node @doc(category: "Products") { + """The ID of the product translation.""" id: ID! """Translation language.""" language: LanguageDisplay! + + """Translated SEO title.""" seoTitle: String + + """Translated SEO description.""" seoDescription: String + + """Translated product name.""" name: String """ @@ -7381,6 +8688,63 @@ type ProductTranslation implements Node @doc(category: "Products") { Rich text format. For reference see https://editorjs.io/ """ descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + + """ + Represents the product fields to translate. + + Added in Saleor 3.14. + """ + translatableContent: ProductTranslatableContent +} + +""" +Represents product's original translatable fields and related translations. +""" +type ProductTranslatableContent implements Node @doc(category: "Products") { + """The ID of the product translatable content.""" + id: ID! + + """ + The ID of the product to translate. + + Added in Saleor 3.14. + """ + productId: ID! + + """SEO title to translate.""" + seoTitle: String + + """SEO description to translate.""" + seoDescription: String + + """Product's name to translate.""" + name: String! + + """ + Product's description to translate. + + Rich text format. For reference see https://editorjs.io/ + """ + description: JSONString + + """ + Description of the product. + + Rich text format. For reference see https://editorjs.io/ + """ + descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + + """Returns translated product fields for the given language code.""" + translation( + """A language code to return the translation for product.""" + languageCode: LanguageCodeEnum! + ): ProductTranslation + + """Represents an individual item for sale in the storefront.""" + product: Product @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + + """List of product attribute values that can be translated.""" + attributeValues: [AttributeValueTranslatableContent!]! } type WarehouseCountableConnection @doc(category: "Products") { @@ -7402,6 +8766,7 @@ type WarehouseCountableEdge @doc(category: "Products") { input WarehouseFilterInput @doc(category: "Products") { clickAndCollectOption: WarehouseClickAndCollectOptionEnum + metadata: [MetadataFilter!] search: String ids: [ID!] isPrivate: Boolean @@ -7439,188 +8804,50 @@ type TranslatableItemEdge { cursor: String! } -union TranslatableItem = ProductTranslatableContent | CollectionTranslatableContent | CategoryTranslatableContent | AttributeTranslatableContent | AttributeValueTranslatableContent | ProductVariantTranslatableContent | PageTranslatableContent | ShippingMethodTranslatableContent | SaleTranslatableContent | VoucherTranslatableContent | MenuItemTranslatableContent +union TranslatableItem = ProductTranslatableContent | CollectionTranslatableContent | CategoryTranslatableContent | AttributeTranslatableContent | AttributeValueTranslatableContent | ProductVariantTranslatableContent | PageTranslatableContent | ShippingMethodTranslatableContent | VoucherTranslatableContent | MenuItemTranslatableContent | PromotionTranslatableContent | PromotionRuleTranslatableContent | SaleTranslatableContent -type ProductTranslatableContent implements Node @doc(category: "Products") { +""" +Represents page's original translatable fields and related translations. +""" +type PageTranslatableContent implements Node @doc(category: "Pages") { + """The ID of the page translatable content.""" id: ID! + + """ + The ID of the page to translate. + + Added in Saleor 3.14. + """ + pageId: ID! + + """SEO title to translate.""" seoTitle: String + + """SEO description to translate.""" seoDescription: String - name: String! + + """Page title to translate.""" + title: String! """ - Description of the product. + Content of the page to translate. Rich text format. For reference see https://editorjs.io/ """ - description: JSONString + content: JSONString """ - Description of the product. + Content of the page. Rich text format. For reference see https://editorjs.io/ """ - descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + contentJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `content` field instead.") - """Returns translated product fields for the given language code.""" + """Returns translated page fields for the given language code.""" translation( - """A language code to return the translation for product.""" + """A language code to return the translation for page.""" languageCode: LanguageCodeEnum! - ): ProductTranslation - - """Represents an individual item for sale in the storefront.""" - product: Product @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") - - """List of product attribute values that can be translated.""" - attributeValues: [AttributeValueTranslatableContent!]! -} - -type AttributeValueTranslatableContent implements Node @doc(category: "Attributes") { - id: ID! - name: String! - - """ - Attribute value. - - Rich text format. For reference see https://editorjs.io/ - """ - richText: JSONString - - """Attribute plain text value.""" - plainText: String - - """Returns translated attribute value fields for the given language code.""" - translation( - """A language code to return the translation for attribute value.""" - languageCode: LanguageCodeEnum! - ): AttributeValueTranslation - - """Represents a value of an attribute.""" - attributeValue: AttributeValue @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") - - """ - Associated attribute that can be translated. - - Added in Saleor 3.9. - """ - attribute: AttributeTranslatableContent -} - -type AttributeTranslatableContent implements Node @doc(category: "Attributes") { - id: ID! - name: String! - - """Returns translated attribute fields for the given language code.""" - translation( - """A language code to return the translation for attribute.""" - languageCode: LanguageCodeEnum! - ): AttributeTranslation - - """Custom attribute of a product.""" - attribute: Attribute @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") -} - -type CollectionTranslatableContent implements Node @doc(category: "Products") { - id: ID! - seoTitle: String - seoDescription: String - name: String! - - """ - Description of the collection. - - Rich text format. For reference see https://editorjs.io/ - """ - description: JSONString - - """ - Description of the collection. - - Rich text format. For reference see https://editorjs.io/ - """ - descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") - - """Returns translated collection fields for the given language code.""" - translation( - """A language code to return the translation for collection.""" - languageCode: LanguageCodeEnum! - ): CollectionTranslation - - """Represents a collection of products.""" - collection: Collection @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") -} - -type CategoryTranslatableContent implements Node @doc(category: "Products") { - id: ID! - seoTitle: String - seoDescription: String - name: String! - - """ - Description of the category. - - Rich text format. For reference see https://editorjs.io/ - """ - description: JSONString - - """ - Description of the category. - - Rich text format. For reference see https://editorjs.io/ - """ - descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") - - """Returns translated category fields for the given language code.""" - translation( - """A language code to return the translation for category.""" - languageCode: LanguageCodeEnum! - ): CategoryTranslation - - """Represents a single category of products.""" - category: Category @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") -} - -type ProductVariantTranslatableContent implements Node @doc(category: "Products") { - id: ID! - name: String! - - """Returns translated product variant fields for the given language code.""" - translation( - """A language code to return the translation for product variant.""" - languageCode: LanguageCodeEnum! - ): ProductVariantTranslation - - """Represents a version of a product such as different size or color.""" - productVariant: ProductVariant @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") - - """List of product variant attribute values that can be translated.""" - attributeValues: [AttributeValueTranslatableContent!]! -} - -type PageTranslatableContent implements Node @doc(category: "Pages") { - id: ID! - seoTitle: String - seoDescription: String - title: String! - - """ - Content of the page. - - Rich text format. For reference see https://editorjs.io/ - """ - content: JSONString - - """ - Content of the page. - - Rich text format. For reference see https://editorjs.io/ - """ - contentJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `content` field instead.") - - """Returns translated page fields for the given language code.""" - translation( - """A language code to return the translation for page.""" - languageCode: LanguageCodeEnum! - ): PageTranslation + ): PageTranslation """ A static page that can be manually added by a shop operator through the dashboard. @@ -7631,13 +8858,21 @@ type PageTranslatableContent implements Node @doc(category: "Pages") { attributeValues: [AttributeValueTranslatableContent!]! } +"""Represents page translations.""" type PageTranslation implements Node @doc(category: "Pages") { + """The ID of the page translation.""" id: ID! """Translation language.""" language: LanguageDisplay! + + """Translated SEO title.""" seoTitle: String + + """Translated SEO description.""" seoDescription: String + + """Translated page title.""" title: String """ @@ -7653,12 +8888,20 @@ type PageTranslation implements Node @doc(category: "Pages") { Rich text format. For reference see https://editorjs.io/ """ contentJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `content` field instead.") + + """ + Represents the page fields to translate. + + Added in Saleor 3.14. + """ + translatableContent: PageTranslatableContent } """ A static page that can be manually added by a shop operator through the dashboard. """ type Page implements Node & ObjectWithMetadata @doc(category: "Pages") { + """ID of the page.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -7670,8 +8913,6 @@ type Page implements Node & ObjectWithMetadata @doc(category: "Pages") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -7679,8 +8920,6 @@ type Page implements Node & ObjectWithMetadata @doc(category: "Pages") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -7693,8 +8932,6 @@ type Page implements Node & ObjectWithMetadata @doc(category: "Pages") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -7702,12 +8939,16 @@ type Page implements Node & ObjectWithMetadata @doc(category: "Pages") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """Title of the page for SEO.""" seoTitle: String + + """Description of the page for SEO.""" seoDescription: String + + """Title of the page.""" title: String! """ @@ -7724,9 +8965,17 @@ type Page implements Node & ObjectWithMetadata @doc(category: "Pages") { Added in Saleor 3.3. """ publishedAt: DateTime + + """Determines if the page is published.""" isPublished: Boolean! + + """Slug of the page.""" slug: String! + + """Determines the type of page""" pageType: PageType! + + """Date and time at which page was created.""" created: DateTime! """ @@ -7750,6 +8999,7 @@ type Page implements Node & ObjectWithMetadata @doc(category: "Pages") { Represents a type of page. It defines what attributes are available to pages of this type. """ type PageType implements Node & ObjectWithMetadata @doc(category: "Pages") { + """ID of the page type.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -7761,8 +9011,6 @@ type PageType implements Node & ObjectWithMetadata @doc(category: "Pages") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -7770,8 +9018,6 @@ type PageType implements Node & ObjectWithMetadata @doc(category: "Pages") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -7784,8 +9030,6 @@ type PageType implements Node & ObjectWithMetadata @doc(category: "Pages") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -7793,11 +9037,13 @@ type PageType implements Node & ObjectWithMetadata @doc(category: "Pages") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """Name of the page type.""" name: String! + + """Slug of the page type.""" slug: String! """Page attributes of that page type.""" @@ -7837,61 +9083,61 @@ type PageType implements Node & ObjectWithMetadata @doc(category: "Pages") { hasPages: Boolean } -type ShippingMethodTranslatableContent implements Node @doc(category: "Shipping") { +""" +Represents voucher's original translatable fields and related translations. +""" +type VoucherTranslatableContent implements Node @doc(category: "Discounts") { + """The ID of the voucher translatable content.""" id: ID! - name: String! """ - Description of the shipping method. + The ID of the voucher to translate. - Rich text format. For reference see https://editorjs.io/ - """ - description: JSONString - - """Returns translated shipping method fields for the given language code.""" - translation( - """A language code to return the translation for shipping method.""" - languageCode: LanguageCodeEnum! - ): ShippingMethodTranslation - - """ - Shipping method are the methods you'll use to get customer's orders to them. They are directly exposed to the customers. - - Requires one of the following permissions: MANAGE_SHIPPING. + Added in Saleor 3.14. """ - shippingMethod: ShippingMethodType @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") -} + voucherId: ID! -type SaleTranslatableContent implements Node @doc(category: "Discounts") { - id: ID! - name: String! + """Voucher name to translate.""" + name: String - """Returns translated sale fields for the given language code.""" + """Returns translated voucher fields for the given language code.""" translation( - """A language code to return the translation for sale.""" + """A language code to return the translation for voucher.""" languageCode: LanguageCodeEnum! - ): SaleTranslation + ): VoucherTranslation """ - Sales allow creating discounts for categories, collections or products and are visible to all the customers. + Vouchers allow giving discounts to particular customers on categories, collections or specific products. They can be used during checkout by providing valid voucher codes. Requires one of the following permissions: MANAGE_DISCOUNTS. """ - sale: Sale @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + voucher: Voucher @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") } -type SaleTranslation implements Node @doc(category: "Discounts") { +"""Represents voucher translations.""" +type VoucherTranslation implements Node @doc(category: "Discounts") { + """The ID of the voucher translation.""" id: ID! """Translation language.""" language: LanguageDisplay! + + """Translated voucher name.""" name: String + + """ + Represents the voucher fields to translate. + + Added in Saleor 3.14. + """ + translatableContent: VoucherTranslatableContent } """ -Sales allow creating discounts for categories, collections or products and are visible to all the customers. +Vouchers allow giving discounts to particular customers on categories, collections or specific products. They can be used during checkout by providing valid voucher codes. """ -type Sale implements Node & ObjectWithMetadata @doc(category: "Discounts") { +type Voucher implements Node & ObjectWithMetadata @doc(category: "Discounts") { + """The ID of the voucher.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -7903,8 +9149,6 @@ type Sale implements Node & ObjectWithMetadata @doc(category: "Discounts") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -7912,8 +9156,6 @@ type Sale implements Node & ObjectWithMetadata @doc(category: "Discounts") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -7926,8 +9168,6 @@ type Sale implements Node & ObjectWithMetadata @doc(category: "Discounts") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -7935,19 +9175,18 @@ type Sale implements Node & ObjectWithMetadata @doc(category: "Discounts") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata - name: String! - type: SaleType! - startDate: DateTime! - endDate: DateTime - created: DateTime! - updatedAt: DateTime! - """List of categories this sale applies to.""" - categories( + """The name of the voucher.""" + name: String + + """ + List of codes available for this voucher. + + Added in Saleor 3.18. + """ + codes( """Return the elements in the list that come before the specified cursor.""" before: String @@ -7963,10 +9202,69 @@ type Sale implements Node & ObjectWithMetadata @doc(category: "Discounts") { Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. """ last: Int - ): CategoryCountableConnection + ): VoucherCodeCountableConnection - """ - List of collections this sale applies to. + """The code of the voucher.This field will be removed in Saleor 4.0.""" + code: String + + """The number of times a voucher can be used.""" + usageLimit: Int + + """Usage count of the voucher.""" + used: Int! + + """The start date and time of voucher.""" + startDate: DateTime! + + """The end date and time of voucher.""" + endDate: DateTime + + """ + Determine if the voucher should be applied once per order. If set to True, the voucher is applied to a single cheapest eligible product in checkout. + """ + applyOncePerOrder: Boolean! + + """ + Determine if the voucher usage should be limited to one use per customer. + """ + applyOncePerCustomer: Boolean! + + """ + Determine if the voucher codes can be used once or multiple times. + + Added in Saleor 3.18. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + singleUse: Boolean! + + """Determine if the voucher is available only for staff members.""" + onlyForStaff: Boolean! + + """Determine minimum quantity of items for checkout.""" + minCheckoutItemsQuantity: Int + + """List of categories this voucher applies to.""" + categories( + """Return the elements in the list that come before the specified cursor.""" + before: String + + """Return the elements in the list that come after the specified cursor.""" + after: String + + """ + Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. + """ + first: Int + + """ + Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. + """ + last: Int + ): CategoryCountableConnection + + """ + List of collections this voucher applies to. Requires one of the following permissions: MANAGE_DISCOUNTS. """ @@ -7989,7 +9287,7 @@ type Sale implements Node & ObjectWithMetadata @doc(category: "Discounts") { ): CollectionCountableConnection """ - List of products this sale applies to. + List of products this voucher applies to. Requires one of the following permissions: MANAGE_DISCOUNTS. """ @@ -8012,7 +9310,7 @@ type Sale implements Node & ObjectWithMetadata @doc(category: "Discounts") { ): ProductCountableConnection """ - List of product variants this sale applies to. + List of product variants this voucher applies to. Added in Saleor 3.1. @@ -8036,31 +9334,80 @@ type Sale implements Node & ObjectWithMetadata @doc(category: "Discounts") { last: Int ): ProductVariantCountableConnection - """Returns translated sale fields for the given language code.""" + """List of countries available for the shipping voucher.""" + countries: [CountryDisplay!] + + """Returns translated voucher fields for the given language code.""" translation( - """A language code to return the translation for sale.""" + """A language code to return the translation for voucher.""" languageCode: LanguageCodeEnum! - ): SaleTranslation + ): VoucherTranslation + + """Determines a type of discount for voucher - value or percentage""" + discountValueType: DiscountValueTypeEnum! + + """Voucher value.""" + discountValue: Float + + """Currency code for voucher.""" + currency: String + + """Minimum order value to apply voucher.""" + minSpent: Money + + """Determines a type of voucher.""" + type: VoucherTypeEnum! """ - List of channels available for the sale. + List of availability in channels for the voucher. Requires one of the following permissions: MANAGE_DISCOUNTS. """ - channelListings: [SaleChannelListing!] + channelListings: [VoucherChannelListing!] +} - """Sale value.""" - discountValue: Float +type VoucherCodeCountableConnection @doc(category: "Discounts") { + """Pagination data for this connection.""" + pageInfo: PageInfo! + edges: [VoucherCodeCountableEdge!]! - """Currency code for sale.""" - currency: String + """A total count of items in the collection.""" + totalCount: Int } -enum SaleType @doc(category: "Discounts") { - FIXED - PERCENTAGE +type VoucherCodeCountableEdge @doc(category: "Discounts") { + """The item at the end of the edge.""" + node: VoucherCode! + + """A cursor for use in pagination.""" + cursor: String! +} + +""" +Represents voucher code. + +Added in Saleor 3.18. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type VoucherCode { + """The ID of the voucher code.""" + id: ID! + + """Code to use the voucher.""" + code: String + + """Number of times a code has been used.""" + used: Int + + """Whether a code is active or not.""" + isActive: Boolean + + """Date time of code creation.""" + createdAt: DateTime! } +"""Represents a connection to a list of collections.""" type CollectionCountableConnection @doc(category: "Products") { """Pagination data for this connection.""" pageInfo: PageInfo! @@ -8095,44 +9442,88 @@ type ProductVariantCountableEdge @doc(category: "Products") { cursor: String! } -"""Represents sale channel listing.""" -type SaleChannelListing implements Node @doc(category: "Discounts") { +enum DiscountValueTypeEnum @doc(category: "Discounts") { + FIXED + PERCENTAGE +} + +enum VoucherTypeEnum @doc(category: "Discounts") { + SHIPPING + ENTIRE_ORDER + SPECIFIC_PRODUCT +} + +"""Represents voucher channel listing.""" +type VoucherChannelListing implements Node @doc(category: "Discounts") { + """The ID of channel listing.""" id: ID! + + """The channel in which voucher can be applied.""" channel: Channel! + + """The value of the discount on voucher in a channel.""" discountValue: Float! + + """Currency code for voucher in a channel.""" currency: String! + + """Minimum order value for voucher to apply in channel.""" + minSpent: Money } -type VoucherTranslatableContent implements Node @doc(category: "Discounts") { +""" +Represents menu item's original translatable fields and related translations. +""" +type MenuItemTranslatableContent implements Node @doc(category: "Menu") { + """The ID of the menu item translatable content.""" id: ID! - name: String - """Returns translated voucher fields for the given language code.""" + """ + The ID of the menu item to translate. + + Added in Saleor 3.14. + """ + menuItemId: ID! + + """Name of the menu item to translate.""" + name: String! + + """Returns translated menu item fields for the given language code.""" translation( - """A language code to return the translation for voucher.""" + """A language code to return the translation for menu item.""" languageCode: LanguageCodeEnum! - ): VoucherTranslation + ): MenuItemTranslation """ - Vouchers allow giving discounts to particular customers on categories, collections or specific products. They can be used during checkout by providing valid voucher codes. - - Requires one of the following permissions: MANAGE_DISCOUNTS. + Represents a single item of the related menu. Can store categories, collection or pages. """ - voucher: Voucher @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + menuItem: MenuItem @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") } -type VoucherTranslation implements Node @doc(category: "Discounts") { +"""Represents menu item translations.""" +type MenuItemTranslation implements Node @doc(category: "Menu") { + """The ID of the menu item translation.""" id: ID! """Translation language.""" language: LanguageDisplay! - name: String + + """Translated menu item name.""" + name: String! + + """ + Represents the menu item fields to translate. + + Added in Saleor 3.14. + """ + translatableContent: MenuItemTranslatableContent } """ -Vouchers allow giving discounts to particular customers on categories, collections or specific products. They can be used during checkout by providing valid voucher codes. +Represents a single item of the related menu. Can store categories, collection or pages. """ -type Voucher implements Node & ObjectWithMetadata @doc(category: "Discounts") { +type MenuItem implements Node & ObjectWithMetadata @doc(category: "Menu") { + """The ID of the menu item.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -8144,8 +9535,6 @@ type Voucher implements Node & ObjectWithMetadata @doc(category: "Discounts") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -8153,8 +9542,6 @@ type Voucher implements Node & ObjectWithMetadata @doc(category: "Discounts") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -8167,8 +9554,6 @@ type Voucher implements Node & ObjectWithMetadata @doc(category: "Discounts") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -8176,191 +9561,52 @@ type Voucher implements Node & ObjectWithMetadata @doc(category: "Discounts") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata - name: String - code: String! - usageLimit: Int - used: Int! - startDate: DateTime! - endDate: DateTime - applyOncePerOrder: Boolean! - applyOncePerCustomer: Boolean! - onlyForStaff: Boolean! - minCheckoutItemsQuantity: Int - """List of categories this voucher applies to.""" - categories( - """Return the elements in the list that come before the specified cursor.""" - before: String + """The name of the menu item.""" + name: String! - """Return the elements in the list that come after the specified cursor.""" - after: String + """Represents the menu to which the menu item belongs.""" + menu: Menu! - """ - Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. - """ - first: Int + """ID of parent menu item. If empty, menu will be top level menu.""" + parent: MenuItem - """ - Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. - """ - last: Int - ): CategoryCountableConnection + """Category associated with the menu item.""" + category: Category """ - List of collections this voucher applies to. - - Requires one of the following permissions: MANAGE_DISCOUNTS. + A collection associated with this menu item. Requires one of the following permissions to include the unpublished items: MANAGE_ORDERS, MANAGE_DISCOUNTS, MANAGE_PRODUCTS. """ - collections( - """Return the elements in the list that come before the specified cursor.""" - before: String - - """Return the elements in the list that come after the specified cursor.""" - after: String - - """ - Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. - """ - first: Int - - """ - Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. - """ - last: Int - ): CollectionCountableConnection + collection: Collection """ - List of products this voucher applies to. - - Requires one of the following permissions: MANAGE_DISCOUNTS. + A page associated with this menu item. Requires one of the following permissions to include unpublished items: MANAGE_PAGES. """ - products( - """Return the elements in the list that come before the specified cursor.""" - before: String + page: Page - """Return the elements in the list that come after the specified cursor.""" - after: String + """Indicates the position of the menu item within the menu structure.""" + level: Int! - """ - Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. - """ - first: Int + """Represents the child items of the current menu item.""" + children: [MenuItem!] - """ - Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. - """ - last: Int - ): ProductCountableConnection - - """ - List of product variants this voucher applies to. - - Added in Saleor 3.1. - - Requires one of the following permissions: MANAGE_DISCOUNTS. - """ - variants( - """Return the elements in the list that come before the specified cursor.""" - before: String - - """Return the elements in the list that come after the specified cursor.""" - after: String - - """ - Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. - """ - first: Int - - """ - Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. - """ - last: Int - ): ProductVariantCountableConnection - - """List of countries available for the shipping voucher.""" - countries: [CountryDisplay!] - - """Returns translated voucher fields for the given language code.""" - translation( - """A language code to return the translation for voucher.""" - languageCode: LanguageCodeEnum! - ): VoucherTranslation - - """Determines a type of discount for voucher - value or percentage""" - discountValueType: DiscountValueTypeEnum! - - """Voucher value.""" - discountValue: Float - - """Currency code for voucher.""" - currency: String - - """Minimum order value to apply voucher.""" - minSpent: Money - - """Determines a type of voucher.""" - type: VoucherTypeEnum! - - """ - List of availability in channels for the voucher. - - Requires one of the following permissions: MANAGE_DISCOUNTS. - """ - channelListings: [VoucherChannelListing!] -} - -enum DiscountValueTypeEnum @doc(category: "Discounts") { - FIXED - PERCENTAGE -} - -enum VoucherTypeEnum @doc(category: "Discounts") { - SHIPPING - ENTIRE_ORDER - SPECIFIC_PRODUCT -} - -"""Represents voucher channel listing.""" -type VoucherChannelListing implements Node @doc(category: "Discounts") { - id: ID! - channel: Channel! - discountValue: Float! - currency: String! - minSpent: Money -} - -type MenuItemTranslatableContent implements Node @doc(category: "Menu") { - id: ID! - name: String! + """URL to the menu item.""" + url: String """Returns translated menu item fields for the given language code.""" translation( """A language code to return the translation for menu item.""" languageCode: LanguageCodeEnum! ): MenuItemTranslation - - """ - Represents a single item of the related menu. Can store categories, collection or pages. - """ - menuItem: MenuItem @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") -} - -type MenuItemTranslation implements Node @doc(category: "Menu") { - id: ID! - - """Translation language.""" - language: LanguageDisplay! - name: String! } """ -Represents a single item of the related menu. Can store categories, collection or pages. +Represents a single menu - an object that is used to help navigate through the store. """ -type MenuItem implements Node & ObjectWithMetadata @doc(category: "Menu") { +type Menu implements Node & ObjectWithMetadata @doc(category: "Menu") { + """The ID of the menu.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -8372,8 +9618,6 @@ type MenuItem implements Node & ObjectWithMetadata @doc(category: "Menu") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -8381,8 +9625,6 @@ type MenuItem implements Node & ObjectWithMetadata @doc(category: "Menu") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -8395,8 +9637,6 @@ type MenuItem implements Node & ObjectWithMetadata @doc(category: "Menu") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -8404,211 +9644,410 @@ type MenuItem implements Node & ObjectWithMetadata @doc(category: "Menu") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """The name of the menu.""" name: String! - menu: Menu! - parent: MenuItem - category: Category - """ - A collection associated with this menu item. Requires one of the following permissions to include the unpublished items: MANAGE_ORDERS, MANAGE_DISCOUNTS, MANAGE_PRODUCTS. - """ - collection: Collection + """Slug of the menu.""" + slug: String! + + """Menu items associated with this menu.""" + items: [MenuItem!] +} + +""" +Represents promotion's original translatable fields and related translations. + +Added in Saleor 3.17. +""" +type PromotionTranslatableContent implements Node @doc(category: "Discounts") { + """ID of the promotion translatable content.""" + id: ID! + + """ID of the promotion to translate.""" + promotionId: ID! + + """Name of the promotion.""" + name: String! """ - A page associated with this menu item. Requires one of the following permissions to include unpublished items: MANAGE_PAGES. + Description of the promotion. + + Rich text format. For reference see https://editorjs.io/ """ - page: Page - level: Int! - children: [MenuItem!] - - """URL to the menu item.""" - url: String + description: JSONString - """Returns translated menu item fields for the given language code.""" + """Returns translated promotion fields for the given language code.""" translation( - """A language code to return the translation for menu item.""" + """A language code to return the translation for promotion.""" languageCode: LanguageCodeEnum! - ): MenuItemTranslation + ): PromotionTranslation } """ -Represents a single menu - an object that is used to help navigate through the store. +Represents promotion translations. + +Added in Saleor 3.17. """ -type Menu implements Node & ObjectWithMetadata @doc(category: "Menu") { +type PromotionTranslation implements Node @doc(category: "Discounts") { + """ID of the promotion translation.""" id: ID! - """List of private metadata items. Requires staff permissions to access.""" - privateMetadata: [MetadataItem!]! + """Translation language.""" + language: LanguageDisplay! + + """Translated name of the promotion.""" + name: String """ - A single key from private metadata. Requires staff permissions to access. - - Tip: Use GraphQL aliases to fetch multiple keys. - - Added in Saleor 3.3. + Translated description of the promotion. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Rich text format. For reference see https://editorjs.io/ """ - privateMetafield(key: String!): String + description: JSONString """ - 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. + Represents the promotion fields to translate. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Added in Saleor 3.14. """ - privateMetafields(keys: [String!]): Metadata + translatableContent: PromotionTranslatableContent +} - """List of public metadata items. Can be accessed without permissions.""" - metadata: [MetadataItem!]! +""" +Represents promotion rule's original translatable fields and related translations. + +Added in Saleor 3.17. +""" +type PromotionRuleTranslatableContent implements Node @doc(category: "Discounts") { + """ID of the promotion rule translatable content.""" + id: ID! """ - A single key from public metadata. - - Tip: Use GraphQL aliases to fetch multiple keys. + ID of the promotion rule to translate. - Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Added in Saleor 3.14. """ - metafield(key: String!): String + promotionRuleId: ID! + + """Name of the promotion rule.""" + name: String """ - Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. - - Added in Saleor 3.3. + Description of the promotion rule. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Rich text format. For reference see https://editorjs.io/ """ - metafields(keys: [String!]): Metadata - name: String! - slug: String! - items: [MenuItem!] -} + description: JSONString -enum TranslatableKinds { - ATTRIBUTE - ATTRIBUTE_VALUE - CATEGORY - COLLECTION - MENU_ITEM - PAGE - PRODUCT - SALE - SHIPPING_METHOD - VARIANT - VOUCHER + """Returns translated promotion rule fields for the given language code.""" + translation( + """A language code to return the translation for promotion rule.""" + languageCode: LanguageCodeEnum! + ): PromotionRuleTranslation } """ -Channel-specific tax configuration. +Represents promotion rule translations. -Added in Saleor 3.9. +Added in Saleor 3.17. """ -type TaxConfiguration implements Node & ObjectWithMetadata @doc(category: "Taxes") { - """The ID of the object.""" +type PromotionRuleTranslation implements Node @doc(category: "Discounts") { + """ID of the promotion rule translation.""" id: ID! - """List of private metadata items. Requires staff permissions to access.""" - privateMetadata: [MetadataItem!]! + """Translation language.""" + language: LanguageDisplay! + + """Translated name of the promotion rule.""" + name: String """ - A single key from private metadata. Requires staff permissions to access. - - Tip: Use GraphQL aliases to fetch multiple keys. + Translated description of the promotion rule. - Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Rich text format. For reference see https://editorjs.io/ """ - privateMetafield(key: String!): String + description: JSONString """ - 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. + Represents the promotion rule fields to translate. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Added in Saleor 3.14. """ - privateMetafields(keys: [String!]): Metadata + translatableContent: PromotionRuleTranslatableContent +} - """List of public metadata items. Can be accessed without permissions.""" - metadata: [MetadataItem!]! +""" +Represents sale's original translatable fields and related translations. - """ - A single key from public metadata. - - Tip: Use GraphQL aliases to fetch multiple keys. - - Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. - """ - metafield(key: String!): String +DEPRECATED: this type will be removed in Saleor 4.0. Use `PromotionTranslatableContent` instead. +""" +type SaleTranslatableContent implements Node @doc(category: "Discounts") { + """The ID of the sale translatable content.""" + id: ID! """ - Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. - - Added in Saleor 3.3. + The ID of the sale to translate. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Added in Saleor 3.14. """ - metafields(keys: [String!]): Metadata + saleId: ID! - """A channel to which the tax configuration applies to.""" - channel: Channel! + """Name of the sale to translate.""" + name: String! - """Determines whether taxes are charged in the given channel.""" - chargeTaxes: Boolean! + """Returns translated sale fields for the given language code.""" + translation( + """A language code to return the translation for sale.""" + languageCode: LanguageCodeEnum! + ): SaleTranslation """ - The default strategy to use for tax calculation in the given channel. Taxes can be calculated either using user-defined flat rates or with a tax app. Empty value means that no method is selected and taxes are not calculated. + Sales allow creating discounts for categories, collections or products and are visible to all the customers. + + Requires one of the following permissions: MANAGE_DISCOUNTS. """ - taxCalculationStrategy: TaxCalculationStrategy + sale: Sale @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") +} - """ - Determines whether prices displayed in a storefront should include taxes. - """ - displayGrossPrices: Boolean! +""" +Represents sale translations. - """Determines whether prices are entered with the tax included.""" - pricesEnteredWithTax: Boolean! +DEPRECATED: this type will be removed in Saleor 4.0. Use `PromotionTranslation` instead. +""" +type SaleTranslation implements Node @doc(category: "Discounts") { + """The ID of the sale translation.""" + id: ID! - """List of country-specific exceptions in tax configuration.""" - countries: [TaxConfigurationPerCountry!]! -} + """Translation language.""" + language: LanguageDisplay! -enum TaxCalculationStrategy @doc(category: "Taxes") { - FLAT_RATES - TAX_APP + """Translated name of sale.""" + name: String + + """ + Represents the sale fields to translate. + + Added in Saleor 3.14. + """ + translatableContent: SaleTranslatableContent } """ -Country-specific exceptions of a channel's tax configuration. +Sales allow creating discounts for categories, collections or products and are visible to all the customers. -Added in Saleor 3.9. +DEPRECATED: this type will be removed in Saleor 4.0. Use `Promotion` type instead. """ -type TaxConfigurationPerCountry @doc(category: "Taxes") { - """Country in which this configuration applies.""" - country: CountryDisplay! +type Sale implements Node & ObjectWithMetadata @doc(category: "Discounts") { + """The ID of the sale.""" + id: ID! - """Determines whether taxes are charged in this country.""" - chargeTaxes: Boolean! + """List of private metadata items. Requires staff permissions to access.""" + privateMetadata: [MetadataItem!]! """ - A country-specific strategy to use for tax calculation. Taxes can be calculated either using user-defined flat rates or with a tax app. If not provided, use the value from the channel's tax configuration. + A single key from private metadata. Requires staff permissions to access. + + Tip: Use GraphQL aliases to fetch multiple keys. + + Added in Saleor 3.3. """ - taxCalculationStrategy: TaxCalculationStrategy + privateMetafield(key: String!): String """ - Determines whether prices displayed in a storefront should include taxes for this country. + 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. """ - displayGrossPrices: Boolean! + privateMetafields(keys: [String!]): Metadata + + """List of public metadata items. Can be accessed without permissions.""" + metadata: [MetadataItem!]! + + """ + A single key from public metadata. + + Tip: Use GraphQL aliases to fetch multiple keys. + + Added in Saleor 3.3. + """ + metafield(key: String!): String + + """ + Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. + + Added in Saleor 3.3. + """ + metafields(keys: [String!]): Metadata + + """The name of the sale.""" + name: String! + + """Type of the sale, fixed or percentage.""" + type: SaleType! + + """The start date and time of the sale.""" + startDate: DateTime! + + """The end date and time of the sale.""" + endDate: DateTime + + """The date and time when the sale was created.""" + created: DateTime! + + """The date and time when the sale was updated.""" + updatedAt: DateTime! + + """List of categories this sale applies to.""" + categories( + """Return the elements in the list that come before the specified cursor.""" + before: String + + """Return the elements in the list that come after the specified cursor.""" + after: String + + """ + Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. + """ + first: Int + + """ + Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. + """ + last: Int + ): CategoryCountableConnection + + """ + List of collections this sale applies to. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + """ + collections( + """Return the elements in the list that come before the specified cursor.""" + before: String + + """Return the elements in the list that come after the specified cursor.""" + after: String + + """ + Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. + """ + first: Int + + """ + Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. + """ + last: Int + ): CollectionCountableConnection + + """ + List of products this sale applies to. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + """ + products( + """Return the elements in the list that come before the specified cursor.""" + before: String + + """Return the elements in the list that come after the specified cursor.""" + after: String + + """ + Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. + """ + first: Int + + """ + Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. + """ + last: Int + ): ProductCountableConnection + + """ + List of product variants this sale applies to. + + Added in Saleor 3.1. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + """ + variants( + """Return the elements in the list that come before the specified cursor.""" + before: String + + """Return the elements in the list that come after the specified cursor.""" + after: String + + """ + Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. + """ + first: Int + + """ + Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query. + """ + last: Int + ): ProductVariantCountableConnection + + """Returns translated sale fields for the given language code.""" + translation( + """A language code to return the translation for sale.""" + languageCode: LanguageCodeEnum! + ): SaleTranslation + + """ + List of channels available for the sale. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + """ + channelListings: [SaleChannelListing!] + + """Sale value.""" + discountValue: Float + + """Currency code for sale.""" + currency: String +} + +enum SaleType @doc(category: "Discounts") { + FIXED + PERCENTAGE +} + +""" +Represents sale channel listing. + +DEPRECATED: this type will be removed in Saleor 4.0. Use `PromotionRule` type instead. +""" +type SaleChannelListing implements Node @doc(category: "Discounts") { + """The ID of the channel listing.""" + id: ID! + + """The channel in which the sale is available.""" + channel: Channel! + + """The value of the discount applied to the sale in the channel.""" + discountValue: Float! + + """The currency in which the discount value is specified.""" + currency: String! +} + +enum TranslatableKinds { + ATTRIBUTE + ATTRIBUTE_VALUE + CATEGORY + COLLECTION + MENU_ITEM + PAGE + PRODUCT + PROMOTION + PROMOTION_RULE + SALE + SHIPPING_METHOD + VARIANT + VOUCHER } type TaxConfigurationCountableConnection @doc(category: "Taxes") { @@ -8707,27 +10146,60 @@ input StockFilterInput @doc(category: "Products") { """ Represents a shop resource containing general shop data and configuration. """ -type Shop { - """List of available payment gateways.""" - availablePaymentGateways( - """ - A currency for which gateways will be returned. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `channel` argument instead. - """ - currency: String +type Shop implements ObjectWithMetadata { + """List of private metadata items. Requires staff permissions to access.""" + privateMetadata: [MetadataItem!]! - """Slug of a channel for which the data should be returned.""" - channel: String - ): [PaymentGateway!]! + """ + A single key from private metadata. Requires staff permissions to access. + + Tip: Use GraphQL aliases to fetch multiple keys. + """ + privateMetafield(key: String!): String - """List of available external authentications.""" - availableExternalAuthentications: [ExternalAuthentication!]! + """ + Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything. + """ + privateMetafields(keys: [String!]): Metadata - """Shipping methods that are available for the shop.""" - availableShippingMethods( - """Slug of a channel for which the data should be returned.""" - channel: String! + """List of public metadata items. Can be accessed without permissions.""" + metadata: [MetadataItem!]! + + """ + A single key from public metadata. + + Tip: Use GraphQL aliases to fetch multiple keys. + """ + metafield(key: String!): String + + """ + Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. + """ + metafields(keys: [String!]): Metadata + + """ID of the shop.""" + id: ID! + + """List of available payment gateways.""" + availablePaymentGateways( + """ + A currency for which gateways will be returned. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `channel` argument instead. + """ + currency: String + + """Slug of a channel for which the data should be returned.""" + channel: String + ): [PaymentGateway!]! + + """List of available external authentications.""" + availableExternalAuthentications: [ExternalAuthentication!]! + + """Shipping methods that are available for the shop.""" + availableShippingMethods( + """Slug of a channel for which the data should be returned.""" + channel: String! """Address for which available shipping methods should be returned.""" address: AddressInput @@ -8807,7 +10279,9 @@ type Shop { """ fulfillmentAllowUnpaid: Boolean! - """Enable inventory tracking.""" + """ + This field is used as a default value for `ProductVariant.trackInventory`. + """ trackInventoryByDefault: Boolean """Default weight unit.""" @@ -8880,6 +10354,24 @@ type Shop { """ staffNotificationRecipients: [StaffNotificationRecipient!] + """ + Determines if account confirmation by email is enabled. + + Added in Saleor 3.14. + + Requires one of the following permissions: MANAGE_SETTINGS. + """ + enableAccountConfirmationByEmail: Boolean + + """ + Determines if user can login without confirmation when `enableAccountConfrimation` is enabled. + + Added in Saleor 3.15. + + Requires one of the following permissions: MANAGE_SETTINGS. + """ + allowLoginWithoutConfirmation: Boolean + """ Resource limitations and current usage if any set for a shop @@ -8901,6 +10393,15 @@ type Shop { """ schemaVersion: String! + """ + List of tax apps that can be assigned to the channel. The list will be calculated by Saleor based on the apps that are subscribed to webhooks related to tax calculations: CHECKOUT_CALCULATE_TAXES + + Added in Saleor 3.19. + + Requires one of the following permissions: AUTHENTICATED_STAFF_USER, MANAGE_APPS. + """ + availableTaxApps: [App!]! + """Include taxes in prices.""" includeTaxesInPrices: Boolean! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `Channel.taxConfiguration.pricesEnteredWithTax` to determine whether prices are entered with tax.") @@ -8937,6 +10438,7 @@ type GatewayConfigLine @doc(category: "Payments") { value: String } +"""External authentication plugin.""" type ExternalAuthentication @doc(category: "Authentication") { """ID of external authentication plugin.""" id: String! @@ -8952,7 +10454,7 @@ input CountryFilterInput { attachedToShippingZones: Boolean } -"""Represents shop's domain.""" +"""Represents API domain.""" type Domain { """The host name of the domain.""" host: String! @@ -8960,16 +10462,22 @@ type Domain { """Inform if SSL is enabled.""" sslEnabled: Boolean! - """Shop's absolute URL.""" + """The absolute URL of the API.""" url: String! } +"""Represents shop translations.""" type ShopTranslation implements Node @doc(category: "Shop") { + """The ID of the shop translation.""" id: ID! """Translation language.""" language: LanguageDisplay! + + """Translated header text of sale.""" headerText: String! + + """Translated description of sale.""" description: String! } @@ -8977,6 +10485,7 @@ type ShopTranslation implements Node @doc(category: "Shop") { Represents a recipient of email notifications send by Saleor, such as notifications about new orders. Notifications can be assigned to staff users or arbitrary email addresses. """ type StaffNotificationRecipient implements Node { + """The ID of the staff notification recipient.""" id: ID! """Returns a user subscribed to email notifications.""" @@ -8991,6 +10500,7 @@ type StaffNotificationRecipient implements Node { """Represents user data.""" type User implements Node & ObjectWithMetadata @doc(category: "Users") { + """The ID of the user.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -9002,8 +10512,6 @@ type User implements Node & ObjectWithMetadata @doc(category: "Users") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -9011,8 +10519,6 @@ type User implements Node & ObjectWithMetadata @doc(category: "Users") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -9025,8 +10531,6 @@ type User implements Node & ObjectWithMetadata @doc(category: "Users") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -9034,16 +10538,31 @@ type User implements Node & ObjectWithMetadata @doc(category: "Users") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """The email address of the user.""" email: String! + + """The given name of the address.""" firstName: String! + + """The family name of the address.""" lastName: String! + + """Determine if the user is a staff admin.""" isStaff: Boolean! + + """Determine if the user is active.""" isActive: Boolean! + """ + Determines if user has confirmed email. + + Added in Saleor 3.15. + """ + isConfirmed: Boolean! + """List of all user's addresses.""" addresses: [Address!]! @@ -9143,6 +10662,26 @@ type User implements Node & ObjectWithMetadata @doc(category: "Users") { """List of user's permission groups which user can manage.""" editableGroups: [Group!] + + """ + List of channels the user has access to. The sum of channels from all user groups. If at least one group has `restrictedAccessToChannels` set to False - all channels are returned. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + accessibleChannels: [Channel!] + + """ + Determine if user have restricted access to channels. False if at least one user group has `restrictedAccessToChannels` set to False. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + restrictedAccessToChannels: Boolean! + + """The avatar of the user.""" avatar( """ Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended). @@ -9164,7 +10703,9 @@ type User implements Node & ObjectWithMetadata @doc(category: "Users") { """ events: [CustomerEvent!] - """List of stored payment sources.""" + """ + List of stored payment sources. The field returns a list of payment sources stored for payment plugins. + """ storedPaymentSources( """Slug of a channel for which the data should be returned.""" channel: String @@ -9172,7 +10713,11 @@ type User implements Node & ObjectWithMetadata @doc(category: "Users") { """User language code.""" languageCode: LanguageCodeEnum! + + """The default shipping address of the user.""" defaultShippingAddress: Address + + """The default billing address of the user.""" defaultBillingAddress: Address """ @@ -9181,13 +10726,32 @@ type User implements Node & ObjectWithMetadata @doc(category: "Users") { Added in Saleor 3.10. """ externalReference: String + + """The date when the user last time log in to the system.""" lastLogin: DateTime + + """The data when the user create account.""" dateJoined: DateTime! + + """The data when the user last update the account information.""" updatedAt: DateTime! + + """ + Returns a list of user's stored payment methods that can be used in provided channel. The field returns a list of stored payment methods by payment apps. When `amount` is not provided, 0 will be used as default value. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + storedPaymentMethods( + """Slug of a channel for which the data should be returned.""" + channel: String! + ): [StoredPaymentMethod!] } """Checkout object.""" type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") { + """The ID of the checkout.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -9199,8 +10763,6 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -9208,8 +10770,6 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -9222,8 +10782,6 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -9231,10 +10789,10 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """The date and time when the checkout was created.""" created: DateTime! """ @@ -9244,21 +10802,66 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") { """ updatedAt: DateTime! lastChange: DateTime! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `updatedAt` instead.") + + """ + The user assigned to the checkout. Requires one of the following permissions: MANAGE_USERS, HANDLE_PAYMENTS, OWNER. + """ user: User + + """The channel for which checkout was created.""" channel: Channel! + + """The billing address of the checkout.""" billingAddress: Address + + """The shipping address of the checkout.""" shippingAddress: Address + + """The note for the checkout.""" note: String! + + """ + The total discount applied to the checkout. Note: Only discount created via voucher are included in this field. + """ discount: Money + + """The name of voucher assigned to the checkout.""" discountName: String + + """ + Translation of the discountName field in the language set in Checkout.languageCode field.Note: this field is set automatically when Checkout.languageCode is defined; otherwise it's null + """ translatedDiscountName: String + + """ + The voucher assigned to the checkout. + + Added in Saleor 3.18. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + """ + voucher: Voucher + + """The code of voucher assigned to the checkout.""" voucherCode: String - """Shipping methods that can be used with this checkout.""" - availableShippingMethods: [ShippingMethod!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `shippingMethods` instead.") + """ + Shipping methods that can be used with this checkout. + + Triggers the following webhook events: + - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid. + - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid. + """ + availableShippingMethods: [ShippingMethod!]! @webhookEventsInfo(asyncEvents: [], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS]) @deprecated(reason: "This field will be removed in Saleor 4.0. Use `shippingMethods` instead.") - """Shipping methods that can be used with this checkout.""" - shippingMethods: [ShippingMethod!]! + """ + Shipping methods that can be used with this checkout. + + Triggers the following webhook events: + - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid. + - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid. + """ + shippingMethods: [ShippingMethod!]! @webhookEventsInfo(asyncEvents: [], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS]) """ Collection points that can be used for this order. @@ -9267,8 +10870,13 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") { """ availableCollectionPoints: [Warehouse!]! - """List of available payment gateways.""" - availablePaymentGateways: [PaymentGateway!]! + """ + List of available payment gateways. + + Triggers the following webhook events: + - PAYMENT_LIST_GATEWAYS (sync): Fetch payment gateways available for checkout. + """ + availablePaymentGateways: [PaymentGateway!]! @webhookEventsInfo(asyncEvents: [], syncEvents: [PAYMENT_LIST_GATEWAYS]) """Email of a customer.""" email: String @@ -9294,21 +10902,41 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") { """ lines: [CheckoutLine!]! - """The price of the shipping, with all the taxes included.""" - shippingPrice: TaxedMoney! + """ + The price of the shipping, with all the taxes included. Set to 0 when no delivery method is selected. + + Triggers the following webhook events: + - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired. + """ + shippingPrice: TaxedMoney! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES]) - """The shipping method related with checkout.""" - shippingMethod: ShippingMethod @deprecated(reason: "This field will be removed in Saleor 4.0. Use `deliveryMethod` instead.") + """ + The shipping method related with checkout. + + Triggers the following webhook events: + - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid. + - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid. + """ + shippingMethod: ShippingMethod @webhookEventsInfo(asyncEvents: [], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS]) @deprecated(reason: "This field will be removed in Saleor 4.0. Use `deliveryMethod` instead.") """ The delivery method selected for this checkout. Added in Saleor 3.1. + + Triggers the following webhook events: + - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid. + - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid. """ - deliveryMethod: DeliveryMethod + deliveryMethod: DeliveryMethod @webhookEventsInfo(asyncEvents: [], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS]) - """The price of the checkout before shipping, with taxes included.""" - subtotalPrice: TaxedMoney! + """ + The price of the checkout before shipping, with taxes included. + + Triggers the following webhook events: + - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired. + """ + subtotalPrice: TaxedMoney! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES]) """ Returns True if checkout has to be exempt from taxes. @@ -9322,8 +10950,11 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") { """ The sum of the the checkout line prices, with all the taxes,shipping costs, and discounts included. + + Triggers the following webhook events: + - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired. """ - totalPrice: TaxedMoney! + totalPrice: TaxedMoney! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES]) """ The difference between the paid and the checkout total amount. @@ -9331,8 +10962,11 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") { Added in Saleor 3.13. Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Triggers the following webhook events: + - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired. """ - totalBalance: Money! + totalBalance: Money! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES]) """Checkout language code.""" languageCode: LanguageCodeEnum! @@ -9347,7 +10981,7 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") { transactions: [TransactionItem!] """ - Determines whether checkout prices should include taxes when displayed in a storefront. + Determines whether displayed prices should include taxes. Added in Saleor 3.9. """ @@ -9359,23 +10993,51 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") { Added in Saleor 3.13. Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Triggers the following webhook events: + - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired. """ - authorizeStatus: CheckoutAuthorizeStatusEnum! + authorizeStatus: CheckoutAuthorizeStatusEnum! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES]) """ The charge status of the checkout. Added in Saleor 3.13. + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Triggers the following webhook events: + - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired. + """ + chargeStatus: CheckoutChargeStatusEnum! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES]) + + """ + List of user's stored payment methods that can be used in this checkout session. It uses the channel that the checkout was created in. When `amount` is not provided, `checkout.total` will be used as a default value. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + storedPaymentMethods( + """Amount that will be used to fetch stored payment methods.""" + amount: PositiveDecimal + ): [StoredPaymentMethod!] + + """ + List of problems with the checkout. + + Added in Saleor 3.15. + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - chargeStatus: CheckoutChargeStatusEnum! + problems: [CheckoutProblem!] } """ A gift card is a prepaid electronic payment card accepted in stores. They can be used during checkout by providing a valid gift card codes. """ type GiftCard implements Node & ObjectWithMetadata @doc(category: "Gift cards") { + """ID of the gift card.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -9387,8 +11049,6 @@ type GiftCard implements Node & ObjectWithMetadata @doc(category: "Gift cards") Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -9396,8 +11056,6 @@ type GiftCard implements Node & ObjectWithMetadata @doc(category: "Gift cards") 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -9410,8 +11068,6 @@ type GiftCard implements Node & ObjectWithMetadata @doc(category: "Gift cards") Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -9419,8 +11075,6 @@ type GiftCard implements Node & ObjectWithMetadata @doc(category: "Gift cards") Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata @@ -9431,9 +11085,13 @@ type GiftCard implements Node & ObjectWithMetadata @doc(category: "Gift cards") last4CodeChars: String! """ - Gift card code. Can be fetched by a staff member with MANAGE_GIFT_CARD when gift card wasn't yet used and by the gift card owner. + Gift card code. It can be fetched both by a staff member with 'MANAGE_GIFT_CARD' when gift card hasn't been used yet or a user who bought or issued the gift card. + + Requires one of the following permissions: MANAGE_GIFT_CARD, OWNER. """ code: String! + + """Date and time when gift card was created.""" created: DateTime! """ @@ -9448,7 +11106,7 @@ type GiftCard implements Node & ObjectWithMetadata @doc(category: "Gift cards") Added in Saleor 3.1. """ - usedBy: User + usedBy: User @deprecated(reason: "This field will be removed in Saleor 4.0.") """ Email address of the user who bought or issued gift card. @@ -9464,8 +11122,12 @@ type GiftCard implements Node & ObjectWithMetadata @doc(category: "Gift cards") Added in Saleor 3.1. """ - usedByEmail: String + usedByEmail: String @deprecated(reason: "This field will be removed in Saleor 4.0.") + + """Date and time when gift card was last used.""" lastUsedOn: DateTime + + """Expiry date of the gift card.""" expiryDate: Date """ @@ -9531,6 +11193,7 @@ History log of the gift card. Added in Saleor 3.1. """ type GiftCardEvent implements Node @doc(category: "Gift cards") { + """ID of the event associated with a gift card.""" id: ID! """Date when event happened at in ISO 8601 format.""" @@ -9618,20 +11281,22 @@ The gift card tag. Added in Saleor 3.1. """ type GiftCardTag implements Node @doc(category: "Gift cards") { + """ID of the tag associated with a gift card.""" id: ID! + + """Name of the tag associated with a gift card.""" name: String! } """Represents an item in the checkout.""" type CheckoutLine implements Node & ObjectWithMetadata @doc(category: "Checkout") { + """The ID of the checkout line.""" id: ID! """ List of private metadata items. Requires staff permissions to access. Added in Saleor 3.5. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetadata: [MetadataItem!]! @@ -9641,8 +11306,6 @@ type CheckoutLine implements Node & ObjectWithMetadata @doc(category: "Checkout" Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.5. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -9650,8 +11313,6 @@ type CheckoutLine implements Node & ObjectWithMetadata @doc(category: "Checkout" 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.5. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -9659,8 +11320,6 @@ type CheckoutLine implements Node & ObjectWithMetadata @doc(category: "Checkout" List of public metadata items. Can be accessed without permissions. Added in Saleor 3.5. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metadata: [MetadataItem!]! @@ -9670,8 +11329,6 @@ type CheckoutLine implements Node & ObjectWithMetadata @doc(category: "Checkout" Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.5. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -9679,27 +11336,96 @@ type CheckoutLine implements Node & ObjectWithMetadata @doc(category: "Checkout" Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.5. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """The product variant from which the checkout line was created.""" variant: ProductVariant! + + """The quantity of product variant assigned to the checkout line.""" quantity: Int! - """The unit price of the checkout line, with taxes and discounts.""" - unitPrice: TaxedMoney! + """ + The unit price of the checkout line, with taxes and discounts. + + Triggers the following webhook events: + - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired. + """ + unitPrice: TaxedMoney! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES]) """The unit price of the checkout line, without discounts.""" undiscountedUnitPrice: Money! - """The sum of the checkout line price, taxes and discounts.""" - totalPrice: TaxedMoney! + """ + The sum of the checkout line price, taxes and discounts. + + Triggers the following webhook events: + - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired. + """ + totalPrice: TaxedMoney! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES]) """The sum of the checkout line price, without discounts.""" undiscountedTotalPrice: Money! """Indicates whether the item need to be delivered.""" requiresShipping: Boolean! + + """ + List of problems with the checkout line. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + problems: [CheckoutLineProblem!] + + """ + Determine if the line is a gift. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + isGift: Boolean +} + +""" +Represents an problem in the checkout line. + +Added in Saleor 3.15. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +union CheckoutLineProblem = CheckoutLineProblemInsufficientStock | CheckoutLineProblemVariantNotAvailable + +""" +Indicates insufficient stock for a given checkout line.Placing the order will not be possible until solving this problem. + +Added in Saleor 3.15. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type CheckoutLineProblemInsufficientStock @doc(category: "Checkout") { + """Available quantity of a variant.""" + availableQuantity: Int + + """The line that has variant with insufficient stock.""" + line: CheckoutLine! + + """The variant with insufficient stock.""" + variant: ProductVariant! +} + +""" +The variant assigned to the checkout line is not available.Placing the order will not be possible until solving this problem. + +Added in Saleor 3.15. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type CheckoutLineProblemVariantNotAvailable @doc(category: "Checkout") { + """The line that has variant that is not available.""" + line: CheckoutLine! } """ @@ -9729,8 +11455,6 @@ type TransactionItem implements Node & ObjectWithMetadata @doc(category: "Paymen Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -9738,8 +11462,6 @@ type TransactionItem implements Node & ObjectWithMetadata @doc(category: "Paymen 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -9752,8 +11474,6 @@ type TransactionItem implements Node & ObjectWithMetadata @doc(category: "Paymen Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -9761,11 +11481,20 @@ type TransactionItem implements Node & ObjectWithMetadata @doc(category: "Paymen Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """ + The transaction token. + + Added in Saleor 3.14. + """ + token: UUID! + + """Date and time at which payment transaction was created.""" createdAt: DateTime! + + """Date and time at which payment transaction was modified.""" modifiedAt: DateTime! """ @@ -9793,9 +11522,6 @@ type TransactionItem implements Node & ObjectWithMetadata @doc(category: "Paymen """ refundPendingAmount: Money! - """Total amount voided for this payment.""" - voidedAmount: Money! @deprecated(reason: "This field will be removed in Saleor 3.14 (Preview Feature).Use `canceledAmount` instead.") - """ Total amount canceled for this payment. @@ -9820,12 +11546,6 @@ type TransactionItem implements Node & ObjectWithMetadata @doc(category: "Paymen """ chargePendingAmount: Money! - """Status of transaction.""" - status: String! @deprecated(reason: "This field will be removed in Saleor 3.14 (Preview Feature). The `status` is not needed. The amounts can be used to define the current status of transactions.") - - """Type of transaction.""" - type: String! @deprecated(reason: "This field will be removed in Saleor 3.14 (Preview Feature). Use `name` or `message` instead.") - """ Name of the transaction. @@ -9840,9 +11560,6 @@ type TransactionItem implements Node & ObjectWithMetadata @doc(category: "Paymen """ message: String! - """Reference of transaction.""" - reference: String! @deprecated(reason: "This field will be removed in Saleor 3.14 (Preview Feature).Use `pspReference` instead.") - """ PSP reference of transaction. @@ -9857,6 +11574,13 @@ type TransactionItem implements Node & ObjectWithMetadata @doc(category: "Paymen """ order: Order + """ + The related checkout. + + Added in Saleor 3.14. + """ + checkout: Checkout + """List of all transaction's events.""" events: [TransactionEvent!]! @@ -9881,19 +11605,17 @@ Represents possible actions on payment transaction. The following actions are possible: CHARGE - Represents the charge action. REFUND - Represents a refund action. - VOID - Represents a void action. This field will be removed - in Saleor 3.14 (Preview Feature). Use `CANCEL` instead. CANCEL - Represents a cancel action. Added in Saleor 3.12. """ enum TransactionActionEnum @doc(category: "Payments") { CHARGE REFUND - VOID CANCEL } """Represents an order in the shop.""" type Order implements Node & ObjectWithMetadata @doc(category: "Orders") { + """ID of the order.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -9905,8 +11627,6 @@ type Order implements Node & ObjectWithMetadata @doc(category: "Orders") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -9914,8 +11634,6 @@ type Order implements Node & ObjectWithMetadata @doc(category: "Orders") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -9928,8 +11646,6 @@ type Order implements Node & ObjectWithMetadata @doc(category: "Orders") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -9937,18 +11653,26 @@ type Order implements Node & ObjectWithMetadata @doc(category: "Orders") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """Date and time when the order was created.""" created: DateTime! + + """Date and time when the order was created.""" updatedAt: DateTime! + + """Status of the order.""" status: OrderStatus! """ - User who placed the order. This field is set only for orders placed by authenticated users. Can be fetched for orders created in Saleor 3.2 and later, for other orders requires one of the following permissions: MANAGE_USERS, MANAGE_ORDERS, OWNER. + User who placed the order. This field is set only for orders placed by authenticated users. Can be fetched for orders created in Saleor 3.2 and later, for other orders requires one of the following permissions: MANAGE_USERS, MANAGE_ORDERS, HANDLE_PAYMENTS, OWNER. """ user: User + + """ + Google Analytics tracking client ID. This field will be removed in Saleor 4.0. + """ trackingClientId: String! """ @@ -9960,8 +11684,16 @@ type Order implements Node & ObjectWithMetadata @doc(category: "Orders") { Shipping address. The full data can be access for orders created in Saleor 3.2 and later, for other orders requires one of the following permissions: MANAGE_ORDERS, OWNER. """ shippingAddress: Address + + """Method used for shipping.""" shippingMethodName: String + + """ + Name of the collection point where the order should be picked up by the customer. + """ collectionPointName: String + + """Channel through which the order was placed.""" channel: Channel! """List of shipments for the order.""" @@ -10087,12 +11819,27 @@ type Order implements Node & ObjectWithMetadata @doc(category: "Orders") { """ shippingTaxClassPrivateMetadata: [MetadataItem!]! token: String! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `id` instead.") + + """Voucher linked to the order.""" voucher: Voucher + """ + Voucher code that was used for Order. + + Added in Saleor 3.18. + """ + voucherCode: String + """List of user gift cards.""" giftCards: [GiftCard!]! + + """Additional information provided by the customer about the order.""" customerNote: String! + + """Weight of the order.""" weight: Weight! + + """URL to which user should be redirected after order is placed.""" redirectUrl: String """The sum of line prices not including shipping.""" @@ -10171,7 +11918,7 @@ type Order implements Node & ObjectWithMetadata @doc(category: "Orders") { errors: [OrderError!]! """ - Determines whether checkout prices should include taxes when displayed in a storefront. + Determines whether displayed prices should include taxes. Added in Saleor 3.9. """ @@ -10293,6 +12040,7 @@ enum OrderStatus @doc(category: "Orders") { """Represents order fulfillment.""" type Fulfillment implements Node & ObjectWithMetadata @doc(category: "Orders") { + """ID of the fulfillment.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -10304,8 +12052,6 @@ type Fulfillment implements Node & ObjectWithMetadata @doc(category: "Orders") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -10313,8 +12059,6 @@ type Fulfillment implements Node & ObjectWithMetadata @doc(category: "Orders") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -10327,8 +12071,6 @@ type Fulfillment implements Node & ObjectWithMetadata @doc(category: "Orders") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -10336,13 +12078,19 @@ type Fulfillment implements Node & ObjectWithMetadata @doc(category: "Orders") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """Sequence in which the fulfillments were created for an order.""" fulfillmentOrder: Int! + + """Status of fulfillment.""" status: FulfillmentStatus! + + """Fulfillment tracking number.""" trackingNumber: String! + + """Date and time when fulfillment was created.""" created: DateTime! """List of lines for the fulfillment.""" @@ -10353,6 +12101,20 @@ type Fulfillment implements Node & ObjectWithMetadata @doc(category: "Orders") { """Warehouse from fulfillment was fulfilled.""" warehouse: Warehouse + + """ + Amount of refunded shipping price. + + Added in Saleor 3.14. + """ + shippingRefundedAmount: Money + + """ + Total refunded amount assigned to this fulfillment. + + Added in Saleor 3.14. + """ + totalRefundedAmount: Money } """An enumeration.""" @@ -10368,21 +12130,25 @@ enum FulfillmentStatus @doc(category: "Orders") { """Represents line of the fulfillment.""" type FulfillmentLine implements Node @doc(category: "Orders") { + """ID of the fulfillment line.""" id: ID! + + """The number of items included in the fulfillment line.""" quantity: Int! + + """The order line to which the fulfillment line is related.""" orderLine: OrderLine } """Represents order line of particular order.""" type OrderLine implements Node & ObjectWithMetadata @doc(category: "Orders") { + """ID of the order line.""" id: ID! """ List of private metadata items. Requires staff permissions to access. Added in Saleor 3.5. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetadata: [MetadataItem!]! @@ -10392,8 +12158,6 @@ type OrderLine implements Node & ObjectWithMetadata @doc(category: "Orders") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.5. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -10401,8 +12165,6 @@ type OrderLine implements Node & ObjectWithMetadata @doc(category: "Orders") { 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.5. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -10410,8 +12172,6 @@ type OrderLine implements Node & ObjectWithMetadata @doc(category: "Orders") { List of public metadata items. Can be accessed without permissions. Added in Saleor 3.5. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metadata: [MetadataItem!]! @@ -10421,8 +12181,6 @@ type OrderLine implements Node & ObjectWithMetadata @doc(category: "Orders") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.5. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -10430,18 +12188,34 @@ type OrderLine implements Node & ObjectWithMetadata @doc(category: "Orders") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.5. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """Name of the product in order line.""" productName: String! + + """Name of the variant of product in order line.""" variantName: String! + + """SKU of the product variant.""" productSku: String + + """The ID of the product variant.""" productVariantId: String + + """Whether the product variant requires shipping.""" isShippingRequired: Boolean! + + """Number of variant items ordered.""" quantity: Int! + + """Number of variant items fulfilled.""" quantityFulfilled: Int! + + """Reason for any discounts applied on a product in the order.""" unitDiscountReason: String + + """Rate of tax applied on product variant.""" taxRate: Float! digitalContentUrl: DigitalContentUrl thumbnail( @@ -10475,6 +12249,9 @@ type OrderLine implements Node & ObjectWithMetadata @doc(category: "Orders") { """Price of the order line.""" totalPrice: TaxedMoney! + """Price of the order line without discounts.""" + undiscountedTotalPrice: TaxedMoney! + """ A purchased product variant. Note: this field may be null if the variant has been removed from stock at all. Requires one of the following permissions to include the unpublished items: MANAGE_ORDERS, MANAGE_DISCOUNTS, MANAGE_PRODUCTS. """ @@ -10493,6 +12270,13 @@ type OrderLine implements Node & ObjectWithMetadata @doc(category: "Orders") { """ allocations: [Allocation!] + """ + Denormalized sale ID, set when order line is created for a product variant that is on sale. + + Added in Saleor 3.14. + """ + saleId: ID + """ A quantity of items remaining to be fulfilled. @@ -10532,6 +12316,22 @@ type OrderLine implements Node & ObjectWithMetadata @doc(category: "Orders") { Added in Saleor 3.9. """ taxClassPrivateMetadata: [MetadataItem!]! + + """ + Voucher code that was used for this order line. + + Added in Saleor 3.14. + """ + voucherCode: String + + """ + Determine if the line is a gift. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + isGift: Boolean } """ @@ -10543,6 +12343,7 @@ scalar PositiveDecimal """Represents allocation.""" type Allocation implements Node @doc(category: "Products") { + """The ID of allocation.""" id: ID! """ @@ -10585,8 +12386,6 @@ type Invoice implements ObjectWithMetadata & Job & Node @doc(category: "Orders") Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -10594,8 +12393,6 @@ type Invoice implements ObjectWithMetadata & Job & Node @doc(category: "Orders") 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -10608,8 +12405,6 @@ type Invoice implements ObjectWithMetadata & Job & Node @doc(category: "Orders") Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -10617,23 +12412,33 @@ type Invoice implements ObjectWithMetadata & Job & Node @doc(category: "Orders") Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata """Job status.""" status: JobStatusEnum! + + """Date and time at which invoice was created.""" createdAt: DateTime! + + """Date and time at which invoice was updated.""" updatedAt: DateTime! + + """Message associated with an invoice.""" message: String """The ID of the object.""" id: ID! + + """Invoice number.""" number: String - externalUrl: String - """URL to download an invoice.""" + """URL to view an invoice.""" + externalUrl: String @deprecated(reason: "This field will be removed in Saleor 4.0. Use `url` field.This field will be removed in 4.0") + + """ + URL to view/download an invoice. This can be an internal URL if the Invoicing Plugin was used or an external URL if it has been provided. + """ url: String """ @@ -10671,6 +12476,7 @@ enum OrderOriginEnum @doc(category: "Orders") { CHECKOUT DRAFT REISSUE + BULK_CREATE } """An enumeration.""" @@ -10736,6 +12542,7 @@ enum OrderChargeStatusEnum @doc(category: "Orders") { """Represents a payment of a given type.""" type Payment implements Node & ObjectWithMetadata @doc(category: "Payments") { + """ID of the payment.""" id: ID! """List of private metadata items. Requires staff permissions to access.""" @@ -10747,8 +12554,6 @@ type Payment implements Node & ObjectWithMetadata @doc(category: "Payments") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String @@ -10756,8 +12561,6 @@ type Payment implements Node & ObjectWithMetadata @doc(category: "Payments") { 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. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -10770,8 +12573,6 @@ type Payment implements Node & ObjectWithMetadata @doc(category: "Payments") { Tip: Use GraphQL aliases to fetch multiple keys. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String @@ -10779,17 +12580,31 @@ type Payment implements Node & ObjectWithMetadata @doc(category: "Payments") { Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata + + """Payment gateway used for payment.""" gateway: String! + + """Determines if the payment is active or not.""" isActive: Boolean! + + """Date and time at which payment was created.""" created: DateTime! + + """Date and time at which payment was modified.""" modified: DateTime! + + """Unique token associated with a payment.""" token: String! + + """Checkout associated with a payment.""" checkout: Checkout + + """Order associated with a payment.""" order: Order + + """Type of method used for payment.""" paymentMethodType: String! """ @@ -10838,17 +12653,46 @@ type Payment implements Node & ObjectWithMetadata @doc(category: "Payments") { """The details of the card used for this payment.""" creditCard: CreditCard + + """ + Informs whether this is a partial payment. + + Added in Saleor 3.14. + """ + partial: Boolean! + + """ + PSP reference of the payment. + + Added in Saleor 3.14. + """ + pspReference: String } """An object representing a single payment.""" type Transaction implements Node @doc(category: "Payments") { + """ID of the transaction.""" id: ID! + + """Date and time at which transaction was created.""" created: DateTime! + + """Determines the payment associated with a transaction.""" payment: Payment! + + """Unique token associated with a transaction.""" token: String! + + """Determines the type of transaction.""" kind: TransactionKind! + + """Determines if the transaction was successful.""" isSuccess: Boolean! + + """Error associated with transaction, if any.""" error: String + + """Response returned by payment gateway.""" gatewayResponse: JSONString! """Total amount of the transaction.""" @@ -10888,6 +12732,7 @@ type CreditCard @doc(category: "Payments") { """History log of the order.""" type OrderEvent implements Node @doc(category: "Orders") { + """ID of the event associated with an order.""" id: ID! """Date when event happened at in ISO 8601 format.""" @@ -10955,12 +12800,18 @@ type OrderEvent implements Node @doc(category: "Orders") { """The order which is related to this order.""" relatedOrder: Order + """ + The order event which is related to this event. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + related: OrderEvent + """The discount applied to the order.""" discount: OrderEventDiscountObject - """The status of payment's transaction.""" - status: TransactionStatus @deprecated(reason: "This field will be removed in Saleor 3.14 (Preview Feature).Use `TransactionEvent` to track the status of `TransactionItem`.") - """The reference of payment's transaction.""" reference: String } @@ -10998,17 +12849,7 @@ enum OrderEventsEnum @doc(category: "Orders") { PAYMENT_FAILED TRANSACTION_EVENT TRANSACTION_CHARGE_REQUESTED - - """ - This field will be removed in Saleor 3.14 (Preview Feature). Use `TRANSACTION_CHARGE_REQUESTED` instead. - """ - TRANSACTION_CAPTURE_REQUESTED TRANSACTION_REFUND_REQUESTED - - """ - This field will be removed in Saleor 3.14 (Preview Feature). Use `TRANSACTION_CANCEL_REQUESTED` instead. - """ - TRANSACTION_VOID_REQUESTED TRANSACTION_CANCEL_REQUESTED TRANSACTION_MARK_AS_PAID_FAILED INVOICE_REQUESTED @@ -11024,6 +12865,7 @@ enum OrderEventsEnum @doc(category: "Orders") { FULFILLMENT_AWAITS_APPROVAL TRACKING_UPDATED NOTE_ADDED + NOTE_UPDATED OTHER } @@ -11077,25 +12919,18 @@ type OrderEventDiscountObject @doc(category: "Orders") { oldAmount: Money } -""" -Represents a status of payment transaction. - - The following statuses are possible: - SUCCESS - Represents a sucess action. - FAILURE - Represents a failure action. - PENDING - Represents a pending action. -""" -enum TransactionStatus @doc(category: "Payments") { - PENDING - SUCCESS - FAILURE -} - """Contains all details related to the applied discount to the order.""" type OrderDiscount implements Node @doc(category: "Discounts") { + """The ID of discount applied.""" id: ID! + + """The type of applied discount: Sale, Voucher or Manual.""" type: OrderDiscountType! + + """The name of applied discount.""" name: String + + """Translated name of the applied discount.""" translatedName: String """Type of the discount: fixed or percent""" @@ -11117,8 +12952,11 @@ type OrderDiscount implements Node @doc(category: "Discounts") { """An enumeration.""" enum OrderDiscountType @doc(category: "Discounts") { + SALE VOUCHER MANUAL + PROMOTION + ORDER_PROMOTION } type OrderError @doc(category: "Orders") { @@ -11180,6 +13018,10 @@ enum OrderErrorCode @doc(category: "Orders") { DUPLICATED_INPUT_ITEM NOT_AVAILABLE_IN_CHANNEL CHANNEL_INACTIVE + INVALID_VOUCHER + INVALID_VOUCHER_CODE + NON_EDITABLE_GIFT_LINE + NON_REMOVABLE_GIFT_LINE } """An enumeration.""" @@ -11217,19 +13059,53 @@ type OrderGrantedRefund @doc(category: "Orders") { """App that performed the action.""" app: App + + """ + If true, the refunded amount includes the shipping price.If false, the refunded amount does not include the shipping price. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + shippingCostsIncluded: Boolean! + + """ + Lines assigned to the granted refund. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + lines: [OrderGrantedRefundLine!] +} + +""" +Represents granted refund line. + +Added in Saleor 3.15. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type OrderGrantedRefundLine { + id: ID! + + """Number of items to refund.""" + quantity: Int! + + """Line of the order associated with this granted refund.""" + orderLine: OrderLine! + + """Reason for refunding the line.""" + reason: String } """Represents transaction's event.""" type TransactionEvent implements Node @doc(category: "Payments") { """The ID of the object.""" id: ID! - createdAt: DateTime! - """Status of transaction's event.""" - status: TransactionStatus @deprecated(reason: "This field will be removed in Saleor 3.14 (Preview Feature). Use `type` instead.") - - """Reference of transaction's event.""" - reference: String! @deprecated(reason: "This field will be removed in Saleor 3.14 (Preview Feature).Use `pspReference` instead.") + """Date and time at which a transaction event was created.""" + createdAt: DateTime! """ PSP reference of transaction. @@ -11238,9 +13114,6 @@ type TransactionEvent implements Node @doc(category: "Payments") { """ pspReference: String! - """Name of the transaction's event.""" - name: String @deprecated(reason: "This field will be removed in Saleor 3.14 (Preview Feature). Use `message` instead.") - """ Message related to the transaction's event. @@ -11275,6 +13148,13 @@ type TransactionEvent implements Node @doc(category: "Payments") { Added in Saleor 3.13. """ createdBy: UserOrApp + + """ + Idempotency key assigned to the event. + + Added in Saleor 3.14. + """ + idempotencyKey: String } """ @@ -11370,6 +13250,63 @@ enum CheckoutChargeStatusEnum @doc(category: "Checkout") { OVERCHARGED } +""" +Represents a payment method stored for user (tokenized) in payment gateway. + +Added in Saleor 3.15. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type StoredPaymentMethod @doc(category: "Payments") { + """Stored payment method ID.""" + id: ID! + + """Payment gateway that stores this payment method.""" + gateway: PaymentGateway! + + """ + ID of stored payment method used to make payment actions. Note: method ID is unique only within the payment gateway. + """ + paymentMethodId: String! + + """Stored credit card details if available.""" + creditCardInfo: CreditCard + supportedPaymentFlows: [TokenizedPaymentFlowEnum!] + + """Type of the payment method. Example: credit card, wallet, etc.""" + type: String! + + """ + Payment method name. Example: last 4 digits of credit card, obfuscated email, etc. + """ + name: String + + """JSON data returned by Payment Provider app for this payment method.""" + data: JSON +} + +""" +Represents possible tokenized payment flows that can be used to process payment. + + The following flows are possible: + INTERACTIVE - Payment method can be used for 1 click checkout - it's prefilled in + checkout form (might require additional authentication from user) +""" +enum TokenizedPaymentFlowEnum @doc(category: "Payments") { + INTERACTIVE +} + +scalar JSON + +""" +Represents an problem in the checkout. + +Added in Saleor 3.15. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +union CheckoutProblem = CheckoutLineProblemInsufficientStock | CheckoutLineProblemVariantNotAvailable + type CheckoutCountableConnection @doc(category: "Checkout") { """Pagination data for this connection.""" pageInfo: PageInfo! @@ -11438,7 +13375,10 @@ type UserPermission @doc(category: "Users") { """Represents permission group data.""" type Group implements Node @doc(category: "Users") { + """The ID of the group.""" id: ID! + + """The name of the group.""" name: String! """ @@ -11455,14 +13395,33 @@ type Group implements Node @doc(category: "Users") { True, if the currently authenticated user has rights to manage a group. """ userCanManage: Boolean! -} - -"""History log of the customer.""" -type CustomerEvent implements Node @doc(category: "Users") { - id: ID! - """Date when event happened at in ISO 8601 format.""" - date: DateTime + """ + List of channels the group has access to. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + accessibleChannels: [Channel!] + + """ + Determine if the group have restricted access to channels. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + restrictedAccessToChannels: Boolean! +} + +"""History log of the customer.""" +type CustomerEvent implements Node @doc(category: "Users") { + """The ID of the customer event.""" + id: ID! + + """Date when event happened at in ISO 8601 format.""" + date: DateTime """Customer event type.""" type: CustomerEventsEnum @@ -11528,6 +13487,7 @@ type PaymentSource @doc(category: "Payments") { metadata: [MetadataItem!]! } +"""Store the current and allowed usage.""" type LimitInfo { """Defines the current resource usage.""" currentUsage: Limits! @@ -11537,10 +13497,19 @@ type LimitInfo { } type Limits { + """Defines the number of channels.""" channels: Int + + """Defines the number of order.""" orders: Int + + """Defines the number of product variants.""" productVariants: Int + + """Defines the number of staff users.""" staffUsers: Int + + """Defines the number of warehouses.""" warehouses: Int } @@ -11580,6 +13549,7 @@ input ShippingZoneFilterInput @doc(category: "Shipping") { channels: [ID!] } +"""A connection to a list of digital content items.""" type DigitalContentCountableConnection @doc(category: "Products") { """Pagination data for this connection.""" pageInfo: PageInfo! @@ -11602,6 +13572,24 @@ input CategoryFilterInput @doc(category: "Products") { metadata: [MetadataFilter!] ids: [ID!] slugs: [String!] + + """ + Filter by when was the most recent update. + + Added in Saleor 3.17. + """ + updatedAt: DateTimeRangeInput +} + +input CategoryWhereInput @doc(category: "Products") { + metadata: [MetadataFilter!] + ids: [ID!] + + """List of conditions that must be met.""" + AND: [CategoryWhereInput!] + + """A list of conditions of which at least one must be met.""" + OR: [CategoryWhereInput!] } input CategorySortingInput @doc(category: "Products") { @@ -11650,6 +13638,17 @@ enum CollectionPublished @doc(category: "Products") { HIDDEN } +input CollectionWhereInput @doc(category: "Products") { + metadata: [MetadataFilter!] + ids: [ID!] + + """List of conditions that must be met.""" + AND: [CollectionWhereInput!] + + """A list of conditions of which at least one must be met.""" + OR: [CollectionWhereInput!] +} + input CollectionSortingInput @doc(category: "Products") { """Specifies the direction in which to sort collections.""" direction: OrderDirection! @@ -11741,6 +13740,17 @@ input ProductVariantFilterInput @doc(category: "Products") { updatedAt: DateTimeRangeInput } +input ProductVariantWhereInput @doc(category: "Products") { + metadata: [MetadataFilter!] + ids: [ID!] + + """List of conditions that must be met.""" + AND: [ProductVariantWhereInput!] + + """A list of conditions of which at least one must be met.""" + OR: [ProductVariantWhereInput!] +} + input ProductVariantSortingInput @doc(category: "Products") { """Specifies the direction in which to sort productVariants.""" direction: OrderDirection! @@ -12102,6 +14112,7 @@ input GiftCardFilterInput @doc(category: "Gift cards") { currentBalance: PriceRangeInput initialBalance: PriceRangeInput code: String + createdByEmail: String } type GiftCardTagCountableConnection @doc(category: "Gift cards") { @@ -12353,9 +14364,20 @@ input VoucherSortingInput @doc(category: "Discounts") { } enum VoucherSortField { - """Sort vouchers by code.""" + """ + Sort vouchers by code. + + DEPRECATED: this field will be removed in Saleor 4.0. + """ CODE + """ + Sort vouchers by name. + + Added in Saleor 3.18. + """ + NAME + """Sort vouchers by start date.""" START_DATE @@ -12383,4466 +14405,6905 @@ enum VoucherSortField { MINIMUM_SPENT_AMOUNT } -"""Represents a job data of exported file.""" -type ExportFile implements Node & Job { - id: ID! - - """Job status.""" - status: JobStatusEnum! - - """Created date time of job in ISO 8601 format.""" - createdAt: DateTime! - - """Date time of job last update in ISO 8601 format.""" - updatedAt: DateTime! +""" +Represents the promotion that allow creating discounts based on given conditions, and is visible to all the customers. - """Job message.""" - message: String +Added in Saleor 3.17. - """The URL of field to download.""" - url: String +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type Promotion implements Node & ObjectWithMetadata @doc(category: "Discounts") { + id: ID! - """List of events associated with the export.""" - events: [ExportEvent!] - user: User - app: App -} + """List of private metadata items. Requires staff permissions to access.""" + privateMetadata: [MetadataItem!]! -"""History log of export file.""" -type ExportEvent implements Node { - """The ID of the object.""" - id: ID! + """ + A single key from private metadata. Requires staff permissions to access. + + Tip: Use GraphQL aliases to fetch multiple keys. + + Added in Saleor 3.3. + """ + privateMetafield(key: String!): String - """Date when event happened at in ISO 8601 format.""" - date: DateTime! + """ + 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. + """ + privateMetafields(keys: [String!]): Metadata - """Export event type.""" - type: ExportEventsEnum! + """List of public metadata items. Can be accessed without permissions.""" + metadata: [MetadataItem!]! """ - User who performed the action. Requires one of the following permissions: OWNER, MANAGE_STAFF. + A single key from public metadata. + + Tip: Use GraphQL aliases to fetch multiple keys. + + Added in Saleor 3.3. """ - user: User + metafield(key: String!): String """ - App which performed the action. Requires one of the following permissions: OWNER, MANAGE_APPS. + Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. + + Added in Saleor 3.3. """ - app: App + metafields(keys: [String!]): Metadata - """Content of the event.""" - message: String! -} + """Name of the promotion.""" + name: String! -"""An enumeration.""" -enum ExportEventsEnum { - EXPORT_PENDING - EXPORT_SUCCESS - EXPORT_FAILED - EXPORT_DELETED - EXPORTED_FILE_SENT - EXPORT_FAILED_INFO_SENT -} + """ + The type of the promotion. Implicate if the discount is applied on catalogue or order level. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + type: PromotionTypeEnum -type ExportFileCountableConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - edges: [ExportFileCountableEdge!]! + """Description of the promotion.""" + description: JSON - """A total count of items in the collection.""" - totalCount: Int -} + """Start date of the promotion.""" + startDate: DateTime! -type ExportFileCountableEdge { - """The item at the end of the edge.""" - node: ExportFile! + """End date of the promotion.""" + endDate: DateTime - """A cursor for use in pagination.""" - cursor: String! -} + """Date time of promotion creation.""" + createdAt: DateTime! -input ExportFileFilterInput { - createdAt: DateTimeRangeInput - updatedAt: DateTimeRangeInput - status: JobStatusEnum - user: String - app: String -} + """Date time of last update of promotion.""" + updatedAt: DateTime! -input ExportFileSortingInput { - """Specifies the direction in which to sort export file.""" - direction: OrderDirection! + """The list of promotion rules.""" + rules: [PromotionRule!] - """Sort export file by the selected field.""" - field: ExportFileSortField! -} + """Returns translated promotion fields for the given language code.""" + translation( + """A language code to return the translation for promotion.""" + languageCode: LanguageCodeEnum! + ): PromotionTranslation -enum ExportFileSortField { - STATUS - CREATED_AT - UPDATED_AT - LAST_MODIFIED_AT + """The list of events associated with the promotion.""" + events: [PromotionEvent!] } -input CheckoutSortingInput @doc(category: "Checkout") { - """Specifies the direction in which to sort checkouts.""" - direction: OrderDirection! - - """Sort checkouts by the selected field.""" - field: CheckoutSortField! +"""An enumeration.""" +enum PromotionTypeEnum @doc(category: "Discounts") { + CATALOGUE + ORDER } -enum CheckoutSortField @doc(category: "Checkout") { - """Sort checkouts by creation date.""" - CREATION_DATE +""" +Represents the promotion rule that specifies the conditions that must be met to apply the promotion discount. - """Sort checkouts by customer.""" - CUSTOMER +Added in Saleor 3.17. - """Sort checkouts by payment.""" - PAYMENT -} +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionRule implements Node @doc(category: "Discounts") { + id: ID! -input CheckoutFilterInput @doc(category: "Checkout") { - customer: String - created: DateRangeInput - search: String - metadata: [MetadataFilter!] - channels: [ID!] - updatedAt: DateRangeInput - authorizeStatus: [CheckoutAuthorizeStatusEnum!] - chargeStatus: [CheckoutChargeStatusEnum!] -} + """Name of the promotion rule.""" + name: String -type CheckoutLineCountableConnection @doc(category: "Checkout") { - """Pagination data for this connection.""" - pageInfo: PageInfo! - edges: [CheckoutLineCountableEdge!]! + """Description of the promotion rule.""" + description: JSON - """A total count of items in the collection.""" - totalCount: Int -} + """Promotion to which the rule belongs.""" + promotion: Promotion -type CheckoutLineCountableEdge @doc(category: "Checkout") { - """The item at the end of the edge.""" - node: CheckoutLine! + """ + List of channels where the rule applies. + + Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_STAFF_USER. + """ + channels: [Channel!] - """A cursor for use in pagination.""" - cursor: String! -} + """ + The reward value of the promotion rule. Defines the discount value applied when the rule conditions are met. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + rewardValue: PositiveDecimal -input AttributeSortingInput @doc(category: "Attributes") { - """Specifies the direction in which to sort attributes.""" - direction: OrderDirection! + """The type of reward value of the promotion rule.""" + rewardValueType: RewardValueTypeEnum - """Sort attributes by the selected field.""" - field: AttributeSortField! -} + """ + The type of the predicate that must be met to apply the reward. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + predicateType: PromotionTypeEnum -enum AttributeSortField @doc(category: "Attributes") { - """Sort attributes by name""" - NAME + """The catalogue predicate that must be met to apply the rule reward.""" + cataloguePredicate: JSON - """Sort attributes by slug""" - SLUG + """ + The checkout/order predicate that must be met to apply the rule reward. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + orderPredicate: JSON - """Sort attributes by the value required flag""" - VALUE_REQUIRED + """ + The reward type of the promotion rule. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + rewardType: RewardTypeEnum - """Sort attributes by the variant only flag""" - IS_VARIANT_ONLY + """Returns translated promotion rule fields for the given language code.""" + translation( + """A language code to return the translation for promotion rule.""" + languageCode: LanguageCodeEnum! + ): PromotionRuleTranslation - """Sort attributes by visibility in the storefront""" - VISIBLE_IN_STOREFRONT + """ + Product variant IDs available as a gift to choose. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + giftIds: [ID!] - """Sort attributes by the filterable in storefront flag""" - FILTERABLE_IN_STOREFRONT + """ + Defines the maximum number of gifts to choose from the gifts list. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + giftsLimit: Int +} - """Sort attributes by the filterable in dashboard flag""" - FILTERABLE_IN_DASHBOARD +"""An enumeration.""" +enum RewardValueTypeEnum @doc(category: "Discounts") { + FIXED + PERCENTAGE +} - """Sort attributes by their position in storefront""" - STOREFRONT_SEARCH_POSITION +"""An enumeration.""" +enum RewardTypeEnum @doc(category: "Discounts") { + SUBTOTAL_DISCOUNT + GIFT +} + +union PromotionEvent = PromotionCreatedEvent | PromotionUpdatedEvent | PromotionStartedEvent | PromotionEndedEvent | PromotionRuleCreatedEvent | PromotionRuleUpdatedEvent | PromotionRuleDeletedEvent + +""" +History log of the promotion created event. + +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionCreatedEvent implements Node & PromotionEventInterface @doc(category: "Discounts") { + id: ID! + + """Date when event happened.""" + date: DateTime! + + """Promotion event type.""" + type: PromotionEventsEnum! """ - Sort attributes based on whether they can be displayed or not in a product grid. + User or App that created the promotion event. + + Requires one of the following permissions: MANAGE_STAFF, MANAGE_APPS, OWNER. """ - AVAILABLE_IN_GRID + createdBy: UserOrApp } -"""Represents ongoing installation of app.""" -type AppInstallation implements Node & Job @doc(category: "Apps") { +interface PromotionEventInterface { id: ID! - """Job status.""" - status: JobStatusEnum! + """Date when event happened.""" + date: DateTime! - """Created date time of job in ISO 8601 format.""" - createdAt: DateTime! + """Promotion event type.""" + type: PromotionEventsEnum! - """Date time of job last update in ISO 8601 format.""" - updatedAt: DateTime! + """ + User or App that created the promotion event. + + Requires one of the following permissions: MANAGE_STAFF, MANAGE_APPS, OWNER. + """ + createdBy: UserOrApp +} - """Job message.""" - message: String - appName: String! - manifestUrl: String! +"""An enumeration.""" +enum PromotionEventsEnum @doc(category: "Discounts") { + PROMOTION_CREATED + PROMOTION_UPDATED + PROMOTION_STARTED + PROMOTION_ENDED + RULE_CREATED + RULE_UPDATED + RULE_DELETED } -type AppCountableConnection @doc(category: "Apps") { - """Pagination data for this connection.""" - pageInfo: PageInfo! - edges: [AppCountableEdge!]! +""" +History log of the promotion updated event. - """A total count of items in the collection.""" - totalCount: Int -} +Added in Saleor 3.17. -type AppCountableEdge @doc(category: "Apps") { - """The item at the end of the edge.""" - node: App! +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionUpdatedEvent implements Node & PromotionEventInterface @doc(category: "Discounts") { + id: ID! - """A cursor for use in pagination.""" - cursor: String! -} + """Date when event happened.""" + date: DateTime! -input AppFilterInput @doc(category: "Apps") { - search: String - isActive: Boolean - type: AppTypeEnum + """Promotion event type.""" + type: PromotionEventsEnum! + + """ + User or App that created the promotion event. + + Requires one of the following permissions: MANAGE_STAFF, MANAGE_APPS, OWNER. + """ + createdBy: UserOrApp } -input AppSortingInput @doc(category: "Apps") { - """Specifies the direction in which to sort apps.""" - direction: OrderDirection! +""" +History log of the promotion started event. - """Sort apps by the selected field.""" - field: AppSortField! -} +Added in Saleor 3.17. -enum AppSortField @doc(category: "Apps") { - """Sort apps by name.""" - NAME +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionStartedEvent implements Node & PromotionEventInterface @doc(category: "Discounts") { + id: ID! - """Sort apps by creation date.""" - CREATION_DATE -} + """Date when event happened.""" + date: DateTime! -type AppExtensionCountableConnection @doc(category: "Apps") { - """Pagination data for this connection.""" - pageInfo: PageInfo! - edges: [AppExtensionCountableEdge!]! + """Promotion event type.""" + type: PromotionEventsEnum! - """A total count of items in the collection.""" - totalCount: Int + """ + User or App that created the promotion event. + + Requires one of the following permissions: MANAGE_STAFF, MANAGE_APPS, OWNER. + """ + createdBy: UserOrApp } -type AppExtensionCountableEdge @doc(category: "Apps") { - """The item at the end of the edge.""" - node: AppExtension! +""" +History log of the promotion ended event. - """A cursor for use in pagination.""" - cursor: String! -} +Added in Saleor 3.17. -input AppExtensionFilterInput @doc(category: "Apps") { - mount: [AppExtensionMountEnum!] - target: AppExtensionTargetEnum -} +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionEndedEvent implements Node & PromotionEventInterface @doc(category: "Discounts") { + id: ID! -"""Represents address validation rules for a country.""" -type AddressValidationData @doc(category: "Users") { - countryCode: String! - countryName: String! - addressFormat: String! - addressLatinFormat: String! - allowedFields: [String!]! - requiredFields: [String!]! - upperFields: [String!]! - countryAreaType: String! - countryAreaChoices: [ChoiceValue!]! - cityType: String! - cityChoices: [ChoiceValue!]! - cityAreaType: String! - cityAreaChoices: [ChoiceValue!]! - postalCodeType: String! - postalCodeMatchers: [String!]! - postalCodeExamples: [String!]! - postalCodePrefix: String! -} + """Date when event happened.""" + date: DateTime! -type ChoiceValue { - raw: String - verbose: String + """Promotion event type.""" + type: PromotionEventsEnum! + + """ + User or App that created the promotion event. + + Requires one of the following permissions: MANAGE_STAFF, MANAGE_APPS, OWNER. + """ + createdBy: UserOrApp } -type UserCountableConnection @doc(category: "Users") { - """Pagination data for this connection.""" - pageInfo: PageInfo! - edges: [UserCountableEdge!]! +""" +History log of the promotion rule created event. - """A total count of items in the collection.""" - totalCount: Int -} +Added in Saleor 3.17. -type UserCountableEdge @doc(category: "Users") { - """The item at the end of the edge.""" - node: User! +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionRuleCreatedEvent implements Node & PromotionEventInterface & PromotionRuleEventInterface @doc(category: "Discounts") { + id: ID! - """A cursor for use in pagination.""" - cursor: String! -} + """Date when event happened.""" + date: DateTime! -input CustomerFilterInput @doc(category: "Users") { - dateJoined: DateRangeInput - numberOfOrders: IntRangeInput - placedOrders: DateRangeInput - search: String - metadata: [MetadataFilter!] + """Promotion event type.""" + type: PromotionEventsEnum! """ - Filter by ids. + User or App that created the promotion event. - Added in Saleor 3.8. + Requires one of the following permissions: MANAGE_STAFF, MANAGE_APPS, OWNER. """ - ids: [ID!] - updatedAt: DateTimeRangeInput + createdBy: UserOrApp + + """The rule ID associated with the promotion event.""" + ruleId: String } -input UserSortingInput @doc(category: "Users") { - """Specifies the direction in which to sort users.""" - direction: OrderDirection! +""" +History log of the promotion event related to rule. - """Sort users by the selected field.""" - field: UserSortField! +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +interface PromotionRuleEventInterface { + """The rule ID associated with the promotion event.""" + ruleId: String } -enum UserSortField @doc(category: "Users") { - """Sort users by first name.""" - FIRST_NAME +""" +History log of the promotion rule created event. - """Sort users by last name.""" - LAST_NAME +Added in Saleor 3.17. - """Sort users by email.""" - EMAIL +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionRuleUpdatedEvent implements Node & PromotionEventInterface & PromotionRuleEventInterface @doc(category: "Discounts") { + id: ID! - """Sort users by order count.""" - ORDER_COUNT + """Date when event happened.""" + date: DateTime! - """Sort users by created at.""" - CREATED_AT + """Promotion event type.""" + type: PromotionEventsEnum! - """Sort users by last modified at.""" - LAST_MODIFIED_AT + """ + User or App that created the promotion event. + + Requires one of the following permissions: MANAGE_STAFF, MANAGE_APPS, OWNER. + """ + createdBy: UserOrApp + + """The rule ID associated with the promotion event.""" + ruleId: String } -type GroupCountableConnection @doc(category: "Users") { +""" +History log of the promotion rule created event. + +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionRuleDeletedEvent implements Node & PromotionEventInterface & PromotionRuleEventInterface @doc(category: "Discounts") { + id: ID! + + """Date when event happened.""" + date: DateTime! + + """Promotion event type.""" + type: PromotionEventsEnum! + + """ + User or App that created the promotion event. + + Requires one of the following permissions: MANAGE_STAFF, MANAGE_APPS, OWNER. + """ + createdBy: UserOrApp + + """The rule ID associated with the promotion event.""" + ruleId: String +} + +type PromotionCountableConnection @doc(category: "Discounts") { """Pagination data for this connection.""" pageInfo: PageInfo! - edges: [GroupCountableEdge!]! + edges: [PromotionCountableEdge!]! """A total count of items in the collection.""" totalCount: Int } -type GroupCountableEdge @doc(category: "Users") { +type PromotionCountableEdge @doc(category: "Discounts") { """The item at the end of the edge.""" - node: Group! + node: Promotion! """A cursor for use in pagination.""" cursor: String! } -input PermissionGroupFilterInput @doc(category: "Users") { - search: String +input PromotionWhereInput @doc(category: "Discounts") { + metadata: [MetadataFilter!] ids: [ID!] -} -input PermissionGroupSortingInput @doc(category: "Users") { - """Specifies the direction in which to sort permission group.""" - direction: OrderDirection! + """Filter by promotion name.""" + name: StringFilterInput - """Sort permission group by the selected field.""" - field: PermissionGroupSortField! + """Filter promotions by end date.""" + endDate: DateTimeFilterInput + + """Filter promotions by start date.""" + startDate: DateTimeFilterInput + isOldSale: Boolean + type: PromotionTypeEnumFilterInput + + """List of conditions that must be met.""" + AND: [PromotionWhereInput!] + + """A list of conditions of which at least one must be met.""" + OR: [PromotionWhereInput!] } -"""Sorting options for permission groups.""" -enum PermissionGroupSortField @doc(category: "Users") { - """Sort permission group accounts by name.""" +input PromotionTypeEnumFilterInput @doc(category: "Discounts") { + """The value equal to.""" + eq: PromotionTypeEnum + + """The value included in.""" + oneOf: [PromotionTypeEnum!] +} + +input PromotionSortingInput @doc(category: "Discounts") { + """Specifies the direction in which to sort promotions.""" + direction: OrderDirection! + + """Sort promotions by the selected field.""" + field: PromotionSortField! +} + +enum PromotionSortField @doc(category: "Discounts") { + """Sort promotions by name.""" NAME + + """Sort promotions by start date.""" + START_DATE + + """Sort promotions by end date.""" + END_DATE + + """Sort promotions by created at.""" + CREATED_AT } -input StaffUserInput @doc(category: "Users") { - status: StaffMemberStatus +"""Represents a job data of exported file.""" +type ExportFile implements Node & Job { + """The ID of the export file.""" + id: ID! + + """Job status.""" + status: JobStatusEnum! + + """Created date time of job in ISO 8601 format.""" + createdAt: DateTime! + + """Date time of job last update in ISO 8601 format.""" + updatedAt: DateTime! + + """Job message.""" + message: String + + """The URL of field to download.""" + url: String + + """List of events associated with the export.""" + events: [ExportEvent!] + + """The user who requests file export.""" + user: User + + """The app which requests file export.""" + app: App +} + +"""History log of export file.""" +type ExportEvent implements Node { + """The ID of the object.""" + id: ID! + + """Date when event happened at in ISO 8601 format.""" + date: DateTime! + + """Export event type.""" + type: ExportEventsEnum! + + """ + User who performed the action. Requires one of the following permissions: OWNER, MANAGE_STAFF. + """ + user: User + + """ + App which performed the action. Requires one of the following permissions: OWNER, MANAGE_APPS. + """ + app: App + + """Content of the event.""" + message: String! +} + +"""An enumeration.""" +enum ExportEventsEnum { + EXPORT_PENDING + EXPORT_SUCCESS + EXPORT_FAILED + EXPORT_DELETED + EXPORTED_FILE_SENT + EXPORT_FAILED_INFO_SENT +} + +type ExportFileCountableConnection { + """Pagination data for this connection.""" + pageInfo: PageInfo! + edges: [ExportFileCountableEdge!]! + + """A total count of items in the collection.""" + totalCount: Int +} + +type ExportFileCountableEdge { + """The item at the end of the edge.""" + node: ExportFile! + + """A cursor for use in pagination.""" + cursor: String! +} + +input ExportFileFilterInput { + createdAt: DateTimeRangeInput + updatedAt: DateTimeRangeInput + status: JobStatusEnum + user: String + app: String +} + +input ExportFileSortingInput { + """Specifies the direction in which to sort export file.""" + direction: OrderDirection! + + """Sort export file by the selected field.""" + field: ExportFileSortField! +} + +enum ExportFileSortField { + STATUS + CREATED_AT + UPDATED_AT + LAST_MODIFIED_AT +} + +input CheckoutSortingInput @doc(category: "Checkout") { + """Specifies the direction in which to sort checkouts.""" + direction: OrderDirection! + + """Sort checkouts by the selected field.""" + field: CheckoutSortField! +} + +enum CheckoutSortField @doc(category: "Checkout") { + """Sort checkouts by creation date.""" + CREATION_DATE + + """Sort checkouts by customer.""" + CUSTOMER + + """Sort checkouts by payment.""" + PAYMENT +} + +input CheckoutFilterInput @doc(category: "Checkout") { + customer: String + created: DateRangeInput search: String - ids: [ID!] + metadata: [MetadataFilter!] + channels: [ID!] + updatedAt: DateRangeInput + authorizeStatus: [CheckoutAuthorizeStatusEnum!] + chargeStatus: [CheckoutChargeStatusEnum!] } -"""Represents status of a staff account.""" -enum StaffMemberStatus @doc(category: "Users") { - """User account has been activated.""" - ACTIVE +type CheckoutLineCountableConnection @doc(category: "Checkout") { + """Pagination data for this connection.""" + pageInfo: PageInfo! + edges: [CheckoutLineCountableEdge!]! - """User account has not been activated yet.""" - DEACTIVATED + """A total count of items in the collection.""" + totalCount: Int +} + +type CheckoutLineCountableEdge @doc(category: "Checkout") { + """The item at the end of the edge.""" + node: CheckoutLine! + + """A cursor for use in pagination.""" + cursor: String! +} + +input AttributeSortingInput @doc(category: "Attributes") { + """Specifies the direction in which to sort attributes.""" + direction: OrderDirection! + + """Sort attributes by the selected field.""" + field: AttributeSortField! +} + +enum AttributeSortField @doc(category: "Attributes") { + """Sort attributes by name""" + NAME + + """Sort attributes by slug""" + SLUG + + """Sort attributes by the value required flag""" + VALUE_REQUIRED + + """Sort attributes by the variant only flag""" + IS_VARIANT_ONLY + + """Sort attributes by visibility in the storefront""" + VISIBLE_IN_STOREFRONT + + """Sort attributes by the filterable in storefront flag""" + FILTERABLE_IN_STOREFRONT + + """Sort attributes by the filterable in dashboard flag""" + FILTERABLE_IN_DASHBOARD + + """Sort attributes by their position in storefront""" + STOREFRONT_SEARCH_POSITION + + """ + Sort attributes based on whether they can be displayed or not in a product grid. + """ + AVAILABLE_IN_GRID +} + +"""Represents ongoing installation of app.""" +type AppInstallation implements Node & Job @doc(category: "Apps") { + """The ID of the app installation.""" + id: ID! + + """Job status.""" + status: JobStatusEnum! + + """Created date time of job in ISO 8601 format.""" + createdAt: DateTime! + + """Date time of job last update in ISO 8601 format.""" + updatedAt: DateTime! + + """Job message.""" + message: String + + """The name of the app installation.""" + appName: String! + + """The URL address of manifest for the app installation.""" + manifestUrl: String! + + """ + App's brand data. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + brand: AppBrand +} + +type AppCountableConnection @doc(category: "Apps") { + """Pagination data for this connection.""" + pageInfo: PageInfo! + edges: [AppCountableEdge!]! + + """A total count of items in the collection.""" + totalCount: Int } -type Mutation { +type AppCountableEdge @doc(category: "Apps") { + """The item at the end of the edge.""" + node: App! + + """A cursor for use in pagination.""" + cursor: String! +} + +input AppFilterInput @doc(category: "Apps") { + search: String + isActive: Boolean + type: AppTypeEnum +} + +input AppSortingInput @doc(category: "Apps") { + """Specifies the direction in which to sort apps.""" + direction: OrderDirection! + + """Sort apps by the selected field.""" + field: AppSortField! +} + +enum AppSortField @doc(category: "Apps") { + """Sort apps by name.""" + NAME + + """Sort apps by creation date.""" + CREATION_DATE +} + +type AppExtensionCountableConnection @doc(category: "Apps") { + """Pagination data for this connection.""" + pageInfo: PageInfo! + edges: [AppExtensionCountableEdge!]! + + """A total count of items in the collection.""" + totalCount: Int +} + +type AppExtensionCountableEdge @doc(category: "Apps") { + """The item at the end of the edge.""" + node: AppExtension! + + """A cursor for use in pagination.""" + cursor: String! +} + +input AppExtensionFilterInput @doc(category: "Apps") { + mount: [AppExtensionMountEnum!] + target: AppExtensionTargetEnum +} + +"""Represents address validation rules for a country.""" +type AddressValidationData @doc(category: "Users") { + """The country code of the address validation rule.""" + countryCode: String! + + """The country name of the address validation rule.""" + countryName: String! + + """ + The address format of the address validation rule. + + Many fields in the JSON refer to address fields by one-letter abbreviations. These are defined as follows: + + - `N`: Name + - `O`: Organisation + - `A`: Street Address Line(s) + - `D`: Dependent locality (may be an inner-city district or a suburb) + - `C`: City or Locality + - `S`: Administrative area such as a state, province, island etc + - `Z`: Zip or postal code + - `X`: Sorting code + + [Click here for more information.](https://github.com/google/libaddressinput/wiki/AddressValidationMetadata) + """ + addressFormat: String! + + """ + The latin address format of the address validation rule. + + Many fields in the JSON refer to address fields by one-letter abbreviations. These are defined as follows: + + - `N`: Name + - `O`: Organisation + - `A`: Street Address Line(s) + - `D`: Dependent locality (may be an inner-city district or a suburb) + - `C`: City or Locality + - `S`: Administrative area such as a state, province, island etc + - `Z`: Zip or postal code + - `X`: Sorting code + + [Click here for more information.](https://github.com/google/libaddressinput/wiki/AddressValidationMetadata) + """ + addressLatinFormat: String! + + """The allowed fields to use in address.""" + allowedFields: [String!]! + + """The required fields to create a valid address.""" + requiredFields: [String!]! + + """ + The list of fields that should be in upper case for address validation rule. + """ + upperFields: [String!]! + + """The formal name of the county area of the address validation rule.""" + countryAreaType: String! + + """ + The available choices for the country area of the address validation rule. + """ + countryAreaChoices: [ChoiceValue!]! + + """The formal name of the city of the address validation rule.""" + cityType: String! + + """The available choices for the city of the address validation rule.""" + cityChoices: [ChoiceValue!]! + + """The formal name of the city area of the address validation rule.""" + cityAreaType: String! + + """ + The available choices for the city area of the address validation rule. + """ + cityAreaChoices: [ChoiceValue!]! + + """The formal name of the postal code of the address validation rule.""" + postalCodeType: String! + + """The regular expression for postal code validation.""" + postalCodeMatchers: [String!]! + + """The example postal code of the address validation rule.""" + postalCodeExamples: [String!]! + + """The postal code prefix of the address validation rule.""" + postalCodePrefix: String! +} + +type ChoiceValue { + """The raw name of the choice.""" + raw: String + + """The verbose name of the choice.""" + verbose: String +} + +type UserCountableConnection @doc(category: "Users") { + """Pagination data for this connection.""" + pageInfo: PageInfo! + edges: [UserCountableEdge!]! + + """A total count of items in the collection.""" + totalCount: Int +} + +type UserCountableEdge @doc(category: "Users") { + """The item at the end of the edge.""" + node: User! + + """A cursor for use in pagination.""" + cursor: String! +} + +input CustomerFilterInput @doc(category: "Users") { + dateJoined: DateRangeInput + numberOfOrders: IntRangeInput + placedOrders: DateRangeInput + search: String + metadata: [MetadataFilter!] + + """ + Filter by ids. + + Added in Saleor 3.8. + """ + ids: [ID!] + updatedAt: DateTimeRangeInput +} + +input UserSortingInput @doc(category: "Users") { + """Specifies the direction in which to sort users.""" + direction: OrderDirection! + + """Sort users by the selected field.""" + field: UserSortField! +} + +enum UserSortField @doc(category: "Users") { + """Sort users by first name.""" + FIRST_NAME + + """Sort users by last name.""" + LAST_NAME + + """Sort users by email.""" + EMAIL + + """Sort users by order count.""" + ORDER_COUNT + + """Sort users by created at.""" + CREATED_AT + + """Sort users by last modified at.""" + LAST_MODIFIED_AT +} + +type GroupCountableConnection @doc(category: "Users") { + """Pagination data for this connection.""" + pageInfo: PageInfo! + edges: [GroupCountableEdge!]! + + """A total count of items in the collection.""" + totalCount: Int +} + +type GroupCountableEdge @doc(category: "Users") { + """The item at the end of the edge.""" + node: Group! + + """A cursor for use in pagination.""" + cursor: String! +} + +input PermissionGroupFilterInput @doc(category: "Users") { + search: String + ids: [ID!] +} + +input PermissionGroupSortingInput @doc(category: "Users") { + """Specifies the direction in which to sort permission group.""" + direction: OrderDirection! + + """Sort permission group by the selected field.""" + field: PermissionGroupSortField! +} + +"""Sorting options for permission groups.""" +enum PermissionGroupSortField @doc(category: "Users") { + """Sort permission group accounts by name.""" + NAME +} + +input StaffUserInput @doc(category: "Users") { + status: StaffMemberStatus + search: String + ids: [ID!] +} + +"""Represents status of a staff account.""" +enum StaffMemberStatus @doc(category: "Users") { + """User account has been activated.""" + ACTIVE + + """User account has not been activated yet.""" + DEACTIVATED +} + +type Mutation { + """ + Creates a new webhook subscription. + + Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. + """ + webhookCreate( + """Fields required to create a webhook.""" + input: WebhookCreateInput! + ): WebhookCreate @doc(category: "Webhooks") + + """ + Delete a webhook. Before the deletion, the webhook is deactivated to pause any deliveries that are already scheduled. The deletion might fail if delivery is in progress. In such a case, the webhook is not deleted but remains deactivated. + + Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. + """ + webhookDelete( + """ID of a webhook to delete.""" + id: ID! + ): WebhookDelete @doc(category: "Webhooks") + + """ + Updates a webhook subscription. + + Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. + """ + webhookUpdate( + """ID of a webhook to update.""" + id: ID! + + """Fields required to update a webhook.""" + input: WebhookUpdateInput! + ): WebhookUpdate @doc(category: "Webhooks") + + """ + Retries event delivery. + + Requires one of the following permissions: MANAGE_APPS. + """ + eventDeliveryRetry( + """ID of the event delivery to retry.""" + id: ID! + ): EventDeliveryRetry @doc(category: "Webhooks") + + """ + Performs a dry run of a webhook event. Supports a single event (the first, if multiple provided in the `query`). Requires permission relevant to processed event. + + Added in Saleor 3.11. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: AUTHENTICATED_STAFF_USER. + """ + webhookDryRun( + """The ID of an object to serialize.""" + objectId: ID! + + """The subscription query that defines the webhook event and its payload.""" + query: String! + ): WebhookDryRun @doc(category: "Webhooks") + + """ + Trigger a webhook event. Supports a single event (the first, if multiple provided in the `webhook.subscription_query`). Requires permission relevant to processed event. Successfully delivered webhook returns `delivery` with status='PENDING' and empty payload. + + Added in Saleor 3.11. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: AUTHENTICATED_STAFF_USER. + """ + webhookTrigger( + """The ID of an object to serialize.""" + objectId: ID! + + """The ID of the webhook.""" + webhookId: ID! + ): WebhookTrigger @doc(category: "Webhooks") + + """ + Creates new warehouse. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + createWarehouse( + """Fields required to create warehouse.""" + input: WarehouseCreateInput! + ): WarehouseCreate @doc(category: "Products") + + """ + Updates given warehouse. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + updateWarehouse( + """ + External reference of a warehouse. + + Added in Saleor 3.16. + """ + externalReference: String + + """ID of a warehouse to update.""" + id: ID + + """Fields required to update warehouse.""" + input: WarehouseUpdateInput! + ): WarehouseUpdate @doc(category: "Products") + + """ + Deletes selected warehouse. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + deleteWarehouse( + """ID of a warehouse to delete.""" + id: ID! + ): WarehouseDelete @doc(category: "Products") + + """ + Add shipping zone to given warehouse. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + assignWarehouseShippingZone( + """ID of a warehouse to update.""" + id: ID! + + """List of shipping zone IDs.""" + shippingZoneIds: [ID!]! + ): WarehouseShippingZoneAssign @doc(category: "Products") + + """ + Remove shipping zone from given warehouse. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + unassignWarehouseShippingZone( + """ID of a warehouse to update.""" + id: ID! + + """List of shipping zone IDs.""" + shippingZoneIds: [ID!]! + ): WarehouseShippingZoneUnassign @doc(category: "Products") + + """ + Create a tax class. + + Added in Saleor 3.9. + + Requires one of the following permissions: MANAGE_TAXES. + """ + taxClassCreate( + """Fields required to create a tax class.""" + input: TaxClassCreateInput! + ): TaxClassCreate @doc(category: "Taxes") + + """ + Delete a tax class. After deleting the tax class any products, product types or shipping methods using it are updated to use the default tax class. + + Added in Saleor 3.9. + + Requires one of the following permissions: MANAGE_TAXES. + """ + taxClassDelete( + """ID of a tax class to delete.""" + id: ID! + ): TaxClassDelete @doc(category: "Taxes") + + """ + Update a tax class. + + Added in Saleor 3.9. + + Requires one of the following permissions: MANAGE_TAXES. + """ + taxClassUpdate( + """ID of the tax class.""" + id: ID! + + """Fields required to update a tax class.""" + input: TaxClassUpdateInput! + ): TaxClassUpdate @doc(category: "Taxes") + + """ + Update tax configuration for a channel. + + Added in Saleor 3.9. + + Requires one of the following permissions: MANAGE_TAXES. + """ + taxConfigurationUpdate( + """ID of the tax configuration.""" + id: ID! + + """Fields required to update the tax configuration.""" + input: TaxConfigurationUpdateInput! + ): TaxConfigurationUpdate @doc(category: "Taxes") + + """ + Update tax class rates for a specific country. + + Added in Saleor 3.9. + + Requires one of the following permissions: MANAGE_TAXES. + """ + taxCountryConfigurationUpdate( + """Country in which to update the tax class rates.""" + countryCode: CountryCode! + + """ + List of tax rates per tax class to update. When `{taxClass: id, rate: null`} is passed, it deletes the rate object for given taxClass ID. When `{rate: Int}` is passed without a tax class, it updates the default tax class for this country. + """ + updateTaxClassRates: [TaxClassRateInput!]! + ): TaxCountryConfigurationUpdate @doc(category: "Taxes") + + """ + Remove all tax class rates for a specific country. + + Added in Saleor 3.9. + + Requires one of the following permissions: MANAGE_TAXES. + """ + taxCountryConfigurationDelete( + """Country in which to update the tax class rates.""" + countryCode: CountryCode! + ): TaxCountryConfigurationDelete @doc(category: "Taxes") + + """ + Exempt checkout or order from charging the taxes. When tax exemption is enabled, taxes won't be charged for the checkout or order. Taxes may still be calculated in cases when product prices are entered with the tax included and the net price needs to be known. + + Added in Saleor 3.8. + + Requires one of the following permissions: MANAGE_TAXES. + """ + taxExemptionManage( + """ID of the Checkout or Order object.""" + id: ID! + + """Determines if a taxes should be exempt.""" + taxExemption: Boolean! + ): TaxExemptionManage @doc(category: "Taxes") + + """ + Updates stocks for a given variant and warehouse. Variant and warehouse selectors have to be the same for all stock inputs. Is not allowed to use 'variantId' in one input and 'variantExternalReference' in another. + + Added in Saleor 3.13. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_PRODUCTS. + + Triggers the following webhook events: + - PRODUCT_VARIANT_STOCK_UPDATED (async): A product variant stock details were updated. + """ + stockBulkUpdate( + """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" + errorPolicy: ErrorPolicyEnum + + """Input list of stocks to update.""" + stocks: [StockBulkUpdateInput!]! + ): StockBulkUpdate @doc(category: "Products") @webhookEventsInfo(asyncEvents: [PRODUCT_VARIANT_STOCK_UPDATED], syncEvents: []) + + """ + Creates a new staff notification recipient. + + Requires one of the following permissions: MANAGE_SETTINGS. + """ + staffNotificationRecipientCreate( + """Fields required to create a staff notification recipient.""" + input: StaffNotificationRecipientInput! + ): StaffNotificationRecipientCreate @doc(category: "Users") + + """ + Updates a staff notification recipient. + + Requires one of the following permissions: MANAGE_SETTINGS. + """ + staffNotificationRecipientUpdate( + """ID of a staff notification recipient to update.""" + id: ID! + + """Fields required to update a staff notification recipient.""" + input: StaffNotificationRecipientInput! + ): StaffNotificationRecipientUpdate @doc(category: "Users") + + """ + Delete staff notification recipient. + + Requires one of the following permissions: MANAGE_SETTINGS. + """ + staffNotificationRecipientDelete( + """ID of a staff notification recipient to delete.""" + id: ID! + ): StaffNotificationRecipientDelete @doc(category: "Users") + + """ + Updates site domain of the shop. + + DEPRECATED: this mutation will be removed in Saleor 4.0. Use `PUBLIC_URL` environment variable instead. + + Requires one of the following permissions: MANAGE_SETTINGS. + """ + shopDomainUpdate( + """Fields required to update site.""" + input: SiteDomainInput + ): ShopDomainUpdate @doc(category: "Shop") @deprecated(reason: "\\n\\nDEPRECATED: this mutation will be removed in Saleor 4.0. Use `PUBLIC_URL` environment variable instead.") + + """ + Updates shop settings. + + Requires one of the following permissions: MANAGE_SETTINGS. + + Triggers the following webhook events: + - SHOP_METADATA_UPDATED (async): Optionally triggered when public or private metadata is updated. + """ + shopSettingsUpdate( + """Fields required to update shop settings.""" + input: ShopSettingsInput! + ): ShopSettingsUpdate @doc(category: "Shop") @webhookEventsInfo(asyncEvents: [SHOP_METADATA_UPDATED], syncEvents: []) + + """ + Fetch tax rates. + + Requires one of the following permissions: MANAGE_SETTINGS. + """ + shopFetchTaxRates: ShopFetchTaxRates @doc(category: "Shop") @deprecated(reason: "\\n\\nDEPRECATED: this mutation will be removed in Saleor 4.0.") + + """ + Creates/updates translations for shop settings. + + Requires one of the following permissions: MANAGE_TRANSLATIONS. + """ + shopSettingsTranslate( + """Fields required to update shop settings translations.""" + input: ShopSettingsTranslationInput! + + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): ShopSettingsTranslate @doc(category: "Shop") + + """ + Update the shop's address. If the `null` value is passed, the currently selected address will be deleted. + + Requires one of the following permissions: MANAGE_SETTINGS. + """ + shopAddressUpdate( + """Fields required to update shop address.""" + input: AddressInput + ): ShopAddressUpdate @doc(category: "Shop") + + """ + Update shop order settings across all channels. Returns `orderSettings` for the first `channel` in alphabetical order. + + Requires one of the following permissions: MANAGE_ORDERS. + """ + orderSettingsUpdate( + """Fields required to update shop order settings.""" + input: OrderSettingsUpdateInput! + ): OrderSettingsUpdate @doc(category: "Orders") @deprecated(reason: "\\n\\nDEPRECATED: this mutation will be removed in Saleor 4.0. Use `channelUpdate` mutation instead.") + + """ + Update gift card settings. + + Requires one of the following permissions: MANAGE_GIFT_CARD. + """ + giftCardSettingsUpdate( + """Fields required to update gift card settings.""" + input: GiftCardSettingsUpdateInput! + ): GiftCardSettingsUpdate @doc(category: "Gift cards") + + """ + Manage shipping method's availability in channels. + + Requires one of the following permissions: MANAGE_SHIPPING. + """ + shippingMethodChannelListingUpdate( + """ID of a shipping method to update.""" + id: ID! + + """Fields required to update shipping method channel listings.""" + input: ShippingMethodChannelListingInput! + ): ShippingMethodChannelListingUpdate @doc(category: "Shipping") + + """ + Creates a new shipping price. + + Requires one of the following permissions: MANAGE_SHIPPING. + """ + shippingPriceCreate( + """Fields required to create a shipping price.""" + input: ShippingPriceInput! + ): ShippingPriceCreate @doc(category: "Shipping") + + """ + Deletes a shipping price. + + Requires one of the following permissions: MANAGE_SHIPPING. + """ + shippingPriceDelete( + """ID of a shipping price to delete.""" + id: ID! + ): ShippingPriceDelete @doc(category: "Shipping") + + """ + Deletes shipping prices. + + Requires one of the following permissions: MANAGE_SHIPPING. + """ + shippingPriceBulkDelete( + """List of shipping price IDs to delete.""" + ids: [ID!]! + ): ShippingPriceBulkDelete @doc(category: "Shipping") + + """ + Updates a new shipping price. + + Requires one of the following permissions: MANAGE_SHIPPING. + """ + shippingPriceUpdate( + """ID of a shipping price to update.""" + id: ID! + + """Fields required to update a shipping price.""" + input: ShippingPriceInput! + ): ShippingPriceUpdate @doc(category: "Shipping") + + """ + Creates/updates translations for a shipping method. + + Requires one of the following permissions: MANAGE_TRANSLATIONS. + """ + shippingPriceTranslate( + """ShippingMethodType ID or ShippingMethodTranslatableContent ID.""" + id: ID! + + """Fields required to update shipping price translations.""" + input: ShippingPriceTranslationInput! + + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): ShippingPriceTranslate @doc(category: "Shipping") + + """ + Exclude products from shipping price. + + Requires one of the following permissions: MANAGE_SHIPPING. + """ + shippingPriceExcludeProducts( + """ID of a shipping price.""" + id: ID! + + """Exclude products input.""" + input: ShippingPriceExcludeProductsInput! + ): ShippingPriceExcludeProducts @doc(category: "Shipping") + + """ + Remove product from excluded list for shipping price. + + Requires one of the following permissions: MANAGE_SHIPPING. + """ + shippingPriceRemoveProductFromExclude( + """ID of a shipping price.""" + id: ID! + + """List of products which will be removed from excluded list.""" + products: [ID!]! + ): ShippingPriceRemoveProductFromExclude @doc(category: "Shipping") + + """ + Creates a new shipping zone. + + Requires one of the following permissions: MANAGE_SHIPPING. + """ + shippingZoneCreate( + """Fields required to create a shipping zone.""" + input: ShippingZoneCreateInput! + ): ShippingZoneCreate @doc(category: "Shipping") + + """ + Deletes a shipping zone. + + Requires one of the following permissions: MANAGE_SHIPPING. + """ + shippingZoneDelete( + """ID of a shipping zone to delete.""" + id: ID! + ): ShippingZoneDelete @doc(category: "Shipping") + + """ + Deletes shipping zones. + + Requires one of the following permissions: MANAGE_SHIPPING. + """ + shippingZoneBulkDelete( + """List of shipping zone IDs to delete.""" + ids: [ID!]! + ): ShippingZoneBulkDelete @doc(category: "Shipping") + + """ + Updates a new shipping zone. + + Requires one of the following permissions: MANAGE_SHIPPING. + """ + shippingZoneUpdate( + """ID of a shipping zone to update.""" + id: ID! + + """Fields required to update a shipping zone.""" + input: ShippingZoneUpdateInput! + ): ShippingZoneUpdate @doc(category: "Shipping") + + """ + Assign attributes to a given product type. + + Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + """ + productAttributeAssign( + """The operations to perform.""" + operations: [ProductAttributeAssignInput!]! + + """ID of the product type to assign the attributes into.""" + productTypeId: ID! + ): ProductAttributeAssign @doc(category: "Products") + + """ + Update attributes assigned to product variant for given product type. + + Added in Saleor 3.1. + + Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + """ + productAttributeAssignmentUpdate( + """The operations to perform.""" + operations: [ProductAttributeAssignmentUpdateInput!]! + + """ID of the product type to assign the attributes into.""" + productTypeId: ID! + ): ProductAttributeAssignmentUpdate @doc(category: "Products") + + """ + Un-assign attributes from a given product type. + + Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + """ + productAttributeUnassign( + """The IDs of the attributes to unassign.""" + attributeIds: [ID!]! + + """ID of the product type from which the attributes should be unassigned.""" + productTypeId: ID! + ): ProductAttributeUnassign @doc(category: "Products") + + """ + Creates a new category. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + categoryCreate( + """Fields required to create a category.""" + input: CategoryInput! + + """ + ID of the parent category. If empty, category will be top level category. + """ + parent: ID + ): CategoryCreate @doc(category: "Products") + + """ + Deletes a category. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + categoryDelete( + """ID of a category to delete.""" + id: ID! + ): CategoryDelete @doc(category: "Products") + + """ + Deletes categories. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + categoryBulkDelete( + """List of category IDs to delete.""" + ids: [ID!]! + ): CategoryBulkDelete @doc(category: "Products") + + """ + Updates a category. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + categoryUpdate( + """ID of a category to update.""" + id: ID! + + """Fields required to update a category.""" + input: CategoryInput! + ): CategoryUpdate @doc(category: "Products") + + """ + Creates/updates translations for a category. + + Requires one of the following permissions: MANAGE_TRANSLATIONS. + """ + categoryTranslate( + """Category ID or CategoryTranslatableContent ID.""" + id: ID! + + """Fields required to update category translations.""" + input: TranslationInput! + + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): CategoryTranslate @doc(category: "Products") + + """ + Adds products to a collection. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + collectionAddProducts( + """ID of a collection.""" + collectionId: ID! + + """List of product IDs.""" + products: [ID!]! + ): CollectionAddProducts @doc(category: "Products") + + """ + Creates a new collection. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + collectionCreate( + """Fields required to create a collection.""" + input: CollectionCreateInput! + ): CollectionCreate @doc(category: "Products") + + """ + Deletes a collection. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + collectionDelete( + """ID of a collection to delete.""" + id: ID! + ): CollectionDelete @doc(category: "Products") + + """ + Reorder the products of a collection. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + collectionReorderProducts( + """ID of a collection.""" + collectionId: ID! + + """The collection products position operations.""" + moves: [MoveProductInput!]! + ): CollectionReorderProducts @doc(category: "Products") + + """ + Deletes collections. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + collectionBulkDelete( + """List of collection IDs to delete.""" + ids: [ID!]! + ): CollectionBulkDelete @doc(category: "Products") + + """ + Remove products from a collection. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + collectionRemoveProducts( + """ID of a collection.""" + collectionId: ID! + + """List of product IDs.""" + products: [ID!]! + ): CollectionRemoveProducts @doc(category: "Products") + + """ + Updates a collection. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + collectionUpdate( + """ID of a collection to update.""" + id: ID! + + """Fields required to update a collection.""" + input: CollectionInput! + ): CollectionUpdate @doc(category: "Products") + + """ + Creates/updates translations for a collection. + + Requires one of the following permissions: MANAGE_TRANSLATIONS. + """ + collectionTranslate( + """Collection ID or CollectionTranslatableContent ID.""" + id: ID! + + """Fields required to update collection translations.""" + input: TranslationInput! + + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): CollectionTranslate @doc(category: "Products") + + """ + Manage collection's availability in channels. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + collectionChannelListingUpdate( + """ID of a collection to update.""" + id: ID! + + """Fields required to create or update collection channel listings.""" + input: CollectionChannelListingUpdateInput! + ): CollectionChannelListingUpdate @doc(category: "Products") + + """ + Creates a new product. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productCreate( + """Fields required to create a product.""" + input: ProductCreateInput! + ): ProductCreate @doc(category: "Products") + + """ + Deletes a product. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productDelete( + """ + External ID of a product to delete. + + Added in Saleor 3.10. + """ + externalReference: String + + """ID of a product to delete.""" + id: ID + ): ProductDelete @doc(category: "Products") + + """ + Creates products. + + Added in Saleor 3.13. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productBulkCreate( + """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" + errorPolicy: ErrorPolicyEnum + + """Input list of products to create.""" + products: [ProductBulkCreateInput!]! + ): ProductBulkCreate @doc(category: "Products") + + """ + Deletes products. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productBulkDelete( + """List of product IDs to delete.""" + ids: [ID!]! + ): ProductBulkDelete @doc(category: "Products") + + """ + Updates an existing product. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productUpdate( + """ + External ID of a product to update. + + Added in Saleor 3.10. + """ + externalReference: String + + """ID of a product to update.""" + id: ID + + """Fields required to update a product.""" + input: ProductInput! + ): ProductUpdate @doc(category: "Products") + + """ + Creates/updates translations for products. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_TRANSLATIONS. + + Triggers the following webhook events: + - TRANSLATION_CREATED (async): Called when a translation was created. + - TRANSLATION_UPDATED (async): Called when a translation was updated. + """ + productBulkTranslate( + """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" + errorPolicy: ErrorPolicyEnum + + """List of product translations.""" + translations: [ProductBulkTranslateInput!]! + ): ProductBulkTranslate @doc(category: "Products") @webhookEventsInfo(asyncEvents: [TRANSLATION_CREATED, TRANSLATION_UPDATED], syncEvents: []) + + """ + Creates/updates translations for a product. + + Requires one of the following permissions: MANAGE_TRANSLATIONS. + """ + productTranslate( + """Product ID or ProductTranslatableContent ID.""" + id: ID! + + """Fields required to update product translations.""" + input: TranslationInput! + + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): ProductTranslate @doc(category: "Products") + + """ + Manage product's availability in channels. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productChannelListingUpdate( + """ID of a product to update.""" + id: ID! + + """Fields required to create or update product channel listings.""" + input: ProductChannelListingUpdateInput! + ): ProductChannelListingUpdate @doc(category: "Products") + + """ + Create a media object (image or video URL) associated with product. For image, this mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productMediaCreate( + """Fields required to create a product media.""" + input: ProductMediaCreateInput! + ): ProductMediaCreate @doc(category: "Products") + + """ + Reorder the variants of a product. Mutation updates updated_at on product and triggers PRODUCT_UPDATED webhook. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productVariantReorder( + """The list of variant reordering operations.""" + moves: [ReorderInput!]! + + """Id of product that variants order will be altered.""" + productId: ID! + ): ProductVariantReorder @doc(category: "Products") + + """ + Deletes a product media. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productMediaDelete( + """ID of a product media to delete.""" + id: ID! + ): ProductMediaDelete @doc(category: "Products") + + """ + Deletes product media. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productMediaBulkDelete( + """List of product media IDs to delete.""" + ids: [ID!]! + ): ProductMediaBulkDelete @doc(category: "Products") + + """ + Changes ordering of the product media. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productMediaReorder( + """IDs of a product media in the desired order.""" + mediaIds: [ID!]! + + """ID of product that media order will be altered.""" + productId: ID! + ): ProductMediaReorder @doc(category: "Products") + + """ + Updates a product media. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productMediaUpdate( + """ID of a product media to update.""" + id: ID! + + """Fields required to update a product media.""" + input: ProductMediaUpdateInput! + ): ProductMediaUpdate @doc(category: "Products") + + """ + Creates a new product type. + + Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + """ + productTypeCreate( + """Fields required to create a product type.""" + input: ProductTypeInput! + ): ProductTypeCreate @doc(category: "Products") + + """ + Deletes a product type. + + Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + """ + productTypeDelete( + """ID of a product type to delete.""" + id: ID! + ): ProductTypeDelete @doc(category: "Products") + + """ + Deletes product types. + + Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + """ + productTypeBulkDelete( + """List of product type IDs to delete.""" + ids: [ID!]! + ): ProductTypeBulkDelete @doc(category: "Products") + + """ + Updates an existing product type. + + Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + """ + productTypeUpdate( + """ID of a product type to update.""" + id: ID! + + """Fields required to update a product type.""" + input: ProductTypeInput! + ): ProductTypeUpdate @doc(category: "Products") + + """ + Reorder the attributes of a product type. + + Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + """ + productTypeReorderAttributes( + """The list of attribute reordering operations.""" + moves: [ReorderInput!]! + + """ID of a product type.""" + productTypeId: ID! + + """The attribute type to reorder.""" + type: ProductAttributeType! + ): ProductTypeReorderAttributes @doc(category: "Products") + + """ + Reorder product attribute values. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productReorderAttributeValues( + """ID of an attribute.""" + attributeId: ID! + + """The list of reordering operations for given attribute values.""" + moves: [ReorderInput!]! + + """ID of a product.""" + productId: ID! + ): ProductReorderAttributeValues @doc(category: "Products") + + """ + Create new digital content. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + digitalContentCreate( + """Fields required to create a digital content.""" + input: DigitalContentUploadInput! + + """ID of a product variant to upload digital content.""" + variantId: ID! + ): DigitalContentCreate @doc(category: "Products") + + """ + Remove digital content assigned to given variant. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + digitalContentDelete( + """ID of a product variant with digital content to remove.""" + variantId: ID! + ): DigitalContentDelete @doc(category: "Products") + + """ + Update digital content. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + digitalContentUpdate( + """Fields required to update a digital content.""" + input: DigitalContentInput! + + """ID of a product variant with digital content to update.""" + variantId: ID! + ): DigitalContentUpdate @doc(category: "Products") + + """ + Generate new URL to digital content. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + digitalContentUrlCreate( + """Fields required to create a new url.""" + input: DigitalContentUrlCreateInput! + ): DigitalContentUrlCreate @doc(category: "Products") + + """ + Creates a new variant for a product. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productVariantCreate( + """Fields required to create a product variant.""" + input: ProductVariantCreateInput! + ): ProductVariantCreate @doc(category: "Products") + + """ + Deletes a product variant. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productVariantDelete( + """ + External ID of a product variant to update. + + Added in Saleor 3.10. + """ + externalReference: String + + """ID of a product variant to delete.""" + id: ID + + """ + SKU of a product variant to delete. + + Added in Saleor 3.8. + """ + sku: String + ): ProductVariantDelete @doc(category: "Products") + + """ + Creates product variants for a given product. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productVariantBulkCreate( + """ + Policies of error handling. DEFAULT: REJECT_EVERYTHING + + Added in Saleor 3.11. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + errorPolicy: ErrorPolicyEnum + + """ID of the product to create the variants for.""" + product: ID! + + """Input list of product variants to create.""" + variants: [ProductVariantBulkCreateInput!]! + ): ProductVariantBulkCreate @doc(category: "Products") + + """ + Update multiple product variants. + + Added in Saleor 3.11. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productVariantBulkUpdate( + """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" + errorPolicy: ErrorPolicyEnum + + """ID of the product to update the variants for.""" + product: ID! + + """Input list of product variants to update.""" + variants: [ProductVariantBulkUpdateInput!]! + ): ProductVariantBulkUpdate @doc(category: "Products") + + """ + Deletes product variants. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productVariantBulkDelete( + """List of product variant IDs to delete.""" + ids: [ID!] + + """ + List of product variant SKUs to delete. + + Added in Saleor 3.8. + """ + skus: [String!] + ): ProductVariantBulkDelete @doc(category: "Products") + + """ + Creates stocks for product variant. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productVariantStocksCreate( + """Input list of stocks to create.""" + stocks: [StockInput!]! + + """ID of a product variant for which stocks will be created.""" + variantId: ID! + ): ProductVariantStocksCreate @doc(category: "Products") + + """ + Delete stocks from product variant. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productVariantStocksDelete( + """SKU of product variant for which stocks will be deleted.""" + sku: String + + """ID of product variant for which stocks will be deleted.""" + variantId: ID + + """Input list of warehouse IDs.""" + warehouseIds: [ID!] + ): ProductVariantStocksDelete @doc(category: "Products") + + """ + Update stocks for product variant. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productVariantStocksUpdate( + """SKU of product variant for which stocks will be updated.""" + sku: String + + """Input list of stocks to create or update.""" + stocks: [StockInput!]! + + """ID of a product variant for which stocks will be updated.""" + variantId: ID + ): ProductVariantStocksUpdate @doc(category: "Products") + + """ + Updates an existing variant for product. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productVariantUpdate( + """ + External ID of a product variant to update. + + Added in Saleor 3.10. + """ + externalReference: String + + """ID of a product to update.""" + id: ID + + """Fields required to update a product variant.""" + input: ProductVariantInput! + + """ + SKU of a product variant to update. + + Added in Saleor 3.8. + """ + sku: String + ): ProductVariantUpdate @doc(category: "Products") + + """ + Set default variant for a product. Mutation triggers PRODUCT_UPDATED webhook. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productVariantSetDefault( + """Id of a product that will have the default variant set.""" + productId: ID! + + """Id of a variant that will be set as default.""" + variantId: ID! + ): ProductVariantSetDefault @doc(category: "Products") + + """ + Creates/updates translations for a product variant. + + Requires one of the following permissions: MANAGE_TRANSLATIONS. + """ + productVariantTranslate( + """ProductVariant ID or ProductVariantTranslatableContent ID.""" + id: ID! + + """Fields required to update product variant translations.""" + input: NameTranslationInput! + + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): ProductVariantTranslate @doc(category: "Products") + + """ + Creates/updates translations for products variants. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_TRANSLATIONS. + + Triggers the following webhook events: + - TRANSLATION_CREATED (async): A translation was created. + - TRANSLATION_UPDATED (async): A translation was updated. + """ + productVariantBulkTranslate( + """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" + errorPolicy: ErrorPolicyEnum + + """List of products variants translations.""" + translations: [ProductVariantBulkTranslateInput!]! + ): ProductVariantBulkTranslate @doc(category: "Products") @webhookEventsInfo(asyncEvents: [TRANSLATION_CREATED, TRANSLATION_UPDATED], syncEvents: []) + + """ + Manage product variant prices in channels. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productVariantChannelListingUpdate( + """ID of a product variant to update.""" + id: ID + + """ + List of fields required to create or upgrade product variant channel listings. + """ + input: [ProductVariantChannelListingAddInput!]! + + """ + SKU of a product variant to update. + + Added in Saleor 3.8. + """ + sku: String + ): ProductVariantChannelListingUpdate @doc(category: "Products") + """ - Creates a new webhook subscription. + Reorder product variant attribute values. - Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. + Requires one of the following permissions: MANAGE_PRODUCTS. """ - webhookCreate( - """Fields required to create a webhook.""" - input: WebhookCreateInput! - ): WebhookCreate @doc(category: "Webhooks") + productVariantReorderAttributeValues( + """ID of an attribute.""" + attributeId: ID! + + """The list of reordering operations for given attribute values.""" + moves: [ReorderInput!]! + + """ID of a product variant.""" + variantId: ID! + ): ProductVariantReorderAttributeValues @doc(category: "Products") """ - Delete a webhook. Before the deletion, the webhook is deactivated to pause any deliveries that are already scheduled. The deletion might fail if delivery is in progress. In such a case, the webhook is not deleted but remains deactivated. + Deactivates product variant preorder. It changes all preorder allocation into regular allocation. - Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. + Added in Saleor 3.1. + + Requires one of the following permissions: MANAGE_PRODUCTS. """ - webhookDelete( - """ID of a webhook to delete.""" + productVariantPreorderDeactivate( + """ID of a variant which preorder should be deactivated.""" id: ID! - ): WebhookDelete @doc(category: "Webhooks") + ): ProductVariantPreorderDeactivate @doc(category: "Products") """ - Updates a webhook subscription. + Assign an media to a product variant. - Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. + Requires one of the following permissions: MANAGE_PRODUCTS. """ - webhookUpdate( - """ID of a webhook to update.""" - id: ID! + variantMediaAssign( + """ID of a product media to assign to a variant.""" + mediaId: ID! - """Fields required to update a webhook.""" - input: WebhookUpdateInput! - ): WebhookUpdate @doc(category: "Webhooks") + """ID of a product variant.""" + variantId: ID! + ): VariantMediaAssign @doc(category: "Products") """ - Retries event delivery. + Unassign an media from a product variant. - Requires one of the following permissions: MANAGE_APPS. + Requires one of the following permissions: MANAGE_PRODUCTS. """ - eventDeliveryRetry( - """ID of the event delivery to retry.""" - id: ID! - ): EventDeliveryRetry @doc(category: "Webhooks") + variantMediaUnassign( + """ID of a product media to unassign from a variant.""" + mediaId: ID! + + """ID of a product variant.""" + variantId: ID! + ): VariantMediaUnassign @doc(category: "Products") """ - Performs a dry run of a webhook event. Supports a single event (the first, if multiple provided in the `query`). Requires permission relevant to processed event. + Captures the authorized payment amount. - Added in Saleor 3.11. + Requires one of the following permissions: MANAGE_ORDERS. + """ + paymentCapture( + """Transaction amount.""" + amount: PositiveDecimal + + """Payment ID.""" + paymentId: ID! + ): PaymentCapture @doc(category: "Payments") + + """ + Refunds the captured payment amount. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Requires one of the following permissions: MANAGE_ORDERS. + """ + paymentRefund( + """Transaction amount.""" + amount: PositiveDecimal + + """Payment ID.""" + paymentId: ID! + ): PaymentRefund @doc(category: "Payments") + + """ + Voids the authorized payment. - Requires one of the following permissions: AUTHENTICATED_STAFF_USER. + Requires one of the following permissions: MANAGE_ORDERS. """ - webhookDryRun( - """The ID of an object to serialize.""" - objectId: ID! + paymentVoid( + """Payment ID.""" + paymentId: ID! + ): PaymentVoid @doc(category: "Payments") - """The subscription query that defines the webhook event and its payload.""" - query: String! - ): WebhookDryRun @doc(category: "Webhooks") + """Initializes payment process when it is required by gateway.""" + paymentInitialize( + """Slug of a channel for which the data should be returned.""" + channel: String + + """A gateway name used to initialize the payment.""" + gateway: String! + + """Client-side generated data required to initialize the payment.""" + paymentData: JSONString + ): PaymentInitialize @doc(category: "Payments") + + """Check payment balance.""" + paymentCheckBalance( + """Fields required to check payment balance.""" + input: PaymentCheckBalanceInput! + ): PaymentCheckBalance @doc(category: "Payments") """ - Trigger a webhook event. Supports a single event (the first, if multiple provided in the `webhook.subscription_query`). Requires permission relevant to processed event. Successfully delivered webhook returns `delivery` with status='PENDING' and empty payload. + Create transaction for checkout or order. - Added in Saleor 3.11. + Added in Saleor 3.4. Note: this API is currently in Feature Preview and can be subject to changes at later point. - Requires one of the following permissions: AUTHENTICATED_STAFF_USER. + Requires one of the following permissions: HANDLE_PAYMENTS. """ - webhookTrigger( - """The ID of an object to serialize.""" - objectId: ID! + transactionCreate( + """The ID of the checkout or order.""" + id: ID! - """The ID of the webhook.""" - webhookId: ID! - ): WebhookTrigger @doc(category: "Webhooks") + """Input data required to create a new transaction object.""" + transaction: TransactionCreateInput! + + """Data that defines a transaction event.""" + transactionEvent: TransactionEventInput + ): TransactionCreate @doc(category: "Payments") """ - Creates new warehouse. + Update transaction. - Requires one of the following permissions: MANAGE_PRODUCTS. + Added in Saleor 3.4. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires the following permissions: OWNER and HANDLE_PAYMENTS for apps, HANDLE_PAYMENTS for staff users. Staff user cannot update a transaction that is owned by the app. """ - createWarehouse( - """Fields required to create warehouse.""" - input: WarehouseCreateInput! - ): WarehouseCreate @doc(category: "Products") + transactionUpdate( + """The ID of the transaction. One of field id or token is required.""" + id: ID + + """ + The token of the transaction. One of field id or token is required. + + Added in Saleor 3.14. + """ + token: UUID + + """Input data required to create a new transaction object.""" + transaction: TransactionUpdateInput + + """Data that defines a transaction transaction.""" + transactionEvent: TransactionEventInput + ): TransactionUpdate @doc(category: "Payments") """ - Updates given warehouse. + Request an action for payment transaction. - Requires one of the following permissions: MANAGE_PRODUCTS. + Added in Saleor 3.4. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: HANDLE_PAYMENTS. """ - updateWarehouse( - """ID of a warehouse to update.""" - id: ID! + transactionRequestAction( + """Determines the action type.""" + actionType: TransactionActionEnum! - """Fields required to update warehouse.""" - input: WarehouseUpdateInput! - ): WarehouseUpdate @doc(category: "Products") + """ + Transaction request amount. If empty for refund or capture, maximal possible amount will be used. + """ + amount: PositiveDecimal + + """The ID of the transaction. One of field id or token is required.""" + id: ID + + """ + The token of the transaction. One of field id or token is required. + + Added in Saleor 3.14. + """ + token: UUID + ): TransactionRequestAction @doc(category: "Payments") """ - Deletes selected warehouse. + Request a refund for payment transaction based on granted refund. - Requires one of the following permissions: MANAGE_PRODUCTS. + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: HANDLE_PAYMENTS. """ - deleteWarehouse( - """ID of a warehouse to delete.""" - id: ID! - ): WarehouseDelete @doc(category: "Products") + transactionRequestRefundForGrantedRefund( + """The ID of the granted refund.""" + grantedRefundId: ID! + + """The ID of the transaction. One of field id or token is required.""" + id: ID + + """ + The token of the transaction. One of field id or token is required. + + Added in Saleor 3.14. + """ + token: UUID + ): TransactionRequestRefundForGrantedRefund @doc(category: "Payments") """ - Add shipping zone to given warehouse. + Report the event for the transaction. - Requires one of the following permissions: MANAGE_PRODUCTS. + Added in Saleor 3.13. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires the following permissions: OWNER and HANDLE_PAYMENTS for apps, HANDLE_PAYMENTS for staff users. Staff user cannot update a transaction that is owned by the app. """ - assignWarehouseShippingZone( - """ID of a warehouse to update.""" - id: ID! + transactionEventReport( + """The amount of the event to report.""" + amount: PositiveDecimal! - """List of shipping zone IDs.""" - shippingZoneIds: [ID!]! - ): WarehouseShippingZoneAssign @doc(category: "Products") + """List of all possible actions for the transaction""" + availableActions: [TransactionActionEnum!] + + """ + The url that will allow to redirect user to payment provider page with event details. + """ + externalUrl: String + + """The ID of the transaction. One of field id or token is required.""" + id: ID + + """The message related to the event.""" + message: String + + """PSP Reference of the event to report.""" + pspReference: String! + + """ + The time of the event to report. If not provide, the current time will be used. + """ + time: DateTime - """ - Remove shipping zone from given warehouse. - - Requires one of the following permissions: MANAGE_PRODUCTS. - """ - unassignWarehouseShippingZone( - """ID of a warehouse to update.""" - id: ID! + """ + The token of the transaction. One of field id or token is required. + + Added in Saleor 3.14. + """ + token: UUID - """List of shipping zone IDs.""" - shippingZoneIds: [ID!]! - ): WarehouseShippingZoneUnassign @doc(category: "Products") + """Current status of the event to report.""" + type: TransactionEventTypeEnum! + ): TransactionEventReport @doc(category: "Payments") """ - Create a tax class. + Initializes a payment gateway session. It triggers the webhook `PAYMENT_GATEWAY_INITIALIZE_SESSION`, to the requested `paymentGateways`. If `paymentGateways` is not provided, the webhook will be send to all subscribed payment gateways. - Added in Saleor 3.9. + Added in Saleor 3.13. - Requires one of the following permissions: MANAGE_TAXES. + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - taxClassCreate( - """Fields required to create a tax class.""" - input: TaxClassCreateInput! - ): TaxClassCreate @doc(category: "Taxes") + paymentGatewayInitialize( + """ + The amount requested for initializing the payment gateway. If not provided, the difference between checkout.total - transactions that are already processed will be send. + """ + amount: PositiveDecimal - """ - Delete a tax class. After deleting the tax class any products, product types or shipping methods using it are updated to use the default tax class. - - Added in Saleor 3.9. - - Requires one of the following permissions: MANAGE_TAXES. - """ - taxClassDelete( - """ID of a tax class to delete.""" + """The ID of the checkout or order.""" id: ID! - ): TaxClassDelete @doc(category: "Taxes") + + """List of payment gateways to initialize.""" + paymentGateways: [PaymentGatewayToInitialize!] + ): PaymentGatewayInitialize @doc(category: "Payments") """ - Update a tax class. + Initializes a transaction session. It triggers the webhook `TRANSACTION_INITIALIZE_SESSION`, to the requested `paymentGateways`. - Added in Saleor 3.9. + Added in Saleor 3.13. - Requires one of the following permissions: MANAGE_TAXES. + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - taxClassUpdate( - """ID of the tax class.""" - id: ID! + transactionInitialize( + """ + The expected action called for the transaction. By default, the `channel.paymentSettings.defaultTransactionFlowStrategy` will be used.The field can be used only by app that has `HANDLE_PAYMENTS` permission. + """ + action: TransactionFlowStrategyEnum - """Fields required to update a tax class.""" - input: TaxClassUpdateInput! - ): TaxClassUpdate @doc(category: "Taxes") + """ + The amount requested for initializing the payment gateway. If not provided, the difference between checkout.total - transactions that are already processed will be send. + """ + amount: PositiveDecimal - """ - Update tax configuration for a channel. - - Added in Saleor 3.9. - - Requires one of the following permissions: MANAGE_TAXES. - """ - taxConfigurationUpdate( - """ID of the tax configuration.""" + """ + The customer's IP address. If not provided Saleor will try to determine the customer's IP address on its own. The customer's IP address will be passed to the payment app. The IP should be in ipv4 or ipv6 format. The field can be used only by an app that has `HANDLE_PAYMENTS` permission. + + Added in Saleor 3.16. + """ + customerIpAddress: String + + """The ID of the checkout or order.""" id: ID! - """Fields required to update the tax configuration.""" - input: TaxConfigurationUpdateInput! - ): TaxConfigurationUpdate @doc(category: "Taxes") + """ + The idempotency key assigned to the action. It will be passed to the payment app to discover potential duplicate actions. If not provided, the default one will be generated. If empty string provided, INVALID error code will be raised. + + Added in Saleor 3.14. + """ + idempotencyKey: String + + """Payment gateway used to initialize the transaction.""" + paymentGateway: PaymentGatewayToInitialize! + ): TransactionInitialize @doc(category: "Payments") """ - Update tax class rates for a specific country. + Processes a transaction session. It triggers the webhook `TRANSACTION_PROCESS_SESSION`, to the assigned `paymentGateways`. - Added in Saleor 3.9. + Added in Saleor 3.13. - Requires one of the following permissions: MANAGE_TAXES. + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - taxCountryConfigurationUpdate( - """Country in which to update the tax class rates.""" - countryCode: CountryCode! + transactionProcess( + """ + The customer's IP address. If not provided Saleor will try to determine the customer's IP address on its own. The customer's IP address will be passed to the payment app. The IP should be in ipv4 or ipv6 format. The field can be used only by an app that has `HANDLE_PAYMENTS` permission. + + Added in Saleor 3.16. + """ + customerIpAddress: String + + """The data that will be passed to the payment gateway.""" + data: JSON """ - List of tax rates per tax class to update. When `{taxClass: id, rate: null`} is passed, it deletes the rate object for given taxClass ID. When `{rate: Int}` is passed without a tax class, it updates the default tax class for this country. + The ID of the transaction to process. One of field id or token is required. """ - updateTaxClassRates: [TaxClassRateInput!]! - ): TaxCountryConfigurationUpdate @doc(category: "Taxes") + id: ID + + """ + The token of the transaction to process. One of field id or token is required. + + Added in Saleor 3.14. + """ + token: UUID + ): TransactionProcess @doc(category: "Payments") """ - Remove all tax class rates for a specific country. + Request to delete a stored payment method on payment provider side. - Added in Saleor 3.9. + Added in Saleor 3.16. - Requires one of the following permissions: MANAGE_TAXES. - """ - taxCountryConfigurationDelete( - """Country in which to update the tax class rates.""" - countryCode: CountryCode! - ): TaxCountryConfigurationDelete @doc(category: "Taxes") - - """ - Exempt checkout or order from charging the taxes. When tax exemption is enabled, taxes won't be charged for the checkout or order. Taxes may still be calculated in cases when product prices are entered with the tax included and the net price needs to be known. + Note: this API is currently in Feature Preview and can be subject to changes at later point. - Added in Saleor 3.8. + Requires one of the following permissions: AUTHENTICATED_USER. - Requires one of the following permissions: MANAGE_TAXES. + Triggers the following webhook events: + - STORED_PAYMENT_METHOD_DELETE_REQUESTED (sync): The customer requested to delete a payment method. """ - taxExemptionManage( - """ID of the Checkout or Order object.""" - id: ID! + storedPaymentMethodRequestDelete( + """Slug of a channel related to delete request.""" + channel: String! - """Determines if a taxes should be exempt.""" - taxExemption: Boolean! - ): TaxExemptionManage @doc(category: "Taxes") + """The ID of the payment method.""" + id: ID! + ): StoredPaymentMethodRequestDelete @doc(category: "Payments") @webhookEventsInfo(asyncEvents: [], syncEvents: [STORED_PAYMENT_METHOD_DELETE_REQUESTED]) """ - Updates stocks for a given variant and warehouse. + Initializes payment gateway for tokenizing payment method session. - Added in Saleor 3.13. + Added in Saleor 3.16. Note: this API is currently in Feature Preview and can be subject to changes at later point. - Requires one of the following permissions: MANAGE_PRODUCTS. - """ - stockBulkUpdate( - """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" - errorPolicy: ErrorPolicyEnum = reject_everything - - """Input list of stocks to update.""" - stocks: [StockBulkUpdateInput!]! - ): StockBulkUpdate @doc(category: "Products") - - """ - Creates a new staff notification recipient. + Requires one of the following permissions: AUTHENTICATED_USER. - Requires one of the following permissions: MANAGE_SETTINGS. + Triggers the following webhook events: + - PAYMENT_GATEWAY_INITIALIZE_TOKENIZATION_SESSION (sync): The customer requested to initialize payment gateway for tokenization. """ - staffNotificationRecipientCreate( - """Fields required to create a staff notification recipient.""" - input: StaffNotificationRecipientInput! - ): StaffNotificationRecipientCreate @doc(category: "Users") + paymentGatewayInitializeTokenization( + """Slug of a channel related to tokenization request.""" + channel: String! - """ - Updates a staff notification recipient. - - Requires one of the following permissions: MANAGE_SETTINGS. - """ - staffNotificationRecipientUpdate( - """ID of a staff notification recipient to update.""" - id: ID! + """The data that will be passed to the payment gateway.""" + data: JSON - """Fields required to update a staff notification recipient.""" - input: StaffNotificationRecipientInput! - ): StaffNotificationRecipientUpdate @doc(category: "Users") + """The identifier of the payment gateway app to initialize tokenization.""" + id: String! + ): PaymentGatewayInitializeTokenization @doc(category: "Payments") @webhookEventsInfo(asyncEvents: [], syncEvents: [PAYMENT_GATEWAY_INITIALIZE_TOKENIZATION_SESSION]) """ - Delete staff notification recipient. + Tokenize payment method. - Requires one of the following permissions: MANAGE_SETTINGS. - """ - staffNotificationRecipientDelete( - """ID of a staff notification recipient to delete.""" - id: ID! - ): StaffNotificationRecipientDelete @doc(category: "Users") - - """ - Updates site domain of the shop. + Added in Saleor 3.16. - Requires one of the following permissions: MANAGE_SETTINGS. - """ - shopDomainUpdate( - """Fields required to update site.""" - input: SiteDomainInput - ): ShopDomainUpdate @doc(category: "Shop") - - """ - Updates shop settings. + Note: this API is currently in Feature Preview and can be subject to changes at later point. - Requires one of the following permissions: MANAGE_SETTINGS. - """ - shopSettingsUpdate( - """Fields required to update shop settings.""" - input: ShopSettingsInput! - ): ShopSettingsUpdate @doc(category: "Shop") - - """ - Fetch tax rates. + Requires one of the following permissions: AUTHENTICATED_USER. - Requires one of the following permissions: MANAGE_SETTINGS. + Triggers the following webhook events: + - PAYMENT_METHOD_INITIALIZE_TOKENIZATION_SESSION (sync): The customer requested to tokenize payment method. """ - shopFetchTaxRates: ShopFetchTaxRates @doc(category: "Shop") @deprecated(reason: "\\n\\nDEPRECATED: this mutation will be removed in Saleor 4.0.") + paymentMethodInitializeTokenization( + """Slug of a channel related to tokenization request.""" + channel: String! - """ - Creates/updates translations for shop settings. - - Requires one of the following permissions: MANAGE_TRANSLATIONS. - """ - shopSettingsTranslate( - """Fields required to update shop settings translations.""" - input: ShopSettingsTranslationInput! + """The data that will be passed to the payment gateway.""" + data: JSON - """Translation language code.""" - languageCode: LanguageCodeEnum! - ): ShopSettingsTranslate @doc(category: "Shop") + """ + The identifier of the payment gateway app to initialize payment method tokenization. + """ + id: String! - """ - Update the shop's address. If the `null` value is passed, the currently selected address will be deleted. - - Requires one of the following permissions: MANAGE_SETTINGS. - """ - shopAddressUpdate( - """Fields required to update shop address.""" - input: AddressInput - ): ShopAddressUpdate @doc(category: "Shop") + """The payment flow that the tokenized payment method should support.""" + paymentFlowToSupport: TokenizedPaymentFlowEnum! + ): PaymentMethodInitializeTokenization @doc(category: "Payments") @webhookEventsInfo(asyncEvents: [], syncEvents: [PAYMENT_METHOD_INITIALIZE_TOKENIZATION_SESSION]) """ - Update shop order settings across all channels. Returns `orderSettings` for the first `channel` in alphabetical order. + Tokenize payment method. - Requires one of the following permissions: MANAGE_ORDERS. - """ - orderSettingsUpdate( - """Fields required to update shop order settings.""" - input: OrderSettingsUpdateInput! - ): OrderSettingsUpdate @doc(category: "Orders") @deprecated(reason: "\\n\\nDEPRECATED: this mutation will be removed in Saleor 4.0. Use `channelUpdate` mutation instead.") - - """ - Update gift card settings. + Added in Saleor 3.16. - Requires one of the following permissions: MANAGE_GIFT_CARD. - """ - giftCardSettingsUpdate( - """Fields required to update gift card settings.""" - input: GiftCardSettingsUpdateInput! - ): GiftCardSettingsUpdate @doc(category: "Gift cards") - - """ - Manage shipping method's availability in channels. + Note: this API is currently in Feature Preview and can be subject to changes at later point. - Requires one of the following permissions: MANAGE_SHIPPING. + Requires one of the following permissions: AUTHENTICATED_USER. + + Triggers the following webhook events: + - PAYMENT_METHOD_PROCESS_TOKENIZATION_SESSION (sync): The customer continues payment method tokenization. """ - shippingMethodChannelListingUpdate( - """ID of a shipping method to update.""" - id: ID! + paymentMethodProcessTokenization( + """Slug of a channel related to tokenization request.""" + channel: String! + + """The data that will be passed to the payment gateway.""" + data: JSON - """Fields required to update shipping method channel listings.""" - input: ShippingMethodChannelListingInput! - ): ShippingMethodChannelListingUpdate @doc(category: "Shipping") + """ + The identifier of the payment gateway app to process payment method tokenization. + """ + id: String! + ): PaymentMethodProcessTokenization @doc(category: "Payments") @webhookEventsInfo(asyncEvents: [], syncEvents: [PAYMENT_METHOD_PROCESS_TOKENIZATION_SESSION]) """ - Creates a new shipping price. + Creates a new page. - Requires one of the following permissions: MANAGE_SHIPPING. + Requires one of the following permissions: MANAGE_PAGES. """ - shippingPriceCreate( - """Fields required to create a shipping price.""" - input: ShippingPriceInput! - ): ShippingPriceCreate @doc(category: "Shipping") + pageCreate( + """Fields required to create a page.""" + input: PageCreateInput! + ): PageCreate @doc(category: "Pages") """ - Deletes a shipping price. + Deletes a page. - Requires one of the following permissions: MANAGE_SHIPPING. + Requires one of the following permissions: MANAGE_PAGES. """ - shippingPriceDelete( - """ID of a shipping price to delete.""" + pageDelete( + """ID of a page to delete.""" id: ID! - ): ShippingPriceDelete @doc(category: "Shipping") + ): PageDelete @doc(category: "Pages") """ - Deletes shipping prices. + Deletes pages. - Requires one of the following permissions: MANAGE_SHIPPING. + Requires one of the following permissions: MANAGE_PAGES. """ - shippingPriceBulkDelete( - """List of shipping price IDs to delete.""" + pageBulkDelete( + """List of page IDs to delete.""" ids: [ID!]! - ): ShippingPriceBulkDelete @doc(category: "Shipping") + ): PageBulkDelete @doc(category: "Pages") """ - Updates a new shipping price. + Publish pages. - Requires one of the following permissions: MANAGE_SHIPPING. + Requires one of the following permissions: MANAGE_PAGES. """ - shippingPriceUpdate( - """ID of a shipping price to update.""" - id: ID! + pageBulkPublish( + """List of page IDs to (un)publish.""" + ids: [ID!]! - """Fields required to update a shipping price.""" - input: ShippingPriceInput! - ): ShippingPriceUpdate @doc(category: "Shipping") + """Determine if pages will be published or not.""" + isPublished: Boolean! + ): PageBulkPublish @doc(category: "Pages") """ - Creates/updates translations for a shipping method. + Updates an existing page. - Requires one of the following permissions: MANAGE_TRANSLATIONS. + Requires one of the following permissions: MANAGE_PAGES. """ - shippingPriceTranslate( - """ShippingMethodType ID or ShippingMethodTranslatableContent ID.""" + pageUpdate( + """ID of a page to update.""" id: ID! - input: ShippingPriceTranslationInput! - """Translation language code.""" - languageCode: LanguageCodeEnum! - ): ShippingPriceTranslate @doc(category: "Shipping") + """Fields required to update a page.""" + input: PageInput! + ): PageUpdate @doc(category: "Pages") """ - Exclude products from shipping price. + Creates/updates translations for a page. - Requires one of the following permissions: MANAGE_SHIPPING. + Requires one of the following permissions: MANAGE_TRANSLATIONS. """ - shippingPriceExcludeProducts( - """ID of a shipping price.""" + pageTranslate( + """Page ID or PageTranslatableContent ID.""" id: ID! - """Exclude products input.""" - input: ShippingPriceExcludeProductsInput! - ): ShippingPriceExcludeProducts @doc(category: "Shipping") - - """ - Remove product from excluded list for shipping price. - - Requires one of the following permissions: MANAGE_SHIPPING. - """ - shippingPriceRemoveProductFromExclude( - """ID of a shipping price.""" - id: ID! + """Fields required to update page translations.""" + input: PageTranslationInput! - """List of products which will be removed from excluded list.""" - products: [ID!]! - ): ShippingPriceRemoveProductFromExclude @doc(category: "Shipping") + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): PageTranslate @doc(category: "Pages") """ - Creates a new shipping zone. + Create a new page type. - Requires one of the following permissions: MANAGE_SHIPPING. + Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. """ - shippingZoneCreate( - """Fields required to create a shipping zone.""" - input: ShippingZoneCreateInput! - ): ShippingZoneCreate @doc(category: "Shipping") + pageTypeCreate( + """Fields required to create page type.""" + input: PageTypeCreateInput! + ): PageTypeCreate @doc(category: "Pages") """ - Deletes a shipping zone. + Update page type. - Requires one of the following permissions: MANAGE_SHIPPING. + Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. """ - shippingZoneDelete( - """ID of a shipping zone to delete.""" - id: ID! - ): ShippingZoneDelete @doc(category: "Shipping") + pageTypeUpdate( + """ID of the page type to update.""" + id: ID - """ - Deletes shipping zones. - - Requires one of the following permissions: MANAGE_SHIPPING. - """ - shippingZoneBulkDelete( - """List of shipping zone IDs to delete.""" - ids: [ID!]! - ): ShippingZoneBulkDelete @doc(category: "Shipping") + """Fields required to update page type.""" + input: PageTypeUpdateInput! + ): PageTypeUpdate @doc(category: "Pages") """ - Updates a new shipping zone. + Delete a page type. - Requires one of the following permissions: MANAGE_SHIPPING. + Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. """ - shippingZoneUpdate( - """ID of a shipping zone to update.""" + pageTypeDelete( + """ID of the page type to delete.""" id: ID! - - """Fields required to update a shipping zone.""" - input: ShippingZoneUpdateInput! - ): ShippingZoneUpdate @doc(category: "Shipping") + ): PageTypeDelete @doc(category: "Pages") """ - Assign attributes to a given product type. + Delete page types. - Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. """ - productAttributeAssign( - """The operations to perform.""" - operations: [ProductAttributeAssignInput!]! - - """ID of the product type to assign the attributes into.""" - productTypeId: ID! - ): ProductAttributeAssign @doc(category: "Products") + pageTypeBulkDelete( + """List of page type IDs to delete""" + ids: [ID!]! + ): PageTypeBulkDelete @doc(category: "Pages") """ - Update attributes assigned to product variant for given product type. - - Added in Saleor 3.1. + Assign attributes to a given page type. - Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. """ - productAttributeAssignmentUpdate( - """The operations to perform.""" - operations: [ProductAttributeAssignmentUpdateInput!]! + pageAttributeAssign( + """The IDs of the attributes to assign.""" + attributeIds: [ID!]! - """ID of the product type to assign the attributes into.""" - productTypeId: ID! - ): ProductAttributeAssignmentUpdate @doc(category: "Products") + """ID of the page type to assign the attributes into.""" + pageTypeId: ID! + ): PageAttributeAssign @doc(category: "Pages") """ - Un-assign attributes from a given product type. + Unassign attributes from a given page type. - Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. """ - productAttributeUnassign( + pageAttributeUnassign( """The IDs of the attributes to unassign.""" attributeIds: [ID!]! - """ID of the product type from which the attributes should be unassigned.""" - productTypeId: ID! - ): ProductAttributeUnassign @doc(category: "Products") + """ID of the page type from which the attributes should be unassign.""" + pageTypeId: ID! + ): PageAttributeUnassign @doc(category: "Pages") """ - Creates a new category. + Reorder the attributes of a page type. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. """ - categoryCreate( - """Fields required to create a category.""" - input: CategoryInput! - - """ - ID of the parent category. If empty, category will be top level category. - """ - parent: ID - ): CategoryCreate @doc(category: "Products") + pageTypeReorderAttributes( + """The list of attribute reordering operations.""" + moves: [ReorderInput!]! - """ - Deletes a category. - - Requires one of the following permissions: MANAGE_PRODUCTS. - """ - categoryDelete( - """ID of a category to delete.""" - id: ID! - ): CategoryDelete @doc(category: "Products") + """ID of a page type.""" + pageTypeId: ID! + ): PageTypeReorderAttributes @doc(category: "Pages") """ - Deletes categories. + Reorder page attribute values. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_PAGES. """ - categoryBulkDelete( - """List of category IDs to delete.""" - ids: [ID!]! - ): CategoryBulkDelete @doc(category: "Products") + pageReorderAttributeValues( + """ID of an attribute.""" + attributeId: ID! - """ - Updates a category. - - Requires one of the following permissions: MANAGE_PRODUCTS. - """ - categoryUpdate( - """ID of a category to update.""" - id: ID! + """The list of reordering operations for given attribute values.""" + moves: [ReorderInput!]! - """Fields required to update a category.""" - input: CategoryInput! - ): CategoryUpdate @doc(category: "Products") + """ID of a page.""" + pageId: ID! + ): PageReorderAttributeValues @doc(category: "Pages") """ - Creates/updates translations for a category. + Completes creating an order. - Requires one of the following permissions: MANAGE_TRANSLATIONS. + Requires one of the following permissions: MANAGE_ORDERS. """ - categoryTranslate( - """Category ID or CategoryTranslatableContent ID.""" + draftOrderComplete( + """ID of the order that will be completed.""" id: ID! - input: TranslationInput! - - """Translation language code.""" - languageCode: LanguageCodeEnum! - ): CategoryTranslate @doc(category: "Products") + ): DraftOrderComplete @doc(category: "Orders") """ - Adds products to a collection. + Creates a new draft order. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - collectionAddProducts( - """ID of a collection.""" - collectionId: ID! - - """List of product IDs.""" - products: [ID!]! - ): CollectionAddProducts @doc(category: "Products") + draftOrderCreate( + """Fields required to create an order.""" + input: DraftOrderCreateInput! + ): DraftOrderCreate @doc(category: "Orders") """ - Creates a new collection. + Deletes a draft order. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - collectionCreate( - """Fields required to create a collection.""" - input: CollectionCreateInput! - ): CollectionCreate @doc(category: "Products") + draftOrderDelete( + """ + External ID of a product to delete. + + Added in Saleor 3.10. + """ + externalReference: String + + """ID of a product to delete.""" + id: ID + ): DraftOrderDelete @doc(category: "Orders") """ - Deletes a collection. + Deletes draft orders. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - collectionDelete( - """ID of a collection to delete.""" - id: ID! - ): CollectionDelete @doc(category: "Products") + draftOrderBulkDelete( + """List of draft order IDs to delete.""" + ids: [ID!]! + ): DraftOrderBulkDelete @doc(category: "Orders") """ - Reorder the products of a collection. + Deletes order lines. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - collectionReorderProducts( - """ID of a collection.""" - collectionId: ID! - - """The collection products position operations.""" - moves: [MoveProductInput!]! - ): CollectionReorderProducts @doc(category: "Products") + draftOrderLinesBulkDelete( + """List of order lines IDs to delete.""" + ids: [ID!]! + ): DraftOrderLinesBulkDelete @doc(category: "Orders") @deprecated(reason: "This field will be removed in Saleor 4.0.") """ - Deletes collections. + Updates a draft order. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - collectionBulkDelete( - """List of collection IDs to delete.""" - ids: [ID!]! - ): CollectionBulkDelete @doc(category: "Products") + draftOrderUpdate( + """ + External ID of a draft order to update. + + Added in Saleor 3.10. + """ + externalReference: String + + """ID of a draft order to update.""" + id: ID + + """Fields required to update an order.""" + input: DraftOrderInput! + ): DraftOrderUpdate @doc(category: "Orders") """ - Remove products from a collection. + Adds note to the order. - Requires one of the following permissions: MANAGE_PRODUCTS. + DEPRECATED: this mutation will be removed in Saleor 4.0. + + Requires one of the following permissions: MANAGE_ORDERS. """ - collectionRemoveProducts( - """ID of a collection.""" - collectionId: ID! + orderAddNote( + """ID of the order to add a note for.""" + order: ID! - """List of product IDs.""" - products: [ID!]! - ): CollectionRemoveProducts @doc(category: "Products") + """Fields required to create a note for the order.""" + input: OrderAddNoteInput! + ): OrderAddNote @doc(category: "Orders") @deprecated(reason: "This field will be removed in Saleor 4.0. Use `orderNoteAdd` instead.") """ - Updates a collection. + Cancel an order. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - collectionUpdate( - """ID of a collection to update.""" + orderCancel( + """ID of the order to cancel.""" id: ID! - - """Fields required to update a collection.""" - input: CollectionInput! - ): CollectionUpdate @doc(category: "Products") + ): OrderCancel @doc(category: "Orders") """ - Creates/updates translations for a collection. + Capture an order. - Requires one of the following permissions: MANAGE_TRANSLATIONS. + Requires one of the following permissions: MANAGE_ORDERS. """ - collectionTranslate( - """Collection ID or CollectionTranslatableContent ID.""" - id: ID! - input: TranslationInput! + orderCapture( + """Amount of money to capture.""" + amount: PositiveDecimal! - """Translation language code.""" - languageCode: LanguageCodeEnum! - ): CollectionTranslate @doc(category: "Products") + """ID of the order to capture.""" + id: ID! + ): OrderCapture @doc(category: "Orders") """ - Manage collection's availability in channels. + Confirms an unconfirmed order by changing status to unfulfilled. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - collectionChannelListingUpdate( - """ID of a collection to update.""" + orderConfirm( + """ID of an order to confirm.""" id: ID! - - """Fields required to create or update collection channel listings.""" - input: CollectionChannelListingUpdateInput! - ): CollectionChannelListingUpdate @doc(category: "Products") + ): OrderConfirm @doc(category: "Orders") """ - Creates a new product. + Creates new fulfillments for an order. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. + + Triggers the following webhook events: + - FULFILLMENT_CREATED (async): A new fulfillment is created. + - ORDER_FULFILLED (async): Order is fulfilled. + - FULFILLMENT_TRACKING_NUMBER_UPDATED (async): Sent when fulfillment tracking number is updated. + - FULFILLMENT_APPROVED (async): A fulfillment is approved. """ - productCreate( - """Fields required to create a product.""" - input: ProductCreateInput! - ): ProductCreate @doc(category: "Products") + orderFulfill( + """Fields required to create a fulfillment.""" + input: OrderFulfillInput! + + """ID of the order to be fulfilled.""" + order: ID + ): OrderFulfill @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [FULFILLMENT_CREATED, ORDER_FULFILLED, FULFILLMENT_TRACKING_NUMBER_UPDATED, FULFILLMENT_APPROVED], syncEvents: []) """ - Deletes a product. + Cancels existing fulfillment and optionally restocks items. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - productDelete( - """ - External ID of a product to delete. - - Added in Saleor 3.10. - """ - externalReference: String + orderFulfillmentCancel( + """ID of a fulfillment to cancel.""" + id: ID! - """ID of a product to delete.""" - id: ID - ): ProductDelete @doc(category: "Products") + """Fields required to cancel a fulfillment.""" + input: FulfillmentCancelInput + ): FulfillmentCancel @doc(category: "Orders") """ - Creates products. + Approve existing fulfillment. - Added in Saleor 3.13. + Added in Saleor 3.1. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Requires one of the following permissions: MANAGE_ORDERS. - Requires one of the following permissions: MANAGE_PRODUCTS. + Triggers the following webhook events: + - FULFILLMENT_APPROVED (async): Fulfillment is approved. """ - productBulkCreate( - """Policies of error handling.""" - errorPolicy: ErrorPolicyEnum = reject_everything + orderFulfillmentApprove( + """True if stock could be exceeded.""" + allowStockToBeExceeded: Boolean = false - """Input list of products to create.""" - products: [ProductBulkCreateInput!]! - ): ProductBulkCreate @doc(category: "Products") + """ID of a fulfillment to approve.""" + id: ID! + + """True if confirmation email should be send.""" + notifyCustomer: Boolean! + ): FulfillmentApprove @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [FULFILLMENT_APPROVED], syncEvents: []) """ - Deletes products. + Updates a fulfillment for an order. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. + + Triggers the following webhook events: + - FULFILLMENT_TRACKING_NUMBER_UPDATED (async): Fulfillment tracking number is updated. """ - productBulkDelete( - """List of product IDs to delete.""" - ids: [ID!]! - ): ProductBulkDelete @doc(category: "Products") + orderFulfillmentUpdateTracking( + """ID of a fulfillment to update.""" + id: ID! + + """Fields required to update a fulfillment.""" + input: FulfillmentUpdateTrackingInput! + ): FulfillmentUpdateTracking @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [FULFILLMENT_TRACKING_NUMBER_UPDATED], syncEvents: []) """ - Updates an existing product. + Refund products. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - productUpdate( - """ - External ID of a product to update. - - Added in Saleor 3.10. - """ - externalReference: String - - """ID of a product to update.""" - id: ID + orderFulfillmentRefundProducts( + """Fields required to create an refund fulfillment.""" + input: OrderRefundProductsInput! - """Fields required to update a product.""" - input: ProductInput! - ): ProductUpdate @doc(category: "Products") + """ID of the order to be refunded.""" + order: ID! + ): FulfillmentRefundProducts @doc(category: "Orders") """ - Creates/updates translations for a product. + Return products. - Requires one of the following permissions: MANAGE_TRANSLATIONS. + Requires one of the following permissions: MANAGE_ORDERS. """ - productTranslate( - """Product ID or ProductTranslatableContent ID.""" - id: ID! - input: TranslationInput! + orderFulfillmentReturnProducts( + """Fields required to return products.""" + input: OrderReturnProductsInput! - """Translation language code.""" - languageCode: LanguageCodeEnum! - ): ProductTranslate @doc(category: "Products") + """ID of the order to be returned.""" + order: ID! + ): FulfillmentReturnProducts @doc(category: "Orders") """ - Manage product's availability in channels. + Adds granted refund to the order. + + Added in Saleor 3.13. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - productChannelListingUpdate( - """ID of a product to update.""" + orderGrantRefundCreate( + """ID of the order.""" id: ID! - """Fields required to create or update product channel listings.""" - input: ProductChannelListingUpdateInput! - ): ProductChannelListingUpdate @doc(category: "Products") + """Fields required to create a granted refund for the order.""" + input: OrderGrantRefundCreateInput! + ): OrderGrantRefundCreate @doc(category: "Orders") """ - Create a media object (image or video URL) associated with product. For image, this mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec + Updates granted refund. - Requires one of the following permissions: MANAGE_PRODUCTS. + Added in Saleor 3.13. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_ORDERS. """ - productMediaCreate( - """Fields required to create a product media.""" - input: ProductMediaCreateInput! - ): ProductMediaCreate @doc(category: "Products") + orderGrantRefundUpdate( + """ID of the granted refund.""" + id: ID! + + """Fields required to update a granted refund.""" + input: OrderGrantRefundUpdateInput! + ): OrderGrantRefundUpdate @doc(category: "Orders") """ - Reorder the variants of a product. Mutation updates updated_at on product and triggers PRODUCT_UPDATED webhook. + Create order lines for an order. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - productVariantReorder( - """The list of variant reordering operations.""" - moves: [ReorderInput!]! + orderLinesCreate( + """ID of the order to add the lines to.""" + id: ID! - """Id of product that variants order will be altered.""" - productId: ID! - ): ProductVariantReorder @doc(category: "Products") + """Fields required to add order lines.""" + input: [OrderLineCreateInput!]! + ): OrderLinesCreate @doc(category: "Orders") """ - Deletes a product media. + Deletes an order line from an order. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - productMediaDelete( - """ID of a product media to delete.""" + orderLineDelete( + """ID of the order line to delete.""" id: ID! - ): ProductMediaDelete @doc(category: "Products") + ): OrderLineDelete @doc(category: "Orders") """ - Deletes product media. + Updates an order line of an order. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - productMediaBulkDelete( - """List of product media IDs to delete.""" - ids: [ID!]! - ): ProductMediaBulkDelete @doc(category: "Products") + orderLineUpdate( + """ID of the order line to update.""" + id: ID! + + """Fields required to update an order line.""" + input: OrderLineInput! + ): OrderLineUpdate @doc(category: "Orders") """ - Changes ordering of the product media. + Adds discount to the order. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - productMediaReorder( - """IDs of a product media in the desired order.""" - mediaIds: [ID!]! + orderDiscountAdd( + """Fields required to create a discount for the order.""" + input: OrderDiscountCommonInput! - """ID of product that media order will be altered.""" - productId: ID! - ): ProductMediaReorder @doc(category: "Products") + """ID of an order to discount.""" + orderId: ID! + ): OrderDiscountAdd @doc(category: "Orders") """ - Updates a product media. + Update discount for the order. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - productMediaUpdate( - """ID of a product media to update.""" - id: ID! + orderDiscountUpdate( + """ID of a discount to update.""" + discountId: ID! - """Fields required to update a product media.""" - input: ProductMediaUpdateInput! - ): ProductMediaUpdate @doc(category: "Products") + """Fields required to update a discount for the order.""" + input: OrderDiscountCommonInput! + ): OrderDiscountUpdate @doc(category: "Orders") """ - Creates a new product type. + Remove discount from the order. - Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + Requires one of the following permissions: MANAGE_ORDERS. """ - productTypeCreate( - """Fields required to create a product type.""" - input: ProductTypeInput! - ): ProductTypeCreate @doc(category: "Products") + orderDiscountDelete( + """ID of a discount to remove.""" + discountId: ID! + ): OrderDiscountDelete @doc(category: "Orders") """ - Deletes a product type. + Update discount for the order line. - Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + Requires one of the following permissions: MANAGE_ORDERS. """ - productTypeDelete( - """ID of a product type to delete.""" - id: ID! - ): ProductTypeDelete @doc(category: "Products") + orderLineDiscountUpdate( + """Fields required to update price for the order line.""" + input: OrderDiscountCommonInput! + + """ID of a order line to update price""" + orderLineId: ID! + ): OrderLineDiscountUpdate @doc(category: "Orders") """ - Deletes product types. + Remove discount applied to the order line. - Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + Requires one of the following permissions: MANAGE_ORDERS. """ - productTypeBulkDelete( - """List of product type IDs to delete.""" - ids: [ID!]! - ): ProductTypeBulkDelete @doc(category: "Products") + orderLineDiscountRemove( + """ID of a order line to remove its discount""" + orderLineId: ID! + ): OrderLineDiscountRemove @doc(category: "Orders") """ - Updates an existing product type. + Adds note to the order. - Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_ORDERS. """ - productTypeUpdate( - """ID of a product type to update.""" - id: ID! + orderNoteAdd( + """ID of the order to add a note for.""" + order: ID! - """Fields required to update a product type.""" - input: ProductTypeInput! - ): ProductTypeUpdate @doc(category: "Products") + """Fields required to create a note for the order.""" + input: OrderNoteInput! + ): OrderNoteAdd @doc(category: "Orders") """ - Reorder the attributes of a product type. + Updates note of an order. - Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_ORDERS. """ - productTypeReorderAttributes( - """The list of attribute reordering operations.""" - moves: [ReorderInput!]! + orderNoteUpdate( + """ID of the note.""" + note: ID! - """ID of a product type.""" - productTypeId: ID! - - """The attribute type to reorder.""" - type: ProductAttributeType! - ): ProductTypeReorderAttributes @doc(category: "Products") + """Fields required to create a note for the order.""" + input: OrderNoteInput! + ): OrderNoteUpdate @doc(category: "Orders") """ - Reorder product attribute values. + Mark order as manually paid. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - productReorderAttributeValues( - """ID of an attribute.""" - attributeId: ID! - - """The list of reordering operations for given attribute values.""" - moves: [ReorderInput!]! + orderMarkAsPaid( + """ID of the order to mark paid.""" + id: ID! - """ID of a product.""" - productId: ID! - ): ProductReorderAttributeValues @doc(category: "Products") + """The external transaction reference.""" + transactionReference: String + ): OrderMarkAsPaid @doc(category: "Orders") """ - Create new digital content. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec + Refund an order. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - digitalContentCreate( - """Fields required to create a digital content.""" - input: DigitalContentUploadInput! + orderRefund( + """Amount of money to refund.""" + amount: PositiveDecimal! - """ID of a product variant to upload digital content.""" - variantId: ID! - ): DigitalContentCreate @doc(category: "Products") + """ID of the order to refund.""" + id: ID! + ): OrderRefund @doc(category: "Orders") """ - Remove digital content assigned to given variant. + Updates an order. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - digitalContentDelete( - """ID of a product variant with digital content to remove.""" - variantId: ID! - ): DigitalContentDelete @doc(category: "Products") + orderUpdate( + """ + External ID of an order to update. + + Added in Saleor 3.10. + """ + externalReference: String + + """ID of an order to update.""" + id: ID + + """Fields required to update an order.""" + input: OrderUpdateInput! + ): OrderUpdate @doc(category: "Orders") """ - Update digital content. + Updates a shipping method of the order. Requires shipping method ID to update, when null is passed then currently assigned shipping method is removed. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - digitalContentUpdate( - """Fields required to update a digital content.""" - input: DigitalContentInput! + orderUpdateShipping( + """ID of the order to update a shipping method.""" + order: ID! - """ID of a product variant with digital content to update.""" - variantId: ID! - ): DigitalContentUpdate @doc(category: "Products") + """Fields required to change shipping method of the order.""" + input: OrderUpdateShippingInput! + ): OrderUpdateShipping @doc(category: "Orders") """ - Generate new URL to digital content. + Void an order. - Requires one of the following permissions: MANAGE_PRODUCTS. - """ - digitalContentUrlCreate( - """Fields required to create a new url.""" - input: DigitalContentUrlCreateInput! - ): DigitalContentUrlCreate @doc(category: "Products") + Requires one of the following permissions: MANAGE_ORDERS. + """ + orderVoid( + """ID of the order to void.""" + id: ID! + ): OrderVoid @doc(category: "Orders") """ - Creates a new variant for a product. + Cancels orders. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. """ - productVariantCreate( - """Fields required to create a product variant.""" - input: ProductVariantCreateInput! - ): ProductVariantCreate @doc(category: "Products") + orderBulkCancel( + """List of orders IDs to cancel.""" + ids: [ID!]! + ): OrderBulkCancel @doc(category: "Orders") """ - Deletes a product variant. + Creates multiple orders. - Requires one of the following permissions: MANAGE_PRODUCTS. + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_ORDERS_IMPORT. """ - productVariantDelete( - """ - External ID of a product variant to update. - - Added in Saleor 3.10. - """ - externalReference: String + orderBulkCreate( + """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" + errorPolicy: ErrorPolicyEnum - """ID of a product variant to delete.""" - id: ID + """Input list of orders to create. Orders limit: 50.""" + orders: [OrderBulkCreateInput!]! """ - SKU of a product variant to delete. - - Added in Saleor 3.8. + Determine how stock should be updated, while processing the order. DEFAULT: UPDATE - Only do update, if there is enough stocks. """ - sku: String - ): ProductVariantDelete @doc(category: "Products") + stockUpdatePolicy: StockUpdatePolicyEnum + ): OrderBulkCreate @doc(category: "Orders") """ - Creates product variants for a given product. - - Requires one of the following permissions: MANAGE_PRODUCTS. + Delete metadata of an object. To use it, you need to have access to the modified object. """ - productVariantBulkCreate( - """ - Policies of error handling. DEFAULT: REJECT_EVERYTHING - - Added in Saleor 3.11. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. - """ - errorPolicy: ErrorPolicyEnum = reject_everything - - """ID of the product to create the variants for.""" - product: ID! + deleteMetadata( + """ID or token (for Order and Checkout) of an object to update.""" + id: ID! - """Input list of product variants to create.""" - variants: [ProductVariantBulkCreateInput!]! - ): ProductVariantBulkCreate @doc(category: "Products") + """Metadata keys to delete.""" + keys: [String!]! + ): DeleteMetadata """ - Update multiple product variants. - - Added in Saleor 3.11. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. - - Requires one of the following permissions: MANAGE_PRODUCTS. + Delete object's private metadata. To use it, you need to be an authenticated staff user or an app and have access to the modified object. """ - productVariantBulkUpdate( - """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" - errorPolicy: ErrorPolicyEnum = reject_everything - - """ID of the product to update the variants for.""" - product: ID! + deletePrivateMetadata( + """ID or token (for Order and Checkout) of an object to update.""" + id: ID! - """Input list of product variants to update.""" - variants: [ProductVariantBulkUpdateInput!]! - ): ProductVariantBulkUpdate @doc(category: "Products") + """Metadata keys to delete.""" + keys: [String!]! + ): DeletePrivateMetadata """ - Deletes product variants. - - Requires one of the following permissions: MANAGE_PRODUCTS. + Updates metadata of an object. To use it, you need to have access to the modified object. """ - productVariantBulkDelete( - """List of product variant IDs to delete.""" - ids: [ID!] + updateMetadata( + """ID or token (for Order and Checkout) of an object to update.""" + id: ID! - """ - List of product variant SKUs to delete. - - Added in Saleor 3.8. - """ - skus: [String!] - ): ProductVariantBulkDelete @doc(category: "Products") + """Fields required to update the object's metadata.""" + input: [MetadataInput!]! + ): UpdateMetadata """ - Creates stocks for product variant. - - Requires one of the following permissions: MANAGE_PRODUCTS. + Updates private metadata of an object. To use it, you need to be an authenticated staff user or an app and have access to the modified object. """ - productVariantStocksCreate( - """Input list of stocks to create.""" - stocks: [StockInput!]! + updatePrivateMetadata( + """ID or token (for Order and Checkout) of an object to update.""" + id: ID! - """ID of a product variant for which stocks will be created.""" - variantId: ID! - ): ProductVariantStocksCreate @doc(category: "Products") + """Fields required to update the object's metadata.""" + input: [MetadataInput!]! + ): UpdatePrivateMetadata """ - Delete stocks from product variant. + Assigns storefront's navigation menus. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_MENUS, MANAGE_SETTINGS. """ - productVariantStocksDelete( - """SKU of product variant for which stocks will be deleted.""" - sku: String - - """ID of product variant for which stocks will be deleted.""" - variantId: ID + assignNavigation( + """ID of the menu.""" + menu: ID - """Input list of warehouse IDs.""" - warehouseIds: [ID!] - ): ProductVariantStocksDelete @doc(category: "Products") + """Type of the navigation bar to assign the menu to.""" + navigationType: NavigationType! + ): AssignNavigation @doc(category: "Menu") """ - Update stocks for product variant. + Creates a new Menu. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_MENUS. + + Triggers the following webhook events: + - MENU_CREATED (async): A menu was created. """ - productVariantStocksUpdate( - """SKU of product variant for which stocks will be updated.""" - sku: String - - """Input list of stocks to create or update.""" - stocks: [StockInput!]! + menuCreate( + """Fields required to create a menu.""" + input: MenuCreateInput! + ): MenuCreate @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_CREATED], syncEvents: []) - """ID of a product variant for which stocks will be updated.""" - variantId: ID - ): ProductVariantStocksUpdate @doc(category: "Products") + """ + Deletes a menu. + + Requires one of the following permissions: MANAGE_MENUS. + + Triggers the following webhook events: + - MENU_DELETED (async): A menu was deleted. + """ + menuDelete( + """ID of a menu to delete.""" + id: ID! + ): MenuDelete @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_DELETED], syncEvents: []) """ - Updates an existing variant for product. + Deletes menus. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_MENUS. + + Triggers the following webhook events: + - MENU_DELETED (async): A menu was deleted. """ - productVariantUpdate( - """ - External ID of a product variant to update. - - Added in Saleor 3.10. - """ - externalReference: String + menuBulkDelete( + """List of menu IDs to delete.""" + ids: [ID!]! + ): MenuBulkDelete @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_DELETED], syncEvents: []) - """ID of a product to update.""" - id: ID + """ + Updates a menu. + + Requires one of the following permissions: MANAGE_MENUS. + + Triggers the following webhook events: + - MENU_UPDATED (async): A menu was updated. + """ + menuUpdate( + """ID of a menu to update.""" + id: ID! - """Fields required to update a product variant.""" - input: ProductVariantInput! + """Fields required to update a menu.""" + input: MenuInput! + ): MenuUpdate @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_UPDATED], syncEvents: []) + """ + Creates a new menu item. + + Requires one of the following permissions: MANAGE_MENUS. + + Triggers the following webhook events: + - MENU_ITEM_CREATED (async): A menu item was created. + """ + menuItemCreate( """ - SKU of a product variant to update. - - Added in Saleor 3.8. + Fields required to update a menu item. Only one of `url`, `category`, `page`, `collection` is allowed per item. """ - sku: String - ): ProductVariantUpdate @doc(category: "Products") + input: MenuItemCreateInput! + ): MenuItemCreate @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_ITEM_CREATED], syncEvents: []) """ - Set default variant for a product. Mutation triggers PRODUCT_UPDATED webhook. + Deletes a menu item. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_MENUS. + + Triggers the following webhook events: + - MENU_ITEM_DELETED (async): A menu item was deleted. """ - productVariantSetDefault( - """Id of a product that will have the default variant set.""" - productId: ID! - - """Id of a variant that will be set as default.""" - variantId: ID! - ): ProductVariantSetDefault @doc(category: "Products") + menuItemDelete( + """ID of a menu item to delete.""" + id: ID! + ): MenuItemDelete @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_ITEM_DELETED], syncEvents: []) """ - Creates/updates translations for a product variant. + Deletes menu items. - Requires one of the following permissions: MANAGE_TRANSLATIONS. + Requires one of the following permissions: MANAGE_MENUS. + + Triggers the following webhook events: + - MENU_ITEM_DELETED (async): A menu item was deleted. """ - productVariantTranslate( - """ProductVariant ID or ProductVariantTranslatableContent ID.""" - id: ID! - input: NameTranslationInput! - - """Translation language code.""" - languageCode: LanguageCodeEnum! - ): ProductVariantTranslate @doc(category: "Products") + menuItemBulkDelete( + """List of menu item IDs to delete.""" + ids: [ID!]! + ): MenuItemBulkDelete @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_ITEM_DELETED], syncEvents: []) """ - Manage product variant prices in channels. + Updates a menu item. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_MENUS. + + Triggers the following webhook events: + - MENU_ITEM_UPDATED (async): A menu item was updated. """ - productVariantChannelListingUpdate( - """ID of a product variant to update.""" - id: ID - - """ - List of fields required to create or upgrade product variant channel listings. - """ - input: [ProductVariantChannelListingAddInput!]! + menuItemUpdate( + """ID of a menu item to update.""" + id: ID! """ - SKU of a product variant to update. - - Added in Saleor 3.8. + Fields required to update a menu item. Only one of `url`, `category`, `page`, `collection` is allowed per item. """ - sku: String - ): ProductVariantChannelListingUpdate @doc(category: "Products") + input: MenuItemInput! + ): MenuItemUpdate @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_ITEM_UPDATED], syncEvents: []) """ - Reorder product variant attribute values. + Creates/updates translations for a menu item. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_TRANSLATIONS. """ - productVariantReorderAttributeValues( - """ID of an attribute.""" - attributeId: ID! + menuItemTranslate( + """MenuItem ID or MenuItemTranslatableContent ID.""" + id: ID! - """The list of reordering operations for given attribute values.""" - moves: [ReorderInput!]! + """Fields required to update menu item translations.""" + input: NameTranslationInput! - """ID of a product variant.""" - variantId: ID! - ): ProductVariantReorderAttributeValues @doc(category: "Products") + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): MenuItemTranslate @doc(category: "Menu") """ - Deactivates product variant preorder. It changes all preorder allocation into regular allocation. + Moves items of menus. - Added in Saleor 3.1. + Requires one of the following permissions: MANAGE_MENUS. - Requires one of the following permissions: MANAGE_PRODUCTS. + Triggers the following webhook events: + - MENU_ITEM_UPDATED (async): Optionally triggered when sort order or parent changed for menu item. """ - productVariantPreorderDeactivate( - """ID of a variant which preorder should be deactivated.""" - id: ID! - ): ProductVariantPreorderDeactivate @doc(category: "Products") + menuItemMove( + """ID of the menu.""" + menu: ID! + + """The menu position data.""" + moves: [MenuItemMoveInput!]! + ): MenuItemMove @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_ITEM_UPDATED], syncEvents: []) """ - Assign an media to a product variant. + Request an invoice for the order using plugin. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. + + Triggers the following webhook events: + - INVOICE_REQUESTED (async): An invoice was requested. """ - variantMediaAssign( - """ID of a product media to assign to a variant.""" - mediaId: ID! + invoiceRequest( + """Invoice number, if not provided it will be generated.""" + number: String - """ID of a product variant.""" - variantId: ID! - ): VariantMediaAssign @doc(category: "Products") + """ID of the order related to invoice.""" + orderId: ID! + ): InvoiceRequest @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [INVOICE_REQUESTED], syncEvents: []) """ - Unassign an media from a product variant. + Requests deletion of an invoice. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_ORDERS. + + Triggers the following webhook events: + - INVOICE_DELETED (async): An invoice was requested to delete. """ - variantMediaUnassign( - """ID of a product media to unassign from a variant.""" - mediaId: ID! - - """ID of a product variant.""" - variantId: ID! - ): VariantMediaUnassign @doc(category: "Products") + invoiceRequestDelete( + """ID of an invoice to request the deletion.""" + id: ID! + ): InvoiceRequestDelete @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [INVOICE_DELETED], syncEvents: []) """ - Captures the authorized payment amount. + Creates a ready to send invoice. Requires one of the following permissions: MANAGE_ORDERS. """ - paymentCapture( - """Transaction amount.""" - amount: PositiveDecimal + invoiceCreate( + """Fields required when creating an invoice.""" + input: InvoiceCreateInput! - """Payment ID.""" - paymentId: ID! - ): PaymentCapture @doc(category: "Payments") + """ID of the order related to invoice.""" + orderId: ID! + ): InvoiceCreate @doc(category: "Orders") """ - Refunds the captured payment amount. + Deletes an invoice. Requires one of the following permissions: MANAGE_ORDERS. """ - paymentRefund( - """Transaction amount.""" - amount: PositiveDecimal - - """Payment ID.""" - paymentId: ID! - ): PaymentRefund @doc(category: "Payments") + invoiceDelete( + """ID of an invoice to delete.""" + id: ID! + ): InvoiceDelete @doc(category: "Orders") """ - Voids the authorized payment. + Updates an invoice. Requires one of the following permissions: MANAGE_ORDERS. """ - paymentVoid( - """Payment ID.""" - paymentId: ID! - ): PaymentVoid @doc(category: "Payments") - - """Initializes payment process when it is required by gateway.""" - paymentInitialize( - """Slug of a channel for which the data should be returned.""" - channel: String - - """A gateway name used to initialize the payment.""" - gateway: String! - - """Client-side generated data required to initialize the payment.""" - paymentData: JSONString - ): PaymentInitialize @doc(category: "Payments") + invoiceUpdate( + """ID of an invoice to update.""" + id: ID! - """Check payment balance.""" - paymentCheckBalance( - """Fields required to check payment balance.""" - input: PaymentCheckBalanceInput! - ): PaymentCheckBalance @doc(category: "Payments") + """Fields to use when updating an invoice.""" + input: UpdateInvoiceInput! + ): InvoiceUpdate @doc(category: "Orders") """ - Create transaction for checkout or order. - - Added in Saleor 3.4. + Send an invoice notification to the customer. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Requires one of the following permissions: MANAGE_ORDERS. - Requires one of the following permissions: HANDLE_PAYMENTS. + Triggers the following webhook events: + - INVOICE_SENT (async): A notification for invoice send + - NOTIFY_USER (async): A notification for invoice send """ - transactionCreate( - """The ID of the checkout or order.""" + invoiceSendNotification( + """ID of an invoice to be sent.""" id: ID! - - """Input data required to create a new transaction object.""" - transaction: TransactionCreateInput! - - """Data that defines a transaction event.""" - transactionEvent: TransactionEventInput - ): TransactionCreate @doc(category: "Payments") + ): InvoiceSendNotification @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [INVOICE_SENT, NOTIFY_USER], syncEvents: []) """ - Update transaction. - - Added in Saleor 3.4. + Activate a gift card. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Requires one of the following permissions: MANAGE_GIFT_CARD. - Requires the following permissions: OWNER and HANDLE_PAYMENTS for apps, HANDLE_PAYMENTS for staff users. Staff user cannot update a transaction that is owned by the app. + Triggers the following webhook events: + - GIFT_CARD_STATUS_CHANGED (async): A gift card was activated. """ - transactionUpdate( - """The ID of the transaction.""" + giftCardActivate( + """ID of a gift card to activate.""" id: ID! - - """Input data required to create a new transaction object.""" - transaction: TransactionUpdateInput - - """Data that defines a transaction transaction.""" - transactionEvent: TransactionEventInput - ): TransactionUpdate @doc(category: "Payments") + ): GiftCardActivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: []) """ - Request an action for payment transaction. - - Added in Saleor 3.4. + Creates a new gift card. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Requires one of the following permissions: MANAGE_GIFT_CARD. - Requires one of the following permissions: HANDLE_PAYMENTS. + Triggers the following webhook events: + - GIFT_CARD_CREATED (async): A gift card was created. + - NOTIFY_USER (async): A notification for created gift card. """ - transactionRequestAction( - """Determines the action type.""" - actionType: TransactionActionEnum! - - """ - Transaction request amount. If empty for refund or capture, maximal possible amount will be used. - """ - amount: PositiveDecimal - - """The ID of the transaction.""" - id: ID! - ): TransactionRequestAction @doc(category: "Payments") + giftCardCreate( + """Fields required to create a gift card.""" + input: GiftCardCreateInput! + ): GiftCardCreate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_CREATED, NOTIFY_USER], syncEvents: []) """ - Report the event for the transaction. + Delete gift card. - Added in Saleor 3.13. + Added in Saleor 3.1. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Requires one of the following permissions: MANAGE_GIFT_CARD. - Requires the following permissions: OWNER and HANDLE_PAYMENTS for apps, HANDLE_PAYMENTS for staff users. Staff user cannot update a transaction that is owned by the app. + Triggers the following webhook events: + - GIFT_CARD_DELETED (async): A gift card was deleted. """ - transactionEventReport( - """The amount of the event to report.""" - amount: PositiveDecimal! - - """List of all possible actions for the transaction""" - availableActions: [TransactionActionEnum!] - - """ - The url that will allow to redirect user to payment provider page with event details. - """ - externalUrl: String - - """The ID of the transaction.""" + giftCardDelete( + """ID of the gift card to delete.""" id: ID! - - """The message related to the event.""" - message: String - - """PSP Reference of the event to report.""" - pspReference: String! - - """ - The time of the event to report. If not provide, the current time will be used. - """ - time: DateTime - - """Current status of the event to report.""" - type: TransactionEventTypeEnum! - ): TransactionEventReport @doc(category: "Payments") + ): GiftCardDelete @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_DELETED], syncEvents: []) """ - Initializes a payment gateway session. It triggers the webhook `PAYMENT_GATEWAY_INITIALIZE_SESSION`, to the requested `paymentGateways`. If `paymentGateways` is not provided, the webhook will be send to all subscribed payment gateways. + Deactivate a gift card. - Added in Saleor 3.13. + Requires one of the following permissions: MANAGE_GIFT_CARD. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Triggers the following webhook events: + - GIFT_CARD_STATUS_CHANGED (async): A gift card was deactivated. """ - paymentGatewayInitialize( - """ - The amount requested for initializing the payment gateway. If not provided, the difference between checkout.total - transactions that are already processed will be send. - """ - amount: PositiveDecimal - - """The ID of the checkout or order.""" + giftCardDeactivate( + """ID of a gift card to deactivate.""" id: ID! - - """List of payment gateways to initialize.""" - paymentGateways: [PaymentGatewayToInitialize!] - ): PaymentGatewayInitialize @doc(category: "Payments") + ): GiftCardDeactivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: []) """ - Initializes a transaction session. It triggers the webhook `TRANSACTION_INITIALIZE_SESSION`, to the requested `paymentGateways`. - - Added in Saleor 3.13. + Update a gift card. - Note: this API is currently in Feature Preview and can be subject to changes at later point. - """ - transactionInitialize( - """ - The expected action called for the transaction. By default, the `channel.defaultTransactionFlowStrategy` will be used. The field can be used only by app that has `HANDLE_PAYMENTS` permission. - """ - action: TransactionFlowStrategyEnum - - """ - The amount requested for initializing the payment gateway. If not provided, the difference between checkout.total - transactions that are already processed will be send. - """ - amount: PositiveDecimal - - """The ID of the checkout or order.""" + Requires one of the following permissions: MANAGE_GIFT_CARD. + + Triggers the following webhook events: + - GIFT_CARD_UPDATED (async): A gift card was updated. + """ + giftCardUpdate( + """ID of a gift card to update.""" id: ID! - """Payment gateway used to initialize the transaction.""" - paymentGateway: PaymentGatewayToInitialize! - ): TransactionInitialize @doc(category: "Payments") + """Fields required to update a gift card.""" + input: GiftCardUpdateInput! + ): GiftCardUpdate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_UPDATED], syncEvents: []) """ - Processes a transaction session. It triggers the webhook `TRANSACTION_PROCESS_SESSION`, to the assigned `paymentGateways`. + Resend a gift card. - Added in Saleor 3.13. + Added in Saleor 3.1. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Requires one of the following permissions: MANAGE_GIFT_CARD. + + Triggers the following webhook events: + - NOTIFY_USER (async): A notification for gift card resend. """ - transactionProcess( - """The data that will be passed to the payment gateway.""" - data: JSON + giftCardResend( + """Fields required to resend a gift card.""" + input: GiftCardResendInput! + ): GiftCardResend @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: []) - """The ID of the transaction to process.""" + """ + Adds note to the gift card. + + Added in Saleor 3.1. + + Requires one of the following permissions: MANAGE_GIFT_CARD. + + Triggers the following webhook events: + - GIFT_CARD_UPDATED (async): A gift card was updated. + """ + giftCardAddNote( + """ID of the gift card to add a note for.""" id: ID! - ): TransactionProcess @doc(category: "Payments") + + """Fields required to create a note for the gift card.""" + input: GiftCardAddNoteInput! + ): GiftCardAddNote @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_UPDATED], syncEvents: []) """ - Creates a new page. + Create gift cards. - Requires one of the following permissions: MANAGE_PAGES. + Added in Saleor 3.1. + + Requires one of the following permissions: MANAGE_GIFT_CARD. + + Triggers the following webhook events: + - GIFT_CARD_CREATED (async): A gift card was created. + - NOTIFY_USER (async): A notification for created gift card. """ - pageCreate( - """Fields required to create a page.""" - input: PageCreateInput! - ): PageCreate @doc(category: "Pages") + giftCardBulkCreate( + """Fields required to create gift cards.""" + input: GiftCardBulkCreateInput! + ): GiftCardBulkCreate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_CREATED, NOTIFY_USER], syncEvents: []) """ - Deletes a page. + Delete gift cards. - Requires one of the following permissions: MANAGE_PAGES. + Added in Saleor 3.1. + + Requires one of the following permissions: MANAGE_GIFT_CARD. + + Triggers the following webhook events: + - GIFT_CARD_DELETED (async): A gift card was deleted. """ - pageDelete( - """ID of a page to delete.""" - id: ID! - ): PageDelete @doc(category: "Pages") + giftCardBulkDelete( + """List of gift card IDs to delete.""" + ids: [ID!]! + ): GiftCardBulkDelete @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_DELETED], syncEvents: []) """ - Deletes pages. + Activate gift cards. - Requires one of the following permissions: MANAGE_PAGES. + Added in Saleor 3.1. + + Requires one of the following permissions: MANAGE_GIFT_CARD. + + Triggers the following webhook events: + - GIFT_CARD_STATUS_CHANGED (async): A gift card was activated. """ - pageBulkDelete( - """List of page IDs to delete.""" + giftCardBulkActivate( + """List of gift card IDs to activate.""" ids: [ID!]! - ): PageBulkDelete @doc(category: "Pages") + ): GiftCardBulkActivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: []) """ - Publish pages. + Deactivate gift cards. - Requires one of the following permissions: MANAGE_PAGES. + Added in Saleor 3.1. + + Requires one of the following permissions: MANAGE_GIFT_CARD. + + Triggers the following webhook events: + - GIFT_CARD_STATUS_CHANGED (async): A gift card was deactivated. """ - pageBulkPublish( - """List of page IDs to (un)publish.""" + giftCardBulkDeactivate( + """List of gift card IDs to deactivate.""" ids: [ID!]! - - """Determine if pages will be published or not.""" - isPublished: Boolean! - ): PageBulkPublish @doc(category: "Pages") + ): GiftCardBulkDeactivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: []) """ - Updates an existing page. + Update plugin configuration. - Requires one of the following permissions: MANAGE_PAGES. + Requires one of the following permissions: MANAGE_PLUGINS. """ - pageUpdate( - """ID of a page to update.""" + pluginUpdate( + """ID of a channel for which the data should be modified.""" + channelId: ID + + """ID of plugin to update.""" id: ID! - """Fields required to update a page.""" - input: PageInput! - ): PageUpdate @doc(category: "Pages") + """Fields required to update a plugin configuration.""" + input: PluginUpdateInput! + ): PluginUpdate """ - Creates/updates translations for a page. + Trigger sending a notification with the notify plugin method. Serializes nodes provided as ids parameter and includes this data in the notification payload. - Requires one of the following permissions: MANAGE_TRANSLATIONS. + Added in Saleor 3.1. """ - pageTranslate( - """Page ID or PageTranslatableContent ID.""" - id: ID! - input: PageTranslationInput! + externalNotificationTrigger( + """ + Channel slug. Saleor will send a notification within a provided channel. Please, make sure that necessary plugins are active. + """ + channel: String! - """Translation language code.""" - languageCode: LanguageCodeEnum! - ): PageTranslate @doc(category: "Pages") + """Input for External Notification Trigger.""" + input: ExternalNotificationTriggerInput! + + """The ID of notification plugin.""" + pluginId: String + ): ExternalNotificationTrigger @deprecated(reason: "\\n\\nDEPRECATED: this mutation will be removed in Saleor 4.0.") """ - Create a new page type. + Creates a new promotion. - Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. + Added in Saleor 3.17. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - PROMOTION_CREATED (async): A promotion was created. + - PROMOTION_STARTED (async): Optionally called if promotion was started. """ - pageTypeCreate( - """Fields required to create page type.""" - input: PageTypeCreateInput! - ): PageTypeCreate @doc(category: "Pages") + promotionCreate( + """Fields requires to create a promotion.""" + input: PromotionCreateInput! + ): PromotionCreate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_CREATED, PROMOTION_STARTED], syncEvents: []) """ - Update page type. + Updates an existing promotion. - Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. + Added in Saleor 3.17. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - PROMOTION_UPDATED (async): A promotion was updated. + - PROMOTION_STARTED (async): Optionally called if promotion was started. + - PROMOTION_ENDED (async): Optionally called if promotion was ended. """ - pageTypeUpdate( - """ID of the page type to update.""" - id: ID + promotionUpdate( + """ID of the promotion to update.""" + id: ID! - """Fields required to update page type.""" - input: PageTypeUpdateInput! - ): PageTypeUpdate @doc(category: "Pages") + """Fields required to update a promotion.""" + input: PromotionUpdateInput! + ): PromotionUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_UPDATED, PROMOTION_STARTED, PROMOTION_ENDED], syncEvents: []) """ - Delete a page type. + Deletes a promotion. - Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. + Added in Saleor 3.17. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - PROMOTION_DELETED (async): A promotion was deleted. """ - pageTypeDelete( - """ID of the page type to delete.""" + promotionDelete( + """The ID of the promotion to remove.""" id: ID! - ): PageTypeDelete @doc(category: "Pages") + ): PromotionDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_DELETED], syncEvents: []) """ - Delete page types. + Creates a new promotion rule. - Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. + Added in Saleor 3.17. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - PROMOTION_RULE_CREATED (async): A promotion rule was created. """ - pageTypeBulkDelete( - """List of page type IDs to delete""" - ids: [ID!]! - ): PageTypeBulkDelete @doc(category: "Pages") + promotionRuleCreate( + """Fields required to create a promotion rule.""" + input: PromotionRuleCreateInput! + ): PromotionRuleCreate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_RULE_CREATED], syncEvents: []) """ - Assign attributes to a given page type. + Updates an existing promotion rule. - Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. + Added in Saleor 3.17. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - PROMOTION_RULE_UPDATED (async): A promotion rule was updated. """ - pageAttributeAssign( - """The IDs of the attributes to assign.""" - attributeIds: [ID!]! + promotionRuleUpdate( + """ID of the promotion rule to update.""" + id: ID! - """ID of the page type to assign the attributes into.""" - pageTypeId: ID! - ): PageAttributeAssign @doc(category: "Pages") + """Fields required to create a promotion rule.""" + input: PromotionRuleUpdateInput! + ): PromotionRuleUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_RULE_UPDATED], syncEvents: []) """ - Unassign attributes from a given page type. + Deletes a promotion rule. - Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. + Added in Saleor 3.17. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - PROMOTION_RULE_DELETED (async): A promotion rule was deleted. """ - pageAttributeUnassign( - """The IDs of the attributes to unassign.""" - attributeIds: [ID!]! - - """ID of the page type from which the attributes should be unassign.""" - pageTypeId: ID! - ): PageAttributeUnassign @doc(category: "Pages") + promotionRuleDelete( + """The ID of the promotion to remove.""" + id: ID! + ): PromotionRuleDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_RULE_DELETED], syncEvents: []) """ - Reorder the attributes of a page type. + Creates/updates translations for a promotion. - Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. + Added in Saleor 3.17. + + Requires one of the following permissions: MANAGE_TRANSLATIONS. """ - pageTypeReorderAttributes( - """The list of attribute reordering operations.""" - moves: [ReorderInput!]! + promotionTranslate( + """Promotion ID or PromotionTranslatableContent ID.""" + id: ID! - """ID of a page type.""" - pageTypeId: ID! - ): PageTypeReorderAttributes @doc(category: "Pages") + """Fields required to update promotion translations.""" + input: PromotionTranslationInput! + + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): PromotionTranslate @doc(category: "Discounts") """ - Reorder page attribute values. + Creates/updates translations for a promotion rule. - Requires one of the following permissions: MANAGE_PAGES. + Added in Saleor 3.17. + + Requires one of the following permissions: MANAGE_TRANSLATIONS. """ - pageReorderAttributeValues( - """ID of an attribute.""" - attributeId: ID! + promotionRuleTranslate( + """PromotionRule ID or PromotionRuleTranslatableContent ID.""" + id: ID! - """The list of reordering operations for given attribute values.""" - moves: [ReorderInput!]! + """Fields required to update promotion rule translations.""" + input: PromotionRuleTranslationInput! - """ID of a page.""" - pageId: ID! - ): PageReorderAttributeValues @doc(category: "Pages") + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): PromotionRuleTranslate @doc(category: "Discounts") """ - Completes creating an order. + Deletes promotions. + + Added in Saleor 3.17. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - PROMOTION_DELETED (async): A promotion was deleted. + """ + promotionBulkDelete( + """List of promotion IDs to delete.""" + ids: [ID!]! + ): PromotionBulkDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_DELETED], syncEvents: []) + + """ + Creates a new sale. + + DEPRECATED: this mutation will be removed in Saleor 4.0. Use `promotionCreate` mutation instead. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - SALE_CREATED (async): A sale was created. + """ + saleCreate( + """Fields required to create a sale.""" + input: SaleInput! + ): SaleCreate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_CREATED], syncEvents: []) + + """ + Deletes a sale. + + DEPRECATED: this mutation will be removed in Saleor 4.0. Use `promotionDelete` mutation instead. - Requires one of the following permissions: MANAGE_ORDERS. + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - SALE_DELETED (async): A sale was deleted. """ - draftOrderComplete( - """ID of the order that will be completed.""" + saleDelete( + """ID of a sale to delete.""" id: ID! - ): DraftOrderComplete @doc(category: "Orders") + ): SaleDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_DELETED], syncEvents: []) """ - Creates a new draft order. + Deletes sales. - Requires one of the following permissions: MANAGE_ORDERS. + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - SALE_DELETED (async): A sale was deleted. """ - draftOrderCreate( - """Fields required to create an order.""" - input: DraftOrderCreateInput! - ): DraftOrderCreate @doc(category: "Orders") + saleBulkDelete( + """List of sale IDs to delete.""" + ids: [ID!]! + ): SaleBulkDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_DELETED], syncEvents: []) """ - Deletes a draft order. + Updates a sale. - Requires one of the following permissions: MANAGE_ORDERS. + DEPRECATED: this mutation will be removed in Saleor 4.0. Use `promotionUpdate` mutation instead. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - SALE_UPDATED (async): A sale was updated. + - SALE_TOGGLE (async): Optionally triggered when a sale is started or stopped. """ - draftOrderDelete( - """ - External ID of a product to delete. - - Added in Saleor 3.10. - """ - externalReference: String + saleUpdate( + """ID of a sale to update.""" + id: ID! - """ID of a product to delete.""" - id: ID - ): DraftOrderDelete @doc(category: "Orders") + """Fields required to update a sale.""" + input: SaleInput! + ): SaleUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_UPDATED, SALE_TOGGLE], syncEvents: []) """ - Deletes draft orders. + Adds products, categories, collections to a sale. - Requires one of the following permissions: MANAGE_ORDERS. + DEPRECATED: this mutation will be removed in Saleor 4.0. Use `promotionRuleCreate` mutation instead. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - SALE_UPDATED (async): A sale was updated. """ - draftOrderBulkDelete( - """List of draft order IDs to delete.""" - ids: [ID!]! - ): DraftOrderBulkDelete @doc(category: "Orders") + saleCataloguesAdd( + """ID of a sale.""" + id: ID! + + """Fields required to modify catalogue IDs of sale.""" + input: CatalogueInput! + ): SaleAddCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_UPDATED], syncEvents: []) """ - Deletes order lines. + Removes products, categories, collections from a sale. - Requires one of the following permissions: MANAGE_ORDERS. + DEPRECATED: this mutation will be removed in Saleor 4.0. Use `promotionRuleUpdate` or `promotionRuleDelete` mutations instead. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - SALE_UPDATED (async): A sale was updated. """ - draftOrderLinesBulkDelete( - """List of order lines IDs to delete.""" - ids: [ID!]! - ): DraftOrderLinesBulkDelete @doc(category: "Orders") @deprecated(reason: "This field will be removed in Saleor 4.0.") + saleCataloguesRemove( + """ID of a sale.""" + id: ID! + + """Fields required to modify catalogue IDs of sale.""" + input: CatalogueInput! + ): SaleRemoveCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_UPDATED], syncEvents: []) """ - Updates a draft order. + Creates/updates translations for a sale. - Requires one of the following permissions: MANAGE_ORDERS. + DEPRECATED: this mutation will be removed in Saleor 4.0. Use `PromotionTranslate` mutation instead. + + Requires one of the following permissions: MANAGE_TRANSLATIONS. """ - draftOrderUpdate( - """ - External ID of a draft order to update. - - Added in Saleor 3.10. - """ - externalReference: String + saleTranslate( + """Sale ID or SaleTranslatableContent ID.""" + id: ID! - """ID of a draft order to update.""" - id: ID + """Fields required to update sale translations.""" + input: NameTranslationInput! - """Fields required to update an order.""" - input: DraftOrderInput! - ): DraftOrderUpdate @doc(category: "Orders") + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): SaleTranslate @doc(category: "Discounts") """ - Adds note to the order. + Manage sale's availability in channels. - Requires one of the following permissions: MANAGE_ORDERS. + DEPRECATED: this mutation will be removed in Saleor 4.0. Use `promotionRuleCreate` or `promotionRuleUpdate` mutations instead. + + Requires one of the following permissions: MANAGE_DISCOUNTS. """ - orderAddNote( - """ID of the order to add a note for.""" - order: ID! + saleChannelListingUpdate( + """ID of a sale to update.""" + id: ID! - """Fields required to create a note for the order.""" - input: OrderAddNoteInput! - ): OrderAddNote @doc(category: "Orders") + """Fields required to update sale channel listings.""" + input: SaleChannelListingInput! + ): SaleChannelListingUpdate @doc(category: "Discounts") """ - Cancel an order. + Creates a new voucher. - Requires one of the following permissions: MANAGE_ORDERS. + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - VOUCHER_CREATED (async): A voucher was created. + - VOUCHER_CODES_CREATED (async): A voucher codes were created. """ - orderCancel( - """ID of the order to cancel.""" - id: ID! - ): OrderCancel @doc(category: "Orders") + voucherCreate( + """Fields required to create a voucher.""" + input: VoucherInput! + ): VoucherCreate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_CREATED, VOUCHER_CODES_CREATED], syncEvents: []) """ - Capture an order. + Deletes a voucher. - Requires one of the following permissions: MANAGE_ORDERS. + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - VOUCHER_DELETED (async): A voucher was deleted. """ - orderCapture( - """Amount of money to capture.""" - amount: PositiveDecimal! - - """ID of the order to capture.""" + voucherDelete( + """ID of a voucher to delete.""" id: ID! - ): OrderCapture @doc(category: "Orders") + ): VoucherDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_DELETED], syncEvents: []) """ - Confirms an unconfirmed order by changing status to unfulfilled. + Deletes vouchers. - Requires one of the following permissions: MANAGE_ORDERS. + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - VOUCHER_DELETED (async): A voucher was deleted. """ - orderConfirm( - """ID of an order to confirm.""" - id: ID! - ): OrderConfirm @doc(category: "Orders") + voucherBulkDelete( + """List of voucher IDs to delete.""" + ids: [ID!]! + ): VoucherBulkDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_DELETED], syncEvents: []) """ - Creates new fulfillments for an order. + Updates a voucher. - Requires one of the following permissions: MANAGE_ORDERS. + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - VOUCHER_UPDATED (async): A voucher was updated. + - VOUCHER_CODES_CREATED (async): A voucher code was created. """ - orderFulfill( - """Fields required to create a fulfillment.""" - input: OrderFulfillInput! + voucherUpdate( + """ID of a voucher to update.""" + id: ID! - """ID of the order to be fulfilled.""" - order: ID - ): OrderFulfill @doc(category: "Orders") + """Fields required to update a voucher.""" + input: VoucherInput! + ): VoucherUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED, VOUCHER_CODES_CREATED], syncEvents: []) """ - Cancels existing fulfillment and optionally restocks items. + Adds products, categories, collections to a voucher. - Requires one of the following permissions: MANAGE_ORDERS. + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - VOUCHER_UPDATED (async): A voucher was updated. """ - orderFulfillmentCancel( - """ID of a fulfillment to cancel.""" + voucherCataloguesAdd( + """ID of a voucher.""" id: ID! - """Fields required to cancel a fulfillment.""" - input: FulfillmentCancelInput - ): FulfillmentCancel @doc(category: "Orders") + """Fields required to modify catalogue IDs of voucher.""" + input: CatalogueInput! + ): VoucherAddCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: []) """ - Approve existing fulfillment. + Removes products, categories, collections from a voucher. - Added in Saleor 3.1. + Requires one of the following permissions: MANAGE_DISCOUNTS. - Requires one of the following permissions: MANAGE_ORDERS. + Triggers the following webhook events: + - VOUCHER_UPDATED (async): A voucher was updated. """ - orderFulfillmentApprove( - """True if stock could be exceeded.""" - allowStockToBeExceeded: Boolean = false - - """ID of a fulfillment to approve.""" + voucherCataloguesRemove( + """ID of a voucher.""" id: ID! - """True if confirmation email should be send.""" - notifyCustomer: Boolean! - ): FulfillmentApprove @doc(category: "Orders") + """Fields required to modify catalogue IDs of voucher.""" + input: CatalogueInput! + ): VoucherRemoveCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: []) """ - Updates a fulfillment for an order. + Creates/updates translations for a voucher. - Requires one of the following permissions: MANAGE_ORDERS. + Requires one of the following permissions: MANAGE_TRANSLATIONS. """ - orderFulfillmentUpdateTracking( - """ID of a fulfillment to update.""" + voucherTranslate( + """Voucher ID or VoucherTranslatableContent ID.""" id: ID! - """Fields required to update a fulfillment.""" - input: FulfillmentUpdateTrackingInput! - ): FulfillmentUpdateTracking @doc(category: "Orders") + """Fields required to update voucher translations.""" + input: NameTranslationInput! + + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): VoucherTranslate @doc(category: "Discounts") """ - Refund products. + Manage voucher's availability in channels. - Requires one of the following permissions: MANAGE_ORDERS. + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - VOUCHER_UPDATED (async): A voucher was updated. """ - orderFulfillmentRefundProducts( - """Fields required to create an refund fulfillment.""" - input: OrderRefundProductsInput! + voucherChannelListingUpdate( + """ID of a voucher to update.""" + id: ID! - """ID of the order to be refunded.""" - order: ID! - ): FulfillmentRefundProducts @doc(category: "Orders") + """Fields required to update voucher channel listings.""" + input: VoucherChannelListingInput! + ): VoucherChannelListingUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: []) """ - Return products. + Deletes voucher codes. - Requires one of the following permissions: MANAGE_ORDERS. + Added in Saleor 3.18. + + Requires one of the following permissions: MANAGE_DISCOUNTS. + + Triggers the following webhook events: + - VOUCHER_CODES_DELETED (async): A voucher codes were deleted. """ - orderFulfillmentReturnProducts( - """Fields required to return products.""" - input: OrderReturnProductsInput! + voucherCodeBulkDelete( + """List of voucher codes IDs to delete.""" + ids: [ID!]! + ): VoucherCodeBulkDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_CODES_DELETED], syncEvents: []) - """ID of the order to be returned.""" - order: ID! - ): FulfillmentReturnProducts @doc(category: "Orders") + """ + Export products to csv file. + + Requires one of the following permissions: MANAGE_PRODUCTS. + + Triggers the following webhook events: + - NOTIFY_USER (async): A notification for the exported file. + - PRODUCT_EXPORT_COMPLETED (async): A notification for the exported file. + """ + exportProducts( + """Fields required to export product data.""" + input: ExportProductsInput! + ): ExportProducts @doc(category: "Products") @webhookEventsInfo(asyncEvents: [NOTIFY_USER, PRODUCT_EXPORT_COMPLETED], syncEvents: []) """ - Adds granted refund to the order. + Export gift cards to csv file. - Added in Saleor 3.13. + Added in Saleor 3.1. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Requires one of the following permissions: MANAGE_GIFT_CARD. - Requires one of the following permissions: MANAGE_ORDERS. + Triggers the following webhook events: + - NOTIFY_USER (async): A notification for the exported file. + - GIFT_CARD_EXPORT_COMPLETED (async): A notification for the exported file. """ - orderGrantRefundCreate( - """ID of the order.""" - id: ID! - - """Fields required to create a granted refund for the order.""" - input: OrderGrantRefundCreateInput! - ): OrderGrantRefundCreate @doc(category: "Orders") + exportGiftCards( + """Fields required to export gift cards data.""" + input: ExportGiftCardsInput! + ): ExportGiftCards @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [NOTIFY_USER, GIFT_CARD_EXPORT_COMPLETED], syncEvents: []) """ - Updates granted refund. + Export voucher codes to csv/xlsx file. - Added in Saleor 3.13. + Added in Saleor 3.18. Note: this API is currently in Feature Preview and can be subject to changes at later point. - Requires one of the following permissions: MANAGE_ORDERS. - """ - orderGrantRefundUpdate( - """ID of the granted refund.""" - id: ID! - - """Fields required to update a granted refund.""" - input: OrderGrantRefundUpdateInput! - ): OrderGrantRefundUpdate @doc(category: "Orders") - - """ - Create order lines for an order. + Requires one of the following permissions: MANAGE_DISCOUNTS. - Requires one of the following permissions: MANAGE_ORDERS. + Triggers the following webhook events: + - VOUCHER_CODE_EXPORT_COMPLETED (async): A notification for the exported file. """ - orderLinesCreate( - """ID of the order to add the lines to.""" - id: ID! - - """Fields required to add order lines.""" - input: [OrderLineCreateInput!]! - ): OrderLinesCreate @doc(category: "Orders") + exportVoucherCodes( + """Fields required to export voucher codes.""" + input: ExportVoucherCodesInput! + ): ExportVoucherCodes @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_CODE_EXPORT_COMPLETED], syncEvents: []) """ - Deletes an order line from an order. + Upload a file. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec - Requires one of the following permissions: MANAGE_ORDERS. + Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_STAFF_USER. """ - orderLineDelete( - """ID of the order line to delete.""" - id: ID! - ): OrderLineDelete @doc(category: "Orders") + fileUpload( + """Represents a file in a multipart request.""" + file: Upload! + ): FileUpload """ - Updates an order line of an order. + Adds a gift card or a voucher to a checkout. - Requires one of the following permissions: MANAGE_ORDERS. + Triggers the following webhook events: + - CHECKOUT_UPDATED (async): A checkout was updated. """ - orderLineUpdate( - """ID of the order line to update.""" - id: ID! + checkoutAddPromoCode( + """ + The ID of the checkout. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + checkoutId: ID - """Fields required to update an order line.""" - input: OrderLineInput! - ): OrderLineUpdate @doc(category: "Orders") + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID + + """Gift card code or voucher code.""" + promoCode: String! + + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutAddPromoCode @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) """ - Adds discount to the order. + Update billing address in the existing checkout. - Requires one of the following permissions: MANAGE_ORDERS. + Triggers the following webhook events: + - CHECKOUT_UPDATED (async): A checkout was updated. """ - orderDiscountAdd( - """Fields required to create a discount for the order.""" - input: OrderDiscountCommonInput! + checkoutBillingAddressUpdate( + """The billing address of the checkout.""" + billingAddress: AddressInput! - """ID of an order to discount.""" - orderId: ID! - ): OrderDiscountAdd @doc(category: "Orders") + """ + The ID of the checkout. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + checkoutId: ID + + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID + + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + + """ + The rules for changing validation for received billing address data. + + Added in Saleor 3.5. + """ + validationRules: CheckoutAddressValidationRules + ): CheckoutBillingAddressUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) """ - Update discount for the order. + Completes the checkout. As a result a new order is created. The mutation allows to create the unpaid order when setting `orderSettings.allowUnpaidOrders` for given `Channel` is set to `true`. When `orderSettings.allowUnpaidOrders` is set to `false`, checkout can be completed only when attached `Payment`/`TransactionItem`s fully cover the checkout's total. When processing the checkout with `Payment`, in case of required additional confirmation step like 3D secure, the `confirmationNeeded` flag will be set to True and no order will be created until payment is confirmed with second call of this mutation. - Requires one of the following permissions: MANAGE_ORDERS. + Triggers the following webhook events: + - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid. + - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid. + - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired. + - ORDER_CREATED (async): Triggered when order is created. + - NOTIFY_USER (async): A notification for order placement. + - NOTIFY_USER (async): A staff notification for order placement. + - ORDER_UPDATED (async): Triggered when order received the update after placement. + - ORDER_PAID (async): Triggered when newly created order is paid. + - ORDER_FULLY_PAID (async): Triggered when newly created order is fully paid. + - ORDER_CONFIRMED (async): Optionally triggered when newly created order are automatically marked as confirmed. """ - orderDiscountUpdate( - """ID of a discount to update.""" - discountId: ID! + checkoutComplete( + """ + The ID of the checkout. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + checkoutId: ID - """Fields required to update a discount for the order.""" - input: OrderDiscountCommonInput! - ): OrderDiscountUpdate @doc(category: "Orders") + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID + + """ + Fields required to update the checkout metadata. + + Added in Saleor 3.8. + """ + metadata: [MetadataInput!] + + """Client-side generated data required to finalize the payment.""" + paymentData: JSONString + + """ + URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. + """ + redirectUrl: String + + """ + Determines whether to store the payment source for future usage. + + DEPRECATED: this field will be removed in Saleor 4.0. Use checkoutPaymentCreate for this action. + """ + storeSource: Boolean = false + + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutComplete @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [ORDER_CREATED, NOTIFY_USER, NOTIFY_USER, ORDER_UPDATED, ORDER_PAID, ORDER_FULLY_PAID, ORDER_CONFIRMED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS, CHECKOUT_CALCULATE_TAXES]) """ - Remove discount from the order. + Create a new checkout. - Requires one of the following permissions: MANAGE_ORDERS. + Triggers the following webhook events: + - CHECKOUT_CREATED (async): A checkout was created. """ - orderDiscountDelete( - """ID of a discount to remove.""" - discountId: ID! - ): OrderDiscountDelete @doc(category: "Orders") + checkoutCreate( + """Fields required to create checkout.""" + input: CheckoutCreateInput! + ): CheckoutCreate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_CREATED], syncEvents: []) """ - Update discount for the order line. + Create new checkout from existing order. - Requires one of the following permissions: MANAGE_ORDERS. + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - orderLineDiscountUpdate( - """Fields required to update price for the order line.""" - input: OrderDiscountCommonInput! - - """ID of a order line to update price""" - orderLineId: ID! - ): OrderLineDiscountUpdate @doc(category: "Orders") + checkoutCreateFromOrder( + """ID of a order that will be used to create the checkout.""" + id: ID! + ): CheckoutCreateFromOrder @doc(category: "Checkout") """ - Remove discount applied to the order line. + Sets the customer as the owner of the checkout. - Requires one of the following permissions: MANAGE_ORDERS. + Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER. + + Triggers the following webhook events: + - CHECKOUT_UPDATED (async): A checkout was updated. """ - orderLineDiscountRemove( - """ID of a order line to remove its discount""" - orderLineId: ID! - ): OrderLineDiscountRemove @doc(category: "Orders") + checkoutCustomerAttach( + """ + The ID of the checkout. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + checkoutId: ID + + """ + ID of customer to attach to checkout. Requires IMPERSONATE_USER permission when customerId is different than the logged-in user. + """ + customerId: ID + + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID + + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutCustomerAttach @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) """ - Mark order as manually paid. + Removes the user assigned as the owner of the checkout. - Requires one of the following permissions: MANAGE_ORDERS. + Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER. + + Triggers the following webhook events: + - CHECKOUT_UPDATED (async): A checkout was updated. """ - orderMarkAsPaid( - """ID of the order to mark paid.""" - id: ID! + checkoutCustomerDetach( + """ + The ID of the checkout. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + checkoutId: ID - """The external transaction reference.""" - transactionReference: String - ): OrderMarkAsPaid @doc(category: "Orders") + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID + + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutCustomerDetach @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) """ - Refund an order. + Updates email address in the existing checkout object. - Requires one of the following permissions: MANAGE_ORDERS. + Triggers the following webhook events: + - CHECKOUT_UPDATED (async): A checkout was updated. """ - orderRefund( - """Amount of money to refund.""" - amount: PositiveDecimal! + checkoutEmailUpdate( + """ + The ID of the checkout. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + checkoutId: ID + + """email.""" + email: String! - """ID of the order to refund.""" - id: ID! - ): OrderRefund @doc(category: "Orders") + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID + + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutEmailUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) """ - Updates an order. + Deletes a CheckoutLine. - Requires one of the following permissions: MANAGE_ORDERS. + Triggers the following webhook events: + - CHECKOUT_UPDATED (async): A checkout was updated. """ - orderUpdate( + checkoutLineDelete( """ - External ID of an order to update. + The ID of the checkout. - Added in Saleor 3.10. + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. """ - externalReference: String + checkoutId: ID - """ID of an order to update.""" + """ + The checkout's ID. + + Added in Saleor 3.4. + """ id: ID - """Fields required to update an order.""" - input: OrderUpdateInput! - ): OrderUpdate @doc(category: "Orders") + """ID of the checkout line to delete.""" + lineId: ID + + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutLineDelete @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) @deprecated(reason: "This field will be removed in Saleor 4.0. Use `checkoutLinesDelete` instead.") """ - Updates a shipping method of the order. Requires shipping method ID to update, when null is passed then currently assigned shipping method is removed. + Deletes checkout lines. - Requires one of the following permissions: MANAGE_ORDERS. + Triggers the following webhook events: + - CHECKOUT_UPDATED (async): A checkout was updated. """ - orderUpdateShipping( - """ID of the order to update a shipping method.""" - order: ID! + checkoutLinesDelete( + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID - """Fields required to change shipping method of the order.""" - input: OrderUpdateShippingInput! - ): OrderUpdateShipping @doc(category: "Orders") + """A list of checkout lines.""" + linesIds: [ID!]! - """ - Void an order. - - Requires one of the following permissions: MANAGE_ORDERS. - """ - orderVoid( - """ID of the order to void.""" - id: ID! - ): OrderVoid @doc(category: "Orders") + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutLinesDelete @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) """ - Cancels orders. + Adds a checkout line to the existing checkout.If line was already in checkout, its quantity will be increased. - Requires one of the following permissions: MANAGE_ORDERS. - """ - orderBulkCancel( - """List of orders IDs to cancel.""" - ids: [ID!]! - ): OrderBulkCancel @doc(category: "Orders") - - """ - Delete metadata of an object. To use it, you need to have access to the modified object. + Triggers the following webhook events: + - CHECKOUT_UPDATED (async): A checkout was updated. """ - deleteMetadata( - """ID or token (for Order and Checkout) of an object to update.""" - id: ID! + checkoutLinesAdd( + """ + The ID of the checkout. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + checkoutId: ID - """Metadata keys to delete.""" - keys: [String!]! - ): DeleteMetadata + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID - """ - Delete object's private metadata. To use it, you need to be an authenticated staff user or an app and have access to the modified object. - """ - deletePrivateMetadata( - """ID or token (for Order and Checkout) of an object to update.""" - id: ID! + """ + A list of checkout lines, each containing information about an item in the checkout. + """ + lines: [CheckoutLineInput!]! - """Metadata keys to delete.""" - keys: [String!]! - ): DeletePrivateMetadata + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutLinesAdd @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) """ - Updates metadata of an object. To use it, you need to have access to the modified object. + Updates checkout line in the existing checkout. + + Triggers the following webhook events: + - CHECKOUT_UPDATED (async): A checkout was updated. """ - updateMetadata( - """ID or token (for Order and Checkout) of an object to update.""" - id: ID! + checkoutLinesUpdate( + """ + The ID of the checkout. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + checkoutId: ID - """Fields required to update the object's metadata.""" - input: [MetadataInput!]! - ): UpdateMetadata + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID - """ - Updates private metadata of an object. To use it, you need to be an authenticated staff user or an app and have access to the modified object. - """ - updatePrivateMetadata( - """ID or token (for Order and Checkout) of an object to update.""" - id: ID! + """ + A list of checkout lines, each containing information about an item in the checkout. + """ + lines: [CheckoutLineUpdateInput!]! - """Fields required to update the object's metadata.""" - input: [MetadataInput!]! - ): UpdatePrivateMetadata + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutLinesUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) """ - Assigns storefront's navigation menus. + Remove a gift card or a voucher from a checkout. - Requires one of the following permissions: MANAGE_MENUS, MANAGE_SETTINGS. + Triggers the following webhook events: + - CHECKOUT_UPDATED (async): A checkout was updated. """ - assignNavigation( - """ID of the menu.""" - menu: ID + checkoutRemovePromoCode( + """ + The ID of the checkout. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + checkoutId: ID - """Type of the navigation bar to assign the menu to.""" - navigationType: NavigationType! - ): AssignNavigation @doc(category: "Menu") + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID - """ - Creates a new Menu. - - Requires one of the following permissions: MANAGE_MENUS. - """ - menuCreate( - """Fields required to create a menu.""" - input: MenuCreateInput! - ): MenuCreate @doc(category: "Menu") + """Gift card code or voucher code.""" + promoCode: String - """ - Deletes a menu. - - Requires one of the following permissions: MANAGE_MENUS. - """ - menuDelete( - """ID of a menu to delete.""" - id: ID! - ): MenuDelete @doc(category: "Menu") + """Gift card or voucher ID.""" + promoCodeId: ID - """ - Deletes menus. - - Requires one of the following permissions: MANAGE_MENUS. - """ - menuBulkDelete( - """List of menu IDs to delete.""" - ids: [ID!]! - ): MenuBulkDelete @doc(category: "Menu") + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutRemovePromoCode @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) - """ - Updates a menu. - - Requires one of the following permissions: MANAGE_MENUS. - """ - menuUpdate( - """ID of a menu to update.""" - id: ID! + """Create a new payment for given checkout.""" + checkoutPaymentCreate( + """ + The ID of the checkout. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + checkoutId: ID - """Fields required to update a menu.""" - input: MenuInput! - ): MenuUpdate @doc(category: "Menu") + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID + + """Data required to create a new payment.""" + input: PaymentInput! + + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutPaymentCreate @doc(category: "Checkout") """ - Creates a new menu item. + Update shipping address in the existing checkout. - Requires one of the following permissions: MANAGE_MENUS. + Triggers the following webhook events: + - CHECKOUT_UPDATED (async): A checkout was updated. """ - menuItemCreate( + checkoutShippingAddressUpdate( """ - Fields required to update a menu item. Only one of `url`, `category`, `page`, `collection` is allowed per item. + The ID of the checkout. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. """ - input: MenuItemCreateInput! - ): MenuItemCreate @doc(category: "Menu") + checkoutId: ID - """ - Deletes a menu item. - - Requires one of the following permissions: MANAGE_MENUS. - """ - menuItemDelete( - """ID of a menu item to delete.""" - id: ID! - ): MenuItemDelete @doc(category: "Menu") + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID - """ - Deletes menu items. - - Requires one of the following permissions: MANAGE_MENUS. - """ - menuItemBulkDelete( - """List of menu item IDs to delete.""" - ids: [ID!]! - ): MenuItemBulkDelete @doc(category: "Menu") + """The mailing address to where the checkout will be shipped.""" + shippingAddress: AddressInput! - """ - Updates a menu item. - - Requires one of the following permissions: MANAGE_MENUS. - """ - menuItemUpdate( - """ID of a menu item to update.""" - id: ID! + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID """ - Fields required to update a menu item. Only one of `url`, `category`, `page`, `collection` is allowed per item. + The rules for changing validation for received shipping address data. + + Added in Saleor 3.5. """ - input: MenuItemInput! - ): MenuItemUpdate @doc(category: "Menu") + validationRules: CheckoutAddressValidationRules + ): CheckoutShippingAddressUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) """ - Creates/updates translations for a menu item. + Updates the shipping method of the checkout. - Requires one of the following permissions: MANAGE_TRANSLATIONS. + Triggers the following webhook events: + - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Triggered when updating the checkout shipping method with the external one. + - CHECKOUT_UPDATED (async): A checkout was updated. """ - menuItemTranslate( - """MenuItem ID or MenuItemTranslatableContent ID.""" - id: ID! - input: NameTranslationInput! + checkoutShippingMethodUpdate( + """ + The ID of the checkout. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + checkoutId: ID - """Translation language code.""" - languageCode: LanguageCodeEnum! - ): MenuItemTranslate @doc(category: "Menu") + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID - """ - Moves items of menus. - - Requires one of the following permissions: MANAGE_MENUS. - """ - menuItemMove( - """ID of the menu.""" - menu: ID! + """Shipping method.""" + shippingMethodId: ID - """The menu position data.""" - moves: [MenuItemMoveInput!]! - ): MenuItemMove @doc(category: "Menu") + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutShippingMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT]) @deprecated(reason: "This field will be removed in Saleor 4.0. Use `checkoutDeliveryMethodUpdate` instead.") """ - Request an invoice for the order using plugin. + Updates the delivery method (shipping method or pick up point) of the checkout. Updates the checkout shipping_address for click and collect delivery for a warehouse address. - Requires one of the following permissions: MANAGE_ORDERS. + Added in Saleor 3.1. + + Triggers the following webhook events: + - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Triggered when updating the checkout delivery method with the external one. + - CHECKOUT_UPDATED (async): A checkout was updated. """ - invoiceRequest( - """Invoice number, if not provided it will be generated.""" - number: String + checkoutDeliveryMethodUpdate( + """Delivery Method ID (`Warehouse` ID or `ShippingMethod` ID).""" + deliveryMethodId: ID - """ID of the order related to invoice.""" - orderId: ID! - ): InvoiceRequest @doc(category: "Orders") + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID - """ - Requests deletion of an invoice. - - Requires one of the following permissions: MANAGE_ORDERS. - """ - invoiceRequestDelete( - """ID of an invoice to request the deletion.""" - id: ID! - ): InvoiceRequestDelete @doc(category: "Orders") + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutDeliveryMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT]) """ - Creates a ready to send invoice. + Update language code in the existing checkout. - Requires one of the following permissions: MANAGE_ORDERS. + Triggers the following webhook events: + - CHECKOUT_UPDATED (async): A checkout was updated. """ - invoiceCreate( - """Fields required when creating an invoice.""" - input: InvoiceCreateInput! + checkoutLanguageCodeUpdate( + """ + The ID of the checkout. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + checkoutId: ID - """ID of the order related to invoice.""" - orderId: ID! - ): InvoiceCreate @doc(category: "Orders") + """ + The checkout's ID. + + Added in Saleor 3.4. + """ + id: ID - """ - Deletes an invoice. - - Requires one of the following permissions: MANAGE_ORDERS. - """ - invoiceDelete( - """ID of an invoice to delete.""" - id: ID! - ): InvoiceDelete @doc(category: "Orders") + """New language code.""" + languageCode: LanguageCodeEnum! + + """ + Checkout token. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + """ + token: UUID + ): CheckoutLanguageCodeUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) """ - Updates an invoice. + Create new order from existing checkout. Requires the following permissions: AUTHENTICATED_APP and HANDLE_CHECKOUTS. - Requires one of the following permissions: MANAGE_ORDERS. + Added in Saleor 3.2. + + Triggers the following webhook events: + - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid. + - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid. + - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired. + - ORDER_CREATED (async): Triggered when order is created. + - NOTIFY_USER (async): A notification for order placement. + - NOTIFY_USER (async): A staff notification for order placement. + - ORDER_UPDATED (async): Triggered when order received the update after placement. + - ORDER_PAID (async): Triggered when newly created order is paid. + - ORDER_FULLY_PAID (async): Triggered when newly created order is fully paid. + - ORDER_CONFIRMED (async): Optionally triggered when newly created order are automatically marked as confirmed. """ - invoiceUpdate( - """ID of an invoice to update.""" + orderCreateFromCheckout( + """ID of a checkout that will be converted to an order.""" id: ID! - """Fields to use when updating an invoice.""" - input: UpdateInvoiceInput! - ): InvoiceUpdate @doc(category: "Orders") + """ + Fields required to update the checkout metadata. + + Added in Saleor 3.8. + """ + metadata: [MetadataInput!] - """ - Send an invoice notification to the customer. - - Requires one of the following permissions: MANAGE_ORDERS. - """ - invoiceSendNotification( - """ID of an invoice to be sent.""" - id: ID! - ): InvoiceSendNotification @doc(category: "Orders") + """ + Fields required to update the checkout private metadata. + + Added in Saleor 3.8. + """ + privateMetadata: [MetadataInput!] - """ - Activate a gift card. - - Requires one of the following permissions: MANAGE_GIFT_CARD. - """ - giftCardActivate( - """ID of a gift card to activate.""" - id: ID! - ): GiftCardActivate @doc(category: "Gift cards") + """ + Determines if checkout should be removed after creating an order. Default true. + """ + removeCheckout: Boolean = true + ): OrderCreateFromCheckout @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [ORDER_CREATED, NOTIFY_USER, NOTIFY_USER, ORDER_UPDATED, ORDER_PAID, ORDER_FULLY_PAID, ORDER_CONFIRMED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS, CHECKOUT_CALCULATE_TAXES]) """ - Creates a new gift card. + Creates new channel. - Requires one of the following permissions: MANAGE_GIFT_CARD. + Requires one of the following permissions: MANAGE_CHANNELS. + + Triggers the following webhook events: + - CHANNEL_CREATED (async): A channel was created. """ - giftCardCreate( - """Fields required to create a gift card.""" - input: GiftCardCreateInput! - ): GiftCardCreate @doc(category: "Gift cards") + channelCreate( + """Fields required to create channel.""" + input: ChannelCreateInput! + ): ChannelCreate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_CREATED], syncEvents: []) """ - Delete gift card. + Update a channel. - Added in Saleor 3.1. + Requires one of the following permissions: MANAGE_CHANNELS. + Requires one of the following permissions when updating only `orderSettings` field: `MANAGE_CHANNELS`, `MANAGE_ORDERS`. + Requires one of the following permissions when updating only `checkoutSettings` field: `MANAGE_CHANNELS`, `MANAGE_CHECKOUTS`. + Requires one of the following permissions when updating only `paymentSettings` field: `MANAGE_CHANNELS`, `HANDLE_PAYMENTS`. - Requires one of the following permissions: MANAGE_GIFT_CARD. + Triggers the following webhook events: + - CHANNEL_UPDATED (async): A channel was updated. + - CHANNEL_METADATA_UPDATED (async): Optionally triggered when public or private metadata is updated. """ - giftCardDelete( - """ID of the gift card to delete.""" + channelUpdate( + """ID of a channel to update.""" id: ID! - ): GiftCardDelete @doc(category: "Gift cards") + + """Fields required to update a channel.""" + input: ChannelUpdateInput! + ): ChannelUpdate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_UPDATED, CHANNEL_METADATA_UPDATED], syncEvents: []) """ - Deactivate a gift card. + Delete a channel. Orders associated with the deleted channel will be moved to the target channel. Checkouts, product availability, and pricing will be removed. - Requires one of the following permissions: MANAGE_GIFT_CARD. + Requires one of the following permissions: MANAGE_CHANNELS. + + Triggers the following webhook events: + - CHANNEL_DELETED (async): A channel was deleted. """ - giftCardDeactivate( - """ID of a gift card to deactivate.""" + channelDelete( + """ID of a channel to delete.""" id: ID! - ): GiftCardDeactivate @doc(category: "Gift cards") + + """Fields required to delete a channel.""" + input: ChannelDeleteInput + ): ChannelDelete @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_DELETED], syncEvents: []) """ - Update a gift card. + Activate a channel. - Requires one of the following permissions: MANAGE_GIFT_CARD. + Requires one of the following permissions: MANAGE_CHANNELS. + + Triggers the following webhook events: + - CHANNEL_STATUS_CHANGED (async): A channel was activated. """ - giftCardUpdate( - """ID of a gift card to update.""" + channelActivate( + """ID of the channel to activate.""" id: ID! - - """Fields required to update a gift card.""" - input: GiftCardUpdateInput! - ): GiftCardUpdate @doc(category: "Gift cards") + ): ChannelActivate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_STATUS_CHANGED], syncEvents: []) """ - Resend a gift card. + Deactivate a channel. - Added in Saleor 3.1. + Requires one of the following permissions: MANAGE_CHANNELS. - Requires one of the following permissions: MANAGE_GIFT_CARD. + Triggers the following webhook events: + - CHANNEL_STATUS_CHANGED (async): A channel was deactivated. """ - giftCardResend( - """Fields required to resend a gift card.""" - input: GiftCardResendInput! - ): GiftCardResend @doc(category: "Gift cards") + channelDeactivate( + """ID of the channel to deactivate.""" + id: ID! + ): ChannelDeactivate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_STATUS_CHANGED], syncEvents: []) """ - Adds note to the gift card. + Reorder the warehouses of a channel. - Added in Saleor 3.1. + Added in Saleor 3.7. - Requires one of the following permissions: MANAGE_GIFT_CARD. + Requires one of the following permissions: MANAGE_CHANNELS. """ - giftCardAddNote( - """ID of the gift card to add a note for.""" - id: ID! + channelReorderWarehouses( + """ID of a channel.""" + channelId: ID! - """Fields required to create a note for the gift card.""" - input: GiftCardAddNoteInput! - ): GiftCardAddNote @doc(category: "Gift cards") + """The list of reordering operations for the given channel warehouses.""" + moves: [ReorderInput!]! + ): ChannelReorderWarehouses @doc(category: "Channels") """ - Create gift cards. - - Added in Saleor 3.1. + Creates an attribute. - Requires one of the following permissions: MANAGE_GIFT_CARD. + Triggers the following webhook events: + - ATTRIBUTE_CREATED (async): An attribute was created. """ - giftCardBulkCreate( - """Fields required to create gift cards.""" - input: GiftCardBulkCreateInput! - ): GiftCardBulkCreate @doc(category: "Gift cards") + attributeCreate( + """Fields required to create an attribute.""" + input: AttributeCreateInput! + ): AttributeCreate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_CREATED], syncEvents: []) """ - Delete gift cards. + Deletes an attribute. - Added in Saleor 3.1. + Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. - Requires one of the following permissions: MANAGE_GIFT_CARD. + Triggers the following webhook events: + - ATTRIBUTE_DELETED (async): An attribute was deleted. """ - giftCardBulkDelete( - """List of gift card IDs to delete.""" - ids: [ID!]! - ): GiftCardBulkDelete @doc(category: "Gift cards") + attributeDelete( + """ + External ID of an attribute to delete. + + Added in Saleor 3.10. + """ + externalReference: String + + """ID of an attribute to delete.""" + id: ID + ): AttributeDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_DELETED], syncEvents: []) """ - Activate gift cards. + Updates attribute. - Added in Saleor 3.1. + Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. - Requires one of the following permissions: MANAGE_GIFT_CARD. + Triggers the following webhook events: + - ATTRIBUTE_UPDATED (async): An attribute was updated. """ - giftCardBulkActivate( - """List of gift card IDs to activate.""" - ids: [ID!]! - ): GiftCardBulkActivate @doc(category: "Gift cards") + attributeUpdate( + """ + External ID of an attribute to update. + + Added in Saleor 3.10. + """ + externalReference: String + + """ID of an attribute to update.""" + id: ID + + """Fields required to update an attribute.""" + input: AttributeUpdateInput! + ): AttributeUpdate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_UPDATED], syncEvents: []) """ - Deactivate gift cards. + Creates attributes. - Added in Saleor 3.1. + Added in Saleor 3.15. - Requires one of the following permissions: MANAGE_GIFT_CARD. + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Triggers the following webhook events: + - ATTRIBUTE_CREATED (async): An attribute was created. """ - giftCardBulkDeactivate( - """List of gift card IDs to deactivate.""" - ids: [ID!]! - ): GiftCardBulkDeactivate @doc(category: "Gift cards") + attributeBulkCreate( + """Input list of attributes to create.""" + attributes: [AttributeCreateInput!]! + + """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" + errorPolicy: ErrorPolicyEnum + ): AttributeBulkCreate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_CREATED], syncEvents: []) """ - Update plugin configuration. + Updates attributes. - Requires one of the following permissions: MANAGE_PLUGINS. + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Triggers the following webhook events: + - ATTRIBUTE_UPDATED (async): An attribute was updated. Optionally called when new attribute value was created or deleted. + - ATTRIBUTE_VALUE_CREATED (async): Called optionally when an attribute value was created. + - ATTRIBUTE_VALUE_DELETED (async): Called optionally when an attribute value was deleted. """ - pluginUpdate( - """ID of a channel for which the data should be modified.""" - channelId: ID + attributeBulkUpdate( + """Input list of attributes to update.""" + attributes: [AttributeBulkUpdateInput!]! - """ID of plugin to update.""" - id: ID! - - """Fields required to update a plugin configuration.""" - input: PluginUpdateInput! - ): PluginUpdate + """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" + errorPolicy: ErrorPolicyEnum + ): AttributeBulkUpdate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_UPDATED, ATTRIBUTE_VALUE_CREATED, ATTRIBUTE_VALUE_DELETED], syncEvents: []) """ - Trigger sending a notification with the notify plugin method. Serializes nodes provided as ids parameter and includes this data in the notification payload. + Creates/updates translations for an attribute. - Added in Saleor 3.1. + Requires one of the following permissions: MANAGE_TRANSLATIONS. """ - externalNotificationTrigger( - """ - Channel slug. Saleor will send a notification within a provided channel. Please, make sure that necessary plugins are active. - """ - channel: String! + attributeTranslate( + """Attribute ID or AttributeTranslatableContent ID.""" + id: ID! - """Input for External Notification Trigger.""" - input: ExternalNotificationTriggerInput! + """Fields required to update attribute translations.""" + input: NameTranslationInput! - """The ID of notification plugin.""" - pluginId: String - ): ExternalNotificationTrigger + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): AttributeTranslate @doc(category: "Attributes") """ - Creates a new sale. + Creates/updates translations for attributes. - Requires one of the following permissions: MANAGE_DISCOUNTS. + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_TRANSLATIONS. """ - saleCreate( - """Fields required to create a sale.""" - input: SaleInput! - ): SaleCreate @doc(category: "Discounts") + attributeBulkTranslate( + """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" + errorPolicy: ErrorPolicyEnum + + """List of attributes translations.""" + translations: [AttributeBulkTranslateInput!]! + ): AttributeBulkTranslate @doc(category: "Attributes") """ - Deletes a sale. + Deletes attributes. - Requires one of the following permissions: MANAGE_DISCOUNTS. + Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. + + Triggers the following webhook events: + - ATTRIBUTE_DELETED (async): An attribute was deleted. """ - saleDelete( - """ID of a sale to delete.""" - id: ID! - ): SaleDelete @doc(category: "Discounts") + attributeBulkDelete( + """List of attribute IDs to delete.""" + ids: [ID!]! + ): AttributeBulkDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_DELETED], syncEvents: []) """ - Deletes sales. + Deletes values of attributes. - Requires one of the following permissions: MANAGE_DISCOUNTS. + Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. + + Triggers the following webhook events: + - ATTRIBUTE_VALUE_DELETED (async): An attribute value was deleted. + - ATTRIBUTE_UPDATED (async): An attribute was updated. """ - saleBulkDelete( - """List of sale IDs to delete.""" + attributeValueBulkDelete( + """List of attribute value IDs to delete.""" ids: [ID!]! - ): SaleBulkDelete @doc(category: "Discounts") + ): AttributeValueBulkDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_DELETED, ATTRIBUTE_UPDATED], syncEvents: []) """ - Updates a sale. + Creates a value for an attribute. - Requires one of the following permissions: MANAGE_DISCOUNTS. + Requires one of the following permissions: MANAGE_PRODUCTS. + + Triggers the following webhook events: + - ATTRIBUTE_VALUE_CREATED (async): An attribute value was created. + - ATTRIBUTE_UPDATED (async): An attribute was updated. """ - saleUpdate( - """ID of a sale to update.""" - id: ID! + attributeValueCreate( + """Attribute to which value will be assigned.""" + attribute: ID! - """Fields required to update a sale.""" - input: SaleInput! - ): SaleUpdate @doc(category: "Discounts") + """Fields required to create an AttributeValue.""" + input: AttributeValueCreateInput! + ): AttributeValueCreate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_CREATED, ATTRIBUTE_UPDATED], syncEvents: []) """ - Adds products, categories, collections to a voucher. + Deletes a value of an attribute. - Requires one of the following permissions: MANAGE_DISCOUNTS. + Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + + Triggers the following webhook events: + - ATTRIBUTE_VALUE_DELETED (async): An attribute value was deleted. + - ATTRIBUTE_UPDATED (async): An attribute was updated. """ - saleCataloguesAdd( - """ID of a sale.""" - id: ID! + attributeValueDelete( + """ + External ID of a value to delete. + + Added in Saleor 3.10. + """ + externalReference: String - """Fields required to modify catalogue IDs of sale.""" - input: CatalogueInput! - ): SaleAddCatalogues @doc(category: "Discounts") + """ID of a value to delete.""" + id: ID + ): AttributeValueDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_DELETED, ATTRIBUTE_UPDATED], syncEvents: []) """ - Removes products, categories, collections from a sale. + Updates value of an attribute. - Requires one of the following permissions: MANAGE_DISCOUNTS. + Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + + Triggers the following webhook events: + - ATTRIBUTE_VALUE_UPDATED (async): An attribute value was updated. + - ATTRIBUTE_UPDATED (async): An attribute was updated. """ - saleCataloguesRemove( - """ID of a sale.""" - id: ID! + attributeValueUpdate( + """ + External ID of an AttributeValue to update. + + Added in Saleor 3.10. + """ + externalReference: String - """Fields required to modify catalogue IDs of sale.""" - input: CatalogueInput! - ): SaleRemoveCatalogues @doc(category: "Discounts") + """ID of an AttributeValue to update.""" + id: ID + + """Fields required to update an AttributeValue.""" + input: AttributeValueUpdateInput! + ): AttributeValueUpdate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_UPDATED, ATTRIBUTE_UPDATED], syncEvents: []) """ - Creates/updates translations for a sale. + Creates/updates translations for attributes values. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. Requires one of the following permissions: MANAGE_TRANSLATIONS. """ - saleTranslate( - """Sale ID or SaleTranslatableContent ID.""" - id: ID! - input: NameTranslationInput! + attributeValueBulkTranslate( + """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" + errorPolicy: ErrorPolicyEnum - """Translation language code.""" - languageCode: LanguageCodeEnum! - ): SaleTranslate @doc(category: "Discounts") + """List of attribute values translations.""" + translations: [AttributeValueBulkTranslateInput!]! + ): AttributeValueBulkTranslate @doc(category: "Attributes") """ - Manage sale's availability in channels. + Creates/updates translations for an attribute value. - Requires one of the following permissions: MANAGE_DISCOUNTS. + Requires one of the following permissions: MANAGE_TRANSLATIONS. """ - saleChannelListingUpdate( - """ID of a sale to update.""" + attributeValueTranslate( + """AttributeValue ID or AttributeValueTranslatableContent ID.""" id: ID! - """Fields required to update sale channel listings.""" - input: SaleChannelListingInput! - ): SaleChannelListingUpdate @doc(category: "Discounts") + """Fields required to update attribute value translations.""" + input: AttributeValueTranslationInput! - """ - Creates a new voucher. - - Requires one of the following permissions: MANAGE_DISCOUNTS. - """ - voucherCreate( - """Fields required to create a voucher.""" - input: VoucherInput! - ): VoucherCreate @doc(category: "Discounts") + """Translation language code.""" + languageCode: LanguageCodeEnum! + ): AttributeValueTranslate @doc(category: "Attributes") """ - Deletes a voucher. + Reorder the values of an attribute. - Requires one of the following permissions: MANAGE_DISCOUNTS. + Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + + Triggers the following webhook events: + - ATTRIBUTE_VALUE_UPDATED (async): An attribute value was updated. + - ATTRIBUTE_UPDATED (async): An attribute was updated. """ - voucherDelete( - """ID of a voucher to delete.""" - id: ID! - ): VoucherDelete @doc(category: "Discounts") + attributeReorderValues( + """ID of an attribute.""" + attributeId: ID! + + """The list of reordering operations for given attribute values.""" + moves: [ReorderInput!]! + ): AttributeReorderValues @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_UPDATED, ATTRIBUTE_UPDATED], syncEvents: []) """ - Deletes vouchers. + Creates a new app. Requires the following permissions: AUTHENTICATED_STAFF_USER and MANAGE_APPS. - Requires one of the following permissions: MANAGE_DISCOUNTS. + Triggers the following webhook events: + - APP_INSTALLED (async): An app was installed. """ - voucherBulkDelete( - """List of voucher IDs to delete.""" - ids: [ID!]! - ): VoucherBulkDelete @doc(category: "Discounts") + appCreate( + """Fields required to create a new app.""" + input: AppInput! + ): AppCreate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_INSTALLED], syncEvents: []) """ - Updates a voucher. + Updates an existing app. - Requires one of the following permissions: MANAGE_DISCOUNTS. + Requires one of the following permissions: MANAGE_APPS. + + Triggers the following webhook events: + - APP_UPDATED (async): An app was updated. """ - voucherUpdate( - """ID of a voucher to update.""" + appUpdate( + """ID of an app to update.""" id: ID! - """Fields required to update a voucher.""" - input: VoucherInput! - ): VoucherUpdate @doc(category: "Discounts") + """Fields required to update an existing app.""" + input: AppInput! + ): AppUpdate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_UPDATED], syncEvents: []) """ - Adds products, categories, collections to a voucher. + Deletes an app. - Requires one of the following permissions: MANAGE_DISCOUNTS. + Requires one of the following permissions: MANAGE_APPS. + + Triggers the following webhook events: + - APP_DELETED (async): An app was deleted. """ - voucherCataloguesAdd( - """ID of a voucher.""" + appDelete( + """ID of an app to delete.""" id: ID! + ): AppDelete @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_DELETED], syncEvents: []) - """Fields required to modify catalogue IDs of voucher.""" - input: CatalogueInput! - ): VoucherAddCatalogues @doc(category: "Discounts") + """ + Creates a new token. + + Requires one of the following permissions: MANAGE_APPS. + """ + appTokenCreate( + """Fields required to create a new auth token.""" + input: AppTokenInput! + ): AppTokenCreate @doc(category: "Apps") """ - Removes products, categories, collections from a voucher. + Deletes an authentication token assigned to app. - Requires one of the following permissions: MANAGE_DISCOUNTS. + Requires one of the following permissions: MANAGE_APPS. """ - voucherCataloguesRemove( - """ID of a voucher.""" + appTokenDelete( + """ID of an auth token to delete.""" id: ID! + ): AppTokenDelete @doc(category: "Apps") - """Fields required to modify catalogue IDs of voucher.""" - input: CatalogueInput! - ): VoucherRemoveCatalogues @doc(category: "Discounts") + """Verify provided app token.""" + appTokenVerify( + """App token to verify.""" + token: String! + ): AppTokenVerify @doc(category: "Apps") """ - Creates/updates translations for a voucher. + Install new app by using app manifest. Requires the following permissions: AUTHENTICATED_STAFF_USER and MANAGE_APPS. + """ + appInstall( + """Fields required to install a new app.""" + input: AppInstallInput! + ): AppInstall @doc(category: "Apps") + + """ + Retry failed installation of new app. - Requires one of the following permissions: MANAGE_TRANSLATIONS. + Requires one of the following permissions: MANAGE_APPS. + + Triggers the following webhook events: + - APP_INSTALLED (async): An app was installed. """ - voucherTranslate( - """Voucher ID or VoucherTranslatableContent ID.""" - id: ID! - input: NameTranslationInput! + appRetryInstall( + """Determine if app will be set active or not.""" + activateAfterInstallation: Boolean = true - """Translation language code.""" - languageCode: LanguageCodeEnum! - ): VoucherTranslate @doc(category: "Discounts") + """ID of failed installation.""" + id: ID! + ): AppRetryInstall @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_INSTALLED], syncEvents: []) """ - Manage voucher's availability in channels. + Delete failed installation. - Requires one of the following permissions: MANAGE_DISCOUNTS. + Requires one of the following permissions: MANAGE_APPS. """ - voucherChannelListingUpdate( - """ID of a voucher to update.""" + appDeleteFailedInstallation( + """ID of failed installation to delete.""" id: ID! - - """Fields required to update voucher channel listings.""" - input: VoucherChannelListingInput! - ): VoucherChannelListingUpdate @doc(category: "Discounts") + ): AppDeleteFailedInstallation @doc(category: "Apps") """ - Export products to csv file. + Fetch and validate manifest. - Requires one of the following permissions: MANAGE_PRODUCTS. + Requires one of the following permissions: MANAGE_APPS. """ - exportProducts( - """Fields required to export product data.""" - input: ExportProductsInput! - ): ExportProducts @doc(category: "Products") + appFetchManifest( + """URL to app's manifest in JSON format.""" + manifestUrl: String! + ): AppFetchManifest @doc(category: "Apps") """ - Export gift cards to csv file. + Activate the app. - Added in Saleor 3.1. + Requires one of the following permissions: MANAGE_APPS. - Requires one of the following permissions: MANAGE_GIFT_CARD. + Triggers the following webhook events: + - APP_STATUS_CHANGED (async): An app was activated. """ - exportGiftCards( - """Fields required to export gift cards data.""" - input: ExportGiftCardsInput! - ): ExportGiftCards @doc(category: "Gift cards") + appActivate( + """ID of app to activate.""" + id: ID! + ): AppActivate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_STATUS_CHANGED], syncEvents: []) """ - Upload a file. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec + Deactivate the app. - Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_STAFF_USER. + Requires one of the following permissions: MANAGE_APPS. + + Triggers the following webhook events: + - APP_STATUS_CHANGED (async): An app was deactivated. """ - fileUpload( - """Represents a file in a multipart request.""" - file: Upload! - ): FileUpload + appDeactivate( + """ID of app to deactivate.""" + id: ID! + ): AppDeactivate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_STATUS_CHANGED], syncEvents: []) - """Adds a gift card or a voucher to a checkout.""" - checkoutAddPromoCode( + """Create JWT token.""" + tokenCreate( """ - The ID of the checkout. + The audience that will be included to JWT tokens with prefix `custom:`. - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + Added in Saleor 3.8. """ - checkoutId: ID + audience: String - """ - The checkout's ID. - - Added in Saleor 3.4. - """ - id: ID + """Email of a user.""" + email: String! - """Gift card code or voucher code.""" - promoCode: String! + """Password of a user.""" + password: String! + ): CreateToken @doc(category: "Authentication") + """ + Refresh JWT token. Mutation tries to take refreshToken from the input. If it fails it will try to take `refreshToken` from the http-only cookie `refreshToken`. `csrfToken` is required when `refreshToken` is provided as a cookie. + """ + tokenRefresh( """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + CSRF token required to refresh token. This argument is required when `refreshToken` is provided as a cookie. """ - token: UUID - ): CheckoutAddPromoCode @doc(category: "Checkout") + csrfToken: String - """Update billing address in the existing checkout.""" - checkoutBillingAddressUpdate( - """The billing address of the checkout.""" - billingAddress: AddressInput! + """Refresh token.""" + refreshToken: String + ): RefreshToken @doc(category: "Authentication") - """ - The ID of the checkout. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - checkoutId: ID + """Verify JWT token.""" + tokenVerify( + """JWT token to validate.""" + token: String! + ): VerifyToken @doc(category: "Authentication") - """ - The checkout's ID. - - Added in Saleor 3.4. - """ - id: ID + """ + Deactivate all JWT tokens of the currently authenticated user. + + Requires one of the following permissions: AUTHENTICATED_USER. + """ + tokensDeactivateAll: DeactivateAllUserTokens @doc(category: "Authentication") - """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - token: UUID + """Prepare external authentication URL for user by custom plugin.""" + externalAuthenticationUrl( + """The data required by plugin to create external authentication url.""" + input: JSONString! - """ - The rules for changing validation for received billing address data. - - Added in Saleor 3.5. - """ - validationRules: CheckoutAddressValidationRules - ): CheckoutBillingAddressUpdate @doc(category: "Checkout") + """The ID of the authentication plugin.""" + pluginId: String! + ): ExternalAuthenticationUrl @doc(category: "Authentication") - """ - Completes the checkout. As a result a new order is created and a payment charge is made. This action requires a successful payment before it can be performed. In case additional confirmation step as 3D secure is required confirmationNeeded flag will be set to True and no order created until payment is confirmed with second call of this mutation. - """ - checkoutComplete( - """ - The ID of the checkout. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - checkoutId: ID + """Obtain external access tokens for user by custom plugin.""" + externalObtainAccessTokens( + """The data required by plugin to create authentication data.""" + input: JSONString! - """ - The checkout's ID. - - Added in Saleor 3.4. - """ - id: ID + """The ID of the authentication plugin.""" + pluginId: String! + ): ExternalObtainAccessTokens @doc(category: "Authentication") - """ - Fields required to update the checkout metadata. - - Added in Saleor 3.8. - """ - metadata: [MetadataInput!] + """Refresh user's access by custom plugin.""" + externalRefresh( + """The data required by plugin to proceed the refresh process.""" + input: JSONString! - """Client-side generated data required to finalize the payment.""" - paymentData: JSONString + """The ID of the authentication plugin.""" + pluginId: String! + ): ExternalRefresh @doc(category: "Authentication") - """ - URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. - """ - redirectUrl: String + """Logout user by custom plugin.""" + externalLogout( + """The data required by plugin to proceed the logout process.""" + input: JSONString! - """ - Determines whether to store the payment source for future usage. - - DEPRECATED: this field will be removed in Saleor 4.0. Use checkoutPaymentCreate for this action. - """ - storeSource: Boolean = false + """The ID of the authentication plugin.""" + pluginId: String! + ): ExternalLogout @doc(category: "Authentication") - """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - token: UUID - ): CheckoutComplete @doc(category: "Checkout") + """Verify external authentication data by plugin.""" + externalVerify( + """The data required by plugin to proceed the verification.""" + input: JSONString! - """Create a new checkout.""" - checkoutCreate( - """Fields required to create checkout.""" - input: CheckoutCreateInput! - ): CheckoutCreate @doc(category: "Checkout") + """The ID of the authentication plugin.""" + pluginId: String! + ): ExternalVerify @doc(category: "Authentication") """ - Sets the customer as the owner of the checkout. + Sends an email with the account password modification link. - Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER. + Triggers the following webhook events: + - NOTIFY_USER (async): A notification for password reset. + - ACCOUNT_SET_PASSWORD_REQUESTED (async): Setting a new password for the account is requested. + - STAFF_SET_PASSWORD_REQUESTED (async): Setting a new password for the staff account is requested. """ - checkoutCustomerAttach( - """ - The ID of the checkout. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - checkoutId: ID - + requestPasswordReset( """ - ID of customer to attach to checkout. Requires IMPERSONATE_USER permission when customerId is different than the logged-in user. + Slug of a channel which will be used for notify user. Optional when only one channel exists. """ - customerId: ID + channel: String - """ - The checkout's ID. - - Added in Saleor 3.4. - """ - id: ID + """Email of the user that will be used for password recovery.""" + email: String! """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + URL of a view where users should be redirected to reset the password. URL in RFC 1808 format. """ - token: UUID - ): CheckoutCustomerAttach @doc(category: "Checkout") + redirectUrl: String! + ): RequestPasswordReset @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER, ACCOUNT_SET_PASSWORD_REQUESTED, STAFF_SET_PASSWORD_REQUESTED], syncEvents: []) """ - Removes the user assigned as the owner of the checkout. + Sends a notification confirmation. - Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER. + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: AUTHENTICATED_USER. + + Triggers the following webhook events: + - NOTIFY_USER (async): A notification for account confirmation. + - ACCOUNT_CONFIRMATION_REQUESTED (async): An account confirmation was requested. This event is always sent regardless of settings. """ - checkoutCustomerDetach( - """ - The ID of the checkout. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - checkoutId: ID - - """ - The checkout's ID. - - Added in Saleor 3.4. - """ - id: ID - - """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - token: UUID - ): CheckoutCustomerDetach @doc(category: "Checkout") + sendConfirmationEmail( + """Slug of a channel which will be used for notify user.""" + channel: String! - """Updates email address in the existing checkout object.""" - checkoutEmailUpdate( - """ - The ID of the checkout. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - checkoutId: ID + """Base of frontend URL that will be needed to create confirmation URL.""" + redirectUrl: String! + ): SendConfirmationEmail @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER, ACCOUNT_CONFIRMATION_REQUESTED], syncEvents: []) - """email.""" + """ + Confirm user account with token sent by email during registration. + + Triggers the following webhook events: + - ACCOUNT_CONFIRMED (async): Account was confirmed. + """ + confirmAccount( + """E-mail of the user performing account confirmation.""" email: String! - """ - The checkout's ID. - - Added in Saleor 3.4. - """ - id: ID - - """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - token: UUID - ): CheckoutEmailUpdate @doc(category: "Checkout") - - """Deletes a CheckoutLine.""" - checkoutLineDelete( - """ - The ID of the checkout. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - checkoutId: ID - - """ - The checkout's ID. - - Added in Saleor 3.4. - """ - id: ID + """A one-time token required to confirm the account.""" + token: String! + ): ConfirmAccount @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ACCOUNT_CONFIRMED], syncEvents: []) - """ID of the checkout line to delete.""" - lineId: ID + """ + Sets the user's password from the token sent by email using the RequestPasswordReset mutation. + """ + setPassword( + """Email of a user.""" + email: String! - """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - token: UUID - ): CheckoutLineDelete @doc(category: "Checkout") @deprecated(reason: "This field will be removed in Saleor 4.0. Use `checkoutLinesDelete` instead.") + """Password of a user.""" + password: String! - """Deletes checkout lines.""" - checkoutLinesDelete( - """ - The checkout's ID. - - Added in Saleor 3.4. - """ - id: ID + """A one-time token required to set the password.""" + token: String! + ): SetPassword @doc(category: "Users") - """A list of checkout lines.""" - linesIds: [ID!]! + """ + Change the password of the logged in user. + + Requires one of the following permissions: AUTHENTICATED_USER. + """ + passwordChange( + """New user password.""" + newPassword: String! - """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - token: UUID - ): CheckoutLinesDelete @doc(category: "Checkout") + """Current user password.""" + oldPassword: String + ): PasswordChange @doc(category: "Users") """ - Adds a checkout line to the existing checkout.If line was already in checkout, its quantity will be increased. + Request email change of the logged in user. + + Requires one of the following permissions: AUTHENTICATED_USER. + + Triggers the following webhook events: + - NOTIFY_USER (async): A notification for account email change. + - ACCOUNT_CHANGE_EMAIL_REQUESTED (async): An account email change was requested. """ - checkoutLinesAdd( - """ - The ID of the checkout. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - checkoutId: ID - + requestEmailChange( """ - The checkout's ID. - - Added in Saleor 3.4. + Slug of a channel which will be used to notify users. Optional when only one channel exists. """ - id: ID + channel: String - """ - A list of checkout lines, each containing information about an item in the checkout. - """ - lines: [CheckoutLineInput!]! + """New user email.""" + newEmail: String! - """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - token: UUID - ): CheckoutLinesAdd @doc(category: "Checkout") + """User password.""" + password: String! - """Updates checkout line in the existing checkout.""" - checkoutLinesUpdate( """ - The ID of the checkout. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + URL of a view where users should be redirected to update the email address. URL in RFC 1808 format. """ - checkoutId: ID + redirectUrl: String! + ): RequestEmailChange @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER, ACCOUNT_CHANGE_EMAIL_REQUESTED], syncEvents: []) + """ + Confirm the email change of the logged-in user. + + Requires one of the following permissions: AUTHENTICATED_USER. + + Triggers the following webhook events: + - CUSTOMER_UPDATED (async): A customer account was updated. + - NOTIFY_USER (async): A notification that account email change was confirmed. + - ACCOUNT_EMAIL_CHANGED (async): An account email was changed. + """ + confirmEmailChange( """ - The checkout's ID. - - Added in Saleor 3.4. + Slug of a channel which will be used to notify users. Optional when only one channel exists. """ - id: ID + channel: String - """ - A list of checkout lines, each containing information about an item in the checkout. - """ - lines: [CheckoutLineUpdateInput!]! + """A one-time token required to change the email.""" + token: String! + ): ConfirmEmailChange @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, NOTIFY_USER, ACCOUNT_EMAIL_CHANGED], syncEvents: []) - """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - token: UUID - ): CheckoutLinesUpdate @doc(category: "Checkout") + """ + Create a new address for the customer. + + Requires one of the following permissions: AUTHENTICATED_USER. + + Triggers the following webhook events: + - CUSTOMER_UPDATED (async): A customer account was updated. + - ADDRESS_CREATED (async): An address was created. + """ + accountAddressCreate( + """Fields required to create address.""" + input: AddressInput! - """Remove a gift card or a voucher from a checkout.""" - checkoutRemovePromoCode( """ - The ID of the checkout. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + A type of address. If provided, the new address will be automatically assigned as the customer's default address of that type. """ - checkoutId: ID + type: AddressTypeEnum + ): AccountAddressCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, ADDRESS_CREATED], syncEvents: []) - """ - The checkout's ID. - - Added in Saleor 3.4. - """ - id: ID + """ + Updates an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER. + + Triggers the following webhook events: + - ADDRESS_UPDATED (async): An address was updated. + """ + accountAddressUpdate( + """ID of the address to update.""" + id: ID! - """Gift card code or voucher code.""" - promoCode: String + """Fields required to update the address.""" + input: AddressInput! + ): AccountAddressUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_UPDATED], syncEvents: []) - """Gift card or voucher ID.""" - promoCodeId: ID + """ + Delete an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER. + + Triggers the following webhook events: + - ADDRESS_DELETED (async): An address was deleted. + """ + accountAddressDelete( + """ID of the address to delete.""" + id: ID! + ): AccountAddressDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_DELETED], syncEvents: []) - """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - token: UUID - ): CheckoutRemovePromoCode @doc(category: "Checkout") + """ + Sets a default address for the authenticated user. + + Requires one of the following permissions: AUTHENTICATED_USER. + + Triggers the following webhook events: + - CUSTOMER_UPDATED (async): A customer's address was updated. + """ + accountSetDefaultAddress( + """ID of the address to set as default.""" + id: ID! - """Create a new payment for given checkout.""" - checkoutPaymentCreate( - """ - The ID of the checkout. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - checkoutId: ID + """The type of address.""" + type: AddressTypeEnum! + ): AccountSetDefaultAddress @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED], syncEvents: []) - """ - The checkout's ID. - - Added in Saleor 3.4. - """ - id: ID + """ + Register a new user. + + Triggers the following webhook events: + - CUSTOMER_CREATED (async): A new customer account was created. + - NOTIFY_USER (async): A notification for account confirmation. + - ACCOUNT_CONFIRMATION_REQUESTED (async): An user confirmation was requested. This event is always sent regardless of settings. + """ + accountRegister( + """Fields required to create a user.""" + input: AccountRegisterInput! + ): AccountRegister @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_CREATED, NOTIFY_USER, ACCOUNT_CONFIRMATION_REQUESTED], syncEvents: []) - """Data required to create a new payment.""" - input: PaymentInput! + """ + Updates the account of the logged-in user. + + Requires one of the following permissions: AUTHENTICATED_USER. + + Triggers the following webhook events: + - CUSTOMER_UPDATED (async): A customer account was updated. + - CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated. + """ + accountUpdate( + """Fields required to update the account of the logged-in user.""" + input: AccountInput! + ): AccountUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, CUSTOMER_METADATA_UPDATED], syncEvents: []) + """ + Sends an email with the account removal link for the logged-in user. + + Requires one of the following permissions: AUTHENTICATED_USER. + + Triggers the following webhook events: + - NOTIFY_USER (async): A notification for account delete request. + - ACCOUNT_DELETE_REQUESTED (async): An account delete requested. + """ + accountRequestDeletion( """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + Slug of a channel which will be used to notify users. Optional when only one channel exists. """ - token: UUID - ): CheckoutPaymentCreate @doc(category: "Checkout") + channel: String - """Update shipping address in the existing checkout.""" - checkoutShippingAddressUpdate( """ - The ID of the checkout. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + URL of a view where users should be redirected to delete their account. URL in RFC 1808 format. """ - checkoutId: ID + redirectUrl: String! + ): AccountRequestDeletion @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER, ACCOUNT_DELETE_REQUESTED], syncEvents: []) + """ + Remove user account. + + Requires one of the following permissions: AUTHENTICATED_USER. + + Triggers the following webhook events: + - ACCOUNT_DELETED (async): Account was deleted. + """ + accountDelete( """ - The checkout's ID. - - Added in Saleor 3.4. + A one-time token required to remove account. Sent by email using AccountRequestDeletion mutation. """ - id: ID + token: String! + ): AccountDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ACCOUNT_DELETED], syncEvents: []) - """The mailing address to where the checkout will be shipped.""" - shippingAddress: AddressInput! + """ + Creates user address. + + Requires one of the following permissions: MANAGE_USERS. + + Triggers the following webhook events: + - ADDRESS_CREATED (async): A new address was created. + """ + addressCreate( + """Fields required to create address.""" + input: AddressInput! - """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - token: UUID + """ID of a user to create address for.""" + userId: ID! + ): AddressCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_CREATED], syncEvents: []) - """ - The rules for changing validation for received shipping address data. - - Added in Saleor 3.5. - """ - validationRules: CheckoutAddressValidationRules - ): CheckoutShippingAddressUpdate @doc(category: "Checkout") + """ + Updates an address. + + Requires one of the following permissions: MANAGE_USERS. + + Triggers the following webhook events: + - ADDRESS_UPDATED (async): An address was updated. + """ + addressUpdate( + """ID of the address to update.""" + id: ID! - """Updates the shipping method of the checkout.""" - checkoutShippingMethodUpdate( - """ - The ID of the checkout. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - checkoutId: ID + """Fields required to update the address.""" + input: AddressInput! + ): AddressUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_UPDATED], syncEvents: []) - """ - The checkout's ID. - - Added in Saleor 3.4. - """ - id: ID + """ + Deletes an address. + + Requires one of the following permissions: MANAGE_USERS. + + Triggers the following webhook events: + - ADDRESS_DELETED (async): An address was deleted. + """ + addressDelete( + """ID of the address to delete.""" + id: ID! + ): AddressDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_DELETED], syncEvents: []) - """Shipping method.""" - shippingMethodId: ID! + """ + Sets a default address for the given user. + + Requires one of the following permissions: MANAGE_USERS. + + Triggers the following webhook events: + - CUSTOMER_UPDATED (async): A customer was updated. + """ + addressSetDefault( + """ID of the address.""" + addressId: ID! - """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - token: UUID - ): CheckoutShippingMethodUpdate @doc(category: "Checkout") @deprecated(reason: "This field will be removed in Saleor 4.0. Use `checkoutDeliveryMethodUpdate` instead.") + """The type of address.""" + type: AddressTypeEnum! + + """ID of the user to change the address for.""" + userId: ID! + ): AddressSetDefault @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED], syncEvents: []) """ - Updates the delivery method (shipping method or pick up point) of the checkout. + Creates a new customer. - Added in Saleor 3.1. + Requires one of the following permissions: MANAGE_USERS. + + Triggers the following webhook events: + - CUSTOMER_CREATED (async): A new customer account was created. + - CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated. + - NOTIFY_USER (async): A notification for setting the password. + - ACCOUNT_SET_PASSWORD_REQUESTED (async): Setting a new password for the account is requested. """ - checkoutDeliveryMethodUpdate( - """Delivery Method ID (`Warehouse` ID or `ShippingMethod` ID).""" - deliveryMethodId: ID + customerCreate( + """Fields required to create a customer.""" + input: UserCreateInput! + ): CustomerCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_CREATED, CUSTOMER_METADATA_UPDATED, NOTIFY_USER, ACCOUNT_SET_PASSWORD_REQUESTED], syncEvents: []) + """ + Updates an existing customer. + + Requires one of the following permissions: MANAGE_USERS. + + Triggers the following webhook events: + - CUSTOMER_UPDATED (async): A new customer account was updated. + - CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated. + """ + customerUpdate( """ - The checkout's ID. + External ID of a customer to update. - Added in Saleor 3.4. + Added in Saleor 3.10. """ + externalReference: String + + """ID of a customer to update.""" id: ID - """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - token: UUID - ): CheckoutDeliveryMethodUpdate @doc(category: "Checkout") + """Fields required to update a customer.""" + input: CustomerInput! + ): CustomerUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, CUSTOMER_METADATA_UPDATED], syncEvents: []) - """Update language code in the existing checkout.""" - checkoutLanguageCodeUpdate( + """ + Deletes a customer. + + Requires one of the following permissions: MANAGE_USERS. + + Triggers the following webhook events: + - CUSTOMER_DELETED (async): A customer account was deleted. + """ + customerDelete( """ - The ID of the checkout. + External ID of a customer to update. - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. + Added in Saleor 3.10. """ - checkoutId: ID + externalReference: String - """ - The checkout's ID. - - Added in Saleor 3.4. - """ + """ID of a customer to delete.""" id: ID + ): CustomerDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_DELETED], syncEvents: []) - """New language code.""" - languageCode: LanguageCodeEnum! + """ + Deletes customers. + + Requires one of the following permissions: MANAGE_USERS. + + Triggers the following webhook events: + - CUSTOMER_DELETED (async): A customer account was deleted. + """ + customerBulkDelete( + """List of user IDs to delete.""" + ids: [ID!]! + ): CustomerBulkDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_DELETED], syncEvents: []) + + """ + Updates customers. + + Added in Saleor 3.13. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_USERS. + + Triggers the following webhook events: + - CUSTOMER_UPDATED (async): A customer account was updated. + - CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated. + """ + customerBulkUpdate( + """Input list of customers to update.""" + customers: [CustomerBulkUpdateInput!]! + + """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" + errorPolicy: ErrorPolicyEnum + ): CustomerBulkUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, CUSTOMER_METADATA_UPDATED], syncEvents: []) - """ - Checkout token. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead. - """ - token: UUID - ): CheckoutLanguageCodeUpdate @doc(category: "Checkout") + """ + Creates a new staff user. Apps are not allowed to perform this mutation. + + Requires one of the following permissions: MANAGE_STAFF. + + Triggers the following webhook events: + - STAFF_CREATED (async): A new staff account was created. + - NOTIFY_USER (async): A notification for setting the password. + - STAFF_SET_PASSWORD_REQUESTED (async): Setting a new password for the staff account is requested. + """ + staffCreate( + """Fields required to create a staff user.""" + input: StaffCreateInput! + ): StaffCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_CREATED, NOTIFY_USER, STAFF_SET_PASSWORD_REQUESTED], syncEvents: []) """ - Create new order from existing checkout. Requires the following permissions: AUTHENTICATED_APP and HANDLE_CHECKOUTS. + Updates an existing staff user. Apps are not allowed to perform this mutation. - Added in Saleor 3.2. + Requires one of the following permissions: MANAGE_STAFF. + + Triggers the following webhook events: + - STAFF_UPDATED (async): A staff account was updated. """ - orderCreateFromCheckout( - """ID of a checkout that will be converted to an order.""" + staffUpdate( + """ID of a staff user to update.""" id: ID! - """ - Fields required to update the checkout metadata. - - Added in Saleor 3.8. - """ - metadata: [MetadataInput!] - - """ - Fields required to update the checkout private metadata. - - Added in Saleor 3.8. - """ - privateMetadata: [MetadataInput!] + """Fields required to update a staff user.""" + input: StaffUpdateInput! + ): StaffUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_UPDATED], syncEvents: []) - """ - Determines if checkout should be removed after creating an order. Default true. - """ - removeCheckout: Boolean = true - ): OrderCreateFromCheckout @doc(category: "Checkout") + """ + Deletes a staff user. Apps are not allowed to perform this mutation. + + Requires one of the following permissions: MANAGE_STAFF. + + Triggers the following webhook events: + - STAFF_DELETED (async): A staff account was deleted. + """ + staffDelete( + """ID of a staff user to delete.""" + id: ID! + ): StaffDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_DELETED], syncEvents: []) """ - Creates new channel. + Deletes staff users. Apps are not allowed to perform this mutation. - Requires one of the following permissions: MANAGE_CHANNELS. + Requires one of the following permissions: MANAGE_STAFF. + + Triggers the following webhook events: + - STAFF_DELETED (async): A staff account was deleted. """ - channelCreate( - """Fields required to create channel.""" - input: ChannelCreateInput! - ): ChannelCreate @doc(category: "Channels") + staffBulkDelete( + """List of user IDs to delete.""" + ids: [ID!]! + ): StaffBulkDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_DELETED], syncEvents: []) """ - Update a channel. + Create a user avatar. Only for staff members. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec - Requires one of the following permissions: MANAGE_CHANNELS. - Requires one of the following permissions when updating only orderSettings field: MANAGE_CHANNELS, MANAGE_ORDERS. + Requires one of the following permissions: AUTHENTICATED_STAFF_USER. """ - channelUpdate( - """ID of a channel to update.""" - id: ID! + userAvatarUpdate( + """Represents an image file in a multipart request.""" + image: Upload! + ): UserAvatarUpdate @doc(category: "Users") - """Fields required to update a channel.""" - input: ChannelUpdateInput! - ): ChannelUpdate @doc(category: "Channels") + """ + Deletes a user avatar. Only for staff members. + + Requires one of the following permissions: AUTHENTICATED_STAFF_USER. + """ + userAvatarDelete: UserAvatarDelete @doc(category: "Users") """ - Delete a channel. Orders associated with the deleted channel will be moved to the target channel. Checkouts, product availability, and pricing will be removed. + Activate or deactivate users. - Requires one of the following permissions: MANAGE_CHANNELS. + Requires one of the following permissions: MANAGE_USERS. """ - channelDelete( - """ID of a channel to delete.""" - id: ID! + userBulkSetActive( + """List of user IDs to activate/deactivate.""" + ids: [ID!]! - """Fields required to delete a channel.""" - input: ChannelDeleteInput - ): ChannelDelete @doc(category: "Channels") + """Determine if users will be set active or not.""" + isActive: Boolean! + ): UserBulkSetActive @doc(category: "Users") """ - Activate a channel. + Create new permission group. Apps are not allowed to perform this mutation. - Requires one of the following permissions: MANAGE_CHANNELS. + Requires one of the following permissions: MANAGE_STAFF. + + Triggers the following webhook events: + - PERMISSION_GROUP_CREATED (async) """ - channelActivate( - """ID of the channel to activate.""" - id: ID! - ): ChannelActivate @doc(category: "Channels") + permissionGroupCreate( + """Input fields to create permission group.""" + input: PermissionGroupCreateInput! + ): PermissionGroupCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [PERMISSION_GROUP_CREATED], syncEvents: []) """ - Deactivate a channel. + Update permission group. Apps are not allowed to perform this mutation. - Requires one of the following permissions: MANAGE_CHANNELS. + Requires one of the following permissions: MANAGE_STAFF. + + Triggers the following webhook events: + - PERMISSION_GROUP_UPDATED (async) """ - channelDeactivate( - """ID of the channel to deactivate.""" + permissionGroupUpdate( + """ID of the group to update.""" id: ID! - ): ChannelDeactivate @doc(category: "Channels") + + """Input fields to create permission group.""" + input: PermissionGroupUpdateInput! + ): PermissionGroupUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [PERMISSION_GROUP_UPDATED], syncEvents: []) """ - Reorder the warehouses of a channel. + Delete permission group. Apps are not allowed to perform this mutation. - Added in Saleor 3.7. + Requires one of the following permissions: MANAGE_STAFF. - Requires one of the following permissions: MANAGE_CHANNELS. + Triggers the following webhook events: + - PERMISSION_GROUP_DELETED (async) """ - channelReorderWarehouses( - """ID of a channel.""" - channelId: ID! + permissionGroupDelete( + """ID of the group to delete.""" + id: ID! + ): PermissionGroupDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [PERMISSION_GROUP_DELETED], syncEvents: []) +} - """The list of reordering operations for the given channel warehouses.""" - moves: [ReorderInput!]! - ): ChannelReorderWarehouses @doc(category: "Channels") +""" +Creates a new webhook subscription. - """Creates an attribute.""" - attributeCreate( - """Fields required to create an attribute.""" - input: AttributeCreateInput! - ): AttributeCreate @doc(category: "Attributes") +Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. +""" +type WebhookCreate @doc(category: "Webhooks") { + webhookErrors: [WebhookError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [WebhookError!]! + webhook: Webhook +} +type WebhookError @doc(category: "Webhooks") { """ - Deletes an attribute. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """The error message.""" + message: String + + """The error code.""" + code: WebhookErrorCode! +} + +"""An enumeration.""" +enum WebhookErrorCode @doc(category: "Webhooks") { + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE + DELETE_FAILED + SYNTAX + MISSING_SUBSCRIPTION + UNABLE_TO_PARSE + MISSING_EVENT + INVALID_CUSTOM_HEADERS + INVALID_NOTIFY_WITH_SUBSCRIPTION +} + +input WebhookCreateInput @doc(category: "Webhooks") { + """The name of the webhook.""" + name: String + + """The url to receive the payload.""" + targetUrl: String + + """ + The events that webhook wants to subscribe. - Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + DEPRECATED: this field will be removed in Saleor 4.0. Use `asyncEvents` or `syncEvents` instead. """ - attributeDelete( - """ - External ID of an attribute to delete. - - Added in Saleor 3.10. - """ - externalReference: String + events: [WebhookEventTypeEnum!] - """ID of an attribute to delete.""" - id: ID - ): AttributeDelete @doc(category: "Attributes") + """The asynchronous events that webhook wants to subscribe.""" + asyncEvents: [WebhookEventTypeAsyncEnum!] + + """The synchronous events that webhook wants to subscribe.""" + syncEvents: [WebhookEventTypeSyncEnum!] + + """ID of the app to which webhook belongs.""" + app: ID + + """Determine if webhook will be set active or not.""" + isActive: Boolean """ - Updates attribute. + The secret key used to create a hash signature with each payload. - Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + DEPRECATED: this field will be removed in Saleor 4.0. As of Saleor 3.5, webhook payloads default to signing using a verifiable JWS. """ - attributeUpdate( - """ - External ID of an attribute to update. - - Added in Saleor 3.10. - """ - externalReference: String + secretKey: String + + """ + Subscription query used to define a webhook payload. + + Added in Saleor 3.2. + """ + query: String + + """ + Custom headers, which will be added to HTTP request. There is a limitation of 5 headers per webhook and 998 characters per header.Only "X-*" and "Authorization*" keys are allowed. + + Added in Saleor 3.12. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + customHeaders: JSONString +} + +""" +Delete a webhook. Before the deletion, the webhook is deactivated to pause any deliveries that are already scheduled. The deletion might fail if delivery is in progress. In such a case, the webhook is not deleted but remains deactivated. + +Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. +""" +type WebhookDelete @doc(category: "Webhooks") { + webhookErrors: [WebhookError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [WebhookError!]! + webhook: Webhook +} + +""" +Updates a webhook subscription. + +Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. +""" +type WebhookUpdate @doc(category: "Webhooks") { + webhookErrors: [WebhookError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [WebhookError!]! + webhook: Webhook +} - """ID of an attribute to update.""" - id: ID +input WebhookUpdateInput @doc(category: "Webhooks") { + """The new name of the webhook.""" + name: String - """Fields required to update an attribute.""" - input: AttributeUpdateInput! - ): AttributeUpdate @doc(category: "Attributes") + """The url to receive the payload.""" + targetUrl: String """ - Creates/updates translations for an attribute. + The events that webhook wants to subscribe. - Requires one of the following permissions: MANAGE_TRANSLATIONS. + DEPRECATED: this field will be removed in Saleor 4.0. Use `asyncEvents` or `syncEvents` instead. """ - attributeTranslate( - """Attribute ID or AttributeTranslatableContent ID.""" - id: ID! - input: NameTranslationInput! + events: [WebhookEventTypeEnum!] - """Translation language code.""" - languageCode: LanguageCodeEnum! - ): AttributeTranslate @doc(category: "Attributes") + """The asynchronous events that webhook wants to subscribe.""" + asyncEvents: [WebhookEventTypeAsyncEnum!] + + """The synchronous events that webhook wants to subscribe.""" + syncEvents: [WebhookEventTypeSyncEnum!] + + """ID of the app to which webhook belongs.""" + app: ID + + """Determine if webhook will be set active or not.""" + isActive: Boolean """ - Deletes attributes. + Use to create a hash signature with each payload. - Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. + DEPRECATED: this field will be removed in Saleor 4.0. As of Saleor 3.5, webhook payloads default to signing using a verifiable JWS. """ - attributeBulkDelete( - """List of attribute IDs to delete.""" - ids: [ID!]! - ): AttributeBulkDelete @doc(category: "Attributes") + secretKey: String """ - Deletes values of attributes. + Subscription query used to define a webhook payload. - Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. + Added in Saleor 3.2. """ - attributeValueBulkDelete( - """List of attribute value IDs to delete.""" - ids: [ID!]! - ): AttributeValueBulkDelete @doc(category: "Attributes") + query: String """ - Creates a value for an attribute. + Custom headers, which will be added to HTTP request. There is a limitation of 5 headers per webhook and 998 characters per header.Only "X-*" and "Authorization*" keys are allowed. - Requires one of the following permissions: MANAGE_PRODUCTS. + Added in Saleor 3.12. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - attributeValueCreate( - """Attribute to which value will be assigned.""" - attribute: ID! + customHeaders: JSONString +} - """Fields required to create an AttributeValue.""" - input: AttributeValueCreateInput! - ): AttributeValueCreate @doc(category: "Attributes") +""" +Retries event delivery. - """ - Deletes a value of an attribute. - - Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. - """ - attributeValueDelete( - """ - External ID of a value to delete. - - Added in Saleor 3.10. - """ - externalReference: String +Requires one of the following permissions: MANAGE_APPS. +""" +type EventDeliveryRetry @doc(category: "Webhooks") { + """Event delivery.""" + delivery: EventDelivery + errors: [WebhookError!]! +} - """ID of a value to delete.""" - id: ID - ): AttributeValueDelete @doc(category: "Attributes") +""" +Performs a dry run of a webhook event. Supports a single event (the first, if multiple provided in the `query`). Requires permission relevant to processed event. - """ - Updates value of an attribute. - - Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. - """ - attributeValueUpdate( - """ - External ID of an AttributeValue to update. - - Added in Saleor 3.10. - """ - externalReference: String +Added in Saleor 3.11. - """ID of an AttributeValue to update.""" - id: ID +Note: this API is currently in Feature Preview and can be subject to changes at later point. - """Fields required to update an AttributeValue.""" - input: AttributeValueUpdateInput! - ): AttributeValueUpdate @doc(category: "Attributes") +Requires one of the following permissions: AUTHENTICATED_STAFF_USER. +""" +type WebhookDryRun @doc(category: "Webhooks") { + """JSON payload, that would be sent out to webhook's target URL.""" + payload: JSONString + errors: [WebhookDryRunError!]! +} +type WebhookDryRunError @doc(category: "Webhooks") { """ - Creates/updates translations for an attribute value. - - Requires one of the following permissions: MANAGE_TRANSLATIONS. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - attributeValueTranslate( - """AttributeValue ID or AttributeValueTranslatableContent ID.""" - id: ID! - input: AttributeValueTranslationInput! + field: String - """Translation language code.""" - languageCode: LanguageCodeEnum! - ): AttributeValueTranslate @doc(category: "Attributes") + """The error message.""" + message: String - """ - Reorder the values of an attribute. - - Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. - """ - attributeReorderValues( - """ID of an attribute.""" - attributeId: ID! + """The error code.""" + code: WebhookDryRunErrorCode! +} - """The list of reordering operations for given attribute values.""" - moves: [ReorderInput!]! - ): AttributeReorderValues @doc(category: "Attributes") +"""An enumeration.""" +enum WebhookDryRunErrorCode @doc(category: "Webhooks") { + GRAPHQL_ERROR + NOT_FOUND + INVALID_ID + MISSING_PERMISSION + TYPE_NOT_SUPPORTED + SYNTAX + MISSING_SUBSCRIPTION + UNABLE_TO_PARSE + MISSING_EVENT +} - """ - Creates a new app. Requires the following permissions: AUTHENTICATED_STAFF_USER and MANAGE_APPS. - """ - appCreate( - """Fields required to create a new app.""" - input: AppInput! - ): AppCreate @doc(category: "Apps") +""" +Trigger a webhook event. Supports a single event (the first, if multiple provided in the `webhook.subscription_query`). Requires permission relevant to processed event. Successfully delivered webhook returns `delivery` with status='PENDING' and empty payload. - """ - Updates an existing app. - - Requires one of the following permissions: MANAGE_APPS. - """ - appUpdate( - """ID of an app to update.""" - id: ID! +Added in Saleor 3.11. - """Fields required to update an existing app.""" - input: AppInput! - ): AppUpdate @doc(category: "Apps") +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: AUTHENTICATED_STAFF_USER. +""" +type WebhookTrigger @doc(category: "Webhooks") { + delivery: EventDelivery + errors: [WebhookTriggerError!]! +} +type WebhookTriggerError @doc(category: "Webhooks") { """ - Deletes an app. - - Requires one of the following permissions: MANAGE_APPS. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - appDelete( - """ID of an app to delete.""" - id: ID! - ): AppDelete @doc(category: "Apps") + field: String + + """The error message.""" + message: String + + """The error code.""" + code: WebhookTriggerErrorCode! +} + +"""An enumeration.""" +enum WebhookTriggerErrorCode @doc(category: "Webhooks") { + GRAPHQL_ERROR + NOT_FOUND + INVALID_ID + MISSING_PERMISSION + TYPE_NOT_SUPPORTED + SYNTAX + MISSING_SUBSCRIPTION + UNABLE_TO_PARSE + MISSING_QUERY + MISSING_EVENT +} + +""" +Creates new warehouse. + +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type WarehouseCreate @doc(category: "Products") { + warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [WarehouseError!]! + warehouse: Warehouse +} +type WarehouseError @doc(category: "Products") { """ - Creates a new token. - - Requires one of the following permissions: MANAGE_APPS. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - appTokenCreate( - """Fields required to create a new auth token.""" - input: AppTokenInput! - ): AppTokenCreate @doc(category: "Apps") + field: String + + """The error message.""" + message: String + + """The error code.""" + code: WarehouseErrorCode! + + """List of shipping zones IDs which causes the error.""" + shippingZones: [ID!] +} + +"""An enumeration.""" +enum WarehouseErrorCode @doc(category: "Products") { + ALREADY_EXISTS + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE +} + +input WarehouseCreateInput @doc(category: "Products") { + """Warehouse slug.""" + slug: String + + """The email address of the warehouse.""" + email: String """ - Deletes an authentication token assigned to app. + External ID of the warehouse. - Requires one of the following permissions: MANAGE_APPS. + Added in Saleor 3.10. """ - appTokenDelete( - """ID of an auth token to delete.""" - id: ID! - ): AppTokenDelete @doc(category: "Apps") + externalReference: String - """Verify provided app token.""" - appTokenVerify( - """App token to verify.""" - token: String! - ): AppTokenVerify @doc(category: "Apps") + """Warehouse name.""" + name: String! - """ - Install new app by using app manifest. Requires the following permissions: AUTHENTICATED_STAFF_USER and MANAGE_APPS. - """ - appInstall( - """Fields required to install a new app.""" - input: AppInstallInput! - ): AppInstall @doc(category: "Apps") + """Address of the warehouse.""" + address: AddressInput! """ - Retry failed installation of new app. + Shipping zones supported by the warehouse. - Requires one of the following permissions: MANAGE_APPS. + DEPRECATED: this field will be removed in Saleor 4.0. Providing the zone ids will raise a ValidationError. """ - appRetryInstall( - """Determine if app will be set active or not.""" - activateAfterInstallation: Boolean = true + shippingZones: [ID!] +} - """ID of failed installation.""" - id: ID! - ): AppRetryInstall @doc(category: "Apps") +""" +Updates given warehouse. - """ - Delete failed installation. - - Requires one of the following permissions: MANAGE_APPS. - """ - appDeleteFailedInstallation( - """ID of failed installation to delete.""" - id: ID! - ): AppDeleteFailedInstallation @doc(category: "Apps") +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type WarehouseUpdate @doc(category: "Products") { + warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [WarehouseError!]! + warehouse: Warehouse +} - """ - Fetch and validate manifest. - - Requires one of the following permissions: MANAGE_APPS. - """ - appFetchManifest(manifestUrl: String!): AppFetchManifest @doc(category: "Apps") +input WarehouseUpdateInput @doc(category: "Products") { + """Warehouse slug.""" + slug: String - """ - Activate the app. - - Requires one of the following permissions: MANAGE_APPS. - """ - appActivate( - """ID of app to activate.""" - id: ID! - ): AppActivate @doc(category: "Apps") + """The email address of the warehouse.""" + email: String """ - Deactivate the app. + External ID of the warehouse. - Requires one of the following permissions: MANAGE_APPS. + Added in Saleor 3.10. """ - appDeactivate( - """ID of app to deactivate.""" - id: ID! - ): AppDeactivate @doc(category: "Apps") - - """Create JWT token.""" - tokenCreate( - """ - The audience that will be included to JWT tokens with prefix `custom:`. - - Added in Saleor 3.8. - """ - audience: String + externalReference: String - """Email of a user.""" - email: String! + """Warehouse name.""" + name: String - """Password of a user.""" - password: String! - ): CreateToken @doc(category: "Authentication") + """Address of the warehouse.""" + address: AddressInput """ - Refresh JWT token. Mutation tries to take refreshToken from the input.If it fails it will try to take refreshToken from the http-only cookie -refreshToken. csrfToken is required when refreshToken is provided as a cookie. + Click and collect options: local, all or disabled. + + Added in Saleor 3.1. """ - tokenRefresh( - """ - CSRF token required to refresh token. This argument is required when refreshToken is provided as a cookie. - """ - csrfToken: String - - """Refresh token.""" - refreshToken: String - ): RefreshToken @doc(category: "Authentication") - - """Verify JWT token.""" - tokenVerify( - """JWT token to validate.""" - token: String! - ): VerifyToken @doc(category: "Authentication") + clickAndCollectOption: WarehouseClickAndCollectOptionEnum """ - Deactivate all JWT tokens of the currently authenticated user. + Visibility of warehouse stocks. - Requires one of the following permissions: AUTHENTICATED_USER. + Added in Saleor 3.1. """ - tokensDeactivateAll: DeactivateAllUserTokens @doc(category: "Authentication") - - """Prepare external authentication URL for user by custom plugin.""" - externalAuthenticationUrl( - """The data required by plugin to create external authentication url.""" - input: JSONString! - - """The ID of the authentication plugin.""" - pluginId: String! - ): ExternalAuthenticationUrl @doc(category: "Authentication") - - """Obtain external access tokens for user by custom plugin.""" - externalObtainAccessTokens( - """The data required by plugin to create authentication data.""" - input: JSONString! - - """The ID of the authentication plugin.""" - pluginId: String! - ): ExternalObtainAccessTokens @doc(category: "Authentication") - - """Refresh user's access by custom plugin.""" - externalRefresh( - """The data required by plugin to proceed the refresh process.""" - input: JSONString! - - """The ID of the authentication plugin.""" - pluginId: String! - ): ExternalRefresh @doc(category: "Authentication") + isPrivate: Boolean +} - """Logout user by custom plugin.""" - externalLogout( - """The data required by plugin to proceed the logout process.""" - input: JSONString! +""" +Deletes selected warehouse. - """The ID of the authentication plugin.""" - pluginId: String! - ): ExternalLogout @doc(category: "Authentication") +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type WarehouseDelete @doc(category: "Products") { + warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [WarehouseError!]! + warehouse: Warehouse +} - """Verify external authentication data by plugin.""" - externalVerify( - """The data required by plugin to proceed the verification.""" - input: JSONString! +""" +Add shipping zone to given warehouse. - """The ID of the authentication plugin.""" - pluginId: String! - ): ExternalVerify @doc(category: "Authentication") +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type WarehouseShippingZoneAssign @doc(category: "Products") { + warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [WarehouseError!]! + warehouse: Warehouse +} - """Sends an email with the account password modification link.""" - requestPasswordReset( - """ - Slug of a channel which will be used for notify user. Optional when only one channel exists. - """ - channel: String +""" +Remove shipping zone from given warehouse. - """Email of the user that will be used for password recovery.""" - email: String! +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type WarehouseShippingZoneUnassign @doc(category: "Products") { + warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [WarehouseError!]! + warehouse: Warehouse +} - """ - URL of a view where users should be redirected to reset the password. URL in RFC 1808 format. - """ - redirectUrl: String! - ): RequestPasswordReset @doc(category: "Users") +""" +Create a tax class. - """Confirm user account with token sent by email during registration.""" - confirmAccount( - """E-mail of the user performing account confirmation.""" - email: String! +Added in Saleor 3.9. - """A one-time token required to confirm the account.""" - token: String! - ): ConfirmAccount @doc(category: "Users") +Requires one of the following permissions: MANAGE_TAXES. +""" +type TaxClassCreate @doc(category: "Taxes") { + errors: [TaxClassCreateError!]! + taxClass: TaxClass +} +type TaxClassCreateError @doc(category: "Taxes") { """ - Sets the user's password from the token sent by email using the RequestPasswordReset mutation. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - setPassword( - """Email of a user.""" - email: String! + field: String - """Password of a user.""" - password: String! + """The error message.""" + message: String - """A one-time token required to set the password.""" - token: String! - ): SetPassword @doc(category: "Users") + """The error code.""" + code: TaxClassCreateErrorCode! - """ - Change the password of the logged in user. - - Requires one of the following permissions: AUTHENTICATED_USER. - """ - passwordChange( - """New user password.""" - newPassword: String! + """List of country codes for which the configuration is invalid.""" + countryCodes: [String!]! +} + +"""An enumeration.""" +enum TaxClassCreateErrorCode @doc(category: "Taxes") { + GRAPHQL_ERROR + INVALID + NOT_FOUND +} + +input TaxClassCreateInput @doc(category: "Taxes") { + """Name of the tax class.""" + name: String! - """Current user password.""" - oldPassword: String - ): PasswordChange @doc(category: "Users") + """List of country-specific tax rates to create for this tax class.""" + createCountryRates: [CountryRateInput!] +} + +input CountryRateInput @doc(category: "Taxes") { + """Country in which this rate applies.""" + countryCode: CountryCode! """ - Request email change of the logged in user. - - Requires one of the following permissions: AUTHENTICATED_USER. + Tax rate value provided as percentage. Example: provide `23` to represent `23%` tax rate. """ - requestEmailChange( - """ - Slug of a channel which will be used to notify users. Optional when only one channel exists. - """ - channel: String + rate: Float! +} - """New user email.""" - newEmail: String! +""" +Delete a tax class. After deleting the tax class any products, product types or shipping methods using it are updated to use the default tax class. - """User password.""" - password: String! +Added in Saleor 3.9. - """ - URL of a view where users should be redirected to update the email address. URL in RFC 1808 format. - """ - redirectUrl: String! - ): RequestEmailChange @doc(category: "Users") +Requires one of the following permissions: MANAGE_TAXES. +""" +type TaxClassDelete @doc(category: "Taxes") { + errors: [TaxClassDeleteError!]! + taxClass: TaxClass +} +type TaxClassDeleteError @doc(category: "Taxes") { """ - Confirm the email change of the logged-in user. - - Requires one of the following permissions: AUTHENTICATED_USER. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - confirmEmailChange( - """ - Slug of a channel which will be used to notify users. Optional when only one channel exists. - """ - channel: String + field: String - """A one-time token required to change the email.""" - token: String! - ): ConfirmEmailChange @doc(category: "Users") + """The error message.""" + message: String - """ - Create a new address for the customer. - - Requires one of the following permissions: AUTHENTICATED_USER. - """ - accountAddressCreate( - """Fields required to create address.""" - input: AddressInput! + """The error code.""" + code: TaxClassDeleteErrorCode! +} - """ - A type of address. If provided, the new address will be automatically assigned as the customer's default address of that type. - """ - type: AddressTypeEnum - ): AccountAddressCreate @doc(category: "Users") +"""An enumeration.""" +enum TaxClassDeleteErrorCode @doc(category: "Taxes") { + GRAPHQL_ERROR + INVALID + NOT_FOUND +} - """ - Updates an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER. - """ - accountAddressUpdate( - """ID of the address to update.""" - id: ID! +""" +Update a tax class. - """Fields required to update the address.""" - input: AddressInput! - ): AccountAddressUpdate @doc(category: "Users") +Added in Saleor 3.9. - """ - Delete an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER. - """ - accountAddressDelete( - """ID of the address to delete.""" - id: ID! - ): AccountAddressDelete @doc(category: "Users") +Requires one of the following permissions: MANAGE_TAXES. +""" +type TaxClassUpdate @doc(category: "Taxes") { + errors: [TaxClassUpdateError!]! + taxClass: TaxClass +} +type TaxClassUpdateError @doc(category: "Taxes") { """ - Sets a default address for the authenticated user. - - Requires one of the following permissions: AUTHENTICATED_USER. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - accountSetDefaultAddress( - """ID of the address to set as default.""" - id: ID! + field: String - """The type of address.""" - type: AddressTypeEnum! - ): AccountSetDefaultAddress @doc(category: "Users") + """The error message.""" + message: String - """Register a new user.""" - accountRegister( - """Fields required to create a user.""" - input: AccountRegisterInput! - ): AccountRegister @doc(category: "Users") + """The error code.""" + code: TaxClassUpdateErrorCode! - """ - Updates the account of the logged-in user. - - Requires one of the following permissions: AUTHENTICATED_USER. - """ - accountUpdate( - """Fields required to update the account of the logged-in user.""" - input: AccountInput! - ): AccountUpdate @doc(category: "Users") + """List of country codes for which the configuration is invalid.""" + countryCodes: [String!]! +} - """ - Sends an email with the account removal link for the logged-in user. - - Requires one of the following permissions: AUTHENTICATED_USER. - """ - accountRequestDeletion( - """ - Slug of a channel which will be used to notify users. Optional when only one channel exists. - """ - channel: String +"""An enumeration.""" +enum TaxClassUpdateErrorCode @doc(category: "Taxes") { + DUPLICATED_INPUT_ITEM + GRAPHQL_ERROR + INVALID + NOT_FOUND +} - """ - URL of a view where users should be redirected to delete their account. URL in RFC 1808 format. - """ - redirectUrl: String! - ): AccountRequestDeletion @doc(category: "Users") +input TaxClassUpdateInput @doc(category: "Taxes") { + """Name of the tax class.""" + name: String """ - Remove user account. - - Requires one of the following permissions: AUTHENTICATED_USER. + List of country-specific tax rates to create or update for this tax class. """ - accountDelete( - """ - A one-time token required to remove account. Sent by email using AccountRequestDeletion mutation. - """ - token: String! - ): AccountDelete @doc(category: "Users") + updateCountryRates: [CountryRateUpdateInput!] """ - Creates user address. - - Requires one of the following permissions: MANAGE_USERS. + List of country codes for which to remove the tax class rates. Note: It removes all rates for given country code. """ - addressCreate( - """Fields required to create address.""" - input: AddressInput! + removeCountryRates: [CountryCode!] +} - """ID of a user to create address for.""" - userId: ID! - ): AddressCreate @doc(category: "Users") +input CountryRateUpdateInput @doc(category: "Taxes") { + """Country in which this rate applies.""" + countryCode: CountryCode! """ - Updates an address. - - Requires one of the following permissions: MANAGE_USERS. + Tax rate value provided as percentage. Example: provide `23` to represent `23%` tax rate. Provide `null` to remove the particular rate. """ - addressUpdate( - """ID of the address to update.""" - id: ID! + rate: Float +} - """Fields required to update the address.""" - input: AddressInput! - ): AddressUpdate @doc(category: "Users") +""" +Update tax configuration for a channel. - """ - Deletes an address. - - Requires one of the following permissions: MANAGE_USERS. - """ - addressDelete( - """ID of the address to delete.""" - id: ID! - ): AddressDelete @doc(category: "Users") +Added in Saleor 3.9. + +Requires one of the following permissions: MANAGE_TAXES. +""" +type TaxConfigurationUpdate @doc(category: "Taxes") { + errors: [TaxConfigurationUpdateError!]! + taxConfiguration: TaxConfiguration +} +type TaxConfigurationUpdateError @doc(category: "Taxes") { """ - Sets a default address for the given user. - - Requires one of the following permissions: MANAGE_USERS. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - addressSetDefault( - """ID of the address.""" - addressId: ID! + field: String - """The type of address.""" - type: AddressTypeEnum! + """The error message.""" + message: String - """ID of the user to change the address for.""" - userId: ID! - ): AddressSetDefault @doc(category: "Users") + """The error code.""" + code: TaxConfigurationUpdateErrorCode! - """ - Creates a new customer. - - Requires one of the following permissions: MANAGE_USERS. - """ - customerCreate( - """Fields required to create a customer.""" - input: UserCreateInput! - ): CustomerCreate @doc(category: "Users") + """List of country codes for which the configuration is invalid.""" + countryCodes: [String!]! +} + +"""An enumeration.""" +enum TaxConfigurationUpdateErrorCode @doc(category: "Taxes") { + DUPLICATED_INPUT_ITEM + GRAPHQL_ERROR + INVALID + NOT_FOUND +} + +input TaxConfigurationUpdateInput @doc(category: "Taxes") { + """Determines whether taxes are charged in the given channel.""" + chargeTaxes: Boolean """ - Updates an existing customer. - - Requires one of the following permissions: MANAGE_USERS. - """ - customerUpdate( - """ - External ID of a customer to update. - - Added in Saleor 3.10. - """ - externalReference: String + The default strategy to use for tax calculation in the given channel. Taxes can be calculated either using user-defined flat rates or with a tax app. Empty value means that no method is selected and taxes are not calculated. + """ + taxCalculationStrategy: TaxCalculationStrategy - """ID of a customer to update.""" - id: ID + """Determines whether displayed prices should include taxes.""" + displayGrossPrices: Boolean - """Fields required to update a customer.""" - input: CustomerInput! - ): CustomerUpdate @doc(category: "Users") + """Determines whether prices are entered with the tax included.""" + pricesEnteredWithTax: Boolean """ - Deletes a customer. - - Requires one of the following permissions: MANAGE_USERS. + List of tax country configurations to create or update (identified by a country code). """ - customerDelete( - """ - External ID of a customer to update. - - Added in Saleor 3.10. - """ - externalReference: String + updateCountriesConfiguration: [TaxConfigurationPerCountryInput!] - """ID of a customer to delete.""" - id: ID - ): CustomerDelete @doc(category: "Users") + """List of country codes for which to remove the tax configuration.""" + removeCountriesConfiguration: [CountryCode!] """ - Deletes customers. + The tax app `App.identifier` that will be used to calculate the taxes for the given channel. Empty value for `TAX_APP` set as `taxCalculationStrategy` means that Saleor will iterate over all installed tax apps. If multiple tax apps exist with provided tax app id use the `App` with newest `created` date. It's possible to set plugin by using prefix `plugin:` with `PLUGIN_ID` e.g. with Avalara `plugin:mirumee.taxes.avalara`.Will become mandatory in 4.0 for `TAX_APP` `taxCalculationStrategy`. - Requires one of the following permissions: MANAGE_USERS. + Added in Saleor 3.19. """ - customerBulkDelete( - """List of user IDs to delete.""" - ids: [ID!]! - ): CustomerBulkDelete @doc(category: "Users") + taxAppId: String +} + +input TaxConfigurationPerCountryInput @doc(category: "Taxes") { + """Country in which this configuration applies.""" + countryCode: CountryCode! + + """Determines whether taxes are charged in this country.""" + chargeTaxes: Boolean! """ - Updates customers. - - Added in Saleor 3.13. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. - - Requires one of the following permissions: MANAGE_USERS. + A country-specific strategy to use for tax calculation. Taxes can be calculated either using user-defined flat rates or with a tax app. If not provided, use the value from the channel's tax configuration. """ - customerBulkUpdate( - """Input list of customers to update.""" - customers: [CustomerBulkUpdateInput!]! - - """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" - errorPolicy: ErrorPolicyEnum - ): CustomerBulkUpdate @doc(category: "Users") + taxCalculationStrategy: TaxCalculationStrategy """ - Creates a new staff user. Apps are not allowed to perform this mutation. - - Requires one of the following permissions: MANAGE_STAFF. + Determines whether displayed prices should include taxes for this country. """ - staffCreate( - """Fields required to create a staff user.""" - input: StaffCreateInput! - ): StaffCreate @doc(category: "Users") + displayGrossPrices: Boolean! """ - Updates an existing staff user. Apps are not allowed to perform this mutation. + The tax app `App.identifier` that will be used to calculate the taxes for the given channel and country. If not provided, use the value from the channel's tax configuration. - Requires one of the following permissions: MANAGE_STAFF. + Added in Saleor 3.19. """ - staffUpdate( - """ID of a staff user to update.""" - id: ID! + taxAppId: String +} - """Fields required to update a staff user.""" - input: StaffUpdateInput! - ): StaffUpdate @doc(category: "Users") +""" +Update tax class rates for a specific country. + +Added in Saleor 3.9. + +Requires one of the following permissions: MANAGE_TAXES. +""" +type TaxCountryConfigurationUpdate @doc(category: "Taxes") { + """Updated tax class rates grouped by a country.""" + taxCountryConfiguration: TaxCountryConfiguration + errors: [TaxCountryConfigurationUpdateError!]! +} +type TaxCountryConfigurationUpdateError @doc(category: "Taxes") { """ - Deletes a staff user. Apps are not allowed to perform this mutation. - - Requires one of the following permissions: MANAGE_STAFF. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - staffDelete( - """ID of a staff user to delete.""" - id: ID! - ): StaffDelete @doc(category: "Users") + field: String + + """The error message.""" + message: String + + """The error code.""" + code: TaxCountryConfigurationUpdateErrorCode! + + """List of tax class IDs for which the update failed.""" + taxClassIds: [String!]! +} + +"""An enumeration.""" +enum TaxCountryConfigurationUpdateErrorCode @doc(category: "Taxes") { + GRAPHQL_ERROR + INVALID + NOT_FOUND + ONLY_ONE_DEFAULT_COUNTRY_RATE_ALLOWED + CANNOT_CREATE_NEGATIVE_RATE +} + +input TaxClassRateInput @doc(category: "Taxes") { + """ID of a tax class for which to update the tax rate""" + taxClassId: ID + + """Tax rate value.""" + rate: Float +} + +""" +Remove all tax class rates for a specific country. + +Added in Saleor 3.9. + +Requires one of the following permissions: MANAGE_TAXES. +""" +type TaxCountryConfigurationDelete @doc(category: "Taxes") { + """Updated tax class rates grouped by a country.""" + taxCountryConfiguration: TaxCountryConfiguration + errors: [TaxCountryConfigurationDeleteError!]! +} +type TaxCountryConfigurationDeleteError @doc(category: "Taxes") { """ - Deletes staff users. Apps are not allowed to perform this mutation. - - Requires one of the following permissions: MANAGE_STAFF. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - staffBulkDelete( - """List of user IDs to delete.""" - ids: [ID!]! - ): StaffBulkDelete @doc(category: "Users") + field: String + + """The error message.""" + message: String + + """The error code.""" + code: TaxCountryConfigurationDeleteErrorCode! +} + +"""An enumeration.""" +enum TaxCountryConfigurationDeleteErrorCode @doc(category: "Taxes") { + GRAPHQL_ERROR + INVALID + NOT_FOUND +} + +""" +Exempt checkout or order from charging the taxes. When tax exemption is enabled, taxes won't be charged for the checkout or order. Taxes may still be calculated in cases when product prices are entered with the tax included and the net price needs to be known. + +Added in Saleor 3.8. + +Requires one of the following permissions: MANAGE_TAXES. +""" +type TaxExemptionManage @doc(category: "Taxes") { + taxableObject: TaxSourceObject + errors: [TaxExemptionManageError!]! +} +union TaxSourceObject = Checkout | Order + +type TaxExemptionManageError @doc(category: "Taxes") { """ - Create a user avatar. Only for staff members. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec - - Requires one of the following permissions: AUTHENTICATED_STAFF_USER. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - userAvatarUpdate( - """Represents an image file in a multipart request.""" - image: Upload! - ): UserAvatarUpdate @doc(category: "Users") + field: String + + """The error message.""" + message: String + + """The error code.""" + code: TaxExemptionManageErrorCode! +} + +"""An enumeration.""" +enum TaxExemptionManageErrorCode @doc(category: "Taxes") { + GRAPHQL_ERROR + INVALID + NOT_FOUND + NOT_EDITABLE_ORDER +} + +""" +Updates stocks for a given variant and warehouse. Variant and warehouse selectors have to be the same for all stock inputs. Is not allowed to use 'variantId' in one input and 'variantExternalReference' in another. + +Added in Saleor 3.13. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: MANAGE_PRODUCTS. + +Triggers the following webhook events: +- PRODUCT_VARIANT_STOCK_UPDATED (async): A product variant stock details were updated. +""" +type StockBulkUpdate @doc(category: "Products") @webhookEventsInfo(asyncEvents: [PRODUCT_VARIANT_STOCK_UPDATED], syncEvents: []) { + """Returns how many objects were updated.""" + count: Int! + + """List of the updated stocks.""" + results: [StockBulkResult!]! + errors: [StockBulkUpdateError!]! +} +type StockBulkResult @doc(category: "Products") { + """Stock data.""" + stock: Stock + + """List of errors occurred on create or update attempt.""" + errors: [StockBulkUpdateError!] +} + +type StockBulkUpdateError @doc(category: "Products") { """ - Deletes a user avatar. Only for staff members. - - Requires one of the following permissions: AUTHENTICATED_STAFF_USER. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - userAvatarDelete: UserAvatarDelete @doc(category: "Users") + field: String + + """The error message.""" + message: String + + """The error code.""" + code: StockBulkUpdateErrorCode! +} + +"""An enumeration.""" +enum StockBulkUpdateErrorCode @doc(category: "Products") { + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED +} +enum ErrorPolicyEnum { """ - Activate or deactivate users. - - Requires one of the following permissions: MANAGE_USERS. + Save what is possible within a single row. If there are errors in an input data row, try to save it partially and skip the invalid part. """ - userBulkSetActive( - """List of user IDs to activate/deactivate.""" - ids: [ID!]! + IGNORE_FAILED - """Determine if users will be set active or not.""" - isActive: Boolean! - ): UserBulkSetActive @doc(category: "Users") + """Reject all rows if there is at least one error in any of them.""" + REJECT_EVERYTHING + + """Reject rows with errors.""" + REJECT_FAILED_ROWS +} - """ - Create new permission group. Apps are not allowed to perform this mutation. - - Requires one of the following permissions: MANAGE_STAFF. - """ - permissionGroupCreate( - """Input fields to create permission group.""" - input: PermissionGroupCreateInput! - ): PermissionGroupCreate @doc(category: "Users") +input StockBulkUpdateInput @doc(category: "Products") { + """Variant ID.""" + variantId: ID - """ - Update permission group. Apps are not allowed to perform this mutation. - - Requires one of the following permissions: MANAGE_STAFF. - """ - permissionGroupUpdate( - """ID of the group to update.""" - id: ID! + """Variant external reference.""" + variantExternalReference: String - """Input fields to create permission group.""" - input: PermissionGroupUpdateInput! - ): PermissionGroupUpdate @doc(category: "Users") + """Warehouse ID.""" + warehouseId: ID - """ - Delete permission group. Apps are not allowed to perform this mutation. - - Requires one of the following permissions: MANAGE_STAFF. - """ - permissionGroupDelete( - """ID of the group to delete.""" - id: ID! - ): PermissionGroupDelete @doc(category: "Users") + """Warehouse external reference.""" + warehouseExternalReference: String + + """Quantity of items available for sell.""" + quantity: Int! } """ -Creates a new webhook subscription. +Creates a new staff notification recipient. -Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. +Requires one of the following permissions: MANAGE_SETTINGS. """ -type WebhookCreate @doc(category: "Webhooks") { - webhookErrors: [WebhookError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [WebhookError!]! - webhook: Webhook +type StaffNotificationRecipientCreate @doc(category: "Users") { + shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShopError!]! + staffNotificationRecipient: StaffNotificationRecipient } -type WebhookError @doc(category: "Webhooks") { +type ShopError @doc(category: "Shop") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -16852,173 +21313,233 @@ type WebhookError @doc(category: "Webhooks") { message: String """The error code.""" - code: WebhookErrorCode! + code: ShopErrorCode! } """An enumeration.""" -enum WebhookErrorCode @doc(category: "Webhooks") { +enum ShopErrorCode { + ALREADY_EXISTS + CANNOT_FETCH_TAX_RATES GRAPHQL_ERROR INVALID NOT_FOUND REQUIRED UNIQUE - DELETE_FAILED - SYNTAX - MISSING_SUBSCRIPTION - UNABLE_TO_PARSE - MISSING_EVENT - INVALID_CUSTOM_HEADERS } -input WebhookCreateInput @doc(category: "Webhooks") { - """The name of the webhook.""" - name: String +input StaffNotificationRecipientInput { + """The ID of the user subscribed to email notifications..""" + user: ID - """The url to receive the payload.""" - targetUrl: String + """Email address of a user subscribed to email notifications.""" + email: String - """ - The events that webhook wants to subscribe. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `asyncEvents` or `syncEvents` instead. - """ - events: [WebhookEventTypeEnum!] + """Determines if a notification active.""" + active: Boolean +} - """The asynchronous events that webhook wants to subscribe.""" - asyncEvents: [WebhookEventTypeAsyncEnum!] +""" +Updates a staff notification recipient. - """The synchronous events that webhook wants to subscribe.""" - syncEvents: [WebhookEventTypeSyncEnum!] +Requires one of the following permissions: MANAGE_SETTINGS. +""" +type StaffNotificationRecipientUpdate @doc(category: "Users") { + shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShopError!]! + staffNotificationRecipient: StaffNotificationRecipient +} - """ID of the app to which webhook belongs.""" - app: ID +""" +Delete staff notification recipient. - """Determine if webhook will be set active or not.""" - isActive: Boolean +Requires one of the following permissions: MANAGE_SETTINGS. +""" +type StaffNotificationRecipientDelete @doc(category: "Users") { + shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShopError!]! + staffNotificationRecipient: StaffNotificationRecipient +} + +""" +Updates site domain of the shop. + +DEPRECATED: this mutation will be removed in Saleor 4.0. Use `PUBLIC_URL` environment variable instead. + +Requires one of the following permissions: MANAGE_SETTINGS. +""" +type ShopDomainUpdate @doc(category: "Shop") { + """Updated shop.""" + shop: Shop + shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShopError!]! +} + +input SiteDomainInput { + """Domain name for shop.""" + domain: String + + """Shop site name.""" + name: String +} + +""" +Updates shop settings. + +Requires one of the following permissions: MANAGE_SETTINGS. + +Triggers the following webhook events: +- SHOP_METADATA_UPDATED (async): Optionally triggered when public or private metadata is updated. +""" +type ShopSettingsUpdate @doc(category: "Shop") @webhookEventsInfo(asyncEvents: [SHOP_METADATA_UPDATED], syncEvents: []) { + """Updated shop.""" + shop: Shop + shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShopError!]! +} + +input ShopSettingsInput { + """Header text.""" + headerText: String + + """SEO description.""" + description: String """ - The secret key used to create a hash signature with each payload. - - DEPRECATED: this field will be removed in Saleor 4.0. As of Saleor 3.5, webhook payloads default to signing using a verifiable JWS. + This field is used as a default value for `ProductVariant.trackInventory`. """ - secretKey: String + trackInventoryByDefault: Boolean + + """Default weight unit.""" + defaultWeightUnit: WeightUnitsEnum + + """Enable automatic fulfillment for all digital products.""" + automaticFulfillmentDigitalProducts: Boolean """ - Subscription query used to define a webhook payload. + Enable automatic approval of all new fulfillments. - Added in Saleor 3.2. + Added in Saleor 3.1. """ - query: String + fulfillmentAutoApprove: Boolean """ - Custom headers, which will be added to HTTP request. There is a limitation of 5 headers per webhook and 998 characters per header.Only "X-*" and "Authorization*" keys are allowed. - - Added in Saleor 3.12. + Enable ability to approve fulfillments which are unpaid. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + Added in Saleor 3.1. """ - customHeaders: JSONString -} + fulfillmentAllowUnpaid: Boolean -""" -Delete a webhook. Before the deletion, the webhook is deactivated to pause any deliveries that are already scheduled. The deletion might fail if delivery is in progress. In such a case, the webhook is not deleted but remains deactivated. + """Default number of max downloads per digital content URL.""" + defaultDigitalMaxDownloads: Int -Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. -""" -type WebhookDelete @doc(category: "Webhooks") { - webhookErrors: [WebhookError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [WebhookError!]! - webhook: Webhook -} + """Default number of days which digital content URL will be valid.""" + defaultDigitalUrlValidDays: Int -""" -Updates a webhook subscription. + """Default email sender's name.""" + defaultMailSenderName: String -Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. -""" -type WebhookUpdate @doc(category: "Webhooks") { - webhookErrors: [WebhookError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [WebhookError!]! - webhook: Webhook -} + """Default email sender's address.""" + defaultMailSenderAddress: String -input WebhookUpdateInput @doc(category: "Webhooks") { - """The new name of the webhook.""" - name: String + """URL of a view where customers can set their password.""" + customerSetPasswordUrl: String - """The url to receive the payload.""" - targetUrl: String + """ + Default number of minutes stock will be reserved for anonymous checkout. Enter 0 or null to disable. + + Added in Saleor 3.1. + """ + reserveStockDurationAnonymousUser: Int """ - The events that webhook wants to subscribe. + Default number of minutes stock will be reserved for authenticated checkout. Enter 0 or null to disable. - DEPRECATED: this field will be removed in Saleor 4.0. Use `asyncEvents` or `syncEvents` instead. + Added in Saleor 3.1. """ - events: [WebhookEventTypeEnum!] + reserveStockDurationAuthenticatedUser: Int - """The asynchronous events that webhook wants to subscribe.""" - asyncEvents: [WebhookEventTypeAsyncEnum!] + """ + Default number of maximum line quantity in single checkout. Minimum possible value is 1, default value is 50. + + Added in Saleor 3.1. + """ + limitQuantityPerCheckout: Int - """The synchronous events that webhook wants to subscribe.""" - syncEvents: [WebhookEventTypeSyncEnum!] + """ + Enable automatic account confirmation by email. + + Added in Saleor 3.14. + """ + enableAccountConfirmationByEmail: Boolean - """ID of the app to which webhook belongs.""" - app: ID + """ + Enable possibility to login without account confirmation. + + Added in Saleor 3.15. + """ + allowLoginWithoutConfirmation: Boolean - """Determine if webhook will be set active or not.""" - isActive: Boolean + """ + Shop public metadata. + + Added in Saleor 3.15. + """ + metadata: [MetadataInput!] """ - Use to create a hash signature with each payload. + Shop private metadata. - DEPRECATED: this field will be removed in Saleor 4.0. As of Saleor 3.5, webhook payloads default to signing using a verifiable JWS. + Added in Saleor 3.15. """ - secretKey: String + privateMetadata: [MetadataInput!] """ - Subscription query used to define a webhook payload. + Include taxes in prices. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `taxConfigurationUpdate` mutation to configure this setting per channel or country. + """ + includeTaxesInPrices: Boolean + + """ + Display prices with tax in store. - Added in Saleor 3.2. + DEPRECATED: this field will be removed in Saleor 4.0. Use `taxConfigurationUpdate` mutation to configure this setting per channel or country. """ - query: String + displayGrossPrices: Boolean """ - Custom headers, which will be added to HTTP request. There is a limitation of 5 headers per webhook and 998 characters per header.Only "X-*" and "Authorization*" keys are allowed. - - Added in Saleor 3.12. + Charge taxes on shipping. - Note: this API is currently in Feature Preview and can be subject to changes at later point. + DEPRECATED: this field will be removed in Saleor 4.0. To enable taxes for a shipping method, assign a tax class to the shipping method with `shippingPriceCreate` or `shippingPriceUpdate` mutations. """ - customHeaders: JSONString + chargeTaxesOnShipping: Boolean } """ -Retries event delivery. +Fetch tax rates. -Requires one of the following permissions: MANAGE_APPS. +Requires one of the following permissions: MANAGE_SETTINGS. """ -type EventDeliveryRetry @doc(category: "Webhooks") { - """Event delivery.""" - delivery: EventDelivery - errors: [WebhookError!]! +type ShopFetchTaxRates @doc(category: "Shop") { + """Updated shop.""" + shop: Shop + shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShopError!]! } """ -Performs a dry run of a webhook event. Supports a single event (the first, if multiple provided in the `query`). Requires permission relevant to processed event. - -Added in Saleor 3.11. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. +Creates/updates translations for shop settings. -Requires one of the following permissions: AUTHENTICATED_STAFF_USER. +Requires one of the following permissions: MANAGE_TRANSLATIONS. """ -type WebhookDryRun @doc(category: "Webhooks") { - """JSON payload, that would be sent out to webhook's target URL.""" - payload: JSONString - errors: [WebhookDryRunError!]! +type ShopSettingsTranslate @doc(category: "Shop") { + """Updated shop settings.""" + shop: Shop + translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [TranslationError!]! } -type WebhookDryRunError @doc(category: "Webhooks") { +type TranslationError { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -17028,37 +21549,47 @@ type WebhookDryRunError @doc(category: "Webhooks") { message: String """The error code.""" - code: WebhookDryRunErrorCode! + code: TranslationErrorCode! } """An enumeration.""" -enum WebhookDryRunErrorCode @doc(category: "Webhooks") { +enum TranslationErrorCode { GRAPHQL_ERROR + INVALID NOT_FOUND - INVALID_ID - MISSING_PERMISSION - TYPE_NOT_SUPPORTED - SYNTAX - MISSING_SUBSCRIPTION - UNABLE_TO_PARSE - MISSING_EVENT + REQUIRED +} + +input ShopSettingsTranslationInput { + headerText: String + description: String } """ -Trigger a webhook event. Supports a single event (the first, if multiple provided in the `webhook.subscription_query`). Requires permission relevant to processed event. Successfully delivered webhook returns `delivery` with status='PENDING' and empty payload. +Update the shop's address. If the `null` value is passed, the currently selected address will be deleted. -Added in Saleor 3.11. +Requires one of the following permissions: MANAGE_SETTINGS. +""" +type ShopAddressUpdate @doc(category: "Shop") { + """Updated shop.""" + shop: Shop + shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShopError!]! +} -Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +Update shop order settings across all channels. Returns `orderSettings` for the first `channel` in alphabetical order. -Requires one of the following permissions: AUTHENTICATED_STAFF_USER. +Requires one of the following permissions: MANAGE_ORDERS. """ -type WebhookTrigger @doc(category: "Webhooks") { - delivery: EventDelivery - errors: [WebhookTriggerError!]! +type OrderSettingsUpdate @doc(category: "Orders") { + """Order settings.""" + orderSettings: OrderSettings + orderSettingsErrors: [OrderSettingsError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderSettingsError!]! } -type WebhookTriggerError @doc(category: "Webhooks") { +type OrderSettingsError @doc(category: "Orders") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -17068,35 +21599,86 @@ type WebhookTriggerError @doc(category: "Webhooks") { message: String """The error code.""" - code: WebhookTriggerErrorCode! + code: OrderSettingsErrorCode! } """An enumeration.""" -enum WebhookTriggerErrorCode @doc(category: "Webhooks") { +enum OrderSettingsErrorCode @doc(category: "Orders") { + INVALID +} + +input OrderSettingsUpdateInput @doc(category: "Orders") { + """ + When disabled, all new orders from checkout will be marked as unconfirmed. When enabled orders from checkout will become unfulfilled immediately. By default set to True + """ + automaticallyConfirmAllNewOrders: Boolean + + """ + When enabled, all non-shippable gift card orders will be fulfilled automatically. By default set to True. + """ + automaticallyFulfillNonShippableGiftCard: Boolean +} + +""" +Update gift card settings. + +Requires one of the following permissions: MANAGE_GIFT_CARD. +""" +type GiftCardSettingsUpdate @doc(category: "Gift cards") { + """Gift card settings.""" + giftCardSettings: GiftCardSettings + errors: [GiftCardSettingsError!]! +} + +type GiftCardSettingsError @doc(category: "Gift cards") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """The error message.""" + message: String + + """The error code.""" + code: GiftCardSettingsErrorCode! +} + +"""An enumeration.""" +enum GiftCardSettingsErrorCode @doc(category: "Gift cards") { + INVALID + REQUIRED GRAPHQL_ERROR - NOT_FOUND - INVALID_ID - MISSING_PERMISSION - TYPE_NOT_SUPPORTED - SYNTAX - MISSING_SUBSCRIPTION - UNABLE_TO_PARSE - MISSING_QUERY - MISSING_EVENT +} + +input GiftCardSettingsUpdateInput @doc(category: "Gift cards") { + """Defines gift card default expiry settings.""" + expiryType: GiftCardSettingsExpiryTypeEnum + + """Defines gift card expiry period.""" + expiryPeriod: TimePeriodInputType +} + +input TimePeriodInputType { + """The length of the period.""" + amount: Int! + + """The type of the period.""" + type: TimePeriodTypeEnum! } """ -Creates new warehouse. +Manage shipping method's availability in channels. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: MANAGE_SHIPPING. """ -type WarehouseCreate @doc(category: "Products") { - warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [WarehouseError!]! - warehouse: Warehouse +type ShippingMethodChannelListingUpdate @doc(category: "Shipping") { + """An updated shipping method instance.""" + shippingMethod: ShippingMethodType + shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShippingError!]! } -type WarehouseError @doc(category: "Products") { +type ShippingError @doc(category: "Shipping") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -17106,227 +21688,311 @@ type WarehouseError @doc(category: "Products") { message: String """The error code.""" - code: WarehouseErrorCode! + code: ShippingErrorCode! - """List of shipping zones IDs which causes the error.""" - shippingZones: [ID!] + """List of warehouse IDs which causes the error.""" + warehouses: [ID!] + + """List of channels IDs which causes the error.""" + channels: [ID!] } """An enumeration.""" -enum WarehouseErrorCode @doc(category: "Products") { +enum ShippingErrorCode @doc(category: "Shipping") { ALREADY_EXISTS GRAPHQL_ERROR INVALID + MAX_LESS_THAN_MIN NOT_FOUND REQUIRED UNIQUE + DUPLICATED_INPUT_ITEM } -input WarehouseCreateInput @doc(category: "Products") { - """Warehouse slug.""" - slug: String +input ShippingMethodChannelListingInput @doc(category: "Shipping") { + """List of channels to which the shipping method should be assigned.""" + addChannels: [ShippingMethodChannelListingAddInput!] - """The email address of the warehouse.""" - email: String + """List of channels from which the shipping method should be unassigned.""" + removeChannels: [ID!] +} + +input ShippingMethodChannelListingAddInput @doc(category: "Shipping") { + """ID of a channel.""" + channelId: ID! + + """Shipping price of the shipping method in this channel.""" + price: PositiveDecimal + + """Minimum order price to use this shipping method.""" + minimumOrderPrice: PositiveDecimal + + """Maximum order price to use this shipping method.""" + maximumOrderPrice: PositiveDecimal +} + +""" +Creates a new shipping price. + +Requires one of the following permissions: MANAGE_SHIPPING. +""" +type ShippingPriceCreate @doc(category: "Shipping") { + """A shipping zone to which the shipping method belongs.""" + shippingZone: ShippingZone + shippingMethod: ShippingMethodType + shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShippingError!]! +} + +input ShippingPriceInput @doc(category: "Shipping") { + """Name of the shipping method.""" + name: String + + """Shipping method description.""" + description: JSONString + + """Minimum order weight to use this shipping method.""" + minimumOrderWeight: WeightScalar + + """Maximum order weight to use this shipping method.""" + maximumOrderWeight: WeightScalar + + """Maximum number of days for delivery.""" + maximumDeliveryDays: Int + + """Minimal number of days for delivery.""" + minimumDeliveryDays: Int + + """Shipping type: price or weight based.""" + type: ShippingMethodTypeEnum + + """Shipping zone this method belongs to.""" + shippingZone: ID + + """Postal code rules to add.""" + addPostalCodeRules: [ShippingPostalCodeRulesCreateInputRange!] + + """Postal code rules to delete.""" + deletePostalCodeRules: [ID!] + + """Inclusion type for currently assigned postal code rules.""" + inclusionType: PostalCodeRuleInclusionTypeEnum """ - External ID of the warehouse. - - Added in Saleor 3.10. + ID of a tax class to assign to this shipping method. If not provided, the default tax class will be used. """ - externalReference: String + taxClass: ID +} - """Warehouse name.""" - name: String! +scalar WeightScalar - """Address of the warehouse.""" - address: AddressInput! +input ShippingPostalCodeRulesCreateInputRange @doc(category: "Shipping") { + """Start range of the postal code.""" + start: String! - """ - Shipping zones supported by the warehouse. - - DEPRECATED: this field will be removed in Saleor 4.0. Providing the zone ids will raise a ValidationError. - """ - shippingZones: [ID!] + """End range of the postal code.""" + end: String } """ -Updates given warehouse. +Deletes a shipping price. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: MANAGE_SHIPPING. """ -type WarehouseUpdate @doc(category: "Products") { - warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [WarehouseError!]! - warehouse: Warehouse +type ShippingPriceDelete @doc(category: "Shipping") { + """A shipping method to delete.""" + shippingMethod: ShippingMethodType + + """A shipping zone to which the shipping method belongs.""" + shippingZone: ShippingZone + shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShippingError!]! } -input WarehouseUpdateInput @doc(category: "Products") { - """Warehouse slug.""" - slug: String +""" +Deletes shipping prices. - """The email address of the warehouse.""" - email: String +Requires one of the following permissions: MANAGE_SHIPPING. +""" +type ShippingPriceBulkDelete @doc(category: "Shipping") { + """Returns how many objects were affected.""" + count: Int! + shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShippingError!]! +} - """ - External ID of the warehouse. - - Added in Saleor 3.10. - """ - externalReference: String +""" +Updates a new shipping price. - """Warehouse name.""" - name: String +Requires one of the following permissions: MANAGE_SHIPPING. +""" +type ShippingPriceUpdate @doc(category: "Shipping") { + """A shipping zone to which the shipping method belongs.""" + shippingZone: ShippingZone + shippingMethod: ShippingMethodType + shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShippingError!]! +} - """Address of the warehouse.""" - address: AddressInput +""" +Creates/updates translations for a shipping method. - """ - Click and collect options: local, all or disabled. - - Added in Saleor 3.1. - """ - clickAndCollectOption: WarehouseClickAndCollectOptionEnum +Requires one of the following permissions: MANAGE_TRANSLATIONS. +""" +type ShippingPriceTranslate @doc(category: "Shipping") { + translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [TranslationError!]! + shippingMethod: ShippingMethodType +} + +input ShippingPriceTranslationInput { + name: String """ - Visibility of warehouse stocks. + Translated shipping method description. - Added in Saleor 3.1. + Rich text format. For reference see https://editorjs.io/ """ - isPrivate: Boolean + description: JSONString } """ -Deletes selected warehouse. +Exclude products from shipping price. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: MANAGE_SHIPPING. """ -type WarehouseDelete @doc(category: "Products") { - warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [WarehouseError!]! - warehouse: Warehouse +type ShippingPriceExcludeProducts @doc(category: "Shipping") { + """A shipping method with new list of excluded products.""" + shippingMethod: ShippingMethodType + shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShippingError!]! +} + +input ShippingPriceExcludeProductsInput @doc(category: "Shipping") { + """List of products which will be excluded.""" + products: [ID!]! } """ -Add shipping zone to given warehouse. +Remove product from excluded list for shipping price. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: MANAGE_SHIPPING. """ -type WarehouseShippingZoneAssign @doc(category: "Products") { - warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [WarehouseError!]! - warehouse: Warehouse +type ShippingPriceRemoveProductFromExclude @doc(category: "Shipping") { + """A shipping method with new list of excluded products.""" + shippingMethod: ShippingMethodType + shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShippingError!]! } """ -Remove shipping zone from given warehouse. +Creates a new shipping zone. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: MANAGE_SHIPPING. """ -type WarehouseShippingZoneUnassign @doc(category: "Products") { - warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [WarehouseError!]! - warehouse: Warehouse +type ShippingZoneCreate @doc(category: "Shipping") { + shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShippingError!]! + shippingZone: ShippingZone } -""" -Create a tax class. +input ShippingZoneCreateInput @doc(category: "Shipping") { + """Shipping zone's name. Visible only to the staff.""" + name: String -Added in Saleor 3.9. + """Description of the shipping zone.""" + description: String -Requires one of the following permissions: MANAGE_TAXES. -""" -type TaxClassCreate @doc(category: "Taxes") { - errors: [TaxClassCreateError!]! - taxClass: TaxClass -} + """List of countries in this shipping zone.""" + countries: [String!] -type TaxClassCreateError @doc(category: "Taxes") { """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + Default shipping zone will be used for countries not covered by other zones. """ - field: String - - """The error message.""" - message: String - - """The error code.""" - code: TaxClassCreateErrorCode! + default: Boolean - """List of country codes for which the configuration is invalid.""" - countryCodes: [String!]! -} + """List of warehouses to assign to a shipping zone""" + addWarehouses: [ID!] -"""An enumeration.""" -enum TaxClassCreateErrorCode @doc(category: "Taxes") { - GRAPHQL_ERROR - INVALID - NOT_FOUND + """List of channels to assign to the shipping zone.""" + addChannels: [ID!] } -input TaxClassCreateInput @doc(category: "Taxes") { - """Name of the tax class.""" - name: String! +""" +Deletes a shipping zone. - """List of country-specific tax rates to create for this tax class.""" - createCountryRates: [CountryRateInput!] +Requires one of the following permissions: MANAGE_SHIPPING. +""" +type ShippingZoneDelete @doc(category: "Shipping") { + shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShippingError!]! + shippingZone: ShippingZone } -input CountryRateInput @doc(category: "Taxes") { - """Country in which this rate applies.""" - countryCode: CountryCode! +""" +Deletes shipping zones. - """ - Tax rate value provided as percentage. Example: provide `23` to represent `23%` tax rate. - """ - rate: Float! +Requires one of the following permissions: MANAGE_SHIPPING. +""" +type ShippingZoneBulkDelete @doc(category: "Shipping") { + """Returns how many objects were affected.""" + count: Int! + shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShippingError!]! } """ -Delete a tax class. After deleting the tax class any products, product types or shipping methods using it are updated to use the default tax class. - -Added in Saleor 3.9. +Updates a new shipping zone. -Requires one of the following permissions: MANAGE_TAXES. +Requires one of the following permissions: MANAGE_SHIPPING. """ -type TaxClassDelete @doc(category: "Taxes") { - errors: [TaxClassDeleteError!]! - taxClass: TaxClass +type ShippingZoneUpdate @doc(category: "Shipping") { + shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ShippingError!]! + shippingZone: ShippingZone } -type TaxClassDeleteError @doc(category: "Taxes") { +input ShippingZoneUpdateInput @doc(category: "Shipping") { + """Shipping zone's name. Visible only to the staff.""" + name: String + + """Description of the shipping zone.""" + description: String + + """List of countries in this shipping zone.""" + countries: [String!] + """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + Default shipping zone will be used for countries not covered by other zones. """ - field: String - - """The error message.""" - message: String + default: Boolean - """The error code.""" - code: TaxClassDeleteErrorCode! -} + """List of warehouses to assign to a shipping zone""" + addWarehouses: [ID!] -"""An enumeration.""" -enum TaxClassDeleteErrorCode @doc(category: "Taxes") { - GRAPHQL_ERROR - INVALID - NOT_FOUND + """List of channels to assign to the shipping zone.""" + addChannels: [ID!] + + """List of warehouses to unassign from a shipping zone""" + removeWarehouses: [ID!] + + """List of channels to unassign from the shipping zone.""" + removeChannels: [ID!] } """ -Update a tax class. - -Added in Saleor 3.9. +Assign attributes to a given product type. -Requires one of the following permissions: MANAGE_TAXES. +Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. """ -type TaxClassUpdate @doc(category: "Taxes") { - errors: [TaxClassUpdateError!]! - taxClass: TaxClass +type ProductAttributeAssign @doc(category: "Products") { + """The updated product type.""" + productType: ProductType + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! } -type TaxClassUpdateError @doc(category: "Taxes") { +type ProductError @doc(category: "Products") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -17336,139 +22002,230 @@ type TaxClassUpdateError @doc(category: "Taxes") { message: String """The error code.""" - code: TaxClassUpdateErrorCode! + code: ProductErrorCode! - """List of country codes for which the configuration is invalid.""" - countryCodes: [String!]! + """List of attributes IDs which causes the error.""" + attributes: [ID!] + + """List of attribute values IDs which causes the error.""" + values: [ID!] } """An enumeration.""" -enum TaxClassUpdateErrorCode @doc(category: "Taxes") { +enum ProductErrorCode @doc(category: "Products") { + ALREADY_EXISTS + ATTRIBUTE_ALREADY_ASSIGNED + ATTRIBUTE_CANNOT_BE_ASSIGNED + ATTRIBUTE_VARIANTS_DISABLED + MEDIA_ALREADY_ASSIGNED DUPLICATED_INPUT_ITEM GRAPHQL_ERROR INVALID + INVALID_PRICE + PRODUCT_WITHOUT_CATEGORY + NOT_PRODUCTS_IMAGE + NOT_PRODUCTS_VARIANT NOT_FOUND + REQUIRED + UNIQUE + VARIANT_NO_DIGITAL_CONTENT + CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT + PRODUCT_NOT_ASSIGNED_TO_CHANNEL + UNSUPPORTED_MEDIA_PROVIDER + PREORDER_VARIANT_CANNOT_BE_DEACTIVATED } -input TaxClassUpdateInput @doc(category: "Taxes") { - """Name of the tax class.""" - name: String +input ProductAttributeAssignInput @doc(category: "Products") { + """The ID of the attribute to assign.""" + id: ID! - """ - List of country-specific tax rates to create or update for this tax class. - """ - updateCountryRates: [CountryRateUpdateInput!] + """The attribute type to be assigned as.""" + type: ProductAttributeType! """ - List of country codes for which to remove the tax class rates. Note: It removes all rates for given country code. + Whether attribute is allowed in variant selection. Allowed types are: ['dropdown', 'boolean', 'swatch', 'numeric']. + + Added in Saleor 3.1. """ - removeCountryRates: [CountryCode!] + variantSelection: Boolean } -input CountryRateUpdateInput @doc(category: "Taxes") { - """Country in which this rate applies.""" - countryCode: CountryCode! +enum ProductAttributeType @doc(category: "Products") { + PRODUCT + VARIANT +} + +""" +Update attributes assigned to product variant for given product type. + +Added in Saleor 3.1. + +Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. +""" +type ProductAttributeAssignmentUpdate @doc(category: "Products") { + """The updated product type.""" + productType: ProductType + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! +} + +input ProductAttributeAssignmentUpdateInput @doc(category: "Products") { + """The ID of the attribute to assign.""" + id: ID! """ - Tax rate value provided as percentage. Example: provide `23` to represent `23%` tax rate. Provide `null` to remove the particular rate. + Whether attribute is allowed in variant selection. Allowed types are: ['dropdown', 'boolean', 'swatch', 'numeric']. + + Added in Saleor 3.1. """ - rate: Float + variantSelection: Boolean! } """ -Update tax configuration for a channel. +Un-assign attributes from a given product type. -Added in Saleor 3.9. +Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. +""" +type ProductAttributeUnassign @doc(category: "Products") { + """The updated product type.""" + productType: ProductType + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! +} -Requires one of the following permissions: MANAGE_TAXES. """ -type TaxConfigurationUpdate @doc(category: "Taxes") { - errors: [TaxConfigurationUpdateError!]! - taxConfiguration: TaxConfiguration +Creates a new category. + +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type CategoryCreate @doc(category: "Products") { + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! + category: Category } -type TaxConfigurationUpdateError @doc(category: "Taxes") { +input CategoryInput @doc(category: "Products") { """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + Category description. + + Rich text format. For reference see https://editorjs.io/ """ - field: String + description: JSONString - """The error message.""" - message: String + """Category name.""" + name: String - """The error code.""" - code: TaxConfigurationUpdateErrorCode! + """Category slug.""" + slug: String - """List of country codes for which the configuration is invalid.""" - countryCodes: [String!]! -} + """Search engine optimization fields.""" + seo: SeoInput -"""An enumeration.""" -enum TaxConfigurationUpdateErrorCode @doc(category: "Taxes") { - DUPLICATED_INPUT_ITEM - GRAPHQL_ERROR - INVALID - NOT_FOUND -} + """Background image file.""" + backgroundImage: Upload -input TaxConfigurationUpdateInput @doc(category: "Taxes") { - """Determines whether taxes are charged in the given channel.""" - chargeTaxes: Boolean + """Alt text for a product media.""" + backgroundImageAlt: String """ - The default strategy to use for tax calculation in the given channel. Taxes can be calculated either using user-defined flat rates or with a tax app. Empty value means that no method is selected and taxes are not calculated. + Fields required to update the category metadata. + + Added in Saleor 3.8. """ - taxCalculationStrategy: TaxCalculationStrategy + metadata: [MetadataInput!] """ - Determines whether prices displayed in a storefront should include taxes. + Fields required to update the category private metadata. + + Added in Saleor 3.8. """ - displayGrossPrices: Boolean + privateMetadata: [MetadataInput!] +} - """Determines whether prices are entered with the tax included.""" - pricesEnteredWithTax: Boolean +input SeoInput { + """SEO title.""" + title: String - """ - List of tax country configurations to create or update (identified by a country code). - """ - updateCountriesConfiguration: [TaxConfigurationPerCountryInput!] + """SEO description.""" + description: String +} - """List of country codes for which to remove the tax configuration.""" - removeCountriesConfiguration: [CountryCode!] +""" +Variables of this type must be set to null in mutations. They will be replaced with a filename from a following multipart part containing a binary file. See: https://github.com/jaydenseric/graphql-multipart-request-spec. +""" +scalar Upload + +""" +Deletes a category. + +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type CategoryDelete @doc(category: "Products") { + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! + category: Category } -input TaxConfigurationPerCountryInput @doc(category: "Taxes") { - """Country in which this configuration applies.""" - countryCode: CountryCode! +""" +Deletes categories. - """Determines whether taxes are charged in this country.""" - chargeTaxes: Boolean! +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type CategoryBulkDelete @doc(category: "Products") { + """Returns how many objects were affected.""" + count: Int! + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! +} - """ - A country-specific strategy to use for tax calculation. Taxes can be calculated either using user-defined flat rates or with a tax app. If not provided, use the value from the channel's tax configuration. - """ - taxCalculationStrategy: TaxCalculationStrategy +""" +Updates a category. + +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type CategoryUpdate @doc(category: "Products") { + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! + category: Category +} + +""" +Creates/updates translations for a category. + +Requires one of the following permissions: MANAGE_TRANSLATIONS. +""" +type CategoryTranslate @doc(category: "Products") { + translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [TranslationError!]! + category: Category +} + +input TranslationInput { + seoTitle: String + seoDescription: String + name: String """ - Determines whether prices displayed in a storefront should include taxes for this country. + Translated description. + + Rich text format. For reference see https://editorjs.io/ """ - displayGrossPrices: Boolean! + description: JSONString } """ -Update tax class rates for a specific country. - -Added in Saleor 3.9. +Adds products to a collection. -Requires one of the following permissions: MANAGE_TAXES. +Requires one of the following permissions: MANAGE_PRODUCTS. """ -type TaxCountryConfigurationUpdate @doc(category: "Taxes") { - """Updated tax class rates grouped by a country.""" - taxCountryConfiguration: TaxCountryConfiguration - errors: [TaxCountryConfigurationUpdateError!]! +type CollectionAddProducts @doc(category: "Products") { + """Collection to which products will be added.""" + collection: Collection + collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [CollectionError!]! } -type TaxCountryConfigurationUpdateError @doc(category: "Taxes") { +type CollectionError @doc(category: "Products") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -17477,187 +22234,226 @@ type TaxCountryConfigurationUpdateError @doc(category: "Taxes") { """The error message.""" message: String - """The error code.""" - code: TaxCountryConfigurationUpdateErrorCode! + """List of products IDs which causes the error.""" + products: [ID!] - """List of tax class IDs for which the update failed.""" - taxClassIds: [String!]! + """The error code.""" + code: CollectionErrorCode! } """An enumeration.""" -enum TaxCountryConfigurationUpdateErrorCode @doc(category: "Taxes") { +enum CollectionErrorCode @doc(category: "Products") { + DUPLICATED_INPUT_ITEM GRAPHQL_ERROR INVALID NOT_FOUND - ONLY_ONE_DEFAULT_COUNTRY_RATE_ALLOWED - CANNOT_CREATE_NEGATIVE_RATE + REQUIRED + UNIQUE + CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT } -input TaxClassRateInput @doc(category: "Taxes") { - """ID of a tax class for which to update the tax rate""" - taxClassId: ID +""" +Creates a new collection. - """Tax rate value.""" - rate: Float +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type CollectionCreate @doc(category: "Products") { + collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [CollectionError!]! + collection: Collection } -""" -Remove all tax class rates for a specific country. +input CollectionCreateInput @doc(category: "Products") { + """Informs whether a collection is published.""" + isPublished: Boolean -Added in Saleor 3.9. + """Name of the collection.""" + name: String -Requires one of the following permissions: MANAGE_TAXES. -""" -type TaxCountryConfigurationDelete @doc(category: "Taxes") { - """Updated tax class rates grouped by a country.""" - taxCountryConfiguration: TaxCountryConfiguration - errors: [TaxCountryConfigurationDeleteError!]! -} + """Slug of the collection.""" + slug: String -type TaxCountryConfigurationDeleteError @doc(category: "Taxes") { """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + Description of the collection. + + Rich text format. For reference see https://editorjs.io/ """ - field: String + description: JSONString - """The error message.""" - message: String + """Background image file.""" + backgroundImage: Upload - """The error code.""" - code: TaxCountryConfigurationDeleteErrorCode! -} + """Alt text for an image.""" + backgroundImageAlt: String -"""An enumeration.""" -enum TaxCountryConfigurationDeleteErrorCode @doc(category: "Taxes") { - GRAPHQL_ERROR - INVALID - NOT_FOUND + """Search engine optimization fields.""" + seo: SeoInput + + """ + Publication date. ISO 8601 standard. + + DEPRECATED: this field will be removed in Saleor 4.0. + """ + publicationDate: Date + + """ + Fields required to update the collection metadata. + + Added in Saleor 3.8. + """ + metadata: [MetadataInput!] + + """ + Fields required to update the collection private metadata. + + Added in Saleor 3.8. + """ + privateMetadata: [MetadataInput!] + + """List of products to be added to the collection.""" + products: [ID!] } """ -Exempt checkout or order from charging the taxes. When tax exemption is enabled, taxes won't be charged for the checkout or order. Taxes may still be calculated in cases when product prices are entered with the tax included and the net price needs to be known. +Deletes a collection. -Added in Saleor 3.8. +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type CollectionDelete @doc(category: "Products") { + collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [CollectionError!]! + collection: Collection +} -Requires one of the following permissions: MANAGE_TAXES. """ -type TaxExemptionManage @doc(category: "Taxes") { - taxableObject: TaxSourceObject - errors: [TaxExemptionManageError!]! +Reorder the products of a collection. + +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type CollectionReorderProducts @doc(category: "Products") { + """Collection from which products are reordered.""" + collection: Collection + collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [CollectionError!]! } -union TaxSourceObject = Checkout | Order +input MoveProductInput @doc(category: "Products") { + """The ID of the product to move.""" + productId: ID! -type TaxExemptionManageError @doc(category: "Taxes") { """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + The relative sorting position of the product (from -inf to +inf) starting from the first given product's actual position.1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. """ - field: String - - """The error message.""" - message: String - - """The error code.""" - code: TaxExemptionManageErrorCode! + sortOrder: Int } -"""An enumeration.""" -enum TaxExemptionManageErrorCode @doc(category: "Taxes") { - GRAPHQL_ERROR - INVALID - NOT_FOUND - NOT_EDITABLE_ORDER +""" +Deletes collections. + +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type CollectionBulkDelete @doc(category: "Products") { + """Returns how many objects were affected.""" + count: Int! + collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [CollectionError!]! } """ -Updates stocks for a given variant and warehouse. +Remove products from a collection. -Added in Saleor 3.13. +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type CollectionRemoveProducts @doc(category: "Products") { + """Collection from which products will be removed.""" + collection: Collection + collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [CollectionError!]! +} -Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +Updates a collection. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type StockBulkUpdate @doc(category: "Products") { - """Returns how many objects were updated.""" - count: Int! - - """List of the updated stocks.""" - results: [StockBulkResult!]! - errors: [StockBulkUpdateError!]! +type CollectionUpdate @doc(category: "Products") { + collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [CollectionError!]! + collection: Collection } -type StockBulkResult @doc(category: "Products") { - """Stock data.""" - stock: Stock +input CollectionInput @doc(category: "Products") { + """Informs whether a collection is published.""" + isPublished: Boolean - """List of errors occurred on create or update attempt.""" - errors: [StockBulkUpdateError!] -} + """Name of the collection.""" + name: String + + """Slug of the collection.""" + slug: String -type StockBulkUpdateError @doc(category: "Products") { """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + Description of the collection. + + Rich text format. For reference see https://editorjs.io/ """ - field: String + description: JSONString - """The error message.""" - message: String + """Background image file.""" + backgroundImage: Upload - """The error code.""" - code: StockBulkUpdateErrorCode! -} + """Alt text for an image.""" + backgroundImageAlt: String -"""An enumeration.""" -enum StockBulkUpdateErrorCode @doc(category: "Products") { - GRAPHQL_ERROR - INVALID - NOT_FOUND - REQUIRED -} + """Search engine optimization fields.""" + seo: SeoInput -enum ErrorPolicyEnum { """ - Save what is possible within a single row. If there are errors in an input data row, try to save it partially and skip the invalid part. + Publication date. ISO 8601 standard. + + DEPRECATED: this field will be removed in Saleor 4.0. """ - IGNORE_FAILED + publicationDate: Date - """Reject all rows if there is at least one error in any of them.""" - REJECT_EVERYTHING + """ + Fields required to update the collection metadata. + + Added in Saleor 3.8. + """ + metadata: [MetadataInput!] - """Reject rows with errors.""" - REJECT_FAILED_ROWS + """ + Fields required to update the collection private metadata. + + Added in Saleor 3.8. + """ + privateMetadata: [MetadataInput!] } -input StockBulkUpdateInput @doc(category: "Products") { - """Variant ID.""" - variantId: ID - - """Variant external reference.""" - variantExternalReference: String - - """Warehouse ID.""" - warehouseId: ID - - """Warehouse external reference.""" - warehouseExternalReference: String - - """Quantity of items available for sell.""" - quantity: Int! +""" +Creates/updates translations for a collection. + +Requires one of the following permissions: MANAGE_TRANSLATIONS. +""" +type CollectionTranslate @doc(category: "Products") { + translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [TranslationError!]! + collection: Collection } """ -Creates a new staff notification recipient. +Manage collection's availability in channels. -Requires one of the following permissions: MANAGE_SETTINGS. +Requires one of the following permissions: MANAGE_PRODUCTS. """ -type StaffNotificationRecipientCreate @doc(category: "Users") { - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShopError!]! - staffNotificationRecipient: StaffNotificationRecipient +type CollectionChannelListingUpdate @doc(category: "Products") { + """An updated collection instance.""" + collection: Collection + collectionChannelListingErrors: [CollectionChannelListingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [CollectionChannelListingError!]! } -type ShopError @doc(category: "Shop") { +type CollectionChannelListingError @doc(category: "Products") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -17667,892 +22463,799 @@ type ShopError @doc(category: "Shop") { message: String """The error code.""" - code: ShopErrorCode! -} - -"""An enumeration.""" -enum ShopErrorCode { - ALREADY_EXISTS - CANNOT_FETCH_TAX_RATES - GRAPHQL_ERROR - INVALID - NOT_FOUND - REQUIRED - UNIQUE -} - -input StaffNotificationRecipientInput { - """The ID of the user subscribed to email notifications..""" - user: ID - - """Email address of a user subscribed to email notifications.""" - email: String + code: ProductErrorCode! - """Determines if a notification active.""" - active: Boolean -} + """List of attributes IDs which causes the error.""" + attributes: [ID!] -""" -Updates a staff notification recipient. + """List of attribute values IDs which causes the error.""" + values: [ID!] -Requires one of the following permissions: MANAGE_SETTINGS. -""" -type StaffNotificationRecipientUpdate @doc(category: "Users") { - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShopError!]! - staffNotificationRecipient: StaffNotificationRecipient + """List of channels IDs which causes the error.""" + channels: [ID!] } -""" -Delete staff notification recipient. +input CollectionChannelListingUpdateInput @doc(category: "Products") { + """List of channels to which the collection should be assigned.""" + addChannels: [PublishableChannelListingInput!] -Requires one of the following permissions: MANAGE_SETTINGS. -""" -type StaffNotificationRecipientDelete @doc(category: "Users") { - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShopError!]! - staffNotificationRecipient: StaffNotificationRecipient + """List of channels from which the collection should be unassigned.""" + removeChannels: [ID!] } -""" -Updates site domain of the shop. +input PublishableChannelListingInput @doc(category: "Products") { + """ID of a channel.""" + channelId: ID! -Requires one of the following permissions: MANAGE_SETTINGS. -""" -type ShopDomainUpdate @doc(category: "Shop") { - """Updated shop.""" - shop: Shop - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShopError!]! -} + """Determines if object is visible to customers.""" + isPublished: Boolean -input SiteDomainInput { - """Domain name for shop.""" - domain: String + """ + Publication date. ISO 8601 standard. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `publishedAt` field instead. + """ + publicationDate: Date - """Shop site name.""" - name: String + """ + Publication date time. ISO 8601 standard. + + Added in Saleor 3.3. + """ + publishedAt: DateTime } """ -Updates shop settings. +Creates a new product. -Requires one of the following permissions: MANAGE_SETTINGS. +Requires one of the following permissions: MANAGE_PRODUCTS. """ -type ShopSettingsUpdate @doc(category: "Shop") { - """Updated shop.""" - shop: Shop - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShopError!]! +type ProductCreate @doc(category: "Products") { + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! + product: Product } -input ShopSettingsInput { - """Header text.""" - headerText: String - - """SEO description.""" - description: String - - """Enable inventory tracking.""" - trackInventoryByDefault: Boolean - - """Default weight unit.""" - defaultWeightUnit: WeightUnitsEnum +input ProductCreateInput @doc(category: "Products") { + """List of attributes.""" + attributes: [AttributeValueInput!] - """Enable automatic fulfillment for all digital products.""" - automaticFulfillmentDigitalProducts: Boolean + """ID of the product's category.""" + category: ID """ - Enable automatic approval of all new fulfillments. + Determine if taxes are being charged for the product. - Added in Saleor 3.1. + DEPRECATED: this field will be removed in Saleor 4.0. Use `Channel.taxConfiguration` to configure whether tax collection is enabled. """ - fulfillmentAutoApprove: Boolean + chargeTaxes: Boolean + + """List of IDs of collections that the product belongs to.""" + collections: [ID!] """ - Enable ability to approve fulfillments which are unpaid. + Product description. - Added in Saleor 3.1. + Rich text format. For reference see https://editorjs.io/ """ - fulfillmentAllowUnpaid: Boolean + description: JSONString - """Default number of max downloads per digital content URL.""" - defaultDigitalMaxDownloads: Int + """Product name.""" + name: String - """Default number of days which digital content URL will be valid.""" - defaultDigitalUrlValidDays: Int + """Product slug.""" + slug: String - """Default email sender's name.""" - defaultMailSenderName: String + """ + ID of a tax class to assign to this product. If not provided, product will use the tax class which is assigned to the product type. + """ + taxClass: ID - """Default email sender's address.""" - defaultMailSenderAddress: String + """ + Tax rate for enabled tax gateway. + + DEPRECATED: this field will be removed in Saleor 4.0. Use tax classes to control the tax calculation for a product. If taxCode is provided, Saleor will try to find a tax class with given code (codes are stored in metadata) and assign it. If no tax class is found, it would be created and assigned. + """ + taxCode: String - """URL of a view where customers can set their password.""" - customerSetPasswordUrl: String + """Search engine optimization fields.""" + seo: SeoInput + + """Weight of the Product.""" + weight: WeightScalar + + """Defines the product rating value.""" + rating: Float """ - Default number of minutes stock will be reserved for anonymous checkout. Enter 0 or null to disable. + Fields required to update the product metadata. - Added in Saleor 3.1. + Added in Saleor 3.8. """ - reserveStockDurationAnonymousUser: Int + metadata: [MetadataInput!] """ - Default number of minutes stock will be reserved for authenticated checkout. Enter 0 or null to disable. + Fields required to update the product private metadata. - Added in Saleor 3.1. + Added in Saleor 3.8. """ - reserveStockDurationAuthenticatedUser: Int + privateMetadata: [MetadataInput!] """ - Default number of maximum line quantity in single checkout. Minimum possible value is 1, default value is 50. + External ID of this product. - Added in Saleor 3.1. + Added in Saleor 3.10. """ - limitQuantityPerCheckout: Int + externalReference: String + + """ID of the type that product belongs to.""" + productType: ID! +} + +input AttributeValueInput @doc(category: "Attributes") { + """ID of the selected attribute.""" + id: ID """ - Include taxes in prices. + External ID of this attribute. - DEPRECATED: this field will be removed in Saleor 4.0. Use `taxConfigurationUpdate` mutation to configure this setting per channel or country. + Added in Saleor 3.14. """ - includeTaxesInPrices: Boolean + externalReference: String """ - Display prices with tax in store. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `taxConfigurationUpdate` mutation to configure this setting per channel or country. + The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. This field will be removed in Saleor 4.0. """ - displayGrossPrices: Boolean + values: [String!] """ - Charge taxes on shipping. + Attribute value ID or external reference. - DEPRECATED: this field will be removed in Saleor 4.0. To enable taxes for a shipping method, assign a tax class to the shipping method with `shippingPriceCreate` or `shippingPriceUpdate` mutations. + Added in Saleor 3.9. """ - chargeTaxesOnShipping: Boolean -} - -""" -Fetch tax rates. - -Requires one of the following permissions: MANAGE_SETTINGS. -""" -type ShopFetchTaxRates @doc(category: "Shop") { - """Updated shop.""" - shop: Shop - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShopError!]! -} + dropdown: AttributeValueSelectableTypeInput -""" -Creates/updates translations for shop settings. + """ + Attribute value ID or external reference. + + Added in Saleor 3.9. + """ + swatch: AttributeValueSelectableTypeInput -Requires one of the following permissions: MANAGE_TRANSLATIONS. -""" -type ShopSettingsTranslate @doc(category: "Shop") { - """Updated shop settings.""" - shop: Shop - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [TranslationError!]! -} + """ + List of attribute value IDs or external references. + + Added in Saleor 3.9. + """ + multiselect: [AttributeValueSelectableTypeInput!] -type TranslationError { """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + Numeric value of an attribute. + + Added in Saleor 3.9. """ - field: String + numeric: String - """The error message.""" - message: String + """URL of the file attribute. Every time, a new value is created.""" + file: String - """The error code.""" - code: TranslationErrorCode! -} + """File content type.""" + contentType: String -"""An enumeration.""" -enum TranslationErrorCode { - GRAPHQL_ERROR - INVALID - NOT_FOUND - REQUIRED -} + """List of entity IDs that will be used as references.""" + references: [ID!] -input ShopSettingsTranslationInput { - headerText: String - description: String -} + """Text content in JSON format.""" + richText: JSONString -""" -Update the shop's address. If the `null` value is passed, the currently selected address will be deleted. + """Plain text content.""" + plainText: String -Requires one of the following permissions: MANAGE_SETTINGS. -""" -type ShopAddressUpdate @doc(category: "Shop") { - """Updated shop.""" - shop: Shop - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShopError!]! -} + """Represents the boolean value of the attribute value.""" + boolean: Boolean -""" -Update shop order settings across all channels. Returns `orderSettings` for the first `channel` in alphabetical order. + """Represents the date value of the attribute value.""" + date: Date -Requires one of the following permissions: MANAGE_ORDERS. -""" -type OrderSettingsUpdate @doc(category: "Orders") { - """Order settings.""" - orderSettings: OrderSettings - orderSettingsErrors: [OrderSettingsError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderSettingsError!]! + """Represents the date/time value of the attribute value.""" + dateTime: DateTime } -type OrderSettingsError @doc(category: "Orders") { - """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - """ - field: String - - """The error message.""" - message: String - - """The error code.""" - code: OrderSettingsErrorCode! -} +""" +Represents attribute value. +1. If ID is provided, then attribute value will be resolved by ID. +2. If externalReference is provided, then attribute value will be resolved by external reference. +3. If value is provided, then attribute value will be resolved by value. If this attribute value doesn't exist, then it will be created. +4. If externalReference and value is provided then new attribute value will be created. -"""An enumeration.""" -enum OrderSettingsErrorCode @doc(category: "Orders") { - INVALID -} +Added in Saleor 3.9. +""" +input AttributeValueSelectableTypeInput @doc(category: "Attributes") { + """ID of an attribute value.""" + id: ID -input OrderSettingsUpdateInput @doc(category: "Orders") { """ - When disabled, all new orders from checkout will be marked as unconfirmed. When enabled orders from checkout will become unfulfilled immediately. By default set to True + External reference of an attribute value. + + Added in Saleor 3.14. """ - automaticallyConfirmAllNewOrders: Boolean + externalReference: String """ - When enabled, all non-shippable gift card orders will be fulfilled automatically. By defualt set to True. + The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. """ - automaticallyFulfillNonShippableGiftCard: Boolean + value: String } """ -Update gift card settings. +Deletes a product. -Requires one of the following permissions: MANAGE_GIFT_CARD. +Requires one of the following permissions: MANAGE_PRODUCTS. """ -type GiftCardSettingsUpdate @doc(category: "Gift cards") { - """Gift card settings.""" - giftCardSettings: GiftCardSettings - errors: [GiftCardSettingsError!]! -} - -type GiftCardSettingsError @doc(category: "Gift cards") { - """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - """ - field: String - - """The error message.""" - message: String - - """The error code.""" - code: GiftCardSettingsErrorCode! +type ProductDelete @doc(category: "Products") { + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! + product: Product } -"""An enumeration.""" -enum GiftCardSettingsErrorCode @doc(category: "Gift cards") { - INVALID - REQUIRED - GRAPHQL_ERROR -} +""" +Creates products. -input GiftCardSettingsUpdateInput @doc(category: "Gift cards") { - """Defines gift card default expiry settings.""" - expiryType: GiftCardSettingsExpiryTypeEnum +Added in Saleor 3.13. - """Defines gift card expiry period.""" - expiryPeriod: TimePeriodInputType -} +Note: this API is currently in Feature Preview and can be subject to changes at later point. -input TimePeriodInputType { - """The length of the period.""" - amount: Int! +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type ProductBulkCreate @doc(category: "Products") { + """Returns how many objects were created.""" + count: Int! - """The type of the period.""" - type: TimePeriodTypeEnum! + """List of the created products.""" + results: [ProductBulkResult!]! + errors: [ProductBulkCreateError!]! } -""" -Manage shipping method's availability in channels. +type ProductBulkResult @doc(category: "Products") { + """Product data.""" + product: Product -Requires one of the following permissions: MANAGE_SHIPPING. -""" -type ShippingMethodChannelListingUpdate @doc(category: "Shipping") { - """An updated shipping method instance.""" - shippingMethod: ShippingMethodType - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShippingError!]! + """List of errors occurred on create attempt.""" + errors: [ProductBulkCreateError!] } -type ShippingError @doc(category: "Shipping") { +type ProductBulkCreateError @doc(category: "Products") { """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + Path to field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - field: String + path: String """The error message.""" message: String """The error code.""" - code: ShippingErrorCode! + code: ProductBulkCreateErrorCode! + + """List of attributes IDs which causes the error.""" + attributes: [ID!] + + """List of attribute values IDs which causes the error.""" + values: [ID!] """List of warehouse IDs which causes the error.""" warehouses: [ID!] - """List of channels IDs which causes the error.""" + """List of channel IDs which causes the error.""" channels: [ID!] } """An enumeration.""" -enum ShippingErrorCode @doc(category: "Shipping") { - ALREADY_EXISTS +enum ProductBulkCreateErrorCode @doc(category: "Products") { + ATTRIBUTE_ALREADY_ASSIGNED + ATTRIBUTE_CANNOT_BE_ASSIGNED + ATTRIBUTE_VARIANTS_DISABLED + BLANK + MAX_LENGTH + DUPLICATED_INPUT_ITEM GRAPHQL_ERROR INVALID - MAX_LESS_THAN_MIN + INVALID_PRICE + PRODUCT_WITHOUT_CATEGORY NOT_FOUND REQUIRED UNIQUE - DUPLICATED_INPUT_ITEM -} - -input ShippingMethodChannelListingInput @doc(category: "Shipping") { - """List of channels to which the shipping method should be assigned.""" - addChannels: [ShippingMethodChannelListingAddInput!] - - """List of channels from which the shipping method should be unassigned.""" - removeChannels: [ID!] -} - -input ShippingMethodChannelListingAddInput @doc(category: "Shipping") { - """ID of a channel.""" - channelId: ID! - - """Shipping price of the shipping method in this channel.""" - price: PositiveDecimal - - """Minimum order price to use this shipping method.""" - minimumOrderPrice: PositiveDecimal - - """Maximum order price to use this shipping method.""" - maximumOrderPrice: PositiveDecimal -} - -""" -Creates a new shipping price. - -Requires one of the following permissions: MANAGE_SHIPPING. -""" -type ShippingPriceCreate @doc(category: "Shipping") { - """A shipping zone to which the shipping method belongs.""" - shippingZone: ShippingZone - shippingMethod: ShippingMethodType - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShippingError!]! + PRODUCT_NOT_ASSIGNED_TO_CHANNEL + UNSUPPORTED_MEDIA_PROVIDER } -input ShippingPriceInput @doc(category: "Shipping") { - """Name of the shipping method.""" - name: String - - """Shipping method description.""" - description: JSONString - - """Minimum order weight to use this shipping method.""" - minimumOrderWeight: WeightScalar - - """Maximum order weight to use this shipping method.""" - maximumOrderWeight: WeightScalar - - """Maximum number of days for delivery.""" - maximumDeliveryDays: Int - - """Minimal number of days for delivery.""" - minimumDeliveryDays: Int +input ProductBulkCreateInput @doc(category: "Products") { + """List of attributes.""" + attributes: [AttributeValueInput!] - """Shipping type: price or weight based.""" - type: ShippingMethodTypeEnum + """ID of the product's category.""" + category: ID - """Shipping zone this method belongs to.""" - shippingZone: ID + """ + Determine if taxes are being charged for the product. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `Channel.taxConfiguration` to configure whether tax collection is enabled. + """ + chargeTaxes: Boolean - """Postal code rules to add.""" - addPostalCodeRules: [ShippingPostalCodeRulesCreateInputRange!] + """List of IDs of collections that the product belongs to.""" + collections: [ID!] - """Postal code rules to delete.""" - deletePostalCodeRules: [ID!] + """ + Product description. + + Rich text format. For reference see https://editorjs.io/ + """ + description: JSONString - """Inclusion type for currently assigned postal code rules.""" - inclusionType: PostalCodeRuleInclusionTypeEnum + """Product name.""" + name: String + + """Product slug.""" + slug: String """ - ID of a tax class to assign to this shipping method. If not provided, the default tax class will be used. + ID of a tax class to assign to this product. If not provided, product will use the tax class which is assigned to the product type. """ taxClass: ID -} - -scalar WeightScalar -input ShippingPostalCodeRulesCreateInputRange @doc(category: "Shipping") { - """Start range of the postal code.""" - start: String! + """ + Tax rate for enabled tax gateway. + + DEPRECATED: this field will be removed in Saleor 4.0. Use tax classes to control the tax calculation for a product. If taxCode is provided, Saleor will try to find a tax class with given code (codes are stored in metadata) and assign it. If no tax class is found, it would be created and assigned. + """ + taxCode: String - """End range of the postal code.""" - end: String -} + """Search engine optimization fields.""" + seo: SeoInput -""" -Deletes a shipping price. + """Weight of the Product.""" + weight: WeightScalar -Requires one of the following permissions: MANAGE_SHIPPING. -""" -type ShippingPriceDelete @doc(category: "Shipping") { - """A shipping method to delete.""" - shippingMethod: ShippingMethodType + """Defines the product rating value.""" + rating: Float - """A shipping zone to which the shipping method belongs.""" - shippingZone: ShippingZone - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShippingError!]! -} + """Fields required to update the product metadata.""" + metadata: [MetadataInput!] -""" -Deletes shipping prices. + """Fields required to update the product private metadata.""" + privateMetadata: [MetadataInput!] -Requires one of the following permissions: MANAGE_SHIPPING. -""" -type ShippingPriceBulkDelete @doc(category: "Shipping") { - """Returns how many objects were affected.""" - count: Int! - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShippingError!]! -} + """External ID of this product.""" + externalReference: String -""" -Updates a new shipping price. + """ID of the type that product belongs to.""" + productType: ID! -Requires one of the following permissions: MANAGE_SHIPPING. -""" -type ShippingPriceUpdate @doc(category: "Shipping") { - """A shipping zone to which the shipping method belongs.""" - shippingZone: ShippingZone - shippingMethod: ShippingMethodType - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShippingError!]! -} + """List of media inputs associated with the product.""" + media: [MediaInput!] -""" -Creates/updates translations for a shipping method. + """List of channels in which the product is available.""" + channelListings: [ProductChannelListingCreateInput!] -Requires one of the following permissions: MANAGE_TRANSLATIONS. -""" -type ShippingPriceTranslate @doc(category: "Shipping") { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [TranslationError!]! - shippingMethod: ShippingMethodType + """Input list of product variants to create.""" + variants: [ProductVariantBulkCreateInput!] } -input ShippingPriceTranslationInput { - name: String - - """ - Translated shipping method description. - - Rich text format. For reference see https://editorjs.io/ - """ - description: JSONString -} +input MediaInput { + """Alt text for a product media.""" + alt: String -""" -Exclude products from shipping price. + """Represents an image file in a multipart request.""" + image: Upload -Requires one of the following permissions: MANAGE_SHIPPING. -""" -type ShippingPriceExcludeProducts @doc(category: "Shipping") { - """A shipping method with new list of excluded products.""" - shippingMethod: ShippingMethodType - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShippingError!]! + """Represents an URL to an external media.""" + mediaUrl: String } -input ShippingPriceExcludeProductsInput @doc(category: "Shipping") { - """List of products which will be excluded.""" - products: [ID!]! -} +input ProductChannelListingCreateInput @doc(category: "Products") { + """ID of a channel.""" + channelId: ID! -""" -Remove product from excluded list for shipping price. + """Determines if object is visible to customers.""" + isPublished: Boolean -Requires one of the following permissions: MANAGE_SHIPPING. -""" -type ShippingPriceRemoveProductFromExclude @doc(category: "Shipping") { - """A shipping method with new list of excluded products.""" - shippingMethod: ShippingMethodType - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShippingError!]! -} + """Publication date time. ISO 8601 standard.""" + publishedAt: DateTime -""" -Creates a new shipping zone. + """ + Determines if product is visible in product listings (doesn't apply to product collections). + """ + visibleInListings: Boolean -Requires one of the following permissions: MANAGE_SHIPPING. -""" -type ShippingZoneCreate @doc(category: "Shipping") { - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShippingError!]! - shippingZone: ShippingZone + """ + Determines if product should be available for purchase in this channel. This does not guarantee the availability of stock. When set to `False`, this product is still visible to customers, but it cannot be purchased. + """ + isAvailableForPurchase: Boolean + + """ + A start date time from which a product will be available for purchase. When not set and `isAvailable` is set to True, the current day is assumed. + """ + availableForPurchaseAt: DateTime } -input ShippingZoneCreateInput @doc(category: "Shipping") { - """Shipping zone's name. Visible only to the staff.""" - name: String +input ProductVariantBulkCreateInput @doc(category: "Products") { + """List of attributes specific to this variant.""" + attributes: [BulkAttributeValueInput!]! - """Description of the shipping zone.""" - description: String + """Stock keeping unit.""" + sku: String - """List of countries in this shipping zone.""" - countries: [String!] + """Variant name.""" + name: String """ - Default shipping zone will be used for countries not covered by other zones. + Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. If the field is not provided, `Shop.trackInventoryByDefault` will be used. """ - default: Boolean - - """List of warehouses to assign to a shipping zone""" - addWarehouses: [ID!] - - """List of channels to assign to the shipping zone.""" - addChannels: [ID!] -} + trackInventory: Boolean -""" -Deletes a shipping zone. + """Weight of the Product Variant.""" + weight: WeightScalar -Requires one of the following permissions: MANAGE_SHIPPING. -""" -type ShippingZoneDelete @doc(category: "Shipping") { - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShippingError!]! - shippingZone: ShippingZone -} + """ + Determines if variant is in preorder. + + Added in Saleor 3.1. + """ + preorder: PreorderSettingsInput -""" -Deletes shipping zones. + """ + Determines maximum quantity of `ProductVariant`,that can be bought in a single checkout. + + Added in Saleor 3.1. + """ + quantityLimitPerCustomer: Int -Requires one of the following permissions: MANAGE_SHIPPING. -""" -type ShippingZoneBulkDelete @doc(category: "Shipping") { - """Returns how many objects were affected.""" - count: Int! - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShippingError!]! -} + """ + Fields required to update the product variant metadata. + + Added in Saleor 3.8. + """ + metadata: [MetadataInput!] -""" -Updates a new shipping zone. + """ + Fields required to update the product variant private metadata. + + Added in Saleor 3.8. + """ + privateMetadata: [MetadataInput!] -Requires one of the following permissions: MANAGE_SHIPPING. -""" -type ShippingZoneUpdate @doc(category: "Shipping") { - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ShippingError!]! - shippingZone: ShippingZone -} + """ + External ID of this product variant. + + Added in Saleor 3.10. + """ + externalReference: String -input ShippingZoneUpdateInput @doc(category: "Shipping") { - """Shipping zone's name. Visible only to the staff.""" - name: String + """Stocks of a product available for sale.""" + stocks: [StockInput!] - """Description of the shipping zone.""" - description: String + """List of prices assigned to channels.""" + channelListings: [ProductVariantChannelListingAddInput!] +} - """List of countries in this shipping zone.""" - countries: [String!] +input BulkAttributeValueInput @doc(category: "Products") { + """ID of the selected attribute.""" + id: ID """ - Default shipping zone will be used for countries not covered by other zones. + External ID of this attribute. + + Added in Saleor 3.14. """ - default: Boolean - - """List of warehouses to assign to a shipping zone""" - addWarehouses: [ID!] - - """List of channels to assign to the shipping zone.""" - addChannels: [ID!] + externalReference: String - """List of warehouses to unassign from a shipping zone""" - removeWarehouses: [ID!] + """ + The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created.This field will be removed in Saleor 4.0. + """ + values: [String!] - """List of channels to unassign from the shipping zone.""" - removeChannels: [ID!] -} + """ + Attribute value ID. + + Added in Saleor 3.12. + """ + dropdown: AttributeValueSelectableTypeInput -""" -Assign attributes to a given product type. + """ + Attribute value ID. + + Added in Saleor 3.12. + """ + swatch: AttributeValueSelectableTypeInput -Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. -""" -type ProductAttributeAssign @doc(category: "Products") { - """The updated product type.""" - productType: ProductType - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! -} + """ + List of attribute value IDs. + + Added in Saleor 3.12. + """ + multiselect: [AttributeValueSelectableTypeInput!] -type ProductError @doc(category: "Products") { """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + Numeric value of an attribute. + + Added in Saleor 3.12. """ - field: String + numeric: String - """The error message.""" - message: String + """ + URL of the file attribute. Every time, a new value is created. + + Added in Saleor 3.12. + """ + file: String - """The error code.""" - code: ProductErrorCode! + """ + File content type. + + Added in Saleor 3.12. + """ + contentType: String - """List of attributes IDs which causes the error.""" - attributes: [ID!] + """ + List of entity IDs that will be used as references. + + Added in Saleor 3.12. + """ + references: [ID!] - """List of attribute values IDs which causes the error.""" - values: [ID!] -} + """ + Text content in JSON format. + + Added in Saleor 3.12. + """ + richText: JSONString -"""An enumeration.""" -enum ProductErrorCode @doc(category: "Products") { - ALREADY_EXISTS - ATTRIBUTE_ALREADY_ASSIGNED - ATTRIBUTE_CANNOT_BE_ASSIGNED - ATTRIBUTE_VARIANTS_DISABLED - MEDIA_ALREADY_ASSIGNED - DUPLICATED_INPUT_ITEM - GRAPHQL_ERROR - INVALID - INVALID_PRICE - PRODUCT_WITHOUT_CATEGORY - NOT_PRODUCTS_IMAGE - NOT_PRODUCTS_VARIANT - NOT_FOUND - REQUIRED - UNIQUE - VARIANT_NO_DIGITAL_CONTENT - CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT - PRODUCT_NOT_ASSIGNED_TO_CHANNEL - UNSUPPORTED_MEDIA_PROVIDER - PREORDER_VARIANT_CANNOT_BE_DEACTIVATED -} + """ + Plain text content. + + Added in Saleor 3.12. + """ + plainText: String -input ProductAttributeAssignInput @doc(category: "Products") { - """The ID of the attribute to assign.""" - id: ID! + """ + The boolean value of an attribute to resolve. If the passed value is non-existent, it will be created. + """ + boolean: Boolean - """The attribute type to be assigned as.""" - type: ProductAttributeType! + """ + Represents the date value of the attribute value. + + Added in Saleor 3.12. + """ + date: Date """ - Whether attribute is allowed in variant selection. Allowed types are: ['dropdown', 'boolean', 'swatch', 'numeric']. + Represents the date/time value of the attribute value. - Added in Saleor 3.1. + Added in Saleor 3.12. """ - variantSelection: Boolean + dateTime: DateTime } -enum ProductAttributeType @doc(category: "Products") { - PRODUCT - VARIANT -} +input PreorderSettingsInput @doc(category: "Products") { + """The global threshold for preorder variant.""" + globalThreshold: Int -""" -Update attributes assigned to product variant for given product type. + """The end date for preorder.""" + endDate: DateTime +} -Added in Saleor 3.1. +input StockInput @doc(category: "Products") { + """Warehouse in which stock is located.""" + warehouse: ID! -Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. -""" -type ProductAttributeAssignmentUpdate @doc(category: "Products") { - """The updated product type.""" - productType: ProductType - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! + """Quantity of items available for sell.""" + quantity: Int! } -input ProductAttributeAssignmentUpdateInput @doc(category: "Products") { - """The ID of the attribute to assign.""" - id: ID! +input ProductVariantChannelListingAddInput @doc(category: "Products") { + """ID of a channel.""" + channelId: ID! + + """Price of the particular variant in channel.""" + price: PositiveDecimal! + + """Cost price of the variant in channel.""" + costPrice: PositiveDecimal """ - Whether attribute is allowed in variant selection. Allowed types are: ['dropdown', 'boolean', 'swatch', 'numeric']. + The threshold for preorder variant in channel. Added in Saleor 3.1. """ - variantSelection: Boolean! + preorderThreshold: Int } """ -Un-assign attributes from a given product type. +Deletes products. -Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. +Requires one of the following permissions: MANAGE_PRODUCTS. """ -type ProductAttributeUnassign @doc(category: "Products") { - """The updated product type.""" - productType: ProductType +type ProductBulkDelete @doc(category: "Products") { + """Returns how many objects were affected.""" + count: Int! productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [ProductError!]! } """ -Creates a new category. +Updates an existing product. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type CategoryCreate @doc(category: "Products") { +type ProductUpdate @doc(category: "Products") { productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [ProductError!]! - category: Category + product: Product } -input CategoryInput @doc(category: "Products") { +input ProductInput @doc(category: "Products") { + """List of attributes.""" + attributes: [AttributeValueInput!] + + """ID of the product's category.""" + category: ID + """ - Category description. + Determine if taxes are being charged for the product. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `Channel.taxConfiguration` to configure whether tax collection is enabled. + """ + chargeTaxes: Boolean + + """List of IDs of collections that the product belongs to.""" + collections: [ID!] + + """ + Product description. Rich text format. For reference see https://editorjs.io/ """ description: JSONString - """Category name.""" + """Product name.""" name: String - """Category slug.""" + """Product slug.""" slug: String + """ + ID of a tax class to assign to this product. If not provided, product will use the tax class which is assigned to the product type. + """ + taxClass: ID + + """ + Tax rate for enabled tax gateway. + + DEPRECATED: this field will be removed in Saleor 4.0. Use tax classes to control the tax calculation for a product. If taxCode is provided, Saleor will try to find a tax class with given code (codes are stored in metadata) and assign it. If no tax class is found, it would be created and assigned. + """ + taxCode: String + """Search engine optimization fields.""" seo: SeoInput - """Background image file.""" - backgroundImage: Upload + """Weight of the Product.""" + weight: WeightScalar - """Alt text for a product media.""" - backgroundImageAlt: String + """Defines the product rating value.""" + rating: Float """ - Fields required to update the category metadata. + Fields required to update the product metadata. Added in Saleor 3.8. """ metadata: [MetadataInput!] """ - Fields required to update the category private metadata. + Fields required to update the product private metadata. Added in Saleor 3.8. """ privateMetadata: [MetadataInput!] + + """ + External ID of this product. + + Added in Saleor 3.10. + """ + externalReference: String } -input SeoInput { - """SEO title.""" - title: String +""" +Creates/updates translations for products. - """SEO description.""" - description: String -} +Added in Saleor 3.15. -""" -Variables of this type must be set to null in mutations. They will be replaced with a filename from a following multipart part containing a binary file. See: https://github.com/jaydenseric/graphql-multipart-request-spec. -""" -scalar Upload +Note: this API is currently in Feature Preview and can be subject to changes at later point. -input MetadataInput { - """Key of a metadata item.""" - key: String! +Requires one of the following permissions: MANAGE_TRANSLATIONS. - """Value of a metadata item.""" - value: String! +Triggers the following webhook events: +- TRANSLATION_CREATED (async): Called when a translation was created. +- TRANSLATION_UPDATED (async): Called when a translation was updated. +""" +type ProductBulkTranslate @doc(category: "Products") @webhookEventsInfo(asyncEvents: [TRANSLATION_CREATED, TRANSLATION_UPDATED], syncEvents: []) { + """Returns how many translations were created/updated.""" + count: Int! + + """List of the translations.""" + results: [ProductBulkTranslateResult!]! + errors: [ProductBulkTranslateError!]! } -""" -Deletes a category. +type ProductBulkTranslateResult @doc(category: "Products") { + """Product translation data.""" + translation: ProductTranslation -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type CategoryDelete @doc(category: "Products") { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! - category: Category + """List of errors occurred on translation attempt.""" + errors: [ProductBulkTranslateError!] } -""" -Deletes categories. +type ProductBulkTranslateError { + """ + Path to field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + path: String -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type CategoryBulkDelete @doc(category: "Products") { - """Returns how many objects were affected.""" - count: Int! - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! + """The error message.""" + message: String + + """The error code.""" + code: ProductTranslateErrorCode! } -""" -Updates a category. +"""An enumeration.""" +enum ProductTranslateErrorCode @doc(category: "Products") { + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED +} -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type CategoryUpdate @doc(category: "Products") { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! - category: Category +input ProductBulkTranslateInput @doc(category: "Products") { + """Product ID.""" + id: ID + + """External reference of an product.""" + externalReference: String + + """Translation language code.""" + languageCode: LanguageCodeEnum! + + """Translation fields.""" + translationFields: TranslationInput! } """ -Creates/updates translations for a category. +Creates/updates translations for a product. Requires one of the following permissions: MANAGE_TRANSLATIONS. """ -type CategoryTranslate @doc(category: "Products") { +type ProductTranslate @doc(category: "Products") { translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [TranslationError!]! - category: Category -} - -input TranslationInput { - seoTitle: String - seoDescription: String - name: String - - """ - Translated description. - - Rich text format. For reference see https://editorjs.io/ - """ - description: JSONString + product: Product } """ -Adds products to a collection. +Manage product's availability in channels. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type CollectionAddProducts @doc(category: "Products") { - """Collection to which products will be added.""" - collection: Collection - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [CollectionError!]! +type ProductChannelListingUpdate @doc(category: "Products") { + """An updated product instance.""" + product: Product + productChannelListingErrors: [ProductChannelListingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductChannelListingError!]! } -type CollectionError @doc(category: "Products") { +type ProductChannelListingError @doc(category: "Products") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -18561,633 +23264,643 @@ type CollectionError @doc(category: "Products") { """The error message.""" message: String - """List of products IDs which causes the error.""" - products: [ID!] - """The error code.""" - code: CollectionErrorCode! -} + code: ProductErrorCode! -"""An enumeration.""" -enum CollectionErrorCode @doc(category: "Products") { - DUPLICATED_INPUT_ITEM - GRAPHQL_ERROR - INVALID - NOT_FOUND - REQUIRED - UNIQUE - CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT -} + """List of attributes IDs which causes the error.""" + attributes: [ID!] -""" -Creates a new collection. + """List of attribute values IDs which causes the error.""" + values: [ID!] -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type CollectionCreate @doc(category: "Products") { - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [CollectionError!]! - collection: Collection + """List of channels IDs which causes the error.""" + channels: [ID!] + + """List of variants IDs which causes the error.""" + variants: [ID!] } -input CollectionCreateInput @doc(category: "Products") { - """Informs whether a collection is published.""" - isPublished: Boolean +input ProductChannelListingUpdateInput @doc(category: "Products") { + """List of channels to which the product should be assigned or updated.""" + updateChannels: [ProductChannelListingAddInput!] - """Name of the collection.""" - name: String + """List of channels from which the product should be unassigned.""" + removeChannels: [ID!] +} - """Slug of the collection.""" - slug: String +input ProductChannelListingAddInput @doc(category: "Products") { + """ID of a channel.""" + channelId: ID! + + """Determines if object is visible to customers.""" + isPublished: Boolean """ - Description of the collection. + Publication date. ISO 8601 standard. - Rich text format. For reference see https://editorjs.io/ + DEPRECATED: this field will be removed in Saleor 4.0. Use `publishedAt` field instead. """ - description: JSONString - - """Background image file.""" - backgroundImage: Upload + publicationDate: Date - """Alt text for an image.""" - backgroundImageAlt: String + """ + Publication date time. ISO 8601 standard. + + Added in Saleor 3.3. + """ + publishedAt: DateTime - """Search engine optimization fields.""" - seo: SeoInput + """ + Determines if product is visible in product listings (doesn't apply to product collections). + """ + visibleInListings: Boolean """ - Publication date. ISO 8601 standard. - - DEPRECATED: this field will be removed in Saleor 4.0. + Determines if product should be available for purchase in this channel. This does not guarantee the availability of stock. When set to `False`, this product is still visible to customers, but it cannot be purchased. """ - publicationDate: Date + isAvailableForPurchase: Boolean """ - Fields required to update the collection metadata. + A start date from which a product will be available for purchase. When not set and isAvailable is set to True, the current day is assumed. - Added in Saleor 3.8. + DEPRECATED: this field will be removed in Saleor 4.0. Use `availableForPurchaseAt` field instead. """ - metadata: [MetadataInput!] + availableForPurchaseDate: Date """ - Fields required to update the collection private metadata. + A start date time from which a product will be available for purchase. When not set and `isAvailable` is set to True, the current day is assumed. - Added in Saleor 3.8. + Added in Saleor 3.3. """ - privateMetadata: [MetadataInput!] + availableForPurchaseAt: DateTime - """List of products to be added to the collection.""" - products: [ID!] + """List of variants to which the channel should be assigned.""" + addVariants: [ID!] + + """List of variants from which the channel should be unassigned.""" + removeVariants: [ID!] } """ -Deletes a collection. +Create a media object (image or video URL) associated with product. For image, this mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec Requires one of the following permissions: MANAGE_PRODUCTS. """ -type CollectionDelete @doc(category: "Products") { - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [CollectionError!]! - collection: Collection +type ProductMediaCreate @doc(category: "Products") { + product: Product + media: ProductMedia + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! +} + +input ProductMediaCreateInput @doc(category: "Products") { + """Alt text for a product media.""" + alt: String + + """Represents an image file in a multipart request.""" + image: Upload + + """ID of an product.""" + product: ID! + + """Represents an URL to an external media.""" + mediaUrl: String } """ -Reorder the products of a collection. +Reorder the variants of a product. Mutation updates updated_at on product and triggers PRODUCT_UPDATED webhook. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type CollectionReorderProducts @doc(category: "Products") { - """Collection from which products are reordered.""" - collection: Collection - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [CollectionError!]! +type ProductVariantReorder @doc(category: "Products") { + product: Product + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! } -input MoveProductInput @doc(category: "Products") { - """The ID of the product to move.""" - productId: ID! +input ReorderInput { + """The ID of the item to move.""" + id: ID! """ - The relative sorting position of the product (from -inf to +inf) starting from the first given product's actual position.1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. + The new relative sorting position of the item (from -inf to +inf). 1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. """ sortOrder: Int } """ -Deletes collections. +Deletes a product media. + +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type ProductMediaDelete @doc(category: "Products") { + product: Product + media: ProductMedia + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! +} + +""" +Deletes product media. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type CollectionBulkDelete @doc(category: "Products") { +type ProductMediaBulkDelete @doc(category: "Products") { """Returns how many objects were affected.""" count: Int! - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [CollectionError!]! + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! } """ -Remove products from a collection. +Changes ordering of the product media. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type CollectionRemoveProducts @doc(category: "Products") { - """Collection from which products will be removed.""" - collection: Collection - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [CollectionError!]! +type ProductMediaReorder @doc(category: "Products") { + product: Product + media: [ProductMedia!] + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! } """ -Updates a collection. +Updates a product media. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type CollectionUpdate @doc(category: "Products") { - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [CollectionError!]! - collection: Collection +type ProductMediaUpdate @doc(category: "Products") { + product: Product + media: ProductMedia + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! } -input CollectionInput @doc(category: "Products") { - """Informs whether a collection is published.""" - isPublished: Boolean +input ProductMediaUpdateInput @doc(category: "Products") { + """Alt text for a product media.""" + alt: String +} - """Name of the collection.""" +""" +Creates a new product type. + +Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. +""" +type ProductTypeCreate @doc(category: "Products") { + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! + productType: ProductType +} + +input ProductTypeInput @doc(category: "Products") { + """Name of the product type.""" name: String - """Slug of the collection.""" + """Product type slug.""" slug: String + """The product type kind.""" + kind: ProductTypeKindEnum + """ - Description of the collection. - - Rich text format. For reference see https://editorjs.io/ + Determines if product of this type has multiple variants. This option mainly simplifies product management in the dashboard. There is always at least one variant created under the hood. """ - description: JSONString - - """Background image file.""" - backgroundImage: Upload - - """Alt text for an image.""" - backgroundImageAlt: String + hasVariants: Boolean - """Search engine optimization fields.""" - seo: SeoInput + """List of attributes shared among all product variants.""" + productAttributes: [ID!] """ - Publication date. ISO 8601 standard. - - DEPRECATED: this field will be removed in Saleor 4.0. + List of attributes used to distinguish between different variants of a product. """ - publicationDate: Date + variantAttributes: [ID!] + + """Determines if shipping is required for products of this variant.""" + isShippingRequired: Boolean + + """Determines if products are digital.""" + isDigital: Boolean + + """Weight of the ProductType items.""" + weight: WeightScalar """ - Fields required to update the collection metadata. + Tax rate for enabled tax gateway. - Added in Saleor 3.8. + DEPRECATED: this field will be removed in Saleor 4.0.. Use tax classes to control the tax calculation for a product type. If taxCode is provided, Saleor will try to find a tax class with given code (codes are stored in metadata) and assign it. If no tax class is found, it would be created and assigned. """ - metadata: [MetadataInput!] + taxCode: String """ - Fields required to update the collection private metadata. - - Added in Saleor 3.8. + ID of a tax class to assign to this product type. All products of this product type would use this tax class, unless it's overridden in the `Product` type. """ - privateMetadata: [MetadataInput!] + taxClass: ID } """ -Creates/updates translations for a collection. +Deletes a product type. -Requires one of the following permissions: MANAGE_TRANSLATIONS. +Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. """ -type CollectionTranslate @doc(category: "Products") { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [TranslationError!]! - collection: Collection +type ProductTypeDelete @doc(category: "Products") { + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! + productType: ProductType } """ -Manage collection's availability in channels. +Deletes product types. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. """ -type CollectionChannelListingUpdate @doc(category: "Products") { - """An updated collection instance.""" - collection: Collection - collectionChannelListingErrors: [CollectionChannelListingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [CollectionChannelListingError!]! +type ProductTypeBulkDelete @doc(category: "Products") { + """Returns how many objects were affected.""" + count: Int! + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! } -type CollectionChannelListingError @doc(category: "Products") { - """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - """ - field: String +""" +Updates an existing product type. - """The error message.""" - message: String +Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. +""" +type ProductTypeUpdate @doc(category: "Products") { + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! + productType: ProductType +} - """The error code.""" - code: ProductErrorCode! +""" +Reorder the attributes of a product type. - """List of attributes IDs which causes the error.""" - attributes: [ID!] +Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. +""" +type ProductTypeReorderAttributes @doc(category: "Products") { + """Product type from which attributes are reordered.""" + productType: ProductType + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! +} - """List of attribute values IDs which causes the error.""" - values: [ID!] +""" +Reorder product attribute values. - """List of channels IDs which causes the error.""" - channels: [ID!] +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type ProductReorderAttributeValues @doc(category: "Products") { + """Product from which attribute values are reordered.""" + product: Product + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! } -input CollectionChannelListingUpdateInput @doc(category: "Products") { - """List of channels to which the collection should be assigned.""" - addChannels: [PublishableChannelListingInput!] +""" +Create new digital content. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec - """List of channels from which the collection should be unassigned.""" - removeChannels: [ID!] +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type DigitalContentCreate @doc(category: "Products") { + variant: ProductVariant + content: DigitalContent + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! } -input PublishableChannelListingInput @doc(category: "Products") { - """ID of a channel.""" - channelId: ID! +input DigitalContentUploadInput @doc(category: "Products") { + """Use default digital content settings for this product.""" + useDefaultSettings: Boolean! - """Determines if object is visible to customers.""" - isPublished: Boolean + """ + Determines how many times a download link can be accessed by a customer. + """ + maxDownloads: Int """ - Publication date. ISO 8601 standard. + Determines for how many days a download link is active since it was generated. + """ + urlValidDays: Int + + """Overwrite default automatic_fulfillment setting for variant.""" + automaticFulfillment: Boolean + + """ + Fields required to update the digital content metadata. - DEPRECATED: this field will be removed in Saleor 4.0. Use `publishedAt` field instead. + Added in Saleor 3.8. """ - publicationDate: Date + metadata: [MetadataInput!] """ - Publication date time. ISO 8601 standard. + Fields required to update the digital content private metadata. - Added in Saleor 3.3. + Added in Saleor 3.8. """ - publishedAt: DateTime + privateMetadata: [MetadataInput!] + + """Represents an file in a multipart request.""" + contentFile: Upload! } """ -Creates a new product. +Remove digital content assigned to given variant. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type ProductCreate @doc(category: "Products") { +type DigitalContentDelete @doc(category: "Products") { + variant: ProductVariant productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [ProductError!]! - product: Product } -input ProductCreateInput @doc(category: "Products") { - """List of attributes.""" - attributes: [AttributeValueInput!] - - """ID of the product's category.""" - category: ID - - """ - Determine if taxes are being charged for the product. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `Channel.taxConfiguration` to configure whether tax collection is enabled. - """ - chargeTaxes: Boolean - - """List of IDs of collections that the product belongs to.""" - collections: [ID!] - - """ - Product description. - - Rich text format. For reference see https://editorjs.io/ - """ - description: JSONString +""" +Update digital content. - """Product name.""" - name: String +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type DigitalContentUpdate @doc(category: "Products") { + variant: ProductVariant + content: DigitalContent + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! +} - """Product slug.""" - slug: String +input DigitalContentInput @doc(category: "Products") { + """Use default digital content settings for this product.""" + useDefaultSettings: Boolean! """ - ID of a tax class to assign to this product. If not provided, product will use the tax class which is assigned to the product type. + Determines how many times a download link can be accessed by a customer. """ - taxClass: ID + maxDownloads: Int """ - Tax rate for enabled tax gateway. - - DEPRECATED: this field will be removed in Saleor 4.0. Use tax classes to control the tax calculation for a product. If taxCode is provided, Saleor will try to find a tax class with given code (codes are stored in metadata) and assign it. If no tax class is found, it would be created and assigned. + Determines for how many days a download link is active since it was generated. """ - taxCode: String - - """Search engine optimization fields.""" - seo: SeoInput - - """Weight of the Product.""" - weight: WeightScalar + urlValidDays: Int - """Defines the product rating value.""" - rating: Float + """Overwrite default automatic_fulfillment setting for variant.""" + automaticFulfillment: Boolean """ - Fields required to update the product metadata. + Fields required to update the digital content metadata. Added in Saleor 3.8. """ metadata: [MetadataInput!] """ - Fields required to update the product private metadata. + Fields required to update the digital content private metadata. Added in Saleor 3.8. """ privateMetadata: [MetadataInput!] +} - """ - External ID of this product. - - Added in Saleor 3.10. - """ - externalReference: String +""" +Generate new URL to digital content. - """ID of the type that product belongs to.""" - productType: ID! +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type DigitalContentUrlCreate @doc(category: "Products") { + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! + digitalContentUrl: DigitalContentUrl } -input AttributeValueInput @doc(category: "Attributes") { - """ID of the selected attribute.""" - id: ID +input DigitalContentUrlCreateInput @doc(category: "Products") { + """Digital content ID which URL will belong to.""" + content: ID! +} + +""" +Creates a new variant for a product. + +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type ProductVariantCreate @doc(category: "Products") { + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! + productVariant: ProductVariant +} + +input ProductVariantCreateInput @doc(category: "Products") { + """List of attributes specific to this variant.""" + attributes: [AttributeValueInput!]! + + """Stock keeping unit.""" + sku: String + + """Variant name.""" + name: String """ - The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. This field will be removed in Saleor 4.0. + Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. If the field is not provided, `Shop.trackInventoryByDefault` will be used. """ - values: [String!] + trackInventory: Boolean + + """Weight of the Product Variant.""" + weight: WeightScalar """ - Attribute value ID. + Determines if variant is in preorder. - Added in Saleor 3.9. + Added in Saleor 3.1. """ - dropdown: AttributeValueSelectableTypeInput + preorder: PreorderSettingsInput """ - Attribute value ID. + Determines maximum quantity of `ProductVariant`,that can be bought in a single checkout. - Added in Saleor 3.9. + Added in Saleor 3.1. """ - swatch: AttributeValueSelectableTypeInput + quantityLimitPerCustomer: Int """ - List of attribute value IDs. + Fields required to update the product variant metadata. - Added in Saleor 3.9. + Added in Saleor 3.8. """ - multiselect: [AttributeValueSelectableTypeInput!] + metadata: [MetadataInput!] """ - Numeric value of an attribute. + Fields required to update the product variant private metadata. - Added in Saleor 3.9. + Added in Saleor 3.8. """ - numeric: String - - """URL of the file attribute. Every time, a new value is created.""" - file: String - - """File content type.""" - contentType: String - - """List of entity IDs that will be used as references.""" - references: [ID!] - - """Text content in JSON format.""" - richText: JSONString - - """Plain text content.""" - plainText: String - - """Represents the boolean value of the attribute value.""" - boolean: Boolean - - """Represents the date value of the attribute value.""" - date: Date - - """Represents the date/time value of the attribute value.""" - dateTime: DateTime -} - -""" -Represents attribute value. If no ID provided, value will be resolved. - -Added in Saleor 3.9. -""" -input AttributeValueSelectableTypeInput @doc(category: "Attributes") { - """ID of an attribute value.""" - id: ID + privateMetadata: [MetadataInput!] """ - The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. + External ID of this product variant. + + Added in Saleor 3.10. """ - value: String + externalReference: String + + """Product ID of which type is the variant.""" + product: ID! + + """Stocks of a product available for sale.""" + stocks: [StockInput!] } """ -Deletes a product. +Deletes a product variant. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type ProductDelete @doc(category: "Products") { +type ProductVariantDelete @doc(category: "Products") { productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [ProductError!]! - product: Product + productVariant: ProductVariant } """ -Creates products. - -Added in Saleor 3.13. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. +Creates product variants for a given product. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type ProductBulkCreate @doc(category: "Products") { +type ProductVariantBulkCreate @doc(category: "Products") { """Returns how many objects were created.""" count: Int! - """List of the created products.""" - results: [ProductBulkResult!]! - errors: [ProductBulkCreateError!]! + """List of the created variants.This field will be removed in Saleor 4.0.""" + productVariants: [ProductVariant!]! + + """ + List of the created variants. + + Added in Saleor 3.11. + """ + results: [ProductVariantBulkResult!]! + bulkProductErrors: [BulkProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [BulkProductError!]! } -type ProductBulkResult @doc(category: "Products") { - """Product data.""" - product: Product +type ProductVariantBulkResult @doc(category: "Products") { + """Product variant data.""" + productVariant: ProductVariant """List of errors occurred on create attempt.""" - errors: [ProductBulkCreateError!] + errors: [ProductVariantBulkError!] } -type ProductBulkCreateError @doc(category: "Products") { +type ProductVariantBulkError @doc(category: "Products") { """ - Path to field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - path: String + field: String """The error message.""" message: String """The error code.""" - code: ProductBulkCreateErrorCode! - - """List of attributes IDs which causes the error.""" - attributes: [ID!] - - """List of attribute values IDs which causes the error.""" - values: [ID!] - - """List of warehouse IDs which causes the error.""" - warehouses: [ID!] - - """List of channel IDs which causes the error.""" - channels: [ID!] -} - -"""An enumeration.""" -enum ProductBulkCreateErrorCode @doc(category: "Products") { - ATTRIBUTE_ALREADY_ASSIGNED - ATTRIBUTE_CANNOT_BE_ASSIGNED - ATTRIBUTE_VARIANTS_DISABLED - BLANK - MAX_LENGTH - DUPLICATED_INPUT_ITEM - GRAPHQL_ERROR - INVALID - INVALID_PRICE - PRODUCT_WITHOUT_CATEGORY - NOT_FOUND - REQUIRED - UNIQUE - PRODUCT_NOT_ASSIGNED_TO_CHANNEL - UNSUPPORTED_MEDIA_PROVIDER -} - -input ProductBulkCreateInput @doc(category: "Products") { - """List of attributes.""" - attributes: [AttributeValueInput!] - - """ID of the product's category.""" - category: ID + code: ProductVariantBulkErrorCode! """ - Determine if taxes are being charged for the product. + Path to field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - DEPRECATED: this field will be removed in Saleor 4.0. Use `Channel.taxConfiguration` to configure whether tax collection is enabled. + Added in Saleor 3.14. """ - chargeTaxes: Boolean - - """List of IDs of collections that the product belongs to.""" - collections: [ID!] + path: String - """ - Product description. - - Rich text format. For reference see https://editorjs.io/ - """ - description: JSONString + """List of attributes IDs which causes the error.""" + attributes: [ID!] - """Product name.""" - name: String + """List of attribute values IDs which causes the error.""" + values: [ID!] - """Product slug.""" - slug: String + """List of warehouse IDs which causes the error.""" + warehouses: [ID!] """ - ID of a tax class to assign to this product. If not provided, product will use the tax class which is assigned to the product type. + List of stocks IDs which causes the error. + + Added in Saleor 3.12. """ - taxClass: ID + stocks: [ID!] """ - Tax rate for enabled tax gateway. + List of channel IDs which causes the error. - DEPRECATED: this field will be removed in Saleor 4.0. Use tax classes to control the tax calculation for a product. If taxCode is provided, Saleor will try to find a tax class with given code (codes are stored in metadata) and assign it. If no tax class is found, it would be created and assigned. + Added in Saleor 3.12. """ - taxCode: String - - """Search engine optimization fields.""" - seo: SeoInput - - """Weight of the Product.""" - weight: WeightScalar - - """Defines the product rating value.""" - rating: Float + channels: [ID!] - """Fields required to update the product metadata.""" - metadata: [MetadataInput!] + """List of channel listings IDs which causes the error.""" + channelListings: [ID!] +} - """Fields required to update the product private metadata.""" - privateMetadata: [MetadataInput!] +"""An enumeration.""" +enum ProductVariantBulkErrorCode @doc(category: "Products") { + ATTRIBUTE_ALREADY_ASSIGNED + ATTRIBUTE_CANNOT_BE_ASSIGNED + ATTRIBUTE_VARIANTS_DISABLED + DUPLICATED_INPUT_ITEM + GRAPHQL_ERROR + INVALID + INVALID_PRICE + NOT_PRODUCTS_VARIANT + NOT_FOUND + REQUIRED + UNIQUE + PRODUCT_NOT_ASSIGNED_TO_CHANNEL + STOCK_ALREADY_EXISTS +} - """External ID of this product.""" - externalReference: String +type BulkProductError @doc(category: "Products") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String - """ID of the type that product belongs to.""" - productType: ID! + """The error message.""" + message: String - """List of media inputs associated with the product.""" - media: [MediaInput!] + """The error code.""" + code: ProductErrorCode! - """List of channels in which the product is available.""" - channelListings: [ProductChannelListingCreateInput!] + """List of attributes IDs which causes the error.""" + attributes: [ID!] - """Input list of product variants to create.""" - variants: [ProductVariantBulkCreateInput!] -} + """List of attribute values IDs which causes the error.""" + values: [ID!] -input MediaInput { - """Alt text for a product media.""" - alt: String + """Index of an input list item that caused the error.""" + index: Int - """Represents an image file in a multipart request.""" - image: Upload + """List of warehouse IDs which causes the error.""" + warehouses: [ID!] - """Represents an URL to an external media.""" - mediaUrl: String + """List of channel IDs which causes the error.""" + channels: [ID!] } -input ProductChannelListingCreateInput @doc(category: "Products") { - """ID of a channel.""" - channelId: ID! - - """Determines if object is visible to customers.""" - isPublished: Boolean +""" +Update multiple product variants. - """Publication date time. ISO 8601 standard.""" - publishedAt: DateTime +Added in Saleor 3.11. - """ - Determines if product is visible in product listings (doesn't apply to product collections). - """ - visibleInListings: Boolean +Note: this API is currently in Feature Preview and can be subject to changes at later point. - """Determine if product should be available for purchase.""" - isAvailableForPurchase: Boolean +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type ProductVariantBulkUpdate @doc(category: "Products") { + """Returns how many objects were updated.""" + count: Int! - """ - A start date time from which a product will be available for purchase. When not set and `isAvailable` is set to True, the current day is assumed. - """ - availableForPurchaseAt: DateTime + """List of the updated variants.""" + results: [ProductVariantBulkResult!]! + errors: [ProductVariantBulkError!]! } -input ProductVariantBulkCreateInput @doc(category: "Products") { +""" +Input fields to update product variants. + +Added in Saleor 3.11. +""" +input ProductVariantBulkUpdateInput @doc(category: "Products") { """List of attributes specific to this variant.""" - attributes: [BulkAttributeValueInput!]! + attributes: [BulkAttributeValueInput!] """Stock keeping unit.""" sku: String @@ -19196,7 +23909,7 @@ input ProductVariantBulkCreateInput @doc(category: "Products") { name: String """ - Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. + Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. If the field is not provided, `Shop.trackInventoryByDefault` will be used. """ trackInventory: Boolean @@ -19238,229 +23951,224 @@ input ProductVariantBulkCreateInput @doc(category: "Products") { """ externalReference: String - """Stocks of a product available for sale.""" - stocks: [StockInput!] - - """List of prices assigned to channels.""" - channelListings: [ProductVariantChannelListingAddInput!] -} - -input BulkAttributeValueInput @doc(category: "Products") { - """ID of the selected attribute.""" - id: ID - - """ - The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created.This field will be removed in Saleor 4.0. - """ - values: [String!] - """ - Attribute value ID. + Stocks input. Added in Saleor 3.12. - """ - dropdown: AttributeValueSelectableTypeInput - - """ - Attribute value ID. - Added in Saleor 3.12. + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - swatch: AttributeValueSelectableTypeInput + stocks: ProductVariantStocksUpdateInput """ - List of attribute value IDs. + Channel listings input. Added in Saleor 3.12. - """ - multiselect: [AttributeValueSelectableTypeInput!] - - """ - Numeric value of an attribute. - Added in Saleor 3.12. + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - numeric: String + channelListings: ProductVariantChannelListingUpdateInput - """ - URL of the file attribute. Every time, a new value is created. - - Added in Saleor 3.12. - """ - file: String + """ID of the product variant to update.""" + id: ID! +} - """ - File content type. - - Added in Saleor 3.12. - """ - contentType: String +input ProductVariantStocksUpdateInput @doc(category: "Products") { + """List of warehouses to create stocks.""" + create: [StockInput!] - """ - List of entity IDs that will be used as references. - - Added in Saleor 3.12. - """ - references: [ID!] + """List of stocks to update.""" + update: [StockUpdateInput!] - """ - Text content in JSON format. - - Added in Saleor 3.12. - """ - richText: JSONString + """List of stocks to remove.""" + remove: [ID!] +} - """ - Plain text content. - - Added in Saleor 3.12. - """ - plainText: String +input StockUpdateInput @doc(category: "Products") { + """Stock.""" + stock: ID! - """ - The boolean value of an attribute to resolve. If the passed value is non-existent, it will be created. - """ - boolean: Boolean + """Quantity of items available for sell.""" + quantity: Int! +} + +input ProductVariantChannelListingUpdateInput @doc(category: "Products") { + """List of channels to create variant channel listings.""" + create: [ProductVariantChannelListingAddInput!] + + """List of channel listings to update.""" + update: [ChannelListingUpdateInput!] + + """List of channel listings to remove.""" + remove: [ID!] +} + +input ChannelListingUpdateInput @doc(category: "Products") { + """ID of a channel listing.""" + channelListing: ID! + + """Price of the particular variant in channel.""" + price: PositiveDecimal + + """Cost price of the variant in channel.""" + costPrice: PositiveDecimal + + """The threshold for preorder variant in channel.""" + preorderThreshold: Int +} + +""" +Deletes product variants. + +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type ProductVariantBulkDelete @doc(category: "Products") { + """Returns how many objects were affected.""" + count: Int! + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! +} + +""" +Creates stocks for product variant. + +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type ProductVariantStocksCreate @doc(category: "Products") { + """Updated product variant.""" + productVariant: ProductVariant + bulkStockErrors: [BulkStockError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [BulkStockError!]! +} +type BulkStockError @doc(category: "Products") { """ - Represents the date value of the attribute value. - - Added in Saleor 3.12. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - date: Date + field: String - """ - Represents the date/time value of the attribute value. - - Added in Saleor 3.12. - """ - dateTime: DateTime -} + """The error message.""" + message: String -input PreorderSettingsInput @doc(category: "Products") { - """The global threshold for preorder variant.""" - globalThreshold: Int + """The error code.""" + code: ProductErrorCode! - """The end date for preorder.""" - endDate: DateTime -} + """List of attributes IDs which causes the error.""" + attributes: [ID!] -input StockInput @doc(category: "Products") { - """Warehouse in which stock is located.""" - warehouse: ID! + """List of attribute values IDs which causes the error.""" + values: [ID!] - """Quantity of items available for sell.""" - quantity: Int! + """Index of an input list item that caused the error.""" + index: Int } -input ProductVariantChannelListingAddInput @doc(category: "Products") { - """ID of a channel.""" - channelId: ID! - - """Price of the particular variant in channel.""" - price: PositiveDecimal! +""" +Delete stocks from product variant. - """Cost price of the variant in channel.""" - costPrice: PositiveDecimal +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type ProductVariantStocksDelete @doc(category: "Products") { + """Updated product variant.""" + productVariant: ProductVariant + stockErrors: [StockError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [StockError!]! +} +type StockError @doc(category: "Products") { """ - The threshold for preorder variant in channel. - - Added in Saleor 3.1. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - preorderThreshold: Int + field: String + + """The error message.""" + message: String + + """The error code.""" + code: StockErrorCode! +} + +"""An enumeration.""" +enum StockErrorCode @doc(category: "Products") { + ALREADY_EXISTS + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE } """ -Deletes products. +Update stocks for product variant. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type ProductBulkDelete @doc(category: "Products") { - """Returns how many objects were affected.""" - count: Int! - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! +type ProductVariantStocksUpdate @doc(category: "Products") { + """Updated product variant.""" + productVariant: ProductVariant + bulkStockErrors: [BulkStockError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [BulkStockError!]! } """ -Updates an existing product. +Updates an existing variant for product. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type ProductUpdate @doc(category: "Products") { +type ProductVariantUpdate @doc(category: "Products") { productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [ProductError!]! - product: Product + productVariant: ProductVariant } -input ProductInput @doc(category: "Products") { - """List of attributes.""" +input ProductVariantInput @doc(category: "Products") { + """List of attributes specific to this variant.""" attributes: [AttributeValueInput!] - """ID of the product's category.""" - category: ID - - """ - Determine if taxes are being charged for the product. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `Channel.taxConfiguration` to configure whether tax collection is enabled. - """ - chargeTaxes: Boolean + """Stock keeping unit.""" + sku: String - """List of IDs of collections that the product belongs to.""" - collections: [ID!] + """Variant name.""" + name: String """ - Product description. - - Rich text format. For reference see https://editorjs.io/ + Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. If the field is not provided, `Shop.trackInventoryByDefault` will be used. """ - description: JSONString - - """Product name.""" - name: String + trackInventory: Boolean - """Product slug.""" - slug: String + """Weight of the Product Variant.""" + weight: WeightScalar """ - ID of a tax class to assign to this product. If not provided, product will use the tax class which is assigned to the product type. + Determines if variant is in preorder. + + Added in Saleor 3.1. """ - taxClass: ID + preorder: PreorderSettingsInput """ - Tax rate for enabled tax gateway. + Determines maximum quantity of `ProductVariant`,that can be bought in a single checkout. - DEPRECATED: this field will be removed in Saleor 4.0. Use tax classes to control the tax calculation for a product. If taxCode is provided, Saleor will try to find a tax class with given code (codes are stored in metadata) and assign it. If no tax class is found, it would be created and assigned. + Added in Saleor 3.1. """ - taxCode: String - - """Search engine optimization fields.""" - seo: SeoInput - - """Weight of the Product.""" - weight: WeightScalar - - """Defines the product rating value.""" - rating: Float + quantityLimitPerCustomer: Int """ - Fields required to update the product metadata. + Fields required to update the product variant metadata. Added in Saleor 3.8. """ metadata: [MetadataInput!] """ - Fields required to update the product private metadata. + Fields required to update the product variant private metadata. Added in Saleor 3.8. """ privateMetadata: [MetadataInput!] """ - External ID of this product. + External ID of this product variant. Added in Saleor 3.10. """ @@ -19468,556 +24176,653 @@ input ProductInput @doc(category: "Products") { } """ -Creates/updates translations for a product. +Set default variant for a product. Mutation triggers PRODUCT_UPDATED webhook. -Requires one of the following permissions: MANAGE_TRANSLATIONS. +Requires one of the following permissions: MANAGE_PRODUCTS. """ -type ProductTranslate @doc(category: "Products") { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [TranslationError!]! +type ProductVariantSetDefault @doc(category: "Products") { product: Product + productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductError!]! } """ -Manage product's availability in channels. +Creates/updates translations for a product variant. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: MANAGE_TRANSLATIONS. """ -type ProductChannelListingUpdate @doc(category: "Products") { - """An updated product instance.""" - product: Product - productChannelListingErrors: [ProductChannelListingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductChannelListingError!]! +type ProductVariantTranslate @doc(category: "Products") { + translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [TranslationError!]! + productVariant: ProductVariant } -type ProductChannelListingError @doc(category: "Products") { - """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - """ - field: String +input NameTranslationInput { + name: String +} - """The error message.""" - message: String +""" +Creates/updates translations for products variants. - """The error code.""" - code: ProductErrorCode! +Added in Saleor 3.15. - """List of attributes IDs which causes the error.""" - attributes: [ID!] +Note: this API is currently in Feature Preview and can be subject to changes at later point. - """List of attribute values IDs which causes the error.""" - values: [ID!] +Requires one of the following permissions: MANAGE_TRANSLATIONS. - """List of channels IDs which causes the error.""" - channels: [ID!] +Triggers the following webhook events: +- TRANSLATION_CREATED (async): A translation was created. +- TRANSLATION_UPDATED (async): A translation was updated. +""" +type ProductVariantBulkTranslate @doc(category: "Products") @webhookEventsInfo(asyncEvents: [TRANSLATION_CREATED, TRANSLATION_UPDATED], syncEvents: []) { + """Returns how many translations were created/updated.""" + count: Int! - """List of variants IDs which causes the error.""" - variants: [ID!] + """List of the translations.""" + results: [ProductVariantBulkTranslateResult!]! + errors: [ProductVariantBulkTranslateError!]! } -input ProductChannelListingUpdateInput @doc(category: "Products") { - """List of channels to which the product should be assigned or updated.""" - updateChannels: [ProductChannelListingAddInput!] +type ProductVariantBulkTranslateResult @doc(category: "Products") { + """Product variant translation data.""" + translation: ProductVariantTranslation - """List of channels from which the product should be unassigned.""" - removeChannels: [ID!] + """List of errors occurred on translation attempt.""" + errors: [ProductVariantBulkTranslateError!] } -input ProductChannelListingAddInput @doc(category: "Products") { - """ID of a channel.""" - channelId: ID! - - """Determines if object is visible to customers.""" - isPublished: Boolean - - """ - Publication date. ISO 8601 standard. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `publishedAt` field instead. - """ - publicationDate: Date - +type ProductVariantBulkTranslateError { """ - Publication date time. ISO 8601 standard. - - Added in Saleor 3.3. + Path to field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - publishedAt: DateTime + path: String - """ - Determines if product is visible in product listings (doesn't apply to product collections). - """ - visibleInListings: Boolean + """The error message.""" + message: String - """Determine if product should be available for purchase.""" - isAvailableForPurchase: Boolean + """The error code.""" + code: ProductVariantTranslateErrorCode! +} - """ - A start date from which a product will be available for purchase. When not set and isAvailable is set to True, the current day is assumed. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `availableForPurchaseAt` field instead. - """ - availableForPurchaseDate: Date +"""An enumeration.""" +enum ProductVariantTranslateErrorCode @doc(category: "Products") { + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED +} - """ - A start date time from which a product will be available for purchase. When not set and `isAvailable` is set to True, the current day is assumed. - - Added in Saleor 3.3. - """ - availableForPurchaseAt: DateTime +input ProductVariantBulkTranslateInput @doc(category: "Products") { + """Product variant ID.""" + id: ID - """List of variants to which the channel should be assigned.""" - addVariants: [ID!] + """External reference of a product variant.""" + externalReference: String - """List of variants from which the channel should be unassigned.""" - removeVariants: [ID!] + """Translation language code.""" + languageCode: LanguageCodeEnum! + + """Translation fields.""" + translationFields: NameTranslationInput! } """ -Create a media object (image or video URL) associated with product. For image, this mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec +Manage product variant prices in channels. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type ProductMediaCreate @doc(category: "Products") { - product: Product - media: ProductMedia - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! -} - -input ProductMediaCreateInput @doc(category: "Products") { - """Alt text for a product media.""" - alt: String - - """Represents an image file in a multipart request.""" - image: Upload - - """ID of an product.""" - product: ID! - - """Represents an URL to an external media.""" - mediaUrl: String +type ProductVariantChannelListingUpdate @doc(category: "Products") { + """An updated product variant instance.""" + variant: ProductVariant + productChannelListingErrors: [ProductChannelListingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [ProductChannelListingError!]! } """ -Reorder the variants of a product. Mutation updates updated_at on product and triggers PRODUCT_UPDATED webhook. +Reorder product variant attribute values. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type ProductVariantReorder @doc(category: "Products") { - product: Product +type ProductVariantReorderAttributeValues @doc(category: "Products") { + """Product variant from which attribute values are reordered.""" + productVariant: ProductVariant productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [ProductError!]! } -input ReorderInput { - """The ID of the item to move.""" - id: ID! +""" +Deactivates product variant preorder. It changes all preorder allocation into regular allocation. - """ - The new relative sorting position of the item (from -inf to +inf). 1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. - """ - sortOrder: Int +Added in Saleor 3.1. + +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type ProductVariantPreorderDeactivate @doc(category: "Products") { + """Product variant with ended preorder.""" + productVariant: ProductVariant + errors: [ProductError!]! } """ -Deletes a product media. +Assign an media to a product variant. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type ProductMediaDelete @doc(category: "Products") { - product: Product +type VariantMediaAssign @doc(category: "Products") { + productVariant: ProductVariant media: ProductMedia productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [ProductError!]! } """ -Deletes product media. +Unassign an media from a product variant. Requires one of the following permissions: MANAGE_PRODUCTS. """ -type ProductMediaBulkDelete @doc(category: "Products") { - """Returns how many objects were affected.""" - count: Int! +type VariantMediaUnassign @doc(category: "Products") { + productVariant: ProductVariant + media: ProductMedia productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [ProductError!]! } """ -Changes ordering of the product media. +Captures the authorized payment amount. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: MANAGE_ORDERS. """ -type ProductMediaReorder @doc(category: "Products") { - product: Product - media: [ProductMedia!] - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! +type PaymentCapture @doc(category: "Payments") { + """Updated payment.""" + payment: Payment + paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PaymentError!]! +} + +type PaymentError @doc(category: "Payments") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """The error message.""" + message: String + + """The error code.""" + code: PaymentErrorCode! + + """List of variant IDs which causes the error.""" + variants: [ID!] +} + +"""An enumeration.""" +enum PaymentErrorCode @doc(category: "Payments") { + BILLING_ADDRESS_NOT_SET + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE + PARTIAL_PAYMENT_NOT_ALLOWED + SHIPPING_ADDRESS_NOT_SET + INVALID_SHIPPING_METHOD + SHIPPING_METHOD_NOT_SET + PAYMENT_ERROR + NOT_SUPPORTED_GATEWAY + CHANNEL_INACTIVE + BALANCE_CHECK_ERROR + CHECKOUT_EMAIL_NOT_SET + UNAVAILABLE_VARIANT_IN_CHANNEL + NO_CHECKOUT_LINES } """ -Updates a product media. +Refunds the captured payment amount. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: MANAGE_ORDERS. """ -type ProductMediaUpdate @doc(category: "Products") { - product: Product - media: ProductMedia - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! +type PaymentRefund @doc(category: "Payments") { + """Updated payment.""" + payment: Payment + paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PaymentError!]! } -input ProductMediaUpdateInput @doc(category: "Products") { - """Alt text for a product media.""" - alt: String +""" +Voids the authorized payment. + +Requires one of the following permissions: MANAGE_ORDERS. +""" +type PaymentVoid @doc(category: "Payments") { + """Updated payment.""" + payment: Payment + paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PaymentError!]! +} + +"""Initializes payment process when it is required by gateway.""" +type PaymentInitialize @doc(category: "Payments") { + """Payment that was initialized.""" + initializedPayment: PaymentInitialized + paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PaymentError!]! } """ -Creates a new product type. +Server-side data generated by a payment gateway. Optional step when the payment provider requires an additional action to initialize payment session. +""" +type PaymentInitialized @doc(category: "Payments") { + """ID of a payment gateway.""" + gateway: String! + + """Payment gateway name.""" + name: String! + + """Initialized data by gateway.""" + data: JSONString +} + +"""Check payment balance.""" +type PaymentCheckBalance @doc(category: "Payments") { + """Response from the gateway.""" + data: JSONString + paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PaymentError!]! +} + +input PaymentCheckBalanceInput @doc(category: "Payments") { + """An ID of a payment gateway to check.""" + gatewayId: String! + + """Payment method name.""" + method: String! + + """Slug of a channel for which the data should be returned.""" + channel: String! + + """Information about card.""" + card: CardInput! +} + +input CardInput { + """ + Payment method nonce, a token returned by the appropriate provider's SDK. + """ + code: String! + + """Card security code.""" + cvc: String + + """Information about currency and amount.""" + money: MoneyInput! +} + +input MoneyInput { + """Currency code.""" + currency: String! + + """Amount of money.""" + amount: PositiveDecimal! +} -Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. """ -type ProductTypeCreate @doc(category: "Products") { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! - productType: ProductType +Create transaction for checkout or order. + +Added in Saleor 3.4. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: HANDLE_PAYMENTS. +""" +type TransactionCreate @doc(category: "Payments") { + transaction: TransactionItem + errors: [TransactionCreateError!]! } -input ProductTypeInput @doc(category: "Products") { - """Name of the product type.""" - name: String +type TransactionCreateError @doc(category: "Payments") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String - """Product type slug.""" - slug: String + """The error message.""" + message: String - """The product type kind.""" - kind: ProductTypeKindEnum + """The error code.""" + code: TransactionCreateErrorCode! +} + +"""An enumeration.""" +enum TransactionCreateErrorCode @doc(category: "Payments") { + INVALID + GRAPHQL_ERROR + NOT_FOUND + INCORRECT_CURRENCY + METADATA_KEY_REQUIRED + UNIQUE +} +input TransactionCreateInput @doc(category: "Payments") { """ - Determines if product of this type has multiple variants. This option mainly simplifies product management in the dashboard. There is always at least one variant created under the hood. + Payment name of the transaction. + + Added in Saleor 3.13. """ - hasVariants: Boolean + name: String - """List of attributes shared among all product variants.""" - productAttributes: [ID!] + """ + The message of the transaction. + + Added in Saleor 3.13. + """ + message: String """ - List of attributes used to distinguish between different variants of a product. + PSP Reference of the transaction. + + Added in Saleor 3.13. """ - variantAttributes: [ID!] + pspReference: String - """Determines if shipping is required for products of this variant.""" - isShippingRequired: Boolean + """List of all possible actions for the transaction""" + availableActions: [TransactionActionEnum!] - """Determines if products are digital.""" - isDigital: Boolean + """Amount authorized by this transaction.""" + amountAuthorized: MoneyInput - """Weight of the ProductType items.""" - weight: WeightScalar + """Amount charged by this transaction.""" + amountCharged: MoneyInput + + """Amount refunded by this transaction.""" + amountRefunded: MoneyInput """ - Tax rate for enabled tax gateway. + Amount canceled by this transaction. - DEPRECATED: this field will be removed in Saleor 4.0.. Use tax classes to control the tax calculation for a product type. If taxCode is provided, Saleor will try to find a tax class with given code (codes are stored in metadata) and assign it. If no tax class is found, it would be created and assigned. + Added in Saleor 3.13. """ - taxCode: String + amountCanceled: MoneyInput + + """Payment public metadata.""" + metadata: [MetadataInput!] + + """Payment private metadata.""" + privateMetadata: [MetadataInput!] """ - ID of a tax class to assign to this product type. All products of this product type would use this tax class, unless it's overridden in the `Product` type. + The url that will allow to redirect user to payment provider page with transaction event details. + + Added in Saleor 3.13. """ - taxClass: ID + externalUrl: String } -""" -Deletes a product type. +input TransactionEventInput @doc(category: "Payments") { + """ + PSP Reference related to this action. + + Added in Saleor 3.13. + """ + pspReference: String -Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. -""" -type ProductTypeDelete @doc(category: "Products") { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! - productType: ProductType + """ + The message related to the event. + + Added in Saleor 3.13. + """ + message: String } """ -Deletes product types. +Update transaction. -Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. -""" -type ProductTypeBulkDelete @doc(category: "Products") { - """Returns how many objects were affected.""" - count: Int! - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! -} +Added in Saleor 3.4. -""" -Updates an existing product type. +Note: this API is currently in Feature Preview and can be subject to changes at later point. -Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. +Requires the following permissions: OWNER and HANDLE_PAYMENTS for apps, HANDLE_PAYMENTS for staff users. Staff user cannot update a transaction that is owned by the app. """ -type ProductTypeUpdate @doc(category: "Products") { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! - productType: ProductType +type TransactionUpdate @doc(category: "Payments") { + transaction: TransactionItem + errors: [TransactionUpdateError!]! } -""" -Reorder the attributes of a product type. - -Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. -""" -type ProductTypeReorderAttributes @doc(category: "Products") { - """Product type from which attributes are reordered.""" - productType: ProductType - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! -} +type TransactionUpdateError @doc(category: "Payments") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String -""" -Reorder product attribute values. + """The error message.""" + message: String -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type ProductReorderAttributeValues @doc(category: "Products") { - """Product from which attribute values are reordered.""" - product: Product - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! + """The error code.""" + code: TransactionUpdateErrorCode! } -""" -Create new digital content. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec - -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type DigitalContentCreate @doc(category: "Products") { - variant: ProductVariant - content: DigitalContent - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! +"""An enumeration.""" +enum TransactionUpdateErrorCode @doc(category: "Payments") { + INVALID + GRAPHQL_ERROR + NOT_FOUND + INCORRECT_CURRENCY + METADATA_KEY_REQUIRED + UNIQUE } -input DigitalContentUploadInput @doc(category: "Products") { - """Use default digital content settings for this product.""" - useDefaultSettings: Boolean! +input TransactionUpdateInput @doc(category: "Payments") { + """ + Payment name of the transaction. + + Added in Saleor 3.13. + """ + name: String """ - Determines how many times a download link can be accessed by a customer. + The message of the transaction. + + Added in Saleor 3.13. """ - maxDownloads: Int + message: String """ - Determines for how many days a download link is active since it was generated. + PSP Reference of the transaction. + + Added in Saleor 3.13. """ - urlValidDays: Int + pspReference: String - """Overwrite default automatic_fulfillment setting for variant.""" - automaticFulfillment: Boolean + """List of all possible actions for the transaction""" + availableActions: [TransactionActionEnum!] + + """Amount authorized by this transaction.""" + amountAuthorized: MoneyInput + + """Amount charged by this transaction.""" + amountCharged: MoneyInput + + """Amount refunded by this transaction.""" + amountRefunded: MoneyInput """ - Fields required to update the digital content metadata. + Amount canceled by this transaction. - Added in Saleor 3.8. + Added in Saleor 3.13. """ + amountCanceled: MoneyInput + + """Payment public metadata.""" metadata: [MetadataInput!] + """Payment private metadata.""" + privateMetadata: [MetadataInput!] + """ - Fields required to update the digital content private metadata. + The url that will allow to redirect user to payment provider page with transaction event details. - Added in Saleor 3.8. + Added in Saleor 3.13. """ - privateMetadata: [MetadataInput!] - - """Represents an file in a multipart request.""" - contentFile: Upload! + externalUrl: String } """ -Remove digital content assigned to given variant. +Request an action for payment transaction. -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type DigitalContentDelete @doc(category: "Products") { - variant: ProductVariant - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! -} +Added in Saleor 3.4. -""" -Update digital content. +Note: this API is currently in Feature Preview and can be subject to changes at later point. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: HANDLE_PAYMENTS. """ -type DigitalContentUpdate @doc(category: "Products") { - variant: ProductVariant - content: DigitalContent - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! +type TransactionRequestAction @doc(category: "Payments") { + transaction: TransactionItem + errors: [TransactionRequestActionError!]! } -input DigitalContentInput @doc(category: "Products") { - """Use default digital content settings for this product.""" - useDefaultSettings: Boolean! - - """ - Determines how many times a download link can be accessed by a customer. - """ - maxDownloads: Int - +type TransactionRequestActionError @doc(category: "Payments") { """ - Determines for how many days a download link is active since it was generated. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - urlValidDays: Int + field: String - """Overwrite default automatic_fulfillment setting for variant.""" - automaticFulfillment: Boolean + """The error message.""" + message: String - """ - Fields required to update the digital content metadata. - - Added in Saleor 3.8. - """ - metadata: [MetadataInput!] + """The error code.""" + code: TransactionRequestActionErrorCode! +} - """ - Fields required to update the digital content private metadata. - - Added in Saleor 3.8. - """ - privateMetadata: [MetadataInput!] +"""An enumeration.""" +enum TransactionRequestActionErrorCode @doc(category: "Payments") { + INVALID + GRAPHQL_ERROR + NOT_FOUND + MISSING_TRANSACTION_ACTION_REQUEST_WEBHOOK } """ -Generate new URL to digital content. +Request a refund for payment transaction based on granted refund. -Requires one of the following permissions: MANAGE_PRODUCTS. +Added in Saleor 3.15. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: HANDLE_PAYMENTS. """ -type DigitalContentUrlCreate @doc(category: "Products") { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! - digitalContentUrl: DigitalContentUrl +type TransactionRequestRefundForGrantedRefund @doc(category: "Payments") { + transaction: TransactionItem + errors: [TransactionRequestRefundForGrantedRefundError!]! } -input DigitalContentUrlCreateInput @doc(category: "Products") { - """Digital content ID which URL will belong to.""" - content: ID! -} +type TransactionRequestRefundForGrantedRefundError @doc(category: "Payments") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String -""" -Creates a new variant for a product. + """The error message.""" + message: String -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type ProductVariantCreate @doc(category: "Products") { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! - productVariant: ProductVariant + """The error code.""" + code: TransactionRequestRefundForGrantedRefundErrorCode! } -input ProductVariantCreateInput @doc(category: "Products") { - """List of attributes specific to this variant.""" - attributes: [AttributeValueInput!]! - - """Stock keeping unit.""" - sku: String +"""An enumeration.""" +enum TransactionRequestRefundForGrantedRefundErrorCode @doc(category: "Payments") { + INVALID + GRAPHQL_ERROR + NOT_FOUND + MISSING_TRANSACTION_ACTION_REQUEST_WEBHOOK +} - """Variant name.""" - name: String +""" +Report the event for the transaction. - """ - Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. - """ - trackInventory: Boolean +Added in Saleor 3.13. - """Weight of the Product Variant.""" - weight: WeightScalar +Note: this API is currently in Feature Preview and can be subject to changes at later point. - """ - Determines if variant is in preorder. - - Added in Saleor 3.1. - """ - preorder: PreorderSettingsInput +Requires the following permissions: OWNER and HANDLE_PAYMENTS for apps, HANDLE_PAYMENTS for staff users. Staff user cannot update a transaction that is owned by the app. +""" +type TransactionEventReport @doc(category: "Payments") { + """Defines if the reported event hasn't been processed earlier.""" + alreadyProcessed: Boolean - """ - Determines maximum quantity of `ProductVariant`,that can be bought in a single checkout. - - Added in Saleor 3.1. - """ - quantityLimitPerCustomer: Int + """The transaction related to the reported event.""" + transaction: TransactionItem """ - Fields required to update the product variant metadata. - - Added in Saleor 3.8. + The event assigned to this report. if `alreadyProcessed` is set to `true`, the previously processed event will be returned. """ - metadata: [MetadataInput!] + transactionEvent: TransactionEvent + errors: [TransactionEventReportError!]! +} +type TransactionEventReportError @doc(category: "Payments") { """ - Fields required to update the product variant private metadata. - - Added in Saleor 3.8. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - privateMetadata: [MetadataInput!] + field: String - """ - External ID of this product variant. - - Added in Saleor 3.10. - """ - externalReference: String + """The error message.""" + message: String - """Product ID of which type is the variant.""" - product: ID! + """The error code.""" + code: TransactionEventReportErrorCode! +} - """Stocks of a product available for sale.""" - stocks: [StockInput!] +"""An enumeration.""" +enum TransactionEventReportErrorCode @doc(category: "Payments") { + INVALID + GRAPHQL_ERROR + NOT_FOUND + INCORRECT_DETAILS + ALREADY_EXISTS } """ -Deletes a product variant. +Initializes a payment gateway session. It triggers the webhook `PAYMENT_GATEWAY_INITIALIZE_SESSION`, to the requested `paymentGateways`. If `paymentGateways` is not provided, the webhook will be send to all subscribed payment gateways. -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type ProductVariantDelete @doc(category: "Products") { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! - productVariant: ProductVariant -} +Added in Saleor 3.13. +Note: this API is currently in Feature Preview and can be subject to changes at later point. """ -Creates product variants for a given product. +type PaymentGatewayInitialize @doc(category: "Payments") { + """List of payment gateway configurations.""" + gatewayConfigs: [PaymentGatewayConfig!] + errors: [PaymentGatewayInitializeError!]! +} -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type ProductVariantBulkCreate @doc(category: "Products") { - """Returns how many objects were created.""" - count: Int! +type PaymentGatewayConfig @doc(category: "Payments") { + """The app identifier.""" + id: String! - """List of the created variants.This field will be removed in Saleor 4.0.""" - productVariants: [ProductVariant!]! + """The JSON data required to initialize the payment gateway.""" + data: JSON + errors: [PaymentGatewayConfigError!] +} +type PaymentGatewayConfigError @doc(category: "Payments") { """ - List of the created variants. - - Added in Saleor 3.11. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - results: [ProductVariantBulkResult!]! - bulkProductErrors: [BulkProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [BulkProductError!]! -} + field: String -type ProductVariantBulkResult @doc(category: "Products") { - """Product variant data.""" - productVariant: ProductVariant + """The error message.""" + message: String - """List of errors occurred on create attempt.""" - errors: [ProductVariantBulkError!] + """The error code.""" + code: PaymentGatewayConfigErrorCode! } -type ProductVariantBulkError @doc(category: "Products") { +"""An enumeration.""" +enum PaymentGatewayConfigErrorCode @doc(category: "Payments") { + GRAPHQL_ERROR + INVALID + NOT_FOUND +} + +type PaymentGatewayInitializeError @doc(category: "Payments") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -20027,52 +24832,84 @@ type ProductVariantBulkError @doc(category: "Products") { message: String """The error code.""" - code: ProductVariantBulkErrorCode! + code: PaymentGatewayInitializeErrorCode! +} - """List of attributes IDs which causes the error.""" - attributes: [ID!] +"""An enumeration.""" +enum PaymentGatewayInitializeErrorCode @doc(category: "Payments") { + GRAPHQL_ERROR + INVALID + NOT_FOUND +} - """List of attribute values IDs which causes the error.""" - values: [ID!] +input PaymentGatewayToInitialize @doc(category: "Payments") { + """The identifier of the payment gateway app to initialize.""" + id: String! - """List of warehouse IDs which causes the error.""" - warehouses: [ID!] + """The data that will be passed to the payment gateway.""" + data: JSON +} - """ - List of stocks IDs which causes the error. - - Added in Saleor 3.12. - """ - stocks: [ID!] +""" +Initializes a transaction session. It triggers the webhook `TRANSACTION_INITIALIZE_SESSION`, to the requested `paymentGateways`. + +Added in Saleor 3.13. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type TransactionInitialize @doc(category: "Payments") { + """The initialized transaction.""" + transaction: TransactionItem + """The event created for the initialized transaction.""" + transactionEvent: TransactionEvent + + """The JSON data required to finalize the payment.""" + data: JSON + errors: [TransactionInitializeError!]! +} + +type TransactionInitializeError @doc(category: "Payments") { """ - List of channel IDs which causes the error. - - Added in Saleor 3.12. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - channels: [ID!] + field: String - """List of channel listings IDs which causes the error.""" - channelListings: [ID!] + """The error message.""" + message: String + + """The error code.""" + code: TransactionInitializeErrorCode! } """An enumeration.""" -enum ProductVariantBulkErrorCode @doc(category: "Products") { - ATTRIBUTE_ALREADY_ASSIGNED - ATTRIBUTE_CANNOT_BE_ASSIGNED - ATTRIBUTE_VARIANTS_DISABLED - DUPLICATED_INPUT_ITEM +enum TransactionInitializeErrorCode @doc(category: "Payments") { GRAPHQL_ERROR INVALID - INVALID_PRICE - NOT_PRODUCTS_VARIANT NOT_FOUND - REQUIRED UNIQUE - PRODUCT_NOT_ASSIGNED_TO_CHANNEL } -type BulkProductError @doc(category: "Products") { +""" +Processes a transaction session. It triggers the webhook `TRANSACTION_PROCESS_SESSION`, to the assigned `paymentGateways`. + +Added in Saleor 3.13. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type TransactionProcess @doc(category: "Payments") { + """The processed transaction.""" + transaction: TransactionItem + + """The event created for the processed transaction.""" + transactionEvent: TransactionEvent + + """The json data required to finalize the payment.""" + data: JSON + errors: [TransactionProcessError!]! +} + +type TransactionProcessError @doc(category: "Payments") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -20082,191 +24919,174 @@ type BulkProductError @doc(category: "Products") { message: String """The error code.""" - code: ProductErrorCode! - - """List of attributes IDs which causes the error.""" - attributes: [ID!] - - """List of attribute values IDs which causes the error.""" - values: [ID!] - - """Index of an input list item that caused the error.""" - index: Int - - """List of warehouse IDs which causes the error.""" - warehouses: [ID!] + code: TransactionProcessErrorCode! +} - """List of channel IDs which causes the error.""" - channels: [ID!] +"""An enumeration.""" +enum TransactionProcessErrorCode @doc(category: "Payments") { + GRAPHQL_ERROR + INVALID + NOT_FOUND + TRANSACTION_ALREADY_PROCESSED + MISSING_PAYMENT_APP_RELATION + MISSING_PAYMENT_APP } """ -Update multiple product variants. +Request to delete a stored payment method on payment provider side. -Added in Saleor 3.11. +Added in Saleor 3.16. Note: this API is currently in Feature Preview and can be subject to changes at later point. -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type ProductVariantBulkUpdate @doc(category: "Products") { - """Returns how many objects were updated.""" - count: Int! +Requires one of the following permissions: AUTHENTICATED_USER. - """List of the updated variants.""" - results: [ProductVariantBulkResult!]! - errors: [ProductVariantBulkError!]! +Triggers the following webhook events: +- STORED_PAYMENT_METHOD_DELETE_REQUESTED (sync): The customer requested to delete a payment method. +""" +type StoredPaymentMethodRequestDelete @doc(category: "Payments") @webhookEventsInfo(asyncEvents: [], syncEvents: [STORED_PAYMENT_METHOD_DELETE_REQUESTED]) { + """The result of deleting a stored payment method.""" + result: StoredPaymentMethodRequestDeleteResult! + errors: [PaymentMethodRequestDeleteError!]! } """ -Input fields to update product variants. +Result of deleting a stored payment method. -Added in Saleor 3.11. + This enum is used to determine the result of deleting a stored payment method. + SUCCESSFULLY_DELETED - The stored payment method was successfully deleted. + FAILED_TO_DELETE - The stored payment method was not deleted. + FAILED_TO_DELIVER - The request to delete the stored payment method was not + delivered. """ -input ProductVariantBulkUpdateInput @doc(category: "Products") { - """List of attributes specific to this variant.""" - attributes: [BulkAttributeValueInput!] - - """Stock keeping unit.""" - sku: String - - """Variant name.""" - name: String +enum StoredPaymentMethodRequestDeleteResult @doc(category: "Payments") { + SUCCESSFULLY_DELETED + FAILED_TO_DELETE + FAILED_TO_DELIVER +} +type PaymentMethodRequestDeleteError @doc(category: "Payments") { """ - Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - trackInventory: Boolean + field: String - """Weight of the Product Variant.""" - weight: WeightScalar + """The error message.""" + message: String - """ - Determines if variant is in preorder. - - Added in Saleor 3.1. - """ - preorder: PreorderSettingsInput + """The error code.""" + code: StoredPaymentMethodRequestDeleteErrorCode! +} - """ - Determines maximum quantity of `ProductVariant`,that can be bought in a single checkout. - - Added in Saleor 3.1. - """ - quantityLimitPerCustomer: Int +"""An enumeration.""" +enum StoredPaymentMethodRequestDeleteErrorCode @doc(category: "Payments") { + GRAPHQL_ERROR + INVALID + NOT_FOUND + CHANNEL_INACTIVE + GATEWAY_ERROR +} - """ - Fields required to update the product variant metadata. - - Added in Saleor 3.8. - """ - metadata: [MetadataInput!] +""" +Initializes payment gateway for tokenizing payment method session. - """ - Fields required to update the product variant private metadata. - - Added in Saleor 3.8. - """ - privateMetadata: [MetadataInput!] +Added in Saleor 3.16. - """ - External ID of this product variant. - - Added in Saleor 3.10. - """ - externalReference: String +Note: this API is currently in Feature Preview and can be subject to changes at later point. - """ - Stocks input. - - Added in Saleor 3.12. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. - """ - stocks: ProductVariantStocksUpdateInput +Requires one of the following permissions: AUTHENTICATED_USER. - """ - Channel listings input. - - Added in Saleor 3.12. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. - """ - channelListings: ProductVariantChannelListingUpdateInput +Triggers the following webhook events: +- PAYMENT_GATEWAY_INITIALIZE_TOKENIZATION_SESSION (sync): The customer requested to initialize payment gateway for tokenization. +""" +type PaymentGatewayInitializeTokenization @doc(category: "Payments") @webhookEventsInfo(asyncEvents: [], syncEvents: [PAYMENT_GATEWAY_INITIALIZE_TOKENIZATION_SESSION]) { + """A status of the payment gateway initialization.""" + result: PaymentGatewayInitializeTokenizationResult! - """ID of the product variant to update.""" - id: ID! + """A data returned by payment app.""" + data: JSON + errors: [PaymentGatewayInitializeTokenizationError!]! } -input ProductVariantStocksUpdateInput @doc(category: "Products") { - """List of warehouses to create stocks.""" - create: [StockInput!] - - """List of stocks to update.""" - update: [StockUpdateInput!] +""" +Result of initialize payment gateway for tokenization of payment method. - """List of stocks to remove.""" - remove: [ID!] + The result of initialize payment gateway for tokenization of payment method. + SUCCESSFULLY_INITIALIZED - The payment gateway was successfully initialized. + FAILED_TO_INITIALIZE - The payment gateway was not initialized. + FAILED_TO_DELIVER - The request to initialize payment gateway was not delivered. +""" +enum PaymentGatewayInitializeTokenizationResult @doc(category: "Payments") { + SUCCESSFULLY_INITIALIZED + FAILED_TO_INITIALIZE + FAILED_TO_DELIVER } -input StockUpdateInput @doc(category: "Products") { - """Stock.""" - stock: ID! - - """Quantity of items available for sell.""" - quantity: Int! -} +type PaymentGatewayInitializeTokenizationError @doc(category: "Payments") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String -input ProductVariantChannelListingUpdateInput @doc(category: "Products") { - """List of channels to create variant channel listings.""" - create: [ProductVariantChannelListingAddInput!] + """The error message.""" + message: String - """List of channel listings to update.""" - update: [ChannelListingUpdateInput!] + """The error code.""" + code: PaymentGatewayInitializeTokenizationErrorCode! +} - """List of channel listings to remove.""" - remove: [ID!] +"""An enumeration.""" +enum PaymentGatewayInitializeTokenizationErrorCode @doc(category: "Payments") { + GRAPHQL_ERROR + INVALID + NOT_FOUND + CHANNEL_INACTIVE + GATEWAY_ERROR } -input ChannelListingUpdateInput @doc(category: "Products") { - """ID of a channel listing.""" - channelListing: ID! +""" +Tokenize payment method. - """Price of the particular variant in channel.""" - price: PositiveDecimal +Added in Saleor 3.16. - """Cost price of the variant in channel.""" - costPrice: PositiveDecimal +Note: this API is currently in Feature Preview and can be subject to changes at later point. - """The threshold for preorder variant in channel.""" - preorderThreshold: Int -} +Requires one of the following permissions: AUTHENTICATED_USER. +Triggers the following webhook events: +- PAYMENT_METHOD_INITIALIZE_TOKENIZATION_SESSION (sync): The customer requested to tokenize payment method. """ -Deletes product variants. +type PaymentMethodInitializeTokenization @doc(category: "Payments") @webhookEventsInfo(asyncEvents: [], syncEvents: [PAYMENT_METHOD_INITIALIZE_TOKENIZATION_SESSION]) { + """A status of the payment method tokenization.""" + result: PaymentMethodTokenizationResult! -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type ProductVariantBulkDelete @doc(category: "Products") { - """Returns how many objects were affected.""" - count: Int! - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! + """The identifier of the payment method.""" + id: String + + """A data returned by the payment app.""" + data: JSON + errors: [PaymentMethodInitializeTokenizationError!]! } """ -Creates stocks for product variant. +Result of tokenization of payment method. -Requires one of the following permissions: MANAGE_PRODUCTS. + SUCCESSFULLY_TOKENIZED - The payment method was successfully tokenized. + ADDITIONAL_ACTION_REQUIRED - The additional action is required to tokenize payment + method. + PENDING - The payment method is pending tokenization. + FAILED_TO_TOKENIZE - The payment method was not tokenized. + FAILED_TO_DELIVER - The request to tokenize payment method was not delivered. """ -type ProductVariantStocksCreate @doc(category: "Products") { - """Updated product variant.""" - productVariant: ProductVariant - bulkStockErrors: [BulkStockError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [BulkStockError!]! +enum PaymentMethodTokenizationResult @doc(category: "Payments") { + SUCCESSFULLY_TOKENIZED + PENDING + ADDITIONAL_ACTION_REQUIRED + FAILED_TO_TOKENIZE + FAILED_TO_DELIVER } -type BulkStockError @doc(category: "Products") { +type PaymentMethodInitializeTokenizationError @doc(category: "Payments") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -20276,31 +25096,43 @@ type BulkStockError @doc(category: "Products") { message: String """The error code.""" - code: ProductErrorCode! - - """List of attributes IDs which causes the error.""" - attributes: [ID!] - - """List of attribute values IDs which causes the error.""" - values: [ID!] + code: PaymentMethodInitializeTokenizationErrorCode! +} - """Index of an input list item that caused the error.""" - index: Int +"""An enumeration.""" +enum PaymentMethodInitializeTokenizationErrorCode @doc(category: "Payments") { + GRAPHQL_ERROR + INVALID + NOT_FOUND + CHANNEL_INACTIVE + GATEWAY_ERROR } """ -Delete stocks from product variant. +Tokenize payment method. -Requires one of the following permissions: MANAGE_PRODUCTS. +Added in Saleor 3.16. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: AUTHENTICATED_USER. + +Triggers the following webhook events: +- PAYMENT_METHOD_PROCESS_TOKENIZATION_SESSION (sync): The customer continues payment method tokenization. """ -type ProductVariantStocksDelete @doc(category: "Products") { - """Updated product variant.""" - productVariant: ProductVariant - stockErrors: [StockError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [StockError!]! +type PaymentMethodProcessTokenization @doc(category: "Payments") @webhookEventsInfo(asyncEvents: [], syncEvents: [PAYMENT_METHOD_PROCESS_TOKENIZATION_SESSION]) { + """A status of the payment method tokenization.""" + result: PaymentMethodTokenizationResult! + + """The identifier of the payment method.""" + id: String + + """A data returned by the payment app.""" + data: JSON + errors: [PaymentMethodProcessTokenizationError!]! } -type StockError @doc(category: "Products") { +type PaymentMethodProcessTokenizationError @doc(category: "Payments") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -20310,768 +25142,861 @@ type StockError @doc(category: "Products") { message: String """The error code.""" - code: StockErrorCode! + code: PaymentMethodProcessTokenizationErrorCode! } """An enumeration.""" -enum StockErrorCode @doc(category: "Products") { - ALREADY_EXISTS +enum PaymentMethodProcessTokenizationErrorCode @doc(category: "Payments") { GRAPHQL_ERROR INVALID NOT_FOUND - REQUIRED - UNIQUE + CHANNEL_INACTIVE + GATEWAY_ERROR } """ -Update stocks for product variant. +Creates a new page. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: MANAGE_PAGES. """ -type ProductVariantStocksUpdate @doc(category: "Products") { - """Updated product variant.""" - productVariant: ProductVariant - bulkStockErrors: [BulkStockError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [BulkStockError!]! +type PageCreate @doc(category: "Pages") { + pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PageError!]! + page: Page } -""" -Updates an existing variant for product. +type PageError @doc(category: "Pages") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type ProductVariantUpdate @doc(category: "Products") { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! - productVariant: ProductVariant -} + """The error message.""" + message: String -input ProductVariantInput @doc(category: "Products") { - """List of attributes specific to this variant.""" - attributes: [AttributeValueInput!] + """The error code.""" + code: PageErrorCode! - """Stock keeping unit.""" - sku: String + """List of attributes IDs which causes the error.""" + attributes: [ID!] - """Variant name.""" - name: String + """List of attribute values IDs which causes the error.""" + values: [ID!] +} - """ - Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. - """ - trackInventory: Boolean +"""An enumeration.""" +enum PageErrorCode @doc(category: "Pages") { + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE + DUPLICATED_INPUT_ITEM + ATTRIBUTE_ALREADY_ASSIGNED +} - """Weight of the Product Variant.""" - weight: WeightScalar +input PageCreateInput @doc(category: "Pages") { + """Page internal name.""" + slug: String - """ - Determines if variant is in preorder. - - Added in Saleor 3.1. - """ - preorder: PreorderSettingsInput + """Page title.""" + title: String """ - Determines maximum quantity of `ProductVariant`,that can be bought in a single checkout. + Page content. - Added in Saleor 3.1. + Rich text format. For reference see https://editorjs.io/ """ - quantityLimitPerCustomer: Int + content: JSONString - """ - Fields required to update the product variant metadata. - - Added in Saleor 3.8. - """ - metadata: [MetadataInput!] + """List of attributes.""" + attributes: [AttributeValueInput!] + + """Determines if page is visible in the storefront.""" + isPublished: Boolean """ - Fields required to update the product variant private metadata. + Publication date. ISO 8601 standard. - Added in Saleor 3.8. + DEPRECATED: this field will be removed in Saleor 4.0. Use `publishedAt` field instead. """ - privateMetadata: [MetadataInput!] + publicationDate: String """ - External ID of this product variant. + Publication date time. ISO 8601 standard. - Added in Saleor 3.10. + Added in Saleor 3.3. """ - externalReference: String -} + publishedAt: DateTime -""" -Set default variant for a product. Mutation triggers PRODUCT_UPDATED webhook. + """Search engine optimization fields.""" + seo: SeoInput -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type ProductVariantSetDefault @doc(category: "Products") { - product: Product - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! + """ID of the page type that page belongs to.""" + pageType: ID! } """ -Creates/updates translations for a product variant. +Deletes a page. -Requires one of the following permissions: MANAGE_TRANSLATIONS. +Requires one of the following permissions: MANAGE_PAGES. """ -type ProductVariantTranslate @doc(category: "Products") { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [TranslationError!]! - productVariant: ProductVariant -} - -input NameTranslationInput { - name: String +type PageDelete @doc(category: "Pages") { + pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PageError!]! + page: Page } """ -Manage product variant prices in channels. +Deletes pages. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: MANAGE_PAGES. """ -type ProductVariantChannelListingUpdate @doc(category: "Products") { - """An updated product variant instance.""" - variant: ProductVariant - productChannelListingErrors: [ProductChannelListingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductChannelListingError!]! +type PageBulkDelete @doc(category: "Pages") { + """Returns how many objects were affected.""" + count: Int! + pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PageError!]! } """ -Reorder product variant attribute values. +Publish pages. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: MANAGE_PAGES. """ -type ProductVariantReorderAttributeValues @doc(category: "Products") { - """Product variant from which attribute values are reordered.""" - productVariant: ProductVariant - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! +type PageBulkPublish @doc(category: "Pages") { + """Returns how many objects were affected.""" + count: Int! + pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PageError!]! } """ -Deactivates product variant preorder. It changes all preorder allocation into regular allocation. - -Added in Saleor 3.1. +Updates an existing page. -Requires one of the following permissions: MANAGE_PRODUCTS. +Requires one of the following permissions: MANAGE_PAGES. """ -type ProductVariantPreorderDeactivate @doc(category: "Products") { - """Product variant with ended preorder.""" - productVariant: ProductVariant - errors: [ProductError!]! +type PageUpdate @doc(category: "Pages") { + pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PageError!]! + page: Page } -""" -Assign an media to a product variant. - -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type VariantMediaAssign @doc(category: "Products") { - productVariant: ProductVariant - media: ProductMedia - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! -} +input PageInput @doc(category: "Pages") { + """Page internal name.""" + slug: String -""" -Unassign an media from a product variant. + """Page title.""" + title: String -Requires one of the following permissions: MANAGE_PRODUCTS. -""" -type VariantMediaUnassign @doc(category: "Products") { - productVariant: ProductVariant - media: ProductMedia - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [ProductError!]! -} + """ + Page content. + + Rich text format. For reference see https://editorjs.io/ + """ + content: JSONString -""" -Captures the authorized payment amount. + """List of attributes.""" + attributes: [AttributeValueInput!] -Requires one of the following permissions: MANAGE_ORDERS. -""" -type PaymentCapture @doc(category: "Payments") { - """Updated payment.""" - payment: Payment - paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PaymentError!]! -} + """Determines if page is visible in the storefront.""" + isPublished: Boolean -type PaymentError @doc(category: "Payments") { """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + Publication date. ISO 8601 standard. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `publishedAt` field instead. """ - field: String - - """The error message.""" - message: String - - """The error code.""" - code: PaymentErrorCode! + publicationDate: String - """List of variant IDs which causes the error.""" - variants: [ID!] -} + """ + Publication date time. ISO 8601 standard. + + Added in Saleor 3.3. + """ + publishedAt: DateTime -"""An enumeration.""" -enum PaymentErrorCode @doc(category: "Payments") { - BILLING_ADDRESS_NOT_SET - GRAPHQL_ERROR - INVALID - NOT_FOUND - REQUIRED - UNIQUE - PARTIAL_PAYMENT_NOT_ALLOWED - SHIPPING_ADDRESS_NOT_SET - INVALID_SHIPPING_METHOD - SHIPPING_METHOD_NOT_SET - PAYMENT_ERROR - NOT_SUPPORTED_GATEWAY - CHANNEL_INACTIVE - BALANCE_CHECK_ERROR - CHECKOUT_EMAIL_NOT_SET - UNAVAILABLE_VARIANT_IN_CHANNEL - NO_CHECKOUT_LINES + """Search engine optimization fields.""" + seo: SeoInput } """ -Refunds the captured payment amount. +Creates/updates translations for a page. -Requires one of the following permissions: MANAGE_ORDERS. +Requires one of the following permissions: MANAGE_TRANSLATIONS. """ -type PaymentRefund @doc(category: "Payments") { - """Updated payment.""" - payment: Payment - paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PaymentError!]! +type PageTranslate @doc(category: "Pages") { + translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [TranslationError!]! + page: PageTranslatableContent +} + +input PageTranslationInput { + seoTitle: String + seoDescription: String + title: String + + """ + Translated page content. + + Rich text format. For reference see https://editorjs.io/ + """ + content: JSONString } """ -Voids the authorized payment. +Create a new page type. -Requires one of the following permissions: MANAGE_ORDERS. +Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. """ -type PaymentVoid @doc(category: "Payments") { - """Updated payment.""" - payment: Payment - paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PaymentError!]! -} - -"""Initializes payment process when it is required by gateway.""" -type PaymentInitialize @doc(category: "Payments") { - initializedPayment: PaymentInitialized - paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PaymentError!]! +type PageTypeCreate @doc(category: "Pages") { + pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PageError!]! + pageType: PageType } -""" -Server-side data generated by a payment gateway. Optional step when the payment provider requires an additional action to initialize payment session. -""" -type PaymentInitialized @doc(category: "Payments") { - """ID of a payment gateway.""" - gateway: String! +input PageTypeCreateInput @doc(category: "Pages") { + """Name of the page type.""" + name: String - """Payment gateway name.""" - name: String! + """Page type slug.""" + slug: String - """Initialized data by gateway.""" - data: JSONString + """List of attribute IDs to be assigned to the page type.""" + addAttributes: [ID!] } -"""Check payment balance.""" -type PaymentCheckBalance @doc(category: "Payments") { - """Response from the gateway.""" - data: JSONString - paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PaymentError!]! +""" +Update page type. + +Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. +""" +type PageTypeUpdate @doc(category: "Pages") { + pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PageError!]! + pageType: PageType } -input PaymentCheckBalanceInput @doc(category: "Payments") { - """An ID of a payment gateway to check.""" - gatewayId: String! +input PageTypeUpdateInput @doc(category: "Pages") { + """Name of the page type.""" + name: String - """Payment method name.""" - method: String! + """Page type slug.""" + slug: String - """Slug of a channel for which the data should be returned.""" - channel: String! + """List of attribute IDs to be assigned to the page type.""" + addAttributes: [ID!] - """Information about card.""" - card: CardInput! + """List of attribute IDs to be assigned to the page type.""" + removeAttributes: [ID!] } -input CardInput { - """ - Payment method nonce, a token returned by the appropriate provider's SDK. - """ - code: String! - - """Card security code.""" - cvc: String +""" +Delete a page type. - """Information about currency and amount.""" - money: MoneyInput! +Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. +""" +type PageTypeDelete @doc(category: "Pages") { + pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PageError!]! + pageType: PageType } -input MoneyInput { - """Currency code.""" - currency: String! +""" +Delete page types. - """Amount of money.""" - amount: PositiveDecimal! +Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. +""" +type PageTypeBulkDelete @doc(category: "Pages") { + """Returns how many objects were affected.""" + count: Int! + pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PageError!]! } """ -Create transaction for checkout or order. - -Added in Saleor 3.4. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. +Assign attributes to a given page type. -Requires one of the following permissions: HANDLE_PAYMENTS. +Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. """ -type TransactionCreate @doc(category: "Payments") { - transaction: TransactionItem - errors: [TransactionCreateError!]! +type PageAttributeAssign @doc(category: "Pages") { + """The updated page type.""" + pageType: PageType + pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PageError!]! } -type TransactionCreateError @doc(category: "Payments") { - """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - """ - field: String - - """The error message.""" - message: String - - """The error code.""" - code: TransactionCreateErrorCode! -} +""" +Unassign attributes from a given page type. -"""An enumeration.""" -enum TransactionCreateErrorCode @doc(category: "Payments") { - INVALID - GRAPHQL_ERROR - NOT_FOUND - INCORRECT_CURRENCY - METADATA_KEY_REQUIRED - UNIQUE +Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. +""" +type PageAttributeUnassign @doc(category: "Pages") { + """The updated page type.""" + pageType: PageType + pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PageError!]! } -input TransactionCreateInput @doc(category: "Payments") { - """ - Status of the transaction. - - DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). The `status` is not needed. The amounts can be used to define the current status of transactions. - """ - status: String +""" +Reorder the attributes of a page type. - """ - Payment type used for this transaction. - - DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `name` and `message` instead. - """ - type: String +Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. +""" +type PageTypeReorderAttributes @doc(category: "Pages") { + """Page type from which attributes are reordered.""" + pageType: PageType + pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PageError!]! +} - """ - Payment name of the transaction. - - Added in Saleor 3.13. - """ - name: String +""" +Reorder page attribute values. - """ - The message of the transaction. - - Added in Saleor 3.13. - """ - message: String +Requires one of the following permissions: MANAGE_PAGES. +""" +type PageReorderAttributeValues @doc(category: "Pages") { + """Page from which attribute values are reordered.""" + page: Page + pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PageError!]! +} - """ - Reference of the transaction. - - DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `pspReference` instead. - """ - reference: String +""" +Completes creating an order. - """ - PSP Reference of the transaction. - - Added in Saleor 3.13. - """ - pspReference: String +Requires one of the following permissions: MANAGE_ORDERS. +""" +type DraftOrderComplete @doc(category: "Orders") { + """Completed order.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! +} - """List of all possible actions for the transaction""" - availableActions: [TransactionActionEnum!] +""" +Creates a new draft order. - """Amount authorized by this transaction.""" - amountAuthorized: MoneyInput +Requires one of the following permissions: MANAGE_ORDERS. +""" +type DraftOrderCreate @doc(category: "Orders") { + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! + order: Order +} - """Amount charged by this transaction.""" - amountCharged: MoneyInput +input DraftOrderCreateInput @doc(category: "Orders") { + """Billing address of the customer.""" + billingAddress: AddressInput - """Amount refunded by this transaction.""" - amountRefunded: MoneyInput + """Customer associated with the draft order.""" + user: ID - """ - Amount voided by this transaction. - - DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `amountCanceled` instead. - """ - amountVoided: MoneyInput + """Email address of the customer.""" + userEmail: String - """ - Amount canceled by this transaction. - - Added in Saleor 3.13. - """ - amountCanceled: MoneyInput + """Discount amount for the order.""" + discount: PositiveDecimal - """Payment public metadata.""" - metadata: [MetadataInput!] + """Shipping address of the customer.""" + shippingAddress: AddressInput - """Payment private metadata.""" - privateMetadata: [MetadataInput!] + """ID of a selected shipping method.""" + shippingMethod: ID - """ - The url that will allow to redirect user to payment provider page with transaction event details. - - Added in Saleor 3.13. - """ - externalUrl: String -} + """ID of the voucher associated with the order.""" + voucher: ID -input TransactionEventInput @doc(category: "Payments") { """ - Current status of the payment transaction. + A code of the voucher associated with the order. - DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Status will be calculated by Saleor. + Added in Saleor 3.18. """ - status: TransactionStatus + voucherCode: String + + """A note from a customer. Visible by customers in the order summary.""" + customerNote: String + + """ID of the channel associated with the order.""" + channelId: ID """ - Reference of the transaction. - - DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `pspReference` instead. + URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. """ - reference: String + redirectUrl: String """ - PSP Reference related to this action. + External ID of this order. - Added in Saleor 3.13. + Added in Saleor 3.10. """ - pspReference: String + externalReference: String + + """Variant line input consisting of variant ID and quantity of products.""" + lines: [OrderLineCreateInput!] +} + +input OrderLineCreateInput @doc(category: "Orders") { + """Number of variant items ordered.""" + quantity: Int! + + """Product variant ID.""" + variantId: ID! """ - Name of the transaction. + Flag that allow force splitting the same variant into multiple lines by skipping the matching logic. - DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `message` instead. `name` field will be added to `message`. + Added in Saleor 3.6. """ - name: String + forceNewLine: Boolean = false """ - The message related to the event. + Custom price of the item.When the line with the same variant will be provided multiple times, the last price will be used. - Added in Saleor 3.13. + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - message: String + price: PositiveDecimal } """ -Update transaction. +Deletes a draft order. -Added in Saleor 3.4. +Requires one of the following permissions: MANAGE_ORDERS. +""" +type DraftOrderDelete @doc(category: "Orders") { + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! + order: Order +} -Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +Deletes draft orders. -Requires the following permissions: OWNER and HANDLE_PAYMENTS for apps, HANDLE_PAYMENTS for staff users. Staff user cannot update a transaction that is owned by the app. +Requires one of the following permissions: MANAGE_ORDERS. """ -type TransactionUpdate @doc(category: "Payments") { - transaction: TransactionItem - errors: [TransactionUpdateError!]! +type DraftOrderBulkDelete @doc(category: "Orders") { + """Returns how many objects were affected.""" + count: Int! + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! } -type TransactionUpdateError @doc(category: "Payments") { - """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - """ - field: String - - """The error message.""" - message: String +""" +Deletes order lines. - """The error code.""" - code: TransactionUpdateErrorCode! +Requires one of the following permissions: MANAGE_ORDERS. +""" +type DraftOrderLinesBulkDelete @doc(category: "Orders") { + """Returns how many objects were affected.""" + count: Int! + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! } -"""An enumeration.""" -enum TransactionUpdateErrorCode @doc(category: "Payments") { - INVALID - GRAPHQL_ERROR - NOT_FOUND - INCORRECT_CURRENCY - METADATA_KEY_REQUIRED - UNIQUE +""" +Updates a draft order. + +Requires one of the following permissions: MANAGE_ORDERS. +""" +type DraftOrderUpdate @doc(category: "Orders") { + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! + order: Order } -input TransactionUpdateInput @doc(category: "Payments") { - """ - Status of the transaction. - - DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). The `status` is not needed. The amounts can be used to define the current status of transactions. - """ - status: String +input DraftOrderInput @doc(category: "Orders") { + """Billing address of the customer.""" + billingAddress: AddressInput - """ - Payment type used for this transaction. - - DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `name` and `message` instead. - """ - type: String + """Customer associated with the draft order.""" + user: ID - """ - Payment name of the transaction. - - Added in Saleor 3.13. - """ - name: String + """Email address of the customer.""" + userEmail: String + + """Discount amount for the order.""" + discount: PositiveDecimal + + """Shipping address of the customer.""" + shippingAddress: AddressInput + + """ID of a selected shipping method.""" + shippingMethod: ID + + """ID of the voucher associated with the order.""" + voucher: ID """ - The message of the transaction. + A code of the voucher associated with the order. - Added in Saleor 3.13. + Added in Saleor 3.18. """ - message: String + voucherCode: String + + """A note from a customer. Visible by customers in the order summary.""" + customerNote: String + + """ID of the channel associated with the order.""" + channelId: ID """ - Reference of the transaction. - - DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `pspReference` instead. + URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. """ - reference: String + redirectUrl: String """ - PSP Reference of the transaction. + External ID of this order. - Added in Saleor 3.13. + Added in Saleor 3.10. """ - pspReference: String + externalReference: String +} - """List of all possible actions for the transaction""" - availableActions: [TransactionActionEnum!] +""" +Adds note to the order. - """Amount authorized by this transaction.""" - amountAuthorized: MoneyInput +DEPRECATED: this mutation will be removed in Saleor 4.0. - """Amount charged by this transaction.""" - amountCharged: MoneyInput +Requires one of the following permissions: MANAGE_ORDERS. +""" +type OrderAddNote @doc(category: "Orders") { + """Order with the note added.""" + order: Order - """Amount refunded by this transaction.""" - amountRefunded: MoneyInput + """Order note created.""" + event: OrderEvent + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! +} +input OrderAddNoteInput @doc(category: "Orders") { """ - Amount voided by this transaction. + Note message. - DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `amountCanceled` instead. + DEPRECATED: this field will be removed in Saleor 4.0. """ - amountVoided: MoneyInput + message: String! +} + +""" +Cancel an order. + +Requires one of the following permissions: MANAGE_ORDERS. +""" +type OrderCancel @doc(category: "Orders") { + """Canceled order.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! +} + +""" +Capture an order. + +Requires one of the following permissions: MANAGE_ORDERS. +""" +type OrderCapture @doc(category: "Orders") { + """Captured order.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! +} + +""" +Confirms an unconfirmed order by changing status to unfulfilled. + +Requires one of the following permissions: MANAGE_ORDERS. +""" +type OrderConfirm @doc(category: "Orders") { + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! +} + +""" +Creates new fulfillments for an order. + +Requires one of the following permissions: MANAGE_ORDERS. + +Triggers the following webhook events: +- FULFILLMENT_CREATED (async): A new fulfillment is created. +- ORDER_FULFILLED (async): Order is fulfilled. +- FULFILLMENT_TRACKING_NUMBER_UPDATED (async): Sent when fulfillment tracking number is updated. +- FULFILLMENT_APPROVED (async): A fulfillment is approved. +""" +type OrderFulfill @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [FULFILLMENT_CREATED, ORDER_FULFILLED, FULFILLMENT_TRACKING_NUMBER_UPDATED, FULFILLMENT_APPROVED], syncEvents: []) { + """List of created fulfillments.""" + fulfillments: [Fulfillment!] + + """Fulfilled order.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! +} + +input OrderFulfillInput @doc(category: "Orders") { + """List of items informing how to fulfill the order.""" + lines: [OrderFulfillLineInput!]! + + """If true, send an email notification to the customer.""" + notifyCustomer: Boolean + + """If true, then allow proceed fulfillment when stock is exceeded.""" + allowStockToBeExceeded: Boolean = false """ - Amount canceled by this transaction. + Fulfillment tracking number. - Added in Saleor 3.13. + Added in Saleor 3.6. """ - amountCanceled: MoneyInput + trackingNumber: String +} + +input OrderFulfillLineInput @doc(category: "Orders") { + """The ID of the order line.""" + orderLineId: ID + + """List of stock items to create.""" + stocks: [OrderFulfillStockInput!]! +} + +input OrderFulfillStockInput @doc(category: "Orders") { + """The number of line items to be fulfilled from given warehouse.""" + quantity: Int! - """Payment public metadata.""" - metadata: [MetadataInput!] + """ID of the warehouse from which the item will be fulfilled.""" + warehouse: ID! +} - """Payment private metadata.""" - privateMetadata: [MetadataInput!] +""" +Cancels existing fulfillment and optionally restocks items. + +Requires one of the following permissions: MANAGE_ORDERS. +""" +type FulfillmentCancel @doc(category: "Orders") { + """A canceled fulfillment.""" + fulfillment: Fulfillment + + """Order which fulfillment was cancelled.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! +} +input FulfillmentCancelInput @doc(category: "Orders") { """ - The url that will allow to redirect user to payment provider page with transaction event details. - - Added in Saleor 3.13. + ID of a warehouse where items will be restocked. Optional when fulfillment is in WAITING_FOR_APPROVAL state. """ - externalUrl: String + warehouseId: ID } """ -Request an action for payment transaction. +Approve existing fulfillment. -Added in Saleor 3.4. +Added in Saleor 3.1. -Note: this API is currently in Feature Preview and can be subject to changes at later point. +Requires one of the following permissions: MANAGE_ORDERS. -Requires one of the following permissions: HANDLE_PAYMENTS. +Triggers the following webhook events: +- FULFILLMENT_APPROVED (async): Fulfillment is approved. """ -type TransactionRequestAction @doc(category: "Payments") { - transaction: TransactionItem - errors: [TransactionRequestActionError!]! +type FulfillmentApprove @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [FULFILLMENT_APPROVED], syncEvents: []) { + """An approved fulfillment.""" + fulfillment: Fulfillment + + """Order which fulfillment was approved.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! } -type TransactionRequestActionError @doc(category: "Payments") { - """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - """ - field: String +""" +Updates a fulfillment for an order. - """The error message.""" - message: String +Requires one of the following permissions: MANAGE_ORDERS. - """The error code.""" - code: TransactionRequestActionErrorCode! +Triggers the following webhook events: +- FULFILLMENT_TRACKING_NUMBER_UPDATED (async): Fulfillment tracking number is updated. +""" +type FulfillmentUpdateTracking @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [FULFILLMENT_TRACKING_NUMBER_UPDATED], syncEvents: []) { + """A fulfillment with updated tracking.""" + fulfillment: Fulfillment + + """Order for which fulfillment was updated.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! } -"""An enumeration.""" -enum TransactionRequestActionErrorCode @doc(category: "Payments") { - INVALID - GRAPHQL_ERROR - NOT_FOUND - MISSING_TRANSACTION_ACTION_REQUEST_WEBHOOK +input FulfillmentUpdateTrackingInput @doc(category: "Orders") { + """Fulfillment tracking number.""" + trackingNumber: String + + """If true, send an email notification to the customer.""" + notifyCustomer: Boolean = false } """ -Report the event for the transaction. +Refund products. -Added in Saleor 3.13. +Requires one of the following permissions: MANAGE_ORDERS. +""" +type FulfillmentRefundProducts @doc(category: "Orders") { + """A refunded fulfillment.""" + fulfillment: Fulfillment -Note: this API is currently in Feature Preview and can be subject to changes at later point. + """Order which fulfillment was refunded.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! +} -Requires the following permissions: OWNER and HANDLE_PAYMENTS for apps, HANDLE_PAYMENTS for staff users. Staff user cannot update a transaction that is owned by the app. -""" -type TransactionEventReport @doc(category: "Payments") { - """Defines if the reported event hasn't been processed earlier.""" - alreadyProcessed: Boolean +input OrderRefundProductsInput @doc(category: "Orders") { + """List of unfulfilled lines to refund.""" + orderLines: [OrderRefundLineInput!] - """The transaction related to the reported event.""" - transaction: TransactionItem + """List of fulfilled lines to refund.""" + fulfillmentLines: [OrderRefundFulfillmentLineInput!] - """ - The event assigned to this report. if `alreadyProcessed` is set to `true`, the previously processed event will be returned. - """ - transactionEvent: TransactionEvent - errors: [TransactionEventReportError!]! -} + """The total amount of refund when the value is provided manually.""" + amountToRefund: PositiveDecimal -type TransactionEventReportError @doc(category: "Payments") { """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + If true, Saleor will refund shipping costs. If amountToRefund is providedincludeShippingCosts will be ignored. """ - field: String + includeShippingCosts: Boolean = false +} - """The error message.""" - message: String +input OrderRefundLineInput @doc(category: "Orders") { + """The ID of the order line to refund.""" + orderLineId: ID! - """The error code.""" - code: TransactionEventReportErrorCode! + """The number of items to be refunded.""" + quantity: Int! } -"""An enumeration.""" -enum TransactionEventReportErrorCode @doc(category: "Payments") { - INVALID - GRAPHQL_ERROR - NOT_FOUND - INCORRECT_DETAILS - ALREADY_EXISTS +input OrderRefundFulfillmentLineInput @doc(category: "Orders") { + """The ID of the fulfillment line to refund.""" + fulfillmentLineId: ID! + + """The number of items to be refunded.""" + quantity: Int! } """ -Initializes a payment gateway session. It triggers the webhook `PAYMENT_GATEWAY_INITIALIZE_SESSION`, to the requested `paymentGateways`. If `paymentGateways` is not provided, the webhook will be send to all subscribed payment gateways. - -Added in Saleor 3.13. +Return products. -Note: this API is currently in Feature Preview and can be subject to changes at later point. +Requires one of the following permissions: MANAGE_ORDERS. """ -type PaymentGatewayInitialize @doc(category: "Payments") { - gatewayConfigs: [PaymentGatewayConfig!] - errors: [PaymentGatewayInitializeError!]! -} +type FulfillmentReturnProducts @doc(category: "Orders") { + """A return fulfillment.""" + returnFulfillment: Fulfillment -type PaymentGatewayConfig @doc(category: "Payments") { - """The app identifier.""" - id: String! + """A replace fulfillment.""" + replaceFulfillment: Fulfillment - """The JSON data required to initialize the payment gateway.""" - data: JSON - errors: [PaymentGatewayConfigError!] + """Order which fulfillment was returned.""" + order: Order + + """A draft order which was created for products with replace flag.""" + replaceOrder: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! } -scalar JSON +input OrderReturnProductsInput @doc(category: "Orders") { + """List of unfulfilled lines to return.""" + orderLines: [OrderReturnLineInput!] -type PaymentGatewayConfigError @doc(category: "Payments") { - """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - """ - field: String + """List of fulfilled lines to return.""" + fulfillmentLines: [OrderReturnFulfillmentLineInput!] - """The error message.""" - message: String + """The total amount of refund when the value is provided manually.""" + amountToRefund: PositiveDecimal - """The error code.""" - code: PaymentGatewayConfigErrorCode! -} + """ + If true, Saleor will refund shipping costs. If amountToRefund is providedincludeShippingCosts will be ignored. + """ + includeShippingCosts: Boolean = false -"""An enumeration.""" -enum PaymentGatewayConfigErrorCode @doc(category: "Payments") { - GRAPHQL_ERROR - INVALID - NOT_FOUND + """If true, Saleor will call refund action for all lines.""" + refund: Boolean = false } -type PaymentGatewayInitializeError @doc(category: "Payments") { - """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - """ - field: String +input OrderReturnLineInput @doc(category: "Orders") { + """The ID of the order line to return.""" + orderLineId: ID! - """The error message.""" - message: String + """The number of items to be returned.""" + quantity: Int! - """The error code.""" - code: PaymentGatewayInitializeErrorCode! + """Determines, if the line should be added to replace order.""" + replace: Boolean = false } -"""An enumeration.""" -enum PaymentGatewayInitializeErrorCode @doc(category: "Payments") { - GRAPHQL_ERROR - INVALID - NOT_FOUND -} +input OrderReturnFulfillmentLineInput @doc(category: "Orders") { + """The ID of the fulfillment line to return.""" + fulfillmentLineId: ID! -input PaymentGatewayToInitialize @doc(category: "Payments") { - """The identifier of the payment gateway app to initialize.""" - id: String! + """The number of items to be returned.""" + quantity: Int! - """The data that will be passed to the payment gateway.""" - data: JSON + """Determines, if the line should be added to replace order.""" + replace: Boolean = false } """ -Initializes a transaction session. It triggers the webhook `TRANSACTION_INITIALIZE_SESSION`, to the requested `paymentGateways`. +Adds granted refund to the order. Added in Saleor 3.13. -Note: this API is currently in Feature Preview and can be subject to changes at later point. +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: MANAGE_ORDERS. """ -type TransactionInitialize @doc(category: "Payments") { - """The initialized transaction.""" - transaction: TransactionItem +type OrderGrantRefundCreate @doc(category: "Orders") { + """Order which has assigned new grant refund.""" + order: Order + + """Created granted refund.""" + grantedRefund: OrderGrantedRefund + errors: [OrderGrantRefundCreateError!]! +} + +type OrderGrantRefundCreateError @doc(category: "Orders") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """The error message.""" + message: String - """The event created for the initialized transaction.""" - transactionEvent: TransactionEvent + """The error code.""" + code: OrderGrantRefundCreateErrorCode! - """The JSON data required to finalize the payment.""" - data: JSON - errors: [TransactionInitializeError!]! + """ + List of lines which cause the error. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + lines: [OrderGrantRefundCreateLineError!] } -type TransactionInitializeError @doc(category: "Payments") { +"""An enumeration.""" +enum OrderGrantRefundCreateErrorCode @doc(category: "Orders") { + GRAPHQL_ERROR + NOT_FOUND + SHIPPING_COSTS_ALREADY_GRANTED + REQUIRED + INVALID +} + +type OrderGrantRefundCreateLineError { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -21081,36 +26006,77 @@ type TransactionInitializeError @doc(category: "Payments") { message: String """The error code.""" - code: TransactionInitializeErrorCode! + code: OrderGrantRefundCreateLineErrorCode! + + """The ID of the line related to the error.""" + lineId: ID! } """An enumeration.""" -enum TransactionInitializeErrorCode @doc(category: "Payments") { +enum OrderGrantRefundCreateLineErrorCode { GRAPHQL_ERROR - INVALID NOT_FOUND + QUANTITY_GREATER_THAN_AVAILABLE +} + +input OrderGrantRefundCreateInput @doc(category: "Orders") { + """ + Amount of the granted refund. If not provided, the amount will be calculated automatically based on provided `lines` and `grantRefundForShipping`. + """ + amount: Decimal + + """Reason of the granted refund.""" + reason: String + + """ + Lines to assign to granted refund. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + lines: [OrderGrantRefundCreateLineInput!] + + """ + Determine if granted refund should include shipping costs. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + grantRefundForShipping: Boolean +} + +input OrderGrantRefundCreateLineInput @doc(category: "Orders") { + """The ID of the order line.""" + id: ID! + + """The quantity of line items to be marked to refund.""" + quantity: Int! + + """Reason of the granted refund for the line.""" + reason: String } """ -Processes a transaction session. It triggers the webhook `TRANSACTION_PROCESS_SESSION`, to the assigned `paymentGateways`. +Updates granted refund. Added in Saleor 3.13. -Note: this API is currently in Feature Preview and can be subject to changes at later point. -""" -type TransactionProcess @doc(category: "Payments") { - """The processed transaction.""" - transaction: TransactionItem +Note: this API is currently in Feature Preview and can be subject to changes at later point. - """The event created for the processed transaction.""" - transactionEvent: TransactionEvent +Requires one of the following permissions: MANAGE_ORDERS. +""" +type OrderGrantRefundUpdate @doc(category: "Orders") { + """Order which has assigned updated grant refund.""" + order: Order - """The json data required to finalize the payment.""" - data: JSON - errors: [TransactionProcessError!]! + """Created granted refund.""" + grantedRefund: OrderGrantedRefund + errors: [OrderGrantRefundUpdateError!]! } -type TransactionProcessError @doc(category: "Payments") { +type OrderGrantRefundUpdateError @doc(category: "Orders") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -21120,31 +26086,37 @@ type TransactionProcessError @doc(category: "Payments") { message: String """The error code.""" - code: TransactionProcessErrorCode! + code: OrderGrantRefundUpdateErrorCode! + + """ + List of lines to add which cause the error. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + addLines: [OrderGrantRefundUpdateLineError!] + + """ + List of lines to remove which cause the error. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + removeLines: [OrderGrantRefundUpdateLineError!] } """An enumeration.""" -enum TransactionProcessErrorCode @doc(category: "Payments") { +enum OrderGrantRefundUpdateErrorCode @doc(category: "Orders") { GRAPHQL_ERROR - INVALID NOT_FOUND - TRANSACTION_ALREADY_PROCESSED - MISSING_PAYMENT_APP_RELATION - MISSING_PAYMENT_APP -} - -""" -Creates a new page. - -Requires one of the following permissions: MANAGE_PAGES. -""" -type PageCreate @doc(category: "Pages") { - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PageError!]! - page: Page + REQUIRED + INVALID + SHIPPING_COSTS_ALREADY_GRANTED } -type PageError @doc(category: "Pages") { +type OrderGrantRefundUpdateLineError { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -21154,404 +26126,362 @@ type PageError @doc(category: "Pages") { message: String """The error code.""" - code: PageErrorCode! + code: OrderGrantRefundUpdateLineErrorCode! - """List of attributes IDs which causes the error.""" - attributes: [ID!] - - """List of attribute values IDs which causes the error.""" - values: [ID!] + """The ID of the line related to the error.""" + lineId: ID! } """An enumeration.""" -enum PageErrorCode @doc(category: "Pages") { +enum OrderGrantRefundUpdateLineErrorCode { GRAPHQL_ERROR - INVALID NOT_FOUND - REQUIRED - UNIQUE - DUPLICATED_INPUT_ITEM - ATTRIBUTE_ALREADY_ASSIGNED + QUANTITY_GREATER_THAN_AVAILABLE } -input PageCreateInput @doc(category: "Pages") { - """Page internal name.""" - slug: String +input OrderGrantRefundUpdateInput @doc(category: "Orders") { + """ + Amount of the granted refund. if not provided and `addLines` or `removeLines` or `grantRefundForShipping` is provided, amount will be calculated automatically. + """ + amount: Decimal - """Page title.""" - title: String + """Reason of the granted refund.""" + reason: String """ - Page content. + Lines to assign to granted refund. - Rich text format. For reference see https://editorjs.io/ + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - content: JSONString - - """List of attributes.""" - attributes: [AttributeValueInput!] - - """Determines if page is visible in the storefront.""" - isPublished: Boolean + addLines: [OrderGrantRefundUpdateLineAddInput!] """ - Publication date. ISO 8601 standard. + Lines to remove from granted refund. - DEPRECATED: this field will be removed in Saleor 4.0. Use `publishedAt` field instead. + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - publicationDate: String + removeLines: [ID!] """ - Publication date time. ISO 8601 standard. + Determine if granted refund should include shipping costs. - Added in Saleor 3.3. + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - publishedAt: DateTime - - """Search engine optimization fields.""" - seo: SeoInput - - """ID of the page type that page belongs to.""" - pageType: ID! + grantRefundForShipping: Boolean } -""" -Deletes a page. +input OrderGrantRefundUpdateLineAddInput @doc(category: "Orders") { + """The ID of the order line.""" + id: ID! -Requires one of the following permissions: MANAGE_PAGES. -""" -type PageDelete @doc(category: "Pages") { - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PageError!]! - page: Page + """The quantity of line items to be marked to refund.""" + quantity: Int! + + """Reason of the granted refund for the line.""" + reason: String } """ -Deletes pages. +Create order lines for an order. -Requires one of the following permissions: MANAGE_PAGES. +Requires one of the following permissions: MANAGE_ORDERS. """ -type PageBulkDelete @doc(category: "Pages") { - """Returns how many objects were affected.""" - count: Int! - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PageError!]! +type OrderLinesCreate @doc(category: "Orders") { + """Related order.""" + order: Order + + """List of added order lines.""" + orderLines: [OrderLine!] + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! } """ -Publish pages. +Deletes an order line from an order. -Requires one of the following permissions: MANAGE_PAGES. +Requires one of the following permissions: MANAGE_ORDERS. """ -type PageBulkPublish @doc(category: "Pages") { - """Returns how many objects were affected.""" - count: Int! - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PageError!]! +type OrderLineDelete @doc(category: "Orders") { + """A related order.""" + order: Order + + """An order line that was deleted.""" + orderLine: OrderLine + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! } """ -Updates an existing page. +Updates an order line of an order. -Requires one of the following permissions: MANAGE_PAGES. +Requires one of the following permissions: MANAGE_ORDERS. """ -type PageUpdate @doc(category: "Pages") { - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PageError!]! - page: Page -} - -input PageInput @doc(category: "Pages") { - """Page internal name.""" - slug: String - - """Page title.""" - title: String - - """ - Page content. - - Rich text format. For reference see https://editorjs.io/ - """ - content: JSONString - - """List of attributes.""" - attributes: [AttributeValueInput!] - - """Determines if page is visible in the storefront.""" - isPublished: Boolean - - """ - Publication date. ISO 8601 standard. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `publishedAt` field instead. - """ - publicationDate: String - - """ - Publication date time. ISO 8601 standard. - - Added in Saleor 3.3. - """ - publishedAt: DateTime +type OrderLineUpdate @doc(category: "Orders") { + """Related order.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! + orderLine: OrderLine +} - """Search engine optimization fields.""" - seo: SeoInput +input OrderLineInput @doc(category: "Orders") { + """Number of variant items ordered.""" + quantity: Int! } """ -Creates/updates translations for a page. +Adds discount to the order. -Requires one of the following permissions: MANAGE_TRANSLATIONS. +Requires one of the following permissions: MANAGE_ORDERS. """ -type PageTranslate @doc(category: "Pages") { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [TranslationError!]! - page: PageTranslatableContent +type OrderDiscountAdd @doc(category: "Orders") { + """Order which has been discounted.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! } -input PageTranslationInput { - seoTitle: String - seoDescription: String - title: String +input OrderDiscountCommonInput @doc(category: "Orders") { + """Type of the discount: fixed or percent""" + valueType: DiscountValueTypeEnum! - """ - Translated page content. - - Rich text format. For reference see https://editorjs.io/ - """ - content: JSONString + """Value of the discount. Can store fixed value or percent value""" + value: PositiveDecimal! + + """Explanation for the applied discount.""" + reason: String } """ -Create a new page type. +Update discount for the order. -Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. +Requires one of the following permissions: MANAGE_ORDERS. """ -type PageTypeCreate @doc(category: "Pages") { - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PageError!]! - pageType: PageType +type OrderDiscountUpdate @doc(category: "Orders") { + """Order which has been discounted.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! } -input PageTypeCreateInput @doc(category: "Pages") { - """Name of the page type.""" - name: String - - """Page type slug.""" - slug: String +""" +Remove discount from the order. - """List of attribute IDs to be assigned to the page type.""" - addAttributes: [ID!] +Requires one of the following permissions: MANAGE_ORDERS. +""" +type OrderDiscountDelete @doc(category: "Orders") { + """Order which has removed discount.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! } """ -Update page type. +Update discount for the order line. -Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. +Requires one of the following permissions: MANAGE_ORDERS. """ -type PageTypeUpdate @doc(category: "Pages") { - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PageError!]! - pageType: PageType -} +type OrderLineDiscountUpdate @doc(category: "Orders") { + """Order line which has been discounted.""" + orderLine: OrderLine -input PageTypeUpdateInput @doc(category: "Pages") { - """Name of the page type.""" - name: String + """Order which is related to the discounted line.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! +} - """Page type slug.""" - slug: String +""" +Remove discount applied to the order line. - """List of attribute IDs to be assigned to the page type.""" - addAttributes: [ID!] +Requires one of the following permissions: MANAGE_ORDERS. +""" +type OrderLineDiscountRemove @doc(category: "Orders") { + """Order line which has removed discount.""" + orderLine: OrderLine - """List of attribute IDs to be assigned to the page type.""" - removeAttributes: [ID!] + """Order which is related to line which has removed discount.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! } """ -Delete a page type. +Adds note to the order. -Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. +Added in Saleor 3.15. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: MANAGE_ORDERS. """ -type PageTypeDelete @doc(category: "Pages") { - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PageError!]! - pageType: PageType +type OrderNoteAdd @doc(category: "Orders") { + """Order with the note added.""" + order: Order + + """Order note created.""" + event: OrderEvent + errors: [OrderNoteAddError!]! } -""" -Delete page types. +type OrderNoteAddError @doc(category: "Orders") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String -Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. -""" -type PageTypeBulkDelete @doc(category: "Pages") { - """Returns how many objects were affected.""" - count: Int! - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PageError!]! + """The error message.""" + message: String + + """The error code.""" + code: OrderNoteAddErrorCode } -""" -Assign attributes to a given page type. +"""An enumeration.""" +enum OrderNoteAddErrorCode @doc(category: "Orders") { + GRAPHQL_ERROR + REQUIRED +} -Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. -""" -type PageAttributeAssign @doc(category: "Pages") { - """The updated page type.""" - pageType: PageType - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PageError!]! +input OrderNoteInput @doc(category: "Orders") { + """Note message.""" + message: String! } """ -Unassign attributes from a given page type. +Updates note of an order. -Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. +Added in Saleor 3.15. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: MANAGE_ORDERS. """ -type PageAttributeUnassign @doc(category: "Pages") { - """The updated page type.""" - pageType: PageType - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PageError!]! +type OrderNoteUpdate @doc(category: "Orders") { + """Order with the note updated.""" + order: Order + + """Order note updated.""" + event: OrderEvent + errors: [OrderNoteUpdateError!]! } -""" -Reorder the attributes of a page type. +type OrderNoteUpdateError @doc(category: "Orders") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String -Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. -""" -type PageTypeReorderAttributes @doc(category: "Pages") { - """Page type from which attributes are reordered.""" - pageType: PageType - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PageError!]! + """The error message.""" + message: String + + """The error code.""" + code: OrderNoteUpdateErrorCode +} + +"""An enumeration.""" +enum OrderNoteUpdateErrorCode @doc(category: "Orders") { + GRAPHQL_ERROR + NOT_FOUND + REQUIRED } """ -Reorder page attribute values. +Mark order as manually paid. -Requires one of the following permissions: MANAGE_PAGES. +Requires one of the following permissions: MANAGE_ORDERS. """ -type PageReorderAttributeValues @doc(category: "Pages") { - """Page from which attribute values are reordered.""" - page: Page - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PageError!]! +type OrderMarkAsPaid @doc(category: "Orders") { + """Order marked as paid.""" + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [OrderError!]! } """ -Completes creating an order. +Refund an order. Requires one of the following permissions: MANAGE_ORDERS. """ -type DraftOrderComplete @doc(category: "Orders") { - """Completed order.""" +type OrderRefund @doc(category: "Orders") { + """A refunded order.""" order: Order orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [OrderError!]! } """ -Creates a new draft order. +Updates an order. Requires one of the following permissions: MANAGE_ORDERS. """ -type DraftOrderCreate @doc(category: "Orders") { +type OrderUpdate @doc(category: "Orders") { orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [OrderError!]! order: Order } -input DraftOrderCreateInput @doc(category: "Orders") { +input OrderUpdateInput @doc(category: "Orders") { """Billing address of the customer.""" billingAddress: AddressInput - """Customer associated with the draft order.""" - user: ID - """Email address of the customer.""" userEmail: String - """Discount amount for the order.""" - discount: PositiveDecimal - """Shipping address of the customer.""" shippingAddress: AddressInput - """ID of a selected shipping method.""" - shippingMethod: ID - - """ID of the voucher associated with the order.""" - voucher: ID - - """A note from a customer. Visible by customers in the order summary.""" - customerNote: String - - """ID of the channel associated with the order.""" - channelId: ID - - """ - URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. - """ - redirectUrl: String - - """ - External ID of this order. - - Added in Saleor 3.10. - """ - externalReference: String - - """Variant line input consisting of variant ID and quantity of products.""" - lines: [OrderLineCreateInput!] -} - -input OrderLineCreateInput @doc(category: "Orders") { - """Number of variant items ordered.""" - quantity: Int! - - """Product variant ID.""" - variantId: ID! - """ - Flag that allow force splitting the same variant into multiple lines by skipping the matching logic. + External ID of this order. - Added in Saleor 3.6. + Added in Saleor 3.10. """ - forceNewLine: Boolean = false + externalReference: String } """ -Deletes a draft order. +Updates a shipping method of the order. Requires shipping method ID to update, when null is passed then currently assigned shipping method is removed. Requires one of the following permissions: MANAGE_ORDERS. """ -type DraftOrderDelete @doc(category: "Orders") { +type OrderUpdateShipping @doc(category: "Orders") { + """Order with updated shipping method.""" + order: Order orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [OrderError!]! - order: Order +} + +input OrderUpdateShippingInput @doc(category: "Orders") { + """ + ID of the selected shipping method, pass null to remove currently assigned shipping method. + """ + shippingMethod: ID } """ -Deletes draft orders. +Void an order. Requires one of the following permissions: MANAGE_ORDERS. """ -type DraftOrderBulkDelete @doc(category: "Orders") { - """Returns how many objects were affected.""" - count: Int! +type OrderVoid @doc(category: "Orders") { + """A voided order.""" + order: Order orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [OrderError!]! } """ -Deletes order lines. +Cancels orders. Requires one of the following permissions: MANAGE_ORDERS. """ -type DraftOrderLinesBulkDelete @doc(category: "Orders") { +type OrderBulkCancel @doc(category: "Orders") { """Returns how many objects were affected.""" count: Int! orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -21559,405 +26489,673 @@ type DraftOrderLinesBulkDelete @doc(category: "Orders") { } """ -Updates a draft order. +Creates multiple orders. -Requires one of the following permissions: MANAGE_ORDERS. +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: MANAGE_ORDERS_IMPORT. """ -type DraftOrderUpdate @doc(category: "Orders") { - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +type OrderBulkCreate @doc(category: "Orders") { + """Returns how many objects were created.""" + count: Int! + + """List of the created orders.""" + results: [OrderBulkCreateResult!]! + errors: [OrderBulkCreateError!]! +} + +type OrderBulkCreateResult @doc(category: "Orders") { + """Order data.""" order: Order + + """List of errors occurred on create attempt.""" + errors: [OrderBulkCreateError!] } -input DraftOrderInput @doc(category: "Orders") { - """Billing address of the customer.""" - billingAddress: AddressInput +type OrderBulkCreateError @doc(category: "Orders") { + """ + Path to field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + path: String - """Customer associated with the draft order.""" - user: ID + """The error message.""" + message: String - """Email address of the customer.""" - userEmail: String + """The error code.""" + code: OrderBulkCreateErrorCode +} - """Discount amount for the order.""" - discount: PositiveDecimal +"""An enumeration.""" +enum OrderBulkCreateErrorCode { + GRAPHQL_ERROR + REQUIRED + INVALID + NOT_FOUND + UNIQUE + BULK_LIMIT + TOO_MANY_IDENTIFIERS + FUTURE_DATE + INVALID_QUANTITY + PRICE_ERROR + NOTE_LENGTH + INSUFFICIENT_STOCK + NON_EXISTING_STOCK + NO_RELATED_ORDER_LINE + NEGATIVE_INDEX + ORDER_LINE_FULFILLMENT_LINE_MISMATCH + METADATA_KEY_REQUIRED + INCORRECT_CURRENCY +} + +input OrderBulkCreateInput @doc(category: "Orders") { + """External ID of the order.""" + externalReference: String + + """Slug of the channel associated with the order.""" + channel: String! + + """The date, when the order was inserted to Saleor database.""" + createdAt: DateTime! + + """Status of the order.""" + status: OrderStatus + + """Customer associated with the order.""" + user: OrderBulkCreateUserInput! + + """Billing address of the customer.""" + billingAddress: AddressInput! """Shipping address of the customer.""" shippingAddress: AddressInput - """ID of a selected shipping method.""" - shippingMethod: ID + """Currency code.""" + currency: String! - """ID of the voucher associated with the order.""" - voucher: ID + """Metadata of the order.""" + metadata: [MetadataInput!] - """A note from a customer. Visible by customers in the order summary.""" + """Private metadata of the order.""" + privateMetadata: [MetadataInput!] + + """Note about customer.""" customerNote: String - """ID of the channel associated with the order.""" - channelId: ID + """Notes related to the order.""" + notes: [OrderBulkCreateNoteInput!] + + """Order language code.""" + languageCode: LanguageCodeEnum! + + """Determines whether displayed prices should include taxes.""" + displayGrossPrices: Boolean + + """Weight of the order in kg.""" + weight: WeightScalar """ - URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. + URL of a view, where users should be redirected to see the order details. """ redirectUrl: String + """List of order lines.""" + lines: [OrderBulkCreateOrderLineInput!]! + + """The delivery method selected for this order.""" + deliveryMethod: OrderBulkCreateDeliveryMethodInput + + """List of gift card codes associated with the order.""" + giftCards: [String!] + """ - External ID of this order. + Code of a voucher associated with the order. - Added in Saleor 3.10. + Added in Saleor 3.18. """ - externalReference: String + voucherCode: String + + """List of discounts.""" + discounts: [OrderDiscountCommonInput!] + + """Fulfillments of the order.""" + fulfillments: [OrderBulkCreateFulfillmentInput!] + + """Transactions related to the order.""" + transactions: [TransactionCreateInput!] + + """Invoices related to the order.""" + invoices: [OrderBulkCreateInvoiceInput!] } -""" -Adds note to the order. +input OrderBulkCreateUserInput @doc(category: "Orders") { + """Customer ID associated with the order.""" + id: ID -Requires one of the following permissions: MANAGE_ORDERS. -""" -type OrderAddNote @doc(category: "Orders") { - """Order with the note added.""" - order: Order + """Customer email associated with the order.""" + email: String - """Order note created.""" - event: OrderEvent - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! + """Customer external ID associated with the order.""" + externalReference: String } -input OrderAddNoteInput @doc(category: "Orders") { - """Note message.""" +input OrderBulkCreateNoteInput @doc(category: "Orders") { + """Note message. Max characters: 255.""" message: String! + + """The date associated with the message.""" + date: DateTime + + """The user ID associated with the message.""" + userId: ID + + """The user email associated with the message.""" + userEmail: ID + + """The user external ID associated with the message.""" + userExternalReference: ID + + """The app ID associated with the message.""" + appId: ID +} + +input OrderBulkCreateOrderLineInput @doc(category: "Orders") { + """The ID of the product variant.""" + variantId: ID + + """The SKU of the product variant.""" + variantSku: String + + """The external ID of the product variant.""" + variantExternalReference: String + + """The name of the product variant.""" + variantName: String + + """The name of the product.""" + productName: String + + """Translation of the product variant name.""" + translatedVariantName: String + + """Translation of the product name.""" + translatedProductName: String + + """The date, when the order line was created.""" + createdAt: DateTime! + + """Determines whether shipping of the order line items is required.""" + isShippingRequired: Boolean! + + """Gift card flag.""" + isGiftCard: Boolean! + + """Number of items in the order line""" + quantity: Int! + + """Price of the order line.""" + totalPrice: TaxedMoneyInput! + + """Price of the order line excluding applied discount.""" + undiscountedTotalPrice: TaxedMoneyInput! + + """The ID of the warehouse, where the line will be allocated.""" + warehouse: ID! + + """Metadata of the order line.""" + metadata: [MetadataInput!] + + """Private metadata of the order line.""" + privateMetadata: [MetadataInput!] + + """Tax rate of the order line.""" + taxRate: PositiveDecimal + + """The ID of the tax class.""" + taxClassId: ID + + """The name of the tax class.""" + taxClassName: String + + """Metadata of the tax class.""" + taxClassMetadata: [MetadataInput!] + + """Private metadata of the tax class.""" + taxClassPrivateMetadata: [MetadataInput!] +} + +input TaxedMoneyInput @doc(category: "Orders") { + """Gross value of an item.""" + gross: PositiveDecimal! + + """Net value of an item.""" + net: PositiveDecimal! +} + +input OrderBulkCreateDeliveryMethodInput @doc(category: "Orders") { + """The ID of the warehouse.""" + warehouseId: ID + + """The name of the warehouse.""" + warehouseName: String + + """The ID of the shipping method.""" + shippingMethodId: ID + + """The name of the shipping method.""" + shippingMethodName: String + + """The price of the shipping.""" + shippingPrice: TaxedMoneyInput + + """Tax rate of the shipping.""" + shippingTaxRate: PositiveDecimal + + """The ID of the tax class.""" + shippingTaxClassId: ID + + """The name of the tax class.""" + shippingTaxClassName: String + + """Metadata of the tax class.""" + shippingTaxClassMetadata: [MetadataInput!] + + """Private metadata of the tax class.""" + shippingTaxClassPrivateMetadata: [MetadataInput!] +} + +input OrderBulkCreateFulfillmentInput @doc(category: "Orders") { + """Fulfillment's tracking code.""" + trackingCode: String + + """List of items informing how to fulfill the order.""" + lines: [OrderBulkCreateFulfillmentLineInput!] +} + +input OrderBulkCreateFulfillmentLineInput @doc(category: "Orders") { + """The ID of the product variant.""" + variantId: ID + + """The SKU of the product variant.""" + variantSku: String + + """The external ID of the product variant.""" + variantExternalReference: String + + """The number of line items to be fulfilled from given warehouse.""" + quantity: Int! + + """ID of the warehouse from which the item will be fulfilled.""" + warehouse: ID! + + """0-based index of order line, which the fulfillment line refers to.""" + orderLineIndex: Int! +} + +input OrderBulkCreateInvoiceInput @doc(category: "Orders") { + """The date, when the invoice was created.""" + createdAt: DateTime! + + """Invoice number.""" + number: String + + """URL of the invoice to download.""" + url: String + + """Metadata of the invoice.""" + metadata: [MetadataInput!] + + """Private metadata of the invoice.""" + privateMetadata: [MetadataInput!] } """ -Cancel an order. +Determine how stocks should be updated, while processing an order. -Requires one of the following permissions: MANAGE_ORDERS. + SKIP - stocks are not checked and not updated. + UPDATE - only do update, if there is enough stock. + FORCE - force update, if there is not enough stock. """ -type OrderCancel @doc(category: "Orders") { - """Canceled order.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +enum StockUpdatePolicyEnum { + SKIP + UPDATE + FORCE +} + +""" +Delete metadata of an object. To use it, you need to have access to the modified object. +""" +type DeleteMetadata { + metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MetadataError!]! + item: ObjectWithMetadata +} + +type MetadataError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """The error message.""" + message: String + + """The error code.""" + code: MetadataErrorCode! +} + +"""An enumeration.""" +enum MetadataErrorCode { + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + NOT_UPDATED } """ -Capture an order. - -Requires one of the following permissions: MANAGE_ORDERS. +Delete object's private metadata. To use it, you need to be an authenticated staff user or an app and have access to the modified object. """ -type OrderCapture @doc(category: "Orders") { - """Captured order.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +type DeletePrivateMetadata { + metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MetadataError!]! + item: ObjectWithMetadata } """ -Confirms an unconfirmed order by changing status to unfulfilled. - -Requires one of the following permissions: MANAGE_ORDERS. +Updates metadata of an object. To use it, you need to have access to the modified object. """ -type OrderConfirm @doc(category: "Orders") { - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +type UpdateMetadata { + metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MetadataError!]! + item: ObjectWithMetadata } """ -Creates new fulfillments for an order. - -Requires one of the following permissions: MANAGE_ORDERS. +Updates private metadata of an object. To use it, you need to be an authenticated staff user or an app and have access to the modified object. """ -type OrderFulfill @doc(category: "Orders") { - """List of created fulfillments.""" - fulfillments: [Fulfillment!] - - """Fulfilled order.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +type UpdatePrivateMetadata { + metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MetadataError!]! + item: ObjectWithMetadata } -input OrderFulfillInput @doc(category: "Orders") { - """List of items informing how to fulfill the order.""" - lines: [OrderFulfillLineInput!]! - - """If true, send an email notification to the customer.""" - notifyCustomer: Boolean +""" +Assigns storefront's navigation menus. - """If true, then allow proceed fulfillment when stock is exceeded.""" - allowStockToBeExceeded: Boolean = false +Requires one of the following permissions: MANAGE_MENUS, MANAGE_SETTINGS. +""" +type AssignNavigation @doc(category: "Menu") { + """Assigned navigation menu.""" + menu: Menu + menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MenuError!]! +} +type MenuError @doc(category: "Menu") { """ - Fulfillment tracking number. - - Added in Saleor 3.6. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - trackingNumber: String -} + field: String -input OrderFulfillLineInput @doc(category: "Orders") { - """The ID of the order line.""" - orderLineId: ID + """The error message.""" + message: String - """List of stock items to create.""" - stocks: [OrderFulfillStockInput!]! + """The error code.""" + code: MenuErrorCode! } -input OrderFulfillStockInput @doc(category: "Orders") { - """The number of line items to be fulfilled from given warehouse.""" - quantity: Int! - - """ID of the warehouse from which the item will be fulfilled.""" - warehouse: ID! +"""An enumeration.""" +enum MenuErrorCode { + CANNOT_ASSIGN_NODE + GRAPHQL_ERROR + INVALID + INVALID_MENU_ITEM + NO_MENU_ITEM_PROVIDED + NOT_FOUND + REQUIRED + TOO_MANY_MENU_ITEMS + UNIQUE } -""" -Cancels existing fulfillment and optionally restocks items. - -Requires one of the following permissions: MANAGE_ORDERS. -""" -type FulfillmentCancel @doc(category: "Orders") { - """A canceled fulfillment.""" - fulfillment: Fulfillment - - """Order which fulfillment was cancelled.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! -} +enum NavigationType { + """Main storefront navigation.""" + MAIN -input FulfillmentCancelInput @doc(category: "Orders") { - """ - ID of a warehouse where items will be restocked. Optional when fulfillment is in WAITING_FOR_APPROVAL state. - """ - warehouseId: ID + """Secondary storefront navigation.""" + SECONDARY } """ -Approve existing fulfillment. +Creates a new Menu. -Added in Saleor 3.1. +Requires one of the following permissions: MANAGE_MENUS. -Requires one of the following permissions: MANAGE_ORDERS. +Triggers the following webhook events: +- MENU_CREATED (async): A menu was created. """ -type FulfillmentApprove @doc(category: "Orders") { - """An approved fulfillment.""" - fulfillment: Fulfillment - - """Order which fulfillment was approved.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +type MenuCreate @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_CREATED], syncEvents: []) { + menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MenuError!]! + menu: Menu } -""" -Updates a fulfillment for an order. +input MenuCreateInput { + """Name of the menu.""" + name: String! -Requires one of the following permissions: MANAGE_ORDERS. -""" -type FulfillmentUpdateTracking @doc(category: "Orders") { - """A fulfillment with updated tracking.""" - fulfillment: Fulfillment + """Slug of the menu. Will be generated if not provided.""" + slug: String - """Order for which fulfillment was updated.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! + """List of menu items.""" + items: [MenuItemInput!] } -input FulfillmentUpdateTrackingInput @doc(category: "Orders") { - """Fulfillment tracking number.""" - trackingNumber: String +input MenuItemInput { + """Name of the menu item.""" + name: String - """If true, send an email notification to the customer.""" - notifyCustomer: Boolean = false + """URL of the pointed item.""" + url: String + + """Category to which item points.""" + category: ID + + """Collection to which item points.""" + collection: ID + + """Page to which item points.""" + page: ID } """ -Refund products. +Deletes a menu. -Requires one of the following permissions: MANAGE_ORDERS. -""" -type FulfillmentRefundProducts @doc(category: "Orders") { - """A refunded fulfillment.""" - fulfillment: Fulfillment +Requires one of the following permissions: MANAGE_MENUS. - """Order which fulfillment was refunded.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +Triggers the following webhook events: +- MENU_DELETED (async): A menu was deleted. +""" +type MenuDelete @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_DELETED], syncEvents: []) { + menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MenuError!]! + menu: Menu } -input OrderRefundProductsInput @doc(category: "Orders") { - """List of unfulfilled lines to refund.""" - orderLines: [OrderRefundLineInput!] - - """List of fulfilled lines to refund.""" - fulfillmentLines: [OrderRefundFulfillmentLineInput!] +""" +Deletes menus. - """The total amount of refund when the value is provided manually.""" - amountToRefund: PositiveDecimal +Requires one of the following permissions: MANAGE_MENUS. - """ - If true, Saleor will refund shipping costs. If amountToRefund is providedincludeShippingCosts will be ignored. - """ - includeShippingCosts: Boolean = false +Triggers the following webhook events: +- MENU_DELETED (async): A menu was deleted. +""" +type MenuBulkDelete @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_DELETED], syncEvents: []) { + """Returns how many objects were affected.""" + count: Int! + menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MenuError!]! } -input OrderRefundLineInput @doc(category: "Orders") { - """The ID of the order line to refund.""" - orderLineId: ID! +""" +Updates a menu. - """The number of items to be refunded.""" - quantity: Int! +Requires one of the following permissions: MANAGE_MENUS. + +Triggers the following webhook events: +- MENU_UPDATED (async): A menu was updated. +""" +type MenuUpdate @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_UPDATED], syncEvents: []) { + menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MenuError!]! + menu: Menu } -input OrderRefundFulfillmentLineInput @doc(category: "Orders") { - """The ID of the fulfillment line to refund.""" - fulfillmentLineId: ID! +input MenuInput { + """Name of the menu.""" + name: String - """The number of items to be refunded.""" - quantity: Int! + """Slug of the menu.""" + slug: String } """ -Return products. +Creates a new menu item. -Requires one of the following permissions: MANAGE_ORDERS. -""" -type FulfillmentReturnProducts @doc(category: "Orders") { - """A return fulfillment.""" - returnFulfillment: Fulfillment +Requires one of the following permissions: MANAGE_MENUS. - """A replace fulfillment.""" - replaceFulfillment: Fulfillment +Triggers the following webhook events: +- MENU_ITEM_CREATED (async): A menu item was created. +""" +type MenuItemCreate @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_ITEM_CREATED], syncEvents: []) { + menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MenuError!]! + menuItem: MenuItem +} - """Order which fulfillment was returned.""" - order: Order +input MenuItemCreateInput { + """Name of the menu item.""" + name: String! - """A draft order which was created for products with replace flag.""" - replaceOrder: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! -} + """URL of the pointed item.""" + url: String -input OrderReturnProductsInput @doc(category: "Orders") { - """List of unfulfilled lines to return.""" - orderLines: [OrderReturnLineInput!] + """Category to which item points.""" + category: ID - """List of fulfilled lines to return.""" - fulfillmentLines: [OrderReturnFulfillmentLineInput!] + """Collection to which item points.""" + collection: ID - """The total amount of refund when the value is provided manually.""" - amountToRefund: PositiveDecimal + """Page to which item points.""" + page: ID - """ - If true, Saleor will refund shipping costs. If amountToRefund is providedincludeShippingCosts will be ignored. - """ - includeShippingCosts: Boolean = false + """Menu to which item belongs.""" + menu: ID! - """If true, Saleor will call refund action for all lines.""" - refund: Boolean = false + """ID of the parent menu. If empty, menu will be top level menu.""" + parent: ID } -input OrderReturnLineInput @doc(category: "Orders") { - """The ID of the order line to return.""" - orderLineId: ID! +""" +Deletes a menu item. - """The number of items to be returned.""" - quantity: Int! +Requires one of the following permissions: MANAGE_MENUS. - """Determines, if the line should be added to replace order.""" - replace: Boolean = false +Triggers the following webhook events: +- MENU_ITEM_DELETED (async): A menu item was deleted. +""" +type MenuItemDelete @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_ITEM_DELETED], syncEvents: []) { + menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MenuError!]! + menuItem: MenuItem } -input OrderReturnFulfillmentLineInput @doc(category: "Orders") { - """The ID of the fulfillment line to return.""" - fulfillmentLineId: ID! +""" +Deletes menu items. - """The number of items to be returned.""" - quantity: Int! +Requires one of the following permissions: MANAGE_MENUS. - """Determines, if the line should be added to replace order.""" - replace: Boolean = false +Triggers the following webhook events: +- MENU_ITEM_DELETED (async): A menu item was deleted. +""" +type MenuItemBulkDelete @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_ITEM_DELETED], syncEvents: []) { + """Returns how many objects were affected.""" + count: Int! + menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MenuError!]! } """ -Adds granted refund to the order. +Updates a menu item. -Added in Saleor 3.13. +Requires one of the following permissions: MANAGE_MENUS. -Note: this API is currently in Feature Preview and can be subject to changes at later point. +Triggers the following webhook events: +- MENU_ITEM_UPDATED (async): A menu item was updated. +""" +type MenuItemUpdate @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_ITEM_UPDATED], syncEvents: []) { + menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MenuError!]! + menuItem: MenuItem +} -Requires one of the following permissions: MANAGE_ORDERS. """ -type OrderGrantRefundCreate @doc(category: "Orders") { - """Order which has assigned new grant refund.""" - order: Order +Creates/updates translations for a menu item. - """Created granted refund.""" - grantedRefund: OrderGrantedRefund - errors: [OrderGrantRefundCreateError!]! +Requires one of the following permissions: MANAGE_TRANSLATIONS. +""" +type MenuItemTranslate @doc(category: "Menu") { + translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [TranslationError!]! + menuItem: MenuItem } -type OrderGrantRefundCreateError @doc(category: "Orders") { - """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - """ - field: String +""" +Moves items of menus. - """The error message.""" - message: String +Requires one of the following permissions: MANAGE_MENUS. - """The error code.""" - code: OrderGrantRefundCreateErrorCode! +Triggers the following webhook events: +- MENU_ITEM_UPDATED (async): Optionally triggered when sort order or parent changed for menu item. +""" +type MenuItemMove @doc(category: "Menu") @webhookEventsInfo(asyncEvents: [MENU_ITEM_UPDATED], syncEvents: []) { + """Assigned menu to move within.""" + menu: Menu + menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [MenuError!]! } -"""An enumeration.""" -enum OrderGrantRefundCreateErrorCode @doc(category: "Orders") { - GRAPHQL_ERROR - NOT_FOUND -} +input MenuItemMoveInput { + """The menu item ID to move.""" + itemId: ID! -input OrderGrantRefundCreateInput @doc(category: "Orders") { - """Amount of the granted refund.""" - amount: Decimal! + """ID of the parent menu. If empty, menu will be top level menu.""" + parentId: ID - """Reason of the granted refund.""" - reason: String + """ + The new relative sorting position of the item (from -inf to +inf). 1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. + """ + sortOrder: Int } """ -Custom Decimal implementation. - -Returns Decimal as a float in the API, -parses float to the Decimal on the way back. -""" -scalar Decimal - -""" -Updates granted refund. - -Added in Saleor 3.13. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. +Request an invoice for the order using plugin. Requires one of the following permissions: MANAGE_ORDERS. + +Triggers the following webhook events: +- INVOICE_REQUESTED (async): An invoice was requested. """ -type OrderGrantRefundUpdate @doc(category: "Orders") { - """Order which has assigned updated grant refund.""" +type InvoiceRequest @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [INVOICE_REQUESTED], syncEvents: []) { + """Order related to an invoice.""" order: Order - - """Created granted refund.""" - grantedRefund: OrderGrantedRefund - errors: [OrderGrantRefundUpdateError!]! - orderGrantedRefund: OrderGrantedRefund + invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [InvoiceError!]! + invoice: Invoice } -type OrderGrantRefundUpdateError @doc(category: "Orders") { +type InvoiceError @doc(category: "Orders") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -21967,548 +27165,598 @@ type OrderGrantRefundUpdateError @doc(category: "Orders") { message: String """The error code.""" - code: OrderGrantRefundUpdateErrorCode! + code: InvoiceErrorCode! } """An enumeration.""" -enum OrderGrantRefundUpdateErrorCode @doc(category: "Orders") { - GRAPHQL_ERROR - NOT_FOUND +enum InvoiceErrorCode @doc(category: "Orders") { REQUIRED -} - -input OrderGrantRefundUpdateInput @doc(category: "Orders") { - """Amount of the granted refund.""" - amount: Decimal - - """Reason of the granted refund.""" - reason: String + NOT_READY + URL_NOT_SET + EMAIL_NOT_SET + NUMBER_NOT_SET + NOT_FOUND + INVALID_STATUS + NO_INVOICE_PLUGIN } """ -Create order lines for an order. +Requests deletion of an invoice. Requires one of the following permissions: MANAGE_ORDERS. -""" -type OrderLinesCreate @doc(category: "Orders") { - """Related order.""" - order: Order - """List of added order lines.""" - orderLines: [OrderLine!] - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +Triggers the following webhook events: +- INVOICE_DELETED (async): An invoice was requested to delete. +""" +type InvoiceRequestDelete @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [INVOICE_DELETED], syncEvents: []) { + invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [InvoiceError!]! + invoice: Invoice } """ -Deletes an order line from an order. +Creates a ready to send invoice. Requires one of the following permissions: MANAGE_ORDERS. """ -type OrderLineDelete @doc(category: "Orders") { - """A related order.""" - order: Order +type InvoiceCreate @doc(category: "Orders") { + invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [InvoiceError!]! + invoice: Invoice +} - """An order line that was deleted.""" - orderLine: OrderLine - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +input InvoiceCreateInput @doc(category: "Orders") { + """Invoice number.""" + number: String! + + """URL of an invoice to download.""" + url: String! + + """ + Fields required to update the invoice metadata. + + Added in Saleor 3.14. + """ + metadata: [MetadataInput!] + + """ + Fields required to update the invoice private metadata. + + Added in Saleor 3.14. + """ + privateMetadata: [MetadataInput!] } """ -Updates an order line of an order. +Deletes an invoice. Requires one of the following permissions: MANAGE_ORDERS. """ -type OrderLineUpdate @doc(category: "Orders") { - """Related order.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! - orderLine: OrderLine -} - -input OrderLineInput @doc(category: "Orders") { - """Number of variant items ordered.""" - quantity: Int! +type InvoiceDelete @doc(category: "Orders") { + invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [InvoiceError!]! + invoice: Invoice } """ -Adds discount to the order. +Updates an invoice. Requires one of the following permissions: MANAGE_ORDERS. """ -type OrderDiscountAdd @doc(category: "Orders") { - """Order which has been discounted.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +type InvoiceUpdate @doc(category: "Orders") { + invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [InvoiceError!]! + invoice: Invoice } -input OrderDiscountCommonInput @doc(category: "Orders") { - """Type of the discount: fixed or percent""" - valueType: DiscountValueTypeEnum! - - """Value of the discount. Can store fixed value or percent value""" - value: PositiveDecimal! +input UpdateInvoiceInput @doc(category: "Orders") { + """Invoice number""" + number: String - """Explanation for the applied discount.""" - reason: String -} + """URL of an invoice to download.""" + url: String -""" -Update discount for the order. + """ + Fields required to update the invoice metadata. + + Added in Saleor 3.14. + """ + metadata: [MetadataInput!] -Requires one of the following permissions: MANAGE_ORDERS. -""" -type OrderDiscountUpdate @doc(category: "Orders") { - """Order which has been discounted.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! + """ + Fields required to update the invoice private metadata. + + Added in Saleor 3.14. + """ + privateMetadata: [MetadataInput!] } """ -Remove discount from the order. +Send an invoice notification to the customer. Requires one of the following permissions: MANAGE_ORDERS. + +Triggers the following webhook events: +- INVOICE_SENT (async): A notification for invoice send +- NOTIFY_USER (async): A notification for invoice send """ -type OrderDiscountDelete @doc(category: "Orders") { - """Order which has removed discount.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +type InvoiceSendNotification @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [INVOICE_SENT, NOTIFY_USER], syncEvents: []) { + invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [InvoiceError!]! + invoice: Invoice } """ -Update discount for the order line. +Activate a gift card. -Requires one of the following permissions: MANAGE_ORDERS. -""" -type OrderLineDiscountUpdate @doc(category: "Orders") { - """Order line which has been discounted.""" - orderLine: OrderLine +Requires one of the following permissions: MANAGE_GIFT_CARD. - """Order which is related to the discounted line.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +Triggers the following webhook events: +- GIFT_CARD_STATUS_CHANGED (async): A gift card was activated. +""" +type GiftCardActivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: []) { + """Activated gift card.""" + giftCard: GiftCard + giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [GiftCardError!]! } -""" -Remove discount applied to the order line. +type GiftCardError @doc(category: "Gift cards") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String -Requires one of the following permissions: MANAGE_ORDERS. -""" -type OrderLineDiscountRemove @doc(category: "Orders") { - """Order line which has removed discount.""" - orderLine: OrderLine + """The error message.""" + message: String - """Order which is related to line which has removed discount.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! -} + """The error code.""" + code: GiftCardErrorCode! -""" -Mark order as manually paid. + """List of tag values that cause the error.""" + tags: [String!] +} -Requires one of the following permissions: MANAGE_ORDERS. -""" -type OrderMarkAsPaid @doc(category: "Orders") { - """Order marked as paid.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +"""An enumeration.""" +enum GiftCardErrorCode @doc(category: "Gift cards") { + ALREADY_EXISTS + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE + EXPIRED_GIFT_CARD + DUPLICATED_INPUT_ITEM } """ -Refund an order. +Creates a new gift card. -Requires one of the following permissions: MANAGE_ORDERS. +Requires one of the following permissions: MANAGE_GIFT_CARD. + +Triggers the following webhook events: +- GIFT_CARD_CREATED (async): A gift card was created. +- NOTIFY_USER (async): A notification for created gift card. """ -type OrderRefund @doc(category: "Orders") { - """A refunded order.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +type GiftCardCreate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_CREATED, NOTIFY_USER], syncEvents: []) { + giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [GiftCardError!]! + giftCard: GiftCard } -""" -Updates an order. +input GiftCardCreateInput @doc(category: "Gift cards") { + """ + The gift card tags to add. + + Added in Saleor 3.1. + """ + addTags: [String!] -Requires one of the following permissions: MANAGE_ORDERS. -""" -type OrderUpdate @doc(category: "Orders") { - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! - order: Order -} + """ + The gift card expiry date. + + Added in Saleor 3.1. + """ + expiryDate: Date -input OrderUpdateInput @doc(category: "Orders") { - """Billing address of the customer.""" - billingAddress: AddressInput + """ + Start date of the gift card in ISO 8601 format. + + DEPRECATED: this field will be removed in Saleor 4.0. + """ + startDate: Date - """Email address of the customer.""" - userEmail: String + """ + End date of the gift card in ISO 8601 format. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `expiryDate` from `expirySettings` instead. + """ + endDate: Date - """Shipping address of the customer.""" - shippingAddress: AddressInput + """Balance of the gift card.""" + balance: PriceInput! + + """Email of the customer to whom gift card will be sent.""" + userEmail: String """ - External ID of this order. + Slug of a channel from which the email should be sent. - Added in Saleor 3.10. + Added in Saleor 3.1. """ - externalReference: String -} + channel: String -""" -Updates a shipping method of the order. Requires shipping method ID to update, when null is passed then currently assigned shipping method is removed. + """ + Determine if gift card is active. + + Added in Saleor 3.1. + """ + isActive: Boolean! -Requires one of the following permissions: MANAGE_ORDERS. -""" -type OrderUpdateShipping @doc(category: "Orders") { - """Order with updated shipping method.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! -} + """ + Code to use the gift card. + + DEPRECATED: this field will be removed in Saleor 4.0. The code is now auto generated. + """ + code: String -input OrderUpdateShippingInput @doc(category: "Orders") { """ - ID of the selected shipping method, pass null to remove currently assigned shipping method. + The gift card note from the staff member. + + Added in Saleor 3.1. """ - shippingMethod: ID + note: String +} + +input PriceInput { + """Currency code.""" + currency: String! + + """Amount of money.""" + amount: PositiveDecimal! } """ -Void an order. +Delete gift card. -Requires one of the following permissions: MANAGE_ORDERS. +Added in Saleor 3.1. + +Requires one of the following permissions: MANAGE_GIFT_CARD. + +Triggers the following webhook events: +- GIFT_CARD_DELETED (async): A gift card was deleted. """ -type OrderVoid @doc(category: "Orders") { - """A voided order.""" - order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +type GiftCardDelete @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_DELETED], syncEvents: []) { + giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [GiftCardError!]! + giftCard: GiftCard } """ -Cancels orders. +Deactivate a gift card. -Requires one of the following permissions: MANAGE_ORDERS. +Requires one of the following permissions: MANAGE_GIFT_CARD. + +Triggers the following webhook events: +- GIFT_CARD_STATUS_CHANGED (async): A gift card was deactivated. """ -type OrderBulkCancel @doc(category: "Orders") { - """Returns how many objects were affected.""" - count: Int! - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [OrderError!]! +type GiftCardDeactivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: []) { + """Deactivated gift card.""" + giftCard: GiftCard + giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [GiftCardError!]! } """ -Delete metadata of an object. To use it, you need to have access to the modified object. +Update a gift card. + +Requires one of the following permissions: MANAGE_GIFT_CARD. + +Triggers the following webhook events: +- GIFT_CARD_UPDATED (async): A gift card was updated. """ -type DeleteMetadata { - metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MetadataError!]! - item: ObjectWithMetadata +type GiftCardUpdate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_UPDATED], syncEvents: []) { + giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [GiftCardError!]! + giftCard: GiftCard } -type MetadataError { +input GiftCardUpdateInput @doc(category: "Gift cards") { """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + The gift card tags to add. + + Added in Saleor 3.1. + """ + addTags: [String!] + + """ + The gift card expiry date. + + Added in Saleor 3.1. + """ + expiryDate: Date + + """ + Start date of the gift card in ISO 8601 format. + + DEPRECATED: this field will be removed in Saleor 4.0. + """ + startDate: Date + + """ + End date of the gift card in ISO 8601 format. + + DEPRECATED: this field will be removed in Saleor 4.0. Use `expiryDate` from `expirySettings` instead. + """ + endDate: Date + + """ + The gift card tags to remove. + + Added in Saleor 3.1. + """ + removeTags: [String!] + + """ + The gift card balance amount. + + Added in Saleor 3.1. """ - field: String + balanceAmount: PositiveDecimal +} - """The error message.""" - message: String +""" +Resend a gift card. - """The error code.""" - code: MetadataErrorCode! -} +Added in Saleor 3.1. -"""An enumeration.""" -enum MetadataErrorCode { - GRAPHQL_ERROR - INVALID - NOT_FOUND - REQUIRED - NOT_UPDATED -} +Requires one of the following permissions: MANAGE_GIFT_CARD. +Triggers the following webhook events: +- NOTIFY_USER (async): A notification for gift card resend. """ -Delete object's private metadata. To use it, you need to be an authenticated staff user or an app and have access to the modified object. -""" -type DeletePrivateMetadata { - metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MetadataError!]! - item: ObjectWithMetadata +type GiftCardResend @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: []) { + """Gift card which has been sent.""" + giftCard: GiftCard + errors: [GiftCardError!]! } -""" -Updates metadata of an object. To use it, you need to have access to the modified object. -""" -type UpdateMetadata { - metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MetadataError!]! - item: ObjectWithMetadata -} +input GiftCardResendInput @doc(category: "Gift cards") { + """ID of a gift card to resend.""" + id: ID! -""" -Updates private metadata of an object. To use it, you need to be an authenticated staff user or an app and have access to the modified object. -""" -type UpdatePrivateMetadata { - metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MetadataError!]! - item: ObjectWithMetadata -} + """Email to which gift card should be send.""" + email: String -""" -Assigns storefront's navigation menus. + """Slug of a channel from which the email should be sent.""" + channel: String! +} -Requires one of the following permissions: MANAGE_MENUS, MANAGE_SETTINGS. """ -type AssignNavigation @doc(category: "Menu") { - """Assigned navigation menu.""" - menu: Menu - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MenuError!]! -} +Adds note to the gift card. -type MenuError @doc(category: "Menu") { - """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - """ - field: String +Added in Saleor 3.1. - """The error message.""" - message: String +Requires one of the following permissions: MANAGE_GIFT_CARD. - """The error code.""" - code: MenuErrorCode! -} +Triggers the following webhook events: +- GIFT_CARD_UPDATED (async): A gift card was updated. +""" +type GiftCardAddNote @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_UPDATED], syncEvents: []) { + """Gift card with the note added.""" + giftCard: GiftCard -"""An enumeration.""" -enum MenuErrorCode { - CANNOT_ASSIGN_NODE - GRAPHQL_ERROR - INVALID - INVALID_MENU_ITEM - NO_MENU_ITEM_PROVIDED - NOT_FOUND - REQUIRED - TOO_MANY_MENU_ITEMS - UNIQUE + """Gift card note created.""" + event: GiftCardEvent + errors: [GiftCardError!]! } -enum NavigationType { - """Main storefront navigation.""" - MAIN - - """Secondary storefront navigation.""" - SECONDARY +input GiftCardAddNoteInput @doc(category: "Gift cards") { + """Note message.""" + message: String! } """ -Creates a new Menu. +Create gift cards. -Requires one of the following permissions: MANAGE_MENUS. -""" -type MenuCreate @doc(category: "Menu") { - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MenuError!]! - menu: Menu -} +Added in Saleor 3.1. -input MenuCreateInput { - """Name of the menu.""" - name: String! +Requires one of the following permissions: MANAGE_GIFT_CARD. - """Slug of the menu. Will be generated if not provided.""" - slug: String +Triggers the following webhook events: +- GIFT_CARD_CREATED (async): A gift card was created. +- NOTIFY_USER (async): A notification for created gift card. +""" +type GiftCardBulkCreate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_CREATED, NOTIFY_USER], syncEvents: []) { + """Returns how many objects were created.""" + count: Int! - """List of menu items.""" - items: [MenuItemInput!] + """List of created gift cards.""" + giftCards: [GiftCard!]! + errors: [GiftCardError!]! } -input MenuItemInput { - """Name of the menu item.""" - name: String +input GiftCardBulkCreateInput @doc(category: "Gift cards") { + """The number of cards to issue.""" + count: Int! - """URL of the pointed item.""" - url: String + """Balance of the gift card.""" + balance: PriceInput! - """Category to which item points.""" - category: ID + """The gift card tags.""" + tags: [String!] - """Collection to which item points.""" - collection: ID + """The gift card expiry date.""" + expiryDate: Date - """Page to which item points.""" - page: ID + """Determine if gift card is active.""" + isActive: Boolean! } """ -Deletes a menu. +Delete gift cards. -Requires one of the following permissions: MANAGE_MENUS. +Added in Saleor 3.1. + +Requires one of the following permissions: MANAGE_GIFT_CARD. + +Triggers the following webhook events: +- GIFT_CARD_DELETED (async): A gift card was deleted. """ -type MenuDelete @doc(category: "Menu") { - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MenuError!]! - menu: Menu +type GiftCardBulkDelete @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_DELETED], syncEvents: []) { + """Returns how many objects were affected.""" + count: Int! + errors: [GiftCardError!]! } """ -Deletes menus. +Activate gift cards. -Requires one of the following permissions: MANAGE_MENUS. +Added in Saleor 3.1. + +Requires one of the following permissions: MANAGE_GIFT_CARD. + +Triggers the following webhook events: +- GIFT_CARD_STATUS_CHANGED (async): A gift card was activated. """ -type MenuBulkDelete @doc(category: "Menu") { +type GiftCardBulkActivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: []) { """Returns how many objects were affected.""" count: Int! - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MenuError!]! + errors: [GiftCardError!]! } """ -Updates a menu. +Deactivate gift cards. -Requires one of the following permissions: MANAGE_MENUS. -""" -type MenuUpdate @doc(category: "Menu") { - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MenuError!]! - menu: Menu -} +Added in Saleor 3.1. -input MenuInput { - """Name of the menu.""" - name: String +Requires one of the following permissions: MANAGE_GIFT_CARD. - """Slug of the menu.""" - slug: String +Triggers the following webhook events: +- GIFT_CARD_STATUS_CHANGED (async): A gift card was deactivated. +""" +type GiftCardBulkDeactivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: []) { + """Returns how many objects were affected.""" + count: Int! + errors: [GiftCardError!]! } """ -Creates a new menu item. +Update plugin configuration. -Requires one of the following permissions: MANAGE_MENUS. +Requires one of the following permissions: MANAGE_PLUGINS. """ -type MenuItemCreate @doc(category: "Menu") { - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MenuError!]! - menuItem: MenuItem +type PluginUpdate { + plugin: Plugin + pluginsErrors: [PluginError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PluginError!]! } -input MenuItemCreateInput { - """Name of the menu item.""" - name: String! - - """URL of the pointed item.""" - url: String - - """Category to which item points.""" - category: ID - - """Collection to which item points.""" - collection: ID - - """Page to which item points.""" - page: ID +type PluginError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String - """Menu to which item belongs.""" - menu: ID! + """The error message.""" + message: String - """ID of the parent menu. If empty, menu will be top level menu.""" - parent: ID + """The error code.""" + code: PluginErrorCode! } -""" -Deletes a menu item. - -Requires one of the following permissions: MANAGE_MENUS. -""" -type MenuItemDelete @doc(category: "Menu") { - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MenuError!]! - menuItem: MenuItem +"""An enumeration.""" +enum PluginErrorCode { + GRAPHQL_ERROR + INVALID + PLUGIN_MISCONFIGURED + NOT_FOUND + REQUIRED + UNIQUE } -""" -Deletes menu items. - -Requires one of the following permissions: MANAGE_MENUS. -""" -type MenuItemBulkDelete @doc(category: "Menu") { - """Returns how many objects were affected.""" - count: Int! - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MenuError!]! +input PluginUpdateInput { + """Indicates whether the plugin should be enabled.""" + active: Boolean + + """Configuration of the plugin.""" + configuration: [ConfigurationItemInput!] } -""" -Updates a menu item. +input ConfigurationItemInput { + """Name of the field to update.""" + name: String! -Requires one of the following permissions: MANAGE_MENUS. -""" -type MenuItemUpdate @doc(category: "Menu") { - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MenuError!]! - menuItem: MenuItem + """Value of the given field to update.""" + value: String } """ -Creates/updates translations for a menu item. +Trigger sending a notification with the notify plugin method. Serializes nodes provided as ids parameter and includes this data in the notification payload. -Requires one of the following permissions: MANAGE_TRANSLATIONS. +Added in Saleor 3.1. """ -type MenuItemTranslate @doc(category: "Menu") { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [TranslationError!]! - menuItem: MenuItem +type ExternalNotificationTrigger { + errors: [ExternalNotificationError!]! } -""" -Moves items of menus. +type ExternalNotificationError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String -Requires one of the following permissions: MANAGE_MENUS. -""" -type MenuItemMove @doc(category: "Menu") { - """Assigned menu to move within.""" - menu: Menu - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [MenuError!]! + """The error message.""" + message: String + + """The error code.""" + code: ExternalNotificationErrorCodes! } -input MenuItemMoveInput { - """The menu item ID to move.""" - itemId: ID! +"""An enumeration.""" +enum ExternalNotificationErrorCodes { + REQUIRED + INVALID_MODEL_TYPE + NOT_FOUND + CHANNEL_INACTIVE +} - """ID of the parent menu. If empty, menu will be top level menu.""" - parentId: ID +input ExternalNotificationTriggerInput { + """ + The list of customers or orders node IDs that will be serialized and included in the notification payload. + """ + ids: [ID!]! """ - The new relative sorting position of the item (from -inf to +inf). 1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. + Additional payload that will be merged with the one based on the bussines object ID. """ - sortOrder: Int + extraPayload: JSONString + + """ + External event type. This field is passed to a plugin as an event type. + """ + externalEventType: String! } """ -Request an invoice for the order using plugin. +Creates a new promotion. -Requires one of the following permissions: MANAGE_ORDERS. +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- PROMOTION_CREATED (async): A promotion was created. +- PROMOTION_STARTED (async): Optionally called if promotion was started. """ -type InvoiceRequest @doc(category: "Orders") { - """Order related to an invoice.""" - order: Order - invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [InvoiceError!]! - invoice: Invoice +type PromotionCreate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_CREATED, PROMOTION_STARTED], syncEvents: []) { + errors: [PromotionCreateError!]! + promotion: Promotion } -type InvoiceError @doc(category: "Orders") { +type PromotionCreateError { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -22518,105 +27766,184 @@ type InvoiceError @doc(category: "Orders") { message: String """The error code.""" - code: InvoiceErrorCode! + code: PromotionCreateErrorCode! + + """Index of an input list item that caused the error.""" + index: Int + + """Limit of rules with orderPredicate defined.""" + rulesLimit: Int + + """Number of rules with orderPredicate defined exceeding the limit.""" + rulesLimitExceedBy: Int + + """Limit of gifts assigned to promotion rule.""" + giftsLimit: Int + + """Number of gifts defined for this promotion rule exceeding the limit.""" + giftsLimitExceedBy: Int } """An enumeration.""" -enum InvoiceErrorCode @doc(category: "Orders") { - REQUIRED - NOT_READY - URL_NOT_SET - EMAIL_NOT_SET - NUMBER_NOT_SET +enum PromotionCreateErrorCode { + GRAPHQL_ERROR NOT_FOUND - INVALID_STATUS - NO_INVOICE_PLUGIN + REQUIRED + INVALID + MULTIPLE_CURRENCIES_NOT_ALLOWED + INVALID_PRECISION + MISSING_CHANNELS + RULES_NUMBER_LIMIT + GIFTS_NUMBER_LIMIT + INVALID_GIFT_TYPE } -""" -Requests deletion of an invoice. +input PromotionCreateInput @doc(category: "Discounts") { + """Promotion description.""" + description: JSON -Requires one of the following permissions: MANAGE_ORDERS. -""" -type InvoiceRequestDelete @doc(category: "Orders") { - invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [InvoiceError!]! - invoice: Invoice -} + """The start date of the promotion in ISO 8601 format.""" + startDate: DateTime -""" -Creates a ready to send invoice. + """The end date of the promotion in ISO 8601 format.""" + endDate: DateTime -Requires one of the following permissions: MANAGE_ORDERS. -""" -type InvoiceCreate @doc(category: "Orders") { - invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [InvoiceError!]! - invoice: Invoice -} + """Promotion name.""" + name: String! -input InvoiceCreateInput @doc(category: "Orders") { - """Invoice number.""" - number: String! + """ + Defines the promotion type. Implicate the required promotion rules predicate type and whether the promotion rules will give the catalogue or order discount. + + The default value is `Catalogue`. + + This field will be required from Saleor 3.20. + + Added in Saleor 3.19. + """ + type: PromotionTypeEnum - """URL of an invoice to download.""" - url: String! + """List of promotion rules.""" + rules: [PromotionRuleInput!] } -""" -Deletes an invoice. +input PromotionRuleInput @doc(category: "Discounts") { + """Promotion rule name.""" + name: String -Requires one of the following permissions: MANAGE_ORDERS. -""" -type InvoiceDelete @doc(category: "Orders") { - invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [InvoiceError!]! - invoice: Invoice + """Promotion rule description.""" + description: JSON + + """ + Defines the conditions on the catalogue level that must be met for the reward to be applied. + """ + cataloguePredicate: CataloguePredicateInput + + """ + Defines the conditions on the checkout/draft order level that must be met for the reward to be applied. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + orderPredicate: OrderPredicateInput + + """ + Defines the promotion rule reward value type. Must be provided together with reward value. + """ + rewardValueType: RewardValueTypeEnum + + """ + Defines the discount value. Required when catalogue predicate is provided. + """ + rewardValue: PositiveDecimal + + """ + Defines the reward type of the promotion rule. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + rewardType: RewardTypeEnum + + """List of channel ids to which the rule should apply to.""" + channels: [ID!] + + """ + Product variant IDs available as a gift to choose. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + gifts: [ID!] } -""" -Updates an invoice. +input CataloguePredicateInput @doc(category: "Discounts") { + """Defines the product variant conditions to be met.""" + variantPredicate: ProductVariantWhereInput -Requires one of the following permissions: MANAGE_ORDERS. -""" -type InvoiceUpdate @doc(category: "Orders") { - invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [InvoiceError!]! - invoice: Invoice + """Defines the product conditions to be met.""" + productPredicate: ProductWhereInput + + """Defines the category conditions to be met.""" + categoryPredicate: CategoryWhereInput + + """Defines the collection conditions to be met.""" + collectionPredicate: CollectionWhereInput + + """List of conditions that must be met.""" + AND: [CataloguePredicateInput!] + + """A list of conditions of which at least one must be met.""" + OR: [CataloguePredicateInput!] } -input UpdateInvoiceInput @doc(category: "Orders") { - """Invoice number""" - number: String +input OrderPredicateInput @doc(category: "Discounts") { + """Defines the conditions related to checkout and order objects.""" + discountedObjectPredicate: DiscountedObjectWhereInput - """URL of an invoice to download.""" - url: String + """List of conditions that must be met.""" + AND: [OrderPredicateInput!] + + """A list of conditions of which at least one must be met.""" + OR: [OrderPredicateInput!] } -""" -Send an invoice notification to the customer. +input DiscountedObjectWhereInput @doc(category: "Discounts") { + """Filter by the base subtotal price.""" + baseSubtotalPrice: DecimalFilterInput -Requires one of the following permissions: MANAGE_ORDERS. -""" -type InvoiceSendNotification @doc(category: "Orders") { - invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [InvoiceError!]! - invoice: Invoice + """Filter by the base total price.""" + baseTotalPrice: DecimalFilterInput + + """List of conditions that must be met.""" + AND: [DiscountedObjectWhereInput!] + + """A list of conditions of which at least one must be met.""" + OR: [DiscountedObjectWhereInput!] } """ -Activate a gift card. +Updates an existing promotion. -Requires one of the following permissions: MANAGE_GIFT_CARD. +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- PROMOTION_UPDATED (async): A promotion was updated. +- PROMOTION_STARTED (async): Optionally called if promotion was started. +- PROMOTION_ENDED (async): Optionally called if promotion was ended. """ -type GiftCardActivate @doc(category: "Gift cards") { - """Activated gift card.""" - giftCard: GiftCard - giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [GiftCardError!]! +type PromotionUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_UPDATED, PROMOTION_STARTED, PROMOTION_ENDED], syncEvents: []) { + errors: [PromotionUpdateError!]! + promotion: Promotion } -type GiftCardError @doc(category: "Gift cards") { +type PromotionUpdateError { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -22626,316 +27953,315 @@ type GiftCardError @doc(category: "Gift cards") { message: String """The error code.""" - code: GiftCardErrorCode! - - """List of tag values that cause the error.""" - tags: [String!] + code: PromotionUpdateErrorCode! } """An enumeration.""" -enum GiftCardErrorCode @doc(category: "Gift cards") { - ALREADY_EXISTS +enum PromotionUpdateErrorCode { GRAPHQL_ERROR - INVALID NOT_FOUND REQUIRED - UNIQUE - EXPIRED_GIFT_CARD - DUPLICATED_INPUT_ITEM + INVALID } -""" -Creates a new gift card. +input PromotionUpdateInput { + """Promotion description.""" + description: JSON -Requires one of the following permissions: MANAGE_GIFT_CARD. -""" -type GiftCardCreate @doc(category: "Gift cards") { - giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [GiftCardError!]! - giftCard: GiftCard -} + """The start date of the promotion in ISO 8601 format.""" + startDate: DateTime -input GiftCardCreateInput @doc(category: "Gift cards") { - """ - The gift card tags to add. - - Added in Saleor 3.1. - """ - addTags: [String!] + """The end date of the promotion in ISO 8601 format.""" + endDate: DateTime - """ - The gift card expiry date. - - Added in Saleor 3.1. - """ - expiryDate: Date + """Promotion name.""" + name: String +} - """ - Start date of the gift card in ISO 8601 format. - - DEPRECATED: this field will be removed in Saleor 4.0. - """ - startDate: Date +""" +Deletes a promotion. - """ - End date of the gift card in ISO 8601 format. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `expiryDate` from `expirySettings` instead. - """ - endDate: Date +Added in Saleor 3.17. - """Balance of the gift card.""" - balance: PriceInput! +Note: this API is currently in Feature Preview and can be subject to changes at later point. - """Email of the customer to whom gift card will be sent.""" - userEmail: String +Requires one of the following permissions: MANAGE_DISCOUNTS. - """ - Slug of a channel from which the email should be sent. - - Added in Saleor 3.1. - """ - channel: String +Triggers the following webhook events: +- PROMOTION_DELETED (async): A promotion was deleted. +""" +type PromotionDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_DELETED], syncEvents: []) { + errors: [PromotionDeleteError!]! + promotion: Promotion +} +type PromotionDeleteError { """ - Determine if gift card is active. - - Added in Saleor 3.1. + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - isActive: Boolean! + field: String - """ - Code to use the gift card. - - DEPRECATED: this field will be removed in Saleor 4.0. The code is now auto generated. - """ - code: String + """The error message.""" + message: String - """ - The gift card note from the staff member. - - Added in Saleor 3.1. - """ - note: String + """The error code.""" + code: PromotionDeleteErrorCode! } -input PriceInput { - """Currency code.""" - currency: String! - - """Amount of money.""" - amount: PositiveDecimal! +"""An enumeration.""" +enum PromotionDeleteErrorCode { + GRAPHQL_ERROR + NOT_FOUND } """ -Delete gift card. +Creates a new promotion rule. -Added in Saleor 3.1. +Added in Saleor 3.17. -Requires one of the following permissions: MANAGE_GIFT_CARD. -""" -type GiftCardDelete @doc(category: "Gift cards") { - giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [GiftCardError!]! - giftCard: GiftCard -} +Note: this API is currently in Feature Preview and can be subject to changes at later point. -""" -Deactivate a gift card. +Requires one of the following permissions: MANAGE_DISCOUNTS. -Requires one of the following permissions: MANAGE_GIFT_CARD. +Triggers the following webhook events: +- PROMOTION_RULE_CREATED (async): A promotion rule was created. """ -type GiftCardDeactivate @doc(category: "Gift cards") { - """Deactivated gift card.""" - giftCard: GiftCard - giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [GiftCardError!]! +type PromotionRuleCreate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_RULE_CREATED], syncEvents: []) { + errors: [PromotionRuleCreateError!]! + promotionRule: PromotionRule } -""" -Update a gift card. +type PromotionRuleCreateError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String -Requires one of the following permissions: MANAGE_GIFT_CARD. -""" -type GiftCardUpdate @doc(category: "Gift cards") { - giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [GiftCardError!]! - giftCard: GiftCard + """The error message.""" + message: String + + """The error code.""" + code: PromotionRuleCreateErrorCode! + + """Limit of rules with orderPredicate defined.""" + rulesLimit: Int + + """Number of rules with orderPredicate defined exceeding the limit.""" + rulesLimitExceedBy: Int + + """Limit of gifts assigned to promotion rule.""" + giftsLimit: Int + + """Number of gifts defined for this promotion rule exceeding the limit.""" + giftsLimitExceedBy: Int } -input GiftCardUpdateInput @doc(category: "Gift cards") { +"""An enumeration.""" +enum PromotionRuleCreateErrorCode { + GRAPHQL_ERROR + NOT_FOUND + REQUIRED + INVALID + MULTIPLE_CURRENCIES_NOT_ALLOWED + INVALID_PRECISION + MISSING_CHANNELS + RULES_NUMBER_LIMIT + GIFTS_NUMBER_LIMIT + INVALID_GIFT_TYPE +} + +input PromotionRuleCreateInput { + """Promotion rule name.""" + name: String + + """Promotion rule description.""" + description: JSON + """ - The gift card tags to add. - - Added in Saleor 3.1. + Defines the conditions on the catalogue level that must be met for the reward to be applied. """ - addTags: [String!] + cataloguePredicate: CataloguePredicateInput """ - The gift card expiry date. + Defines the conditions on the checkout/draft order level that must be met for the reward to be applied. - Added in Saleor 3.1. + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - expiryDate: Date + orderPredicate: OrderPredicateInput """ - Start date of the gift card in ISO 8601 format. - - DEPRECATED: this field will be removed in Saleor 4.0. + Defines the promotion rule reward value type. Must be provided together with reward value. """ - startDate: Date + rewardValueType: RewardValueTypeEnum """ - End date of the gift card in ISO 8601 format. - - DEPRECATED: this field will be removed in Saleor 4.0. Use `expiryDate` from `expirySettings` instead. + Defines the discount value. Required when catalogue predicate is provided. """ - endDate: Date + rewardValue: PositiveDecimal """ - The gift card tags to remove. + Defines the reward type of the promotion rule. - Added in Saleor 3.1. + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - removeTags: [String!] + rewardType: RewardTypeEnum + + """List of channel ids to which the rule should apply to.""" + channels: [ID!] """ - The gift card balance amount. + Product variant IDs available as a gift to choose. - Added in Saleor 3.1. + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. """ - balanceAmount: PositiveDecimal -} + gifts: [ID!] -""" -Resend a gift card. - -Added in Saleor 3.1. + """The ID of the promotion that rule belongs to.""" + promotion: ID! +} -Requires one of the following permissions: MANAGE_GIFT_CARD. """ -type GiftCardResend @doc(category: "Gift cards") { - """Gift card which has been sent.""" - giftCard: GiftCard - errors: [GiftCardError!]! -} +Updates an existing promotion rule. -input GiftCardResendInput @doc(category: "Gift cards") { - """ID of a gift card to resend.""" - id: ID! +Added in Saleor 3.17. - """Email to which gift card should be send.""" - email: String +Note: this API is currently in Feature Preview and can be subject to changes at later point. - """Slug of a channel from which the email should be sent.""" - channel: String! -} +Requires one of the following permissions: MANAGE_DISCOUNTS. +Triggers the following webhook events: +- PROMOTION_RULE_UPDATED (async): A promotion rule was updated. """ -Adds note to the gift card. - -Added in Saleor 3.1. +type PromotionRuleUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_RULE_UPDATED], syncEvents: []) { + errors: [PromotionRuleUpdateError!]! + promotionRule: PromotionRule +} -Requires one of the following permissions: MANAGE_GIFT_CARD. -""" -type GiftCardAddNote @doc(category: "Gift cards") { - """Gift card with the note added.""" - giftCard: GiftCard +type PromotionRuleUpdateError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String - """Gift card note created.""" - event: GiftCardEvent - errors: [GiftCardError!]! -} + """The error message.""" + message: String -input GiftCardAddNoteInput @doc(category: "Gift cards") { - """Note message.""" - message: String! -} + """The error code.""" + code: PromotionRuleUpdateErrorCode! -""" -Create gift cards. + """List of channel IDs which causes the error.""" + channels: [ID!] -Added in Saleor 3.1. + """Limit of gifts assigned to promotion rule.""" + giftsLimit: Int -Requires one of the following permissions: MANAGE_GIFT_CARD. -""" -type GiftCardBulkCreate @doc(category: "Gift cards") { - """Returns how many objects were created.""" - count: Int! + """Number of gifts defined for this promotion rule exceeding the limit.""" + giftsLimitExceedBy: Int +} - """List of created gift cards.""" - giftCards: [GiftCard!]! - errors: [GiftCardError!]! +"""An enumeration.""" +enum PromotionRuleUpdateErrorCode { + GRAPHQL_ERROR + NOT_FOUND + INVALID + REQUIRED + DUPLICATED_INPUT_ITEM + MISSING_CHANNELS + MULTIPLE_CURRENCIES_NOT_ALLOWED + INVALID_PRECISION + INVALID_GIFT_TYPE + GIFTS_NUMBER_LIMIT } -input GiftCardBulkCreateInput @doc(category: "Gift cards") { - """The number of cards to issue.""" - count: Int! +input PromotionRuleUpdateInput { + """Promotion rule name.""" + name: String - """Balance of the gift card.""" - balance: PriceInput! + """Promotion rule description.""" + description: JSON - """The gift card tags.""" - tags: [String!] + """ + Defines the conditions on the catalogue level that must be met for the reward to be applied. + """ + cataloguePredicate: CataloguePredicateInput - """The gift card expiry date.""" - expiryDate: Date + """ + Defines the conditions on the checkout/draft order level that must be met for the reward to be applied. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + orderPredicate: OrderPredicateInput - """Determine if gift card is active.""" - isActive: Boolean! -} + """ + Defines the promotion rule reward value type. Must be provided together with reward value. + """ + rewardValueType: RewardValueTypeEnum -""" -Delete gift cards. + """ + Defines the discount value. Required when catalogue predicate is provided. + """ + rewardValue: PositiveDecimal -Added in Saleor 3.1. + """ + Defines the reward type of the promotion rule. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + rewardType: RewardTypeEnum -Requires one of the following permissions: MANAGE_GIFT_CARD. -""" -type GiftCardBulkDelete @doc(category: "Gift cards") { - """Returns how many objects were affected.""" - count: Int! - errors: [GiftCardError!]! -} + """List of channel ids to add.""" + addChannels: [ID!] -""" -Activate gift cards. + """List of channel ids to remove.""" + removeChannels: [ID!] -Added in Saleor 3.1. + """ + List of variant IDs available as a gift to add. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + addGifts: [ID!] -Requires one of the following permissions: MANAGE_GIFT_CARD. -""" -type GiftCardBulkActivate @doc(category: "Gift cards") { - """Returns how many objects were affected.""" - count: Int! - errors: [GiftCardError!]! + """ + List of variant IDs available as a gift to remove. + + Added in Saleor 3.19. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + removeGifts: [ID!] } """ -Deactivate gift cards. +Deletes a promotion rule. -Added in Saleor 3.1. +Added in Saleor 3.17. -Requires one of the following permissions: MANAGE_GIFT_CARD. -""" -type GiftCardBulkDeactivate @doc(category: "Gift cards") { - """Returns how many objects were affected.""" - count: Int! - errors: [GiftCardError!]! -} +Note: this API is currently in Feature Preview and can be subject to changes at later point. -""" -Update plugin configuration. +Requires one of the following permissions: MANAGE_DISCOUNTS. -Requires one of the following permissions: MANAGE_PLUGINS. +Triggers the following webhook events: +- PROMOTION_RULE_DELETED (async): A promotion rule was deleted. """ -type PluginUpdate { - plugin: Plugin - pluginsErrors: [PluginError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PluginError!]! +type PromotionRuleDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_RULE_DELETED], syncEvents: []) { + errors: [PromotionRuleDeleteError!]! + promotionRule: PromotionRule } -type PluginError { +type PromotionRuleDeleteError { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -22945,91 +28271,77 @@ type PluginError { message: String """The error code.""" - code: PluginErrorCode! + code: PromotionRuleDeleteErrorCode! } """An enumeration.""" -enum PluginErrorCode { +enum PromotionRuleDeleteErrorCode { GRAPHQL_ERROR - INVALID - PLUGIN_MISCONFIGURED NOT_FOUND - REQUIRED - UNIQUE -} - -input PluginUpdateInput { - """Indicates whether the plugin should be enabled.""" - active: Boolean - - """Configuration of the plugin.""" - configuration: [ConfigurationItemInput!] -} - -input ConfigurationItemInput { - """Name of the field to update.""" - name: String! - - """Value of the given field to update.""" - value: String } """ -Trigger sending a notification with the notify plugin method. Serializes nodes provided as ids parameter and includes this data in the notification payload. +Creates/updates translations for a promotion. -Added in Saleor 3.1. +Added in Saleor 3.17. + +Requires one of the following permissions: MANAGE_TRANSLATIONS. """ -type ExternalNotificationTrigger { - errors: [ExternalNotificationError!]! +type PromotionTranslate @doc(category: "Discounts") { + errors: [TranslationError!]! + promotion: Promotion } -type ExternalNotificationError { +input PromotionTranslationInput { + name: String + """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + Translated promotion description. + + Rich text format. For reference see https://editorjs.io/ """ - field: String + description: JSON +} - """The error message.""" - message: String +""" +Creates/updates translations for a promotion rule. - """The error code.""" - code: ExternalNotificationErrorCodes! -} +Added in Saleor 3.17. -"""An enumeration.""" -enum ExternalNotificationErrorCodes { - REQUIRED - INVALID_MODEL_TYPE - NOT_FOUND - CHANNEL_INACTIVE +Requires one of the following permissions: MANAGE_TRANSLATIONS. +""" +type PromotionRuleTranslate @doc(category: "Discounts") { + errors: [TranslationError!]! + promotionRule: PromotionRule } -input ExternalNotificationTriggerInput { - """ - The list of customers or orders node IDs that will be serialized and included in the notification payload. - """ - ids: [ID!]! - - """ - Additional payload that will be merged with the one based on the bussines object ID. - """ - extraPayload: JSONString +input PromotionRuleTranslationInput { + name: String """ - External event type. This field is passed to a plugin as an event type. + Translated promotion description. + + Rich text format. For reference see https://editorjs.io/ """ - externalEventType: String! + description: JSON } """ -Creates a new sale. +Deletes promotions. + +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- PROMOTION_DELETED (async): A promotion was deleted. """ -type SaleCreate @doc(category: "Discounts") { - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") +type PromotionBulkDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [PROMOTION_DELETED], syncEvents: []) { + """Returns how many objects were affected.""" + count: Int! errors: [DiscountError!]! - sale: Sale } type DiscountError @doc(category: "Discounts") { @@ -23049,6 +28361,13 @@ type DiscountError @doc(category: "Discounts") { """List of channels IDs which causes the error.""" channels: [ID!] + + """ + List of voucher codes which causes the error. + + Added in Saleor 3.18. + """ + voucherCodes: [String!] } """An enumeration.""" @@ -23061,6 +28380,23 @@ enum DiscountErrorCode @doc(category: "Discounts") { UNIQUE CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT DUPLICATED_INPUT_ITEM + VOUCHER_ALREADY_USED +} + +""" +Creates a new sale. + +DEPRECATED: this mutation will be removed in Saleor 4.0. Use `promotionCreate` mutation instead. + +Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- SALE_CREATED (async): A sale was created. +""" +type SaleCreate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_CREATED], syncEvents: []) { + discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [DiscountError!]! + sale: Sale } input SaleInput @doc(category: "Discounts") { @@ -23091,11 +28427,16 @@ input SaleInput @doc(category: "Discounts") { } """ -Deletes a sale. +Deletes a sale. + +DEPRECATED: this mutation will be removed in Saleor 4.0. Use `promotionDelete` mutation instead. Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- SALE_DELETED (async): A sale was deleted. """ -type SaleDelete @doc(category: "Discounts") { +type SaleDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_DELETED], syncEvents: []) { discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [DiscountError!]! sale: Sale @@ -23105,8 +28446,11 @@ type SaleDelete @doc(category: "Discounts") { Deletes sales. Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- SALE_DELETED (async): A sale was deleted. """ -type SaleBulkDelete @doc(category: "Discounts") { +type SaleBulkDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_DELETED], syncEvents: []) { """Returns how many objects were affected.""" count: Int! discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23114,22 +28458,33 @@ type SaleBulkDelete @doc(category: "Discounts") { } """ -Updates a sale. +Updates a sale. + +DEPRECATED: this mutation will be removed in Saleor 4.0. Use `promotionUpdate` mutation instead. Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- SALE_UPDATED (async): A sale was updated. +- SALE_TOGGLE (async): Optionally triggered when a sale is started or stopped. """ -type SaleUpdate @doc(category: "Discounts") { +type SaleUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_UPDATED, SALE_TOGGLE], syncEvents: []) { discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [DiscountError!]! sale: Sale } """ -Adds products, categories, collections to a voucher. +Adds products, categories, collections to a sale. + +DEPRECATED: this mutation will be removed in Saleor 4.0. Use `promotionRuleCreate` mutation instead. Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- SALE_UPDATED (async): A sale was updated. """ -type SaleAddCatalogues @doc(category: "Discounts") { +type SaleAddCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_UPDATED], syncEvents: []) { """Sale of which catalogue IDs will be modified.""" sale: Sale discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23155,11 +28510,16 @@ input CatalogueInput @doc(category: "Discounts") { } """ -Removes products, categories, collections from a sale. +Removes products, categories, collections from a sale. + +DEPRECATED: this mutation will be removed in Saleor 4.0. Use `promotionRuleUpdate` or `promotionRuleDelete` mutations instead. Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- SALE_UPDATED (async): A sale was updated. """ -type SaleRemoveCatalogues @doc(category: "Discounts") { +type SaleRemoveCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_UPDATED], syncEvents: []) { """Sale of which catalogue IDs will be modified.""" sale: Sale discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23167,7 +28527,9 @@ type SaleRemoveCatalogues @doc(category: "Discounts") { } """ -Creates/updates translations for a sale. +Creates/updates translations for a sale. + +DEPRECATED: this mutation will be removed in Saleor 4.0. Use `PromotionTranslate` mutation instead. Requires one of the following permissions: MANAGE_TRANSLATIONS. """ @@ -23178,7 +28540,9 @@ type SaleTranslate @doc(category: "Discounts") { } """ -Manage sale's availability in channels. +Manage sale's availability in channels. + +DEPRECATED: this mutation will be removed in Saleor 4.0. Use `promotionRuleCreate` or `promotionRuleUpdate` mutations instead. Requires one of the following permissions: MANAGE_DISCOUNTS. """ @@ -23209,8 +28573,12 @@ input SaleChannelListingAddInput @doc(category: "Discounts") { Creates a new voucher. Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- VOUCHER_CREATED (async): A voucher was created. +- VOUCHER_CODES_CREATED (async): A voucher codes were created. """ -type VoucherCreate @doc(category: "Discounts") { +type VoucherCreate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_CREATED, VOUCHER_CODES_CREATED], syncEvents: []) { discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [DiscountError!]! voucher: Voucher @@ -23223,9 +28591,20 @@ input VoucherInput @doc(category: "Discounts") { """Voucher name.""" name: String - """Code to use the voucher.""" + """ + Code to use the voucher. This field will be removed in Saleor 4.0. Use `addCodes` instead. + """ code: String + """ + List of codes to add. + + Added in Saleor 3.18. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + addCodes: [String!] + """Start date of the voucher in ISO 8601 format.""" startDate: DateTime @@ -23266,6 +28645,17 @@ input VoucherInput @doc(category: "Discounts") { """Voucher can be used only by staff user.""" onlyForStaff: Boolean + """ + When set to 'True', each voucher code can be used only once; otherwise, codes can be used multiple times depending on `usageLimit`. + + The option can only be changed if none of the voucher codes have been used. + + Added in Saleor 3.18. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + singleUse: Boolean + """Limit number of times this voucher can be used in total.""" usageLimit: Int } @@ -23274,8 +28664,11 @@ input VoucherInput @doc(category: "Discounts") { Deletes a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- VOUCHER_DELETED (async): A voucher was deleted. """ -type VoucherDelete @doc(category: "Discounts") { +type VoucherDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_DELETED], syncEvents: []) { discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [DiscountError!]! voucher: Voucher @@ -23285,8 +28678,11 @@ type VoucherDelete @doc(category: "Discounts") { Deletes vouchers. Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- VOUCHER_DELETED (async): A voucher was deleted. """ -type VoucherBulkDelete @doc(category: "Discounts") { +type VoucherBulkDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_DELETED], syncEvents: []) { """Returns how many objects were affected.""" count: Int! discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23297,8 +28693,12 @@ type VoucherBulkDelete @doc(category: "Discounts") { Updates a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- VOUCHER_UPDATED (async): A voucher was updated. +- VOUCHER_CODES_CREATED (async): A voucher code was created. """ -type VoucherUpdate @doc(category: "Discounts") { +type VoucherUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED, VOUCHER_CODES_CREATED], syncEvents: []) { discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [DiscountError!]! voucher: Voucher @@ -23308,8 +28708,11 @@ type VoucherUpdate @doc(category: "Discounts") { Adds products, categories, collections to a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- VOUCHER_UPDATED (async): A voucher was updated. """ -type VoucherAddCatalogues @doc(category: "Discounts") { +type VoucherAddCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: []) { """Voucher of which catalogue IDs will be modified.""" voucher: Voucher discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23320,8 +28723,11 @@ type VoucherAddCatalogues @doc(category: "Discounts") { Removes products, categories, collections from a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- VOUCHER_UPDATED (async): A voucher was updated. """ -type VoucherRemoveCatalogues @doc(category: "Discounts") { +type VoucherRemoveCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: []) { """Voucher of which catalogue IDs will be modified.""" voucher: Voucher discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23343,8 +28749,11 @@ type VoucherTranslate @doc(category: "Discounts") { Manage voucher's availability in channels. Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- VOUCHER_UPDATED (async): A voucher was updated. """ -type VoucherChannelListingUpdate @doc(category: "Discounts") { +type VoucherChannelListingUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: []) { """An updated voucher instance.""" voucher: Voucher discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23370,12 +28779,55 @@ input VoucherChannelListingAddInput @doc(category: "Discounts") { minAmountSpent: PositiveDecimal } +""" +Deletes voucher codes. + +Added in Saleor 3.18. + +Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- VOUCHER_CODES_DELETED (async): A voucher codes were deleted. +""" +type VoucherCodeBulkDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_CODES_DELETED], syncEvents: []) { + """Returns how many codes were deleted.""" + count: Int! + errors: [VoucherCodeBulkDeleteError!]! +} + +type VoucherCodeBulkDeleteError @doc(category: "Discounts") { + """ + Path to field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + path: String + + """The error message.""" + message: String + + """The error code.""" + code: VoucherCodeBulkDeleteErrorCode! + + """List of voucher codes which causes the error.""" + voucherCodes: [ID!] +} + +"""An enumeration.""" +enum VoucherCodeBulkDeleteErrorCode @doc(category: "Discounts") { + GRAPHQL_ERROR + NOT_FOUND + INVALID +} + """ Export products to csv file. Requires one of the following permissions: MANAGE_PRODUCTS. + +Triggers the following webhook events: +- NOTIFY_USER (async): A notification for the exported file. +- PRODUCT_EXPORT_COMPLETED (async): A notification for the exported file. """ -type ExportProducts @doc(category: "Products") { +type ExportProducts @doc(category: "Products") @webhookEventsInfo(asyncEvents: [NOTIFY_USER, PRODUCT_EXPORT_COMPLETED], syncEvents: []) { """ The newly created export file job which is responsible for export data. """ @@ -23474,8 +28926,12 @@ Export gift cards to csv file. Added in Saleor 3.1. Requires one of the following permissions: MANAGE_GIFT_CARD. + +Triggers the following webhook events: +- NOTIFY_USER (async): A notification for the exported file. +- GIFT_CARD_EXPORT_COMPLETED (async): A notification for the exported file. """ -type ExportGiftCards @doc(category: "Gift cards") { +type ExportGiftCards @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [NOTIFY_USER, GIFT_CARD_EXPORT_COMPLETED], syncEvents: []) { """ The newly created export file job which is responsible for export data. """ @@ -23497,6 +28953,39 @@ input ExportGiftCardsInput @doc(category: "Gift cards") { fileType: FileTypesEnum! } +""" +Export voucher codes to csv/xlsx file. + +Added in Saleor 3.18. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: MANAGE_DISCOUNTS. + +Triggers the following webhook events: +- VOUCHER_CODE_EXPORT_COMPLETED (async): A notification for the exported file. +""" +type ExportVoucherCodes @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_CODE_EXPORT_COMPLETED], syncEvents: []) { + """ + The newly created export file job which is responsible for export data. + """ + exportFile: ExportFile + errors: [ExportError!]! +} + +input ExportVoucherCodesInput @doc(category: "Discounts") { + """ + The ID of the voucher. If provided, exports all codes belonging to the voucher. + """ + voucherId: ID + + """List of voucher code IDs to export.""" + ids: [ID!] + + """Type of exported file.""" + fileType: FileTypesEnum! +} + """ Upload a file. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec @@ -23526,8 +29015,13 @@ enum UploadErrorCode { GRAPHQL_ERROR } -"""Adds a gift card or a voucher to a checkout.""" -type CheckoutAddPromoCode @doc(category: "Checkout") { +""" +Adds a gift card or a voucher to a checkout. + +Triggers the following webhook events: +- CHECKOUT_UPDATED (async): A checkout was updated. +""" +type CheckoutAddPromoCode @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) { """The checkout with the added gift card or voucher.""" checkout: Checkout checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23586,10 +29080,18 @@ enum CheckoutErrorCode @doc(category: "Checkout") { EMAIL_NOT_SET NO_LINES INACTIVE_PAYMENT + NON_EDITABLE_GIFT_LINE + NON_REMOVABLE_GIFT_LINE + SHIPPING_CHANGE_FORBIDDEN } -"""Update billing address in the existing checkout.""" -type CheckoutBillingAddressUpdate @doc(category: "Checkout") { +""" +Update billing address in the existing checkout. + +Triggers the following webhook events: +- CHECKOUT_UPDATED (async): A checkout was updated. +""" +type CheckoutBillingAddressUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) { """An updated checkout.""" checkout: Checkout checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23614,9 +29116,21 @@ input CheckoutAddressValidationRules @doc(category: "Checkout") { } """ -Completes the checkout. As a result a new order is created and a payment charge is made. This action requires a successful payment before it can be performed. In case additional confirmation step as 3D secure is required confirmationNeeded flag will be set to True and no order created until payment is confirmed with second call of this mutation. +Completes the checkout. As a result a new order is created. The mutation allows to create the unpaid order when setting `orderSettings.allowUnpaidOrders` for given `Channel` is set to `true`. When `orderSettings.allowUnpaidOrders` is set to `false`, checkout can be completed only when attached `Payment`/`TransactionItem`s fully cover the checkout's total. When processing the checkout with `Payment`, in case of required additional confirmation step like 3D secure, the `confirmationNeeded` flag will be set to True and no order will be created until payment is confirmed with second call of this mutation. + +Triggers the following webhook events: +- SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid. +- CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid. +- CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired. +- ORDER_CREATED (async): Triggered when order is created. +- NOTIFY_USER (async): A notification for order placement. +- NOTIFY_USER (async): A staff notification for order placement. +- ORDER_UPDATED (async): Triggered when order received the update after placement. +- ORDER_PAID (async): Triggered when newly created order is paid. +- ORDER_FULLY_PAID (async): Triggered when newly created order is fully paid. +- ORDER_CONFIRMED (async): Optionally triggered when newly created order are automatically marked as confirmed. """ -type CheckoutComplete @doc(category: "Checkout") { +type CheckoutComplete @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [ORDER_CREATED, NOTIFY_USER, NOTIFY_USER, ORDER_UPDATED, ORDER_PAID, ORDER_FULLY_PAID, ORDER_CONFIRMED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS, CHECKOUT_CALCULATE_TAXES]) { """Placed order.""" order: Order @@ -23631,8 +29145,13 @@ type CheckoutComplete @doc(category: "Checkout") { errors: [CheckoutError!]! } -"""Create a new checkout.""" -type CheckoutCreate @doc(category: "Checkout") { +""" +Create a new checkout. + +Triggers the following webhook events: +- CHECKOUT_CREATED (async): A checkout was created. +""" +type CheckoutCreate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_CREATED], syncEvents: []) { """ Whether the checkout was created or the current active one was returned. Refer to checkoutLinesAdd and checkoutLinesUpdate to merge a cart with an active checkout. """ @@ -23681,45 +29200,110 @@ input CheckoutLineInput @doc(category: "Checkout") { variantId: ID! """ - Custom price of the item. Can be set only by apps with `HANDLE_CHECKOUTS` permission. When the line with the same variant will be provided multiple times, the last price will be used. - - Added in Saleor 3.1. + Custom price of the item. Can be set only by apps with `HANDLE_CHECKOUTS` permission. When the line with the same variant will be provided multiple times, the last price will be used. + + Added in Saleor 3.1. + """ + price: PositiveDecimal + + """ + Flag that allow force splitting the same variant into multiple lines by skipping the matching logic. + + Added in Saleor 3.6. + """ + forceNewLine: Boolean = false + + """ + Fields required to update the object's metadata. + + Added in Saleor 3.8. + """ + metadata: [MetadataInput!] +} + +input CheckoutValidationRules @doc(category: "Checkout") { + """ + The validation rules that can be applied to provided shipping address data. + """ + shippingAddress: CheckoutAddressValidationRules + + """ + The validation rules that can be applied to provided billing address data. + """ + billingAddress: CheckoutAddressValidationRules +} + +""" +Create new checkout from existing order. + +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type CheckoutCreateFromOrder @doc(category: "Checkout") { + """Variants that were not attached to the checkout.""" + unavailableVariants: [CheckoutCreateFromOrderUnavailableVariant!] + + """Created checkout.""" + checkout: Checkout + errors: [CheckoutCreateFromOrderError!]! +} + +type CheckoutCreateFromOrderUnavailableVariant @doc(category: "Checkout") { + """The error message.""" + message: String! + + """The error code.""" + code: CheckoutCreateFromOrderUnavailableVariantErrorCode! + + """Variant ID that is unavailable.""" + variantId: ID! + + """Order line ID that is unavailable.""" + lineId: ID! +} + +"""An enumeration.""" +enum CheckoutCreateFromOrderUnavailableVariantErrorCode @doc(category: "Checkout") { + NOT_FOUND + PRODUCT_UNAVAILABLE_FOR_PURCHASE + UNAVAILABLE_VARIANT_IN_CHANNEL + PRODUCT_NOT_PUBLISHED + QUANTITY_GREATER_THAN_LIMIT + INSUFFICIENT_STOCK +} + +type CheckoutCreateFromOrderError @doc(category: "Checkout") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - price: PositiveDecimal + field: String - """ - Flag that allow force splitting the same variant into multiple lines by skipping the matching logic. - - Added in Saleor 3.6. - """ - forceNewLine: Boolean = false + """The error message.""" + message: String - """ - Fields required to update the object's metadata. - - Added in Saleor 3.8. - """ - metadata: [MetadataInput!] + """The error code.""" + code: CheckoutCreateFromOrderErrorCode! } -input CheckoutValidationRules @doc(category: "Checkout") { - """ - The validation rules that can be applied to provided shipping address data. - """ - shippingAddress: CheckoutAddressValidationRules - - """ - The validation rules that can be applied to provided billing address data. - """ - billingAddress: CheckoutAddressValidationRules +"""An enumeration.""" +enum CheckoutCreateFromOrderErrorCode @doc(category: "Checkout") { + GRAPHQL_ERROR + INVALID + ORDER_NOT_FOUND + CHANNEL_INACTIVE + TAX_ERROR } """ Sets the customer as the owner of the checkout. Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER. + +Triggers the following webhook events: +- CHECKOUT_UPDATED (async): A checkout was updated. """ -type CheckoutCustomerAttach @doc(category: "Checkout") { +type CheckoutCustomerAttach @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) { """An updated checkout.""" checkout: Checkout checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23730,32 +29314,50 @@ type CheckoutCustomerAttach @doc(category: "Checkout") { Removes the user assigned as the owner of the checkout. Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER. + +Triggers the following webhook events: +- CHECKOUT_UPDATED (async): A checkout was updated. """ -type CheckoutCustomerDetach @doc(category: "Checkout") { +type CheckoutCustomerDetach @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) { """An updated checkout.""" checkout: Checkout checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [CheckoutError!]! } -"""Updates email address in the existing checkout object.""" -type CheckoutEmailUpdate @doc(category: "Checkout") { +""" +Updates email address in the existing checkout object. + +Triggers the following webhook events: +- CHECKOUT_UPDATED (async): A checkout was updated. +""" +type CheckoutEmailUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) { """An updated checkout.""" checkout: Checkout checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [CheckoutError!]! } -"""Deletes a CheckoutLine.""" -type CheckoutLineDelete @doc(category: "Checkout") { +""" +Deletes a CheckoutLine. + +Triggers the following webhook events: +- CHECKOUT_UPDATED (async): A checkout was updated. +""" +type CheckoutLineDelete @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) { """An updated checkout.""" checkout: Checkout checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [CheckoutError!]! } -"""Deletes checkout lines.""" -type CheckoutLinesDelete @doc(category: "Checkout") { +""" +Deletes checkout lines. + +Triggers the following webhook events: +- CHECKOUT_UPDATED (async): A checkout was updated. +""" +type CheckoutLinesDelete @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) { """An updated checkout.""" checkout: Checkout errors: [CheckoutError!]! @@ -23763,16 +29365,24 @@ type CheckoutLinesDelete @doc(category: "Checkout") { """ Adds a checkout line to the existing checkout.If line was already in checkout, its quantity will be increased. + +Triggers the following webhook events: +- CHECKOUT_UPDATED (async): A checkout was updated. """ -type CheckoutLinesAdd @doc(category: "Checkout") { +type CheckoutLinesAdd @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) { """An updated checkout.""" checkout: Checkout checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [CheckoutError!]! } -"""Updates checkout line in the existing checkout.""" -type CheckoutLinesUpdate @doc(category: "Checkout") { +""" +Updates checkout line in the existing checkout. + +Triggers the following webhook events: +- CHECKOUT_UPDATED (async): A checkout was updated. +""" +type CheckoutLinesUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) { """An updated checkout.""" checkout: Checkout checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23807,8 +29417,13 @@ input CheckoutLineUpdateInput @doc(category: "Checkout") { lineId: ID } -"""Remove a gift card or a voucher from a checkout.""" -type CheckoutRemovePromoCode @doc(category: "Checkout") { +""" +Remove a gift card or a voucher from a checkout. + +Triggers the following webhook events: +- CHECKOUT_UPDATED (async): A checkout was updated. +""" +type CheckoutRemovePromoCode @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) { """The checkout with the removed gift card or voucher.""" checkout: Checkout checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23876,16 +29491,27 @@ enum StorePaymentMethodEnum @doc(category: "Payments") { NONE } -"""Update shipping address in the existing checkout.""" -type CheckoutShippingAddressUpdate @doc(category: "Checkout") { +""" +Update shipping address in the existing checkout. + +Triggers the following webhook events: +- CHECKOUT_UPDATED (async): A checkout was updated. +""" +type CheckoutShippingAddressUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) { """An updated checkout.""" checkout: Checkout checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [CheckoutError!]! } -"""Updates the shipping method of the checkout.""" -type CheckoutShippingMethodUpdate @doc(category: "Checkout") { +""" +Updates the shipping method of the checkout. + +Triggers the following webhook events: +- SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Triggered when updating the checkout shipping method with the external one. +- CHECKOUT_UPDATED (async): A checkout was updated. +""" +type CheckoutShippingMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT]) { """An updated checkout.""" checkout: Checkout checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23893,18 +29519,27 @@ type CheckoutShippingMethodUpdate @doc(category: "Checkout") { } """ -Updates the delivery method (shipping method or pick up point) of the checkout. +Updates the delivery method (shipping method or pick up point) of the checkout. Updates the checkout shipping_address for click and collect delivery for a warehouse address. Added in Saleor 3.1. + +Triggers the following webhook events: +- SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Triggered when updating the checkout delivery method with the external one. +- CHECKOUT_UPDATED (async): A checkout was updated. """ -type CheckoutDeliveryMethodUpdate @doc(category: "Checkout") { +type CheckoutDeliveryMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT]) { """An updated checkout.""" checkout: Checkout errors: [CheckoutError!]! } -"""Update language code in the existing checkout.""" -type CheckoutLanguageCodeUpdate @doc(category: "Checkout") { +""" +Update language code in the existing checkout. + +Triggers the following webhook events: +- CHECKOUT_UPDATED (async): A checkout was updated. +""" +type CheckoutLanguageCodeUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) { """An updated checkout.""" checkout: Checkout checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -23915,14 +29550,26 @@ type CheckoutLanguageCodeUpdate @doc(category: "Checkout") { Create new order from existing checkout. Requires the following permissions: AUTHENTICATED_APP and HANDLE_CHECKOUTS. Added in Saleor 3.2. -""" -type OrderCreateFromCheckout @doc(category: "Checkout") { + +Triggers the following webhook events: +- SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid. +- CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid. +- CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired. +- ORDER_CREATED (async): Triggered when order is created. +- NOTIFY_USER (async): A notification for order placement. +- NOTIFY_USER (async): A staff notification for order placement. +- ORDER_UPDATED (async): Triggered when order received the update after placement. +- ORDER_PAID (async): Triggered when newly created order is paid. +- ORDER_FULLY_PAID (async): Triggered when newly created order is fully paid. +- ORDER_CONFIRMED (async): Optionally triggered when newly created order are automatically marked as confirmed. +""" +type OrderCreateFromCheckout @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [ORDER_CREATED, NOTIFY_USER, NOTIFY_USER, ORDER_UPDATED, ORDER_PAID, ORDER_FULLY_PAID, ORDER_CONFIRMED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS, CHECKOUT_CALCULATE_TAXES]) { """Placed order.""" order: Order errors: [OrderCreateFromCheckoutError!]! } -type OrderCreateFromCheckoutError @doc(category: "Checkout") { +type OrderCreateFromCheckoutError @doc(category: "Orders") { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ @@ -23963,8 +29610,11 @@ enum OrderCreateFromCheckoutErrorCode @doc(category: "Orders") { Creates new channel. Requires one of the following permissions: MANAGE_CHANNELS. + +Triggers the following webhook events: +- CHANNEL_CREATED (async): A channel was created. """ -type ChannelCreate @doc(category: "Channels") { +type ChannelCreate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_CREATED], syncEvents: []) { channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [ChannelError!]! channel: Channel @@ -24003,7 +29653,7 @@ enum ChannelErrorCode @doc(category: "Channels") { } input ChannelCreateInput @doc(category: "Channels") { - """isActive flag.""" + """Determine if channel will be set active or not.""" isActive: Boolean """ @@ -24030,6 +29680,38 @@ input ChannelCreateInput @doc(category: "Channels") { """ orderSettings: OrderSettingsInput + """ + Channel public metadata. + + Added in Saleor 3.15. + """ + metadata: [MetadataInput!] + + """ + Channel private metadata. + + Added in Saleor 3.15. + """ + privateMetadata: [MetadataInput!] + + """ + The channel checkout settings + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + checkoutSettings: CheckoutSettingsInput + + """ + The channel payment settings + + Added in Saleor 3.16. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + paymentSettings: PaymentSettingsInput + """Name of the channel.""" name: String! @@ -24074,6 +29756,15 @@ input OrderSettingsInput @doc(category: "Orders") { """ expireOrdersAfter: Minute + """ + The time in days after expired orders will be deleted.Allowed range is from 1 to 120. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + deleteExpiredOrdersAfter: Day + """ Determine what strategy will be used to mark the order as paid. Based on the chosen option, the proper object will be created and attached to the order when it's manually marked as paid. `PAYMENT_FLOW` - [default option] creates the `Payment` object. @@ -24085,10 +29776,43 @@ input OrderSettingsInput @doc(category: "Orders") { """ markAsPaidStrategy: MarkAsPaidStrategyEnum + """ + Determine if it is possible to place unpaid order by calling `checkoutComplete` mutation. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + allowUnpaidOrders: Boolean + + """ + Specify whether a coupon applied to draft orders will count toward voucher usage. + + Warning: when switching this setting from `false` to `true`, the vouchers will be disconnected from all draft orders. + + Added in Saleor 3.18. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + includeDraftOrderInVoucherUsage: Boolean +} + +input CheckoutSettingsInput @doc(category: "Checkout") { + """ + Default `true`. Determines if the checkout mutations should use legacy error flow. In legacy flow, all mutations can raise an exception unrelated to the requested action - (e.g. out-of-stock exception when updating checkoutShippingAddress.) If `false`, the errors will be aggregated in `checkout.problems` field. Some of the `problems` can block the finalizing checkout process. The legacy flow will be removed in Saleor 4.0. The flow with `checkout.problems` will be the default one. + + Added in Saleor 3.15. + + DEPRECATED: this field will be removed in Saleor 4.0. + """ + useLegacyErrorFlow: Boolean +} + +input PaymentSettingsInput @doc(category: "Payments") { """ Determine the transaction flow strategy to be used. Include the selected option in the payload sent to the payment app, as a requested action for the transaction. - Added in Saleor 3.13. + Added in Saleor 3.16. Note: this API is currently in Feature Preview and can be subject to changes at later point. """ @@ -24099,16 +29823,22 @@ input OrderSettingsInput @doc(category: "Orders") { Update a channel. Requires one of the following permissions: MANAGE_CHANNELS. -Requires one of the following permissions when updating only orderSettings field: MANAGE_CHANNELS, MANAGE_ORDERS. +Requires one of the following permissions when updating only `orderSettings` field: `MANAGE_CHANNELS`, `MANAGE_ORDERS`. +Requires one of the following permissions when updating only `checkoutSettings` field: `MANAGE_CHANNELS`, `MANAGE_CHECKOUTS`. +Requires one of the following permissions when updating only `paymentSettings` field: `MANAGE_CHANNELS`, `HANDLE_PAYMENTS`. + +Triggers the following webhook events: +- CHANNEL_UPDATED (async): A channel was updated. +- CHANNEL_METADATA_UPDATED (async): Optionally triggered when public or private metadata is updated. """ -type ChannelUpdate @doc(category: "Channels") { +type ChannelUpdate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_UPDATED, CHANNEL_METADATA_UPDATED], syncEvents: []) { channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [ChannelError!]! channel: Channel } input ChannelUpdateInput @doc(category: "Channels") { - """isActive flag.""" + """Determine if channel will be set active or not.""" isActive: Boolean """ @@ -24135,6 +29865,38 @@ input ChannelUpdateInput @doc(category: "Channels") { """ orderSettings: OrderSettingsInput + """ + Channel public metadata. + + Added in Saleor 3.15. + """ + metadata: [MetadataInput!] + + """ + Channel private metadata. + + Added in Saleor 3.15. + """ + privateMetadata: [MetadataInput!] + + """ + The channel checkout settings + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + checkoutSettings: CheckoutSettingsInput + + """ + The channel payment settings + + Added in Saleor 3.16. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + paymentSettings: PaymentSettingsInput + """Name of the channel.""" name: String @@ -24163,8 +29925,11 @@ input ChannelUpdateInput @doc(category: "Channels") { Delete a channel. Orders associated with the deleted channel will be moved to the target channel. Checkouts, product availability, and pricing will be removed. Requires one of the following permissions: MANAGE_CHANNELS. + +Triggers the following webhook events: +- CHANNEL_DELETED (async): A channel was deleted. """ -type ChannelDelete @doc(category: "Channels") { +type ChannelDelete @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_DELETED], syncEvents: []) { channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [ChannelError!]! channel: Channel @@ -24179,8 +29944,11 @@ input ChannelDeleteInput @doc(category: "Channels") { Activate a channel. Requires one of the following permissions: MANAGE_CHANNELS. + +Triggers the following webhook events: +- CHANNEL_STATUS_CHANGED (async): A channel was activated. """ -type ChannelActivate @doc(category: "Channels") { +type ChannelActivate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_STATUS_CHANGED], syncEvents: []) { """Activated channel.""" channel: Channel channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -24191,8 +29959,11 @@ type ChannelActivate @doc(category: "Channels") { Deactivate a channel. Requires one of the following permissions: MANAGE_CHANNELS. + +Triggers the following webhook events: +- CHANNEL_STATUS_CHANGED (async): A channel was deactivated. """ -type ChannelDeactivate @doc(category: "Channels") { +type ChannelDeactivate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_STATUS_CHANGED], syncEvents: []) { """Deactivated channel.""" channel: Channel channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -24212,8 +29983,13 @@ type ChannelReorderWarehouses @doc(category: "Channels") { errors: [ChannelError!]! } -"""Creates an attribute.""" -type AttributeCreate @doc(category: "Attributes") { +""" +Creates an attribute. + +Triggers the following webhook events: +- ATTRIBUTE_CREATED (async): An attribute was created. +""" +type AttributeCreate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_CREATED], syncEvents: []) { attribute: Attribute attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AttributeError!]! @@ -24242,6 +30018,11 @@ enum AttributeErrorCode @doc(category: "Attributes") { UNIQUE } +""" +Represents an input for create of attribute. + +NOTE: Deprecated fields `filterableInStorefront`, `storefrontSearchPosition` and `availableInGrid` are not supported in bulk mutations: `attributeBulkCreate`, `attributeBulkUpdate`. +""" input AttributeCreateInput @doc(category: "Attributes") { """The input type to use for entering attribute values in the dashboard.""" inputType: AttributeInputTypeEnum @@ -24348,8 +30129,11 @@ input AttributeValueCreateInput @doc(category: "Attributes") { Deletes an attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + +Triggers the following webhook events: +- ATTRIBUTE_DELETED (async): An attribute was deleted. """ -type AttributeDelete @doc(category: "Attributes") { +type AttributeDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_DELETED], syncEvents: []) { attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AttributeError!]! attribute: Attribute @@ -24359,13 +30143,21 @@ type AttributeDelete @doc(category: "Attributes") { Updates attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + +Triggers the following webhook events: +- ATTRIBUTE_UPDATED (async): An attribute was updated. """ -type AttributeUpdate @doc(category: "Attributes") { +type AttributeUpdate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_UPDATED], syncEvents: []) { attribute: Attribute attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AttributeError!]! } +""" +Represents an input for update of attribute. + +NOTE: Deprecated fields `filterableInStorefront`, `storefrontSearchPosition` and `availableInGrid` are not supported in bulk mutations: `attributeBulkCreate`, `attributeBulkUpdate`. +""" input AttributeUpdateInput @doc(category: "Attributes") { """Name of an attribute displayed in the interface.""" name: String @@ -24408,58 +30200,177 @@ input AttributeUpdateInput @doc(category: "Attributes") { """ storefrontSearchPosition: Int - """ - Whether the attribute can be displayed in the admin product list. - - DEPRECATED: this field will be removed in Saleor 4.0. - """ - availableInGrid: Boolean + """ + Whether the attribute can be displayed in the admin product list. + + DEPRECATED: this field will be removed in Saleor 4.0. + """ + availableInGrid: Boolean + + """ + External ID of this product. + + Added in Saleor 3.10. + """ + externalReference: String +} + +input AttributeValueUpdateInput @doc(category: "Attributes") { + """ + Represent value of the attribute value (e.g. color values for swatch attributes). + """ + value: String + + """ + Represents the text of the attribute value, includes formatting. + + Rich text format. For reference see https://editorjs.io/ + + DEPRECATED: this field will be removed in Saleor 4.0.The rich text attribute hasn't got predefined value, so can be specified only from instance that supports the given attribute. + """ + richText: JSONString + + """ + Represents the text of the attribute value, plain text without formating. + + DEPRECATED: this field will be removed in Saleor 4.0.The plain text attribute hasn't got predefined value, so can be specified only from instance that supports the given attribute. + """ + plainText: String + + """URL of the file attribute. Every time, a new value is created.""" + fileUrl: String + + """File content type.""" + contentType: String + + """ + External ID of this attribute value. + + Added in Saleor 3.10. + """ + externalReference: String + + """Name of a value displayed in the interface.""" + name: String +} + +""" +Creates attributes. + +Added in Saleor 3.15. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Triggers the following webhook events: +- ATTRIBUTE_CREATED (async): An attribute was created. +""" +type AttributeBulkCreate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_CREATED], syncEvents: []) { + """Returns how many objects were created.""" + count: Int! + + """List of the created attributes.""" + results: [AttributeBulkCreateResult!]! + errors: [AttributeBulkCreateError!]! +} + +type AttributeBulkCreateResult @doc(category: "Attributes") { + """Attribute data.""" + attribute: Attribute + + """List of errors occurred on create attempt.""" + errors: [AttributeBulkCreateError!] +} + +type AttributeBulkCreateError @doc(category: "Attributes") { + """ + Path to field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + path: String + + """The error message.""" + message: String + + """The error code.""" + code: AttributeBulkCreateErrorCode! +} + +"""An enumeration.""" +enum AttributeBulkCreateErrorCode @doc(category: "Attributes") { + ALREADY_EXISTS + BLANK + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE + DUPLICATED_INPUT_ITEM + MAX_LENGTH +} + +""" +Updates attributes. + +Added in Saleor 3.15. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Triggers the following webhook events: +- ATTRIBUTE_UPDATED (async): An attribute was updated. Optionally called when new attribute value was created or deleted. +- ATTRIBUTE_VALUE_CREATED (async): Called optionally when an attribute value was created. +- ATTRIBUTE_VALUE_DELETED (async): Called optionally when an attribute value was deleted. +""" +type AttributeBulkUpdate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_UPDATED, ATTRIBUTE_VALUE_CREATED, ATTRIBUTE_VALUE_DELETED], syncEvents: []) { + """Returns how many objects were updated.""" + count: Int! + + """List of the updated attributes.""" + results: [AttributeBulkUpdateResult!]! + errors: [AttributeBulkUpdateError!]! +} - """ - External ID of this product. - - Added in Saleor 3.10. - """ - externalReference: String +type AttributeBulkUpdateResult @doc(category: "Attributes") { + """Attribute data.""" + attribute: Attribute + + """List of errors occurred on update attempt.""" + errors: [AttributeBulkUpdateError!] } -input AttributeValueUpdateInput @doc(category: "Attributes") { +type AttributeBulkUpdateError @doc(category: "Attributes") { """ - Represent value of the attribute value (e.g. color values for swatch attributes). + Path to field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. """ - value: String + path: String - """ - Represents the text of the attribute value, includes formatting. - - Rich text format. For reference see https://editorjs.io/ - - DEPRECATED: this field will be removed in Saleor 4.0.The rich text attribute hasn't got predefined value, so can be specified only from instance that supports the given attribute. - """ - richText: JSONString + """The error message.""" + message: String - """ - Represents the text of the attribute value, plain text without formating. - - DEPRECATED: this field will be removed in Saleor 4.0.The plain text attribute hasn't got predefined value, so can be specified only from instance that supports the given attribute. - """ - plainText: String + """The error code.""" + code: AttributeBulkUpdateErrorCode! +} - """URL of the file attribute. Every time, a new value is created.""" - fileUrl: String +"""An enumeration.""" +enum AttributeBulkUpdateErrorCode { + ALREADY_EXISTS + BLANK + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE + DUPLICATED_INPUT_ITEM + MAX_LENGTH +} - """File content type.""" - contentType: String +input AttributeBulkUpdateInput @doc(category: "Attributes") { + """ID of an attribute to update.""" + id: ID - """ - External ID of this attribute value. - - Added in Saleor 3.10. - """ + """External ID of this attribute.""" externalReference: String - """Name of a value displayed in the interface.""" - name: String + """Fields to update.""" + fields: AttributeUpdateInput! } """ @@ -24473,12 +30384,76 @@ type AttributeTranslate @doc(category: "Attributes") { attribute: Attribute } +""" +Creates/updates translations for attributes. + +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: MANAGE_TRANSLATIONS. +""" +type AttributeBulkTranslate @doc(category: "Attributes") { + """Returns how many translations were created/updated.""" + count: Int! + + """List of the translations.""" + results: [AttributeBulkTranslateResult!]! + errors: [AttributeBulkTranslateError!]! +} + +type AttributeBulkTranslateResult @doc(category: "Attributes") { + """Attribute translation data.""" + translation: AttributeTranslation + + """List of errors occurred on translation attempt.""" + errors: [AttributeBulkTranslateError!] +} + +type AttributeBulkTranslateError { + """ + Path to field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + path: String + + """The error message.""" + message: String + + """The error code.""" + code: AttributeTranslateErrorCode! +} + +"""An enumeration.""" +enum AttributeTranslateErrorCode @doc(category: "Attributes") { + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED +} + +input AttributeBulkTranslateInput @doc(category: "Attributes") { + """Attribute ID.""" + id: ID + + """External reference of an attribute.""" + externalReference: String + + """Translation language code.""" + languageCode: LanguageCodeEnum! + + """Translation fields.""" + translationFields: NameTranslationInput! +} + """ Deletes attributes. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. + +Triggers the following webhook events: +- ATTRIBUTE_DELETED (async): An attribute was deleted. """ -type AttributeBulkDelete @doc(category: "Attributes") { +type AttributeBulkDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_DELETED], syncEvents: []) { """Returns how many objects were affected.""" count: Int! attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -24489,8 +30464,12 @@ type AttributeBulkDelete @doc(category: "Attributes") { Deletes values of attributes. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES. + +Triggers the following webhook events: +- ATTRIBUTE_VALUE_DELETED (async): An attribute value was deleted. +- ATTRIBUTE_UPDATED (async): An attribute was updated. """ -type AttributeValueBulkDelete @doc(category: "Attributes") { +type AttributeValueBulkDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_DELETED, ATTRIBUTE_UPDATED], syncEvents: []) { """Returns how many objects were affected.""" count: Int! attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -24501,8 +30480,12 @@ type AttributeValueBulkDelete @doc(category: "Attributes") { Creates a value for an attribute. Requires one of the following permissions: MANAGE_PRODUCTS. + +Triggers the following webhook events: +- ATTRIBUTE_VALUE_CREATED (async): An attribute value was created. +- ATTRIBUTE_UPDATED (async): An attribute was updated. """ -type AttributeValueCreate @doc(category: "Attributes") { +type AttributeValueCreate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_CREATED, ATTRIBUTE_UPDATED], syncEvents: []) { """The updated attribute.""" attribute: Attribute attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -24514,8 +30497,12 @@ type AttributeValueCreate @doc(category: "Attributes") { Deletes a value of an attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + +Triggers the following webhook events: +- ATTRIBUTE_VALUE_DELETED (async): An attribute value was deleted. +- ATTRIBUTE_UPDATED (async): An attribute was updated. """ -type AttributeValueDelete @doc(category: "Attributes") { +type AttributeValueDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_DELETED, ATTRIBUTE_UPDATED], syncEvents: []) { """The updated attribute.""" attribute: Attribute attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -24527,8 +30514,12 @@ type AttributeValueDelete @doc(category: "Attributes") { Updates value of an attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + +Triggers the following webhook events: +- ATTRIBUTE_VALUE_UPDATED (async): An attribute value was updated. +- ATTRIBUTE_UPDATED (async): An attribute was updated. """ -type AttributeValueUpdate @doc(category: "Attributes") { +type AttributeValueUpdate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_UPDATED, ATTRIBUTE_UPDATED], syncEvents: []) { """The updated attribute.""" attribute: Attribute attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -24537,14 +30528,64 @@ type AttributeValueUpdate @doc(category: "Attributes") { } """ -Creates/updates translations for an attribute value. +Creates/updates translations for attributes values. + +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. Requires one of the following permissions: MANAGE_TRANSLATIONS. """ -type AttributeValueTranslate @doc(category: "Attributes") { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [TranslationError!]! - attributeValue: AttributeValue +type AttributeValueBulkTranslate @doc(category: "Attributes") { + """Returns how many translations were created/updated.""" + count: Int! + + """List of the translations.""" + results: [AttributeValueBulkTranslateResult!]! + errors: [AttributeValueBulkTranslateError!]! +} + +type AttributeValueBulkTranslateResult @doc(category: "Attributes") { + """Attribute value translation data.""" + translation: AttributeValueTranslation + + """List of errors occurred on translation attempt.""" + errors: [AttributeValueBulkTranslateError!] +} + +type AttributeValueBulkTranslateError { + """ + Path to field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + path: String + + """The error message.""" + message: String + + """The error code.""" + code: AttributeValueTranslateErrorCode! +} + +"""An enumeration.""" +enum AttributeValueTranslateErrorCode @doc(category: "Attributes") { + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED +} + +input AttributeValueBulkTranslateInput @doc(category: "Attributes") { + """Attribute value ID.""" + id: ID + + """External reference of an attribute value.""" + externalReference: String + + """Translation language code.""" + languageCode: LanguageCodeEnum! + + """Translation fields.""" + translationFields: AttributeValueTranslationInput! } input AttributeValueTranslationInput { @@ -24561,12 +30602,27 @@ input AttributeValueTranslationInput { plainText: String } +""" +Creates/updates translations for an attribute value. + +Requires one of the following permissions: MANAGE_TRANSLATIONS. +""" +type AttributeValueTranslate @doc(category: "Attributes") { + translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [TranslationError!]! + attributeValue: AttributeValue +} + """ Reorder the values of an attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. + +Triggers the following webhook events: +- ATTRIBUTE_VALUE_UPDATED (async): An attribute value was updated. +- ATTRIBUTE_UPDATED (async): An attribute was updated. """ -type AttributeReorderValues @doc(category: "Attributes") { +type AttributeReorderValues @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_UPDATED, ATTRIBUTE_UPDATED], syncEvents: []) { """Attribute from which values are reordered.""" attribute: Attribute attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -24575,8 +30631,11 @@ type AttributeReorderValues @doc(category: "Attributes") { """ Creates a new app. Requires the following permissions: AUTHENTICATED_STAFF_USER and MANAGE_APPS. + +Triggers the following webhook events: +- APP_INSTALLED (async): An app was installed. """ -type AppCreate @doc(category: "Apps") { +type AppCreate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_INSTALLED], syncEvents: []) { """The newly created authentication token.""" authToken: String appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -24623,6 +30682,13 @@ input AppInput @doc(category: "Apps") { """Name of the app.""" name: String + """ + Canonical app ID. If not provided, the identifier will be generated based on app.id. + + Added in Saleor 3.19. + """ + identifier: String + """List of permission code names to assign to this app.""" permissions: [PermissionEnum!] } @@ -24631,8 +30697,11 @@ input AppInput @doc(category: "Apps") { Updates an existing app. Requires one of the following permissions: MANAGE_APPS. + +Triggers the following webhook events: +- APP_UPDATED (async): An app was updated. """ -type AppUpdate @doc(category: "Apps") { +type AppUpdate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_UPDATED], syncEvents: []) { appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AppError!]! app: App @@ -24642,8 +30711,11 @@ type AppUpdate @doc(category: "Apps") { Deletes an app. Requires one of the following permissions: MANAGE_APPS. + +Triggers the following webhook events: +- APP_DELETED (async): An app was deleted. """ -type AppDelete @doc(category: "Apps") { +type AppDelete @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_DELETED], syncEvents: []) { appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AppError!]! app: App @@ -24702,7 +30774,7 @@ input AppInstallInput @doc(category: "Apps") { """Name of the app to install.""" appName: String - """Url to app's manifest in JSON format.""" + """URL to app's manifest in JSON format.""" manifestUrl: String """Determine if app will be set active or not.""" @@ -24716,8 +30788,11 @@ input AppInstallInput @doc(category: "Apps") { Retry failed installation of new app. Requires one of the following permissions: MANAGE_APPS. + +Triggers the following webhook events: +- APP_INSTALLED (async): An app was installed. """ -type AppRetryInstall @doc(category: "Apps") { +type AppRetryInstall @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_INSTALLED], syncEvents: []) { appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AppError!]! appInstallation: AppInstallation @@ -24740,6 +30815,7 @@ Fetch and validate manifest. Requires one of the following permissions: MANAGE_APPS. """ type AppFetchManifest @doc(category: "Apps") { + """The validated manifest.""" manifest: Manifest appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AppError!]! @@ -24747,22 +30823,47 @@ type AppFetchManifest @doc(category: "Apps") { """The manifest definition.""" type Manifest @doc(category: "Apps") { + """The identifier of the manifest for the app.""" identifier: String! + + """The version of the manifest for the app.""" version: String! + + """The name of the manifest for the app .""" name: String! + + """Description of the app displayed in the dashboard.""" about: String + + """The array permissions required for the app.""" permissions: [Permission!] + + """App website rendered in the dashboard.""" appUrl: String """URL to iframe with the configuration for the app.""" configurationUrl: String @deprecated(reason: "This field will be removed in Saleor 4.0. Use `appUrl` instead.") + + """ + Endpoint used during process of app installation, [see installing an app.](https://docs.saleor.io/docs/3.x/developer/extending/apps/installing-apps#installing-an-app) + """ tokenTargetUrl: String """Description of the data privacy defined for this app.""" dataPrivacy: String @deprecated(reason: "This field will be removed in Saleor 4.0. Use `dataPrivacyUrl` instead.") + + """URL to the full privacy policy.""" dataPrivacyUrl: String + + """External URL to the app homepage.""" homepageUrl: String + + """External URL to the page where app users can find support.""" supportUrl: String + + """ + List of extensions that will be mounted in Saleor's dashboard. For details, please [see the extension section.](https://docs.saleor.io/docs/3.x/developer/extending/apps/extending-dashboard-with-apps#key-concepts) + """ extensions: [AppManifestExtension!]! """ @@ -24796,6 +30897,15 @@ type Manifest @doc(category: "Apps") { Note: this API is currently in Feature Preview and can be subject to changes at later point. """ author: String + + """ + App's brand data. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + brand: AppManifestBrand } type AppManifestExtension @doc(category: "Apps") { @@ -24852,12 +30962,65 @@ type AppManifestRequiredSaleorVersion @doc(category: "Apps") { satisfied: Boolean! } +""" +Represents the app's manifest brand data. + +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type AppManifestBrand @doc(category: "Apps") { + """ + App's logos details. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + logo: AppManifestBrandLogo! +} + +""" +Represents the app's manifest brand data. + +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type AppManifestBrandLogo @doc(category: "Apps") { + """ + Data URL with a base64 encoded logo image. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + default( + """ + Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended). + """ + size: Int + + """ + The format of the image. When not provided, format of the original image will be used. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + format: IconThumbnailFormatEnum = ORIGINAL + ): String! +} + """ Activate the app. Requires one of the following permissions: MANAGE_APPS. + +Triggers the following webhook events: +- APP_STATUS_CHANGED (async): An app was activated. """ -type AppActivate @doc(category: "Apps") { +type AppActivate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_STATUS_CHANGED], syncEvents: []) { appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AppError!]! app: App @@ -24867,8 +31030,11 @@ type AppActivate @doc(category: "Apps") { Deactivate the app. Requires one of the following permissions: MANAGE_APPS. + +Triggers the following webhook events: +- APP_STATUS_CHANGED (async): An app was deactivated. """ -type AppDeactivate @doc(category: "Apps") { +type AppDeactivate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_STATUS_CHANGED], syncEvents: []) { appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AppError!]! app: App @@ -24947,7 +31113,7 @@ enum AccountErrorCode @doc(category: "Users") { } """ -Refresh JWT token. Mutation tries to take refreshToken from the input.If it fails it will try to take refreshToken from the http-only cookie -refreshToken. csrfToken is required when refreshToken is provided as a cookie. +Refresh JWT token. Mutation tries to take refreshToken from the input. If it fails it will try to take `refreshToken` from the http-only cookie `refreshToken`. `csrfToken` is required when `refreshToken` is provided as a cookie. """ type RefreshToken @doc(category: "Authentication") { """JWT token, required to authenticate.""" @@ -25040,28 +31206,78 @@ type ExternalLogout @doc(category: "Authentication") { errors: [AccountError!]! } -"""Verify external authentication data by plugin.""" -type ExternalVerify @doc(category: "Authentication") { - """User assigned to data.""" - user: User +"""Verify external authentication data by plugin.""" +type ExternalVerify @doc(category: "Authentication") { + """User assigned to data.""" + user: User + + """Determine if authentication data is valid or not.""" + isValid: Boolean! + + """External data.""" + verifyData: JSONString + accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [AccountError!]! +} + +""" +Sends an email with the account password modification link. + +Triggers the following webhook events: +- NOTIFY_USER (async): A notification for password reset. +- ACCOUNT_SET_PASSWORD_REQUESTED (async): Setting a new password for the account is requested. +- STAFF_SET_PASSWORD_REQUESTED (async): Setting a new password for the staff account is requested. +""" +type RequestPasswordReset @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER, ACCOUNT_SET_PASSWORD_REQUESTED, STAFF_SET_PASSWORD_REQUESTED], syncEvents: []) { + accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [AccountError!]! +} + +""" +Sends a notification confirmation. + +Added in Saleor 3.15. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: AUTHENTICATED_USER. + +Triggers the following webhook events: +- NOTIFY_USER (async): A notification for account confirmation. +- ACCOUNT_CONFIRMATION_REQUESTED (async): An account confirmation was requested. This event is always sent regardless of settings. +""" +type SendConfirmationEmail @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER, ACCOUNT_CONFIRMATION_REQUESTED], syncEvents: []) { + errors: [SendConfirmationEmailError!]! +} + +type SendConfirmationEmailError @doc(category: "Users") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String - """Determine if authentication data is valid or not.""" - isValid: Boolean! + """The error message.""" + message: String - """External data.""" - verifyData: JSONString - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [AccountError!]! + """The error code.""" + code: SendConfirmationEmailErrorCode! } -"""Sends an email with the account password modification link.""" -type RequestPasswordReset @doc(category: "Users") { - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [AccountError!]! +"""An enumeration.""" +enum SendConfirmationEmailErrorCode @doc(category: "Users") { + INVALID + ACCOUNT_CONFIRMED + CONFIRMATION_ALREADY_REQUESTED + MISSING_CHANNEL_SLUG } -"""Confirm user account with token sent by email during registration.""" -type ConfirmAccount @doc(category: "Users") { +""" +Confirm user account with token sent by email during registration. + +Triggers the following webhook events: +- ACCOUNT_CONFIRMED (async): Account was confirmed. +""" +type ConfirmAccount @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ACCOUNT_CONFIRMED], syncEvents: []) { """An activated user account.""" user: User accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -25103,8 +31319,12 @@ type PasswordChange @doc(category: "Users") { Request email change of the logged in user. Requires one of the following permissions: AUTHENTICATED_USER. + +Triggers the following webhook events: +- NOTIFY_USER (async): A notification for account email change. +- ACCOUNT_CHANGE_EMAIL_REQUESTED (async): An account email change was requested. """ -type RequestEmailChange @doc(category: "Users") { +type RequestEmailChange @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER, ACCOUNT_CHANGE_EMAIL_REQUESTED], syncEvents: []) { """A user instance.""" user: User accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -25115,8 +31335,13 @@ type RequestEmailChange @doc(category: "Users") { Confirm the email change of the logged-in user. Requires one of the following permissions: AUTHENTICATED_USER. + +Triggers the following webhook events: +- CUSTOMER_UPDATED (async): A customer account was updated. +- NOTIFY_USER (async): A notification that account email change was confirmed. +- ACCOUNT_EMAIL_CHANGED (async): An account email was changed. """ -type ConfirmEmailChange @doc(category: "Users") { +type ConfirmEmailChange @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, NOTIFY_USER, ACCOUNT_EMAIL_CHANGED], syncEvents: []) { """A user instance with a new email.""" user: User accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -25127,8 +31352,12 @@ type ConfirmEmailChange @doc(category: "Users") { Create a new address for the customer. Requires one of the following permissions: AUTHENTICATED_USER. + +Triggers the following webhook events: +- CUSTOMER_UPDATED (async): A customer account was updated. +- ADDRESS_CREATED (async): An address was created. """ -type AccountAddressCreate @doc(category: "Users") { +type AccountAddressCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, ADDRESS_CREATED], syncEvents: []) { """A user instance for which the address was created.""" user: User accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -25138,8 +31367,11 @@ type AccountAddressCreate @doc(category: "Users") { """ Updates an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER. + +Triggers the following webhook events: +- ADDRESS_UPDATED (async): An address was updated. """ -type AccountAddressUpdate @doc(category: "Users") { +type AccountAddressUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_UPDATED], syncEvents: []) { """A user object for which the address was edited.""" user: User accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -25149,8 +31381,11 @@ type AccountAddressUpdate @doc(category: "Users") { """ Delete an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER. + +Triggers the following webhook events: +- ADDRESS_DELETED (async): An address was deleted. """ -type AccountAddressDelete @doc(category: "Users") { +type AccountAddressDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_DELETED], syncEvents: []) { """A user instance for which the address was deleted.""" user: User accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -25162,16 +31397,26 @@ type AccountAddressDelete @doc(category: "Users") { Sets a default address for the authenticated user. Requires one of the following permissions: AUTHENTICATED_USER. + +Triggers the following webhook events: +- CUSTOMER_UPDATED (async): A customer's address was updated. """ -type AccountSetDefaultAddress @doc(category: "Users") { +type AccountSetDefaultAddress @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED], syncEvents: []) { """An updated user instance.""" user: User accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AccountError!]! } -"""Register a new user.""" -type AccountRegister @doc(category: "Users") { +""" +Register a new user. + +Triggers the following webhook events: +- CUSTOMER_CREATED (async): A new customer account was created. +- NOTIFY_USER (async): A notification for account confirmation. +- ACCOUNT_CONFIRMATION_REQUESTED (async): An user confirmation was requested. This event is always sent regardless of settings. +""" +type AccountRegister @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_CREATED, NOTIFY_USER, ACCOUNT_CONFIRMATION_REQUESTED], syncEvents: []) { """Informs whether users need to confirm their email address.""" requiresConfirmation: Boolean accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -25212,8 +31457,12 @@ input AccountRegisterInput @doc(category: "Users") { Updates the account of the logged-in user. Requires one of the following permissions: AUTHENTICATED_USER. + +Triggers the following webhook events: +- CUSTOMER_UPDATED (async): A customer account was updated. +- CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated. """ -type AccountUpdate @doc(category: "Users") { +type AccountUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, CUSTOMER_METADATA_UPDATED], syncEvents: []) { accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AccountError!]! user: User @@ -25235,14 +31484,25 @@ input AccountInput @doc(category: "Users") { """Shipping address of the customer.""" defaultShippingAddress: AddressInput + + """ + Fields required to update the user metadata. + + Added in Saleor 3.14. + """ + metadata: [MetadataInput!] } """ Sends an email with the account removal link for the logged-in user. Requires one of the following permissions: AUTHENTICATED_USER. + +Triggers the following webhook events: +- NOTIFY_USER (async): A notification for account delete request. +- ACCOUNT_DELETE_REQUESTED (async): An account delete requested. """ -type AccountRequestDeletion @doc(category: "Users") { +type AccountRequestDeletion @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER, ACCOUNT_DELETE_REQUESTED], syncEvents: []) { accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AccountError!]! } @@ -25251,8 +31511,11 @@ type AccountRequestDeletion @doc(category: "Users") { Remove user account. Requires one of the following permissions: AUTHENTICATED_USER. + +Triggers the following webhook events: +- ACCOUNT_DELETED (async): Account was deleted. """ -type AccountDelete @doc(category: "Users") { +type AccountDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ACCOUNT_DELETED], syncEvents: []) { accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AccountError!]! user: User @@ -25262,8 +31525,11 @@ type AccountDelete @doc(category: "Users") { Creates user address. Requires one of the following permissions: MANAGE_USERS. + +Triggers the following webhook events: +- ADDRESS_CREATED (async): A new address was created. """ -type AddressCreate @doc(category: "Users") { +type AddressCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_CREATED], syncEvents: []) { """A user instance for which the address was created.""" user: User accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -25275,8 +31541,11 @@ type AddressCreate @doc(category: "Users") { Updates an address. Requires one of the following permissions: MANAGE_USERS. + +Triggers the following webhook events: +- ADDRESS_UPDATED (async): An address was updated. """ -type AddressUpdate @doc(category: "Users") { +type AddressUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_UPDATED], syncEvents: []) { """A user object for which the address was edited.""" user: User accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -25288,8 +31557,11 @@ type AddressUpdate @doc(category: "Users") { Deletes an address. Requires one of the following permissions: MANAGE_USERS. + +Triggers the following webhook events: +- ADDRESS_DELETED (async): An address was deleted. """ -type AddressDelete @doc(category: "Users") { +type AddressDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_DELETED], syncEvents: []) { """A user instance for which the address was deleted.""" user: User accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -25301,8 +31573,11 @@ type AddressDelete @doc(category: "Users") { Sets a default address for the given user. Requires one of the following permissions: MANAGE_USERS. + +Triggers the following webhook events: +- CUSTOMER_UPDATED (async): A customer was updated. """ -type AddressSetDefault @doc(category: "Users") { +type AddressSetDefault @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED], syncEvents: []) { """An updated user instance.""" user: User accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -25310,23 +31585,297 @@ type AddressSetDefault @doc(category: "Users") { } """ -Creates a new customer. +Creates a new customer. + +Requires one of the following permissions: MANAGE_USERS. + +Triggers the following webhook events: +- CUSTOMER_CREATED (async): A new customer account was created. +- CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated. +- NOTIFY_USER (async): A notification for setting the password. +- ACCOUNT_SET_PASSWORD_REQUESTED (async): Setting a new password for the account is requested. +""" +type CustomerCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_CREATED, CUSTOMER_METADATA_UPDATED, NOTIFY_USER, ACCOUNT_SET_PASSWORD_REQUESTED], syncEvents: []) { + accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [AccountError!]! + user: User +} + +input UserCreateInput @doc(category: "Users") { + """Billing address of the customer.""" + defaultBillingAddress: AddressInput + + """Shipping address of the customer.""" + defaultShippingAddress: AddressInput + + """Given name.""" + firstName: String + + """Family name.""" + lastName: String + + """The unique email address of the user.""" + email: String + + """User account is active.""" + isActive: Boolean + + """A note about the user.""" + note: String + + """ + Fields required to update the user metadata. + + Added in Saleor 3.14. + """ + metadata: [MetadataInput!] + + """ + Fields required to update the user private metadata. + + Added in Saleor 3.14. + """ + privateMetadata: [MetadataInput!] + + """User language code.""" + languageCode: LanguageCodeEnum + + """ + External ID of the customer. + + Added in Saleor 3.10. + """ + externalReference: String + + """ + User account is confirmed. + + Added in Saleor 3.15. + + DEPRECATED: this field will be removed in Saleor 4.0. + + The user will be always set as unconfirmed. The confirmation will take place when the user sets the password. + """ + isConfirmed: Boolean + + """ + URL of a view where users should be redirected to set the password. URL in RFC 1808 format. + """ + redirectUrl: String + + """ + Slug of a channel which will be used for notify user. Optional when only one channel exists. + """ + channel: String +} + +""" +Updates an existing customer. + +Requires one of the following permissions: MANAGE_USERS. + +Triggers the following webhook events: +- CUSTOMER_UPDATED (async): A new customer account was updated. +- CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated. +""" +type CustomerUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, CUSTOMER_METADATA_UPDATED], syncEvents: []) { + accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [AccountError!]! + user: User +} + +input CustomerInput @doc(category: "Users") { + """Billing address of the customer.""" + defaultBillingAddress: AddressInput + + """Shipping address of the customer.""" + defaultShippingAddress: AddressInput + + """Given name.""" + firstName: String + + """Family name.""" + lastName: String + + """The unique email address of the user.""" + email: String + + """User account is active.""" + isActive: Boolean + + """A note about the user.""" + note: String + + """ + Fields required to update the user metadata. + + Added in Saleor 3.14. + """ + metadata: [MetadataInput!] + + """ + Fields required to update the user private metadata. + + Added in Saleor 3.14. + """ + privateMetadata: [MetadataInput!] + + """User language code.""" + languageCode: LanguageCodeEnum + + """ + External ID of the customer. + + Added in Saleor 3.10. + """ + externalReference: String + + """ + User account is confirmed. + + Added in Saleor 3.15. + """ + isConfirmed: Boolean +} + +""" +Deletes a customer. + +Requires one of the following permissions: MANAGE_USERS. + +Triggers the following webhook events: +- CUSTOMER_DELETED (async): A customer account was deleted. +""" +type CustomerDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_DELETED], syncEvents: []) { + accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [AccountError!]! + user: User +} + +""" +Deletes customers. + +Requires one of the following permissions: MANAGE_USERS. + +Triggers the following webhook events: +- CUSTOMER_DELETED (async): A customer account was deleted. +""" +type CustomerBulkDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_DELETED], syncEvents: []) { + """Returns how many objects were affected.""" + count: Int! + accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [AccountError!]! +} + +""" +Updates customers. + +Added in Saleor 3.13. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: MANAGE_USERS. + +Triggers the following webhook events: +- CUSTOMER_UPDATED (async): A customer account was updated. +- CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated. +""" +type CustomerBulkUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, CUSTOMER_METADATA_UPDATED], syncEvents: []) { + """Returns how many objects were created.""" + count: Int! + + """List of the updated customers.""" + results: [CustomerBulkResult!]! + errors: [CustomerBulkUpdateError!]! +} + +type CustomerBulkResult @doc(category: "Users") { + """Customer data.""" + customer: User + + """List of errors that occurred during the update attempt.""" + errors: [CustomerBulkUpdateError!] +} + +type CustomerBulkUpdateError @doc(category: "Users") { + """ + Path to field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + path: String + + """The error message.""" + message: String + + """The error code.""" + code: CustomerBulkUpdateErrorCode! +} + +"""An enumeration.""" +enum CustomerBulkUpdateErrorCode @doc(category: "Users") { + BLANK + DUPLICATED_INPUT_ITEM + GRAPHQL_ERROR + INVALID + REQUIRED + UNIQUE + NOT_FOUND + MAX_LENGTH +} + +input CustomerBulkUpdateInput @doc(category: "Users") { + """ID of a customer to update.""" + id: ID + + """External ID of a customer to update.""" + externalReference: String + + """Fields required to update a customer.""" + input: CustomerInput! +} + +""" +Creates a new staff user. Apps are not allowed to perform this mutation. -Requires one of the following permissions: MANAGE_USERS. +Requires one of the following permissions: MANAGE_STAFF. + +Triggers the following webhook events: +- STAFF_CREATED (async): A new staff account was created. +- NOTIFY_USER (async): A notification for setting the password. +- STAFF_SET_PASSWORD_REQUESTED (async): Setting a new password for the staff account is requested. """ -type CustomerCreate @doc(category: "Users") { - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [AccountError!]! +type StaffCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_CREATED, NOTIFY_USER, STAFF_SET_PASSWORD_REQUESTED], syncEvents: []) { + staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [StaffError!]! user: User } -input UserCreateInput @doc(category: "Users") { - """Billing address of the customer.""" - defaultBillingAddress: AddressInput +type StaffError @doc(category: "Users") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String - """Shipping address of the customer.""" - defaultShippingAddress: AddressInput + """The error message.""" + message: String + + """The error code.""" + code: AccountErrorCode! + + """A type of address that causes the error.""" + addressType: AddressTypeEnum + """List of permissions which causes the error.""" + permissions: [PermissionEnum!] + + """List of permission group IDs which cause the error.""" + groups: [ID!] + + """List of user IDs which causes the error.""" + users: [ID!] +} + +"""Fields required to create a staff user.""" +input StaffCreateInput @doc(category: "Users") { """Given name.""" firstName: String @@ -25342,45 +31891,45 @@ input UserCreateInput @doc(category: "Users") { """A note about the user.""" note: String - """User language code.""" - languageCode: LanguageCodeEnum - """ - External ID of the customer. + Fields required to update the user metadata. - Added in Saleor 3.10. + Added in Saleor 3.14. """ - externalReference: String + metadata: [MetadataInput!] """ - URL of a view where users should be redirected to set the password. URL in RFC 1808 format. + Fields required to update the user private metadata. + + Added in Saleor 3.14. """ - redirectUrl: String + privateMetadata: [MetadataInput!] + + """List of permission group IDs to which user should be assigned.""" + addGroups: [ID!] """ - Slug of a channel which will be used for notify user. Optional when only one channel exists. + URL of a view where users should be redirected to set the password. URL in RFC 1808 format. """ - channel: String + redirectUrl: String } """ -Updates an existing customer. +Updates an existing staff user. Apps are not allowed to perform this mutation. -Requires one of the following permissions: MANAGE_USERS. +Requires one of the following permissions: MANAGE_STAFF. + +Triggers the following webhook events: +- STAFF_UPDATED (async): A staff account was updated. """ -type CustomerUpdate @doc(category: "Users") { - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [AccountError!]! +type StaffUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_UPDATED], syncEvents: []) { + staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [StaffError!]! user: User } -input CustomerInput @doc(category: "Users") { - """Billing address of the customer.""" - defaultBillingAddress: AddressInput - - """Shipping address of the customer.""" - defaultShippingAddress: AddressInput - +"""Fields required to update a staff user.""" +input StaffUpdateInput @doc(category: "Users") { """Given name.""" firstName: String @@ -25396,34 +31945,86 @@ input CustomerInput @doc(category: "Users") { """A note about the user.""" note: String - """User language code.""" - languageCode: LanguageCodeEnum + """ + Fields required to update the user metadata. + + Added in Saleor 3.14. + """ + metadata: [MetadataInput!] """ - External ID of the customer. + Fields required to update the user private metadata. - Added in Saleor 3.10. + Added in Saleor 3.14. """ - externalReference: String + privateMetadata: [MetadataInput!] + + """List of permission group IDs to which user should be assigned.""" + addGroups: [ID!] + + """List of permission group IDs from which user should be unassigned.""" + removeGroups: [ID!] } """ -Deletes a customer. +Deletes a staff user. Apps are not allowed to perform this mutation. -Requires one of the following permissions: MANAGE_USERS. +Requires one of the following permissions: MANAGE_STAFF. + +Triggers the following webhook events: +- STAFF_DELETED (async): A staff account was deleted. +""" +type StaffDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_DELETED], syncEvents: []) { + staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [StaffError!]! + user: User +} + +""" +Deletes staff users. Apps are not allowed to perform this mutation. + +Requires one of the following permissions: MANAGE_STAFF. + +Triggers the following webhook events: +- STAFF_DELETED (async): A staff account was deleted. """ -type CustomerDelete @doc(category: "Users") { +type StaffBulkDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_DELETED], syncEvents: []) { + """Returns how many objects were affected.""" + count: Int! + staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [StaffError!]! +} + +""" +Create a user avatar. Only for staff members. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec + +Requires one of the following permissions: AUTHENTICATED_STAFF_USER. +""" +type UserAvatarUpdate @doc(category: "Users") { + """An updated user instance.""" + user: User accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [AccountError!]! +} + +""" +Deletes a user avatar. Only for staff members. + +Requires one of the following permissions: AUTHENTICATED_STAFF_USER. +""" +type UserAvatarDelete @doc(category: "Users") { + """An updated user instance.""" user: User + accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [AccountError!]! } """ -Deletes customers. +Activate or deactivate users. Requires one of the following permissions: MANAGE_USERS. """ -type CustomerBulkDelete @doc(category: "Users") { +type UserBulkSetActive @doc(category: "Users") { """Returns how many objects were affected.""" count: Int! accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -25431,325 +32032,437 @@ type CustomerBulkDelete @doc(category: "Users") { } """ -Updates customers. +Create new permission group. Apps are not allowed to perform this mutation. -Added in Saleor 3.13. +Requires one of the following permissions: MANAGE_STAFF. -Note: this API is currently in Feature Preview and can be subject to changes at later point. +Triggers the following webhook events: +- PERMISSION_GROUP_CREATED (async) +""" +type PermissionGroupCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [PERMISSION_GROUP_CREATED], syncEvents: []) { + permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PermissionGroupError!]! + group: Group +} + +type PermissionGroupError @doc(category: "Users") { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """The error message.""" + message: String + + """The error code.""" + code: PermissionGroupErrorCode! + + """List of permissions which causes the error.""" + permissions: [PermissionEnum!] + + """List of user IDs which causes the error.""" + users: [ID!] + + """List of chnnels IDs which causes the error.""" + channels: [ID!] +} + +"""An enumeration.""" +enum PermissionGroupErrorCode @doc(category: "Users") { + REQUIRED + UNIQUE + ASSIGN_NON_STAFF_MEMBER + DUPLICATED_INPUT_ITEM + CANNOT_REMOVE_FROM_LAST_GROUP + LEFT_NOT_MANAGEABLE_PERMISSION + OUT_OF_SCOPE_PERMISSION + OUT_OF_SCOPE_USER + OUT_OF_SCOPE_CHANNEL +} + +input PermissionGroupCreateInput @doc(category: "Users") { + """List of permission code names to assign to this group.""" + addPermissions: [PermissionEnum!] + + """List of users to assign to this group.""" + addUsers: [ID!] + + """ + List of channels to assign to this group. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + addChannels: [ID!] + + """Group name.""" + name: String! + + """ + Determine if the group has restricted access to channels. DEFAULT: False + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + restrictedAccessToChannels: Boolean = false +} -Requires one of the following permissions: MANAGE_USERS. """ -type CustomerBulkUpdate @doc(category: "Users") { - """Returns how many objects were created.""" - count: Int! +Update permission group. Apps are not allowed to perform this mutation. - """List of the updated customers.""" - results: [CustomerBulkResult!]! - errors: [CustomerBulkUpdateError!]! +Requires one of the following permissions: MANAGE_STAFF. + +Triggers the following webhook events: +- PERMISSION_GROUP_UPDATED (async) +""" +type PermissionGroupUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [PERMISSION_GROUP_UPDATED], syncEvents: []) { + permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PermissionGroupError!]! + group: Group +} + +input PermissionGroupUpdateInput @doc(category: "Users") { + """List of permission code names to assign to this group.""" + addPermissions: [PermissionEnum!] + + """List of users to assign to this group.""" + addUsers: [ID!] + + """ + List of channels to assign to this group. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + addChannels: [ID!] + + """Group name.""" + name: String + + """List of permission code names to unassign from this group.""" + removePermissions: [PermissionEnum!] + + """List of users to unassign from this group.""" + removeUsers: [ID!] + + """ + List of channels to unassign from this group. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + removeChannels: [ID!] + + """ + Determine if the group has restricted access to channels. + + Added in Saleor 3.14. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + restrictedAccessToChannels: Boolean } -type CustomerBulkResult @doc(category: "Users") { - """Customer data.""" - customer: User +""" +Delete permission group. Apps are not allowed to perform this mutation. - """List of errors that occurred during the update attempt.""" - errors: [CustomerBulkUpdateError!] +Requires one of the following permissions: MANAGE_STAFF. + +Triggers the following webhook events: +- PERMISSION_GROUP_DELETED (async) +""" +type PermissionGroupDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [PERMISSION_GROUP_DELETED], syncEvents: []) { + permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + errors: [PermissionGroupError!]! + group: Group } -type CustomerBulkUpdateError @doc(category: "Users") { +type Subscription @doc(category: "Miscellaneous") { """ - Path to field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + Look up subscription event. + + Added in Saleor 3.2. """ - path: String + event: Event +} - """The error message.""" - message: String +interface Event { + """Time of the event.""" + issuedAt: DateTime - """The error code.""" - code: CustomerBulkUpdateErrorCode! + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App @doc(category: "Apps") } +union IssuingPrincipal = App | User + """An enumeration.""" -enum CustomerBulkUpdateErrorCode @doc(category: "Users") { - BLANK - DUPLICATED_INPUT_ITEM - GRAPHQL_ERROR - INVALID - REQUIRED - UNIQUE - NOT_FOUND - MAX_LENGTH +enum DistanceUnitsEnum { + MM + CM + DM + M + KM + FT + YD + INCH } -input CustomerBulkUpdateInput @doc(category: "Users") { - """ID of a customer to update.""" - id: ID - - """External ID of a customer to update.""" - externalReference: String +"""An enumeration.""" +enum AreaUnitsEnum { + SQ_MM + SQ_CM + SQ_DM + SQ_M + SQ_KM + SQ_FT + SQ_YD + SQ_INCH +} - """Fields required to update a customer.""" - input: CustomerInput! +"""An enumeration.""" +enum VolumeUnitsEnum { + CUBIC_MILLIMETER + CUBIC_CENTIMETER + CUBIC_DECIMETER + CUBIC_METER + LITER + CUBIC_FOOT + CUBIC_INCH + CUBIC_YARD + QT + PINT + FL_OZ + ACRE_IN + ACRE_FT } """ -Creates a new staff user. Apps are not allowed to perform this mutation. +Event sent when account confirmation requested. This event is always sent. enableAccountConfirmationByEmail flag set to True is not required. -Requires one of the following permissions: MANAGE_STAFF. +Added in Saleor 3.15. """ -type StaffCreate @doc(category: "Users") { - staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [StaffError!]! - user: User -} +type AccountConfirmationRequested implements Event @doc(category: "Users") { + """Time of the event.""" + issuedAt: DateTime -type StaffError @doc(category: "Users") { - """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - """ - field: String + """Saleor version that triggered the event.""" + version: String - """The error message.""" - message: String + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal - """The error code.""" - code: AccountErrorCode! + """The application receiving the webhook.""" + recipient: App - """A type of address that causes the error.""" - addressType: AddressTypeEnum + """The URL to redirect the user after he accepts the request.""" + redirectUrl: String - """List of permissions which causes the error.""" - permissions: [PermissionEnum!] + """The user the event relates to.""" + user: User - """List of permission group IDs which cause the error.""" - groups: [ID!] + """The channel data.""" + channel: Channel - """List of user IDs which causes the error.""" - users: [ID!] -} + """The token required to confirm request.""" + token: String -"""Fields required to create a staff user.""" -input StaffCreateInput @doc(category: "Users") { - """Given name.""" - firstName: String + """Shop data.""" + shop: Shop +} - """Family name.""" - lastName: String +""" +Event sent when account change email is requested. - """The unique email address of the user.""" - email: String +Added in Saleor 3.15. +""" +type AccountChangeEmailRequested implements Event @doc(category: "Users") { + """Time of the event.""" + issuedAt: DateTime - """User account is active.""" - isActive: Boolean + """Saleor version that triggered the event.""" + version: String - """A note about the user.""" - note: String + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal - """List of permission group IDs to which user should be assigned.""" - addGroups: [ID!] + """The application receiving the webhook.""" + recipient: App - """ - URL of a view where users should be redirected to set the password. URL in RFC 1808 format. - """ + """The URL to redirect the user after he accepts the request.""" redirectUrl: String + + """The user the event relates to.""" + user: User + + """The channel data.""" + channel: Channel + + """The token required to confirm request.""" + token: String + + """Shop data.""" + shop: Shop + + """The new email address the user wants to change to.""" + newEmail: String } """ -Updates an existing staff user. Apps are not allowed to perform this mutation. +Event sent when account email is changed. -Requires one of the following permissions: MANAGE_STAFF. +Added in Saleor 3.15. """ -type StaffUpdate @doc(category: "Users") { - staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [StaffError!]! - user: User -} +type AccountEmailChanged implements Event @doc(category: "Users") { + """Time of the event.""" + issuedAt: DateTime -"""Fields required to update a staff user.""" -input StaffUpdateInput @doc(category: "Users") { - """Given name.""" - firstName: String + """Saleor version that triggered the event.""" + version: String - """Family name.""" - lastName: String + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal - """The unique email address of the user.""" - email: String + """The application receiving the webhook.""" + recipient: App - """User account is active.""" - isActive: Boolean + """The URL to redirect the user after he accepts the request.""" + redirectUrl: String - """A note about the user.""" - note: String + """The user the event relates to.""" + user: User - """List of permission group IDs to which user should be assigned.""" - addGroups: [ID!] + """The channel data.""" + channel: Channel - """List of permission group IDs from which user should be unassigned.""" - removeGroups: [ID!] -} + """The token required to confirm request.""" + token: String -""" -Deletes a staff user. Apps are not allowed to perform this mutation. + """Shop data.""" + shop: Shop -Requires one of the following permissions: MANAGE_STAFF. -""" -type StaffDelete @doc(category: "Users") { - staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [StaffError!]! - user: User + """The new email address.""" + newEmail: String } """ -Deletes staff users. Apps are not allowed to perform this mutation. +Event sent when setting a new password is requested. -Requires one of the following permissions: MANAGE_STAFF. +Added in Saleor 3.15. """ -type StaffBulkDelete @doc(category: "Users") { - """Returns how many objects were affected.""" - count: Int! - staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [StaffError!]! -} +type AccountSetPasswordRequested implements Event @doc(category: "Users") { + """Time of the event.""" + issuedAt: DateTime -""" -Create a user avatar. Only for staff members. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec + """Saleor version that triggered the event.""" + version: String -Requires one of the following permissions: AUTHENTICATED_STAFF_USER. -""" -type UserAvatarUpdate @doc(category: "Users") { - """An updated user instance.""" - user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [AccountError!]! -} + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal -""" -Deletes a user avatar. Only for staff members. + """The application receiving the webhook.""" + recipient: App -Requires one of the following permissions: AUTHENTICATED_STAFF_USER. -""" -type UserAvatarDelete @doc(category: "Users") { - """An updated user instance.""" - user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [AccountError!]! -} + """The URL to redirect the user after he accepts the request.""" + redirectUrl: String -""" -Activate or deactivate users. + """The user the event relates to.""" + user: User -Requires one of the following permissions: MANAGE_USERS. -""" -type UserBulkSetActive @doc(category: "Users") { - """Returns how many objects were affected.""" - count: Int! - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [AccountError!]! + """The channel data.""" + channel: Channel + + """The token required to confirm request.""" + token: String + + """Shop data.""" + shop: Shop } """ -Create new permission group. Apps are not allowed to perform this mutation. +Event sent when account is confirmed. -Requires one of the following permissions: MANAGE_STAFF. +Added in Saleor 3.15. """ -type PermissionGroupCreate @doc(category: "Users") { - permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PermissionGroupError!]! - group: Group -} - -type PermissionGroupError @doc(category: "Users") { - """ - Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. - """ - field: String +type AccountConfirmed implements Event @doc(category: "Users") { + """Time of the event.""" + issuedAt: DateTime - """The error message.""" - message: String + """Saleor version that triggered the event.""" + version: String - """The error code.""" - code: PermissionGroupErrorCode! + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal - """List of permissions which causes the error.""" - permissions: [PermissionEnum!] + """The application receiving the webhook.""" + recipient: App - """List of user IDs which causes the error.""" - users: [ID!] -} + """The URL to redirect the user after he accepts the request.""" + redirectUrl: String -"""An enumeration.""" -enum PermissionGroupErrorCode @doc(category: "Users") { - ASSIGN_NON_STAFF_MEMBER - DUPLICATED_INPUT_ITEM - CANNOT_REMOVE_FROM_LAST_GROUP - LEFT_NOT_MANAGEABLE_PERMISSION - OUT_OF_SCOPE_PERMISSION - OUT_OF_SCOPE_USER - REQUIRED - UNIQUE -} + """The user the event relates to.""" + user: User -input PermissionGroupCreateInput @doc(category: "Users") { - """List of permission code names to assign to this group.""" - addPermissions: [PermissionEnum!] + """The channel data.""" + channel: Channel - """List of users to assign to this group.""" - addUsers: [ID!] + """The token required to confirm request.""" + token: String - """Group name.""" - name: String! + """Shop data.""" + shop: Shop } """ -Update permission group. Apps are not allowed to perform this mutation. +Event sent when account delete is requested. -Requires one of the following permissions: MANAGE_STAFF. +Added in Saleor 3.15. """ -type PermissionGroupUpdate @doc(category: "Users") { - permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PermissionGroupError!]! - group: Group -} +type AccountDeleteRequested implements Event @doc(category: "Users") { + """Time of the event.""" + issuedAt: DateTime -input PermissionGroupUpdateInput @doc(category: "Users") { - """List of permission code names to assign to this group.""" - addPermissions: [PermissionEnum!] + """Saleor version that triggered the event.""" + version: String - """List of users to assign to this group.""" - addUsers: [ID!] + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal - """Group name.""" - name: String + """The application receiving the webhook.""" + recipient: App - """List of permission code names to unassign from this group.""" - removePermissions: [PermissionEnum!] + """The URL to redirect the user after he accepts the request.""" + redirectUrl: String - """List of users to unassign from this group.""" - removeUsers: [ID!] -} + """The user the event relates to.""" + user: User -""" -Delete permission group. Apps are not allowed to perform this mutation. + """The channel data.""" + channel: Channel -Requires one of the following permissions: MANAGE_STAFF. -""" -type PermissionGroupDelete @doc(category: "Users") { - permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") - errors: [PermissionGroupError!]! - group: Group -} + """The token required to confirm request.""" + token: String -type Subscription { - """ - Look up subscription event. - - Added in Saleor 3.2. - """ - event: Event + """Shop data.""" + shop: Shop } -interface Event { +""" +Event sent when account is deleted. + +Added in Saleor 3.15. +""" +type AccountDeleted implements Event @doc(category: "Users") { """Time of the event.""" issuedAt: DateTime @@ -25760,46 +32473,22 @@ interface Event { issuingPrincipal: IssuingPrincipal """The application receiving the webhook.""" - recipient: App @doc(category: "Apps") -} + recipient: App -union IssuingPrincipal = App | User + """The URL to redirect the user after he accepts the request.""" + redirectUrl: String -"""An enumeration.""" -enum DistanceUnitsEnum { - CM - M - KM - FT - YD - INCH -} + """The user the event relates to.""" + user: User -"""An enumeration.""" -enum AreaUnitsEnum { - SQ_CM - SQ_M - SQ_KM - SQ_FT - SQ_YD - SQ_INCH -} + """The channel data.""" + channel: Channel -"""An enumeration.""" -enum VolumeUnitsEnum { - CUBIC_MILLIMETER - CUBIC_CENTIMETER - CUBIC_DECIMETER - CUBIC_METER - LITER - CUBIC_FOOT - CUBIC_INCH - CUBIC_YARD - QT - PINT - FL_OZ - ACRE_IN - ACRE_FT + """The token required to confirm request.""" + token: String + + """Shop data.""" + shop: Shop } """ @@ -26242,6 +32931,28 @@ type ChannelStatusChanged implements Event @doc(category: "Channels") { channel: Channel } +""" +Event sent when channel metadata is updated. + +Added in Saleor 3.15. +""" +type ChannelMetadataUpdated implements Event @doc(category: "Channels") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The channel the event relates to.""" + channel: Channel +} + """ Event sent when new gift card is created. @@ -26382,6 +33093,28 @@ type GiftCardMetadataUpdated implements Event @doc(category: "Gift cards") { giftCard: GiftCard } +""" +Event sent when gift card export is completed. + +Added in Saleor 3.16. +""" +type GiftCardExportCompleted implements Event @doc(category: "Gift cards") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The export file for gift cards.""" + export: ExportFile +} + """ Event sent when new menu is created. @@ -26508,11 +33241,80 @@ type MenuItemUpdated implements Event @doc(category: "Menu") { } """ -Event sent when menu item is deleted. +Event sent when menu item is deleted. + +Added in Saleor 3.4. +""" +type MenuItemDeleted implements Event @doc(category: "Menu") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The menu item the event relates to.""" + menuItem( + """Slug of a channel for which the data should be returned.""" + channel: String + ): MenuItem +} + +""" +Event sent when new order is created. + +Added in Saleor 3.2. +""" +type OrderCreated implements Event @doc(category: "Orders") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The order the event relates to.""" + order: Order +} + +""" +Event sent when order is updated. + +Added in Saleor 3.2. +""" +type OrderUpdated implements Event @doc(category: "Orders") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The order the event relates to.""" + order: Order +} + +""" +Event sent when order is confirmed. -Added in Saleor 3.4. +Added in Saleor 3.2. """ -type MenuItemDeleted implements Event @doc(category: "Menu") { +type OrderConfirmed implements Event @doc(category: "Orders") { """Time of the event.""" issuedAt: DateTime @@ -26525,19 +33327,16 @@ type MenuItemDeleted implements Event @doc(category: "Menu") { """The application receiving the webhook.""" recipient: App - """The menu item the event relates to.""" - menuItem( - """Slug of a channel for which the data should be returned.""" - channel: String - ): MenuItem + """The order the event relates to.""" + order: Order } """ -Event sent when new order is created. +Event sent when order is fully paid. Added in Saleor 3.2. """ -type OrderCreated implements Event @doc(category: "Orders") { +type OrderFullyPaid implements Event @doc(category: "Orders") { """Time of the event.""" issuedAt: DateTime @@ -26555,11 +33354,13 @@ type OrderCreated implements Event @doc(category: "Orders") { } """ -Event sent when order is updated. +Payment has been made. The order may be partially or fully paid. -Added in Saleor 3.2. +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. """ -type OrderUpdated implements Event @doc(category: "Orders") { +type OrderPaid implements Event @doc(category: "Orders") { """Time of the event.""" issuedAt: DateTime @@ -26577,11 +33378,13 @@ type OrderUpdated implements Event @doc(category: "Orders") { } """ -Event sent when order is confirmed. +The order received a refund. The order may be partially or fully refunded. -Added in Saleor 3.2. +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. """ -type OrderConfirmed implements Event @doc(category: "Orders") { +type OrderRefunded implements Event @doc(category: "Orders") { """Time of the event.""" issuedAt: DateTime @@ -26599,11 +33402,13 @@ type OrderConfirmed implements Event @doc(category: "Orders") { } """ -Event sent when order is fully paid. +The order is fully refunded. -Added in Saleor 3.2. +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. """ -type OrderFullyPaid implements Event @doc(category: "Orders") { +type OrderFullyRefunded implements Event @doc(category: "Orders") { """Time of the event.""" issuedAt: DateTime @@ -26710,6 +33515,30 @@ type OrderMetadataUpdated implements Event @doc(category: "Orders") { order: Order } +""" +Event sent when orders are imported. + +Added in Saleor 3.14. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type OrderBulkCreated implements Event @doc(category: "Orders") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The orders the event relates to.""" + orders: [Order!] +} + """ Event sent when new draft order is created. @@ -26888,6 +33717,28 @@ type ProductMetadataUpdated implements Event @doc(category: "Products") { category: Category } +""" +Event sent when product export is completed. + +Added in Saleor 3.16. +""" +type ProductExportCompleted implements Event @doc(category: "Products") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The export file for products.""" + export: ExportFile +} + """ Event sent when new product media is created. @@ -27144,6 +33995,8 @@ type ProductVariantMetadataUpdated implements Event @doc(category: "Products") { Event sent when new sale is created. Added in Saleor 3.2. + +DEPRECATED: this event will be removed in Saleor 4.0. Use `PromotionCreated` event instead. """ type SaleCreated implements Event @doc(category: "Discounts") { """Time of the event.""" @@ -27169,6 +34022,8 @@ type SaleCreated implements Event @doc(category: "Discounts") { Event sent when sale is updated. Added in Saleor 3.2. + +DEPRECATED: this event will be removed in Saleor 4.0. Use `PromotionUpdated` event instead. """ type SaleUpdated implements Event @doc(category: "Discounts") { """Time of the event.""" @@ -27194,6 +34049,8 @@ type SaleUpdated implements Event @doc(category: "Discounts") { Event sent when sale is deleted. Added in Saleor 3.2. + +DEPRECATED: this event will be removed in Saleor 4.0. Use `PromotionDeleted` event instead. """ type SaleDeleted implements Event @doc(category: "Discounts") { """Time of the event.""" @@ -27219,6 +34076,8 @@ type SaleDeleted implements Event @doc(category: "Discounts") { The event informs about the start or end of the sale. Added in Saleor 3.5. + +DEPRECATED: this event will be removed in Saleor 4.0. Use `PromotionStarted` and `PromotionEnded` events instead. """ type SaleToggle implements Event @doc(category: "Discounts") { """Time of the event.""" @@ -27244,6 +34103,198 @@ type SaleToggle implements Event @doc(category: "Discounts") { ): Sale } +""" +Event sent when new promotion is created. + +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionCreated implements Event @doc(category: "Discounts") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The promotion the event relates to.""" + promotion: Promotion +} + +""" +Event sent when promotion is updated. + +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionUpdated implements Event @doc(category: "Discounts") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The promotion the event relates to.""" + promotion: Promotion +} + +""" +Event sent when promotion is deleted. + +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionDeleted implements Event @doc(category: "Discounts") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The promotion the event relates to.""" + promotion: Promotion +} + +""" +The event informs about the start of the promotion. + +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionStarted implements Event @doc(category: "Discounts") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The promotion the event relates to.""" + promotion: Promotion +} + +""" +The event informs about the end of the promotion. + +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionEnded implements Event @doc(category: "Discounts") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The promotion the event relates to.""" + promotion: Promotion +} + +""" +Event sent when new promotion rule is created. + +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionRuleCreated implements Event @doc(category: "Discounts") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The promotion rule the event relates to.""" + promotionRule: PromotionRule +} + +""" +Event sent when new promotion rule is updated. + +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionRuleUpdated implements Event @doc(category: "Discounts") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The promotion rule the event relates to.""" + promotionRule: PromotionRule +} + +""" +Event sent when new promotion rule is deleted. + +Added in Saleor 3.17. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PromotionRuleDeleted implements Event @doc(category: "Discounts") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The promotion rule the event relates to.""" + promotionRule: PromotionRule +} + """ Event sent when invoice is requested. @@ -27324,19 +34375,51 @@ type InvoiceSent implements Event @doc(category: "Orders") { invoice: Invoice """ - Order related to the invoice. + Order related to the invoice. + + Added in Saleor 3.10. + """ + order: Order +} + +""" +Event sent when new fulfillment is created. + +Added in Saleor 3.4. +""" +type FulfillmentCreated implements Event @doc(category: "Orders") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The fulfillment the event relates to.""" + fulfillment: Fulfillment + + """The order the fulfillment belongs to.""" + order: Order + + """ + If true, the app should send a notification to the customer. - Added in Saleor 3.10. + Added in Saleor 3.16. """ - order: Order + notifyCustomer: Boolean! } """ -Event sent when new fulfillment is created. +Event sent when the tracking number is updated. -Added in Saleor 3.4. +Added in Saleor 3.16. """ -type FulfillmentCreated implements Event @doc(category: "Orders") { +type FulfillmentTrackingNumberUpdated implements Event @doc(category: "Orders") { """Time of the event.""" issuedAt: DateTime @@ -27404,6 +34487,13 @@ type FulfillmentApproved implements Event @doc(category: "Orders") { """The order the fulfillment belongs to.""" order: Order + + """ + If true, send a notification to the customer. + + Added in Saleor 3.16. + """ + notifyCustomer: Boolean! } """ @@ -28145,13 +35235,11 @@ type StaffDeleted implements Event @doc(category: "Users") { } """ -Event sent when transaction action is requested. - -Added in Saleor 3.4. +Event sent when setting a new password for staff is requested. -DEPRECATED: this subscription will be removed in Saleor 3.14 (Preview Feature). Use `TransactionChargeRequested`, `TransactionRefundRequested`, `TransactionCancelationRequested` instead. +Added in Saleor 3.15. """ -type TransactionActionRequest implements Event @doc(category: "Payments") { +type StaffSetPasswordRequested implements Event @doc(category: "Users") { """Time of the event.""" issuedAt: DateTime @@ -28164,19 +35252,20 @@ type TransactionActionRequest implements Event @doc(category: "Payments") { """The application receiving the webhook.""" recipient: App - """Look up a transaction.""" - transaction: TransactionItem + """The URL to redirect the user after he accepts the request.""" + redirectUrl: String - """Requested action data.""" - action: TransactionAction! -} + """The user the event relates to.""" + user: User -type TransactionAction @doc(category: "Payments") { - """Determines the action type.""" - actionType: TransactionActionEnum! + """The channel data.""" + channel: Channel - """Transaction request amount. Null when action type is VOID.""" - amount: PositiveDecimal + """The token required to confirm request.""" + token: String + + """Shop data.""" + shop: Shop } """ @@ -28206,7 +35295,7 @@ Event sent when new translation is created. Added in Saleor 3.2. """ -type TranslationCreated implements Event { +type TranslationCreated implements Event @doc(category: "Miscellaneous") { """Time of the event.""" issuedAt: DateTime @@ -28223,14 +35312,14 @@ type TranslationCreated implements Event { translation: TranslationTypes } -union TranslationTypes = ProductTranslation | CollectionTranslation | CategoryTranslation | AttributeTranslation | AttributeValueTranslation | ProductVariantTranslation | PageTranslation | ShippingMethodTranslation | SaleTranslation | VoucherTranslation | MenuItemTranslation +union TranslationTypes = ProductTranslation | CollectionTranslation | CategoryTranslation | AttributeTranslation | AttributeValueTranslation | ProductVariantTranslation | PageTranslation | ShippingMethodTranslation | VoucherTranslation | MenuItemTranslation | PromotionTranslation | PromotionRuleTranslation | SaleTranslation """ Event sent when translation is updated. Added in Saleor 3.2. """ -type TranslationUpdated implements Event { +type TranslationUpdated implements Event @doc(category: "Miscellaneous") { """Time of the event.""" issuedAt: DateTime @@ -28322,6 +35411,50 @@ type VoucherDeleted implements Event @doc(category: "Discounts") { ): Voucher } +""" +Event sent when new voucher codes were created. + +Added in Saleor 3.19. +""" +type VoucherCodesCreated implements Event { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The voucher codes the event relates to.""" + voucherCodes: [VoucherCode!] +} + +""" +Event sent when voucher codes were deleted. + +Added in Saleor 3.19. +""" +type VoucherCodesDeleted implements Event { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The voucher codes the event relates to.""" + voucherCodes: [VoucherCode!] +} + """ Event sent when voucher metadata is updated. @@ -28347,6 +35480,28 @@ type VoucherMetadataUpdated implements Event @doc(category: "Discounts") { ): Voucher } +""" +Event sent when voucher code export is completed. + +Added in Saleor 3.18. +""" +type VoucherCodeExportCompleted implements Event @doc(category: "Discounts") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The export file for voucher codes.""" + export: ExportFile +} + """ Event sent when new warehouse is created. @@ -28440,7 +35595,7 @@ Event sent when thumbnail is created. Added in Saleor 3.12. """ -type ThumbnailCreated implements Event { +type ThumbnailCreated implements Event @doc(category: "Miscellaneous") { """Time of the event.""" issuedAt: DateTime @@ -28663,6 +35818,21 @@ type TransactionCancelationRequested implements Event @doc(category: "Payments") action: TransactionAction! } +type TransactionAction @doc(category: "Payments") { + """Determines the action type.""" + actionType: TransactionActionEnum! + + """Transaction request amount. Null when action type is VOID.""" + amount: PositiveDecimal + + """ + Currency code. + + Added in Saleor 3.16. + """ + currency: String! +} + """ Event sent when transaction charge is requested. @@ -28715,6 +35885,15 @@ type TransactionRefundRequested implements Event @doc(category: "Payments") { """Requested action data.""" action: TransactionAction! + + """ + Granted refund related to refund request. + + Added in Saleor 3.15. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + grantedRefund: OrderGrantedRefund } """ @@ -28909,7 +36088,7 @@ type PaymentGatewayInitializeSession implements Event @doc(category: "Payments") """Checkout or order""" sourceObject: OrderOrCheckout! - """Payment gateway data in JSON format, recieved from storefront.""" + """Payment gateway data in JSON format, received from storefront.""" data: JSON """Amount requested for initializing the payment gateway.""" @@ -28944,14 +36123,28 @@ type TransactionInitializeSession implements Event @doc(category: "Payments") { """Checkout or order""" sourceObject: OrderOrCheckout! - """Payment gateway data in JSON format, recieved from storefront.""" + """Payment gateway data in JSON format, received from storefront.""" data: JSON """Merchant reference assigned to this payment.""" merchantReference: String! + """ + The customer's IP address. If not provided as a parameter in the mutation, Saleor will try to determine the customer's IP address on its own. + + Added in Saleor 3.16. + """ + customerIpAddress: String + """Action to proceed for the transaction""" action: TransactionProcessAction! + + """ + Idempotency key assigned to the transaction initialize. + + Added in Saleor 3.14. + """ + idempotencyKey: String! } type TransactionProcessAction @doc(category: "Payments") { @@ -28989,16 +36182,206 @@ type TransactionProcessSession implements Event @doc(category: "Payments") { """Checkout or order""" sourceObject: OrderOrCheckout! - """Payment gateway data in JSON format, recieved from storefront.""" + """Payment gateway data in JSON format, received from storefront.""" data: JSON """Merchant reference assigned to this payment.""" merchantReference: String! + """ + The customer's IP address. If not provided as a parameter in the mutation, Saleor will try to determine the customer's IP address on its own. + + Added in Saleor 3.16. + """ + customerIpAddress: String + """Action to proceed for the transaction""" action: TransactionProcessAction! } +""" +Event sent when shop metadata is updated. + +Added in Saleor 3.15. +""" +type ShopMetadataUpdated implements Event { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """Shop data.""" + shop: Shop +} + +""" +List payment methods stored for the user by payment gateway. + +Added in Saleor 3.15. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type ListStoredPaymentMethods implements Event @doc(category: "Payments") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The user for which the app should return a list of payment methods.""" + user: User! + + """ + Channel in context which was used to fetch the list of payment methods. + """ + channel: Channel! +} + +""" +Event sent when user requests to delete a payment method. + +Added in Saleor 3.16. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type StoredPaymentMethodDeleteRequested implements Event @doc(category: "Payments") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """ + The user for which the app should proceed with payment method delete request. + """ + user: User! + + """ + The ID of the payment method that should be deleted by the payment gateway. + """ + paymentMethodId: String! + + """Channel related to the requested delete action.""" + channel: Channel! +} + +""" +Event sent to initialize a new session in payment gateway to store the payment method. + +Added in Saleor 3.16. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PaymentGatewayInitializeTokenizationSession implements Event @doc(category: "Payments") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The user related to the requested action.""" + user: User! + + """Channel related to the requested action.""" + channel: Channel! + + """Payment gateway data in JSON format, received from storefront.""" + data: JSON +} + +""" +Event sent when user requests a tokenization of payment method. + +Added in Saleor 3.16. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PaymentMethodInitializeTokenizationSession implements Event @doc(category: "Payments") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The user related to the requested action.""" + user: User! + + """Channel related to the requested action.""" + channel: Channel! + + """Payment gateway data in JSON format, received from storefront.""" + data: JSON + + """The payment flow that the tokenized payment method should support.""" + paymentFlowToSupport: TokenizedPaymentFlowEnum! +} + +""" +Event sent when user continues a tokenization of payment method. + +Added in Saleor 3.16. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type PaymentMethodProcessTokenizationSession implements Event @doc(category: "Payments") { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The user related to the requested action.""" + user: User! + + """Channel related to the requested action.""" + channel: Channel! + + """Payment gateway data in JSON format, received from storefront.""" + data: JSON + + """ + The ID returned by app from `PAYMENT_METHOD_INITIALIZE_TOKENIZATION_SESSION` webhook. + """ + id: String! +} + """_Any value scalar as defined by Federation spec.""" scalar _Any diff --git a/graphql/subscriptions/.gitkeep b/graphql/subscriptions/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/package.json b/package.json index 5ea9ad9..2e69650 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "github:release": "pnpm changeset tag && git push --follow-tags" }, "saleor": { - "schemaVersion": "3.13" + "schemaVersion": "3.19" }, "dependencies": { "@hookform/resolvers": "3.3.0", From ead6c5190360c4c73da2b17e5a5230bf5e725534 Mon Sep 17 00:00:00 2001 From: Adrian Pilarczyk Date: Thu, 18 Apr 2024 12:57:21 +0200 Subject: [PATCH 06/37] add basic setup for ListStoredPaymentMethods --- .../ListStoredPaymentMethodsEvent.graphql | 10 +++ .../ListStoredPaymentMethods.graphql | 5 ++ .../gateways/accept-hosted-gateway.ts | 2 +- .../gateways/accept-js-gateway.ts | 20 +++++- .../gateways/apple-pay-gateway.ts | 2 +- .../authorize-net/gateways/payment-gateway.ts | 24 +++++++ .../authorize-net/gateways/paypal-gateway.ts | 2 +- .../webhooks/list-stored-payment-methods.ts | 22 ++++++ .../payment-gateway-initialize-session.ts | 21 +----- .../webhooks/webhook-manager-service.ts | 14 ++++ .../webhooks/list-stored-payment-methods.ts | 71 +++++++++++++++++++ ...stStoredPaymentMethodsResponse.schema.json | 54 ++++++++++++++ 12 files changed, 223 insertions(+), 24 deletions(-) create mode 100644 graphql/fragments/ListStoredPaymentMethodsEvent.graphql create mode 100644 graphql/subscriptions/ListStoredPaymentMethods.graphql create mode 100644 src/modules/authorize-net/gateways/payment-gateway.ts create mode 100644 src/modules/webhooks/list-stored-payment-methods.ts create mode 100644 src/pages/api/webhooks/list-stored-payment-methods.ts create mode 100644 src/schemas/ListStoredPaymentMethods/ListStoredPaymentMethodsResponse.schema.json diff --git a/graphql/fragments/ListStoredPaymentMethodsEvent.graphql b/graphql/fragments/ListStoredPaymentMethodsEvent.graphql new file mode 100644 index 0000000..191be90 --- /dev/null +++ b/graphql/fragments/ListStoredPaymentMethodsEvent.graphql @@ -0,0 +1,10 @@ +fragment ListStoredPaymentMethodsEvent on ListStoredPaymentMethods { + __typename + issuingPrincipal { + __typename + ... on App { + id + name + } + } +} diff --git a/graphql/subscriptions/ListStoredPaymentMethods.graphql b/graphql/subscriptions/ListStoredPaymentMethods.graphql new file mode 100644 index 0000000..591015f --- /dev/null +++ b/graphql/subscriptions/ListStoredPaymentMethods.graphql @@ -0,0 +1,5 @@ +subscription ListStoredPaymentMethods { + event { + ...ListStoredPaymentMethodsEvent + } +} diff --git a/src/modules/authorize-net/gateways/accept-hosted-gateway.ts b/src/modules/authorize-net/gateways/accept-hosted-gateway.ts index 95d419f..a6fc085 100644 --- a/src/modules/authorize-net/gateways/accept-hosted-gateway.ts +++ b/src/modules/authorize-net/gateways/accept-hosted-gateway.ts @@ -21,7 +21,7 @@ import { import { IncorrectWebhookResponseDataError } from "@/errors"; import { env } from "@/lib/env.mjs"; import { createLogger } from "@/lib/logger"; -import { type PaymentGateway } from "@/modules/webhooks/payment-gateway-initialize-session"; +import { type PaymentGateway } from "@/modules/authorize-net/gateways/payment-gateway"; import { type TransactionInitializeSessionResponse } from "@/schemas/TransactionInitializeSession/TransactionInitializeSessionResponse.mjs"; const ApiContracts = AuthorizeNet.APIContracts; diff --git a/src/modules/authorize-net/gateways/accept-js-gateway.ts b/src/modules/authorize-net/gateways/accept-js-gateway.ts index ef2e98f..356e823 100644 --- a/src/modules/authorize-net/gateways/accept-js-gateway.ts +++ b/src/modules/authorize-net/gateways/accept-js-gateway.ts @@ -15,7 +15,10 @@ import { import { IncorrectWebhookResponseDataError } from "@/errors"; import { createLogger } from "@/lib/logger"; -import { type PaymentGateway } from "@/modules/webhooks/payment-gateway-initialize-session"; +import { + type AppPaymentMethod, + type PaymentGateway, +} from "@/modules/authorize-net/gateways/payment-gateway"; import { type TransactionInitializeSessionResponse } from "@/schemas/TransactionInitializeSession/TransactionInitializeSessionResponse.mjs"; export const acceptJsPaymentGatewayDataSchema = z.object({}); @@ -132,4 +135,19 @@ export class AcceptJsGateway implements PaymentGateway { data, }; } + + async listStoredPaymentMethods(): Promise { + // START: Get stored payment methods for Accept.js flow + + // END + + return { + id: "", + type: "acceptJs", + data: { + // Add fields specific to Accept.js gateway + }, + supportedPaymentFlows: [], + }; + } } diff --git a/src/modules/authorize-net/gateways/apple-pay-gateway.ts b/src/modules/authorize-net/gateways/apple-pay-gateway.ts index 771a94d..abd9b13 100644 --- a/src/modules/authorize-net/gateways/apple-pay-gateway.ts +++ b/src/modules/authorize-net/gateways/apple-pay-gateway.ts @@ -5,7 +5,7 @@ import { CreateTransactionClient } from "../client/create-transaction"; import { gatewayUtils } from "./gateway-utils"; import { IncorrectWebhookPayloadDataError } from "@/errors"; import { createLogger } from "@/lib/logger"; -import { type PaymentGateway } from "@/modules/webhooks/payment-gateway-initialize-session"; +import { type PaymentGateway } from "@/modules/authorize-net/gateways/payment-gateway"; import { type TransactionInitializeSessionResponse } from "@/schemas/TransactionInitializeSession/TransactionInitializeSessionResponse.mjs"; import { type PaymentGatewayInitializeSessionEventFragment, diff --git a/src/modules/authorize-net/gateways/payment-gateway.ts b/src/modules/authorize-net/gateways/payment-gateway.ts new file mode 100644 index 0000000..1aa7573 --- /dev/null +++ b/src/modules/authorize-net/gateways/payment-gateway.ts @@ -0,0 +1,24 @@ +import { type ListStoredPaymentMethodsResponse } from "@/schemas/ListStoredPaymentMethods/ListStoredPaymentMethodsResponse.mjs"; +import { type PaymentGatewayInitializeSessionResponse } from "@/schemas/PaymentGatewayInitializeSession/PaymentGatewayInitializeSessionResponse.mjs"; +import { type TransactionInitializeSessionResponse } from "@/schemas/TransactionInitializeSession/TransactionInitializeSessionResponse.mjs"; +import { + type PaymentGatewayInitializeSessionEventFragment, + type TransactionInitializeSessionEventFragment, +} from "generated/graphql"; + +export type AppPaymentMethod = ListStoredPaymentMethodsResponse["paymentMethods"][0]; +/** + * PaymentGatewayInitialize will return the list of payment gateways. One of them will be Accept Hosted. + * The Accept Hosted payment flow differs from the other payment gateways. The Authorize transaction is created inside the Accept Hosted payment form. + * The other payment gateways require the TransactionInitializeSession webhook to create the Authorize transaction. + */ + +export interface PaymentGateway { + initializePaymentGateway( + payload: PaymentGatewayInitializeSessionEventFragment, + ): Promise; + initializeTransaction( + payload: TransactionInitializeSessionEventFragment, + ): Promise; + listStoredPaymentMethods?(): Promise; +} diff --git a/src/modules/authorize-net/gateways/paypal-gateway.ts b/src/modules/authorize-net/gateways/paypal-gateway.ts index 9e2238c..6d64ff5 100644 --- a/src/modules/authorize-net/gateways/paypal-gateway.ts +++ b/src/modules/authorize-net/gateways/paypal-gateway.ts @@ -3,7 +3,7 @@ import { z } from "zod"; import { CreateTransactionClient } from "../client/create-transaction"; import { authorizeTransaction } from "../authorize-transaction-builder"; import { gatewayUtils } from "./gateway-utils"; -import { type PaymentGateway } from "@/modules/webhooks/payment-gateway-initialize-session"; +import { type PaymentGateway } from "@/modules/authorize-net/gateways/payment-gateway"; import { type TransactionInitializeSessionResponse } from "@/schemas/TransactionInitializeSession/TransactionInitializeSessionResponse.mjs"; import { type PaymentGatewayInitializeSessionEventFragment, diff --git a/src/modules/webhooks/list-stored-payment-methods.ts b/src/modules/webhooks/list-stored-payment-methods.ts new file mode 100644 index 0000000..c6a01bb --- /dev/null +++ b/src/modules/webhooks/list-stored-payment-methods.ts @@ -0,0 +1,22 @@ +import { AcceptJsGateway } from "../authorize-net/gateways/accept-js-gateway"; +import { type ListStoredPaymentMethodsEventFragment } from "generated/graphql"; + +import { createLogger } from "@/lib/logger"; +import { type ListStoredPaymentMethodsResponse } from "@/schemas/ListStoredPaymentMethods/ListStoredPaymentMethodsResponse.mjs"; + +export class ListStoredPaymentMethodsService { + private logger = createLogger({ + name: "ListStoredPaymentMethodsService", + }); + + async execute( + _payload: ListStoredPaymentMethodsEventFragment, + ): Promise { + const acceptJs = new AcceptJsGateway(); + const paymentMethods = await Promise.all([acceptJs.listStoredPaymentMethods()]); + + return { + paymentMethods, + }; + } +} diff --git a/src/modules/webhooks/payment-gateway-initialize-session.ts b/src/modules/webhooks/payment-gateway-initialize-session.ts index fc97c86..e9f641b 100644 --- a/src/modules/webhooks/payment-gateway-initialize-session.ts +++ b/src/modules/webhooks/payment-gateway-initialize-session.ts @@ -1,26 +1,7 @@ import { AcceptHostedGateway } from "../authorize-net/gateways/accept-hosted-gateway"; import { AcceptJsGateway } from "../authorize-net/gateways/accept-js-gateway"; import { type PaymentGatewayInitializeSessionData } from "@/pages/api/webhooks/payment-gateway-initialize-session"; -import { type PaymentGatewayInitializeSessionResponse } from "@/schemas/PaymentGatewayInitializeSession/PaymentGatewayInitializeSessionResponse.mjs"; -import { type TransactionInitializeSessionResponse } from "@/schemas/TransactionInitializeSession/TransactionInitializeSessionResponse.mjs"; -import { - type PaymentGatewayInitializeSessionEventFragment, - type TransactionInitializeSessionEventFragment, -} from "generated/graphql"; - -/** - * PaymentGatewayInitialize will return the list of payment gateways. One of them will be Accept Hosted. - * The Accept Hosted payment flow differs from the other payment gateways. The Authorize transaction is created inside the Accept Hosted payment form. - * The other payment gateways require the TransactionInitializeSession webhook to create the Authorize transaction. - */ -export interface PaymentGateway { - initializePaymentGateway( - payload: PaymentGatewayInitializeSessionEventFragment, - ): Promise; - initializeTransaction( - payload: TransactionInitializeSessionEventFragment, - ): Promise; -} +import { type PaymentGatewayInitializeSessionEventFragment } from "generated/graphql"; export class PaymentGatewayInitializeSessionService { async execute( diff --git a/src/modules/webhooks/webhook-manager-service.ts b/src/modules/webhooks/webhook-manager-service.ts index 3a653c1..48ae111 100644 --- a/src/modules/webhooks/webhook-manager-service.ts +++ b/src/modules/webhooks/webhook-manager-service.ts @@ -8,6 +8,7 @@ import { TransactionRefundRequestedService } from "./transaction-refund-requeste import { PaymentGatewayInitializeSessionService } from "./payment-gateway-initialize-session"; import { TransactionInitializeSessionService } from "./transaction-initialize-session"; +import { ListStoredPaymentMethodsService } from "./list-stored-payment-methods"; import { createServerClient } from "@/lib/create-graphq-client"; import { type PaymentGatewayInitializeSessionResponse } from "@/pages/api/webhooks/payment-gateway-initialize-session"; import { type TransactionCancelationRequestedResponse } from "@/schemas/TransactionCancelationRequested/TransactionCancelationRequestedResponse.mjs"; @@ -15,12 +16,14 @@ import { type TransactionInitializeSessionResponse } from "@/schemas/Transaction import { type TransactionProcessSessionResponse } from "@/schemas/TransactionProcessSession/TransactionProcessSessionResponse.mjs"; import { type TransactionRefundRequestedResponse } from "@/schemas/TransactionRefundRequested/TransactionRefundRequestedResponse.mjs"; import { + type ListStoredPaymentMethodsEventFragment, type PaymentGatewayInitializeSessionEventFragment, type TransactionCancelationRequestedEventFragment, type TransactionInitializeSessionEventFragment, type TransactionProcessSessionEventFragment, type TransactionRefundRequestedEventFragment, } from "generated/graphql"; +import { type ListStoredPaymentMethodsResponse } from "@/schemas/ListStoredPaymentMethods/ListStoredPaymentMethodsResponse.mjs"; export interface PaymentsWebhooks { transactionInitializeSession: ( @@ -32,6 +35,9 @@ export interface PaymentsWebhooks { transactionCancelationRequested: ( payload: TransactionCancelationRequestedEventFragment, ) => Promise; + listStoredPaymentMethods: ( + payload: ListStoredPaymentMethodsEventFragment, + ) => Promise; } export class AppWebhookManager implements PaymentsWebhooks { @@ -41,6 +47,14 @@ export class AppWebhookManager implements PaymentsWebhooks { this.apiClient = apiClient; } + async listStoredPaymentMethods( + payload: ListStoredPaymentMethodsEventFragment, + ): Promise { + const service = new ListStoredPaymentMethodsService(); + + return service.execute(payload); + } + async transactionInitializeSession( payload: TransactionInitializeSessionEventFragment, ): Promise { diff --git a/src/pages/api/webhooks/list-stored-payment-methods.ts b/src/pages/api/webhooks/list-stored-payment-methods.ts new file mode 100644 index 0000000..38f98c9 --- /dev/null +++ b/src/pages/api/webhooks/list-stored-payment-methods.ts @@ -0,0 +1,71 @@ +import { SaleorSyncWebhook } from "@saleor/app-sdk/handlers/next"; +import { createLogger } from "@/lib/logger"; +import { SynchronousWebhookResponseBuilder } from "@/lib/webhook-response-builder"; + +import { getAuthorizeConfig } from "@/modules/authorize-net/authorize-net-config"; +import { AuthorizeWebhookManager } from "@/modules/authorize-net/webhook/authorize-net-webhook-manager"; +import { createAppWebhookManager } from "@/modules/webhooks/webhook-manager-service"; +import { errorUtils } from "@/error-utils"; +import { saleorApp } from "@/saleor-app"; +import { type ListStoredPaymentMethodsResponse } from "@/schemas/ListStoredPaymentMethods/ListStoredPaymentMethodsResponse.mjs"; +import { + UntypedListStoredPaymentMethodsDocument, + type ListStoredPaymentMethodsEventFragment, +} from "generated/graphql"; + +export const config = { + api: { + bodyParser: false, + }, +}; + +export const listStoredPaymentMethodsSyncWebhook = + new SaleorSyncWebhook({ + name: "ListStoredPaymentMethods", + apl: saleorApp.apl, + event: "TRANSACTION_REFUND_REQUESTED", + query: UntypedListStoredPaymentMethodsDocument, + webhookPath: "/api/webhooks/list-stored-payment-methods", + }); + +const logger = createLogger({ + name: "listStoredPaymentMethodsSyncWebhook", +}); + +class WebhookResponseBuilder extends SynchronousWebhookResponseBuilder {} + +export default listStoredPaymentMethodsSyncWebhook.createHandler( + async (req, res, { authData, ...ctx }) => { + const responseBuilder = new WebhookResponseBuilder(res); + logger.debug({ payload: ctx.payload }, "handler called"); + + try { + const authorizeConfig = getAuthorizeConfig(); + const authorizeWebhookManager = new AuthorizeWebhookManager({ + appConfig: authorizeConfig, + }); + + await authorizeWebhookManager.register(); + + const appWebhookManager = await createAppWebhookManager({ + authData, + authorizeConfig, + }); + + const response = await appWebhookManager.listStoredPaymentMethods(ctx.payload); + // eslint-disable-next-line @saleor/saleor-app/logger-leak + logger.info({ response }, "Responding with:"); + return responseBuilder.ok(response); + } catch (error) { + const normalizedError = errorUtils.normalize(error); + errorUtils.capture(normalizedError); + logger.error(normalizedError); + + return responseBuilder.internalServerError({ + // TODO: make sure this is the right method + message: normalizedError.message, + name: normalizedError.name, + }); + } + }, +); diff --git a/src/schemas/ListStoredPaymentMethods/ListStoredPaymentMethodsResponse.schema.json b/src/schemas/ListStoredPaymentMethods/ListStoredPaymentMethodsResponse.schema.json new file mode 100644 index 0000000..1347ae1 --- /dev/null +++ b/src/schemas/ListStoredPaymentMethods/ListStoredPaymentMethodsResponse.schema.json @@ -0,0 +1,54 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "type": "object", + "properties": { + "paymentMethods": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "supportedPaymentFlows": { + "type": "array", + "items": { + "type": "string", + "enum": ["INTERACTIVE"] + } + }, + "type": { + "type": "string" + }, + "creditCardInfo": { + "type": "object", + "properties": { + "brand": { + "type": "string" + }, + "lastDigits": { + "type": "string" + }, + "expMonth": { + "type": "string" + }, + "expYear": { + "type": "string" + }, + "firstDigits": { + "type": "string" + } + }, + "required": ["brand", "lastDigits", "expMonth", "expYear"] + }, + "name": { + "type": "string" + }, + "data": {} + }, + "required": ["id", "supportedPaymentFlows", "type"] + } + } + }, + "required": ["paymentMethods"] +} From 537588ef53a03d3e4a5b5773c0c61fe076597812 Mon Sep 17 00:00:00 2001 From: Adrian Pilarczyk Date: Fri, 19 Apr 2024 13:05:35 +0200 Subject: [PATCH 07/37] fix wrong webhook name --- package.json | 2 +- pnpm-lock.yaml | 250 +++++++++++++++++- src/pages/api/manifest.ts | 2 + .../webhooks/list-stored-payment-methods.ts | 2 +- 4 files changed, 241 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 2e69650..e5f3f2f 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@hookform/resolvers": "3.3.0", "@next/env": "13.4.19", "@radix-ui/react-alert-dialog": "1.0.4", - "@saleor/app-sdk": "0.43.0", + "@saleor/app-sdk": "0.50.0", "@saleor/macaw-ui": "0.8.0-pre.123", "@sentry/nextjs": "7.80.0", "@t3-oss/env-nextjs": "0.6.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 237d375..213c1b7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + overrides: '@urql/exchange-auth>@urql/core': 3.2.2 @@ -14,8 +18,8 @@ dependencies: specifier: 1.0.4 version: 1.0.4(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0) '@saleor/app-sdk': - specifier: 0.43.0 - version: 0.43.0(next@13.4.19)(react-dom@18.2.0)(react@18.2.0) + specifier: 0.50.0 + version: 0.50.0(graphql@16.8.1)(next@13.4.19)(react-dom@18.2.0)(react@18.2.0) '@saleor/macaw-ui': specifier: 0.8.0-pre.123 version: 0.8.0-pre.123(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0) @@ -949,6 +953,7 @@ packages: prettier: 2.8.8 resolve-from: 5.0.0 semver: 7.5.4 + dev: true /@changesets/assemble-release-plan@5.2.4: resolution: {integrity: sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==} @@ -959,11 +964,13 @@ packages: '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 semver: 7.5.4 + dev: true /@changesets/changelog-git@0.1.14: resolution: {integrity: sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==} dependencies: '@changesets/types': 5.2.1 + dev: true /@changesets/cli@2.26.2: resolution: {integrity: sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==} @@ -1002,6 +1009,7 @@ packages: spawndamnit: 2.0.0 term-size: 2.2.1 tty-table: 4.2.1 + dev: true /@changesets/config@2.3.1: resolution: {integrity: sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==} @@ -1013,11 +1021,13 @@ packages: '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 micromatch: 4.0.5 + dev: true /@changesets/errors@0.1.4: resolution: {integrity: sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==} dependencies: extendable-error: 0.1.7 + dev: true /@changesets/get-dependents-graph@1.3.6: resolution: {integrity: sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==} @@ -1027,6 +1037,7 @@ packages: chalk: 2.4.2 fs-extra: 7.0.1 semver: 7.5.4 + dev: true /@changesets/get-release-plan@3.0.17: resolution: {integrity: sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==} @@ -1038,9 +1049,11 @@ packages: '@changesets/read': 0.5.9 '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 + dev: true /@changesets/get-version-range-type@0.3.2: resolution: {integrity: sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==} + dev: true /@changesets/git@2.0.0: resolution: {integrity: sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==} @@ -1052,17 +1065,20 @@ packages: is-subdir: 1.2.0 micromatch: 4.0.5 spawndamnit: 2.0.0 + dev: true /@changesets/logger@0.0.5: resolution: {integrity: sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==} dependencies: chalk: 2.4.2 + dev: true /@changesets/parse@0.3.16: resolution: {integrity: sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==} dependencies: '@changesets/types': 5.2.1 js-yaml: 3.14.1 + dev: true /@changesets/pre@1.0.14: resolution: {integrity: sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==} @@ -1072,6 +1088,7 @@ packages: '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 + dev: true /@changesets/read@0.5.9: resolution: {integrity: sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==} @@ -1084,12 +1101,15 @@ packages: chalk: 2.4.2 fs-extra: 7.0.1 p-filter: 2.1.0 + dev: true /@changesets/types@4.1.0: resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} + dev: true /@changesets/types@5.2.1: resolution: {integrity: sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==} + dev: true /@changesets/write@0.2.3: resolution: {integrity: sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==} @@ -1099,6 +1119,7 @@ packages: fs-extra: 7.0.1 human-id: 1.0.2 prettier: 2.8.8 + dev: true /@commander-js/extra-typings@11.0.0(commander@11.0.0): resolution: {integrity: sha512-06ol6Kn5gPjFY6v0vWOZ84nQwyqhZdaeZCHYH3vhwewjpOEjniF1KHZxh18887G3poWiJ8qyq5pb6ANuiddfPQ==} @@ -2564,6 +2585,7 @@ packages: '@types/node': 12.20.55 find-up: 4.1.0 fs-extra: 8.1.0 + dev: true /@manypkg/get-packages@1.1.3: resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} @@ -2574,6 +2596,7 @@ packages: fs-extra: 8.1.0 globby: 11.1.0 read-yaml-file: 1.1.0 + dev: true /@next/env@13.4.19: resolution: {integrity: sha512-FsAT5x0jF2kkhNkKkukhsyYOrRqtSxrEhfliniIq0bwWbuXLgyt3Gv0Ml+b91XwjwArmuP7NxCiGd++GGKdNMQ==} @@ -2674,6 +2697,16 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 + /@opentelemetry/api@1.8.0: + resolution: {integrity: sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w==} + engines: {node: '>=8.0.0'} + dev: false + + /@opentelemetry/semantic-conventions@1.23.0: + resolution: {integrity: sha512-MiqFvfOzfR31t8cc74CTP1OZfz7MbqpAnLCra8NqQoaHJX6ncIRTdYOQYBDQ2uFISDq0WY8Y9dDTWvsgzzBYRg==} + engines: {node: '>=14'} + dev: false + /@peculiar/asn1-schema@2.3.6: resolution: {integrity: sha512-izNRxPoaeJeg/AyH8hER6s+H7p4itk+03QCa4sbxI3lNdseQYCuxzgsuNK8bTXChtLTjpJz6NmXKA73qLa3rCA==} dependencies: @@ -3645,16 +3678,21 @@ packages: resolution: {integrity: sha512-0xd7qez0AQ+MbHatZTlI1gu5vkG8r7MYRUJAHPAHJBmGLs16zpkrpAVLvjQKQOqaXPDUBwOiJzNc00znHSCVBw==} dev: true - /@saleor/app-sdk@0.43.0(next@13.4.19)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-hDZ/VNgz6vxeA1h4GtKYs2la8j8E2OocKWDK6HZYbsqDg83K+9LzFOIOHf7U/ZEmBgXR0Ezd0vuhmJBPKLC4jA==} + /@saleor/app-sdk@0.50.0(graphql@16.8.1)(next@13.4.19)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-lg/mRV3lSnCQMiXF2EWWI8FYOBIwQCVZXlMa4fn3mrgkf0pO5tADi+RbgtMKFJtOUxmE4cRIKuZ1JXOTsTmHQg==} peerDependencies: + '@vercel/kv': ^1.0.0 + graphql: '>=16.6.0' next: '>=12' react: '>=17' react-dom: '>=17' + peerDependenciesMeta: + '@vercel/kv': + optional: true dependencies: - '@changesets/cli': 2.26.2 + '@opentelemetry/api': 1.8.0 + '@opentelemetry/semantic-conventions': 1.23.0 debug: 4.3.4 - fast-glob: 3.3.1 graphql: 16.8.1 jose: 4.14.4 next: 13.4.19(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0) @@ -3662,7 +3700,7 @@ packages: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) retes: 0.33.0 - uuid: 8.3.2 + uuid: 9.0.0 transitivePeerDependencies: - supports-color dev: false @@ -4134,6 +4172,7 @@ packages: resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} dependencies: ci-info: 3.8.0 + dev: true /@types/istanbul-lib-coverage@2.0.4: resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} @@ -4170,9 +4209,11 @@ packages: /@types/minimist@1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} + dev: true /@types/node@12.20.55: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} + dev: true /@types/node@20.10.4: resolution: {integrity: sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==} @@ -4181,6 +4222,7 @@ packages: /@types/normalize-package-data@2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} + dev: true /@types/omit-deep-lodash@1.1.1: resolution: {integrity: sha512-VGHGKQCOK5/HsZCKcDIBk94T7yIUKZp4Quy+e4e3EX2D9iZ689K6NlqDqJE3GSp+W7gXFzmsYmBRPAgEXm7TxA==} @@ -4210,6 +4252,7 @@ packages: /@types/semver@7.5.0: resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} + dev: true /@types/set-cookie-parser@2.4.3: resolution: {integrity: sha512-7QhnH7bi+6KAhBB+Auejz1uV9DHiopZqu7LfR/5gZZTkejJV5nYeZZpgfFoE0N8aDsXuiYpfKyfyMatCwQhyTQ==} @@ -4926,6 +4969,7 @@ packages: /ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} + dev: true /ansi-escapes@4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} @@ -4987,6 +5031,7 @@ packages: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: sprintf-js: 1.0.3 + dev: true /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -5015,6 +5060,7 @@ packages: dependencies: call-bind: 1.0.2 is-array-buffer: 3.0.2 + dev: true /array-flatten@1.1.1: resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} @@ -5034,6 +5080,7 @@ packages: /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} + dev: true /array.prototype.findlastindex@1.2.2: resolution: {integrity: sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw==} @@ -5054,6 +5101,7 @@ packages: define-properties: 1.2.0 es-abstract: 1.22.1 es-shim-unscopables: 1.0.0 + dev: true /array.prototype.flatmap@1.3.1: resolution: {integrity: sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==} @@ -5085,10 +5133,12 @@ packages: get-intrinsic: 1.2.1 is-array-buffer: 3.0.2 is-shared-array-buffer: 1.0.2 + dev: true /arrify@1.0.1: resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} engines: {node: '>=0.10.0'} + dev: true /asap@2.0.6: resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} @@ -5161,6 +5211,7 @@ packages: /available-typed-arrays@1.0.5: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} + dev: true /aws-sign2@0.7.0: resolution: {integrity: sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==} @@ -5244,6 +5295,7 @@ packages: engines: {node: '>=4'} dependencies: is-windows: 1.0.2 + dev: true /big.js@5.2.2: resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==} @@ -5325,11 +5377,13 @@ packages: engines: {node: '>=8'} dependencies: fill-range: 7.0.1 + dev: true /breakword@1.0.6: resolution: {integrity: sha512-yjxDAYyK/pBvws9H4xKYpLDpYKEH6CzrBPAuXq3x18I+c/2MkVtT3qAr7Oloi6Dss9qNhPVueAAVU1CSeNDIXw==} dependencies: wcwidth: 1.0.1 + dev: true /browserslist@4.21.10: resolution: {integrity: sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==} @@ -5388,6 +5442,7 @@ packages: dependencies: function-bind: 1.1.1 get-intrinsic: 1.2.1 + dev: true /call-me-maybe@1.0.2: resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} @@ -5411,10 +5466,12 @@ packages: camelcase: 5.3.1 map-obj: 4.3.0 quick-lru: 4.0.1 + dev: true /camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} + dev: true /caniuse-lite@1.0.30001522: resolution: {integrity: sha512-TKiyTVZxJGhsTszLuzb+6vUZSjVOAhClszBr2Ta2k9IwtNBT/4dzmL6aywt0HCgEZlmwJzXJd8yNiob6HgwTRg==} @@ -5519,6 +5576,7 @@ packages: /chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + dev: true /check-error@1.0.2: resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} @@ -5531,6 +5589,7 @@ packages: /ci-info@3.8.0: resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==} engines: {node: '>=8'} + dev: true /classnames@2.3.2: resolution: {integrity: sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==} @@ -5601,6 +5660,7 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 6.2.0 + dev: true /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} @@ -5609,10 +5669,12 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 + dev: true /clone@1.0.4: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} engines: {node: '>=0.8'} + dev: true /clsx@1.2.1: resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==} @@ -5756,6 +5818,7 @@ packages: lru-cache: 4.1.5 shebang-command: 1.2.0 which: 1.3.1 + dev: true /cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} @@ -5789,12 +5852,15 @@ packages: /csv-generate@3.4.3: resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} + dev: true /csv-parse@4.16.3: resolution: {integrity: sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==} + dev: true /csv-stringify@5.6.5: resolution: {integrity: sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==} + dev: true /csv@5.5.3: resolution: {integrity: sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==} @@ -5804,6 +5870,7 @@ packages: csv-parse: 4.16.3 csv-stringify: 5.6.5 stream-transform: 2.1.3 + dev: true /cycle@1.0.3: resolution: {integrity: sha512-TVF6svNzeQCOpjCqsy0/CSy8VgObG3wXusJ73xW2GbG5rGx7lC8zxDSURicsXI2UsGdi2L0QNRCi745/wUDvsA==} @@ -5887,10 +5954,12 @@ packages: dependencies: decamelize: 1.2.0 map-obj: 1.0.1 + dev: true /decamelize@1.2.0: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} engines: {node: '>=0.10.0'} + dev: true /decimal.js@10.4.3: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} @@ -5938,6 +6007,7 @@ packages: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} dependencies: clone: 1.0.4 + dev: true /define-properties@1.2.0: resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} @@ -5945,6 +6015,7 @@ packages: dependencies: has-property-descriptors: 1.0.0 object-keys: 1.1.1 + dev: true /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} @@ -6010,6 +6081,7 @@ packages: /detect-indent@6.1.0: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} + dev: true /detect-node-es@1.1.0: resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==} @@ -6033,6 +6105,7 @@ packages: engines: {node: '>=8'} dependencies: path-type: 4.0.0 + dev: true /doctrine@2.1.0: resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} @@ -6120,6 +6193,7 @@ packages: /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true /emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} @@ -6154,6 +6228,7 @@ packages: dependencies: ansi-colors: 4.1.3 strip-ansi: 6.0.1 + dev: true /entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} @@ -6175,6 +6250,7 @@ packages: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: is-arrayish: 0.2.1 + dev: true /error-http-response@2.0.1: resolution: {integrity: sha512-juuYkLUzUSX0y1BpP26i9fAFG+FAFR2KboKF+25se3xKZqO33vKZZjiPGFmjvn0Q2nkPRsHnlmXbGXdRO9/Jtw==} @@ -6239,6 +6315,7 @@ packages: typed-array-length: 1.0.4 unbox-primitive: 1.0.2 which-typed-array: 1.1.11 + dev: true /es-get-iterator@1.1.3: resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} @@ -6284,11 +6361,13 @@ packages: get-intrinsic: 1.2.1 has: 1.0.3 has-tostringtag: 1.0.0 + dev: true /es-shim-unscopables@1.0.0: resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} dependencies: has: 1.0.3 + dev: true /es-to-primitive@1.2.1: resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} @@ -6297,6 +6376,7 @@ packages: is-callable: 1.2.7 is-date-object: 1.0.5 is-symbol: 1.0.4 + dev: true /es5-ext@0.10.62: resolution: {integrity: sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==} @@ -6785,6 +6865,7 @@ packages: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true + dev: true /esquery@1.5.0: resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} @@ -6917,6 +6998,7 @@ packages: /extendable-error@0.1.7: resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} + dev: true /external-editor@3.1.0: resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} @@ -6925,6 +7007,7 @@ packages: chardet: 0.7.0 iconv-lite: 0.4.24 tmp: 0.0.33 + dev: true /extract-files@11.0.0: resolution: {integrity: sha512-FuoE1qtbJ4bBVvv94CC7s0oTnKUGvQs+Rjf1L2SJFfS+HTVVjhPFtehPdQ0JiGPqVNfSSZvL5yzHHQq2Z4WNhQ==} @@ -6961,6 +7044,7 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 + dev: true /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -7050,6 +7134,7 @@ packages: engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 + dev: true /filter-obj@5.1.0: resolution: {integrity: sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==} @@ -7077,6 +7162,7 @@ packages: dependencies: locate-path: 5.0.0 path-exists: 4.0.0 + dev: true /find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} @@ -7090,6 +7176,7 @@ packages: dependencies: micromatch: 4.0.5 pkg-dir: 4.2.0 + dev: true /flat-cache@3.0.4: resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} @@ -7105,6 +7192,7 @@ packages: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: is-callable: 1.2.7 + dev: true /foreground-child@3.1.1: resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} @@ -7161,6 +7249,7 @@ packages: graceful-fs: 4.2.11 jsonfile: 4.0.0 universalify: 0.1.2 + dev: true /fs-extra@8.1.0: resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} @@ -7169,6 +7258,7 @@ packages: graceful-fs: 4.2.11 jsonfile: 4.0.0 universalify: 0.1.2 + dev: true /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -7191,9 +7281,11 @@ packages: define-properties: 1.2.0 es-abstract: 1.22.1 functions-have-names: 1.2.3 + dev: true /functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + dev: true /gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} @@ -7202,6 +7294,7 @@ packages: /get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} + dev: true /get-func-name@2.0.2: resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} @@ -7213,6 +7306,7 @@ packages: has: 1.0.3 has-proto: 1.0.1 has-symbols: 1.0.3 + dev: true /get-nonce@1.0.1: resolution: {integrity: sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==} @@ -7235,6 +7329,7 @@ packages: dependencies: call-bind: 1.0.2 get-intrinsic: 1.2.1 + dev: true /get-tsconfig@4.7.0: resolution: {integrity: sha512-pmjiZ7xtB8URYm74PlGJozDNyhvsVLUcpBa8DZBG3bWHwaHa9bPiRpiSfovw+fjhwONSCWKRyk+JQHEGZmMrzw==} @@ -7252,6 +7347,7 @@ packages: engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 + dev: true /glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} @@ -7338,6 +7434,7 @@ packages: engines: {node: '>= 0.4'} dependencies: define-properties: 1.2.0 + dev: true /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} @@ -7349,6 +7446,7 @@ packages: ignore: 5.2.4 merge2: 1.4.1 slash: 3.0.0 + dev: true /globrex@0.1.2: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} @@ -7358,12 +7456,14 @@ packages: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: get-intrinsic: 1.2.1 + dev: true /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} /grapheme-splitter@1.0.4: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + dev: true /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} @@ -7448,9 +7548,11 @@ packages: /hard-rejection@2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} engines: {node: '>=6'} + dev: true /has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} + dev: true /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} @@ -7464,20 +7566,24 @@ packages: resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} dependencies: get-intrinsic: 1.2.1 + dev: true /has-proto@1.0.1: resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} engines: {node: '>= 0.4'} + dev: true /has-symbols@1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} + dev: true /has-tostringtag@1.0.0: resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.3 + dev: true /has@1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} @@ -7507,6 +7613,7 @@ packages: /hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + dev: true /html-encoding-sniffer@3.0.0: resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==} @@ -7598,6 +7705,7 @@ packages: /human-id@1.0.2: resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} + dev: true /human-signals@4.3.1: resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} @@ -7657,6 +7765,7 @@ packages: /indent-string@4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} + dev: true /indent-string@5.0.0: resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} @@ -7705,6 +7814,7 @@ packages: get-intrinsic: 1.2.1 has: 1.0.3 side-channel: 1.0.4 + dev: true /interpret@3.1.1: resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} @@ -7748,9 +7858,11 @@ packages: call-bind: 1.0.2 get-intrinsic: 1.2.1 is-typed-array: 1.1.12 + dev: true /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + dev: true /is-async-function@2.0.0: resolution: {integrity: sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==} @@ -7763,6 +7875,7 @@ packages: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} dependencies: has-bigints: 1.0.2 + dev: true /is-boolean-object@1.1.2: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} @@ -7770,16 +7883,19 @@ packages: dependencies: call-bind: 1.0.2 has-tostringtag: 1.0.0 + dev: true /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} + dev: true /is-ci@3.0.1: resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} hasBin: true dependencies: ci-info: 3.8.0 + dev: true /is-core-module@2.13.0: resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} @@ -7791,6 +7907,7 @@ packages: engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 + dev: true /is-error-instance@2.0.0: resolution: {integrity: sha512-5RuM+oFY0P5MRa1nXJo6IcTx9m2VyXYhRtb4h0olsi2GHci4bqZ6akHk+GmCYvDrAR9yInbiYdr2pnoqiOMw/Q==} @@ -7810,6 +7927,7 @@ packages: /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + dev: true /is-fullwidth-code-point@4.0.0: resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} @@ -7855,16 +7973,19 @@ packages: /is-negative-zero@2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} + dev: true /is-number-object@1.0.7: resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 + dev: true /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + dev: true /is-path-inside@3.0.3: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} @@ -7873,6 +7994,7 @@ packages: /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} + dev: true /is-plain-obj@4.1.0: resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} @@ -7898,6 +8020,7 @@ packages: dependencies: call-bind: 1.0.2 has-tostringtag: 1.0.0 + dev: true /is-relative@1.0.0: resolution: {integrity: sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==} @@ -7914,6 +8037,7 @@ packages: resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} dependencies: call-bind: 1.0.2 + dev: true /is-stream@3.0.0: resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} @@ -7925,24 +8049,28 @@ packages: engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 + dev: true /is-subdir@1.2.0: resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} engines: {node: '>=4'} dependencies: better-path-resolve: 1.0.0 + dev: true /is-symbol@1.0.4: resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.3 + dev: true /is-typed-array@1.1.12: resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} engines: {node: '>= 0.4'} dependencies: which-typed-array: 1.1.11 + dev: true /is-typedarray@1.0.0: resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} @@ -7979,6 +8107,7 @@ packages: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} dependencies: call-bind: 1.0.2 + dev: true /is-weakset@2.0.2: resolution: {integrity: sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==} @@ -7990,9 +8119,11 @@ packages: /is-windows@1.0.2: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} + dev: true /isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + dev: true /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -8095,6 +8226,7 @@ packages: dependencies: argparse: 1.0.10 esprima: 4.0.1 + dev: true /js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} @@ -8221,6 +8353,7 @@ packages: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: graceful-fs: 4.2.11 + dev: true /jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} @@ -8257,6 +8390,7 @@ packages: /kind-of@6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} + dev: true /kleur@3.0.3: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} @@ -8266,6 +8400,7 @@ packages: /kleur@4.1.5: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} + dev: true /language-subtag-registry@0.3.22: resolution: {integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==} @@ -8297,6 +8432,7 @@ packages: /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + dev: true /lint-staged@14.0.1: resolution: {integrity: sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==} @@ -8362,6 +8498,7 @@ packages: js-yaml: 3.14.1 pify: 4.0.1 strip-bom: 3.0.0 + dev: true /loader-runner@4.3.0: resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==} @@ -8392,6 +8529,7 @@ packages: engines: {node: '>=8'} dependencies: p-locate: 4.1.0 + dev: true /locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} @@ -8407,6 +8545,7 @@ packages: /lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} + dev: true /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} @@ -8478,6 +8617,7 @@ packages: dependencies: pseudomap: 1.0.2 yallist: 2.1.2 + dev: true /lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} @@ -8533,10 +8673,12 @@ packages: /map-obj@1.0.1: resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} engines: {node: '>=0.10.0'} + dev: true /map-obj@4.3.0: resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} engines: {node: '>=8'} + dev: true /media-query-parser@2.0.2: resolution: {integrity: sha512-1N4qp+jE0pL5Xv4uEcwVUhIkwdUO3S/9gML90nqKA7v7FcOS5vUtatfzok9S9U1EJU8dHWlcv95WLnKmmxZI9w==} @@ -8576,6 +8718,7 @@ packages: trim-newlines: 3.0.1 type-fest: 0.13.1 yargs-parser: 18.1.3 + dev: true /merge-descriptors@1.0.1: resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} @@ -8597,6 +8740,7 @@ packages: /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + dev: true /meros@1.3.0(@types/node@20.10.4): resolution: {integrity: sha512-2BNGOimxEz5hmjUG2FwoxCt5HN7BXdaWyFqEwxPTrJzVdABtrL4TiHTcsWSFAxPQ/tOnEaQEJh3qWq71QRMY+w==} @@ -8631,6 +8775,7 @@ packages: dependencies: braces: 3.0.2 picomatch: 2.3.1 + dev: true /mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} @@ -8661,6 +8806,7 @@ packages: /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} + dev: true /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -8695,6 +8841,7 @@ packages: arrify: 1.0.1 is-plain-obj: 1.1.0 kind-of: 6.0.3 + dev: true /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} @@ -8707,6 +8854,7 @@ packages: /mixme@0.5.9: resolution: {integrity: sha512-VC5fg6ySUscaWUpI4gxCBTQMH2RdUpNrk+MsbpCYtIvf9SBJdiUey4qE7BXviJsJR4nDQxCZ+3yaYNW3guz/Pw==} engines: {node: '>= 8.0.0'} + dev: true /mkdirp@0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} @@ -8931,6 +9079,7 @@ packages: resolve: 1.22.4 semver: 5.7.2 validate-npm-package-license: 3.0.4 + dev: true /normalize-path@2.1.1: resolution: {integrity: sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==} @@ -8963,6 +9112,7 @@ packages: /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} + dev: true /object-is@1.1.5: resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==} @@ -8975,6 +9125,7 @@ packages: /object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} + dev: true /object.assign@4.1.4: resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} @@ -8984,6 +9135,7 @@ packages: define-properties: 1.2.0 has-symbols: 1.0.3 object-keys: 1.1.1 + dev: true /object.entries@1.1.6: resolution: {integrity: sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w==} @@ -9106,9 +9258,11 @@ packages: /os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} + dev: true /outdent@0.5.0: resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} + dev: true /outdent@0.8.0: resolution: {integrity: sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A==} @@ -9118,12 +9272,14 @@ packages: engines: {node: '>=8'} dependencies: p-map: 2.1.0 + dev: true /p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} dependencies: p-try: 2.2.0 + dev: true /p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} @@ -9142,6 +9298,7 @@ packages: engines: {node: '>=8'} dependencies: p-limit: 2.3.0 + dev: true /p-locate@5.0.0: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} @@ -9152,6 +9309,7 @@ packages: /p-map@2.1.0: resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} engines: {node: '>=6'} + dev: true /p-map@4.0.0: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} @@ -9163,6 +9321,7 @@ packages: /p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} + dev: true /param-case@3.0.4: resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} @@ -9194,6 +9353,7 @@ packages: error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 + dev: true /parse5@7.1.2: resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} @@ -9266,6 +9426,7 @@ packages: /path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} + dev: true /pathe@1.1.1: resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} @@ -9293,6 +9454,7 @@ packages: /pify@4.0.1: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} + dev: true /pino-abstract-transport@1.0.0: resolution: {integrity: sha512-c7vo5OpW4wIS42hUVcT5REsL8ZljsUfBjqV/e2sFxmFEFZiq1XLUp5EYLtuDH6PEHq9W1egWqRbnLUP5FuZmOA==} @@ -9347,6 +9509,7 @@ packages: engines: {node: '>=8'} dependencies: find-up: 4.1.0 + dev: true /pkg-types@1.0.3: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} @@ -9397,6 +9560,7 @@ packages: find-yarn-workspace-root2: 1.2.16 path-exists: 4.0.0 which-pm: 2.0.0 + dev: true /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} @@ -9406,6 +9570,7 @@ packages: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} hasBin: true + dev: true /prettier@3.0.2: resolution: {integrity: sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==} @@ -9488,6 +9653,7 @@ packages: /pseudomap@1.0.2: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} + dev: true /psl@1.9.0: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} @@ -9550,6 +9716,7 @@ packages: /quick-lru@4.0.1: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} engines: {node: '>=8'} + dev: true /randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} @@ -9724,6 +9891,7 @@ packages: find-up: 4.1.0 read-pkg: 5.2.0 type-fest: 0.8.1 + dev: true /read-pkg@5.2.0: resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} @@ -9733,6 +9901,7 @@ packages: normalize-package-data: 2.5.0 parse-json: 5.2.0 type-fest: 0.6.0 + dev: true /read-yaml-file@1.1.0: resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} @@ -9742,6 +9911,7 @@ packages: js-yaml: 3.14.1 pify: 4.0.1 strip-bom: 3.0.0 + dev: true /readable-stream@3.6.2: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} @@ -9787,6 +9957,7 @@ packages: dependencies: indent-string: 4.0.0 strip-indent: 3.0.0 + dev: true /reflect.getprototypeof@1.0.3: resolution: {integrity: sha512-TTAOZpkJ2YLxl7mVHWrNo3iDMEkYlva/kgFcXndqMgbo/AZUmmavEkdXV+hXtE4P8xdyEKRzalaFqZVuwIk/Nw==} @@ -9815,6 +9986,7 @@ packages: call-bind: 1.0.2 define-properties: 1.2.0 functions-have-names: 1.2.3 + dev: true /regexpp@3.2.0: resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} @@ -9873,6 +10045,7 @@ packages: /require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} + dev: true /require-from-string@2.0.2: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} @@ -9883,6 +10056,7 @@ packages: /require-main-filename@2.0.0: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + dev: true /requireindex@1.1.0: resolution: {integrity: sha512-LBnkqsDE7BZKvqylbmn7lTIVdpx4K/QCduRATpO5R+wtPmky/a8pN1bO2D6wXppn1497AJF9mNjqAXr6bdl9jg==} @@ -9899,6 +10073,7 @@ packages: /resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} + dev: true /resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} @@ -10012,6 +10187,7 @@ packages: get-intrinsic: 1.2.1 has-symbols: 1.0.3 isarray: 2.0.5 + dev: true /safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} @@ -10034,6 +10210,7 @@ packages: call-bind: 1.0.2 get-intrinsic: 1.2.1 is-regex: 1.1.4 + dev: true /safe-regex@2.1.1: resolution: {integrity: sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==} @@ -10087,6 +10264,7 @@ packages: /semver@5.7.2: resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} hasBin: true + dev: true /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} @@ -10148,6 +10326,7 @@ packages: /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + dev: true /set-cookie-parser@2.6.0: resolution: {integrity: sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==} @@ -10207,6 +10386,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: shebang-regex: 1.0.0 + dev: true /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} @@ -10217,6 +10397,7 @@ packages: /shebang-regex@1.0.0: resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} engines: {node: '>=0.10.0'} + dev: true /shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} @@ -10232,12 +10413,14 @@ packages: call-bind: 1.0.2 get-intrinsic: 1.2.1 object-inspect: 1.12.3 + dev: true /siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: true /signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} @@ -10255,6 +10438,7 @@ packages: /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} + dev: true /slice-ansi@3.0.0: resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==} @@ -10298,6 +10482,7 @@ packages: strip-ansi: 6.0.1 wcwidth: 1.0.1 yargs: 15.4.1 + dev: true /snake-case@3.0.4: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} @@ -10331,24 +10516,29 @@ packages: dependencies: cross-spawn: 5.1.0 signal-exit: 3.0.7 + dev: true /spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} dependencies: spdx-expression-parse: 3.0.1 spdx-license-ids: 3.0.13 + dev: true /spdx-exceptions@2.3.0: resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} + dev: true /spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} dependencies: spdx-exceptions: 2.3.0 spdx-license-ids: 3.0.13 + dev: true /spdx-license-ids@3.0.13: resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} + dev: true /split2@4.2.0: resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} @@ -10363,6 +10553,7 @@ packages: /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + dev: true /sshpk@1.18.0: resolution: {integrity: sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==} @@ -10417,6 +10608,7 @@ packages: resolution: {integrity: sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==} dependencies: mixme: 0.5.9 + dev: true /streamsearch@1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} @@ -10438,6 +10630,7 @@ packages: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 + dev: true /string-width@5.1.2: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} @@ -10468,6 +10661,7 @@ packages: call-bind: 1.0.2 define-properties: 1.2.0 es-abstract: 1.22.1 + dev: true /string.prototype.trimend@1.0.6: resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} @@ -10475,6 +10669,7 @@ packages: call-bind: 1.0.2 define-properties: 1.2.0 es-abstract: 1.22.1 + dev: true /string.prototype.trimstart@1.0.6: resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} @@ -10482,6 +10677,7 @@ packages: call-bind: 1.0.2 define-properties: 1.2.0 es-abstract: 1.22.1 + dev: true /string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} @@ -10504,6 +10700,7 @@ packages: /strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} + dev: true /strip-final-newline@3.0.0: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} @@ -10515,6 +10712,7 @@ packages: engines: {node: '>=8'} dependencies: min-indent: 1.0.1 + dev: true /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} @@ -10585,6 +10783,7 @@ packages: /term-size@2.2.1: resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} engines: {node: '>=8'} + dev: true /terser-webpack-plugin@5.3.9(webpack@5.88.2): resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} @@ -10689,6 +10888,7 @@ packages: engines: {node: '>=0.6.0'} dependencies: os-tmpdir: 1.0.2 + dev: true /to-arraybuffer@1.0.1: resolution: {integrity: sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA==} @@ -10703,6 +10903,7 @@ packages: engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 + dev: true /toidentifier@1.0.0: resolution: {integrity: sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==} @@ -10746,6 +10947,7 @@ packages: /trim-newlines@3.0.1: resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} engines: {node: '>=8'} + dev: true /ts-api-utils@1.0.2(typescript@5.1.6): resolution: {integrity: sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==} @@ -10879,6 +11081,7 @@ packages: strip-ansi: 6.0.1 wcwidth: 1.0.1 yargs: 17.7.2 + dev: true /tunnel-agent@0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} @@ -10903,6 +11106,7 @@ packages: /type-fest@0.13.1: resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} engines: {node: '>=10'} + dev: true /type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} @@ -10916,6 +11120,7 @@ packages: /type-fest@0.6.0: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} + dev: true /type-fest@0.7.1: resolution: {integrity: sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==} @@ -10925,6 +11130,7 @@ packages: /type-fest@0.8.1: resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} engines: {node: '>=8'} + dev: true /type-fest@1.4.0: resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} @@ -10959,6 +11165,7 @@ packages: call-bind: 1.0.2 get-intrinsic: 1.2.1 is-typed-array: 1.1.12 + dev: true /typed-array-byte-length@1.0.0: resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} @@ -10968,6 +11175,7 @@ packages: for-each: 0.3.3 has-proto: 1.0.1 is-typed-array: 1.1.12 + dev: true /typed-array-byte-offset@1.0.0: resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} @@ -10978,6 +11186,7 @@ packages: for-each: 0.3.3 has-proto: 1.0.1 is-typed-array: 1.1.12 + dev: true /typed-array-length@1.0.4: resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} @@ -10985,6 +11194,7 @@ packages: call-bind: 1.0.2 for-each: 0.3.3 is-typed-array: 1.1.12 + dev: true /typescript@5.1.6: resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} @@ -11005,6 +11215,7 @@ packages: has-bigints: 1.0.2 has-symbols: 1.0.3 which-boxed-primitive: 1.0.2 + dev: true /unc-path-regex@0.1.2: resolution: {integrity: sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==} @@ -11017,6 +11228,7 @@ packages: /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} + dev: true /universalify@0.2.0: resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} @@ -11166,8 +11378,8 @@ packages: hasBin: true dev: false - /uuid@8.3.2: - resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + /uuid@9.0.0: + resolution: {integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==} hasBin: true dev: false @@ -11194,6 +11406,7 @@ packages: dependencies: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 + dev: true /value-or-promise@1.0.12: resolution: {integrity: sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==} @@ -11398,6 +11611,7 @@ packages: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} dependencies: defaults: 1.0.4 + dev: true /web-streams-polyfill@3.2.1: resolution: {integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==} @@ -11497,6 +11711,7 @@ packages: is-number-object: 1.0.7 is-string: 1.0.7 is-symbol: 1.0.4 + dev: true /which-builtin-type@1.1.3: resolution: {integrity: sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==} @@ -11527,6 +11742,7 @@ packages: /which-module@2.0.1: resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} + dev: true /which-pm@2.0.0: resolution: {integrity: sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==} @@ -11534,6 +11750,7 @@ packages: dependencies: load-yaml-file: 0.2.0 path-exists: 4.0.0 + dev: true /which-typed-array@1.1.11: resolution: {integrity: sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==} @@ -11544,12 +11761,14 @@ packages: for-each: 0.3.3 gopd: 1.0.1 has-tostringtag: 1.0.0 + dev: true /which@1.3.1: resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} hasBin: true dependencies: isexe: 2.0.0 + dev: true /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} @@ -11589,6 +11808,7 @@ packages: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 + dev: true /wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} @@ -11597,6 +11817,7 @@ packages: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 + dev: true /wrap-ansi@8.1.0: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} @@ -11639,13 +11860,16 @@ packages: /y18n@4.0.3: resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + dev: true /y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} + dev: true /yallist@2.1.2: resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} + dev: true /yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} @@ -11673,10 +11897,12 @@ packages: dependencies: camelcase: 5.3.1 decamelize: 1.2.0 + dev: true /yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} + dev: true /yargs@15.4.1: resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} @@ -11693,6 +11919,7 @@ packages: which-module: 2.0.1 y18n: 4.0.3 yargs-parser: 18.1.3 + dev: true /yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} @@ -11705,6 +11932,7 @@ packages: string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 21.1.1 + dev: true /yn@3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} @@ -11754,7 +11982,3 @@ packages: react: 18.2.0 use-sync-external-store: 1.2.0(react@18.2.0) dev: false - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false diff --git a/src/pages/api/manifest.ts b/src/pages/api/manifest.ts index 1c86cc1..ff9963b 100644 --- a/src/pages/api/manifest.ts +++ b/src/pages/api/manifest.ts @@ -7,6 +7,7 @@ import { transactionCancelationRequestedSyncWebhook } from "./webhooks/transacti import { transactionInitializeSessionSyncWebhook } from "./webhooks/transaction-initialize-session"; import { transactionRefundRequestedSyncWebhook } from "./webhooks/transaction-refund-requested"; import { transactionProcessSessionSyncWebhook } from "./webhooks/transaction-process-session"; +import { listStoredPaymentMethodsSyncWebhook } from "./webhooks/list-stored-payment-methods"; export default createManifestHandler({ async manifestFactory(context) { @@ -24,6 +25,7 @@ export default createManifestHandler({ transactionCancelationRequestedSyncWebhook.getWebhookManifest(context.appBaseUrl), transactionRefundRequestedSyncWebhook.getWebhookManifest(context.appBaseUrl), paymentGatewayInitializeSessionSyncWebhook.getWebhookManifest(context.appBaseUrl), + listStoredPaymentMethodsSyncWebhook.getWebhookManifest(context.appBaseUrl), ], extensions: [ /** diff --git a/src/pages/api/webhooks/list-stored-payment-methods.ts b/src/pages/api/webhooks/list-stored-payment-methods.ts index 38f98c9..9780119 100644 --- a/src/pages/api/webhooks/list-stored-payment-methods.ts +++ b/src/pages/api/webhooks/list-stored-payment-methods.ts @@ -23,7 +23,7 @@ export const listStoredPaymentMethodsSyncWebhook = new SaleorSyncWebhook({ name: "ListStoredPaymentMethods", apl: saleorApp.apl, - event: "TRANSACTION_REFUND_REQUESTED", + event: "LIST_STORED_PAYMENT_METHODS", query: UntypedListStoredPaymentMethodsDocument, webhookPath: "/api/webhooks/list-stored-payment-methods", }); From 0318d3a220f89a95f058aa787bf706e4fe14d0b3 Mon Sep 17 00:00:00 2001 From: Adrian Pilarczyk Date: Thu, 25 Apr 2024 12:45:10 +0200 Subject: [PATCH 08/37] add support for multiple payment gateways --- ...ymentGatewayInitializeSessionEvent.graphql | 1 + .../gateways/accept-hosted-gateway.ts | 17 +++-- .../gateways/accept-js-gateway.ts | 11 +++- .../authorize-net/gateways/gateway-utils.ts | 4 +- .../authorize-net/gateways/payment-gateway.ts | 5 +- .../payment-gateway-initialize-session.ts | 64 ++++++++++++------- .../payment-gateway-initialize-session.ts | 46 +++++-------- ...tewayInitializeSessionResponse.schema.json | 8 --- 8 files changed, 83 insertions(+), 73 deletions(-) delete mode 100644 src/schemas/PaymentGatewayInitializeSession/PaymentGatewayInitializeSessionResponse.schema.json diff --git a/graphql/fragments/PaymentGatewayInitializeSessionEvent.graphql b/graphql/fragments/PaymentGatewayInitializeSessionEvent.graphql index d574641..8a84630 100644 --- a/graphql/fragments/PaymentGatewayInitializeSessionEvent.graphql +++ b/graphql/fragments/PaymentGatewayInitializeSessionEvent.graphql @@ -10,6 +10,7 @@ fragment PaymentGatewayInitializeSessionEvent on PaymentGatewayInitializeSession id } } + data sourceObject { __typename ...OrderOrCheckoutSourceObject diff --git a/src/modules/authorize-net/gateways/accept-hosted-gateway.ts b/src/modules/authorize-net/gateways/accept-hosted-gateway.ts index a6fc085..ef3c032 100644 --- a/src/modules/authorize-net/gateways/accept-hosted-gateway.ts +++ b/src/modules/authorize-net/gateways/accept-hosted-gateway.ts @@ -26,9 +26,16 @@ import { type TransactionInitializeSessionResponse } from "@/schemas/Transaction const ApiContracts = AuthorizeNet.APIContracts; -export const acceptHostedPaymentGatewayDataSchema = z.object({}); +export const acceptHostedPaymentGatewayRequestDataSchema = gatewayUtils.createGatewayDataSchema( + "acceptHosted", + z.object({}), +); + +export const acceptHostedPaymentGatewayResponseDataSchema = z.object({}); -type AcceptHostedPaymentGatewayData = z.infer; +type AcceptHostedPaymentGatewayResponseData = z.infer< + typeof acceptHostedPaymentGatewayResponseDataSchema +>; export const acceptHostedTransactionInitializeRequestDataSchema = gatewayUtils.createGatewayDataSchema( @@ -181,8 +188,10 @@ export class AcceptHostedGateway implements PaymentGateway { async initializePaymentGateway( _payload: PaymentGatewayInitializeSessionEventFragment, - ): Promise { - return {}; + ): Promise { + return { + data: {}, + }; } async initializeTransaction( diff --git a/src/modules/authorize-net/gateways/accept-js-gateway.ts b/src/modules/authorize-net/gateways/accept-js-gateway.ts index 356e823..077abe9 100644 --- a/src/modules/authorize-net/gateways/accept-js-gateway.ts +++ b/src/modules/authorize-net/gateways/accept-js-gateway.ts @@ -21,9 +21,14 @@ import { } from "@/modules/authorize-net/gateways/payment-gateway"; import { type TransactionInitializeSessionResponse } from "@/schemas/TransactionInitializeSession/TransactionInitializeSessionResponse.mjs"; -export const acceptJsPaymentGatewayDataSchema = z.object({}); +export const acceptJsPaymentGatewayRequestDataSchema = gatewayUtils.createGatewayDataSchema( + "acceptJs", + z.object({}), +); + +export const acceptJsPaymentGatewayResponseDataSchema = z.object({}); -type AcceptJsPaymentGatewayData = z.infer; +type AcceptJsPaymentGatewayResponseData = z.infer; /** * @example { data: { type: "acceptJs", data: { } } } @@ -112,7 +117,7 @@ export class AcceptJsGateway implements PaymentGateway { // If you need to return some data before creating the transaction with Accept.js, you can do it here async initializePaymentGateway( _payload: PaymentGatewayInitializeSessionEventFragment, - ): Promise { + ): Promise { return {}; } diff --git a/src/modules/authorize-net/gateways/gateway-utils.ts b/src/modules/authorize-net/gateways/gateway-utils.ts index 79386c0..5c2ff15 100644 --- a/src/modules/authorize-net/gateways/gateway-utils.ts +++ b/src/modules/authorize-net/gateways/gateway-utils.ts @@ -1,6 +1,8 @@ import { z } from "zod"; -const createGatewayDataSchema = ( +type GatewayName = "acceptHosted" | "paypal" | "applePay" | "acceptJs"; // todo: centralize all the gateway and infer the names + +const createGatewayDataSchema = ( gatewayName: TName, data: TData, ) => { diff --git a/src/modules/authorize-net/gateways/payment-gateway.ts b/src/modules/authorize-net/gateways/payment-gateway.ts index 1aa7573..8bdf8ac 100644 --- a/src/modules/authorize-net/gateways/payment-gateway.ts +++ b/src/modules/authorize-net/gateways/payment-gateway.ts @@ -1,5 +1,6 @@ +import { type PaymentGatewayInitializeSessionResponseData } from "@/pages/api/webhooks/payment-gateway-initialize-session"; import { type ListStoredPaymentMethodsResponse } from "@/schemas/ListStoredPaymentMethods/ListStoredPaymentMethodsResponse.mjs"; -import { type PaymentGatewayInitializeSessionResponse } from "@/schemas/PaymentGatewayInitializeSession/PaymentGatewayInitializeSessionResponse.mjs"; + import { type TransactionInitializeSessionResponse } from "@/schemas/TransactionInitializeSession/TransactionInitializeSessionResponse.mjs"; import { type PaymentGatewayInitializeSessionEventFragment, @@ -16,7 +17,7 @@ export type AppPaymentMethod = ListStoredPaymentMethodsResponse["paymentMethods" export interface PaymentGateway { initializePaymentGateway( payload: PaymentGatewayInitializeSessionEventFragment, - ): Promise; + ): Promise; initializeTransaction( payload: TransactionInitializeSessionEventFragment, ): Promise; diff --git a/src/modules/webhooks/payment-gateway-initialize-session.ts b/src/modules/webhooks/payment-gateway-initialize-session.ts index e9f641b..1e22c03 100644 --- a/src/modules/webhooks/payment-gateway-initialize-session.ts +++ b/src/modules/webhooks/payment-gateway-initialize-session.ts @@ -1,31 +1,47 @@ -import { AcceptHostedGateway } from "../authorize-net/gateways/accept-hosted-gateway"; -import { AcceptJsGateway } from "../authorize-net/gateways/accept-js-gateway"; -import { type PaymentGatewayInitializeSessionData } from "@/pages/api/webhooks/payment-gateway-initialize-session"; +import { z } from "zod"; +import { + AcceptHostedGateway, + acceptHostedPaymentGatewayRequestDataSchema, +} from "../authorize-net/gateways/accept-hosted-gateway"; +import { + AcceptJsGateway, + acceptJsPaymentGatewayRequestDataSchema, +} from "../authorize-net/gateways/accept-js-gateway"; + import { type PaymentGatewayInitializeSessionEventFragment } from "generated/graphql"; +import { type PaymentGatewayInitializeSessionResponse } from "@/pages/api/webhooks/payment-gateway-initialize-session"; + +export const paymentGatewayInitializeSessionRequestDataSchema = z.union([ + acceptHostedPaymentGatewayRequestDataSchema, + acceptJsPaymentGatewayRequestDataSchema, +]); export class PaymentGatewayInitializeSessionService { async execute( payload: PaymentGatewayInitializeSessionEventFragment, - ): Promise { - const acceptHostedGateway = new AcceptHostedGateway(); - const acceptJsGateway = new AcceptJsGateway(); - - const initializeAcceptHosted = acceptHostedGateway.initializePaymentGateway(payload); - const initializeAcceptJs = acceptJsGateway.initializePaymentGateway(payload); - - /** - * @see: ApplePayGateway, PaypalGateway - * Import once they are implemented. - */ - - const [acceptHosted, acceptJs] = await Promise.all([ - initializeAcceptHosted, - initializeAcceptJs, - ]); - - return { - acceptHosted, - acceptJs, - }; + ): Promise { + const data = paymentGatewayInitializeSessionRequestDataSchema.parse(payload.data); + + switch (data.type) { + case "acceptHosted": { + const acceptHostedGateway = new AcceptHostedGateway(); + + const acceptHosted = await acceptHostedGateway.initializePaymentGateway(payload); + + return { + data: acceptHosted, + }; + } + + case "acceptJs": { + const acceptJsGateway = new AcceptJsGateway(); + + const acceptJs = await acceptJsGateway.initializePaymentGateway(payload); + + return { + data: acceptJs, + }; + } + } } } diff --git a/src/pages/api/webhooks/payment-gateway-initialize-session.ts b/src/pages/api/webhooks/payment-gateway-initialize-session.ts index 92b6cad..c414dbe 100644 --- a/src/pages/api/webhooks/payment-gateway-initialize-session.ts +++ b/src/pages/api/webhooks/payment-gateway-initialize-session.ts @@ -1,10 +1,11 @@ import { SaleorSyncWebhook } from "@saleor/app-sdk/handlers/next"; import { z } from "zod"; +import { errorUtils } from "@/error-utils"; import { createLogger } from "@/lib/logger"; import { SynchronousWebhookResponseBuilder } from "@/lib/webhook-response-builder"; import { getAuthorizeConfig } from "@/modules/authorize-net/authorize-net-config"; -import { acceptHostedPaymentGatewayDataSchema } from "@/modules/authorize-net/gateways/accept-hosted-gateway"; -import { applePayPaymentGatewayResponseDataSchema } from "@/modules/authorize-net/gateways/apple-pay-gateway"; +import { acceptHostedPaymentGatewayResponseDataSchema } from "@/modules/authorize-net/gateways/accept-hosted-gateway"; +import { acceptJsPaymentGatewayResponseDataSchema } from "@/modules/authorize-net/gateways/accept-js-gateway"; import { AuthorizeWebhookManager } from "@/modules/authorize-net/webhook/authorize-net-webhook-manager"; import { createAppWebhookManager } from "@/modules/webhooks/webhook-manager-service"; import { saleorApp } from "@/saleor-app"; @@ -12,25 +13,6 @@ import { UntypedPaymentGatewayInitializeSessionDocument, type PaymentGatewayInitializeSessionEventFragment, } from "generated/graphql"; -import { paypalPaymentGatewayResponseDataSchema } from "@/modules/authorize-net/gateways/paypal-gateway"; -import { errorUtils } from "@/error-utils"; -import { acceptJsPaymentGatewayDataSchema } from "@/modules/authorize-net/gateways/accept-js-gateway"; - -const paymentGatewaySchema = z.union([ - acceptHostedPaymentGatewayDataSchema, - applePayPaymentGatewayResponseDataSchema, -]); - -export type AuthorizePaymentGateway = z.infer; - -const dataSchema = z.object({ - acceptHosted: acceptHostedPaymentGatewayDataSchema.optional(), - applePay: applePayPaymentGatewayResponseDataSchema.optional(), - paypal: paypalPaymentGatewayResponseDataSchema.optional(), - acceptJs: acceptJsPaymentGatewayDataSchema.optional(), -}); - -export type PaymentGatewayInitializeSessionData = z.infer; export const config = { api: { @@ -47,15 +29,21 @@ export const paymentGatewayInitializeSessionSyncWebhook = webhookPath: "/api/webhooks/payment-gateway-initialize-session", }); -const errorSchema = z.unknown({}); +const paymentGatewayInitializeSessionResponseDataSchema = z.union([ + acceptHostedPaymentGatewayResponseDataSchema, + acceptJsPaymentGatewayResponseDataSchema, +]); + +export type PaymentGatewayInitializeSessionResponseData = z.infer< + typeof paymentGatewayInitializeSessionResponseDataSchema +>; -const paymentGatewayInitializeSessionSchema = z.object({ - data: dataSchema.optional(), - error: errorSchema.optional(), +const paymentGatewayInitializeSessionResponseSchema = z.object({ + data: paymentGatewayInitializeSessionResponseDataSchema, }); export type PaymentGatewayInitializeSessionResponse = z.infer< - typeof paymentGatewayInitializeSessionSchema + typeof paymentGatewayInitializeSessionResponseSchema >; class WebhookResponseBuilder extends SynchronousWebhookResponseBuilder {} @@ -86,11 +74,7 @@ export default paymentGatewayInitializeSessionSyncWebhook.createHandler( } catch (error) { const normalizedError = errorUtils.normalize(error); errorUtils.capture(normalizedError); - return responseBuilder.ok({ - error: { - message: normalizedError.message, - }, - }); + return responseBuilder.internalServerError(normalizedError); } }, ); diff --git a/src/schemas/PaymentGatewayInitializeSession/PaymentGatewayInitializeSessionResponse.schema.json b/src/schemas/PaymentGatewayInitializeSession/PaymentGatewayInitializeSessionResponse.schema.json deleted file mode 100644 index b812e92..0000000 --- a/src/schemas/PaymentGatewayInitializeSession/PaymentGatewayInitializeSessionResponse.schema.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "anyOf": [ - { - "type": "object" - } - ] -} From 63efeeb1cca81df2c78ec141ed43775505d8e70b Mon Sep 17 00:00:00 2001 From: Pankaj Patel Date: Tue, 23 Apr 2024 20:24:06 +0530 Subject: [PATCH 09/37] update acceptjs form integration --- example/graphql/CreateCheckout.graphql | 14 +- example/graphql/ProductList.graphql | 4 +- example/next.config.js | 8 + example/pnpm-lock.yaml | 8 +- example/src/accept-payment-form.tsx | 214 ++++++++++++++++++ example/src/pages/index.tsx | 4 +- example/src/payment-methods.tsx | 28 ++- .../gateways/accept-js-gateway.ts | 79 +++++-- .../payment-gateway-initialize-session.ts | 4 + src/pages/api/manifest.ts | 20 +- 10 files changed, 342 insertions(+), 41 deletions(-) create mode 100644 example/src/accept-payment-form.tsx diff --git a/example/graphql/CreateCheckout.graphql b/example/graphql/CreateCheckout.graphql index bd0948b..51abd8c 100644 --- a/example/graphql/CreateCheckout.graphql +++ b/example/graphql/CreateCheckout.graphql @@ -1,26 +1,26 @@ mutation CreateCheckout($variantId: ID!) { checkoutCreate( input: { - channel: "default-channel" + channel: "ken-r" lines: [{ quantity: 1, variantId: $variantId }] languageCode: EN_US email: "demo@saleor.io" billingAddress: { firstName: "John" lastName: "Doe" - streetAddress1: "813 Howard Street" - city: "Oswego" + streetAddress1: "500 8th Avenue" + city: "New York" countryArea: "NY" - postalCode: "13126" + postalCode: "10018" country: US } shippingAddress: { firstName: "John" lastName: "Doe" - streetAddress1: "813 Howard Street" - city: "Oswego" + streetAddress1: "500 8th Avenue" + city: "New York" countryArea: "NY" - postalCode: "13126" + postalCode: "10018" country: US } } diff --git a/example/graphql/ProductList.graphql b/example/graphql/ProductList.graphql index 8f65867..b0a8068 100644 --- a/example/graphql/ProductList.graphql +++ b/example/graphql/ProductList.graphql @@ -1,8 +1,8 @@ query ProductList { products( first: 1 - channel: "default-channel" - where: { isAvailable: true, giftCard: false } + channel: "ken-r" + where: { isAvailable: true, giftCard: false, ids: ["UHJvZHVjdDoyNjA3MA=="] } sortBy: { field: PRICE, direction: DESC } ) { edges { diff --git a/example/next.config.js b/example/next.config.js index 686d604..a195a69 100644 --- a/example/next.config.js +++ b/example/next.config.js @@ -7,6 +7,14 @@ const nextConfig = { reactStrictMode: false, images: { domains: url ? [url.hostname] : [], + remotePatterns: [ + { + protocol: "https", + hostname: url.hostname ?? "", + port: "", + pathname: "/w20/**", + }, + ], }, }; diff --git a/example/pnpm-lock.yaml b/example/pnpm-lock.yaml index 37172a6..65cddea 100644 --- a/example/pnpm-lock.yaml +++ b/example/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + dependencies: '@apollo/client': specifier: 3.8.5 @@ -5463,7 +5467,3 @@ packages: /zod@3.22.4: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false diff --git a/example/src/accept-payment-form.tsx b/example/src/accept-payment-form.tsx new file mode 100644 index 0000000..4900060 --- /dev/null +++ b/example/src/accept-payment-form.tsx @@ -0,0 +1,214 @@ +import { gql, useMutation } from "@apollo/client"; +import React, { FormEvent } from "react"; +import { z } from "zod"; +import { + TransactionInitializeDocument, + TransactionInitializeMutation, + TransactionInitializeMutationVariables, + TransactionProcessDocument, + TransactionProcessMutation, + TransactionProcessMutationVariables, +} from "../generated/graphql"; +import { authorizeNetAppId } from "./lib/common"; +import { getCheckoutId } from "./pages/cart"; +import { useRouter } from "next/router"; + +import { useAcceptJs } from "react-acceptjs"; + +const authData = { + apiLoginID: process.env.NEXT_PUBLIC_AUTHORIZE_API_LOGIN_ID, + clientKey: process.env.NEXT_PUBLIC_AUTHORIZE_PUBLIC_CLIENT_KEY, +}; + +type BasicCardInfo = { + cardNumber: string; + cardCode: string; + month: string; + year: string; +}; + +export interface IAuthorizeTransactionResponse { + amount: number; + result: string; + data: { + response: { + messages: { + resultCode: string; + }; + transactionResponse: { + transId: string; + }; + }; + }; +} + +const acceptHostedTransactionResponseSchema = z.object({ + messages: z.object({ + resultCode: z.string().optional().default(""), + }), + transactionResponse: z.object({ + transId: z.string().optional().default(""), + }), +}); + +export function AcceptPaymentForm() { + const checkoutId = getCheckoutId(); + const router = useRouter(); + const { dispatchData, loading, error } = useAcceptJs({ authData }); + const [cardData, setCardData] = React.useState({ + cardNumber: "", + month: "", + year: "", + cardCode: "", + }); + + const [initializeTransaction] = useMutation< + TransactionInitializeMutation, + TransactionInitializeMutationVariables + >(gql(TransactionInitializeDocument.toString())); + + const [processTransaction] = useMutation( + gql(TransactionProcessDocument.toString()), + ); + + const handleSubmit = React.useCallback(async (event: FormEvent) => { + event.preventDefault(); + // TODO use unknown because not getting currentTarget in event + const formData = new FormData((event as unknown as { target: HTMLFormElement }).target); + const cardData = { + cardNumber: (formData.get("cardNumber") as string) || "", + month: (formData.get("month") as string) || "", + year: (formData.get("year") as string) || "", + cardCode: (formData.get("cardCode") as string) || "", + }; + + // Dispatch CC data to Authorize.net and receive payment nonce for use on your server + const response = await dispatchData({ cardData }); + getAcceptData(response.opaqueData); + }, []); + + const getAcceptData = React.useCallback( + async (opaqueData: { dataDescriptor: string; dataValue: string }) => { + const initializeTransactionResponse = await initializeTransaction({ + variables: { + checkoutId, + paymentGateway: authorizeNetAppId, + data: { + type: "acceptJs", + data: { + opaqueData, + }, + }, + }, + }); + + // Need to handle error from authorize.net : start + + if ( + (initializeTransactionResponse.data?.transactionInitialize?.data as { error: string })?.error + ?.length || + initializeTransactionResponse.data?.transactionInitialize?.errors?.length + ) { + throw new Error("Failed to initialize transaction"); + } + + const nextTransactionId = initializeTransactionResponse.data?.transactionInitialize?.transaction?.id; + + if (!nextTransactionId) { + throw new Error("Transaction id not found in response"); + } + + transactionResponseHandler( + initializeTransactionResponse.data?.transactionInitialize?.data as { + response: IAuthorizeTransactionResponse; + }, + nextTransactionId, + ); + + // Need to handle error from authorize.net : end + }, + [initializeTransaction, checkoutId], + ); + + const transactionResponseHandler = React.useCallback( + async (rawResponse: { response: IAuthorizeTransactionResponse }, transactionId: string) => { + const authorizeResponse = acceptHostedTransactionResponseSchema.parse(rawResponse?.response); + + const data = { + authorizeTransactionId: authorizeResponse?.transactionResponse?.transId, + }; + + if (!transactionId) { + throw new Error("Transaction id not found"); + } + + const processTransactionResponse = await processTransaction({ + variables: { + transactionId, + data, + }, + }); + + const isProcessTransactionSuccessful = + processTransactionResponse?.data?.transactionProcess?.transactionEvent?.type === + "AUTHORIZATION_SUCCESS"; + + if (!isProcessTransactionSuccessful) { + throw new Error("Failed to process transaction"); + } + + router.push("/success"); + }, + [processTransaction, router], + ); + + return ( + <> +
+ + setCardData({ ...cardData, cardNumber: event.target.value })} + /> + + setCardData({ ...cardData, month: event.target.value })} + /> + + setCardData({ ...cardData, year: event.target.value })} + /> + + setCardData({ ...cardData, cardCode: event.target.value })} + /> + +
+ + ); +} diff --git a/example/src/pages/index.tsx b/example/src/pages/index.tsx index 85f6667..fcfe50e 100644 --- a/example/src/pages/index.tsx +++ b/example/src/pages/index.tsx @@ -26,8 +26,7 @@ export default function Page() { const [updateDelivery] = useMutation( gql(UpdateDeliveryDocument.toString()), ); - - const product = data?.products?.edges[0].node; + const product = data?.products?.edges[0]?.node; const variant = product?.defaultVariant; const router = useRouter(); @@ -40,7 +39,6 @@ export default function Page() { e.preventDefault(); const response = await createCheckout({ variables: { variantId: variant.id } }); - if (!response.data?.checkoutCreate?.checkout?.id) { throw new Error("Failed to create checkout"); } diff --git a/example/src/payment-methods.tsx b/example/src/payment-methods.tsx index c568711..b27796b 100644 --- a/example/src/payment-methods.tsx +++ b/example/src/payment-methods.tsx @@ -10,6 +10,7 @@ import { authorizeNetAppId } from "./lib/common"; import { AcceptHostedForm } from "./accept-hosted-form"; import { getCheckoutId } from "./pages/cart"; +import { AcceptPaymentForm } from "./accept-payment-form"; const acceptHostedPaymentGatewaySchema = z.object({}); @@ -20,12 +21,18 @@ const dataSchema = z.object({ acceptHosted: z.unknown().optional(), applePay: z.unknown().optional(), paypal: z.unknown().optional(), + acceptJs: z.object({ enabled: z.boolean().optional() }), }); type PaymentMethods = z.infer; const paymentGatewayInitializeSessionSchema = dataSchema; +const payloadDataSchema = z.object({ + shouldCreateCustomerProfile: z.boolean(), + iframeUrl: z.string(), +}); + export const PaymentMethods = () => { const [isLoading, setIsLoading] = React.useState(false); const [paymentMethods, setPaymentMethods] = React.useState(); @@ -39,11 +46,21 @@ export const PaymentMethods = () => { const getPaymentGateways = React.useCallback(async () => { setIsLoading(true); + const payloadData = payloadDataSchema.parse({ + shouldCreateCustomerProfile: true, + iframeUrl: "", + }); const response = await initializePaymentGateways({ variables: { appId: authorizeNetAppId, checkoutId, - data: {}, + data: { + /** + * This needs to be selectable - if we want type apple pay, paypal, or acceptHosted + */ + type: "acceptJs", + data: payloadData, + }, }, }); @@ -55,9 +72,7 @@ export const PaymentMethods = () => { throw new Error("No payment gateway found"); } - console.log(gateway.data); - - const data = paymentGatewayInitializeSessionSchema.parse(gateway.data); + const data = paymentGatewayInitializeSessionSchema?.parse(gateway.data); if (!data) { throw new Error("No data found"); @@ -80,6 +95,11 @@ export const PaymentMethods = () => { )} + {paymentMethods?.acceptJs !== undefined && ( +
  • + +
  • + )} {paymentMethods?.applePay !== undefined && (
  • diff --git a/src/modules/authorize-net/gateways/accept-js-gateway.ts b/src/modules/authorize-net/gateways/accept-js-gateway.ts index 077abe9..8d232de 100644 --- a/src/modules/authorize-net/gateways/accept-js-gateway.ts +++ b/src/modules/authorize-net/gateways/accept-js-gateway.ts @@ -1,7 +1,12 @@ -import type AuthorizeNet from "authorizenet"; import { z } from "zod"; -import { getAuthorizeConfig, type AuthorizeConfig } from "../authorize-net-config"; +import { APIContracts } from "authorizenet"; +import { + getAuthorizeConfig, + type AuthorizeConfig, + authorizeEnvironmentSchema, +} from "../authorize-net-config"; import { authorizeTransaction } from "../authorize-transaction-builder"; +import { CustomerProfileManager } from "../../customer-profile/customer-profile-manager"; import { CreateTransactionClient, @@ -35,11 +40,27 @@ type AcceptJsPaymentGatewayResponseData = z.infer { + ): Promise { // Build initial transaction request const transactionRequest = authorizeTransaction.buildTransactionFromTransactionInitializePayload(payload); + const user = payload.sourceObject.user; // Parse the payload `data` object const parseResult = acceptJsTransactionInitializeRequestDataSchema.safeParse(payload.data); @@ -85,14 +109,40 @@ export class AcceptJsGateway implements PaymentGateway { // START: Synchronize fields specific for Accept.js gateway - // const payment = new AuthorizeNet.APIContracts.PaymentType(); - // const opaqueData = new AuthorizeNet.APIContracts.OpaqueDataType(); + const payment = new APIContracts.PaymentType(); + const opaqueDataType = new APIContracts.OpaqueDataType(); + const { + data: { opaqueData, shouldCreateCustomerProfile }, + } = parseResult.data; + + if (opaqueData?.dataDescriptor && opaqueData?.dataValue) { + opaqueDataType.setDataDescriptor(opaqueData.dataDescriptor); + opaqueDataType.setDataValue(opaqueData.dataValue); + } + + if (!shouldCreateCustomerProfile) { + this.logger.trace("Skipping customerProfileId lookup."); + } - // opaqueData.setDataDescriptor(""); - // opaqueData.setDataValue(""); + let customerProfileId = null; + if (user && shouldCreateCustomerProfile) { + this.logger.trace("Looking up customerProfileId."); + customerProfileId = await this.customerProfileManager.getUserCustomerProfileId({ + user, + }); + } + + if (customerProfileId) { + this.logger.trace("Found customerProfileId, adding to transaction request."); + const profile = { + customerProfileId, + }; + + transactionRequest.setProfile(profile); + } - // payment.setOpaqueData(opaqueData); - // transactionRequest.setPayment(payment); + payment.setOpaqueData(opaqueDataType); + transactionRequest.setPayment(payment); // END: Synchronize fields specific for Accept.js gateway @@ -100,9 +150,12 @@ export class AcceptJsGateway implements PaymentGateway { } private mapResponseToTransactionInitializeData( - _response: CreateTransactionResponse, + response: CreateTransactionResponse, ): AcceptJsTransactionInitializeResponseData { - const dataParseResult = acceptJsTransactionInitializeResponseDataSchema.safeParse({}); + const dataParseResult = acceptJsTransactionInitializeResponseDataSchema.safeParse({ + response, + environment: this.authorizeConfig.environment, + }); if (!dataParseResult.success) { this.logger.error({ error: dataParseResult.error.format() }); diff --git a/src/modules/webhooks/payment-gateway-initialize-session.ts b/src/modules/webhooks/payment-gateway-initialize-session.ts index 1e22c03..b363373 100644 --- a/src/modules/webhooks/payment-gateway-initialize-session.ts +++ b/src/modules/webhooks/payment-gateway-initialize-session.ts @@ -16,6 +16,10 @@ export const paymentGatewayInitializeSessionRequestDataSchema = z.union([ acceptJsPaymentGatewayRequestDataSchema, ]); +const dataSchema = z.object({ + type: z.string().optional(), +}); + export class PaymentGatewayInitializeSessionService { async execute( payload: PaymentGatewayInitializeSessionEventFragment, diff --git a/src/pages/api/manifest.ts b/src/pages/api/manifest.ts index ff9963b..a1fabb2 100644 --- a/src/pages/api/manifest.ts +++ b/src/pages/api/manifest.ts @@ -11,21 +11,25 @@ import { listStoredPaymentMethodsSyncWebhook } from "./webhooks/list-stored-paym export default createManifestHandler({ async manifestFactory(context) { + const baseDomain = + (context.request.headers["x-forwarded-host"] as string) || + (context.request.headers.host as string); + const appBaseUrl = `https://${baseDomain}`; const manifest: AppManifest = { name: "Authorize.net", - tokenTargetUrl: `${context.appBaseUrl}/api/register`, - appUrl: `${context.appBaseUrl}/config`, + tokenTargetUrl: `${appBaseUrl}/api/register`, + appUrl: `${appBaseUrl}/config`, permissions: ["HANDLE_PAYMENTS"], id: "saleor.app.authorize.net", version: packageJson.version, requiredSaleorVersion: ">=3.13", webhooks: [ - transactionInitializeSessionSyncWebhook.getWebhookManifest(context.appBaseUrl), - transactionProcessSessionSyncWebhook.getWebhookManifest(context.appBaseUrl), - transactionCancelationRequestedSyncWebhook.getWebhookManifest(context.appBaseUrl), - transactionRefundRequestedSyncWebhook.getWebhookManifest(context.appBaseUrl), - paymentGatewayInitializeSessionSyncWebhook.getWebhookManifest(context.appBaseUrl), - listStoredPaymentMethodsSyncWebhook.getWebhookManifest(context.appBaseUrl), + transactionInitializeSessionSyncWebhook.getWebhookManifest(appBaseUrl), + transactionProcessSessionSyncWebhook.getWebhookManifest(appBaseUrl), + transactionCancelationRequestedSyncWebhook.getWebhookManifest(appBaseUrl), + transactionRefundRequestedSyncWebhook.getWebhookManifest(appBaseUrl), + paymentGatewayInitializeSessionSyncWebhook.getWebhookManifest(appBaseUrl), + listStoredPaymentMethodsSyncWebhook.getWebhookManifest(appBaseUrl), ], extensions: [ /** From 93759c46c81146bb4e61b2c6515fa561ecece5b6 Mon Sep 17 00:00:00 2001 From: Jannik Zinkl Date: Thu, 25 Apr 2024 12:02:52 +0200 Subject: [PATCH 10/37] feat: making initialise array --- example/graphql/PaymentGatewayInitialize.graphql | 4 ++-- example/graphql/ProductList.graphql | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/example/graphql/PaymentGatewayInitialize.graphql b/example/graphql/PaymentGatewayInitialize.graphql index 05d5f93..77ac144 100644 --- a/example/graphql/PaymentGatewayInitialize.graphql +++ b/example/graphql/PaymentGatewayInitialize.graphql @@ -1,5 +1,5 @@ -mutation PaymentGatewayInitialize($checkoutId: ID!, $data: JSON, $appId: String!) { - paymentGatewayInitialize(paymentGateways: [{ id: $appId, data: $data }], id: $checkoutId) { +mutation PaymentGatewayInitialize($checkoutId: ID!, $paymentGateways: [PaymentGatewayToInitialize!]) { + paymentGatewayInitialize(paymentGateways: $paymentGateways, id: $checkoutId) { gatewayConfigs { id data diff --git a/example/graphql/ProductList.graphql b/example/graphql/ProductList.graphql index b0a8068..ececd00 100644 --- a/example/graphql/ProductList.graphql +++ b/example/graphql/ProductList.graphql @@ -1,8 +1,8 @@ -query ProductList { +query ProductList($channel: String) { products( first: 1 - channel: "ken-r" - where: { isAvailable: true, giftCard: false, ids: ["UHJvZHVjdDoyNjA3MA=="] } + channel: $channel + where: { isAvailable: true, giftCard: false, stockAvailability: IN_STOCK } sortBy: { field: PRICE, direction: DESC } ) { edges { From 12ccd28874c371121f268153ff17abdee7026c8e Mon Sep 17 00:00:00 2001 From: Jannik Zinkl Date: Thu, 25 Apr 2024 12:07:42 +0200 Subject: [PATCH 11/37] feat: making channel and other things dynamic --- example/.env.example | 1 + example/src/pages/index.tsx | 6 ++++++ example/src/payment-methods.tsx | 38 ++++++++++++++++++++++++--------- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/example/.env.example b/example/.env.example index 179d8dd..11c3e52 100644 --- a/example/.env.example +++ b/example/.env.example @@ -1 +1,2 @@ SALEOR_API_URL= +NEXT_PUBLIC_SALEOR_CHANNEL="default-channel" \ No newline at end of file diff --git a/example/src/pages/index.tsx b/example/src/pages/index.tsx index fcfe50e..39ce2bf 100644 --- a/example/src/pages/index.tsx +++ b/example/src/pages/index.tsx @@ -17,6 +17,12 @@ import { export default function Page() { const { data, loading } = useQuery( gql(ProductListDocument.toString()), + { + /** + * We pull an example product from this saleor channel. + */ + variables: { channel: process.env.NEXT_PUBLIC_SALEOR_CHANNEL }, + }, ); const [createCheckout] = useMutation( diff --git a/example/src/payment-methods.tsx b/example/src/payment-methods.tsx index b27796b..5332568 100644 --- a/example/src/payment-methods.tsx +++ b/example/src/payment-methods.tsx @@ -28,11 +28,15 @@ type PaymentMethods = z.infer; const paymentGatewayInitializeSessionSchema = dataSchema; -const payloadDataSchema = z.object({ +const payloadDataSchemaAcceptHosted = z.object({ shouldCreateCustomerProfile: z.boolean(), iframeUrl: z.string(), }); +const payloadDataSchemaAcceptJs = z.object({ + shouldCreateCustomerProfile: z.boolean(), +}); + export const PaymentMethods = () => { const [isLoading, setIsLoading] = React.useState(false); const [paymentMethods, setPaymentMethods] = React.useState(); @@ -46,21 +50,35 @@ export const PaymentMethods = () => { const getPaymentGateways = React.useCallback(async () => { setIsLoading(true); - const payloadData = payloadDataSchema.parse({ + const payloadDataAcceptHosted = payloadDataSchemaAcceptHosted.parse({ shouldCreateCustomerProfile: true, iframeUrl: "", }); + const payloadDataAcceptJs = payloadDataSchemaAcceptJs.parse({ + shouldCreateCustomerProfile: true, + }); const response = await initializePaymentGateways({ variables: { - appId: authorizeNetAppId, checkoutId, - data: { - /** - * This needs to be selectable - if we want type apple pay, paypal, or acceptHosted - */ - type: "acceptJs", - data: payloadData, - }, + paymentGateways: [ + { + id: authorizeNetAppId, + data: { + /** + * This needs to be selectable - if we want type apple pay, paypal, or acceptHosted + */ + type: "acceptHosted", + data: payloadDataAcceptHosted, + }, + }, + { + id: authorizeNetAppId, + data: { + type: "acceptJs", + data: payloadDataAcceptJs, + }, + }, + ], }, }); From 2740de657caa72eaf10b39228de724e507e37659 Mon Sep 17 00:00:00 2001 From: Adrian Pilarczyk Date: Thu, 25 Apr 2024 12:45:10 +0200 Subject: [PATCH 12/37] add support for multiple payment gateways --- .../authorize-net/gateways/accept-hosted-gateway.ts | 9 +-------- src/modules/authorize-net/gateways/accept-js-gateway.ts | 5 ----- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/modules/authorize-net/gateways/accept-hosted-gateway.ts b/src/modules/authorize-net/gateways/accept-hosted-gateway.ts index ef3c032..96d96db 100644 --- a/src/modules/authorize-net/gateways/accept-hosted-gateway.ts +++ b/src/modules/authorize-net/gateways/accept-hosted-gateway.ts @@ -26,11 +26,6 @@ import { type TransactionInitializeSessionResponse } from "@/schemas/Transaction const ApiContracts = AuthorizeNet.APIContracts; -export const acceptHostedPaymentGatewayRequestDataSchema = gatewayUtils.createGatewayDataSchema( - "acceptHosted", - z.object({}), -); - export const acceptHostedPaymentGatewayResponseDataSchema = z.object({}); type AcceptHostedPaymentGatewayResponseData = z.infer< @@ -189,9 +184,7 @@ export class AcceptHostedGateway implements PaymentGateway { async initializePaymentGateway( _payload: PaymentGatewayInitializeSessionEventFragment, ): Promise { - return { - data: {}, - }; + return {}; } async initializeTransaction( diff --git a/src/modules/authorize-net/gateways/accept-js-gateway.ts b/src/modules/authorize-net/gateways/accept-js-gateway.ts index 8d232de..11e1f0a 100644 --- a/src/modules/authorize-net/gateways/accept-js-gateway.ts +++ b/src/modules/authorize-net/gateways/accept-js-gateway.ts @@ -26,11 +26,6 @@ import { } from "@/modules/authorize-net/gateways/payment-gateway"; import { type TransactionInitializeSessionResponse } from "@/schemas/TransactionInitializeSession/TransactionInitializeSessionResponse.mjs"; -export const acceptJsPaymentGatewayRequestDataSchema = gatewayUtils.createGatewayDataSchema( - "acceptJs", - z.object({}), -); - export const acceptJsPaymentGatewayResponseDataSchema = z.object({}); type AcceptJsPaymentGatewayResponseData = z.infer; From 26bb89c251d38070381566e5129df4e9a44d9d11 Mon Sep 17 00:00:00 2001 From: Pankaj Patel Date: Fri, 26 Apr 2024 19:27:14 +0530 Subject: [PATCH 13/37] Add support for customer profile --- src/modules/authorize-net/gateways/accept-js-gateway.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/modules/authorize-net/gateways/accept-js-gateway.ts b/src/modules/authorize-net/gateways/accept-js-gateway.ts index 11e1f0a..cbaaba1 100644 --- a/src/modules/authorize-net/gateways/accept-js-gateway.ts +++ b/src/modules/authorize-net/gateways/accept-js-gateway.ts @@ -129,11 +129,7 @@ export class AcceptJsGateway implements PaymentGateway { if (customerProfileId) { this.logger.trace("Found customerProfileId, adding to transaction request."); - const profile = { - customerProfileId, - }; - - transactionRequest.setProfile(profile); + transactionRequest.setCustomer({ id: customerProfileId }); } payment.setOpaqueData(opaqueDataType); From 97528da2866919de4c6aac66628a99025f90a535 Mon Sep 17 00:00:00 2001 From: Pankaj Patel Date: Fri, 26 Apr 2024 19:48:44 +0530 Subject: [PATCH 14/37] remove state support --- example/src/accept-payment-form.tsx | 54 ++++------------------------- 1 file changed, 6 insertions(+), 48 deletions(-) diff --git a/example/src/accept-payment-form.tsx b/example/src/accept-payment-form.tsx index 4900060..6a22a85 100644 --- a/example/src/accept-payment-form.tsx +++ b/example/src/accept-payment-form.tsx @@ -16,15 +16,8 @@ import { useRouter } from "next/router"; import { useAcceptJs } from "react-acceptjs"; const authData = { - apiLoginID: process.env.NEXT_PUBLIC_AUTHORIZE_API_LOGIN_ID, - clientKey: process.env.NEXT_PUBLIC_AUTHORIZE_PUBLIC_CLIENT_KEY, -}; - -type BasicCardInfo = { - cardNumber: string; - cardCode: string; - month: string; - year: string; + apiLoginID: process.env.NEXT_PUBLIC_AUTHORIZE_API_LOGIN_ID as string, + clientKey: process.env.NEXT_PUBLIC_AUTHORIZE_PUBLIC_CLIENT_KEY as string, }; export interface IAuthorizeTransactionResponse { @@ -55,13 +48,6 @@ export function AcceptPaymentForm() { const checkoutId = getCheckoutId(); const router = useRouter(); const { dispatchData, loading, error } = useAcceptJs({ authData }); - const [cardData, setCardData] = React.useState({ - cardNumber: "", - month: "", - year: "", - cardCode: "", - }); - const [initializeTransaction] = useMutation< TransactionInitializeMutation, TransactionInitializeMutationVariables @@ -166,41 +152,13 @@ export function AcceptPaymentForm() { <>
    - setCardData({ ...cardData, cardNumber: event.target.value })} - /> + - setCardData({ ...cardData, month: event.target.value })} - /> + - setCardData({ ...cardData, year: event.target.value })} - /> + - setCardData({ ...cardData, cardCode: event.target.value })} - /> +