From aadfd1b5893d594b33e0e0448f6d255febc48613 Mon Sep 17 00:00:00 2001 From: Sagarika Dasgupta Date: Mon, 20 Apr 2026 09:40:12 -0500 Subject: [PATCH 1/3] Update function extension templates to API version 2026-04 --- .../shopify.extension.toml.liquid | 2 +- .../shopify.extension.toml.liquid | 2 +- .../shopify.extension.toml.liquid | 2 +- functions-cart-transform-js/shopify.extension.toml.liquid | 2 +- functions-cart-transform-rs/shopify.extension.toml.liquid | 2 +- functions-cart-transform-wasm/shopify.extension.toml.liquid | 2 +- .../shopify.extension.toml.liquid | 2 +- .../shopify.extension.toml.liquid | 2 +- .../shopify.extension.toml.liquid | 2 +- functions-discount-js/shopify.extension.toml.liquid | 2 +- functions-discount-rs/shopify.extension.toml.liquid | 2 +- functions-discount-wasm/shopify.extension.toml.liquid | 2 +- .../shopify.extension.toml.liquid | 2 +- .../shopify.extension.toml.liquid | 2 +- .../shopify.extension.toml.liquid | 2 +- functions-location-rules-js/shopify.extension.toml.liquid | 2 +- functions-location-rules-rs/shopify.extension.toml.liquid | 2 +- functions-location-rules-wasm/shopify.extension.toml.liquid | 2 +- functions-order-discounts-js/shopify.extension.toml.liquid | 2 +- functions-order-discounts-rs/shopify.extension.toml.liquid | 2 +- functions-order-discounts-wasm/shopify.extension.toml.liquid | 2 +- .../shopify.extension.toml.liquid | 2 +- .../shopify.extension.toml.liquid | 2 +- .../shopify.extension.toml.liquid | 2 +- functions-product-discounts-js/shopify.extension.toml.liquid | 2 +- functions-product-discounts-rs/shopify.extension.toml.liquid | 2 +- functions-product-discounts-wasm/shopify.extension.toml.liquid | 2 +- functions-shipping-discounts-js/shopify.extension.toml.liquid | 2 +- functions-shipping-discounts-rs/shopify.extension.toml.liquid | 2 +- functions-shipping-discounts-wasm/shopify.extension.toml.liquid | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/functions-cart-checkout-validation-js/shopify.extension.toml.liquid b/functions-cart-checkout-validation-js/shopify.extension.toml.liquid index 5663abca..dc0fec00 100644 --- a/functions-cart-checkout-validation-js/shopify.extension.toml.liquid +++ b/functions-cart-checkout-validation-js/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-cart-checkout-validation-rs/shopify.extension.toml.liquid b/functions-cart-checkout-validation-rs/shopify.extension.toml.liquid index f658b44e..2de48e8c 100644 --- a/functions-cart-checkout-validation-rs/shopify.extension.toml.liquid +++ b/functions-cart-checkout-validation-rs/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-cart-checkout-validation-wasm/shopify.extension.toml.liquid b/functions-cart-checkout-validation-wasm/shopify.extension.toml.liquid index 2906c6be..7fa3b047 100644 --- a/functions-cart-checkout-validation-wasm/shopify.extension.toml.liquid +++ b/functions-cart-checkout-validation-wasm/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-cart-transform-js/shopify.extension.toml.liquid b/functions-cart-transform-js/shopify.extension.toml.liquid index 0c8dc148..8e6154b9 100644 --- a/functions-cart-transform-js/shopify.extension.toml.liquid +++ b/functions-cart-transform-js/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-cart-transform-rs/shopify.extension.toml.liquid b/functions-cart-transform-rs/shopify.extension.toml.liquid index 56b009cd..87b0fe0a 100644 --- a/functions-cart-transform-rs/shopify.extension.toml.liquid +++ b/functions-cart-transform-rs/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-cart-transform-wasm/shopify.extension.toml.liquid b/functions-cart-transform-wasm/shopify.extension.toml.liquid index b5b27758..d19265c9 100644 --- a/functions-cart-transform-wasm/shopify.extension.toml.liquid +++ b/functions-cart-transform-wasm/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-delivery-customization-js/shopify.extension.toml.liquid b/functions-delivery-customization-js/shopify.extension.toml.liquid index b9878e07..17eb887b 100644 --- a/functions-delivery-customization-js/shopify.extension.toml.liquid +++ b/functions-delivery-customization-js/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-delivery-customization-rs/shopify.extension.toml.liquid b/functions-delivery-customization-rs/shopify.extension.toml.liquid index 5d07aebf..05411ed1 100644 --- a/functions-delivery-customization-rs/shopify.extension.toml.liquid +++ b/functions-delivery-customization-rs/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-delivery-customization-wasm/shopify.extension.toml.liquid b/functions-delivery-customization-wasm/shopify.extension.toml.liquid index a7d4e997..24eaeba7 100644 --- a/functions-delivery-customization-wasm/shopify.extension.toml.liquid +++ b/functions-delivery-customization-wasm/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-discount-js/shopify.extension.toml.liquid b/functions-discount-js/shopify.extension.toml.liquid index 68cbc335..d4f761fd 100644 --- a/functions-discount-js/shopify.extension.toml.liquid +++ b/functions-discount-js/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-discount-rs/shopify.extension.toml.liquid b/functions-discount-rs/shopify.extension.toml.liquid index 468a9113..8a39dfe6 100644 --- a/functions-discount-rs/shopify.extension.toml.liquid +++ b/functions-discount-rs/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-discount-wasm/shopify.extension.toml.liquid b/functions-discount-wasm/shopify.extension.toml.liquid index b41fdcbe..51fe3154 100644 --- a/functions-discount-wasm/shopify.extension.toml.liquid +++ b/functions-discount-wasm/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-fulfillment-constraints-js/shopify.extension.toml.liquid b/functions-fulfillment-constraints-js/shopify.extension.toml.liquid index 3c3b5e4e..84344039 100644 --- a/functions-fulfillment-constraints-js/shopify.extension.toml.liquid +++ b/functions-fulfillment-constraints-js/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-fulfillment-constraints-rs/shopify.extension.toml.liquid b/functions-fulfillment-constraints-rs/shopify.extension.toml.liquid index 000833ad..9ed99492 100644 --- a/functions-fulfillment-constraints-rs/shopify.extension.toml.liquid +++ b/functions-fulfillment-constraints-rs/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-fulfillment-constraints-wasm/shopify.extension.toml.liquid b/functions-fulfillment-constraints-wasm/shopify.extension.toml.liquid index 84762ff3..62996216 100644 --- a/functions-fulfillment-constraints-wasm/shopify.extension.toml.liquid +++ b/functions-fulfillment-constraints-wasm/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-location-rules-js/shopify.extension.toml.liquid b/functions-location-rules-js/shopify.extension.toml.liquid index 627d344f..2d96c801 100644 --- a/functions-location-rules-js/shopify.extension.toml.liquid +++ b/functions-location-rules-js/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-location-rules-rs/shopify.extension.toml.liquid b/functions-location-rules-rs/shopify.extension.toml.liquid index 902b630c..ed4b66f1 100644 --- a/functions-location-rules-rs/shopify.extension.toml.liquid +++ b/functions-location-rules-rs/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-location-rules-wasm/shopify.extension.toml.liquid b/functions-location-rules-wasm/shopify.extension.toml.liquid index a6a44ff9..d4b35e3b 100644 --- a/functions-location-rules-wasm/shopify.extension.toml.liquid +++ b/functions-location-rules-wasm/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-order-discounts-js/shopify.extension.toml.liquid b/functions-order-discounts-js/shopify.extension.toml.liquid index c894085e..beaa93a7 100644 --- a/functions-order-discounts-js/shopify.extension.toml.liquid +++ b/functions-order-discounts-js/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-order-discounts-rs/shopify.extension.toml.liquid b/functions-order-discounts-rs/shopify.extension.toml.liquid index fdc8e9b7..cc0b5afa 100644 --- a/functions-order-discounts-rs/shopify.extension.toml.liquid +++ b/functions-order-discounts-rs/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-order-discounts-wasm/shopify.extension.toml.liquid b/functions-order-discounts-wasm/shopify.extension.toml.liquid index 3f571e4c..faa4e39c 100644 --- a/functions-order-discounts-wasm/shopify.extension.toml.liquid +++ b/functions-order-discounts-wasm/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-payment-customization-js/shopify.extension.toml.liquid b/functions-payment-customization-js/shopify.extension.toml.liquid index 1f996be1..ed1f4b26 100644 --- a/functions-payment-customization-js/shopify.extension.toml.liquid +++ b/functions-payment-customization-js/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-payment-customization-rs/shopify.extension.toml.liquid b/functions-payment-customization-rs/shopify.extension.toml.liquid index 3f237c1c..6ca18de3 100644 --- a/functions-payment-customization-rs/shopify.extension.toml.liquid +++ b/functions-payment-customization-rs/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-payment-customization-wasm/shopify.extension.toml.liquid b/functions-payment-customization-wasm/shopify.extension.toml.liquid index 37f29b5d..0db0d53f 100644 --- a/functions-payment-customization-wasm/shopify.extension.toml.liquid +++ b/functions-payment-customization-wasm/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-product-discounts-js/shopify.extension.toml.liquid b/functions-product-discounts-js/shopify.extension.toml.liquid index c462aab8..f7241e58 100644 --- a/functions-product-discounts-js/shopify.extension.toml.liquid +++ b/functions-product-discounts-js/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-product-discounts-rs/shopify.extension.toml.liquid b/functions-product-discounts-rs/shopify.extension.toml.liquid index 3e4863a0..73f89a5a 100644 --- a/functions-product-discounts-rs/shopify.extension.toml.liquid +++ b/functions-product-discounts-rs/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-product-discounts-wasm/shopify.extension.toml.liquid b/functions-product-discounts-wasm/shopify.extension.toml.liquid index 17e4b9a4..347b8d0b 100644 --- a/functions-product-discounts-wasm/shopify.extension.toml.liquid +++ b/functions-product-discounts-wasm/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-shipping-discounts-js/shopify.extension.toml.liquid b/functions-shipping-discounts-js/shopify.extension.toml.liquid index ef1eb919..bb5cac9b 100644 --- a/functions-shipping-discounts-js/shopify.extension.toml.liquid +++ b/functions-shipping-discounts-js/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-shipping-discounts-rs/shopify.extension.toml.liquid b/functions-shipping-discounts-rs/shopify.extension.toml.liquid index 6caffec6..1a0f3c38 100644 --- a/functions-shipping-discounts-rs/shopify.extension.toml.liquid +++ b/functions-shipping-discounts-rs/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" diff --git a/functions-shipping-discounts-wasm/shopify.extension.toml.liquid b/functions-shipping-discounts-wasm/shopify.extension.toml.liquid index 3e96b331..1516f940 100644 --- a/functions-shipping-discounts-wasm/shopify.extension.toml.liquid +++ b/functions-shipping-discounts-wasm/shopify.extension.toml.liquid @@ -1,4 +1,4 @@ -api_version = "2026-01" +api_version = "2026-04" [[extensions]] name = "t:name" From bd88b8f061c39e2260fb5744aa0f8c9835c3175f Mon Sep 17 00:00:00 2001 From: Sagarika Dasgupta Date: Mon, 20 Apr 2026 09:54:56 -0500 Subject: [PATCH 2/3] Add required fields to stub shopify.app.toml because Shopify CLI now validates client_id, auth, webhooks, application_url, and embedded even when only used to discover extension directories. --- .github/scripts/run-wasm-tests.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/scripts/run-wasm-tests.sh b/.github/scripts/run-wasm-tests.sh index 0a5c5cd3..f476528f 100755 --- a/.github/scripts/run-wasm-tests.sh +++ b/.github/scripts/run-wasm-tests.sh @@ -22,8 +22,20 @@ esac # Create a minimal app toml so Shopify CLI can discover the extensions cat > shopify.app.toml << EOF -scopes = "" +client_id = "00000000000000000000000000000000" +name = "extensions-templates-ci" +application_url = "https://example.com" +embedded = true extension_directories = ["${EXT_DIR_PATTERN}"] + +[access_scopes] +scopes = "" + +[auth] +redirect_urls = ["https://example.com/auth/callback"] + +[webhooks] +api_version = "2026-04" EOF for dir in $EXT_DIR_PATTERN; do From 0e5b2d797f3ecd7ad0350a8bbc2836c2950437dc Mon Sep 17 00:00:00 2001 From: Sagarika Dasgupta Date: Tue, 21 Apr 2026 15:44:46 -0500 Subject: [PATCH 3/3] Regenerate schema.graphql for 2026-04 and fix ProductDiscountCandidate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regenerates every function template's committed schema.graphql against the 2026-04 API version. The new schema adds a nullable `prerequisites: [ProductDiscountCandidatePrerequisite!]` field on ProductDiscountCandidate — added `prerequisites: None` to the Rust struct literal in functions-discount-rs and `"prerequisites": null` to the corresponding fixture's expectedOutput. --- .../schema.graphql | 243 ++++++++++ .../schema.graphql | 243 ++++++++++ .../schema.graphql | 243 ++++++++++ functions-cart-transform-js/schema.graphql | 302 ++++++++++++ functions-cart-transform-rs/schema.graphql | 302 ++++++++++++ functions-cart-transform-wasm/schema.graphql | 302 ++++++++++++ .../schema.graphql | 243 ++++++++++ .../schema.graphql | 243 ++++++++++ .../schema.graphql | 243 ++++++++++ functions-discount-js/schema.graphql | 279 +++++++++++ functions-discount-rs/schema.graphql | 279 +++++++++++ .../src/cart_lines_discounts_generate_run.rs | 1 + .../fixtures/cart-lines-both-discounts.json | 1 + functions-discount-wasm/schema.graphql | 279 +++++++++++ .../schema.graphql | 258 ++++++++++- .../schema.graphql | 258 ++++++++++- .../schema.graphql | 258 ++++++++++- .../schema.graphql | 243 ++++++++++ .../schema.graphql | 243 ++++++++++ .../schema.graphql | 243 ++++++++++ .../schema.graphql | 432 +++++++++++++++++- .../schema.graphql | 432 +++++++++++++++++- .../schema.graphql | 432 +++++++++++++++++- functions-location-rules-js/schema.graphql | 243 ++++++++++ functions-location-rules-rs/schema.graphql | 243 ++++++++++ functions-location-rules-wasm/schema.graphql | 243 ++++++++++ functions-order-discounts-js/schema.graphql | 243 ++++++++++ functions-order-discounts-rs/schema.graphql | 243 ++++++++++ functions-order-discounts-wasm/schema.graphql | 243 ++++++++++ .../schema.graphql | 243 ++++++++++ .../schema.graphql | 243 ++++++++++ .../schema.graphql | 243 ++++++++++ .../schema.graphql | 258 ++++++++++- .../schema.graphql | 258 ++++++++++- .../schema.graphql | 258 ++++++++++- functions-product-discounts-js/schema.graphql | 243 ++++++++++ functions-product-discounts-rs/schema.graphql | 243 ++++++++++ .../schema.graphql | 243 ++++++++++ .../schema.graphql | 243 ++++++++++ .../schema.graphql | 243 ++++++++++ .../schema.graphql | 243 ++++++++++ 41 files changed, 10367 insertions(+), 54 deletions(-) diff --git a/functions-cart-checkout-validation-js/schema.graphql b/functions-cart-checkout-validation-js/schema.graphql index d52d6c9c..b142caa9 100644 --- a/functions-cart-checkout-validation-js/schema.graphql +++ b/functions-cart-checkout-validation-js/schema.graphql @@ -119,6 +119,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -153,6 +158,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -194,6 +204,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -251,6 +267,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -359,6 +380,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2916,6 +2942,127 @@ enum DeliveryMethod { SHIPPING } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A Function error for a path. """ @@ -4588,6 +4735,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4674,6 +4886,21 @@ input Operation @oneOf { validationAdd: ValidationAddOperation } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -5016,6 +5243,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-cart-checkout-validation-rs/schema.graphql b/functions-cart-checkout-validation-rs/schema.graphql index d52d6c9c..b142caa9 100644 --- a/functions-cart-checkout-validation-rs/schema.graphql +++ b/functions-cart-checkout-validation-rs/schema.graphql @@ -119,6 +119,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -153,6 +158,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -194,6 +204,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -251,6 +267,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -359,6 +380,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2916,6 +2942,127 @@ enum DeliveryMethod { SHIPPING } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A Function error for a path. """ @@ -4588,6 +4735,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4674,6 +4886,21 @@ input Operation @oneOf { validationAdd: ValidationAddOperation } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -5016,6 +5243,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-cart-checkout-validation-wasm/schema.graphql b/functions-cart-checkout-validation-wasm/schema.graphql index d52d6c9c..b142caa9 100644 --- a/functions-cart-checkout-validation-wasm/schema.graphql +++ b/functions-cart-checkout-validation-wasm/schema.graphql @@ -119,6 +119,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -153,6 +158,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -194,6 +204,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -251,6 +267,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -359,6 +380,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2916,6 +2942,127 @@ enum DeliveryMethod { SHIPPING } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A Function error for a path. """ @@ -4588,6 +4735,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4674,6 +4886,21 @@ input Operation @oneOf { validationAdd: ValidationAddOperation } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -5016,6 +5243,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-cart-transform-js/schema.graphql b/functions-cart-transform-js/schema.graphql index 009dbe13..4b96d9c3 100644 --- a/functions-cart-transform-js/schema.graphql +++ b/functions-cart-transform-js/schema.graphql @@ -103,6 +103,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -176,6 +181,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2732,6 +2742,127 @@ Example values: `"29.99"`, `"29.999"`. """ scalar Decimal +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ An operation that expands a single cart line item to form a [bundle](https://shopify.dev/docs/apps/build/product-merchandising/bundles) @@ -4088,6 +4219,81 @@ type LocationAddress { zip: String } +""" +Represents a mailing address. +""" +type MailingAddress { + """ + The first line of the address. Typically the street address or PO Box number. + """ + address1: String + + """ + The second line of the address. Typically the number of the apartment, suite, or unit. + """ + address2: String + + """ + The name of the city, district, village, or town. + """ + city: String + + """ + The name of the customer's company or organization. + """ + company: String + + """ + The two-letter code for the country of the address. For example, US. + """ + countryCode: CountryCode + + """ + The first name of the customer. + """ + firstName: String + + """ + The last name of the customer. + """ + lastName: String + + """ + The approximate latitude of the address. + """ + latitude: Float + + """ + The approximate longitude of the address. + """ + longitude: Float + + """ + The market of the address. + """ + market: Market @deprecated(reason: "This `market` field will be removed in a future version of the API.") + + """ + The full name of the customer, based on firstName and lastName. + """ + name: String + + """ + A unique phone number for the customer. Formatted using E.164 standard. For example, +16135551111. + """ + phone: String + + """ + The alphanumeric code for the region. For example, ON. + """ + provinceCode: String + + """ + The zip or postal code of the address. + """ + zip: String +} + """ A market is a group of one or more regions that you want to target for international sales. By creating a market, you can configure a distinct, localized shopping experience for @@ -4248,6 +4454,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4353,6 +4624,21 @@ input PriceAdjustmentValue { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4695,6 +4981,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-cart-transform-rs/schema.graphql b/functions-cart-transform-rs/schema.graphql index 009dbe13..4b96d9c3 100644 --- a/functions-cart-transform-rs/schema.graphql +++ b/functions-cart-transform-rs/schema.graphql @@ -103,6 +103,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -176,6 +181,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2732,6 +2742,127 @@ Example values: `"29.99"`, `"29.999"`. """ scalar Decimal +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ An operation that expands a single cart line item to form a [bundle](https://shopify.dev/docs/apps/build/product-merchandising/bundles) @@ -4088,6 +4219,81 @@ type LocationAddress { zip: String } +""" +Represents a mailing address. +""" +type MailingAddress { + """ + The first line of the address. Typically the street address or PO Box number. + """ + address1: String + + """ + The second line of the address. Typically the number of the apartment, suite, or unit. + """ + address2: String + + """ + The name of the city, district, village, or town. + """ + city: String + + """ + The name of the customer's company or organization. + """ + company: String + + """ + The two-letter code for the country of the address. For example, US. + """ + countryCode: CountryCode + + """ + The first name of the customer. + """ + firstName: String + + """ + The last name of the customer. + """ + lastName: String + + """ + The approximate latitude of the address. + """ + latitude: Float + + """ + The approximate longitude of the address. + """ + longitude: Float + + """ + The market of the address. + """ + market: Market @deprecated(reason: "This `market` field will be removed in a future version of the API.") + + """ + The full name of the customer, based on firstName and lastName. + """ + name: String + + """ + A unique phone number for the customer. Formatted using E.164 standard. For example, +16135551111. + """ + phone: String + + """ + The alphanumeric code for the region. For example, ON. + """ + provinceCode: String + + """ + The zip or postal code of the address. + """ + zip: String +} + """ A market is a group of one or more regions that you want to target for international sales. By creating a market, you can configure a distinct, localized shopping experience for @@ -4248,6 +4454,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4353,6 +4624,21 @@ input PriceAdjustmentValue { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4695,6 +4981,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-cart-transform-wasm/schema.graphql b/functions-cart-transform-wasm/schema.graphql index 009dbe13..4b96d9c3 100644 --- a/functions-cart-transform-wasm/schema.graphql +++ b/functions-cart-transform-wasm/schema.graphql @@ -103,6 +103,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -176,6 +181,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2732,6 +2742,127 @@ Example values: `"29.99"`, `"29.999"`. """ scalar Decimal +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ An operation that expands a single cart line item to form a [bundle](https://shopify.dev/docs/apps/build/product-merchandising/bundles) @@ -4088,6 +4219,81 @@ type LocationAddress { zip: String } +""" +Represents a mailing address. +""" +type MailingAddress { + """ + The first line of the address. Typically the street address or PO Box number. + """ + address1: String + + """ + The second line of the address. Typically the number of the apartment, suite, or unit. + """ + address2: String + + """ + The name of the city, district, village, or town. + """ + city: String + + """ + The name of the customer's company or organization. + """ + company: String + + """ + The two-letter code for the country of the address. For example, US. + """ + countryCode: CountryCode + + """ + The first name of the customer. + """ + firstName: String + + """ + The last name of the customer. + """ + lastName: String + + """ + The approximate latitude of the address. + """ + latitude: Float + + """ + The approximate longitude of the address. + """ + longitude: Float + + """ + The market of the address. + """ + market: Market @deprecated(reason: "This `market` field will be removed in a future version of the API.") + + """ + The full name of the customer, based on firstName and lastName. + """ + name: String + + """ + A unique phone number for the customer. Formatted using E.164 standard. For example, +16135551111. + """ + phone: String + + """ + The alphanumeric code for the region. For example, ON. + """ + provinceCode: String + + """ + The zip or postal code of the address. + """ + zip: String +} + """ A market is a group of one or more regions that you want to target for international sales. By creating a market, you can configure a distinct, localized shopping experience for @@ -4248,6 +4454,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4353,6 +4624,21 @@ input PriceAdjustmentValue { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4695,6 +4981,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-delivery-customization-js/schema.graphql b/functions-delivery-customization-js/schema.graphql index 87c69f67..9e5389a5 100644 --- a/functions-delivery-customization-js/schema.graphql +++ b/functions-delivery-customization-js/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -338,6 +359,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2981,6 +3007,127 @@ input DeprecatedOperation @oneOf { rename: RenameOperation @deprecated(reason: "Use `deliveryOptionRename` instead.") } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ The output of the Function run target. The object contains the operations to apply to delivery options in checkout. In @@ -4476,6 +4623,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4581,6 +4793,21 @@ input Operation @oneOf { deliveryOptionRename: DeliveryOptionRenameOperation } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4943,6 +5170,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-delivery-customization-rs/schema.graphql b/functions-delivery-customization-rs/schema.graphql index 87c69f67..9e5389a5 100644 --- a/functions-delivery-customization-rs/schema.graphql +++ b/functions-delivery-customization-rs/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -338,6 +359,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2981,6 +3007,127 @@ input DeprecatedOperation @oneOf { rename: RenameOperation @deprecated(reason: "Use `deliveryOptionRename` instead.") } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ The output of the Function run target. The object contains the operations to apply to delivery options in checkout. In @@ -4476,6 +4623,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4581,6 +4793,21 @@ input Operation @oneOf { deliveryOptionRename: DeliveryOptionRenameOperation } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4943,6 +5170,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-delivery-customization-wasm/schema.graphql b/functions-delivery-customization-wasm/schema.graphql index 87c69f67..9e5389a5 100644 --- a/functions-delivery-customization-wasm/schema.graphql +++ b/functions-delivery-customization-wasm/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -338,6 +359,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2981,6 +3007,127 @@ input DeprecatedOperation @oneOf { rename: RenameOperation @deprecated(reason: "Use `deliveryOptionRename` instead.") } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ The output of the Function run target. The object contains the operations to apply to delivery options in checkout. In @@ -4476,6 +4623,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4581,6 +4793,21 @@ input Operation @oneOf { deliveryOptionRename: DeliveryOptionRenameOperation } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4943,6 +5170,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-discount-js/schema.graphql b/functions-discount-js/schema.graphql index 24263f39..2d98ee48 100644 --- a/functions-discount-js/schema.graphql +++ b/functions-discount-js/schema.graphql @@ -101,6 +101,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -135,6 +140,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -176,6 +186,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -233,6 +249,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -362,6 +383,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -465,6 +491,25 @@ type CartLineParentRelationship { parent: CartLine! } +""" +A cart line that is required for the discount candidate to be applicable. A cart line is an entry in the +customer's cart that represents a single unit of a product variant. For example, if a customer adds two +different sizes of the same t-shirt to their cart, then each size is represented as a separate cart line. +""" +input CartLinePrerequisite { + """ + The ID of the prerequisite cart line. + """ + id: ID! + + """ + The number of line items that are required for the discount candidate to be applicable. + + The value is validated against: > 0. + """ + quantity: Int! +} + """ A method for applying a discount to a specific line item in the cart. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -3202,6 +3247,127 @@ type Discount implements HasMetafields { ): Metafield } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ The [discount class](https://help.shopify.com/manual/discounts/combining-discounts/discount-combinations) that's used to control how discounts can be combined. @@ -4920,6 +5086,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -5117,6 +5348,21 @@ input Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -5260,6 +5506,11 @@ input ProductDiscountCandidate { """ message: String + """ + The items required for the discount candidate to be applicable. + """ + prerequisites: [ProductDiscountCandidatePrerequisite!] + """ The targets of the discount to be applied to a cart line. """ @@ -5293,6 +5544,18 @@ input ProductDiscountCandidateFixedAmount { appliesToEachItem: Boolean = false } +""" +The items required for the discount candidate to be applicable. +""" +input ProductDiscountCandidatePrerequisite @oneOf { + """ + A cart line that is required for the discount candidate to be applicable. A cart line is an entry in the + customer's cart that represents a single unit of a product variant. For example, if a customer adds two + different sizes of the same t-shirt to their cart, then each size is represented as a separate cart line. + """ + cartLine: CartLinePrerequisite +} + """ Defines discount candidates, which are cart lines that may be eligible for potential discounts. Use discount candidates to identify items in a customer's @@ -5590,6 +5853,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-discount-rs/schema.graphql b/functions-discount-rs/schema.graphql index 24263f39..2d98ee48 100644 --- a/functions-discount-rs/schema.graphql +++ b/functions-discount-rs/schema.graphql @@ -101,6 +101,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -135,6 +140,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -176,6 +186,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -233,6 +249,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -362,6 +383,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -465,6 +491,25 @@ type CartLineParentRelationship { parent: CartLine! } +""" +A cart line that is required for the discount candidate to be applicable. A cart line is an entry in the +customer's cart that represents a single unit of a product variant. For example, if a customer adds two +different sizes of the same t-shirt to their cart, then each size is represented as a separate cart line. +""" +input CartLinePrerequisite { + """ + The ID of the prerequisite cart line. + """ + id: ID! + + """ + The number of line items that are required for the discount candidate to be applicable. + + The value is validated against: > 0. + """ + quantity: Int! +} + """ A method for applying a discount to a specific line item in the cart. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -3202,6 +3247,127 @@ type Discount implements HasMetafields { ): Metafield } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ The [discount class](https://help.shopify.com/manual/discounts/combining-discounts/discount-combinations) that's used to control how discounts can be combined. @@ -4920,6 +5086,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -5117,6 +5348,21 @@ input Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -5260,6 +5506,11 @@ input ProductDiscountCandidate { """ message: String + """ + The items required for the discount candidate to be applicable. + """ + prerequisites: [ProductDiscountCandidatePrerequisite!] + """ The targets of the discount to be applied to a cart line. """ @@ -5293,6 +5544,18 @@ input ProductDiscountCandidateFixedAmount { appliesToEachItem: Boolean = false } +""" +The items required for the discount candidate to be applicable. +""" +input ProductDiscountCandidatePrerequisite @oneOf { + """ + A cart line that is required for the discount candidate to be applicable. A cart line is an entry in the + customer's cart that represents a single unit of a product variant. For example, if a customer adds two + different sizes of the same t-shirt to their cart, then each size is represented as a separate cart line. + """ + cartLine: CartLinePrerequisite +} + """ Defines discount candidates, which are cart lines that may be eligible for potential discounts. Use discount candidates to identify items in a customer's @@ -5590,6 +5853,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-discount-rs/src/cart_lines_discounts_generate_run.rs b/functions-discount-rs/src/cart_lines_discounts_generate_run.rs index a311d9aa..5a9a1ed7 100644 --- a/functions-discount-rs/src/cart_lines_discounts_generate_run.rs +++ b/functions-discount-rs/src/cart_lines_discounts_generate_run.rs @@ -73,6 +73,7 @@ fn cart_lines_discounts_generate_run( value: Decimal(20.0), }), associated_discount_code: None, + prerequisites: None, }], }, )); diff --git a/functions-discount-rs/tests/fixtures/cart-lines-both-discounts.json b/functions-discount-rs/tests/fixtures/cart-lines-both-discounts.json index 45fcd4d5..4968d82a 100644 --- a/functions-discount-rs/tests/fixtures/cart-lines-both-discounts.json +++ b/functions-discount-rs/tests/fixtures/cart-lines-both-discounts.json @@ -52,6 +52,7 @@ { "associatedDiscountCode": null, "message": "20% OFF PRODUCT", + "prerequisites": null, "targets": [ { "cartLine": { diff --git a/functions-discount-wasm/schema.graphql b/functions-discount-wasm/schema.graphql index 24263f39..2d98ee48 100644 --- a/functions-discount-wasm/schema.graphql +++ b/functions-discount-wasm/schema.graphql @@ -101,6 +101,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -135,6 +140,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -176,6 +186,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -233,6 +249,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -362,6 +383,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -465,6 +491,25 @@ type CartLineParentRelationship { parent: CartLine! } +""" +A cart line that is required for the discount candidate to be applicable. A cart line is an entry in the +customer's cart that represents a single unit of a product variant. For example, if a customer adds two +different sizes of the same t-shirt to their cart, then each size is represented as a separate cart line. +""" +input CartLinePrerequisite { + """ + The ID of the prerequisite cart line. + """ + id: ID! + + """ + The number of line items that are required for the discount candidate to be applicable. + + The value is validated against: > 0. + """ + quantity: Int! +} + """ A method for applying a discount to a specific line item in the cart. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -3202,6 +3247,127 @@ type Discount implements HasMetafields { ): Metafield } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ The [discount class](https://help.shopify.com/manual/discounts/combining-discounts/discount-combinations) that's used to control how discounts can be combined. @@ -4920,6 +5086,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -5117,6 +5348,21 @@ input Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -5260,6 +5506,11 @@ input ProductDiscountCandidate { """ message: String + """ + The items required for the discount candidate to be applicable. + """ + prerequisites: [ProductDiscountCandidatePrerequisite!] + """ The targets of the discount to be applied to a cart line. """ @@ -5293,6 +5544,18 @@ input ProductDiscountCandidateFixedAmount { appliesToEachItem: Boolean = false } +""" +The items required for the discount candidate to be applicable. +""" +input ProductDiscountCandidatePrerequisite @oneOf { + """ + A cart line that is required for the discount candidate to be applicable. A cart line is an entry in the + customer's cart that represents a single unit of a product variant. For example, if a customer adds two + different sizes of the same t-shirt to their cart, then each size is represented as a separate cart line. + """ + cartLine: CartLinePrerequisite +} + """ Defines discount candidates, which are cart lines that may be eligible for potential discounts. Use discount candidates to identify items in a customer's @@ -5590,6 +5853,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-discounts-allocator-js/schema.graphql b/functions-discounts-allocator-js/schema.graphql index 98de6b6f..cf1c7269 100644 --- a/functions-discounts-allocator-js/schema.graphql +++ b/functions-discounts-allocator-js/schema.graphql @@ -81,6 +81,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -115,6 +120,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -156,6 +166,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -168,7 +184,7 @@ the subtotal before taxes and duties, the tax amount, and duty charges. """ type CartCost { """ - The amount for the customer to pay at checkout, excluding taxes and discounts. + The amount, before taxes and cart-level discounts, for the customer to pay. """ subtotalAmount: MoneyV2! @@ -213,6 +229,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -304,7 +325,7 @@ type CartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -321,6 +342,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -332,7 +358,8 @@ type CartLine { merchandise: Merchandise! """ - The relationship between this line and its parent line, if any. + The [nested relationship](https://shopify.dev/docs/apps/build/product-merchandising/nested-cart-lines) + between this line and its parent line, if any. """ parentRelationship: CartLineParentRelationship @@ -361,7 +388,7 @@ type CartLineCost { amountPerQuantity: MoneyV2! """ - The cost of a single unit before any discounts are applied. This field is used to calculate and display + The `compareAt` price of a single unit before any discounts are applied. This field is used to calculate and display savings for customers. For example, if a product's `compareAtAmountPerQuantity` is $25 and its current price is $20, then the customer sees a $5 discount. This value can change based on the buyer's identity and is `null` when the value is hidden from buyers. @@ -2806,7 +2833,7 @@ type DeliverableCartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -2922,6 +2949,89 @@ type Discount implements HasMetafields { title: String! } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + """ The approach that determines how multiple discounts are evaluated and applied to a cart. You can apply all discounts with conditions that are met, @@ -2954,6 +3064,44 @@ enum DiscountApplicationStrategy { MAXIMUM } +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ List of the classes of discounts. """ @@ -4545,7 +4693,74 @@ type Metafield { } """ -A precise monetary value and its associated currency. For example, 12.99 USD. +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + +""" +A precise monetary value and its associated currency. Combines a decimal amount +with a three-letter currency code to express prices, costs, and other financial +values throughout the API. For example, 12.99 USD. """ type MoneyV2 { """ @@ -4599,6 +4814,21 @@ type Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4941,6 +5171,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-discounts-allocator-rs/schema.graphql b/functions-discounts-allocator-rs/schema.graphql index 98de6b6f..cf1c7269 100644 --- a/functions-discounts-allocator-rs/schema.graphql +++ b/functions-discounts-allocator-rs/schema.graphql @@ -81,6 +81,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -115,6 +120,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -156,6 +166,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -168,7 +184,7 @@ the subtotal before taxes and duties, the tax amount, and duty charges. """ type CartCost { """ - The amount for the customer to pay at checkout, excluding taxes and discounts. + The amount, before taxes and cart-level discounts, for the customer to pay. """ subtotalAmount: MoneyV2! @@ -213,6 +229,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -304,7 +325,7 @@ type CartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -321,6 +342,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -332,7 +358,8 @@ type CartLine { merchandise: Merchandise! """ - The relationship between this line and its parent line, if any. + The [nested relationship](https://shopify.dev/docs/apps/build/product-merchandising/nested-cart-lines) + between this line and its parent line, if any. """ parentRelationship: CartLineParentRelationship @@ -361,7 +388,7 @@ type CartLineCost { amountPerQuantity: MoneyV2! """ - The cost of a single unit before any discounts are applied. This field is used to calculate and display + The `compareAt` price of a single unit before any discounts are applied. This field is used to calculate and display savings for customers. For example, if a product's `compareAtAmountPerQuantity` is $25 and its current price is $20, then the customer sees a $5 discount. This value can change based on the buyer's identity and is `null` when the value is hidden from buyers. @@ -2806,7 +2833,7 @@ type DeliverableCartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -2922,6 +2949,89 @@ type Discount implements HasMetafields { title: String! } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + """ The approach that determines how multiple discounts are evaluated and applied to a cart. You can apply all discounts with conditions that are met, @@ -2954,6 +3064,44 @@ enum DiscountApplicationStrategy { MAXIMUM } +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ List of the classes of discounts. """ @@ -4545,7 +4693,74 @@ type Metafield { } """ -A precise monetary value and its associated currency. For example, 12.99 USD. +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + +""" +A precise monetary value and its associated currency. Combines a decimal amount +with a three-letter currency code to express prices, costs, and other financial +values throughout the API. For example, 12.99 USD. """ type MoneyV2 { """ @@ -4599,6 +4814,21 @@ type Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4941,6 +5171,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-discounts-allocator-wasm/schema.graphql b/functions-discounts-allocator-wasm/schema.graphql index 98de6b6f..cf1c7269 100644 --- a/functions-discounts-allocator-wasm/schema.graphql +++ b/functions-discounts-allocator-wasm/schema.graphql @@ -81,6 +81,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -115,6 +120,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -156,6 +166,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -168,7 +184,7 @@ the subtotal before taxes and duties, the tax amount, and duty charges. """ type CartCost { """ - The amount for the customer to pay at checkout, excluding taxes and discounts. + The amount, before taxes and cart-level discounts, for the customer to pay. """ subtotalAmount: MoneyV2! @@ -213,6 +229,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -304,7 +325,7 @@ type CartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -321,6 +342,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -332,7 +358,8 @@ type CartLine { merchandise: Merchandise! """ - The relationship between this line and its parent line, if any. + The [nested relationship](https://shopify.dev/docs/apps/build/product-merchandising/nested-cart-lines) + between this line and its parent line, if any. """ parentRelationship: CartLineParentRelationship @@ -361,7 +388,7 @@ type CartLineCost { amountPerQuantity: MoneyV2! """ - The cost of a single unit before any discounts are applied. This field is used to calculate and display + The `compareAt` price of a single unit before any discounts are applied. This field is used to calculate and display savings for customers. For example, if a product's `compareAtAmountPerQuantity` is $25 and its current price is $20, then the customer sees a $5 discount. This value can change based on the buyer's identity and is `null` when the value is hidden from buyers. @@ -2806,7 +2833,7 @@ type DeliverableCartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -2922,6 +2949,89 @@ type Discount implements HasMetafields { title: String! } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + """ The approach that determines how multiple discounts are evaluated and applied to a cart. You can apply all discounts with conditions that are met, @@ -2954,6 +3064,44 @@ enum DiscountApplicationStrategy { MAXIMUM } +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ List of the classes of discounts. """ @@ -4545,7 +4693,74 @@ type Metafield { } """ -A precise monetary value and its associated currency. For example, 12.99 USD. +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + +""" +A precise monetary value and its associated currency. Combines a decimal amount +with a three-letter currency code to express prices, costs, and other financial +values throughout the API. For example, 12.99 USD. """ type MoneyV2 { """ @@ -4599,6 +4814,21 @@ type Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4941,6 +5171,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-fulfillment-constraints-js/schema.graphql b/functions-fulfillment-constraints-js/schema.graphql index 6ffe0420..f49dee43 100644 --- a/functions-fulfillment-constraints-js/schema.graphql +++ b/functions-fulfillment-constraints-js/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -340,6 +361,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2923,6 +2949,127 @@ input DeprecatedOperation @oneOf { mustFulfillFromSameLocation: MustFulfillFromSameLocation @deprecated(reason: "Use `deliverableLinesMustFulfillFromSameLocationAdd` instead.") } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A customization which applies constraint rules to order routing and fulfillments. """ @@ -4459,6 +4606,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4562,6 +4774,21 @@ input Operation @oneOf { deliverableLinesMustFulfillFromSameLocationAdd: DeliverableLinesMustFulfillFromSameLocationAddOperation } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4904,6 +5131,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-fulfillment-constraints-rs/schema.graphql b/functions-fulfillment-constraints-rs/schema.graphql index 6ffe0420..f49dee43 100644 --- a/functions-fulfillment-constraints-rs/schema.graphql +++ b/functions-fulfillment-constraints-rs/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -340,6 +361,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2923,6 +2949,127 @@ input DeprecatedOperation @oneOf { mustFulfillFromSameLocation: MustFulfillFromSameLocation @deprecated(reason: "Use `deliverableLinesMustFulfillFromSameLocationAdd` instead.") } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A customization which applies constraint rules to order routing and fulfillments. """ @@ -4459,6 +4606,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4562,6 +4774,21 @@ input Operation @oneOf { deliverableLinesMustFulfillFromSameLocationAdd: DeliverableLinesMustFulfillFromSameLocationAddOperation } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4904,6 +5131,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-fulfillment-constraints-wasm/schema.graphql b/functions-fulfillment-constraints-wasm/schema.graphql index 6ffe0420..f49dee43 100644 --- a/functions-fulfillment-constraints-wasm/schema.graphql +++ b/functions-fulfillment-constraints-wasm/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -340,6 +361,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2923,6 +2949,127 @@ input DeprecatedOperation @oneOf { mustFulfillFromSameLocation: MustFulfillFromSameLocation @deprecated(reason: "Use `deliverableLinesMustFulfillFromSameLocationAdd` instead.") } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A customization which applies constraint rules to order routing and fulfillments. """ @@ -4459,6 +4606,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4562,6 +4774,21 @@ input Operation @oneOf { deliverableLinesMustFulfillFromSameLocationAdd: DeliverableLinesMustFulfillFromSameLocationAddOperation } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4904,6 +5131,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-local-pickup-delivery-option-generators-js/schema.graphql b/functions-local-pickup-delivery-option-generators-js/schema.graphql index c16a6f08..a11e1e57 100644 --- a/functions-local-pickup-delivery-option-generators-js/schema.graphql +++ b/functions-local-pickup-delivery-option-generators-js/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -173,7 +189,7 @@ the subtotal before taxes and duties, the tax amount, and duty charges. """ type CartCost { """ - The amount for the customer to pay at checkout, excluding taxes and discounts. + The amount, before taxes and cart-level discounts, for the customer to pay. """ subtotalAmount: MoneyV2! @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -309,7 +330,7 @@ type CartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -337,7 +363,8 @@ type CartLine { merchandise: Merchandise! """ - The relationship between this line and its parent line, if any. + The [nested relationship](https://shopify.dev/docs/apps/build/product-merchandising/nested-cart-lines) + between this line and its parent line, if any. """ parentRelationship: CartLineParentRelationship @@ -366,7 +393,7 @@ type CartLineCost { amountPerQuantity: MoneyV2! """ - The cost of a single unit before any discounts are applied. This field is used to calculate and display + The `compareAt` price of a single unit before any discounts are applied. This field is used to calculate and display savings for customers. For example, if a product's `compareAtAmountPerQuantity` is $25 and its current price is $20, then the customer sees a $5 discount. This value can change based on the buyer's identity and is `null` when the value is hidden from buyers. @@ -2799,7 +2826,7 @@ type DeliverableCartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -2888,6 +2915,127 @@ type DeliveryOptionGenerator implements HasMetafields { ): Metafield } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A group of one or more items to be fulfilled together. Every cart line belongs to exactly one fulfillment group. @@ -2923,6 +3071,16 @@ type FulfillmentGroup { lines: [CartLine!]! @scaleLimits(rate: 0.005) } +""" +The fetch target result. Refer to network access for Shopify Functions. +""" +input FunctionFetchResult { + """ + HTTP Request. + """ + request: HttpRequest +} + """ The output of the Function run target. The object contains the operations to generate local pickup options in checkout. @@ -3003,6 +3161,146 @@ type HasTagResponse { tag: String! } +""" +The attributes associated with an HTTP request. +""" +input HttpRequest { + """ + The HTTP request body as a plain string. + Use this field when the body isn't in JSON format. + """ + body: String + + """ + The HTTP headers. + """ + headers: [HttpRequestHeader!]! + + """ + The HTTP request body as a JSON object. + Use this field when the body's in JSON format, to reduce function instruction consumption + and to ensure the body's formatted in logs. + Don't use this field together with the `body` field. If both are provided, then the `body` field + will take precedence. + If this field is specified and no `Content-Type` header is included, then the header will + automatically be set to `application/json`. + """ + jsonBody: JSON + + """ + The HTTP method. + """ + method: HttpRequestMethod! + + """ + Policy attached to the HTTP request. + """ + policy: HttpRequestPolicy! + + """ + The HTTP url (eg.: https://example.com). The scheme needs to be HTTPS. + """ + url: URL! +} + +""" +The attributes associated with an HTTP request header. +""" +input HttpRequestHeader { + """ + Header name. + """ + name: String! + + """ + Header value. + """ + value: String! +} + +""" +The HTTP request available methods. +""" +enum HttpRequestMethod { + """ + Http GET. + """ + GET + + """ + Http POST. + """ + POST +} + +""" +The attributes associated with an HTTP request policy. +""" +input HttpRequestPolicy { + """ + Read timeout in milliseconds. + """ + readTimeoutMs: Int! +} + +""" +The attributes associated with an HTTP response. +""" +type HttpResponse { + """ + The HTTP response body as a plain string. + Use this field when the body is not in JSON format. + """ + body: String + + """ + An HTTP header. + """ + header( + """ + A case-insensitive header name. + """ + name: String! + ): HttpResponseHeader + + """ + The HTTP headers. + """ + headers: [HttpResponseHeader!]! @deprecated(reason: "Use `header` instead.") + + """ + The HTTP response body parsed as JSON. + If the body is valid JSON, it will be parsed and returned as a JSON object. + If parsing fails, then raw body is returned as a string. + Use this field when you expect the response to be JSON, or when you're dealing + with mixed response types, meaning both JSON and non-JSON. + Using this field reduces function instruction consumption and ensures that the data is formatted in logs. + To prevent increasing the function target input size unnecessarily, avoid querying + both `body` and `jsonBody` simultaneously. + """ + jsonBody: JSON + + """ + The HTTP status code. + """ + status: Int! +} + +""" +The attributes associated with an HTTP response header. +""" +type HttpResponseHeader { + """ + Header name. + """ + name: String! + + """ + Header value. + """ + value: String! +} + """ Represents a unique identifier, often used to refetch an object. The ID type appears in a JSON response as a String, but it is not intended to be human-readable. @@ -3026,6 +3324,11 @@ type Input { """ deliveryOptionGenerator: DeliveryOptionGenerator! + """ + The result of the fetch target. Refer to network access for Shopify Functions. + """ + fetchResult: HttpResponse @restrictTarget(only: ["purchase.local-pickup-delivery-option-generator.run"]) + """ A list of [fulfillment locations](https://shopify.dev/manual/fulfillment/setup/shipping-profiles/managing-fulfillment-locations) @@ -4499,7 +4802,74 @@ input MetafieldOutput { } """ -A precise monetary value and its associated currency. For example, 12.99 USD. +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + +""" +A precise monetary value and its associated currency. Combines a decimal amount +with a three-letter currency code to express prices, costs, and other financial +values throughout the API. For example, 12.99 USD. """ type MoneyV2 { """ @@ -4520,6 +4890,16 @@ type MoneyV2 { The root mutation for the API. """ type MutationRoot { + """ + Handles the Function result for the purchase.local-pickup-delivery-option-generator.fetch target. + """ + fetch( + """ + The result of the Function. + """ + result: FunctionFetchResult! + ): Void! + """ Handles the Function result. """ @@ -4564,6 +4944,21 @@ input PickupLocation { pickupInstruction: String } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4906,6 +5301,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ @@ -4915,6 +5326,15 @@ For example, "05:43:21". """ scalar TimeWithoutTimezone +""" +Represents an [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986) and +[RFC 3987](https://datatracker.ietf.org/doc/html/rfc3987)-compliant URI string. + +For example, `"https://example.myshopify.com"` is a valid URL. It includes a scheme (`https`) and a host +(`example.myshopify.com`). +""" +scalar URL + """ A void type that can be used to return a null value from a mutation. """ diff --git a/functions-local-pickup-delivery-option-generators-rs/schema.graphql b/functions-local-pickup-delivery-option-generators-rs/schema.graphql index c16a6f08..a11e1e57 100644 --- a/functions-local-pickup-delivery-option-generators-rs/schema.graphql +++ b/functions-local-pickup-delivery-option-generators-rs/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -173,7 +189,7 @@ the subtotal before taxes and duties, the tax amount, and duty charges. """ type CartCost { """ - The amount for the customer to pay at checkout, excluding taxes and discounts. + The amount, before taxes and cart-level discounts, for the customer to pay. """ subtotalAmount: MoneyV2! @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -309,7 +330,7 @@ type CartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -337,7 +363,8 @@ type CartLine { merchandise: Merchandise! """ - The relationship between this line and its parent line, if any. + The [nested relationship](https://shopify.dev/docs/apps/build/product-merchandising/nested-cart-lines) + between this line and its parent line, if any. """ parentRelationship: CartLineParentRelationship @@ -366,7 +393,7 @@ type CartLineCost { amountPerQuantity: MoneyV2! """ - The cost of a single unit before any discounts are applied. This field is used to calculate and display + The `compareAt` price of a single unit before any discounts are applied. This field is used to calculate and display savings for customers. For example, if a product's `compareAtAmountPerQuantity` is $25 and its current price is $20, then the customer sees a $5 discount. This value can change based on the buyer's identity and is `null` when the value is hidden from buyers. @@ -2799,7 +2826,7 @@ type DeliverableCartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -2888,6 +2915,127 @@ type DeliveryOptionGenerator implements HasMetafields { ): Metafield } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A group of one or more items to be fulfilled together. Every cart line belongs to exactly one fulfillment group. @@ -2923,6 +3071,16 @@ type FulfillmentGroup { lines: [CartLine!]! @scaleLimits(rate: 0.005) } +""" +The fetch target result. Refer to network access for Shopify Functions. +""" +input FunctionFetchResult { + """ + HTTP Request. + """ + request: HttpRequest +} + """ The output of the Function run target. The object contains the operations to generate local pickup options in checkout. @@ -3003,6 +3161,146 @@ type HasTagResponse { tag: String! } +""" +The attributes associated with an HTTP request. +""" +input HttpRequest { + """ + The HTTP request body as a plain string. + Use this field when the body isn't in JSON format. + """ + body: String + + """ + The HTTP headers. + """ + headers: [HttpRequestHeader!]! + + """ + The HTTP request body as a JSON object. + Use this field when the body's in JSON format, to reduce function instruction consumption + and to ensure the body's formatted in logs. + Don't use this field together with the `body` field. If both are provided, then the `body` field + will take precedence. + If this field is specified and no `Content-Type` header is included, then the header will + automatically be set to `application/json`. + """ + jsonBody: JSON + + """ + The HTTP method. + """ + method: HttpRequestMethod! + + """ + Policy attached to the HTTP request. + """ + policy: HttpRequestPolicy! + + """ + The HTTP url (eg.: https://example.com). The scheme needs to be HTTPS. + """ + url: URL! +} + +""" +The attributes associated with an HTTP request header. +""" +input HttpRequestHeader { + """ + Header name. + """ + name: String! + + """ + Header value. + """ + value: String! +} + +""" +The HTTP request available methods. +""" +enum HttpRequestMethod { + """ + Http GET. + """ + GET + + """ + Http POST. + """ + POST +} + +""" +The attributes associated with an HTTP request policy. +""" +input HttpRequestPolicy { + """ + Read timeout in milliseconds. + """ + readTimeoutMs: Int! +} + +""" +The attributes associated with an HTTP response. +""" +type HttpResponse { + """ + The HTTP response body as a plain string. + Use this field when the body is not in JSON format. + """ + body: String + + """ + An HTTP header. + """ + header( + """ + A case-insensitive header name. + """ + name: String! + ): HttpResponseHeader + + """ + The HTTP headers. + """ + headers: [HttpResponseHeader!]! @deprecated(reason: "Use `header` instead.") + + """ + The HTTP response body parsed as JSON. + If the body is valid JSON, it will be parsed and returned as a JSON object. + If parsing fails, then raw body is returned as a string. + Use this field when you expect the response to be JSON, or when you're dealing + with mixed response types, meaning both JSON and non-JSON. + Using this field reduces function instruction consumption and ensures that the data is formatted in logs. + To prevent increasing the function target input size unnecessarily, avoid querying + both `body` and `jsonBody` simultaneously. + """ + jsonBody: JSON + + """ + The HTTP status code. + """ + status: Int! +} + +""" +The attributes associated with an HTTP response header. +""" +type HttpResponseHeader { + """ + Header name. + """ + name: String! + + """ + Header value. + """ + value: String! +} + """ Represents a unique identifier, often used to refetch an object. The ID type appears in a JSON response as a String, but it is not intended to be human-readable. @@ -3026,6 +3324,11 @@ type Input { """ deliveryOptionGenerator: DeliveryOptionGenerator! + """ + The result of the fetch target. Refer to network access for Shopify Functions. + """ + fetchResult: HttpResponse @restrictTarget(only: ["purchase.local-pickup-delivery-option-generator.run"]) + """ A list of [fulfillment locations](https://shopify.dev/manual/fulfillment/setup/shipping-profiles/managing-fulfillment-locations) @@ -4499,7 +4802,74 @@ input MetafieldOutput { } """ -A precise monetary value and its associated currency. For example, 12.99 USD. +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + +""" +A precise monetary value and its associated currency. Combines a decimal amount +with a three-letter currency code to express prices, costs, and other financial +values throughout the API. For example, 12.99 USD. """ type MoneyV2 { """ @@ -4520,6 +4890,16 @@ type MoneyV2 { The root mutation for the API. """ type MutationRoot { + """ + Handles the Function result for the purchase.local-pickup-delivery-option-generator.fetch target. + """ + fetch( + """ + The result of the Function. + """ + result: FunctionFetchResult! + ): Void! + """ Handles the Function result. """ @@ -4564,6 +4944,21 @@ input PickupLocation { pickupInstruction: String } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4906,6 +5301,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ @@ -4915,6 +5326,15 @@ For example, "05:43:21". """ scalar TimeWithoutTimezone +""" +Represents an [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986) and +[RFC 3987](https://datatracker.ietf.org/doc/html/rfc3987)-compliant URI string. + +For example, `"https://example.myshopify.com"` is a valid URL. It includes a scheme (`https`) and a host +(`example.myshopify.com`). +""" +scalar URL + """ A void type that can be used to return a null value from a mutation. """ diff --git a/functions-local-pickup-delivery-option-generators-wasm/schema.graphql b/functions-local-pickup-delivery-option-generators-wasm/schema.graphql index c16a6f08..a11e1e57 100644 --- a/functions-local-pickup-delivery-option-generators-wasm/schema.graphql +++ b/functions-local-pickup-delivery-option-generators-wasm/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -173,7 +189,7 @@ the subtotal before taxes and duties, the tax amount, and duty charges. """ type CartCost { """ - The amount for the customer to pay at checkout, excluding taxes and discounts. + The amount, before taxes and cart-level discounts, for the customer to pay. """ subtotalAmount: MoneyV2! @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -309,7 +330,7 @@ type CartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -337,7 +363,8 @@ type CartLine { merchandise: Merchandise! """ - The relationship between this line and its parent line, if any. + The [nested relationship](https://shopify.dev/docs/apps/build/product-merchandising/nested-cart-lines) + between this line and its parent line, if any. """ parentRelationship: CartLineParentRelationship @@ -366,7 +393,7 @@ type CartLineCost { amountPerQuantity: MoneyV2! """ - The cost of a single unit before any discounts are applied. This field is used to calculate and display + The `compareAt` price of a single unit before any discounts are applied. This field is used to calculate and display savings for customers. For example, if a product's `compareAtAmountPerQuantity` is $25 and its current price is $20, then the customer sees a $5 discount. This value can change based on the buyer's identity and is `null` when the value is hidden from buyers. @@ -2799,7 +2826,7 @@ type DeliverableCartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -2888,6 +2915,127 @@ type DeliveryOptionGenerator implements HasMetafields { ): Metafield } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A group of one or more items to be fulfilled together. Every cart line belongs to exactly one fulfillment group. @@ -2923,6 +3071,16 @@ type FulfillmentGroup { lines: [CartLine!]! @scaleLimits(rate: 0.005) } +""" +The fetch target result. Refer to network access for Shopify Functions. +""" +input FunctionFetchResult { + """ + HTTP Request. + """ + request: HttpRequest +} + """ The output of the Function run target. The object contains the operations to generate local pickup options in checkout. @@ -3003,6 +3161,146 @@ type HasTagResponse { tag: String! } +""" +The attributes associated with an HTTP request. +""" +input HttpRequest { + """ + The HTTP request body as a plain string. + Use this field when the body isn't in JSON format. + """ + body: String + + """ + The HTTP headers. + """ + headers: [HttpRequestHeader!]! + + """ + The HTTP request body as a JSON object. + Use this field when the body's in JSON format, to reduce function instruction consumption + and to ensure the body's formatted in logs. + Don't use this field together with the `body` field. If both are provided, then the `body` field + will take precedence. + If this field is specified and no `Content-Type` header is included, then the header will + automatically be set to `application/json`. + """ + jsonBody: JSON + + """ + The HTTP method. + """ + method: HttpRequestMethod! + + """ + Policy attached to the HTTP request. + """ + policy: HttpRequestPolicy! + + """ + The HTTP url (eg.: https://example.com). The scheme needs to be HTTPS. + """ + url: URL! +} + +""" +The attributes associated with an HTTP request header. +""" +input HttpRequestHeader { + """ + Header name. + """ + name: String! + + """ + Header value. + """ + value: String! +} + +""" +The HTTP request available methods. +""" +enum HttpRequestMethod { + """ + Http GET. + """ + GET + + """ + Http POST. + """ + POST +} + +""" +The attributes associated with an HTTP request policy. +""" +input HttpRequestPolicy { + """ + Read timeout in milliseconds. + """ + readTimeoutMs: Int! +} + +""" +The attributes associated with an HTTP response. +""" +type HttpResponse { + """ + The HTTP response body as a plain string. + Use this field when the body is not in JSON format. + """ + body: String + + """ + An HTTP header. + """ + header( + """ + A case-insensitive header name. + """ + name: String! + ): HttpResponseHeader + + """ + The HTTP headers. + """ + headers: [HttpResponseHeader!]! @deprecated(reason: "Use `header` instead.") + + """ + The HTTP response body parsed as JSON. + If the body is valid JSON, it will be parsed and returned as a JSON object. + If parsing fails, then raw body is returned as a string. + Use this field when you expect the response to be JSON, or when you're dealing + with mixed response types, meaning both JSON and non-JSON. + Using this field reduces function instruction consumption and ensures that the data is formatted in logs. + To prevent increasing the function target input size unnecessarily, avoid querying + both `body` and `jsonBody` simultaneously. + """ + jsonBody: JSON + + """ + The HTTP status code. + """ + status: Int! +} + +""" +The attributes associated with an HTTP response header. +""" +type HttpResponseHeader { + """ + Header name. + """ + name: String! + + """ + Header value. + """ + value: String! +} + """ Represents a unique identifier, often used to refetch an object. The ID type appears in a JSON response as a String, but it is not intended to be human-readable. @@ -3026,6 +3324,11 @@ type Input { """ deliveryOptionGenerator: DeliveryOptionGenerator! + """ + The result of the fetch target. Refer to network access for Shopify Functions. + """ + fetchResult: HttpResponse @restrictTarget(only: ["purchase.local-pickup-delivery-option-generator.run"]) + """ A list of [fulfillment locations](https://shopify.dev/manual/fulfillment/setup/shipping-profiles/managing-fulfillment-locations) @@ -4499,7 +4802,74 @@ input MetafieldOutput { } """ -A precise monetary value and its associated currency. For example, 12.99 USD. +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + +""" +A precise monetary value and its associated currency. Combines a decimal amount +with a three-letter currency code to express prices, costs, and other financial +values throughout the API. For example, 12.99 USD. """ type MoneyV2 { """ @@ -4520,6 +4890,16 @@ type MoneyV2 { The root mutation for the API. """ type MutationRoot { + """ + Handles the Function result for the purchase.local-pickup-delivery-option-generator.fetch target. + """ + fetch( + """ + The result of the Function. + """ + result: FunctionFetchResult! + ): Void! + """ Handles the Function result. """ @@ -4564,6 +4944,21 @@ input PickupLocation { pickupInstruction: String } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4906,6 +5301,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ @@ -4915,6 +5326,15 @@ For example, "05:43:21". """ scalar TimeWithoutTimezone +""" +Represents an [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986) and +[RFC 3987](https://datatracker.ietf.org/doc/html/rfc3987)-compliant URI string. + +For example, `"https://example.myshopify.com"` is a valid URL. It includes a scheme (`https`) and a host +(`example.myshopify.com`). +""" +scalar URL + """ A void type that can be used to return a null value from a mutation. """ diff --git a/functions-location-rules-js/schema.graphql b/functions-location-rules-js/schema.graphql index 681c6306..b1d8d7ae 100644 --- a/functions-location-rules-js/schema.graphql +++ b/functions-location-rules-js/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -339,6 +360,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2885,6 +2911,127 @@ input DeprecatedOperation @oneOf { rank: FulfillmentGroupRankedLocations @deprecated(reason: "Use `FulfillmentGroupLocationRankingAddOperation` instead.") } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A group of one or more items to be fulfilled together. """ @@ -4454,6 +4601,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4548,6 +4760,21 @@ type OrderRoutingLocationRule implements HasMetafields { ): Metafield } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4905,6 +5132,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-location-rules-rs/schema.graphql b/functions-location-rules-rs/schema.graphql index 681c6306..b1d8d7ae 100644 --- a/functions-location-rules-rs/schema.graphql +++ b/functions-location-rules-rs/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -339,6 +360,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2885,6 +2911,127 @@ input DeprecatedOperation @oneOf { rank: FulfillmentGroupRankedLocations @deprecated(reason: "Use `FulfillmentGroupLocationRankingAddOperation` instead.") } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A group of one or more items to be fulfilled together. """ @@ -4454,6 +4601,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4548,6 +4760,21 @@ type OrderRoutingLocationRule implements HasMetafields { ): Metafield } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4905,6 +5132,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-location-rules-wasm/schema.graphql b/functions-location-rules-wasm/schema.graphql index 681c6306..b1d8d7ae 100644 --- a/functions-location-rules-wasm/schema.graphql +++ b/functions-location-rules-wasm/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -339,6 +360,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2885,6 +2911,127 @@ input DeprecatedOperation @oneOf { rank: FulfillmentGroupRankedLocations @deprecated(reason: "Use `FulfillmentGroupLocationRankingAddOperation` instead.") } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A group of one or more items to be fulfilled together. """ @@ -4454,6 +4601,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4548,6 +4760,21 @@ type OrderRoutingLocationRule implements HasMetafields { ): Metafield } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4905,6 +5132,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-order-discounts-js/schema.graphql b/functions-order-discounts-js/schema.graphql index 93fbdbdd..4a92363f 100644 --- a/functions-order-discounts-js/schema.graphql +++ b/functions-order-discounts-js/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2928,6 +2954,89 @@ input Discount { value: Value! } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + """ The approach that determines how multiple discounts are evaluated and applied to a cart. You can apply a discount to the first line item in a cart that meets conditions, @@ -2950,6 +3059,44 @@ enum DiscountApplicationStrategy { MAXIMUM } +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A discount wrapper node. """ @@ -4490,6 +4637,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4582,6 +4794,21 @@ input Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4990,6 +5217,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-order-discounts-rs/schema.graphql b/functions-order-discounts-rs/schema.graphql index 93fbdbdd..4a92363f 100644 --- a/functions-order-discounts-rs/schema.graphql +++ b/functions-order-discounts-rs/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2928,6 +2954,89 @@ input Discount { value: Value! } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + """ The approach that determines how multiple discounts are evaluated and applied to a cart. You can apply a discount to the first line item in a cart that meets conditions, @@ -2950,6 +3059,44 @@ enum DiscountApplicationStrategy { MAXIMUM } +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A discount wrapper node. """ @@ -4490,6 +4637,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4582,6 +4794,21 @@ input Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4990,6 +5217,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-order-discounts-wasm/schema.graphql b/functions-order-discounts-wasm/schema.graphql index 93fbdbdd..4a92363f 100644 --- a/functions-order-discounts-wasm/schema.graphql +++ b/functions-order-discounts-wasm/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2928,6 +2954,89 @@ input Discount { value: Value! } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + """ The approach that determines how multiple discounts are evaluated and applied to a cart. You can apply a discount to the first line item in a cart that meets conditions, @@ -2950,6 +3059,44 @@ enum DiscountApplicationStrategy { MAXIMUM } +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A discount wrapper node. """ @@ -4490,6 +4637,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4582,6 +4794,21 @@ input Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4990,6 +5217,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-payment-customization-js/schema.graphql b/functions-payment-customization-js/schema.graphql index 5d8055eb..0234c1a2 100644 --- a/functions-payment-customization-js/schema.graphql +++ b/functions-payment-customization-js/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2935,6 +2961,127 @@ input DeprecatedOperation @oneOf { rename: RenameOperation @deprecated(reason: "Use `paymentMethodRename` instead.") } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ The input to set event-based payment terms. """ @@ -4477,6 +4624,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4846,6 +5058,21 @@ enum PaymentTermsTriggerEvent { ORDER_FULFILLED } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -5210,6 +5437,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-payment-customization-rs/schema.graphql b/functions-payment-customization-rs/schema.graphql index 5d8055eb..0234c1a2 100644 --- a/functions-payment-customization-rs/schema.graphql +++ b/functions-payment-customization-rs/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2935,6 +2961,127 @@ input DeprecatedOperation @oneOf { rename: RenameOperation @deprecated(reason: "Use `paymentMethodRename` instead.") } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ The input to set event-based payment terms. """ @@ -4477,6 +4624,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4846,6 +5058,21 @@ enum PaymentTermsTriggerEvent { ORDER_FULFILLED } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -5210,6 +5437,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-payment-customization-wasm/schema.graphql b/functions-payment-customization-wasm/schema.graphql index 5d8055eb..0234c1a2 100644 --- a/functions-payment-customization-wasm/schema.graphql +++ b/functions-payment-customization-wasm/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2935,6 +2961,127 @@ input DeprecatedOperation @oneOf { rename: RenameOperation @deprecated(reason: "Use `paymentMethodRename` instead.") } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ The input to set event-based payment terms. """ @@ -4477,6 +4624,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4846,6 +5058,21 @@ enum PaymentTermsTriggerEvent { ORDER_FULFILLED } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -5210,6 +5437,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-pickup-point-delivery-option-generators-js/schema.graphql b/functions-pickup-point-delivery-option-generators-js/schema.graphql index 0bf87d25..531b1066 100644 --- a/functions-pickup-point-delivery-option-generators-js/schema.graphql +++ b/functions-pickup-point-delivery-option-generators-js/schema.graphql @@ -132,6 +132,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -166,6 +171,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -207,6 +217,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -219,7 +235,7 @@ the subtotal before taxes and duties, the tax amount, and duty charges. """ type CartCost { """ - The amount for the customer to pay at checkout, excluding taxes and discounts. + The amount, before taxes and cart-level discounts, for the customer to pay. """ subtotalAmount: MoneyV2! @@ -264,6 +280,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -355,7 +376,7 @@ type CartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -372,6 +393,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -383,7 +409,8 @@ type CartLine { merchandise: Merchandise! """ - The relationship between this line and its parent line, if any. + The [nested relationship](https://shopify.dev/docs/apps/build/product-merchandising/nested-cart-lines) + between this line and its parent line, if any. """ parentRelationship: CartLineParentRelationship @@ -412,7 +439,7 @@ type CartLineCost { amountPerQuantity: MoneyV2! """ - The cost of a single unit before any discounts are applied. This field is used to calculate and display + The `compareAt` price of a single unit before any discounts are applied. This field is used to calculate and display savings for customers. For example, if a product's `compareAtAmountPerQuantity` is $25 and its current price is $20, then the customer sees a $5 discount. This value can change based on the buyer's identity and is `null` when the value is hidden from buyers. @@ -2845,7 +2872,7 @@ type DeliverableCartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -2906,6 +2933,127 @@ enum DeliveryMethod { SHIPPING } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ The fetch target result. Your Function must return this data structure when generating the request. """ @@ -4582,7 +4730,74 @@ input MetafieldOutput { } """ -A precise monetary value and its associated currency. For example, 12.99 USD. +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + +""" +A precise monetary value and its associated currency. Combines a decimal amount +with a three-letter currency code to express prices, costs, and other financial +values throughout the API. For example, 12.99 USD. """ type MoneyV2 { """ @@ -4758,6 +4973,21 @@ input PickupPointDeliveryOption { pickupPoint: PickupPoint! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -5116,6 +5346,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-pickup-point-delivery-option-generators-rs/schema.graphql b/functions-pickup-point-delivery-option-generators-rs/schema.graphql index 0bf87d25..531b1066 100644 --- a/functions-pickup-point-delivery-option-generators-rs/schema.graphql +++ b/functions-pickup-point-delivery-option-generators-rs/schema.graphql @@ -132,6 +132,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -166,6 +171,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -207,6 +217,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -219,7 +235,7 @@ the subtotal before taxes and duties, the tax amount, and duty charges. """ type CartCost { """ - The amount for the customer to pay at checkout, excluding taxes and discounts. + The amount, before taxes and cart-level discounts, for the customer to pay. """ subtotalAmount: MoneyV2! @@ -264,6 +280,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -355,7 +376,7 @@ type CartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -372,6 +393,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -383,7 +409,8 @@ type CartLine { merchandise: Merchandise! """ - The relationship between this line and its parent line, if any. + The [nested relationship](https://shopify.dev/docs/apps/build/product-merchandising/nested-cart-lines) + between this line and its parent line, if any. """ parentRelationship: CartLineParentRelationship @@ -412,7 +439,7 @@ type CartLineCost { amountPerQuantity: MoneyV2! """ - The cost of a single unit before any discounts are applied. This field is used to calculate and display + The `compareAt` price of a single unit before any discounts are applied. This field is used to calculate and display savings for customers. For example, if a product's `compareAtAmountPerQuantity` is $25 and its current price is $20, then the customer sees a $5 discount. This value can change based on the buyer's identity and is `null` when the value is hidden from buyers. @@ -2845,7 +2872,7 @@ type DeliverableCartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -2906,6 +2933,127 @@ enum DeliveryMethod { SHIPPING } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ The fetch target result. Your Function must return this data structure when generating the request. """ @@ -4582,7 +4730,74 @@ input MetafieldOutput { } """ -A precise monetary value and its associated currency. For example, 12.99 USD. +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + +""" +A precise monetary value and its associated currency. Combines a decimal amount +with a three-letter currency code to express prices, costs, and other financial +values throughout the API. For example, 12.99 USD. """ type MoneyV2 { """ @@ -4758,6 +4973,21 @@ input PickupPointDeliveryOption { pickupPoint: PickupPoint! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -5116,6 +5346,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-pickup-point-delivery-option-generators-wasm/schema.graphql b/functions-pickup-point-delivery-option-generators-wasm/schema.graphql index 0bf87d25..531b1066 100644 --- a/functions-pickup-point-delivery-option-generators-wasm/schema.graphql +++ b/functions-pickup-point-delivery-option-generators-wasm/schema.graphql @@ -132,6 +132,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -166,6 +171,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -207,6 +217,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -219,7 +235,7 @@ the subtotal before taxes and duties, the tax amount, and duty charges. """ type CartCost { """ - The amount for the customer to pay at checkout, excluding taxes and discounts. + The amount, before taxes and cart-level discounts, for the customer to pay. """ subtotalAmount: MoneyV2! @@ -264,6 +280,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -355,7 +376,7 @@ type CartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -372,6 +393,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -383,7 +409,8 @@ type CartLine { merchandise: Merchandise! """ - The relationship between this line and its parent line, if any. + The [nested relationship](https://shopify.dev/docs/apps/build/product-merchandising/nested-cart-lines) + between this line and its parent line, if any. """ parentRelationship: CartLineParentRelationship @@ -412,7 +439,7 @@ type CartLineCost { amountPerQuantity: MoneyV2! """ - The cost of a single unit before any discounts are applied. This field is used to calculate and display + The `compareAt` price of a single unit before any discounts are applied. This field is used to calculate and display savings for customers. For example, if a product's `compareAtAmountPerQuantity` is $25 and its current price is $20, then the customer sees a $5 discount. This value can change based on the buyer's identity and is `null` when the value is hidden from buyers. @@ -2845,7 +2872,7 @@ type DeliverableCartLine { gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. Cart line attributes are equivalent to the - [`line_item`](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) + [`line_item`](https://shopify.dev/docs/api/liquid/objects/line_item) object in Liquid. """ attribute( @@ -2906,6 +2933,127 @@ enum DeliveryMethod { SHIPPING } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ The fetch target result. Your Function must return this data structure when generating the request. """ @@ -4582,7 +4730,74 @@ input MetafieldOutput { } """ -A precise monetary value and its associated currency. For example, 12.99 USD. +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + +""" +A precise monetary value and its associated currency. Combines a decimal amount +with a three-letter currency code to express prices, costs, and other financial +values throughout the API. For example, 12.99 USD. """ type MoneyV2 { """ @@ -4758,6 +4973,21 @@ input PickupPointDeliveryOption { pickupPoint: PickupPoint! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -5116,6 +5346,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-product-discounts-js/schema.graphql b/functions-product-discounts-js/schema.graphql index 8204483f..49dda5fc 100644 --- a/functions-product-discounts-js/schema.graphql +++ b/functions-product-discounts-js/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2919,6 +2945,89 @@ input Discount { value: Value! } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + """ The approach that determines how multiple discounts are evaluated and applied to a cart. You can apply all discounts with conditions that are met, @@ -2951,6 +3060,44 @@ enum DiscountApplicationStrategy { MAXIMUM } +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A discount wrapper node. """ @@ -4501,6 +4648,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4558,6 +4770,21 @@ input Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4922,6 +5149,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-product-discounts-rs/schema.graphql b/functions-product-discounts-rs/schema.graphql index 8204483f..49dda5fc 100644 --- a/functions-product-discounts-rs/schema.graphql +++ b/functions-product-discounts-rs/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2919,6 +2945,89 @@ input Discount { value: Value! } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + """ The approach that determines how multiple discounts are evaluated and applied to a cart. You can apply all discounts with conditions that are met, @@ -2951,6 +3060,44 @@ enum DiscountApplicationStrategy { MAXIMUM } +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A discount wrapper node. """ @@ -4501,6 +4648,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4558,6 +4770,21 @@ input Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4922,6 +5149,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-product-discounts-wasm/schema.graphql b/functions-product-discounts-wasm/schema.graphql index 8204483f..49dda5fc 100644 --- a/functions-product-discounts-wasm/schema.graphql +++ b/functions-product-discounts-wasm/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2919,6 +2945,89 @@ input Discount { value: Value! } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + """ The approach that determines how multiple discounts are evaluated and applied to a cart. You can apply all discounts with conditions that are met, @@ -2951,6 +3060,44 @@ enum DiscountApplicationStrategy { MAXIMUM } +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A discount wrapper node. """ @@ -4501,6 +4648,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4558,6 +4770,21 @@ input Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4922,6 +5149,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-shipping-discounts-js/schema.graphql b/functions-shipping-discounts-js/schema.graphql index 0122597e..21ca37bd 100644 --- a/functions-shipping-discounts-js/schema.graphql +++ b/functions-shipping-discounts-js/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2924,6 +2950,127 @@ input Discount { value: Value! } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A discount wrapper node. """ @@ -4450,6 +4597,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4507,6 +4719,21 @@ input Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4849,6 +5076,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-shipping-discounts-rs/schema.graphql b/functions-shipping-discounts-rs/schema.graphql index 0122597e..21ca37bd 100644 --- a/functions-shipping-discounts-rs/schema.graphql +++ b/functions-shipping-discounts-rs/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2924,6 +2950,127 @@ input Discount { value: Value! } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A discount wrapper node. """ @@ -4450,6 +4597,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4507,6 +4719,21 @@ input Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4849,6 +5076,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """ diff --git a/functions-shipping-discounts-wasm/schema.graphql b/functions-shipping-discounts-wasm/schema.graphql index 0122597e..21ca37bd 100644 --- a/functions-shipping-discounts-wasm/schema.graphql +++ b/functions-shipping-discounts-wasm/schema.graphql @@ -86,6 +86,11 @@ type Cart implements HasMetafields { key: String ): Attribute + """ + The billing address associated with the cart. + """ + billingAddress: MailingAddress + """ Information about the customer that's interacting with the cart. It includes details such as the customer's email and phone number, and the total amount of money the customer has spent in the store. @@ -120,6 +125,11 @@ type Cart implements HasMetafields { """ deliveryGroups: [CartDeliveryGroup!]! + """ + The discounts that have been applied to the cart. + """ + discountApplications: [DiscountApplication!]! + """ The items in a cart that the customer intends to purchase. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two @@ -161,6 +171,12 @@ type Cart implements HasMetafields { namespace: String ): Metafield + """ + A purchase order number associated with the cart, often used for B2B transactions + to reference the buyer's internal purchase order. + """ + poNumber: String + """ The physical location where a retail order is created or completed. """ @@ -218,6 +234,11 @@ type CartDeliveryGroup { """ deliveryOptions: [CartDeliveryOption!]! + """ + The discounts that have been applied to the delivery group. + """ + discountAllocations: [DiscountAllocation!]! + """ The type of merchandise in the delivery group. """ @@ -326,6 +347,11 @@ type CartLine { """ cost: CartLineCost! + """ + The discounts that have been applied to the cart line. + """ + discountAllocations: [DiscountAllocation!]! + """ The ID of the cart line. """ @@ -2924,6 +2950,127 @@ input Discount { value: Value! } +""" +The discount application and the amount applied. +""" +type DiscountAllocation { + """ + The discount that was applied. + """ + discountApplication: DiscountApplication! + + """ + The amount that was discounted. + """ + discountedAmount: MoneyV2! +} + +""" +Discount that has been applied to the cart. +""" +type DiscountApplication implements HasMetafields { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information + about a Shopify resource, such as products, orders, and + [many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType). + Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries) + enables you to customize the checkout experience. + """ + metafield( + """ + The unique identifier for the metafield within its namespace. A metafield is composed of a + namespace and a key, in the format `namespace.key`. + """ + key: String! + + """ + A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts + between different apps or different parts of the same app. If omitted, then the + [app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership) + is used. + """ + namespace: String + ): Metafield + + """ + The lines on the cart targeted by the discount. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards. + """ + targetType: DiscountApplicationTarget! + + """ + The total allocated amount of the discount across all items. + """ + totalAllocatedAmount: MoneyV2! + + """ + The value of the discount. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH +} + +""" +The type of line on an order that the discount is applicable towards. +""" +enum DiscountApplicationTarget { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +The lines on the order to which the discount is applied, of the type defined by +the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of +`LINE_ITEM`, applies the discount on all line items that are entitled to the discount. +The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines that it's entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + """ A discount wrapper node. """ @@ -4450,6 +4597,71 @@ type Metafield { value: String! } +""" +An instance of custom structured data defined by a MetaobjectDefinition. +""" +type Metaobject { + """ + The field for an object key, or null if the key has no field definition. + """ + field( + """ + The metaobject key to access. + """ + key: String! + ): MetaobjectField + + """ + The unique handle of the metaobject, useful as a custom ID. + """ + handle: String! + + """ + The type of the metaobject. + """ + type: String! +} + +""" +Provides a field definition and the data value assigned to it. +""" +type MetaobjectField { + """ + The assigned field value in JSON format. + """ + jsonValue: JSON + + """ + The object key of this field. + """ + key: String! + + """ + The type of the field. + """ + type: String! + + """ + The assigned field value, always stored as a string regardless of the field type. + """ + value: String +} + +""" +The input fields for retrieving a metaobject by handle. +""" +input MetaobjectHandleInput { + """ + The handle of the metaobject to retrieve. + """ + handle: String! + + """ + The type of the metaobject. Must match an existing metaobject definition type. + """ + type: String! +} + """ A precise monetary value and its associated currency. Combines a decimal amount with a three-letter currency code to express prices, costs, and other financial @@ -4507,6 +4719,21 @@ input Percentage { value: Decimal! } +""" +The percentage value of a discount. +""" +type PricingPercentageValue { + """ + The percentage value of the discount. + """ + value: Decimal! +} + +""" +The price value for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + """ The goods and services that merchants offer to customers. Products can include details such as title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data). @@ -4849,6 +5076,22 @@ type Shop implements HasMetafields { """ namespace: String ): Metafield + + """ + Fetch a specific Metaobject by one of its unique identifiers. Only app-owned + metaobjects with the $app reserved prefix are accessible to functions. + """ + metaobject( + """ + The handle and type of the metaobject. + """ + handle: MetaobjectHandleInput + + """ + The ID of the metaobject. + """ + id: ID + ): Metaobject } """