From 8bf513fb3c00d7a43b23628718a294175ce3b8dc Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Mon, 16 Jun 2025 15:12:46 +0200 Subject: [PATCH 1/5] update schema and sdk --- generated/graphql.ts | 215 +++++++++++++++------------------ generated/schema.graphql | 210 ++++++++++++++------------------ graphql/schema.graphql | 252 +++++++++++++++++---------------------- package.json | 2 +- pnpm-lock.yaml | 10 +- 5 files changed, 294 insertions(+), 395 deletions(-) diff --git a/generated/graphql.ts b/generated/graphql.ts index 2dde90f0..a7acd77b 100644 --- a/generated/graphql.ts +++ b/generated/graphql.ts @@ -317,7 +317,6 @@ export type AccountError = { message?: Maybe; }; -/** An enumeration. */ export type AccountErrorCode = | 'ACCOUNT_NOT_CONFIRMED' | 'ACTIVATE_OWN_ACCOUNT' @@ -722,7 +721,6 @@ export type AddressSetDefault = { user?: Maybe; }; -/** An enumeration. */ export type AddressTypeEnum = | 'BILLING' | 'SHIPPING'; @@ -1183,7 +1181,6 @@ export type AppError = { permissions?: Maybe>; }; -/** An enumeration. */ export type AppErrorCode = | 'FORBIDDEN' | 'GRAPHQL_ERROR' @@ -1616,7 +1613,6 @@ export type AppUpdated = Event & { version?: Maybe; }; -/** An enumeration. */ export type AreaUnitsEnum = | 'SQ_CM' | 'SQ_DM' @@ -1830,7 +1826,6 @@ export type AttributeBulkCreateError = { path?: Maybe; }; -/** An enumeration. */ export type AttributeBulkCreateErrorCode = | 'ALREADY_EXISTS' | 'BLANK' @@ -1945,7 +1940,6 @@ export type AttributeBulkUpdateError = { path?: Maybe; }; -/** An enumeration. */ export type AttributeBulkUpdateErrorCode = | 'ALREADY_EXISTS' | 'BLANK' @@ -2126,7 +2120,6 @@ export type AttributeDeleted = Event & { version?: Maybe; }; -/** An enumeration. */ export type AttributeEntityTypeEnum = | 'PAGE' | 'PRODUCT' @@ -2149,7 +2142,6 @@ export type AttributeError = { message?: Maybe; }; -/** An enumeration. */ export type AttributeErrorCode = | 'ALREADY_EXISTS' | 'GRAPHQL_ERROR' @@ -2195,7 +2187,6 @@ export type AttributeInput = { valuesRange?: InputMaybe; }; -/** An enumeration. */ export type AttributeInputTypeEnum = | 'BOOLEAN' | 'DATE' @@ -2302,7 +2293,6 @@ export type AttributeTranslate = { translationErrors: Array; }; -/** An enumeration. */ export type AttributeTranslateErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -2326,7 +2316,6 @@ export type AttributeTranslation = Node & { translatableContent?: Maybe; }; -/** An enumeration. */ export type AttributeTypeEnum = | 'PAGE_TYPE' | 'PRODUCT_TYPE'; @@ -2795,7 +2784,6 @@ export type AttributeValueTranslate = { translationErrors: Array; }; -/** An enumeration. */ export type AttributeValueTranslateErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -3914,7 +3902,6 @@ export type ChannelError = { warehouses?: Maybe>; }; -/** An enumeration. */ export type ChannelErrorCode = | 'ALREADY_EXISTS' | 'CHANNELS_CURRENCY_MUST_BE_THE_SAME' @@ -4535,7 +4522,6 @@ export type CheckoutCreateFromOrderError = { message?: Maybe; }; -/** An enumeration. */ export type CheckoutCreateFromOrderErrorCode = | 'CHANNEL_INACTIVE' | 'GRAPHQL_ERROR' @@ -4555,7 +4541,6 @@ export type CheckoutCreateFromOrderUnavailableVariant = { variantId: Scalars['ID']; }; -/** An enumeration. */ export type CheckoutCreateFromOrderUnavailableVariantErrorCode = | 'INSUFFICIENT_STOCK' | 'NOT_FOUND' @@ -4685,7 +4670,6 @@ export type CheckoutError = { variants?: Maybe>; }; -/** An enumeration. */ export type CheckoutErrorCode = | 'BILLING_ADDRESS_NOT_SET' | 'CHANNEL_INACTIVE' @@ -4756,7 +4740,7 @@ export type CheckoutFilterShippingMethods = Event & { }; /** - * Event sent when checkout is fully paid with transactions. + * Event sent when checkout is fully paid with transactions. The checkout is considered as fully paid when the checkout `charge_status` is `FULL` or `OVERCHARGED`. The event is not sent when the checkout authorization flow strategy is used. * * Added in Saleor 3.13. * @@ -5128,6 +5112,12 @@ export type CheckoutRemovePromoCode = { */ export type CheckoutSettings = { __typename?: 'CheckoutSettings'; + /** + * Default `false`. Determines if the paid checkouts should be automatically completed. This setting applies only to checkouts where payment was processed through transactions.When enabled, the checkout will be automatically completed once the checkout `charge_status` reaches `FULL`. This occurs when the total sum of charged and authorized transaction amounts equals or exceeds the checkout's total amount. + * + * Added in Saleor 3.20. + */ + automaticallyCompleteFullyPaidCheckouts: Scalars['Boolean']; /** * 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. * @@ -5137,6 +5127,12 @@ export type CheckoutSettings = { }; export type CheckoutSettingsInput = { + /** + * Default `false`. Determines if the paid checkouts should be automatically completed. This setting applies only to checkouts where payment was processed through transactions.When enabled, the checkout will be automatically completed once the checkout `charge_status` reaches `FULL`. This occurs when the total sum of charged and authorized transaction amounts equals or exceeds the checkout's total amount. + * + * Added in Saleor 3.20. + */ + automaticallyCompleteFullyPaidCheckouts?: InputMaybe; /** * 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. * @@ -5589,7 +5585,6 @@ export type CollectionError = { products?: Maybe>; }; -/** An enumeration. */ export type CollectionErrorCode = | 'CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT' | 'DUPLICATED_INPUT_ITEM' @@ -5915,7 +5910,6 @@ export type ConfigurationItemInput = { value?: InputMaybe; }; -/** An enumeration. */ export type ConfigurationTypeFieldEnum = | 'BOOLEAN' | 'MULTILINE' @@ -6335,7 +6329,6 @@ export type CustomerBulkUpdateError = { path?: Maybe; }; -/** An enumeration. */ export type CustomerBulkUpdateErrorCode = | 'BLANK' | 'DUPLICATED_INPUT_ITEM' @@ -6432,7 +6425,6 @@ export type CustomerEvent = Node & { user?: Maybe; }; -/** An enumeration. */ export type CustomerEventsEnum = | 'ACCOUNT_ACTIVATED' | 'ACCOUNT_CREATED' @@ -6892,7 +6884,6 @@ export type DiscountError = { voucherCodes?: Maybe>; }; -/** An enumeration. */ export type DiscountErrorCode = | 'ALREADY_EXISTS' | 'CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT' @@ -6924,7 +6915,6 @@ export type DiscountedObjectWhereInput = { baseTotalPrice?: InputMaybe; }; -/** An enumeration. */ export type DistanceUnitsEnum = | 'CM' | 'DM' @@ -7313,7 +7303,6 @@ export type ExportError = { message?: Maybe; }; -/** An enumeration. */ export type ExportErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -7337,7 +7326,6 @@ export type ExportEvent = Node & { user?: Maybe; }; -/** An enumeration. */ export type ExportEventsEnum = | 'EXPORTED_FILE_SENT' | 'EXPORT_DELETED' @@ -7553,7 +7541,6 @@ export type ExternalNotificationError = { message?: Maybe; }; -/** An enumeration. */ export type ExternalNotificationErrorCodes = | 'CHANNEL_INACTIVE' | 'INVALID_MODEL_TYPE' @@ -7633,7 +7620,6 @@ export type File = { url: Scalars['String']; }; -/** An enumeration. */ export type FileTypesEnum = | 'CSV' | 'XLSX'; @@ -7925,7 +7911,6 @@ export type FulfillmentReturnProducts = { returnFulfillment?: Maybe; }; -/** An enumeration. */ export type FulfillmentStatus = | 'CANCELED' | 'FULFILLED' @@ -8457,7 +8442,6 @@ export type GiftCardError = { tags?: Maybe>; }; -/** An enumeration. */ export type GiftCardErrorCode = | 'ALREADY_EXISTS' | 'DUPLICATED_INPUT_ITEM' @@ -8522,7 +8506,6 @@ export type GiftCardEventFilterInput = { type?: InputMaybe; }; -/** An enumeration. */ export type GiftCardEventsEnum = | 'ACTIVATED' | 'BALANCE_RESET' @@ -8659,13 +8642,11 @@ export type GiftCardSettingsError = { message?: Maybe; }; -/** An enumeration. */ export type GiftCardSettingsErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' | 'REQUIRED'; -/** An enumeration. */ export type GiftCardSettingsExpiryTypeEnum = | 'EXPIRY_PERIOD' | 'NEVER_EXPIRE'; @@ -9090,7 +9071,6 @@ export type InvoiceError = { message?: Maybe; }; -/** An enumeration. */ export type InvoiceErrorCode = | 'EMAIL_NOT_SET' | 'INVALID_STATUS' @@ -9228,14 +9208,12 @@ export type Job = { updatedAt: Scalars['DateTime']; }; -/** An enumeration. */ export type JobStatusEnum = | 'DELETED' | 'FAILED' | 'PENDING' | 'SUCCESS'; -/** An enumeration. */ export type LanguageCodeEnum = | 'AF' | 'AF_NA' @@ -10166,7 +10144,6 @@ export type MarkAsPaidStrategyEnum = | 'PAYMENT_FLOW' | 'TRANSACTION_FLOW'; -/** An enumeration. */ export type MeasurementUnitsEnum = | 'ACRE_FT' | 'ACRE_IN' @@ -10442,7 +10419,6 @@ export type MenuError = { message?: Maybe; }; -/** An enumeration. */ export type MenuErrorCode = | 'CANNOT_ASSIGN_NODE' | 'GRAPHQL_ERROR' @@ -10924,7 +10900,6 @@ export type MetadataError = { message?: Maybe; }; -/** An enumeration. */ export type MetadataErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -13265,6 +13240,11 @@ export type Mutation = { * 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. + * + * Triggers the following webhook events: + * - TRANSACTION_ITEM_METADATA_UPDATED (async): Optionally called when transaction's metadata was updated. + * - CHECKOUT_FULLY_PAID (async): Optionally called when the checkout charge status changed to `FULL` or `OVERCHARGED`. + * - ORDER_UPDATED (async): Optionally called when the transaction is related to the order and the order was updated. */ transactionEventReport?: Maybe; /** @@ -15219,6 +15199,8 @@ export type MutationTransactionEventReportArgs = { pspReference: Scalars['String']; time?: InputMaybe; token?: InputMaybe; + transactionMetadata?: InputMaybe>; + transactionPrivateMetadata?: InputMaybe>; type: TransactionEventTypeEnum; }; @@ -15939,7 +15921,6 @@ export type OrderBulkCreateError = { path?: Maybe; }; -/** An enumeration. */ export type OrderBulkCreateErrorCode = | 'BULK_LIMIT' | 'FUTURE_DATE' @@ -16078,6 +16059,12 @@ export type OrderBulkCreateOrderLineInput = { privateMetadata?: InputMaybe>; /** The name of the product. */ productName?: InputMaybe; + /** + * The SKU of the product. + * + * Added in Saleor 3.18. + */ + productSku?: InputMaybe; /** Number of items in the order line */ quantity: Scalars['Int']; /** The ID of the tax class. */ @@ -16098,6 +16085,24 @@ export type OrderBulkCreateOrderLineInput = { translatedVariantName?: InputMaybe; /** Price of the order line excluding applied discount. */ undiscountedTotalPrice: TaxedMoneyInput; + /** + * Reason of the discount on order line. + * + * Added in Saleor 3.19. + */ + unitDiscountReason?: InputMaybe; + /** + * Type of the discount: fixed or percent + * + * Added in Saleor 3.19. + */ + unitDiscountType?: InputMaybe; + /** + * Value of the discount. Can store fixed value or percent value + * + * Added in Saleor 3.19. + */ + unitDiscountValue?: InputMaybe; /** The external ID of the product variant. */ variantExternalReference?: InputMaybe; /** The ID of the product variant. */ @@ -16308,7 +16313,6 @@ export type OrderCreateFromCheckoutError = { variants?: Maybe>; }; -/** An enumeration. */ export type OrderCreateFromCheckoutErrorCode = | 'BILLING_ADDRESS_NOT_SET' | 'CHANNEL_INACTIVE' @@ -16412,7 +16416,6 @@ export type OrderDiscountDelete = { orderErrors: Array; }; -/** An enumeration. */ export type OrderDiscountType = | 'MANUAL' | 'ORDER_PROMOTION' @@ -16460,7 +16463,6 @@ export type OrderError = { warehouse?: Maybe; }; -/** An enumeration. */ export type OrderErrorCode = | 'BILLING_ADDRESS_NOT_SET' | 'CANNOT_CANCEL_FULFILLMENT' @@ -16607,7 +16609,6 @@ export type OrderEventOrderLineObject = { quantity?: Maybe; }; -/** An enumeration. */ export type OrderEventsEmailsEnum = | 'CONFIRMED' | 'DIGITAL_LINKS' @@ -16661,6 +16662,7 @@ export type OrderEventsEnum = | 'PAYMENT_REFUNDED' | 'PAYMENT_VOIDED' | 'PLACED' + | 'PLACED_AUTOMATICALLY_FROM_PAID_CHECKOUT' | 'PLACED_FROM_DRAFT' | 'REMOVED_PRODUCTS' | 'TRACKING_UPDATED' @@ -16884,7 +16886,6 @@ export type OrderGrantRefundCreateError = { message?: Maybe; }; -/** An enumeration. */ export type OrderGrantRefundCreateErrorCode = | 'AMOUNT_GREATER_THAN_AVAILABLE' | 'GRAPHQL_ERROR' @@ -16936,7 +16937,6 @@ export type OrderGrantRefundCreateLineError = { message?: Maybe; }; -/** An enumeration. */ export type OrderGrantRefundCreateLineErrorCode = | 'GRAPHQL_ERROR' | 'NOT_FOUND' @@ -16995,7 +16995,6 @@ export type OrderGrantRefundUpdateError = { removeLines?: Maybe>; }; -/** An enumeration. */ export type OrderGrantRefundUpdateErrorCode = | 'AMOUNT_GREATER_THAN_AVAILABLE' | 'GRAPHQL_ERROR' @@ -17064,7 +17063,6 @@ export type OrderGrantRefundUpdateLineError = { message?: Maybe; }; -/** An enumeration. */ export type OrderGrantRefundUpdateLineErrorCode = | 'GRAPHQL_ERROR' | 'NOT_FOUND' @@ -17287,17 +17285,17 @@ export type OrderLine = Node & ObjectWithMetadata & { translatedVariantName: Scalars['String']; /** Price of the order line without discounts. */ undiscountedTotalPrice: TaxedMoney; - /** Price of the single item in the order line without applied an order line discount. */ + /** Price of the single item in the order line without any discount applied. */ undiscountedUnitPrice: TaxedMoney; - /** The discount applied to the single order line. */ + /** Sum of the line-level discounts applied to the order line. Order-level discounts which affect the line are not visible in this field. For order-level discount portion (if any), please query `order.discounts` field. */ unitDiscount: Money; - /** Reason for any discounts applied on a product in the order. */ + /** Reason for line-level discounts applied on the order line. Order-level discounts which affect the line are not visible in this field. For order-level discount reason (if any), please query `order.discounts` field. */ unitDiscountReason?: Maybe; - /** Type of the discount: fixed or percent */ + /** Type of the discount: `fixed` or `percent`. This field shouldn't be used when multiple discounts affect the line. There is a limitation, that after running `checkoutComplete` mutation the field is always set to `fixed`. */ unitDiscountType?: Maybe; - /** Value of the discount. Can store fixed value or percent value */ + /** Value of the discount. Can store fixed value or percent value. This field shouldn't be used when multiple discounts affect the line. There is a limitation, that after running `checkoutComplete` mutation the field always stores fixed value. */ unitDiscountValue: Scalars['PositiveDecimal']; - /** Price of the single item in the order line. */ + /** Price of the single item in the order line with all the line-level discounts and order-level discount portions applied. */ unitPrice: 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. */ variant?: Maybe; @@ -17508,7 +17506,6 @@ export type OrderNoteAddError = { message?: Maybe; }; -/** An enumeration. */ export type OrderNoteAddErrorCode = | 'GRAPHQL_ERROR' | 'REQUIRED'; @@ -17546,7 +17543,6 @@ export type OrderNoteUpdateError = { message?: Maybe; }; -/** An enumeration. */ export type OrderNoteUpdateErrorCode = | 'GRAPHQL_ERROR' | 'NOT_FOUND' @@ -17554,7 +17550,6 @@ export type OrderNoteUpdateErrorCode = export type OrderOrCheckout = Checkout | Order; -/** An enumeration. */ export type OrderOriginEnum = | 'BULK_CREATE' | 'CHECKOUT' @@ -17743,7 +17738,6 @@ export type OrderSettingsError = { message?: Maybe; }; -/** An enumeration. */ export type OrderSettingsErrorCode = | 'INVALID'; @@ -17852,7 +17846,6 @@ export type OrderSortingInput = { field: OrderSortField; }; -/** An enumeration. */ export type OrderStatus = | 'CANCELED' | 'DRAFT' @@ -18245,7 +18238,6 @@ export type PageError = { values?: Maybe>; }; -/** An enumeration. */ export type PageErrorCode = | 'ATTRIBUTE_ALREADY_ASSIGNED' | 'DUPLICATED_INPUT_ITEM' @@ -18964,7 +18956,6 @@ export type PaymentCaptureEvent = Event & { version?: Maybe; }; -/** An enumeration. */ export type PaymentChargeStatusEnum = | 'CANCELLED' | 'FULLY_CHARGED' @@ -19044,7 +19035,6 @@ export type PaymentError = { variants?: Maybe>; }; -/** An enumeration. */ export type PaymentErrorCode = | 'BALANCE_CHECK_ERROR' | 'BILLING_ADDRESS_NOT_SET' @@ -19107,7 +19097,6 @@ export type PaymentGatewayConfigError = { message?: Maybe; }; -/** An enumeration. */ export type PaymentGatewayConfigErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -19137,7 +19126,6 @@ export type PaymentGatewayInitializeError = { message?: Maybe; }; -/** An enumeration. */ export type PaymentGatewayInitializeErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -19199,7 +19187,6 @@ export type PaymentGatewayInitializeTokenizationError = { message?: Maybe; }; -/** An enumeration. */ export type PaymentGatewayInitializeTokenizationErrorCode = | 'CHANNEL_INACTIVE' | 'GATEWAY_ERROR' @@ -19348,7 +19335,6 @@ export type PaymentMethodInitializeTokenizationError = { message?: Maybe; }; -/** An enumeration. */ export type PaymentMethodInitializeTokenizationErrorCode = | 'CHANNEL_INACTIVE' | 'GATEWAY_ERROR' @@ -19416,7 +19402,6 @@ export type PaymentMethodProcessTokenizationError = { message?: Maybe; }; -/** An enumeration. */ export type PaymentMethodProcessTokenizationErrorCode = | 'CHANNEL_INACTIVE' | 'GATEWAY_ERROR' @@ -19615,7 +19600,6 @@ export type Permission = { name: Scalars['String']; }; -/** An enumeration. */ export type PermissionEnum = | 'HANDLE_CHECKOUTS' | 'HANDLE_PAYMENTS' @@ -19753,7 +19737,6 @@ export type PermissionGroupError = { users?: Maybe>; }; -/** An enumeration. */ export type PermissionGroupErrorCode = | 'ASSIGN_NON_STAFF_MEMBER' | 'CANNOT_REMOVE_FROM_LAST_GROUP' @@ -19911,7 +19894,6 @@ export type PluginError = { message?: Maybe; }; -/** An enumeration. */ export type PluginErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -19962,7 +19944,6 @@ export type PluginUpdateInput = { configuration?: InputMaybe>; }; -/** An enumeration. */ export type PostalCodeRuleInclusionTypeEnum = | 'EXCLUDE' | 'INCLUDE'; @@ -20354,7 +20335,6 @@ export type ProductBulkCreateError = { warehouses?: Maybe>; }; -/** An enumeration. */ export type ProductBulkCreateErrorCode = | 'ATTRIBUTE_ALREADY_ASSIGNED' | 'ATTRIBUTE_CANNOT_BE_ASSIGNED' @@ -20822,7 +20802,6 @@ export type ProductError = { values?: Maybe>; }; -/** An enumeration. */ export type ProductErrorCode = | 'ALREADY_EXISTS' | 'ATTRIBUTE_ALREADY_ASSIGNED' @@ -21208,7 +21187,6 @@ export type ProductMediaReorder = { productErrors: Array; }; -/** An enumeration. */ export type ProductMediaType = | 'IMAGE' | 'VIDEO'; @@ -21466,7 +21444,6 @@ export type ProductTranslate = { translationErrors: Array; }; -/** An enumeration. */ export type ProductTranslateErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -21756,7 +21733,6 @@ export type ProductTypeInput = { weight?: InputMaybe; }; -/** An enumeration. */ export type ProductTypeKindEnum = | 'GIFT_CARD' | 'NORMAL'; @@ -22175,7 +22151,6 @@ export type ProductVariantBulkError = { warehouses?: Maybe>; }; -/** An enumeration. */ export type ProductVariantBulkErrorCode = | 'ATTRIBUTE_ALREADY_ASSIGNED' | 'ATTRIBUTE_CANNOT_BE_ASSIGNED' @@ -22850,7 +22825,6 @@ export type ProductVariantTranslate = { translationErrors: Array; }; -/** An enumeration. */ export type ProductVariantTranslateErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -23177,7 +23151,6 @@ export type PromotionCreateError = { rulesLimitExceedBy?: Maybe; }; -/** An enumeration. */ export type PromotionCreateErrorCode = | 'GIFTS_NUMBER_LIMIT' | 'GRAPHQL_ERROR' @@ -23280,7 +23253,6 @@ export type PromotionDeleteError = { message?: Maybe; }; -/** An enumeration. */ export type PromotionDeleteErrorCode = | 'GRAPHQL_ERROR' | 'NOT_FOUND'; @@ -23365,7 +23337,6 @@ export type PromotionEventInterface = { type: PromotionEventsEnum; }; -/** An enumeration. */ export type PromotionEventsEnum = | 'PROMOTION_CREATED' | 'PROMOTION_ENDED' @@ -23501,7 +23472,6 @@ export type PromotionRuleCreateError = { rulesLimitExceedBy?: Maybe; }; -/** An enumeration. */ export type PromotionRuleCreateErrorCode = | 'GIFTS_NUMBER_LIMIT' | 'GRAPHQL_ERROR' @@ -23628,7 +23598,6 @@ export type PromotionRuleDeleteError = { message?: Maybe; }; -/** An enumeration. */ export type PromotionRuleDeleteErrorCode = | 'GRAPHQL_ERROR' | 'NOT_FOUND'; @@ -23850,7 +23819,6 @@ export type PromotionRuleUpdateError = { message?: Maybe; }; -/** An enumeration. */ export type PromotionRuleUpdateErrorCode = | 'DUPLICATED_INPUT_ITEM' | 'GIFTS_NUMBER_LIMIT' @@ -24100,7 +24068,6 @@ export type PromotionTranslationInput = { name?: InputMaybe; }; -/** An enumeration. */ export type PromotionTypeEnum = | 'CATALOGUE' | 'ORDER'; @@ -24142,7 +24109,6 @@ export type PromotionUpdateError = { message?: Maybe; }; -/** An enumeration. */ export type PromotionUpdateErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -25342,12 +25308,10 @@ export type RequestPasswordReset = { errors: Array; }; -/** An enumeration. */ export type RewardTypeEnum = | 'GIFT' | 'SUBTOTAL_DISCOUNT'; -/** An enumeration. */ export type RewardValueTypeEnum = | 'FIXED' | 'PERCENTAGE'; @@ -26030,7 +25994,6 @@ export type SendConfirmationEmailError = { message?: Maybe; }; -/** An enumeration. */ export type SendConfirmationEmailErrorCode = | 'ACCOUNT_CONFIRMED' | 'CONFIRMATION_ALREADY_REQUESTED' @@ -26074,7 +26037,6 @@ export type ShippingError = { warehouses?: Maybe>; }; -/** An enumeration. */ export type ShippingErrorCode = | 'ALREADY_EXISTS' | 'DUPLICATED_INPUT_ITEM' @@ -26447,7 +26409,6 @@ export type ShippingMethodTypeTranslationArgs = { languageCode: LanguageCodeEnum; }; -/** An enumeration. */ export type ShippingMethodTypeEnum = | 'PRICE' | 'WEIGHT'; @@ -27332,7 +27293,6 @@ export type ShopError = { message?: Maybe; }; -/** An enumeration. */ export type ShopErrorCode = | 'ALREADY_EXISTS' | 'CANNOT_FETCH_TAX_RATES' @@ -27901,7 +27861,6 @@ export type StockBulkUpdateError = { message?: Maybe; }; -/** An enumeration. */ export type StockBulkUpdateErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -27948,7 +27907,6 @@ export type StockError = { message?: Maybe; }; -/** An enumeration. */ export type StockErrorCode = | 'ALREADY_EXISTS' | 'GRAPHQL_ERROR' @@ -28083,7 +28041,6 @@ export type StoredPaymentMethodRequestDelete = { result: StoredPaymentMethodRequestDeleteResult; }; -/** An enumeration. */ export type StoredPaymentMethodRequestDeleteErrorCode = | 'CHANNEL_INACTIVE' | 'GATEWAY_ERROR' @@ -28472,7 +28429,6 @@ export type TaxClassCreateError = { message?: Maybe; }; -/** An enumeration. */ export type TaxClassCreateErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -28508,7 +28464,6 @@ export type TaxClassDeleteError = { message?: Maybe; }; -/** An enumeration. */ export type TaxClassDeleteErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -28563,7 +28518,6 @@ export type TaxClassUpdateError = { message?: Maybe; }; -/** An enumeration. */ export type TaxClassUpdateErrorCode = | 'DUPLICATED_INPUT_ITEM' | 'GRAPHQL_ERROR' @@ -28767,7 +28721,6 @@ export type TaxConfigurationUpdateError = { message?: Maybe; }; -/** An enumeration. */ export type TaxConfigurationUpdateErrorCode = | 'DUPLICATED_INPUT_ITEM' | 'GRAPHQL_ERROR' @@ -28832,7 +28785,6 @@ export type TaxCountryConfigurationDeleteError = { message?: Maybe; }; -/** An enumeration. */ export type TaxCountryConfigurationDeleteErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -28864,7 +28816,6 @@ export type TaxCountryConfigurationUpdateError = { taxClassIds: Array; }; -/** An enumeration. */ export type TaxCountryConfigurationUpdateErrorCode = | 'CANNOT_CREATE_NEGATIVE_RATE' | 'GRAPHQL_ERROR' @@ -28895,7 +28846,6 @@ export type TaxExemptionManageError = { message?: Maybe; }; -/** An enumeration. */ export type TaxExemptionManageErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -29041,7 +28991,6 @@ export type ThumbnailCreated = Event & { version?: Maybe; }; -/** An enumeration. */ export type ThumbnailFormatEnum = | 'AVIF' | 'ORIGINAL' @@ -29062,7 +29011,6 @@ export type TimePeriodInputType = { type: TimePeriodTypeEnum; }; -/** An enumeration. */ export type TimePeriodTypeEnum = | 'DAY' | 'MONTH' @@ -29200,7 +29148,6 @@ export type TransactionCreateError = { message?: Maybe; }; -/** An enumeration. */ export type TransactionCreateErrorCode = | 'GRAPHQL_ERROR' | 'INCORRECT_CURRENCY' @@ -29328,6 +29275,11 @@ export type TransactionEventInput = { * 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. + * + * Triggers the following webhook events: + * - TRANSACTION_ITEM_METADATA_UPDATED (async): Optionally called when transaction's metadata was updated. + * - CHECKOUT_FULLY_PAID (async): Optionally called when the checkout charge status changed to `FULL` or `OVERCHARGED`. + * - ORDER_UPDATED (async): Optionally called when the transaction is related to the order and the order was updated. */ export type TransactionEventReport = { __typename?: 'TransactionEventReport'; @@ -29350,7 +29302,6 @@ export type TransactionEventReportError = { message?: Maybe; }; -/** An enumeration. */ export type TransactionEventReportErrorCode = | 'ALREADY_EXISTS' | 'GRAPHQL_ERROR' @@ -29444,7 +29395,6 @@ export type TransactionInitializeError = { message?: Maybe; }; -/** An enumeration. */ export type TransactionInitializeErrorCode = | 'CHECKOUT_COMPLETION_IN_PROGRESS' | 'GRAPHQL_ERROR' @@ -29697,7 +29647,6 @@ export type TransactionItemMetadataUpdated = Event & { version?: Maybe; }; -/** An enumeration. */ export type TransactionKind = | 'ACTION_TO_CONFIRM' | 'AUTH' @@ -29747,7 +29696,6 @@ export type TransactionProcessError = { message?: Maybe; }; -/** An enumeration. */ export type TransactionProcessErrorCode = | 'CHECKOUT_COMPLETION_IN_PROGRESS' | 'GRAPHQL_ERROR' @@ -29848,7 +29796,6 @@ export type TransactionRequestActionError = { message?: Maybe; }; -/** An enumeration. */ export type TransactionRequestActionErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -29880,7 +29827,6 @@ export type TransactionRequestRefundForGrantedRefundError = { message?: Maybe; }; -/** An enumeration. */ export type TransactionRequestRefundForGrantedRefundErrorCode = | 'AMOUNT_GREATER_THAN_AVAILABLE' | 'GRAPHQL_ERROR' @@ -29915,7 +29861,6 @@ export type TransactionUpdateError = { message?: Maybe; }; -/** An enumeration. */ export type TransactionUpdateErrorCode = | 'GRAPHQL_ERROR' | 'INCORRECT_CURRENCY' @@ -30032,7 +29977,6 @@ export type TranslationError = { message?: Maybe; }; -/** An enumeration. */ export type TranslationErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -30119,7 +30063,6 @@ export type UploadError = { message?: Maybe; }; -/** An enumeration. */ export type UploadErrorCode = | 'GRAPHQL_ERROR'; @@ -30580,7 +30523,6 @@ export type VerifyToken = { user?: Maybe; }; -/** An enumeration. */ export type VolumeUnitsEnum = | 'ACRE_FT' | 'ACRE_IN' @@ -30918,7 +30860,6 @@ export type VoucherCodeBulkDeleteError = { voucherCodes?: Maybe>; }; -/** An enumeration. */ export type VoucherCodeBulkDeleteErrorCode = | 'GRAPHQL_ERROR' | 'INVALID' @@ -31500,7 +31441,6 @@ export type WarehouseStocksArgs = { last?: InputMaybe; }; -/** An enumeration. */ export type WarehouseClickAndCollectOptionEnum = | 'ALL' | 'DISABLED' @@ -31622,7 +31562,6 @@ export type WarehouseError = { shippingZones?: Maybe>; }; -/** An enumeration. */ export type WarehouseErrorCode = | 'ALREADY_EXISTS' | 'GRAPHQL_ERROR' @@ -31903,7 +31842,6 @@ export type WebhookDryRunError = { message?: Maybe; }; -/** An enumeration. */ export type WebhookDryRunErrorCode = | 'GRAPHQL_ERROR' | 'INVALID_ID' @@ -31925,7 +31863,6 @@ export type WebhookError = { message?: Maybe; }; -/** An enumeration. */ export type WebhookErrorCode = | 'DELETE_FAILED' | 'GRAPHQL_ERROR' @@ -32900,7 +32837,6 @@ export type WebhookEventTypeSyncEnum = */ | 'TRANSACTION_REFUND_REQUESTED'; -/** An enumeration. */ export type WebhookSampleEventTypeEnum = | 'ACCOUNT_CHANGE_EMAIL_REQUESTED' | 'ACCOUNT_CONFIRMATION_REQUESTED' @@ -33069,7 +33005,6 @@ export type WebhookTriggerError = { message?: Maybe; }; -/** An enumeration. */ export type WebhookTriggerErrorCode = | 'GRAPHQL_ERROR' | 'INVALID_ID' @@ -33145,7 +33080,6 @@ export type Weight = { value: Scalars['Float']; }; -/** An enumeration. */ export type WeightUnitsEnum = | 'G' | 'KG' @@ -44354,6 +44288,17 @@ export default { "kind": "OBJECT", "name": "CheckoutSettings", "fields": [ + { + "name": "automaticallyCompleteFullyPaidCheckouts", + "type": { + "kind": "NON_NULL", + "ofType": { + "kind": "SCALAR", + "name": "Any" + } + }, + "args": [] + }, { "name": "useLegacyErrorFlow", "type": { @@ -64833,6 +64778,32 @@ export default { "name": "Any" } }, + { + "name": "transactionMetadata", + "type": { + "kind": "LIST", + "ofType": { + "kind": "NON_NULL", + "ofType": { + "kind": "SCALAR", + "name": "Any" + } + } + } + }, + { + "name": "transactionPrivateMetadata", + "type": { + "kind": "LIST", + "ofType": { + "kind": "NON_NULL", + "ofType": { + "kind": "SCALAR", + "name": "Any" + } + } + } + }, { "name": "type", "type": { diff --git a/generated/schema.graphql b/generated/schema.graphql index 07da8c7e..423fafac 100644 --- a/generated/schema.graphql +++ b/generated/schema.graphql @@ -302,7 +302,6 @@ type AccountError { message: String } -"""An enumeration.""" enum AccountErrorCode { ACCOUNT_NOT_CONFIRMED ACTIVATE_OWN_ACCOUNT @@ -734,7 +733,6 @@ type AddressSetDefault { user: User } -"""An enumeration.""" enum AddressTypeEnum { BILLING SHIPPING @@ -1215,7 +1213,6 @@ type AppError { permissions: [PermissionEnum!] } -"""An enumeration.""" enum AppErrorCode { FORBIDDEN GRAPHQL_ERROR @@ -1685,7 +1682,6 @@ type AppUpdated implements Event { version: String } -"""An enumeration.""" enum AreaUnitsEnum { SQ_CM SQ_DM @@ -1934,7 +1930,6 @@ type AttributeBulkCreateError { path: String } -"""An enumeration.""" enum AttributeBulkCreateErrorCode { ALREADY_EXISTS BLANK @@ -2058,7 +2053,6 @@ type AttributeBulkUpdateError { path: String } -"""An enumeration.""" enum AttributeBulkUpdateErrorCode { ALREADY_EXISTS BLANK @@ -2262,7 +2256,6 @@ type AttributeDeleted implements Event { version: String } -"""An enumeration.""" enum AttributeEntityTypeEnum { PAGE PRODUCT @@ -2290,7 +2283,6 @@ type AttributeError { message: String } -"""An enumeration.""" enum AttributeErrorCode { ALREADY_EXISTS GRAPHQL_ERROR @@ -2345,7 +2337,6 @@ input AttributeInput { valuesRange: IntRangeInput } -"""An enumeration.""" enum AttributeInputTypeEnum { BOOLEAN DATE @@ -2461,7 +2452,6 @@ type AttributeTranslate { translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") } -"""An enumeration.""" enum AttributeTranslateErrorCode { GRAPHQL_ERROR INVALID @@ -2488,7 +2478,6 @@ type AttributeTranslation implements Node { translatableContent: AttributeTranslatableContent } -"""An enumeration.""" enum AttributeTypeEnum { PAGE_TYPE PRODUCT_TYPE @@ -3021,7 +3010,6 @@ type AttributeValueTranslate { translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") } -"""An enumeration.""" enum AttributeValueTranslateErrorCode { GRAPHQL_ERROR INVALID @@ -4271,7 +4259,6 @@ type ChannelError { warehouses: [ID!] } -"""An enumeration.""" enum ChannelErrorCode { ALREADY_EXISTS CHANNELS_CURRENCY_MUST_BE_THE_SAME @@ -4946,7 +4933,6 @@ type CheckoutCreateFromOrderError { message: String } -"""An enumeration.""" enum CheckoutCreateFromOrderErrorCode { CHANNEL_INACTIVE GRAPHQL_ERROR @@ -4969,7 +4955,6 @@ type CheckoutCreateFromOrderUnavailableVariant { variantId: ID! } -"""An enumeration.""" enum CheckoutCreateFromOrderUnavailableVariantErrorCode { INSUFFICIENT_STOCK NOT_FOUND @@ -5114,7 +5099,6 @@ type CheckoutError { variants: [ID!] } -"""An enumeration.""" enum CheckoutErrorCode { BILLING_ADDRESS_NOT_SET CHANNEL_INACTIVE @@ -5190,7 +5174,7 @@ type CheckoutFilterShippingMethods implements Event { } """ -Event sent when checkout is fully paid with transactions. +Event sent when checkout is fully paid with transactions. The checkout is considered as fully paid when the checkout `charge_status` is `FULL` or `OVERCHARGED`. The event is not sent when the checkout authorization flow strategy is used. Added in Saleor 3.13. @@ -5555,6 +5539,13 @@ Added in Saleor 3.15. Note: this API is currently in Feature Preview and can be subject to changes at later point. """ type CheckoutSettings { + """ + Default `false`. Determines if the paid checkouts should be automatically completed. This setting applies only to checkouts where payment was processed through transactions.When enabled, the checkout will be automatically completed once the checkout `charge_status` reaches `FULL`. This occurs when the total sum of charged and authorized transaction amounts equals or exceeds the checkout's total amount. + + Added in Saleor 3.20. + """ + automaticallyCompleteFullyPaidCheckouts: Boolean! + """ 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. @@ -5564,6 +5555,13 @@ type CheckoutSettings { } input CheckoutSettingsInput { + """ + Default `false`. Determines if the paid checkouts should be automatically completed. This setting applies only to checkouts where payment was processed through transactions.When enabled, the checkout will be automatically completed once the checkout `charge_status` reaches `FULL`. This occurs when the total sum of charged and authorized transaction amounts equals or exceeds the checkout's total amount. + + Added in Saleor 3.20. + """ + automaticallyCompleteFullyPaidCheckouts: Boolean + """ 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. @@ -6044,7 +6042,6 @@ type CollectionError { products: [ID!] } -"""An enumeration.""" enum CollectionErrorCode { CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT DUPLICATED_INPUT_ITEM @@ -6384,7 +6381,6 @@ input ConfigurationItemInput { value: String } -"""An enumeration.""" enum ConfigurationTypeFieldEnum { BOOLEAN MULTILINE @@ -6817,7 +6813,6 @@ type CustomerBulkUpdateError { path: String } -"""An enumeration.""" enum CustomerBulkUpdateErrorCode { BLANK DUPLICATED_INPUT_ITEM @@ -6923,7 +6918,6 @@ type CustomerEvent implements Node { user: User } -"""An enumeration.""" enum CustomerEventsEnum { ACCOUNT_ACTIVATED ACCOUNT_CREATED @@ -7440,7 +7434,6 @@ type DiscountError { voucherCodes: [String!] } -"""An enumeration.""" enum DiscountErrorCode { ALREADY_EXISTS CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT @@ -7478,7 +7471,6 @@ input DiscountedObjectWhereInput { baseTotalPrice: DecimalFilterInput } -"""An enumeration.""" enum DistanceUnitsEnum { CM DM @@ -7931,7 +7923,6 @@ type ExportError { message: String } -"""An enumeration.""" enum ExportErrorCode { GRAPHQL_ERROR INVALID @@ -7964,7 +7955,6 @@ type ExportEvent implements Node { user: User } -"""An enumeration.""" enum ExportEventsEnum { EXPORTED_FILE_SENT EXPORT_DELETED @@ -8214,7 +8204,6 @@ type ExternalNotificationError { message: String } -"""An enumeration.""" enum ExternalNotificationErrorCodes { CHANNEL_INACTIVE INVALID_MODEL_TYPE @@ -8307,7 +8296,6 @@ type File { url: String! } -"""An enumeration.""" enum FileTypesEnum { CSV XLSX @@ -8611,7 +8599,6 @@ type FulfillmentReturnProducts { returnFulfillment: Fulfillment } -"""An enumeration.""" enum FulfillmentStatus { CANCELED FULFILLED @@ -9159,7 +9146,6 @@ type GiftCardError { tags: [String!] } -"""An enumeration.""" enum GiftCardErrorCode { ALREADY_EXISTS DUPLICATED_INPUT_ITEM @@ -9243,7 +9229,6 @@ input GiftCardEventFilterInput { type: GiftCardEventsEnum } -"""An enumeration.""" enum GiftCardEventsEnum { ACTIVATED BALANCE_RESET @@ -9397,14 +9382,12 @@ type GiftCardSettingsError { message: String } -"""An enumeration.""" enum GiftCardSettingsErrorCode { GRAPHQL_ERROR INVALID REQUIRED } -"""An enumeration.""" enum GiftCardSettingsExpiryTypeEnum { EXPIRY_PERIOD NEVER_EXPIRE @@ -9851,7 +9834,6 @@ type InvoiceError { message: String } -"""An enumeration.""" enum InvoiceErrorCode { EMAIL_NOT_SET INVALID_STATUS @@ -9998,7 +9980,6 @@ interface Job { updatedAt: DateTime! } -"""An enumeration.""" enum JobStatusEnum { DELETED FAILED @@ -10006,7 +9987,6 @@ enum JobStatusEnum { SUCCESS } -"""An enumeration.""" enum LanguageCodeEnum { AF AF_NA @@ -10962,7 +10942,6 @@ enum MarkAsPaidStrategyEnum { TRANSACTION_FLOW } -"""An enumeration.""" enum MeasurementUnitsEnum { ACRE_FT ACRE_IN @@ -11222,7 +11201,6 @@ type MenuError { message: String } -"""An enumeration.""" enum MenuErrorCode { CANNOT_ASSIGN_NODE GRAPHQL_ERROR @@ -11710,7 +11688,6 @@ type MetadataError { message: String } -"""An enumeration.""" enum MetadataErrorCode { GRAPHQL_ERROR INVALID @@ -16371,6 +16348,11 @@ type Mutation { 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. + + Triggers the following webhook events: + - TRANSACTION_ITEM_METADATA_UPDATED (async): Optionally called when transaction's metadata was updated. + - CHECKOUT_FULLY_PAID (async): Optionally called when the checkout charge status changed to `FULL` or `OVERCHARGED`. + - ORDER_UPDATED (async): Optionally called when the transaction is related to the order and the order was updated. """ transactionEventReport( """ @@ -16391,7 +16373,9 @@ type Mutation { """The ID of the transaction. One of field id or token is required.""" id: ID - """The message related to the event.""" + """ + The message related to the event. The maximum length is 512 characters; any text exceeding this limit will be truncated. + """ message: String """PSP Reference of the event to report.""" @@ -16409,6 +16393,20 @@ type Mutation { """ token: UUID + """ + Fields required to update the transaction metadata. + + Added in Saleor 3.17. + """ + transactionMetadata: [MetadataInput!] + + """ + Fields required to update the transaction private metadata. + + Added in Saleor 3.17. + """ + transactionPrivateMetadata: [MetadataInput!] + """Current status of the event to report.""" type: TransactionEventTypeEnum! ): TransactionEventReport @@ -17485,7 +17483,6 @@ type OrderBulkCreateError { path: String } -"""An enumeration.""" enum OrderBulkCreateErrorCode { BULK_LIMIT FUTURE_DATE @@ -17671,6 +17668,13 @@ input OrderBulkCreateOrderLineInput { """The name of the product.""" productName: String + """ + The SKU of the product. + + Added in Saleor 3.18. + """ + productSku: String + """Number of items in the order line""" quantity: Int! @@ -17701,6 +17705,27 @@ input OrderBulkCreateOrderLineInput { """Price of the order line excluding applied discount.""" undiscountedTotalPrice: TaxedMoneyInput! + """ + Reason of the discount on order line. + + Added in Saleor 3.19. + """ + unitDiscountReason: String + + """ + Type of the discount: fixed or percent + + Added in Saleor 3.19. + """ + unitDiscountType: DiscountValueTypeEnum + + """ + Value of the discount. Can store fixed value or percent value + + Added in Saleor 3.19. + """ + unitDiscountValue: PositiveDecimal + """The external ID of the product variant.""" variantExternalReference: String @@ -17929,7 +17954,6 @@ type OrderCreateFromCheckoutError { variants: [ID!] } -"""An enumeration.""" enum OrderCreateFromCheckoutErrorCode { BILLING_ADDRESS_NOT_SET CHANNEL_INACTIVE @@ -18045,7 +18069,6 @@ type OrderDiscountDelete { orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") } -"""An enumeration.""" enum OrderDiscountType { MANUAL ORDER_PROMOTION @@ -18100,7 +18123,6 @@ type OrderError { warehouse: ID } -"""An enumeration.""" enum OrderErrorCode { BILLING_ADDRESS_NOT_SET CANNOT_CANCEL_FULFILLMENT @@ -18281,7 +18303,6 @@ type OrderEventOrderLineObject { quantity: Int } -"""An enumeration.""" enum OrderEventsEmailsEnum { CONFIRMED DIGITAL_LINKS @@ -18336,6 +18357,7 @@ enum OrderEventsEnum { PAYMENT_REFUNDED PAYMENT_VOIDED PLACED + PLACED_AUTOMATICALLY_FROM_PAID_CHECKOUT PLACED_FROM_DRAFT REMOVED_PRODUCTS TRACKING_UPDATED @@ -18586,7 +18608,6 @@ type OrderGrantRefundCreateError { message: String } -"""An enumeration.""" enum OrderGrantRefundCreateErrorCode { AMOUNT_GREATER_THAN_AVAILABLE GRAPHQL_ERROR @@ -18649,7 +18670,6 @@ type OrderGrantRefundCreateLineError { message: String } -"""An enumeration.""" enum OrderGrantRefundCreateLineErrorCode { GRAPHQL_ERROR NOT_FOUND @@ -18717,7 +18737,6 @@ type OrderGrantRefundUpdateError { removeLines: [OrderGrantRefundUpdateLineError!] } -"""An enumeration.""" enum OrderGrantRefundUpdateErrorCode { AMOUNT_GREATER_THAN_AVAILABLE GRAPHQL_ERROR @@ -18800,7 +18819,6 @@ type OrderGrantRefundUpdateLineError { message: String } -"""An enumeration.""" enum OrderGrantRefundUpdateLineErrorCode { GRAPHQL_ERROR NOT_FOUND @@ -19077,23 +19095,33 @@ type OrderLine implements Node & ObjectWithMetadata { undiscountedTotalPrice: TaxedMoney! """ - Price of the single item in the order line without applied an order line discount. + Price of the single item in the order line without any discount applied. """ undiscountedUnitPrice: TaxedMoney! - """The discount applied to the single order line.""" + """ + Sum of the line-level discounts applied to the order line. Order-level discounts which affect the line are not visible in this field. For order-level discount portion (if any), please query `order.discounts` field. + """ unitDiscount: Money! - """Reason for any discounts applied on a product in the order.""" + """ + Reason for line-level discounts applied on the order line. Order-level discounts which affect the line are not visible in this field. For order-level discount reason (if any), please query `order.discounts` field. + """ unitDiscountReason: String - """Type of the discount: fixed or percent""" + """ + Type of the discount: `fixed` or `percent`. This field shouldn't be used when multiple discounts affect the line. There is a limitation, that after running `checkoutComplete` mutation the field is always set to `fixed`. + """ unitDiscountType: DiscountValueTypeEnum - """Value of the discount. Can store fixed value or percent value""" + """ + Value of the discount. Can store fixed value or percent value. This field shouldn't be used when multiple discounts affect the line. There is a limitation, that after running `checkoutComplete` mutation the field always stores fixed value. + """ unitDiscountValue: PositiveDecimal! - """Price of the single item in the order line.""" + """ + Price of the single item in the order line with all the line-level discounts and order-level discount portions applied. + """ unitPrice: TaxedMoney! """ @@ -19286,7 +19314,6 @@ type OrderNoteAddError { message: String } -"""An enumeration.""" enum OrderNoteAddErrorCode { GRAPHQL_ERROR REQUIRED @@ -19329,7 +19356,6 @@ type OrderNoteUpdateError { message: String } -"""An enumeration.""" enum OrderNoteUpdateErrorCode { GRAPHQL_ERROR NOT_FOUND @@ -19338,7 +19364,6 @@ enum OrderNoteUpdateErrorCode { union OrderOrCheckout = Checkout | Order -"""An enumeration.""" enum OrderOriginEnum { BULK_CREATE CHECKOUT @@ -19564,7 +19589,6 @@ type OrderSettingsError { message: String } -"""An enumeration.""" enum OrderSettingsErrorCode { INVALID } @@ -19699,7 +19723,6 @@ input OrderSortingInput { field: OrderSortField! } -"""An enumeration.""" enum OrderStatus { CANCELED DRAFT @@ -20098,7 +20121,6 @@ type PageError { values: [ID!] } -"""An enumeration.""" enum PageErrorCode { ATTRIBUTE_ALREADY_ASSIGNED DUPLICATED_INPUT_ITEM @@ -20853,7 +20875,6 @@ type PaymentCaptureEvent implements Event { version: String } -"""An enumeration.""" enum PaymentChargeStatusEnum { CANCELLED FULLY_CHARGED @@ -20943,7 +20964,6 @@ type PaymentError { variants: [ID!] } -"""An enumeration.""" enum PaymentErrorCode { BALANCE_CHECK_ERROR BILLING_ADDRESS_NOT_SET @@ -21015,7 +21035,6 @@ type PaymentGatewayConfigError { message: String } -"""An enumeration.""" enum PaymentGatewayConfigErrorCode { GRAPHQL_ERROR INVALID @@ -21049,7 +21068,6 @@ type PaymentGatewayInitializeError { message: String } -"""An enumeration.""" enum PaymentGatewayInitializeErrorCode { GRAPHQL_ERROR INVALID @@ -21120,7 +21138,6 @@ type PaymentGatewayInitializeTokenizationError { message: String } -"""An enumeration.""" enum PaymentGatewayInitializeTokenizationErrorCode { CHANNEL_INACTIVE GATEWAY_ERROR @@ -21297,7 +21314,6 @@ type PaymentMethodInitializeTokenizationError { message: String } -"""An enumeration.""" enum PaymentMethodInitializeTokenizationErrorCode { CHANNEL_INACTIVE GATEWAY_ERROR @@ -21376,7 +21392,6 @@ type PaymentMethodProcessTokenizationError { message: String } -"""An enumeration.""" enum PaymentMethodProcessTokenizationErrorCode { CHANNEL_INACTIVE GATEWAY_ERROR @@ -21598,7 +21613,6 @@ type Permission { name: String! } -"""An enumeration.""" enum PermissionEnum { HANDLE_CHECKOUTS HANDLE_PAYMENTS @@ -21749,7 +21763,6 @@ type PermissionGroupError { users: [ID!] } -"""An enumeration.""" enum PermissionGroupErrorCode { ASSIGN_NON_STAFF_MEMBER CANNOT_REMOVE_FROM_LAST_GROUP @@ -21927,7 +21940,6 @@ type PluginError { message: String } -"""An enumeration.""" enum PluginErrorCode { GRAPHQL_ERROR INVALID @@ -21987,7 +21999,6 @@ Should be used in places where value must be nonnegative (0 or greater). """ scalar PositiveDecimal -"""An enumeration.""" enum PostalCodeRuleInclusionTypeEnum { EXCLUDE INCLUDE @@ -22394,7 +22405,6 @@ type ProductBulkCreateError { warehouses: [ID!] } -"""An enumeration.""" enum ProductBulkCreateErrorCode { ATTRIBUTE_ALREADY_ASSIGNED ATTRIBUTE_CANNOT_BE_ASSIGNED @@ -22942,7 +22952,6 @@ type ProductError { values: [ID!] } -"""An enumeration.""" enum ProductErrorCode { ALREADY_EXISTS ATTRIBUTE_ALREADY_ASSIGNED @@ -23360,7 +23369,6 @@ type ProductMediaReorder { productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") } -"""An enumeration.""" enum ProductMediaType { IMAGE VIDEO @@ -23637,7 +23645,6 @@ type ProductTranslate { translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") } -"""An enumeration.""" enum ProductTranslateErrorCode { GRAPHQL_ERROR INVALID @@ -23944,7 +23951,6 @@ input ProductTypeInput { weight: WeightScalar } -"""An enumeration.""" enum ProductTypeKindEnum { GIFT_CARD NORMAL @@ -24385,7 +24391,6 @@ type ProductVariantBulkError { warehouses: [ID!] } -"""An enumeration.""" enum ProductVariantBulkErrorCode { ATTRIBUTE_ALREADY_ASSIGNED ATTRIBUTE_CANNOT_BE_ASSIGNED @@ -25084,7 +25089,6 @@ type ProductVariantTranslate { translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") } -"""An enumeration.""" enum ProductVariantTranslateErrorCode { GRAPHQL_ERROR INVALID @@ -25393,7 +25397,6 @@ type PromotionCreateError { rulesLimitExceedBy: Int } -"""An enumeration.""" enum PromotionCreateErrorCode { GIFTS_NUMBER_LIMIT GRAPHQL_ERROR @@ -25508,7 +25511,6 @@ type PromotionDeleteError { message: String } -"""An enumeration.""" enum PromotionDeleteErrorCode { GRAPHQL_ERROR NOT_FOUND @@ -25603,7 +25605,6 @@ interface PromotionEventInterface { type: PromotionEventsEnum! } -"""An enumeration.""" enum PromotionEventsEnum { PROMOTION_CREATED PROMOTION_ENDED @@ -25748,7 +25749,6 @@ type PromotionRuleCreateError { rulesLimitExceedBy: Int } -"""An enumeration.""" enum PromotionRuleCreateErrorCode { GIFTS_NUMBER_LIMIT GRAPHQL_ERROR @@ -25898,7 +25898,6 @@ type PromotionRuleDeleteError { message: String } -"""An enumeration.""" enum PromotionRuleDeleteErrorCode { GRAPHQL_ERROR NOT_FOUND @@ -26143,7 +26142,6 @@ type PromotionRuleUpdateError { message: String } -"""An enumeration.""" enum PromotionRuleUpdateErrorCode { DUPLICATED_INPUT_ITEM GIFTS_NUMBER_LIMIT @@ -26422,7 +26420,6 @@ input PromotionTranslationInput { name: String } -"""An enumeration.""" enum PromotionTypeEnum { CATALOGUE ORDER @@ -26468,7 +26465,6 @@ type PromotionUpdateError { message: String } -"""An enumeration.""" enum PromotionUpdateErrorCode { GRAPHQL_ERROR INVALID @@ -28314,13 +28310,11 @@ type RequestPasswordReset { errors: [AccountError!]! } -"""An enumeration.""" enum RewardTypeEnum { GIFT SUBTOTAL_DISCOUNT } -"""An enumeration.""" enum RewardValueTypeEnum { FIXED PERCENTAGE @@ -28972,7 +28966,6 @@ type SendConfirmationEmailError { message: String } -"""An enumeration.""" enum SendConfirmationEmailErrorCode { ACCOUNT_CONFIRMED CONFIRMATION_ALREADY_REQUESTED @@ -29027,7 +29020,6 @@ type ShippingError { warehouses: [ID!] } -"""An enumeration.""" enum ShippingErrorCode { ALREADY_EXISTS DUPLICATED_INPUT_ITEM @@ -29409,7 +29401,6 @@ type ShippingMethodType implements Node & ObjectWithMetadata { type: ShippingMethodTypeEnum } -"""An enumeration.""" enum ShippingMethodTypeEnum { PRICE WEIGHT @@ -30277,7 +30268,6 @@ type ShopError { message: String } -"""An enumeration.""" enum ShopErrorCode { ALREADY_EXISTS CANNOT_FETCH_TAX_RATES @@ -30916,7 +30906,6 @@ type StockBulkUpdateError { message: String } -"""An enumeration.""" enum StockBulkUpdateErrorCode { GRAPHQL_ERROR INVALID @@ -30972,7 +30961,6 @@ type StockError { message: String } -"""An enumeration.""" enum StockErrorCode { ALREADY_EXISTS GRAPHQL_ERROR @@ -31139,7 +31127,6 @@ type StoredPaymentMethodRequestDelete { result: StoredPaymentMethodRequestDeleteResult! } -"""An enumeration.""" enum StoredPaymentMethodRequestDeleteErrorCode { CHANNEL_INACTIVE GATEWAY_ERROR @@ -31518,7 +31505,6 @@ type TaxClassCreateError { message: String } -"""An enumeration.""" enum TaxClassCreateErrorCode { GRAPHQL_ERROR INVALID @@ -31558,7 +31544,6 @@ type TaxClassDeleteError { message: String } -"""An enumeration.""" enum TaxClassDeleteErrorCode { GRAPHQL_ERROR INVALID @@ -31620,7 +31605,6 @@ type TaxClassUpdateError { message: String } -"""An enumeration.""" enum TaxClassUpdateErrorCode { DUPLICATED_INPUT_ITEM GRAPHQL_ERROR @@ -31824,7 +31808,6 @@ type TaxConfigurationUpdateError { message: String } -"""An enumeration.""" enum TaxConfigurationUpdateErrorCode { DUPLICATED_INPUT_ITEM GRAPHQL_ERROR @@ -31903,7 +31886,6 @@ type TaxCountryConfigurationDeleteError { message: String } -"""An enumeration.""" enum TaxCountryConfigurationDeleteErrorCode { GRAPHQL_ERROR INVALID @@ -31940,7 +31922,6 @@ type TaxCountryConfigurationUpdateError { taxClassIds: [String!]! } -"""An enumeration.""" enum TaxCountryConfigurationUpdateErrorCode { CANNOT_CREATE_NEGATIVE_RATE GRAPHQL_ERROR @@ -31974,7 +31955,6 @@ type TaxExemptionManageError { message: String } -"""An enumeration.""" enum TaxExemptionManageErrorCode { GRAPHQL_ERROR INVALID @@ -32155,7 +32135,6 @@ type ThumbnailCreated implements Event { version: String } -"""An enumeration.""" enum ThumbnailFormatEnum { AVIF ORIGINAL @@ -32178,7 +32157,6 @@ input TimePeriodInputType { type: TimePeriodTypeEnum! } -"""An enumeration.""" enum TimePeriodTypeEnum { DAY MONTH @@ -32337,7 +32315,6 @@ type TransactionCreateError { message: String } -"""An enumeration.""" enum TransactionCreateErrorCode { GRAPHQL_ERROR INCORRECT_CURRENCY @@ -32484,6 +32461,11 @@ 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. + +Triggers the following webhook events: +- TRANSACTION_ITEM_METADATA_UPDATED (async): Optionally called when transaction's metadata was updated. +- CHECKOUT_FULLY_PAID (async): Optionally called when the checkout charge status changed to `FULL` or `OVERCHARGED`. +- ORDER_UPDATED (async): Optionally called when the transaction is related to the order and the order was updated. """ type TransactionEventReport { """Defines if the reported event hasn't been processed earlier.""" @@ -32512,7 +32494,6 @@ type TransactionEventReportError { message: String } -"""An enumeration.""" enum TransactionEventReportErrorCode { ALREADY_EXISTS GRAPHQL_ERROR @@ -32613,7 +32594,6 @@ type TransactionInitializeError { message: String } -"""An enumeration.""" enum TransactionInitializeErrorCode { CHECKOUT_COMPLETION_IN_PROGRESS GRAPHQL_ERROR @@ -32858,7 +32838,6 @@ type TransactionItemMetadataUpdated implements Event { version: String } -"""An enumeration.""" enum TransactionKind { ACTION_TO_CONFIRM AUTH @@ -32914,7 +32893,6 @@ type TransactionProcessError { message: String } -"""An enumeration.""" enum TransactionProcessErrorCode { CHECKOUT_COMPLETION_IN_PROGRESS GRAPHQL_ERROR @@ -33031,7 +33009,6 @@ type TransactionRequestActionError { message: String } -"""An enumeration.""" enum TransactionRequestActionErrorCode { GRAPHQL_ERROR INVALID @@ -33066,7 +33043,6 @@ type TransactionRequestRefundForGrantedRefundError { message: String } -"""An enumeration.""" enum TransactionRequestRefundForGrantedRefundErrorCode { AMOUNT_GREATER_THAN_AVAILABLE GRAPHQL_ERROR @@ -33104,7 +33080,6 @@ type TransactionUpdateError { message: String } -"""An enumeration.""" enum TransactionUpdateErrorCode { GRAPHQL_ERROR INCORRECT_CURRENCY @@ -33240,7 +33215,6 @@ type TranslationError { message: String } -"""An enumeration.""" enum TranslationErrorCode { GRAPHQL_ERROR INVALID @@ -33344,7 +33318,6 @@ type UploadError { message: String } -"""An enumeration.""" enum UploadErrorCode { GRAPHQL_ERROR } @@ -33848,7 +33821,6 @@ type VerifyToken { user: User } -"""An enumeration.""" enum VolumeUnitsEnum { ACRE_FT ACRE_IN @@ -34238,7 +34210,6 @@ type VoucherCodeBulkDeleteError { voucherCodes: [ID!] } -"""An enumeration.""" enum VoucherCodeBulkDeleteErrorCode { GRAPHQL_ERROR INVALID @@ -34843,7 +34814,6 @@ type Warehouse implements Node & ObjectWithMetadata { ): StockCountableConnection } -"""An enumeration.""" enum WarehouseClickAndCollectOptionEnum { ALL DISABLED @@ -34978,7 +34948,6 @@ type WarehouseError { shippingZones: [ID!] } -"""An enumeration.""" enum WarehouseErrorCode { ALREADY_EXISTS GRAPHQL_ERROR @@ -35291,7 +35260,6 @@ type WebhookDryRunError { message: String } -"""An enumeration.""" enum WebhookDryRunErrorCode { GRAPHQL_ERROR INVALID_ID @@ -35317,7 +35285,6 @@ type WebhookError { message: String } -"""An enumeration.""" enum WebhookErrorCode { DELETE_FAILED GRAPHQL_ERROR @@ -36615,7 +36582,6 @@ enum WebhookEventTypeSyncEnum { TRANSACTION_REFUND_REQUESTED } -"""An enumeration.""" enum WebhookSampleEventTypeEnum { ACCOUNT_CHANGE_EMAIL_REQUESTED ACCOUNT_CONFIRMATION_REQUESTED @@ -36787,7 +36753,6 @@ type WebhookTriggerError { message: String } -"""An enumeration.""" enum WebhookTriggerErrorCode { GRAPHQL_ERROR INVALID_ID @@ -36873,7 +36838,6 @@ type Weight { scalar WeightScalar -"""An enumeration.""" enum WeightUnitsEnum { G KG diff --git a/graphql/schema.graphql b/graphql/schema.graphql index fb6981de..8e48901e 100644 --- a/graphql/schema.graphql +++ b/graphql/schema.graphql @@ -3240,7 +3240,6 @@ type Permission @doc(category: "Authentication") { name: String! } -"""An enumeration.""" enum PermissionEnum @doc(category: "Users") { MANAGE_USERS MANAGE_STAFF @@ -3581,7 +3580,6 @@ input EventDeliveryFilterInput { scalar JSONString -"""An enumeration.""" enum WebhookSampleEventTypeEnum @doc(category: "Webhooks") { ACCOUNT_CONFIRMATION_REQUESTED ACCOUNT_CHANGE_EMAIL_REQUESTED @@ -3969,7 +3967,6 @@ type ReducedRate @doc(category: "Taxes") { rateType: String! } -"""An enumeration.""" enum WarehouseClickAndCollectOptionEnum @doc(category: "Products") { DISABLED LOCAL @@ -4208,7 +4205,6 @@ type ShippingMethodType implements Node & ObjectWithMetadata @doc(category: "Shi taxClass: TaxClass } -"""An enumeration.""" enum ShippingMethodTypeEnum @doc(category: "Shipping") { PRICE WEIGHT @@ -4248,7 +4244,6 @@ type LanguageDisplay { language: String! } -"""An enumeration.""" enum LanguageCodeEnum { AF AF_NA @@ -5615,7 +5610,6 @@ type Weight { value: Float! } -"""An enumeration.""" enum WeightUnitsEnum { G LB @@ -5745,6 +5739,13 @@ type CheckoutSettings { Added in Saleor 3.15.This field will be removed in Saleor 4.0. """ useLegacyErrorFlow: Boolean! + + """ + Default `false`. Determines if the paid checkouts should be automatically completed. This setting applies only to checkouts where payment was processed through transactions.When enabled, the checkout will be automatically completed once the checkout `charge_status` reaches `FULL`. This occurs when the total sum of charged and authorized transaction amounts equals or exceeds the checkout's total amount. + + Added in Saleor 3.20. + """ + automaticallyCompleteFullyPaidCheckouts: Boolean! } """Represents the channel-specific payment settings.""" @@ -5895,7 +5896,6 @@ type ShippingMethodPostalCodeRule implements Node @doc(category: "Shipping") { inclusionType: PostalCodeRuleInclusionTypeEnum } -"""An enumeration.""" enum PostalCodeRuleInclusionTypeEnum @doc(category: "Shipping") { INCLUDE EXCLUDE @@ -6294,7 +6294,6 @@ type ProductType implements Node & ObjectWithMetadata @doc(category: "Products") ): AttributeCountableConnection } -"""An enumeration.""" enum ProductTypeKindEnum @doc(category: "Products") { NORMAL GIFT_CARD @@ -6556,7 +6555,6 @@ type Attribute implements Node & ObjectWithMetadata @doc(category: "Attributes") externalReference: String } -"""An enumeration.""" enum AttributeInputTypeEnum @doc(category: "Attributes") { DROPDOWN MULTISELECT @@ -6571,20 +6569,17 @@ enum AttributeInputTypeEnum @doc(category: "Attributes") { DATE_TIME } -"""An enumeration.""" enum AttributeEntityTypeEnum @doc(category: "Attributes") { PAGE PRODUCT PRODUCT_VARIANT } -"""An enumeration.""" enum AttributeTypeEnum @doc(category: "Attributes") { PRODUCT_TYPE PAGE_TYPE } -"""An enumeration.""" enum MeasurementUnitsEnum { MM CM @@ -7592,7 +7587,6 @@ type Image { alt: String } -"""An enumeration.""" enum ThumbnailFormatEnum { ORIGINAL AVIF @@ -8137,7 +8131,6 @@ type ProductMedia implements Node & ObjectWithMetadata @doc(category: "Products" productId: ID } -"""An enumeration.""" enum ProductMediaType @doc(category: "Products") { IMAGE VIDEO @@ -11282,7 +11275,6 @@ type GiftCardEvent implements Node @doc(category: "Gift cards") { oldExpiryDate: Date } -"""An enumeration.""" enum GiftCardEventsEnum @doc(category: "Gift cards") { ISSUED BOUGHT @@ -12074,7 +12066,6 @@ type Order implements Node & ObjectWithMetadata @doc(category: "Orders") { totalRemainingGrant: Money! } -"""An enumeration.""" enum OrderStatus @doc(category: "Orders") { DRAFT UNCONFIRMED @@ -12166,7 +12157,6 @@ type Fulfillment implements Node & ObjectWithMetadata @doc(category: "Orders") { totalRefundedAmount: Money } -"""An enumeration.""" enum FulfillmentStatus @doc(category: "Orders") { FULFILLED REFUNDED @@ -12261,9 +12251,6 @@ type OrderLine implements Node & ObjectWithMetadata @doc(category: "Orders") { """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 @@ -12281,20 +12268,36 @@ type OrderLine implements Node & ObjectWithMetadata @doc(category: "Orders") { format: ThumbnailFormatEnum = ORIGINAL ): Image - """Price of the single item in the order line.""" + """ + Price of the single item in the order line with all the line-level discounts and order-level discount portions applied. + """ unitPrice: TaxedMoney! """ - Price of the single item in the order line without applied an order line discount. + Price of the single item in the order line without any discount applied. """ undiscountedUnitPrice: TaxedMoney! - """The discount applied to the single order line.""" + """ + Sum of the line-level discounts applied to the order line. Order-level discounts which affect the line are not visible in this field. For order-level discount portion (if any), please query `order.discounts` field. + """ unitDiscount: Money! - """Value of the discount. Can store fixed value or percent value""" + """ + Reason for line-level discounts applied on the order line. Order-level discounts which affect the line are not visible in this field. For order-level discount reason (if any), please query `order.discounts` field. + """ + unitDiscountReason: String + + """ + Value of the discount. Can store fixed value or percent value. This field shouldn't be used when multiple discounts affect the line. There is a limitation, that after running `checkoutComplete` mutation the field always stores fixed value. + """ unitDiscountValue: PositiveDecimal! + """ + Type of the discount: `fixed` or `percent`. This field shouldn't be used when multiple discounts affect the line. There is a limitation, that after running `checkoutComplete` mutation the field is always set to `fixed`. + """ + unitDiscountType: DiscountValueTypeEnum + """Price of the order line.""" totalPrice: TaxedMoney! @@ -12340,9 +12343,6 @@ type OrderLine implements Node & ObjectWithMetadata @doc(category: "Orders") { """ quantityToFulfill: Int! - """Type of the discount: fixed or percent""" - unitDiscountType: DiscountValueTypeEnum - """ Denormalized tax class of the product in this order line. @@ -12519,7 +12519,6 @@ interface Job { message: String } -"""An enumeration.""" enum JobStatusEnum { PENDING SUCCESS @@ -12527,7 +12526,6 @@ enum JobStatusEnum { DELETED } -"""An enumeration.""" enum OrderOriginEnum @doc(category: "Orders") { CHECKOUT DRAFT @@ -12535,7 +12533,6 @@ enum OrderOriginEnum @doc(category: "Orders") { BULK_CREATE } -"""An enumeration.""" enum PaymentChargeStatusEnum @doc(category: "Payments") { NOT_CHARGED PENDING @@ -12755,7 +12752,6 @@ type Transaction implements Node @doc(category: "Payments") { amount: Money } -"""An enumeration.""" enum TransactionKind @doc(category: "Payments") { EXTERNAL AUTH @@ -12880,6 +12876,7 @@ enum OrderEventsEnum @doc(category: "Orders") { REMOVED_PRODUCTS PLACED PLACED_FROM_DRAFT + PLACED_AUTOMATICALLY_FROM_PAID_CHECKOUT OVERSOLD_ITEMS CANCELED EXPIRED @@ -12925,7 +12922,6 @@ enum OrderEventsEnum @doc(category: "Orders") { OTHER } -"""An enumeration.""" enum OrderEventsEmailsEnum @doc(category: "Orders") { PAYMENT_CONFIRMATION CONFIRMED @@ -13006,7 +13002,6 @@ type OrderDiscount implements Node @doc(category: "Discounts") { amount: Money! } -"""An enumeration.""" enum OrderDiscountType @doc(category: "Discounts") { SALE VOUCHER @@ -13040,7 +13035,6 @@ type OrderError @doc(category: "Orders") { addressType: AddressTypeEnum } -"""An enumeration.""" enum OrderErrorCode @doc(category: "Orders") { BILLING_ADDRESS_NOT_SET CANNOT_CANCEL_FULFILLMENT @@ -13080,7 +13074,6 @@ enum OrderErrorCode @doc(category: "Orders") { NON_REMOVABLE_GIFT_LINE } -"""An enumeration.""" enum AddressTypeEnum { BILLING SHIPPING @@ -13537,7 +13530,6 @@ type CustomerEvent implements Node @doc(category: "Users") { orderLine: OrderLine } -"""An enumeration.""" enum CustomerEventsEnum @doc(category: "Users") { ACCOUNT_CREATED ACCOUNT_ACTIVATED @@ -13614,7 +13606,6 @@ type GiftCardSettings @doc(category: "Gift cards") { expiryPeriod: TimePeriod } -"""An enumeration.""" enum GiftCardSettingsExpiryTypeEnum @doc(category: "Gift cards") { NEVER_EXPIRE EXPIRY_PERIOD @@ -13628,7 +13619,6 @@ type TimePeriod { type: TimePeriodTypeEnum! } -"""An enumeration.""" enum TimePeriodTypeEnum { DAY WEEK @@ -14277,7 +14267,6 @@ type ConfigurationItem { label: String } -"""An enumeration.""" enum ConfigurationTypeFieldEnum { STRING MULTILINE @@ -14586,7 +14575,6 @@ type Promotion implements Node & ObjectWithMetadata @doc(category: "Discounts") events: [PromotionEvent!] } -"""An enumeration.""" enum PromotionTypeEnum @doc(category: "Discounts") { CATALOGUE ORDER @@ -14685,13 +14673,11 @@ type PromotionRule implements Node @doc(category: "Discounts") { giftsLimit: Int } -"""An enumeration.""" enum RewardValueTypeEnum @doc(category: "Discounts") { FIXED PERCENTAGE } -"""An enumeration.""" enum RewardTypeEnum @doc(category: "Discounts") { SUBTOTAL_DISCOUNT GIFT @@ -14740,7 +14726,6 @@ interface PromotionEventInterface { createdBy: UserOrApp } -"""An enumeration.""" enum PromotionEventsEnum @doc(category: "Discounts") { PROMOTION_CREATED PROMOTION_UPDATED @@ -15040,7 +15025,6 @@ type ExportEvent implements Node { message: String! } -"""An enumeration.""" enum ExportEventsEnum { EXPORT_PENDING EXPORT_SUCCESS @@ -16974,6 +16958,11 @@ type Mutation { 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. + + Triggers the following webhook events: + - TRANSACTION_ITEM_METADATA_UPDATED (async): Optionally called when transaction's metadata was updated. + - CHECKOUT_FULLY_PAID (async): Optionally called when the checkout charge status changed to `FULL` or `OVERCHARGED`. + - ORDER_UPDATED (async): Optionally called when the transaction is related to the order and the order was updated. """ transactionEventReport( """ @@ -16994,7 +16983,9 @@ type Mutation { """The ID of the transaction. One of field id or token is required.""" id: ID - """The message related to the event.""" + """ + The message related to the event. The maximum length is 512 characters; any text exceeding this limit will be truncated. + """ message: String """PSP Reference of the event to report.""" @@ -17012,9 +17003,23 @@ type Mutation { """ token: UUID + """ + Fields required to update the transaction metadata. + + Added in Saleor 3.17. + """ + transactionMetadata: [MetadataInput!] + + """ + Fields required to update the transaction private metadata. + + Added in Saleor 3.17. + """ + transactionPrivateMetadata: [MetadataInput!] + """Current status of the event to report.""" type: TransactionEventTypeEnum! - ): TransactionEventReport @doc(category: "Payments") + ): TransactionEventReport @doc(category: "Payments") @webhookEventsInfo(asyncEvents: [TRANSACTION_ITEM_METADATA_UPDATED, CHECKOUT_FULLY_PAID, ORDER_UPDATED], 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. There is a limit of 100 transaction items per checkout / order. @@ -20598,7 +20603,6 @@ type WebhookError @doc(category: "Webhooks") { code: WebhookErrorCode! } -"""An enumeration.""" enum WebhookErrorCode @doc(category: "Webhooks") { GRAPHQL_ERROR INVALID @@ -20775,7 +20779,6 @@ type WebhookDryRunError @doc(category: "Webhooks") { code: WebhookDryRunErrorCode! } -"""An enumeration.""" enum WebhookDryRunErrorCode @doc(category: "Webhooks") { GRAPHQL_ERROR NOT_FOUND @@ -20815,7 +20818,6 @@ type WebhookTriggerError @doc(category: "Webhooks") { code: WebhookTriggerErrorCode! } -"""An enumeration.""" enum WebhookTriggerErrorCode @doc(category: "Webhooks") { GRAPHQL_ERROR NOT_FOUND @@ -20856,7 +20858,6 @@ type WarehouseError @doc(category: "Products") { shippingZones: [ID!] } -"""An enumeration.""" enum WarehouseErrorCode @doc(category: "Products") { ALREADY_EXISTS GRAPHQL_ERROR @@ -21001,7 +21002,6 @@ type TaxClassCreateError @doc(category: "Taxes") { countryCodes: [String!]! } -"""An enumeration.""" enum TaxClassCreateErrorCode @doc(category: "Taxes") { GRAPHQL_ERROR INVALID @@ -21051,7 +21051,6 @@ type TaxClassDeleteError @doc(category: "Taxes") { code: TaxClassDeleteErrorCode! } -"""An enumeration.""" enum TaxClassDeleteErrorCode @doc(category: "Taxes") { GRAPHQL_ERROR INVALID @@ -21086,7 +21085,6 @@ type TaxClassUpdateError @doc(category: "Taxes") { countryCodes: [String!]! } -"""An enumeration.""" enum TaxClassUpdateErrorCode @doc(category: "Taxes") { DUPLICATED_INPUT_ITEM GRAPHQL_ERROR @@ -21147,7 +21145,6 @@ type TaxConfigurationUpdateError @doc(category: "Taxes") { countryCodes: [String!]! } -"""An enumeration.""" enum TaxConfigurationUpdateErrorCode @doc(category: "Taxes") { DUPLICATED_INPUT_ITEM GRAPHQL_ERROR @@ -21240,7 +21237,6 @@ type TaxCountryConfigurationUpdateError @doc(category: "Taxes") { taxClassIds: [String!]! } -"""An enumeration.""" enum TaxCountryConfigurationUpdateErrorCode @doc(category: "Taxes") { GRAPHQL_ERROR INVALID @@ -21283,7 +21279,6 @@ type TaxCountryConfigurationDeleteError @doc(category: "Taxes") { code: TaxCountryConfigurationDeleteErrorCode! } -"""An enumeration.""" enum TaxCountryConfigurationDeleteErrorCode @doc(category: "Taxes") { GRAPHQL_ERROR INVALID @@ -21317,7 +21312,6 @@ type TaxExemptionManageError @doc(category: "Taxes") { code: TaxExemptionManageErrorCode! } -"""An enumeration.""" enum TaxExemptionManageErrorCode @doc(category: "Taxes") { GRAPHQL_ERROR INVALID @@ -21367,7 +21361,6 @@ type StockBulkUpdateError @doc(category: "Products") { code: StockBulkUpdateErrorCode! } -"""An enumeration.""" enum StockBulkUpdateErrorCode @doc(category: "Products") { GRAPHQL_ERROR INVALID @@ -21429,7 +21422,6 @@ type ShopError @doc(category: "Shop") { code: ShopErrorCode! } -"""An enumeration.""" enum ShopErrorCode { ALREADY_EXISTS CANNOT_FETCH_TAX_RATES @@ -21665,7 +21657,6 @@ type TranslationError { code: TranslationErrorCode! } -"""An enumeration.""" enum TranslationErrorCode { GRAPHQL_ERROR INVALID @@ -21715,7 +21706,6 @@ type OrderSettingsError @doc(category: "Orders") { code: OrderSettingsErrorCode! } -"""An enumeration.""" enum OrderSettingsErrorCode @doc(category: "Orders") { INVALID } @@ -21756,7 +21746,6 @@ type GiftCardSettingsError @doc(category: "Gift cards") { code: GiftCardSettingsErrorCode! } -"""An enumeration.""" enum GiftCardSettingsErrorCode @doc(category: "Gift cards") { INVALID REQUIRED @@ -21810,7 +21799,6 @@ type ShippingError @doc(category: "Shipping") { channels: [ID!] } -"""An enumeration.""" enum ShippingErrorCode @doc(category: "Shipping") { ALREADY_EXISTS GRAPHQL_ERROR @@ -22124,7 +22112,6 @@ type ProductError @doc(category: "Products") { values: [ID!] } -"""An enumeration.""" enum ProductErrorCode @doc(category: "Products") { ALREADY_EXISTS ATTRIBUTE_ALREADY_ASSIGNED @@ -22354,7 +22341,6 @@ type CollectionError @doc(category: "Products") { code: CollectionErrorCode! } -"""An enumeration.""" enum CollectionErrorCode @doc(category: "Products") { DUPLICATED_INPUT_ITEM GRAPHQL_ERROR @@ -22862,7 +22848,6 @@ type ProductBulkCreateError @doc(category: "Products") { channels: [ID!] } -"""An enumeration.""" enum ProductBulkCreateErrorCode @doc(category: "Products") { ATTRIBUTE_ALREADY_ASSIGNED ATTRIBUTE_CANNOT_BE_ASSIGNED @@ -23323,7 +23308,6 @@ type ProductBulkTranslateError { code: ProductTranslateErrorCode! } -"""An enumeration.""" enum ProductTranslateErrorCode @doc(category: "Products") { GRAPHQL_ERROR INVALID @@ -23943,7 +23927,6 @@ type ProductVariantBulkError @doc(category: "Products") { channelListings: [ID!] } -"""An enumeration.""" enum ProductVariantBulkErrorCode @doc(category: "Products") { ATTRIBUTE_ALREADY_ASSIGNED ATTRIBUTE_CANNOT_BE_ASSIGNED @@ -24201,7 +24184,6 @@ type StockError @doc(category: "Products") { code: StockErrorCode! } -"""An enumeration.""" enum StockErrorCode @doc(category: "Products") { ALREADY_EXISTS GRAPHQL_ERROR @@ -24357,7 +24339,6 @@ type ProductVariantBulkTranslateError { code: ProductVariantTranslateErrorCode! } -"""An enumeration.""" enum ProductVariantTranslateErrorCode @doc(category: "Products") { GRAPHQL_ERROR INVALID @@ -24468,7 +24449,6 @@ type PaymentError @doc(category: "Payments") { variants: [ID!] } -"""An enumeration.""" enum PaymentErrorCode @doc(category: "Payments") { BILLING_ADDRESS_NOT_SET GRAPHQL_ERROR @@ -24606,7 +24586,6 @@ type TransactionCreateError @doc(category: "Payments") { code: TransactionCreateErrorCode! } -"""An enumeration.""" enum TransactionCreateErrorCode @doc(category: "Payments") { INVALID GRAPHQL_ERROR @@ -24714,7 +24693,6 @@ type TransactionUpdateError @doc(category: "Payments") { code: TransactionUpdateErrorCode! } -"""An enumeration.""" enum TransactionUpdateErrorCode @doc(category: "Payments") { INVALID GRAPHQL_ERROR @@ -24806,7 +24784,6 @@ type TransactionRequestActionError @doc(category: "Payments") { code: TransactionRequestActionErrorCode! } -"""An enumeration.""" enum TransactionRequestActionErrorCode @doc(category: "Payments") { INVALID GRAPHQL_ERROR @@ -24841,7 +24818,6 @@ type TransactionRequestRefundForGrantedRefundError @doc(category: "Payments") { code: TransactionRequestRefundForGrantedRefundErrorCode! } -"""An enumeration.""" enum TransactionRequestRefundForGrantedRefundErrorCode @doc(category: "Payments") { INVALID GRAPHQL_ERROR @@ -24860,8 +24836,13 @@ 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. + +Triggers the following webhook events: +- TRANSACTION_ITEM_METADATA_UPDATED (async): Optionally called when transaction's metadata was updated. +- CHECKOUT_FULLY_PAID (async): Optionally called when the checkout charge status changed to `FULL` or `OVERCHARGED`. +- ORDER_UPDATED (async): Optionally called when the transaction is related to the order and the order was updated. """ -type TransactionEventReport @doc(category: "Payments") { +type TransactionEventReport @doc(category: "Payments") @webhookEventsInfo(asyncEvents: [TRANSACTION_ITEM_METADATA_UPDATED, CHECKOUT_FULLY_PAID, ORDER_UPDATED], syncEvents: []) { """Defines if the reported event hasn't been processed earlier.""" alreadyProcessed: Boolean @@ -24888,7 +24869,6 @@ type TransactionEventReportError @doc(category: "Payments") { code: TransactionEventReportErrorCode! } -"""An enumeration.""" enum TransactionEventReportErrorCode @doc(category: "Payments") { INVALID GRAPHQL_ERROR @@ -24933,7 +24913,6 @@ type PaymentGatewayConfigError @doc(category: "Payments") { code: PaymentGatewayConfigErrorCode! } -"""An enumeration.""" enum PaymentGatewayConfigErrorCode @doc(category: "Payments") { GRAPHQL_ERROR INVALID @@ -24953,7 +24932,6 @@ type PaymentGatewayInitializeError @doc(category: "Payments") { code: PaymentGatewayInitializeErrorCode! } -"""An enumeration.""" enum PaymentGatewayInitializeErrorCode @doc(category: "Payments") { GRAPHQL_ERROR INVALID @@ -25000,7 +24978,6 @@ type TransactionInitializeError @doc(category: "Payments") { code: TransactionInitializeErrorCode! } -"""An enumeration.""" enum TransactionInitializeErrorCode @doc(category: "Payments") { GRAPHQL_ERROR INVALID @@ -25041,7 +25018,6 @@ type TransactionProcessError @doc(category: "Payments") { code: TransactionProcessErrorCode! } -"""An enumeration.""" enum TransactionProcessErrorCode @doc(category: "Payments") { GRAPHQL_ERROR INVALID @@ -25098,7 +25074,6 @@ type PaymentMethodRequestDeleteError @doc(category: "Payments") { code: StoredPaymentMethodRequestDeleteErrorCode! } -"""An enumeration.""" enum StoredPaymentMethodRequestDeleteErrorCode @doc(category: "Payments") { GRAPHQL_ERROR INVALID @@ -25155,7 +25130,6 @@ type PaymentGatewayInitializeTokenizationError @doc(category: "Payments") { code: PaymentGatewayInitializeTokenizationErrorCode! } -"""An enumeration.""" enum PaymentGatewayInitializeTokenizationErrorCode @doc(category: "Payments") { GRAPHQL_ERROR INVALID @@ -25219,7 +25193,6 @@ type PaymentMethodInitializeTokenizationError @doc(category: "Payments") { code: PaymentMethodInitializeTokenizationErrorCode! } -"""An enumeration.""" enum PaymentMethodInitializeTokenizationErrorCode @doc(category: "Payments") { GRAPHQL_ERROR INVALID @@ -25265,7 +25238,6 @@ type PaymentMethodProcessTokenizationError @doc(category: "Payments") { code: PaymentMethodProcessTokenizationErrorCode! } -"""An enumeration.""" enum PaymentMethodProcessTokenizationErrorCode @doc(category: "Payments") { GRAPHQL_ERROR INVALID @@ -25304,7 +25276,6 @@ type PageError @doc(category: "Pages") { values: [ID!] } -"""An enumeration.""" enum PageErrorCode @doc(category: "Pages") { GRAPHQL_ERROR INVALID @@ -26107,7 +26078,6 @@ type OrderGrantRefundCreateError @doc(category: "Orders") { lines: [OrderGrantRefundCreateLineError!] } -"""An enumeration.""" enum OrderGrantRefundCreateErrorCode @doc(category: "Orders") { GRAPHQL_ERROR NOT_FOUND @@ -26133,7 +26103,6 @@ type OrderGrantRefundCreateLineError { lineId: ID! } -"""An enumeration.""" enum OrderGrantRefundCreateLineErrorCode { GRAPHQL_ERROR NOT_FOUND @@ -26237,7 +26206,6 @@ type OrderGrantRefundUpdateError @doc(category: "Orders") { removeLines: [OrderGrantRefundUpdateLineError!] } -"""An enumeration.""" enum OrderGrantRefundUpdateErrorCode @doc(category: "Orders") { GRAPHQL_ERROR NOT_FOUND @@ -26263,7 +26231,6 @@ type OrderGrantRefundUpdateLineError { lineId: ID! } -"""An enumeration.""" enum OrderGrantRefundUpdateLineErrorCode { GRAPHQL_ERROR NOT_FOUND @@ -26483,7 +26450,6 @@ type OrderNoteAddError @doc(category: "Orders") { code: OrderNoteAddErrorCode } -"""An enumeration.""" enum OrderNoteAddErrorCode @doc(category: "Orders") { GRAPHQL_ERROR REQUIRED @@ -26525,7 +26491,6 @@ type OrderNoteUpdateError @doc(category: "Orders") { code: OrderNoteUpdateErrorCode } -"""An enumeration.""" enum OrderNoteUpdateErrorCode @doc(category: "Orders") { GRAPHQL_ERROR NOT_FOUND @@ -26667,7 +26632,6 @@ type OrderBulkCreateError @doc(category: "Orders") { code: OrderBulkCreateErrorCode } -"""An enumeration.""" enum OrderBulkCreateErrorCode { GRAPHQL_ERROR REQUIRED @@ -26816,6 +26780,13 @@ input OrderBulkCreateOrderLineInput @doc(category: "Orders") { """The name of the product.""" productName: String + """ + The SKU of the product. + + Added in Saleor 3.18. + """ + productSku: String + """Translation of the product variant name.""" translatedVariantName: String @@ -26840,6 +26811,27 @@ input OrderBulkCreateOrderLineInput @doc(category: "Orders") { """Price of the order line excluding applied discount.""" undiscountedTotalPrice: TaxedMoneyInput! + """ + Reason of the discount on order line. + + Added in Saleor 3.19. + """ + unitDiscountReason: String + + """ + Type of the discount: fixed or percent + + Added in Saleor 3.19. + """ + unitDiscountType: DiscountValueTypeEnum + + """ + Value of the discount. Can store fixed value or percent value + + Added in Saleor 3.19. + """ + unitDiscountValue: PositiveDecimal + """The ID of the warehouse, where the line will be allocated.""" warehouse: ID! @@ -26985,7 +26977,6 @@ type MetadataError { code: MetadataErrorCode! } -"""An enumeration.""" enum MetadataErrorCode { GRAPHQL_ERROR INVALID @@ -27046,7 +27037,6 @@ type MenuError @doc(category: "Menu") { code: MenuErrorCode! } -"""An enumeration.""" enum MenuErrorCode { CANNOT_ASSIGN_NODE GRAPHQL_ERROR @@ -27308,7 +27298,6 @@ type InvoiceError @doc(category: "Orders") { code: InvoiceErrorCode! } -"""An enumeration.""" enum InvoiceErrorCode @doc(category: "Orders") { REQUIRED NOT_READY @@ -27457,7 +27446,6 @@ type GiftCardError @doc(category: "Gift cards") { tags: [String!] } -"""An enumeration.""" enum GiftCardErrorCode @doc(category: "Gift cards") { ALREADY_EXISTS GRAPHQL_ERROR @@ -27805,7 +27793,6 @@ type PluginError { code: PluginErrorCode! } -"""An enumeration.""" enum PluginErrorCode { GRAPHQL_ERROR INVALID @@ -27853,7 +27840,6 @@ type ExternalNotificationError { code: ExternalNotificationErrorCodes! } -"""An enumeration.""" enum ExternalNotificationErrorCodes { REQUIRED INVALID_MODEL_TYPE @@ -27924,7 +27910,6 @@ type PromotionCreateError { giftsLimitExceedBy: Int } -"""An enumeration.""" enum PromotionCreateErrorCode { GRAPHQL_ERROR NOT_FOUND @@ -28092,7 +28077,6 @@ type PromotionUpdateError { code: PromotionUpdateErrorCode! } -"""An enumeration.""" enum PromotionUpdateErrorCode { GRAPHQL_ERROR NOT_FOUND @@ -28144,7 +28128,6 @@ type PromotionDeleteError { code: PromotionDeleteErrorCode! } -"""An enumeration.""" enum PromotionDeleteErrorCode { GRAPHQL_ERROR NOT_FOUND @@ -28192,7 +28175,6 @@ type PromotionRuleCreateError { giftsLimitExceedBy: Int } -"""An enumeration.""" enum PromotionRuleCreateErrorCode { GRAPHQL_ERROR NOT_FOUND @@ -28301,7 +28283,6 @@ type PromotionRuleUpdateError { giftsLimitExceedBy: Int } -"""An enumeration.""" enum PromotionRuleUpdateErrorCode { GRAPHQL_ERROR NOT_FOUND @@ -28410,7 +28391,6 @@ type PromotionRuleDeleteError { code: PromotionRuleDeleteErrorCode! } -"""An enumeration.""" enum PromotionRuleDeleteErrorCode { GRAPHQL_ERROR NOT_FOUND @@ -28506,7 +28486,6 @@ type DiscountError @doc(category: "Discounts") { voucherCodes: [String!] } -"""An enumeration.""" enum DiscountErrorCode @doc(category: "Discounts") { ALREADY_EXISTS GRAPHQL_ERROR @@ -28947,7 +28926,6 @@ type VoucherCodeBulkDeleteError @doc(category: "Discounts") { voucherCodes: [ID!] } -"""An enumeration.""" enum VoucherCodeBulkDeleteErrorCode @doc(category: "Discounts") { GRAPHQL_ERROR NOT_FOUND @@ -28985,7 +28963,6 @@ type ExportError { code: ExportErrorCode! } -"""An enumeration.""" enum ExportErrorCode { GRAPHQL_ERROR INVALID @@ -29050,7 +29027,6 @@ enum ProductFieldEnum @doc(category: "Products") { VARIANT_MEDIA } -"""An enumeration.""" enum FileTypesEnum { CSV XLSX @@ -29146,7 +29122,6 @@ type UploadError { code: UploadErrorCode! } -"""An enumeration.""" enum UploadErrorCode { GRAPHQL_ERROR } @@ -29186,7 +29161,6 @@ type CheckoutError @doc(category: "Checkout") { addressType: AddressTypeEnum } -"""An enumeration.""" enum CheckoutErrorCode @doc(category: "Checkout") { BILLING_ADDRESS_NOT_SET CHECKOUT_NOT_FULLY_PAID @@ -29403,7 +29377,6 @@ type CheckoutCreateFromOrderUnavailableVariant @doc(category: "Checkout") { lineId: ID! } -"""An enumeration.""" enum CheckoutCreateFromOrderUnavailableVariantErrorCode @doc(category: "Checkout") { NOT_FOUND PRODUCT_UNAVAILABLE_FOR_PURCHASE @@ -29426,7 +29399,6 @@ type CheckoutCreateFromOrderError @doc(category: "Checkout") { code: CheckoutCreateFromOrderErrorCode! } -"""An enumeration.""" enum CheckoutCreateFromOrderErrorCode @doc(category: "Checkout") { GRAPHQL_ERROR INVALID @@ -29728,7 +29700,6 @@ type OrderCreateFromCheckoutError @doc(category: "Orders") { lines: [ID!] } -"""An enumeration.""" enum OrderCreateFromCheckoutErrorCode @doc(category: "Orders") { GRAPHQL_ERROR CHECKOUT_NOT_FOUND @@ -29779,7 +29750,6 @@ type ChannelError @doc(category: "Channels") { warehouses: [ID!] } -"""An enumeration.""" enum ChannelErrorCode @doc(category: "Channels") { ALREADY_EXISTS GRAPHQL_ERROR @@ -29946,6 +29916,13 @@ input CheckoutSettingsInput @doc(category: "Checkout") { DEPRECATED: this field will be removed in Saleor 4.0. """ useLegacyErrorFlow: Boolean + + """ + Default `false`. Determines if the paid checkouts should be automatically completed. This setting applies only to checkouts where payment was processed through transactions.When enabled, the checkout will be automatically completed once the checkout `charge_status` reaches `FULL`. This occurs when the total sum of charged and authorized transaction amounts equals or exceeds the checkout's total amount. + + Added in Saleor 3.20. + """ + automaticallyCompleteFullyPaidCheckouts: Boolean } input PaymentSettingsInput @doc(category: "Payments") { @@ -30148,7 +30125,6 @@ type AttributeError @doc(category: "Attributes") { code: AttributeErrorCode! } -"""An enumeration.""" enum AttributeErrorCode @doc(category: "Attributes") { ALREADY_EXISTS GRAPHQL_ERROR @@ -30434,7 +30410,6 @@ type AttributeBulkCreateError @doc(category: "Attributes") { code: AttributeBulkCreateErrorCode! } -"""An enumeration.""" enum AttributeBulkCreateErrorCode @doc(category: "Attributes") { ALREADY_EXISTS BLANK @@ -30489,7 +30464,6 @@ type AttributeBulkUpdateError @doc(category: "Attributes") { code: AttributeBulkUpdateErrorCode! } -"""An enumeration.""" enum AttributeBulkUpdateErrorCode { ALREADY_EXISTS BLANK @@ -30563,7 +30537,6 @@ type AttributeBulkTranslateError { code: AttributeTranslateErrorCode! } -"""An enumeration.""" enum AttributeTranslateErrorCode @doc(category: "Attributes") { GRAPHQL_ERROR INVALID @@ -30706,7 +30679,6 @@ type AttributeValueBulkTranslateError { code: AttributeValueTranslateErrorCode! } -"""An enumeration.""" enum AttributeValueTranslateErrorCode @doc(category: "Attributes") { GRAPHQL_ERROR INVALID @@ -30799,7 +30771,6 @@ type AppError @doc(category: "Apps") { permissions: [PermissionEnum!] } -"""An enumeration.""" enum AppErrorCode @doc(category: "Apps") { FORBIDDEN GRAPHQL_ERROR @@ -31214,7 +31185,6 @@ type AccountError @doc(category: "Users") { addressType: AddressTypeEnum } -"""An enumeration.""" enum AccountErrorCode @doc(category: "Users") { ACTIVATE_OWN_ACCOUNT ACTIVATE_SUPERUSER_ACCOUNT @@ -31405,7 +31375,6 @@ type SendConfirmationEmailError @doc(category: "Users") { code: SendConfirmationEmailErrorCode! } -"""An enumeration.""" enum SendConfirmationEmailErrorCode @doc(category: "Users") { INVALID ACCOUNT_CONFIRMED @@ -31954,7 +31923,6 @@ type CustomerBulkUpdateError @doc(category: "Users") { code: CustomerBulkUpdateErrorCode! } -"""An enumeration.""" enum CustomerBulkUpdateErrorCode @doc(category: "Users") { BLANK DUPLICATED_INPUT_ITEM @@ -32211,7 +32179,6 @@ type PermissionGroupError @doc(category: "Users") { channels: [ID!] } -"""An enumeration.""" enum PermissionGroupErrorCode @doc(category: "Users") { REQUIRED UNIQUE @@ -32345,7 +32312,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): DraftOrderCreated + ): DraftOrderCreated @doc(category: "Orders") """ Event sent when draft order is updated. @@ -32359,7 +32326,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): DraftOrderUpdated + ): DraftOrderUpdated @doc(category: "Orders") """ Event sent when draft order is deleted. @@ -32373,7 +32340,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): DraftOrderDeleted + ): DraftOrderDeleted @doc(category: "Orders") """ Event sent when new order is created. @@ -32387,7 +32354,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): OrderCreated + ): OrderCreated @doc(category: "Orders") """ Event sent when order is updated. @@ -32401,7 +32368,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): OrderUpdated + ): OrderUpdated @doc(category: "Orders") """ Event sent when order is confirmed. @@ -32415,7 +32382,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): OrderConfirmed + ): OrderConfirmed @doc(category: "Orders") """ Payment has been made. The order may be partially or fully paid. @@ -32429,7 +32396,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): OrderPaid + ): OrderPaid @doc(category: "Orders") """ Event sent when order is fully paid. @@ -32443,7 +32410,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): OrderFullyPaid + ): OrderFullyPaid @doc(category: "Orders") """ The order received a refund. The order may be partially or fully refunded. @@ -32457,7 +32424,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): OrderRefunded + ): OrderRefunded @doc(category: "Orders") """ The order is fully refunded. @@ -32471,7 +32438,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): OrderFullyRefunded + ): OrderFullyRefunded @doc(category: "Orders") """ Event sent when order is fulfilled. @@ -32485,7 +32452,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): OrderFulfilled + ): OrderFulfilled @doc(category: "Orders") """ Event sent when order is cancelled. @@ -32499,7 +32466,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): OrderCancelled + ): OrderCancelled @doc(category: "Orders") """ Event sent when order becomes expired. @@ -32513,7 +32480,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): OrderExpired + ): OrderExpired @doc(category: "Orders") """ Event sent when order metadata is updated. @@ -32527,7 +32494,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): OrderMetadataUpdated + ): OrderMetadataUpdated @doc(category: "Orders") """ Event sent when orders are imported. @@ -32541,7 +32508,7 @@ type Subscription @doc(category: "Miscellaneous") { List of channel slugs. The event will be sent only if the order belongs to one of the provided channels. If the channel slug list is empty, orders that belong to any channel will be sent. Maximally 500 items. """ channels: [String!] - ): OrderBulkCreated + ): OrderBulkCreated @doc(category: "Orders") } interface Event { @@ -32900,7 +32867,6 @@ type OrderBulkCreated implements Event @doc(category: "Orders") { orders: [Order!] } -"""An enumeration.""" enum DistanceUnitsEnum { MM CM @@ -32912,7 +32878,6 @@ enum DistanceUnitsEnum { INCH } -"""An enumeration.""" enum AreaUnitsEnum { SQ_MM SQ_CM @@ -32924,7 +32889,6 @@ enum AreaUnitsEnum { SQ_INCH } -"""An enumeration.""" enum VolumeUnitsEnum { CUBIC_MILLIMETER CUBIC_CENTIMETER @@ -35086,7 +35050,7 @@ type CheckoutUpdated implements Event @doc(category: "Checkout") { } """ -Event sent when checkout is fully paid with transactions. +Event sent when checkout is fully paid with transactions. The checkout is considered as fully paid when the checkout `charge_status` is `FULL` or `OVERCHARGED`. The event is not sent when the checkout authorization flow strategy is used. Added in Saleor 3.13. diff --git a/package.json b/package.json index 609ac639..537c2de1 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "pnpm": ">=9.0.0 <10.0.0" }, "dependencies": { - "@saleor/app-sdk": "1.0.0", + "@saleor/app-sdk": "1.1.1", "@saleor/macaw-ui": "1.1.10", "@urql/exchange-auth": "^1.0.0", "@vitejs/plugin-react": "4.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4d5f99f4..0d2d81e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@saleor/app-sdk': - specifier: 1.0.0 - version: 1.0.0(graphql@16.8.1)(next@15.1.7(@babel/core@7.24.0)(@opentelemetry/api@1.9.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: 1.1.1 + version: 1.1.1(graphql@16.8.1)(next@15.1.7(@babel/core@7.24.0)(@opentelemetry/api@1.9.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@saleor/macaw-ui': specifier: 1.1.10 version: 1.1.10(@types/react-dom@18.2.10)(@types/react@18.2.25)(@vanilla-extract/css@1.14.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1698,8 +1698,8 @@ packages: '@rushstack/eslint-patch@1.5.1': resolution: {integrity: sha512-6i/8UoL0P5y4leBIGzvkZdS85RDMG9y1ihZzmTZQ5LdHUYmZ7pKFoj8X0236s3lusPs1Fa5HTQUpwI+UfTcmeA==} - '@saleor/app-sdk@1.0.0': - resolution: {integrity: sha512-st1sHLtMREf7Yxz0lqqU6qu/eyIR3tt8yDgktRvEHHH18925oc4SgLHkyWGcH5S2TEum3Tgh7F5uR+6U6WnjLA==} + '@saleor/app-sdk@1.1.1': + resolution: {integrity: sha512-pHSS7V6wN3nnmcv0yY218zDeYEE45O2ebdqCmudN1QHUiV3dhDScI7ypZvAyM5YHCws4sr67kr4187R0kmVslQ==} peerDependencies: '@vercel/kv': ^1.0.0 graphql: '>=16.6.0' @@ -6341,7 +6341,7 @@ snapshots: '@rushstack/eslint-patch@1.5.1': {} - '@saleor/app-sdk@1.0.0(graphql@16.8.1)(next@15.1.7(@babel/core@7.24.0)(@opentelemetry/api@1.9.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@saleor/app-sdk@1.1.1(graphql@16.8.1)(next@15.1.7(@babel/core@7.24.0)(@opentelemetry/api@1.9.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@opentelemetry/api': 1.9.0 '@opentelemetry/semantic-conventions': 1.30.0 From 9e83b794e15e31fca8b88064b23f02f07adbda8e Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Mon, 16 Jun 2025 15:31:13 +0200 Subject: [PATCH 2/5] Example extensions --- generated/graphql.ts | 20 ++++++++++++++++ graphql/queries/product.graphql | 6 +++++ src/pages/api/manifest.ts | 39 ++++++++++++++++++++++++++++++- src/pages/api/server-widget.ts | 41 +++++++++++++++++++++++++++++++++ src/pages/client-widget.tsx | 15 ++++++++++++ 5 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 graphql/queries/product.graphql create mode 100644 src/pages/api/server-widget.ts create mode 100644 src/pages/client-widget.tsx diff --git a/generated/graphql.ts b/generated/graphql.ts index a7acd77b..329d6967 100644 --- a/generated/graphql.ts +++ b/generated/graphql.ts @@ -33098,6 +33098,13 @@ export type _Service = { export type OrderCreatedWebhookPayloadFragment = { __typename?: 'OrderCreated', order?: { __typename?: 'Order', userEmail?: string | null, id: string, number: string, user?: { __typename?: 'User', email: string, firstName: string, lastName: string } | null } | null }; +export type ProductTimestampsQueryVariables = Exact<{ + id?: InputMaybe; +}>; + + +export type ProductTimestampsQuery = { __typename?: 'Query', product?: { __typename?: 'Product', created: any, updatedAt: any } | null }; + export type OrderCreatedSubscriptionSubscriptionVariables = Exact<{ [key: string]: never; }>; @@ -103421,6 +103428,18 @@ export const UntypedOrderCreatedWebhookPayloadFragmentDoc = gql` } } `; +export const UntypedProductTimestampsDocument = gql` + query ProductTimestamps($id: ID) { + product(id: $id) { + created + updatedAt + } +} + `; + +export function useProductTimestampsQuery(options?: Omit, 'query'>) { + return Urql.useQuery({ query: UntypedProductTimestampsDocument, ...options }); +}; export const UntypedOrderCreatedSubscriptionDocument = gql` subscription OrderCreatedSubscription { event { @@ -103468,5 +103487,6 @@ export function useLastOrderQuery(options?: Omit({ query: UntypedLastOrderDocument, ...options }); }; export const OrderCreatedWebhookPayloadFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"OrderCreatedWebhookPayload"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"OrderCreated"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"order"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"number"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}}]}}]}}]} as unknown as DocumentNode; +export const ProductTimestampsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProductTimestamps"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"product"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode; export const OrderCreatedSubscriptionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"OrderCreatedSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"event"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"OrderCreatedWebhookPayload"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"OrderCreatedWebhookPayload"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"OrderCreated"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"order"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"number"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}}]}}]}}]} as unknown as DocumentNode; export const LastOrderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"LastOrder"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"orders"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"number"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"shippingAddress"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"country"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"country"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"total"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gross"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"lines"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/graphql/queries/product.graphql b/graphql/queries/product.graphql new file mode 100644 index 00000000..efdc505c --- /dev/null +++ b/graphql/queries/product.graphql @@ -0,0 +1,6 @@ +query ProductTimestamps($id: ID) { + product(id: $id) { + created + updatedAt + } +} \ No newline at end of file diff --git a/src/pages/api/manifest.ts b/src/pages/api/manifest.ts index 89690010..242927d5 100644 --- a/src/pages/api/manifest.ts +++ b/src/pages/api/manifest.ts @@ -49,7 +49,44 @@ export default createManifestHandler({ * Optionally, extend Dashboard with custom UIs * https://docs.saleor.io/docs/3.x/developer/extending/apps/extending-dashboard-with-apps */ - extensions: [], + extensions: [ + { + url: "/api/server-widget", + permissions: [], + mount: "PRODUCT_DETAILS_WIDGETS", + label: "Product Timestamps", + target: "NEW_TAB", + options: { + newTabTarget: { + method: "POST", + }, + }, + }, + { + url: "/api/server-widget", + permissions: [], + mount: "PRODUCT_DETAILS_WIDGETS", + label: "Product Timestamps", + target: "WIDGET", + options: { + widgetTarget: { + method: "POST", + }, + }, + }, + { + url: "/client-widget", + permissions: [], + mount: "ORDER_DETAILS_WIDGETS", + label: "Order widget example", + target: "WIDGET", + options: { + widgetTarget: { + method: "GET", + }, + }, + }, + ], author: "Saleor Commerce", brand: { logo: { diff --git a/src/pages/api/server-widget.ts b/src/pages/api/server-widget.ts new file mode 100644 index 00000000..56fec654 --- /dev/null +++ b/src/pages/api/server-widget.ts @@ -0,0 +1,41 @@ +import { NextApiHandler } from "next"; +import { ExtensionPOSTAttributes } from "@saleor/app-sdk/types"; +import { verifyJWT } from "@saleor/app-sdk/auth"; +import { createClient } from "@/lib/create-graphq-client"; +import { ProductTimestampsDocument } from "../../../generated/graphql"; + +const handler: NextApiHandler = async (req, res) => { + const { appId, accessToken, saleorApiUrl, ...contextParams } = + req.body as ExtensionPOSTAttributes; + + res.setHeader("Content-Type", "text/plain"); + + try { + await verifyJWT({ + appId, + token: accessToken, + saleorApiUrl, + }); + } catch (e) { + return res.status(401).send("Not authorized"); + } + + if (!contextParams.productId) { + return res.status(200).send("Missing product ID"); + } + + const client = createClient(saleorApiUrl, async () => ({ token: accessToken })); + const productTimestamps = await client.query(ProductTimestampsDocument, { + id: contextParams.productId, + }); + + if (productTimestamps.data?.product) { + return res + .status(200) + .send( + `This product was created at ${productTimestamps.data.product.created} and last updated at ${productTimestamps.data.product.updatedAt}` + ); + } +}; + +export default handler; diff --git a/src/pages/client-widget.tsx b/src/pages/client-widget.tsx new file mode 100644 index 00000000..3fa350ff --- /dev/null +++ b/src/pages/client-widget.tsx @@ -0,0 +1,15 @@ +import { NextPage } from "next"; +import { useAppBridge } from "@saleor/app-sdk/app-bridge"; +import { Text } from "@saleor/macaw-ui"; + +const ClientWidget: NextPage = () => { + const { appBridgeState } = useAppBridge(); + + if (!appBridgeState?.ready) { + return Loading widget...; + } + + return This is a client widget. Your email is {appBridgeState.user?.email}.; +}; + +export default ClientWidget; From 7bcec32d44f1f2c79f1ecf98ad6bc1d1bf2c0bcd Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Tue, 17 Jun 2025 08:27:50 +0200 Subject: [PATCH 3/5] Add widgets --- src/pages/api/manifest.ts | 18 +++--------------- src/pages/client-widget.tsx | 2 +- src/styles/globals.css | 5 +++++ 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/pages/api/manifest.ts b/src/pages/api/manifest.ts index 242927d5..07caa71f 100644 --- a/src/pages/api/manifest.ts +++ b/src/pages/api/manifest.ts @@ -34,7 +34,7 @@ export default createManifestHandler({ */ "MANAGE_ORDERS", ], - id: "saleor.app", + id: "saleor.app.template", version: packageJson.version, /** * Configure webhooks here. They will be created in Saleor during installation @@ -51,19 +51,7 @@ export default createManifestHandler({ */ extensions: [ { - url: "/api/server-widget", - permissions: [], - mount: "PRODUCT_DETAILS_WIDGETS", - label: "Product Timestamps", - target: "NEW_TAB", - options: { - newTabTarget: { - method: "POST", - }, - }, - }, - { - url: "/api/server-widget", + url: apiBaseURL + "/api/server-widget", permissions: [], mount: "PRODUCT_DETAILS_WIDGETS", label: "Product Timestamps", @@ -75,7 +63,7 @@ export default createManifestHandler({ }, }, { - url: "/client-widget", + url: iframeBaseUrl+"/client-widget", permissions: [], mount: "ORDER_DETAILS_WIDGETS", label: "Order widget example", diff --git a/src/pages/client-widget.tsx b/src/pages/client-widget.tsx index 3fa350ff..f19c11db 100644 --- a/src/pages/client-widget.tsx +++ b/src/pages/client-widget.tsx @@ -9,7 +9,7 @@ const ClientWidget: NextPage = () => { return Loading widget...; } - return This is a client widget. Your email is {appBridgeState.user?.email}.; + return This is a client widget 😎. Your email is {appBridgeState.user?.email}.; }; export default ClientWidget; diff --git a/src/styles/globals.css b/src/styles/globals.css index 1e81d75e..81727245 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -5,3 +5,8 @@ a { code { background-color: var(--mu-colors-background-surface-brand-subdued); } + +html, body { + margin: 0; + padding: 0; +} \ No newline at end of file From 89ea913ce432a30d71ba83d33f9685c001270ba8 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Tue, 17 Jun 2025 08:31:20 +0200 Subject: [PATCH 4/5] fix manifest name --- src/pages/api/manifest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/api/manifest.ts b/src/pages/api/manifest.ts index 07caa71f..1dab9afc 100644 --- a/src/pages/api/manifest.ts +++ b/src/pages/api/manifest.ts @@ -34,7 +34,7 @@ export default createManifestHandler({ */ "MANAGE_ORDERS", ], - id: "saleor.app.template", + id: "saleor.app", version: packageJson.version, /** * Configure webhooks here. They will be created in Saleor during installation From bc8b41b8a28856ec40fd4e54e8dfac5929b50cdf Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Tue, 17 Jun 2025 14:14:51 +0200 Subject: [PATCH 5/5] conditional manifest --- src/pages/api/manifest.ts | 63 ++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/src/pages/api/manifest.ts b/src/pages/api/manifest.ts index 1dab9afc..a2a6e12a 100644 --- a/src/pages/api/manifest.ts +++ b/src/pages/api/manifest.ts @@ -1,5 +1,5 @@ import { createManifestHandler } from "@saleor/app-sdk/handlers/next"; -import { AppManifest } from "@saleor/app-sdk/types"; +import { AppExtension, AppManifest } from "@saleor/app-sdk/types"; import packageJson from "../../../package.json"; import { orderCreatedWebhook } from "./webhooks/order-created"; @@ -18,6 +18,40 @@ export default createManifestHandler({ const iframeBaseUrl = process.env.APP_IFRAME_BASE_URL ?? appBaseUrl; const apiBaseURL = process.env.APP_API_BASE_URL ?? appBaseUrl; + const extensionsForSaleor3_22: AppExtension[] = [ + { + url: apiBaseURL + "/api/server-widget", + permissions: [], + mount: "PRODUCT_DETAILS_WIDGETS", + label: "Product Timestamps", + target: "WIDGET", + options: { + widgetTarget: { + method: "POST", + }, + }, + }, + { + url: iframeBaseUrl+"/client-widget", + permissions: [], + mount: "ORDER_DETAILS_WIDGETS", + label: "Order widget example", + target: "WIDGET", + options: { + widgetTarget: { + method: "GET", + }, + }, + }, + ] + + const saleorMajor = schemaVersion && schemaVersion[0]; + const saleorMinor = schemaVersion && schemaVersion[1] + + const is3_22 = saleorMajor === 3 && saleorMinor === 22; + + const extensions = is3_22 ? extensionsForSaleor3_22 : []; + const manifest: AppManifest = { name: "Saleor App Template", tokenTargetUrl: `${apiBaseURL}/api/register`, @@ -49,32 +83,7 @@ export default createManifestHandler({ * Optionally, extend Dashboard with custom UIs * https://docs.saleor.io/docs/3.x/developer/extending/apps/extending-dashboard-with-apps */ - extensions: [ - { - url: apiBaseURL + "/api/server-widget", - permissions: [], - mount: "PRODUCT_DETAILS_WIDGETS", - label: "Product Timestamps", - target: "WIDGET", - options: { - widgetTarget: { - method: "POST", - }, - }, - }, - { - url: iframeBaseUrl+"/client-widget", - permissions: [], - mount: "ORDER_DETAILS_WIDGETS", - label: "Order widget example", - target: "WIDGET", - options: { - widgetTarget: { - method: "GET", - }, - }, - }, - ], + extensions: extensions, author: "Saleor Commerce", brand: { logo: {