--- title: Order Routing Location Rule Function API description: Use the Order Routing Location Rule Function API to define custom rules that prioritize fulfillment locations. api_version: 2025-07 api_type: functions api_name: order-routing-location-rule source_url: html: https://shopify.dev/docs/api/functions/latest/order-routing-location-rule md: https://shopify.dev/docs/api/functions/latest/order-routing-location-rule.md --- # Order Routing Location Rule Function API [Order routing](https://help.shopify.com/manual/fulfillment/setup/order-routing/understanding-order-routing) determines the location to fulfill each item in a cart. A set of rules are used to evaluate an order and prioritize fulfillment locations. Shopify selects the location with the highest priority ranking to fulfill the order. Location rules let you send items to different fulfillment locations during order routing. For example, Product A can go to Location X, and Product B can go to Location Y. If a product has multiple units, such as four units of Product A, then three can go to Location X and one to Location Y. To define custom order routing rules, you can only use the Order Routing Location Rule Function API. [Shopify Functions](https://shopify.dev/docs/api/functions/current) enable you to customize Shopify's backend logic. The Order Routing Location Rule API integrates this logic into the checkout flow, as well as for draft orders, order editing, and order imports. You can also access this logic using the API after checkout, or re-trigger it in the Shopify admin. Use the API to prioritize locations for order routing, with associated data such as buyer identity, fulfillment groups, and location addresses. Beta The Order Routing Location Rule API is only available by request for merchants that have a [Shopify Plus plan](https://help.shopify.com/manual/intro-to-shopify/pricing-plans/plans-features/shopify-plus-plan). Merchants must be enrolled in the [Partners program](https://help.shopify.com/partners/about) to deploy their own custom apps and location rules. ### Use cases * Fulfill orders from the nearest location that serves the shop's market. * Prioritize a group of locations for order routing, such as warehouses or retail stores. * Rank locations relative to each other based on product metafields. * Deprioritize a location if it's exceeded the maximum daily order capacity. * Prioritize locations that can fulfill items faster or have a certain inventory rotation level. ## Function target Checkout Compatibility with Shopify surfaces Supported (8) Partially supported (3) Unsupported (3) * [B2B](https://shopify.dev/docs/apps/build/b2b): Supported * [Cart](https://shopify.dev/docs/storefronts/themes/architecture/templates/cart): Supported * [Checkout](https://shopify.dev/docs/apps/build/checkout): Supported * [Create Order API](https://shopify.dev/docs/api/admin-graphql/latest/mutations/orderCreate): Supported * [Draft Order (Admin)](https://shopify.dev/docs/apps/build/b2b/draft-orders): Supported * [Draft Order (Checkout)](https://shopify.dev/docs/apps/build/b2b/draft-orders): Supported * [Order Edit (Admin)](https://shopify.dev/docs/apps/build/orders-fulfillment/order-management-apps/edit-orders): Partially supported This option is available only for new items. * [Order Edit (Checkout)](https://shopify.dev/docs/apps/build/orders-fulfillment/order-management-apps/edit-orders): Not supported * [POS](https://shopify.dev/docs/apps/build/pos): Partially supported POS is available only when shipping to a customer. * [Pre-order and Try Before You Buy](https://shopify.dev/docs/apps/build/purchase-options/deferred): Not supported * [Shopify Admin](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries#creating-your-merchant-interface): Supported * [Storefront](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/): Partially supported This option is available only with Buy with Prime. * [Storefront Accelerated Checkout](https://shopify.dev/docs/storefronts/themes/pricing-payments/accelerated-checkout): Supported * [Subscription (Recurring Orders)](https://shopify.dev/docs/apps/build/purchase-options/subscriptions): Not supported *** ## Getting started Scaffolding the function using [Shopify CLI](https://shopify.dev/docs/api/shopify-cli) will automatically configure your TOML file. You can alter the default [configuration](https://shopify.dev/docs/api/functions/2025-07#configuration) to customize the way your function operates. ## Terminal ```terminal shopify app generate extension --template order_routing_location_rule ``` [![](https://shopify.dev/images/icons/32/tutorial.png)![](https://shopify.dev/images/icons/32/tutorial-dark.png)](https://shopify.dev/docs/apps/build/orders-fulfillment/order-routing-apps/location-rules/build-location-rule-function) [TutorialBuild an order routing location rule function](https://shopify.dev/docs/apps/build/orders-fulfillment/order-routing-apps/location-rules/build-location-rule-function) *** ## Targets A [target](https://shopify.dev/docs/apps/build/app-extensions/configure-app-extensions#targets) is an identifier in `shopify.extension.toml` that specifies where you're injecting code into Shopify Function APIs, or other parts of the Shopify platform. Each target is composed of three to four namespaces. The name begins with a broad Shopify context and ends with the behavior of the extensible element. *** ### Run target `cart.fulfillment-groups.location-rankings.generate.run` The run target ranks locations using Shopify data or hardcoded values. Locations must be associated with a fulfillment group to be ranked. The target returns a list of operations to be applied to locations associated with fulfillment groups. For example, you might use this to prioritize warehouses over storefront locations. Locations in the first group will be [prioritized](#how-fulfillment-groups-are-ranked) over locations in the second group. * Input OBJECT The `Input` object is the complete GraphQL schema that your function can query as input to customize order routing logic. Your function receives only the fields that you request in the input query. To optimize performance, we highly recommend that you request only the fields that your function requires. * cart Cart! non-null The cart where the Function is running. A cart contains the merchandise that a customer intends to purchase and information about the customer, such as the customer's email address and phone number. * attribute Attribute The custom attributes associated with a cart to store additional information. Cart attributes allow you to collect specific information from customers on the **Cart** page, such as order notes, gift wrapping requests, or custom product details. Attributes are stored as key-value pairs. * key String ### Arguments The key of the cart attribute to retrieve. For example, `"gift_wrapping"`. *** * key String! non-null ### Fields The key or name of the attribute. For example, `"customer_first_order"`. * value String The value of the attribute. For example, `"true"`. * buyer​Identity Buyer​Identity 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. This information helps personalize the checkout experience and ensures that accurate pricing and delivery options are displayed to customers. * customer Customer The [customer](https://help.shopify.com/manual/customers/manage-customers) that's interacting with the cart. * amount​Spent Money​V2! non-null The total amount that the customer has spent on orders. The amount is converted from the shop's currency to the currency of the cart using a market rate. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * display​Name String! non-null The full name of the customer, based on the values for `firstName` and `lastName`. If `firstName` and `lastName` aren't specified, then the value is the customer's email address. If the email address isn't specified, then the value is the customer's phone number. * email String The customer's email address. * first​Name String The customer's first name. * has​Any​Tag Boolean! non-null Whether the customer is associated with any of the specified tags. The customer must have at least one tag from the list to return `true`. * tags \[String!]! requiredDefault:\[] ### Arguments A comma-separated list of searchable keywords that are associated with the customer. For example, `"VIP, Gold"` returns customers with either the `VIP` or `Gold` tag. *** * has​Tags \[Has​Tag​Response!]! non-null Whether the customer is associated with the specified tags. * tags \[String!]! requiredDefault:\[] ### Arguments A comma-separated list of searchable keywords that are associated with the customer. For example, `"VIP, Gold"` returns customers with both the `VIP` and `Gold` tags. *** * has​Tag Boolean! non-null ### Fields Whether the Shopify resource has the tag. * tag String! non-null A searchable keyword that's associated with a Shopify resource, such as a product or customer. For example, a merchant might apply the `sports` and `summer` tags to products that are associated with sportswear for summer. * id ID! non-null A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the customer. * last​Name String The customer's last name. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * number​Of​Orders Int! non-null The total number of orders that the customer has made at the store. * email String The email address of the customer that's interacting with the cart. * is​Authenticated Boolean! non-null Whether the customer is authenticated through their [customer account](https://help.shopify.com/manual/customers/customer-accounts). * phone String The phone number of the customer that's interacting with the cart. * purchasing​Company Purchasing​Company The company of a B2B customer that's interacting with the cart. Used to manage and track purchases made by businesses rather than individual customers. * company Company! non-null The company associated to the order or draft order. * created​At Date​Time! non-null The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company was created in Shopify. * external​Id String A unique externally-supplied ID for the company. * id ID! non-null The ID of the company. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * name String! non-null The name of the company. * updated​At Date​Time! non-null The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company was last modified. * contact Company​Contact The company contact associated to the order or draft order. * created​At Date​Time! non-null The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company contact was created in Shopify. * id ID! non-null The ID of the company. * locale String The company contact's locale (language). * title String The company contact's job title. * updated​At Date​Time! non-null The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company contact was last modified. * location Company​Location! non-null The company location associated to the order or draft order. * created​At Date​Time! non-null The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company location was created in Shopify. * external​Id String A unique externally-supplied ID for the company. * id ID! non-null The ID of the company. * locale String The preferred locale of the company location. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * name String! non-null The name of the company location. * updated​At Date​Time! non-null The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company location was last modified. * cost Cart​Cost! non-null A breakdown of the costs that the customer will pay at checkout. It includes the total amount, the subtotal before taxes and duties, the tax amount, and duty charges. * subtotal​Amount Money​V2! non-null The amount, before taxes and cart-level discounts, for the customer to pay. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * total​Amount Money​V2! non-null The total amount for the customer to pay at checkout. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * total​Duty​Amount Money​V2 The duty charges for a customer to pay at checkout. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * total​Tax​Amount Money​V2 The total tax amount for the customer to pay at checkout. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * deliverable​Lines \[Deliverable​Cart​Line!]! non-null The items in a cart that are eligible for fulfillment and can be delivered to the customer. * attribute Attribute The custom attributes associated with a cart to store additional information. Cart attributes allow you to collect specific information from customers on the **Cart** page, such as order notes, 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) object in Liquid. * key String ### Arguments The key of the cart attribute to retrieve. For example, `"gift_wrapping"`. *** * key String! non-null ### Fields The key or name of the attribute. For example, `"customer_first_order"`. * value String The value of the attribute. For example, `"true"`. * id ID! non-null The ID of the cart line. * merchandise Merchandise! non-null The item that the customer intends to purchase. * Custom​Product OBJECT A custom product represents a product that doesn't map to Shopify's [standard product categories](https://help.shopify.com/manual/products/details/product-type). For example, you can use a custom product to manage gift cards, shipping requirements, localized product information, or weight measurements and conversions. * is​Gift​Card Boolean! non-null Whether the merchandise is a gift card. * requires​Shipping Boolean! non-null Whether the item needs to be shipped to the customer. For example, a digital gift card doesn't need to be shipped, but a t-shirt does need to be shipped. * title String! non-null The localized name for the product that displays to customers. The title is used to construct the product's handle, which is a unique, human-readable string of the product's title. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * weight Float The product variant's weight, in the system of measurement set in the `weightUnit` field. * weight​Unit Weight​Unit! non-null The unit of measurement for weight. * GRAMS, KILOGRAMS, OUNCES, POUNDS * Product​Variant OBJECT A specific version of a product that comes in more than one option, such as size or color. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another. * id ID! non-null A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the product variant. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * product Product! non-null The product associated with the product variant. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another. The product associated with the product variant would be the t-shirt itself. * handle Handle! non-null A unique, human-readable string of the product's title. A handle can contain letters, hyphens (`-`), and numbers, but not spaces. The handle is used in the online store URL for the product. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * has​Any​Tag Boolean! non-null Whether the product is associated with any of the specified tags. The product must have at least one tag from the list to return `true`. * tags \[String!]! requiredDefault:\[] ### Arguments A comma-separated list of searchable keywords that are associated with the product. For example, `"sports, summer"` returns products with either the `sports` or `summer` tag. *** * has​Tags \[Has​Tag​Response!]! non-null Whether the product is associated with the specified tags. * tags \[String!]! requiredDefault:\[] ### Arguments A comma-separated list of searchable keywords that are associated with the product. For example, `"sports, summer"` returns products with both the `sports` and `summer` tags. *** * has​Tag Boolean! non-null ### Fields Whether the Shopify resource has the tag. * tag String! non-null A searchable keyword that's associated with a Shopify resource, such as a product or customer. For example, a merchant might apply the `sports` and `summer` tags to products that are associated with sportswear for summer. * id ID! non-null A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the product. * in​Any​Collection Boolean! non-null Whether the product is in any of the specified collections. The product must be in at least one collection from the list to return `true`. A collection is a group of products that can be displayed in online stores and other sales channels in categories, which makes it easy for customers to find them. For example, an athletics store might create different collections for running attire and accessories. * ids \[ID!]! requiredDefault:\[] ### Arguments A comma-separated list of [globally-unique collection IDs](https://shopify.dev/docs/api/usage/gids) that are associated with the product. For example, `gid://shopify/Collection/123`, `gid://shopify/Collection/456`. *** * in​Collections \[Collection​Membership!]! non-null Whether the product is in the specified collections. The product must be in all of the collections in the list to return `true`. A collection is a group of products that can be displayed in online stores and other sales channels in categories, which makes it easy for customers to find them. For example, an athletics store might create different collections for running attire and accessories. * ids \[ID!]! requiredDefault:\[] ### Arguments A comma-separated list of [globally-unique collection IDs](https://shopify.dev/docs/api/usage/gids) that are associated with the product. For example, `gid://shopify/Collection/123`, `gid://shopify/Collection/456`. *** * collection​Id ID! non-null ### Fields A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the collection. * is​Member Boolean! non-null Whether the product is in the specified collection. * is​Gift​Card Boolean! non-null Whether the product is a gift card. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * product​Type String A custom category for a product. Product types allow merchants to define categories other than the ones available in Shopify's [standard product categories](https://help.shopify.com/manual/products/details/product-type). * title String! non-null The localized name for the product that displays to customers. The title is used to construct the product's handle, which is a unique, human-readable string of the product's title. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * vendor String The name of the product's vendor. * requires​Shipping Boolean! non-null Whether the item needs to be shipped to the customer. For example, a digital gift card doesn't need to be shipped, but a t-shirt does need to be shipped. * sku String A case-sensitive identifier for the product variant in the merchant's store. For example, `"BBC-1"`. A product variant must have a SKU to be connected to a [fulfillment service](https://shopify.dev/docs/apps/build/orders-fulfillment/fulfillment-service-apps/build-for-fulfillment-services). * title String The localized name for the product variant that displays to customers. * weight Float The product variant's weight, in the system of measurement set in the `weightUnit` field. * weight​Unit Weight​Unit! non-null The unit of measurement for weight. * GRAMS, KILOGRAMS, OUNCES, POUNDS * quantity Int! non-null The quantity of the item that the customer intends to purchase. * delivery​Groups \[Cart​Delivery​Group!]! non-null A collection of items that are grouped by shared delivery characteristics. Delivery groups streamline fulfillment by organizing items that can be shipped together, based on the customer's shipping address. For example, if a customer orders a t-shirt and a pair of shoes that can be shipped together, then the items are included in the same delivery group. In the [Order Discount](https://shopify.dev/docs/api/functions/reference/order-discounts) and [Product Discount](https://shopify.dev/docs/api/functions/reference/product-discounts) legacy APIs, the `cart.deliveryGroups` input is always an empty array. This means you can't access delivery groups when creating Order Discount or Product Discount Functions. If you need to apply discounts to shipping costs, then use the [Discount Function API](https://shopify.dev/docs/api/functions/reference/discount) instead. * cart​Lines \[Cart​Line!]! non-null Information about items in a cart that a 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 different sizes of the same t-shirt to their cart, then each size is represented as a separate cart line. * attribute Attribute The custom attributes associated with a cart to store additional information. Cart attributes allow you to collect specific information from customers on the **Cart** page, such as order notes, 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) object in Liquid. * key String ### Arguments The key of the cart attribute to retrieve. For example, `"gift_wrapping"`. *** * key String! non-null ### Fields The key or name of the attribute. For example, `"customer_first_order"`. * value String The value of the attribute. For example, `"true"`. * cost Cart​Line​Cost! non-null The cost of an item in a cart that the customer intends to purchase. Cart lines are entries in the customer's cart that represent 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. * amount​Per​Quantity Money​V2! non-null The cost of a single unit. For example, if a customer purchases three units of a product that are priced at $10 each, then the `amountPerQuantity` is $10. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * compare​At​Amount​Per​Quantity Money​V2 The cost 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. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * subtotal​Amount Money​V2! non-null The cost of items in the cart before applying any discounts to certain items. This amount serves as the starting point for calculating any potential savings customers might receive through promotions or discounts. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * total​Amount Money​V2! non-null The total cost of items in a cart. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * id ID! non-null The ID of the cart line. * merchandise Merchandise! non-null The item that the customer intends to purchase. * Custom​Product OBJECT A custom product represents a product that doesn't map to Shopify's [standard product categories](https://help.shopify.com/manual/products/details/product-type). For example, you can use a custom product to manage gift cards, shipping requirements, localized product information, or weight measurements and conversions. * is​Gift​Card Boolean! non-null Whether the merchandise is a gift card. * requires​Shipping Boolean! non-null Whether the item needs to be shipped to the customer. For example, a digital gift card doesn't need to be shipped, but a t-shirt does need to be shipped. * title String! non-null The localized name for the product that displays to customers. The title is used to construct the product's handle, which is a unique, human-readable string of the product's title. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * weight Float The product variant's weight, in the system of measurement set in the `weightUnit` field. * weight​Unit Weight​Unit! non-null The unit of measurement for weight. * GRAMS, KILOGRAMS, OUNCES, POUNDS * Product​Variant OBJECT A specific version of a product that comes in more than one option, such as size or color. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another. * id ID! non-null A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the product variant. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * product Product! non-null The product associated with the product variant. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another. The product associated with the product variant would be the t-shirt itself. * handle Handle! non-null A unique, human-readable string of the product's title. A handle can contain letters, hyphens (`-`), and numbers, but not spaces. The handle is used in the online store URL for the product. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * has​Any​Tag Boolean! non-null Whether the product is associated with any of the specified tags. The product must have at least one tag from the list to return `true`. * tags \[String!]! requiredDefault:\[] ### Arguments A comma-separated list of searchable keywords that are associated with the product. For example, `"sports, summer"` returns products with either the `sports` or `summer` tag. *** * has​Tags \[Has​Tag​Response!]! non-null Whether the product is associated with the specified tags. * tags \[String!]! requiredDefault:\[] ### Arguments A comma-separated list of searchable keywords that are associated with the product. For example, `"sports, summer"` returns products with both the `sports` and `summer` tags. *** * has​Tag Boolean! non-null ### Fields Whether the Shopify resource has the tag. * tag String! non-null A searchable keyword that's associated with a Shopify resource, such as a product or customer. For example, a merchant might apply the `sports` and `summer` tags to products that are associated with sportswear for summer. * id ID! non-null A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the product. * in​Any​Collection Boolean! non-null Whether the product is in any of the specified collections. The product must be in at least one collection from the list to return `true`. A collection is a group of products that can be displayed in online stores and other sales channels in categories, which makes it easy for customers to find them. For example, an athletics store might create different collections for running attire and accessories. * ids \[ID!]! requiredDefault:\[] ### Arguments A comma-separated list of [globally-unique collection IDs](https://shopify.dev/docs/api/usage/gids) that are associated with the product. For example, `gid://shopify/Collection/123`, `gid://shopify/Collection/456`. *** * in​Collections \[Collection​Membership!]! non-null Whether the product is in the specified collections. The product must be in all of the collections in the list to return `true`. A collection is a group of products that can be displayed in online stores and other sales channels in categories, which makes it easy for customers to find them. For example, an athletics store might create different collections for running attire and accessories. * ids \[ID!]! requiredDefault:\[] ### Arguments A comma-separated list of [globally-unique collection IDs](https://shopify.dev/docs/api/usage/gids) that are associated with the product. For example, `gid://shopify/Collection/123`, `gid://shopify/Collection/456`. *** * collection​Id ID! non-null ### Fields A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the collection. * is​Member Boolean! non-null Whether the product is in the specified collection. * is​Gift​Card Boolean! non-null Whether the product is a gift card. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * product​Type String A custom category for a product. Product types allow merchants to define categories other than the ones available in Shopify's [standard product categories](https://help.shopify.com/manual/products/details/product-type). * title String! non-null The localized name for the product that displays to customers. The title is used to construct the product's handle, which is a unique, human-readable string of the product's title. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * vendor String The name of the product's vendor. * requires​Shipping Boolean! non-null Whether the item needs to be shipped to the customer. For example, a digital gift card doesn't need to be shipped, but a t-shirt does need to be shipped. * sku String A case-sensitive identifier for the product variant in the merchant's store. For example, `"BBC-1"`. A product variant must have a SKU to be connected to a [fulfillment service](https://shopify.dev/docs/apps/build/orders-fulfillment/fulfillment-service-apps/build-for-fulfillment-services). * title String The localized name for the product variant that displays to customers. * weight Float The product variant's weight, in the system of measurement set in the `weightUnit` field. * weight​Unit Weight​Unit! non-null The unit of measurement for weight. * GRAMS, KILOGRAMS, OUNCES, POUNDS * quantity Int! non-null The quantity of the item that the customer intends to purchase. * selling​Plan​Allocation Selling​Plan​Allocation The [selling plan](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) associated with the cart line, including information about how a product variant can be sold and purchased. * price​Adjustments \[Selling​Plan​Allocation​Price​Adjustment!]! non-null A list of price adjustments, with a maximum of two. When there are two, the first price adjustment goes into effect at the time of purchase, while the second one starts after a certain number of orders. A price adjustment represents how a selling plan affects pricing when a variant is purchased with a selling plan. Prices display in the customer's currency if the shop is configured for it. * per​Delivery​Price Money​V2! non-null The effective price for a single delivery. For example, for a prepaid subscription plan that includes 6 deliveries at the price of $48.00, the per delivery price is $8.00. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * price Money​V2! non-null The price of the variant when it's purchased with a selling plan For example, for a prepaid subscription plan that includes 6 deliveries of $10.00 granola, where the customer gets 20% off, the price is 6 x $10.00 x 0.80 = $48.00. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * selling​Plan Selling​Plan! non-null A representation of how products and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of prepaid granola, delivered weekly'. * description String The description of the selling plan. * id ID! non-null A globally-unique identifier. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * name String! non-null The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'. * recurring​Deliveries Boolean! non-null Whether purchasing the selling plan will result in multiple deliveries. * delivery​Address Mailing​Address The shipping or destination address associated with the delivery group. * address1 String The first line of the address. Typically the street address or PO Box number. * address2 String The second line of the address. Typically the number of the apartment, suite, or unit. * city String The name of the city, district, village, or town. * company String The name of the customer's company or organization. * country​Code Country​Code The two-letter code for the country of the address. For example, US. * AC, AD, AE, AF, AG, AI, AL, AM, AN, AO, AR, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MK, ML, MM, MN, MO, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PS, PT, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TA, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VN, VU, WF, WS, XK, YE, YT, ZA, ZM, ZW, ZZ * first​Name String The first name of the customer. * last​Name String The last name of the customer. * latitude Float The approximate latitude of the address. * longitude Float The approximate longitude of the address. * name String The full name of the customer, based on firstName and lastName. * phone String A unique phone number for the customer. Formatted using E.164 standard. For example, +16135551111. * province​Code String The alphanumeric code for the region. For example, ON. * zip String The zip or postal code of the address. * market Market Deprecated * handle Handle! non-null A human-readable unique string for the market automatically generated from its title. * id ID! non-null A globally-unique identifier. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * regions \[Market​Region!]! non-null A geographic region which comprises a market. * name String The name of the region in the language of the current localization. * delivery​Options \[Cart​Delivery​Option!]! non-null The delivery options available for the delivery group. Delivery options are the different ways that customers can choose to have their orders shipped. Examples include express shipping or standard shipping. * code String A unique identifier that represents the delivery option offered to customers. For example, `Canada Post Expedited`. * cost Money​V2! non-null The amount that the customer pays if they select the delivery option. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * delivery​Method​Type Delivery​Method! non-null The delivery method associated with the delivery option. A delivery method is a way that merchants can fulfill orders from their online stores. Delivery methods include shipping to an address, [local pickup](https://help.shopify.com/manual/fulfillment/setup/delivery-methods/pickup-in-store), and shipping to a [pickup point](https://help.shopify.com/manual/fulfillment/shopify-shipping/pickup-points), all of which are natively supported by Shopify checkout. * LOCAL, NONE, PICK_UP, PICKUP_POINT, RETAIL, SHIPPING * description String A single-line description of the delivery option, with HTML tags removed. * handle Handle! non-null A unique, human-readable identifier of the delivery option's title. A handle can contain letters, hyphens (`-`), and numbers, but not spaces. For example, `standard-shipping`. * title String The name of the delivery option that displays to customers. The title is used to construct the delivery option's handle. For example, if a delivery option is titled "Standard Shipping", then the handle is `standard-shipping`. * group​Type Cart​Delivery​Group​Type! non-null The type of merchandise in the delivery group. * ONE_TIME_PURCHASE, SUBSCRIPTION * id ID! non-null A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the delivery group. * selected​Delivery​Option Cart​Delivery​Option Information about the delivery option that the customer has selected. * code String A unique identifier that represents the delivery option offered to customers. For example, `Canada Post Expedited`. * cost Money​V2! non-null The amount that the customer pays if they select the delivery option. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * delivery​Method​Type Delivery​Method! non-null The delivery method associated with the delivery option. A delivery method is a way that merchants can fulfill orders from their online stores. Delivery methods include shipping to an address, [local pickup](https://help.shopify.com/manual/fulfillment/setup/delivery-methods/pickup-in-store), and shipping to a [pickup point](https://help.shopify.com/manual/fulfillment/shopify-shipping/pickup-points), all of which are natively supported by Shopify checkout. * LOCAL, NONE, PICK_UP, PICKUP_POINT, RETAIL, SHIPPING * description String A single-line description of the delivery option, with HTML tags removed. * handle Handle! non-null A unique, human-readable identifier of the delivery option's title. A handle can contain letters, hyphens (`-`), and numbers, but not spaces. For example, `standard-shipping`. * title String The name of the delivery option that displays to customers. The title is used to construct the delivery option's handle. For example, if a delivery option is titled "Standard Shipping", then the handle is `standard-shipping`. * lines \[Cart​Line!]! non-null 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 different sizes of the same t-shirt to their cart, then each size is represented as a separate cart line. * attribute Attribute The custom attributes associated with a cart to store additional information. Cart attributes allow you to collect specific information from customers on the **Cart** page, such as order notes, 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) object in Liquid. * key String ### Arguments The key of the cart attribute to retrieve. For example, `"gift_wrapping"`. *** * key String! non-null ### Fields The key or name of the attribute. For example, `"customer_first_order"`. * value String The value of the attribute. For example, `"true"`. * cost Cart​Line​Cost! non-null The cost of an item in a cart that the customer intends to purchase. Cart lines are entries in the customer's cart that represent 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. * amount​Per​Quantity Money​V2! non-null The cost of a single unit. For example, if a customer purchases three units of a product that are priced at $10 each, then the `amountPerQuantity` is $10. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * compare​At​Amount​Per​Quantity Money​V2 The cost 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. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * subtotal​Amount Money​V2! non-null The cost of items in the cart before applying any discounts to certain items. This amount serves as the starting point for calculating any potential savings customers might receive through promotions or discounts. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * total​Amount Money​V2! non-null The total cost of items in a cart. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * id ID! non-null The ID of the cart line. * merchandise Merchandise! non-null The item that the customer intends to purchase. * Custom​Product OBJECT A custom product represents a product that doesn't map to Shopify's [standard product categories](https://help.shopify.com/manual/products/details/product-type). For example, you can use a custom product to manage gift cards, shipping requirements, localized product information, or weight measurements and conversions. * is​Gift​Card Boolean! non-null Whether the merchandise is a gift card. * requires​Shipping Boolean! non-null Whether the item needs to be shipped to the customer. For example, a digital gift card doesn't need to be shipped, but a t-shirt does need to be shipped. * title String! non-null The localized name for the product that displays to customers. The title is used to construct the product's handle, which is a unique, human-readable string of the product's title. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * weight Float The product variant's weight, in the system of measurement set in the `weightUnit` field. * weight​Unit Weight​Unit! non-null The unit of measurement for weight. * GRAMS, KILOGRAMS, OUNCES, POUNDS * Product​Variant OBJECT A specific version of a product that comes in more than one option, such as size or color. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another. * id ID! non-null A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the product variant. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * product Product! non-null The product associated with the product variant. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another. The product associated with the product variant would be the t-shirt itself. * handle Handle! non-null A unique, human-readable string of the product's title. A handle can contain letters, hyphens (`-`), and numbers, but not spaces. The handle is used in the online store URL for the product. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * has​Any​Tag Boolean! non-null Whether the product is associated with any of the specified tags. The product must have at least one tag from the list to return `true`. * tags \[String!]! requiredDefault:\[] ### Arguments A comma-separated list of searchable keywords that are associated with the product. For example, `"sports, summer"` returns products with either the `sports` or `summer` tag. *** * has​Tags \[Has​Tag​Response!]! non-null Whether the product is associated with the specified tags. * tags \[String!]! requiredDefault:\[] ### Arguments A comma-separated list of searchable keywords that are associated with the product. For example, `"sports, summer"` returns products with both the `sports` and `summer` tags. *** * has​Tag Boolean! non-null ### Fields Whether the Shopify resource has the tag. * tag String! non-null A searchable keyword that's associated with a Shopify resource, such as a product or customer. For example, a merchant might apply the `sports` and `summer` tags to products that are associated with sportswear for summer. * id ID! non-null A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the product. * in​Any​Collection Boolean! non-null Whether the product is in any of the specified collections. The product must be in at least one collection from the list to return `true`. A collection is a group of products that can be displayed in online stores and other sales channels in categories, which makes it easy for customers to find them. For example, an athletics store might create different collections for running attire and accessories. * ids \[ID!]! requiredDefault:\[] ### Arguments A comma-separated list of [globally-unique collection IDs](https://shopify.dev/docs/api/usage/gids) that are associated with the product. For example, `gid://shopify/Collection/123`, `gid://shopify/Collection/456`. *** * in​Collections \[Collection​Membership!]! non-null Whether the product is in the specified collections. The product must be in all of the collections in the list to return `true`. A collection is a group of products that can be displayed in online stores and other sales channels in categories, which makes it easy for customers to find them. For example, an athletics store might create different collections for running attire and accessories. * ids \[ID!]! requiredDefault:\[] ### Arguments A comma-separated list of [globally-unique collection IDs](https://shopify.dev/docs/api/usage/gids) that are associated with the product. For example, `gid://shopify/Collection/123`, `gid://shopify/Collection/456`. *** * collection​Id ID! non-null ### Fields A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the collection. * is​Member Boolean! non-null Whether the product is in the specified collection. * is​Gift​Card Boolean! non-null Whether the product is a gift card. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * product​Type String A custom category for a product. Product types allow merchants to define categories other than the ones available in Shopify's [standard product categories](https://help.shopify.com/manual/products/details/product-type). * title String! non-null The localized name for the product that displays to customers. The title is used to construct the product's handle, which is a unique, human-readable string of the product's title. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * vendor String The name of the product's vendor. * requires​Shipping Boolean! non-null Whether the item needs to be shipped to the customer. For example, a digital gift card doesn't need to be shipped, but a t-shirt does need to be shipped. * sku String A case-sensitive identifier for the product variant in the merchant's store. For example, `"BBC-1"`. A product variant must have a SKU to be connected to a [fulfillment service](https://shopify.dev/docs/apps/build/orders-fulfillment/fulfillment-service-apps/build-for-fulfillment-services). * title String The localized name for the product variant that displays to customers. * weight Float The product variant's weight, in the system of measurement set in the `weightUnit` field. * weight​Unit Weight​Unit! non-null The unit of measurement for weight. * GRAMS, KILOGRAMS, OUNCES, POUNDS * quantity Int! non-null The quantity of the item that the customer intends to purchase. * selling​Plan​Allocation Selling​Plan​Allocation The [selling plan](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) associated with the cart line, including information about how a product variant can be sold and purchased. * price​Adjustments \[Selling​Plan​Allocation​Price​Adjustment!]! non-null A list of price adjustments, with a maximum of two. When there are two, the first price adjustment goes into effect at the time of purchase, while the second one starts after a certain number of orders. A price adjustment represents how a selling plan affects pricing when a variant is purchased with a selling plan. Prices display in the customer's currency if the shop is configured for it. * per​Delivery​Price Money​V2! non-null The effective price for a single delivery. For example, for a prepaid subscription plan that includes 6 deliveries at the price of $48.00, the per delivery price is $8.00. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * price Money​V2! non-null The price of the variant when it's purchased with a selling plan For example, for a prepaid subscription plan that includes 6 deliveries of $10.00 granola, where the customer gets 20% off, the price is 6 x $10.00 x 0.80 = $48.00. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * selling​Plan Selling​Plan! non-null A representation of how products and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of prepaid granola, delivered weekly'. * description String The description of the selling plan. * id ID! non-null A globally-unique identifier. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * name String! non-null The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'. * recurring​Deliveries Boolean! non-null Whether purchasing the selling plan will result in multiple deliveries. * localized​Fields \[Localized​Field!]! non-null The additional fields on the **Cart** page that are required for international orders in specific countries, such as customs information or tax identification numbers. * keys \[Localized​Field​Key!]! requiredDefault:\[] ### Arguments The keys of the localized fields to retrieve. * SHIPPING_CREDENTIAL_BR, SHIPPING_CREDENTIAL_CL, SHIPPING_CREDENTIAL_CN, SHIPPING_CREDENTIAL_CO, SHIPPING_CREDENTIAL_CR, SHIPPING_CREDENTIAL_EC, SHIPPING_CREDENTIAL_ES, SHIPPING_CREDENTIAL_GT, SHIPPING_CREDENTIAL_ID, SHIPPING_CREDENTIAL_KR, SHIPPING_CREDENTIAL_MX, SHIPPING_CREDENTIAL_MY, SHIPPING_CREDENTIAL_PE, SHIPPING_CREDENTIAL_PT, SHIPPING_CREDENTIAL_PY, SHIPPING_CREDENTIAL_TR, SHIPPING_CREDENTIAL_TW, SHIPPING_CREDENTIAL_TYPE_CO, TAX_CREDENTIAL_BR, TAX_CREDENTIAL_CL, TAX_CREDENTIAL_CO, TAX_CREDENTIAL_CR, TAX_CREDENTIAL_EC, TAX_CREDENTIAL_ES, TAX_CREDENTIAL_GT, TAX_CREDENTIAL_ID, TAX_CREDENTIAL_IT, TAX_CREDENTIAL_MX, TAX_CREDENTIAL_MY, TAX_CREDENTIAL_PE, TAX_CREDENTIAL_PT, TAX_CREDENTIAL_PY, TAX_CREDENTIAL_TR, TAX_CREDENTIAL_TYPE_CO, TAX_CREDENTIAL_TYPE_MX, TAX_CREDENTIAL_USE_MX, TAX_EMAIL_IT *** * key Localized​Field​Key! non-null ### Fields The key of the localized field. * SHIPPING_CREDENTIAL_BR, SHIPPING_CREDENTIAL_CL, SHIPPING_CREDENTIAL_CN, SHIPPING_CREDENTIAL_CO, SHIPPING_CREDENTIAL_CR, SHIPPING_CREDENTIAL_EC, SHIPPING_CREDENTIAL_ES, SHIPPING_CREDENTIAL_GT, SHIPPING_CREDENTIAL_ID, SHIPPING_CREDENTIAL_KR, SHIPPING_CREDENTIAL_MX, SHIPPING_CREDENTIAL_MY, SHIPPING_CREDENTIAL_PE, SHIPPING_CREDENTIAL_PT, SHIPPING_CREDENTIAL_PY, SHIPPING_CREDENTIAL_TR, SHIPPING_CREDENTIAL_TW, SHIPPING_CREDENTIAL_TYPE_CO, TAX_CREDENTIAL_BR, TAX_CREDENTIAL_CL, TAX_CREDENTIAL_CO, TAX_CREDENTIAL_CR, TAX_CREDENTIAL_EC, TAX_CREDENTIAL_ES, TAX_CREDENTIAL_GT, TAX_CREDENTIAL_ID, TAX_CREDENTIAL_IT, TAX_CREDENTIAL_MX, TAX_CREDENTIAL_MY, TAX_CREDENTIAL_PE, TAX_CREDENTIAL_PT, TAX_CREDENTIAL_PY, TAX_CREDENTIAL_TR, TAX_CREDENTIAL_TYPE_CO, TAX_CREDENTIAL_TYPE_MX, TAX_CREDENTIAL_USE_MX, TAX_EMAIL_IT * title String! non-null The title of the localized field. * value String The value of the localized field. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * retail​Location Location The physical location where a retail order is created or completed. * address Location​Address! non-null The address of this location. * address1 String The first line of the address for the location. * address2 String The second line of the address for the location. * city String The city of the location. * country String The country of the location. * country​Code String The country code of the location. * formatted \[String!]! non-null A formatted version of the address for the location. * latitude Float The approximate latitude coordinates of the location. * longitude Float The approximate longitude coordinates of the location. * phone String The phone number of the location. * province String The province of the location. * province​Code String The code for the province, state, or district of the address of the location. * zip String The ZIP code of the location. * handle Handle! non-null The location handle. * id ID! non-null The location id. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * name String! non-null The name of the location. * fulfillment​Groups \[Fulfillment​Group!]! non-null A list of [fulfillment locations](https://shopify.dev/manual/fulfillment/setup/shipping-profiles/managing-fulfillment-locations) that contain one or more items to be shipped together. Each item in the cart is assigned to one fulfillment group. * delivery​Address Mailing​Address The delivery address for the fulfillment group. * address1 String The first line of the address. Typically the street address or PO Box number. * address2 String The second line of the address. Typically the number of the apartment, suite, or unit. * city String The name of the city, district, village, or town. * company String The name of the customer's company or organization. * country​Code Country​Code The two-letter code for the country of the address. For example, US. * AC, AD, AE, AF, AG, AI, AL, AM, AN, AO, AR, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MK, ML, MM, MN, MO, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PS, PT, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TA, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VN, VU, WF, WS, XK, YE, YT, ZA, ZM, ZW, ZZ * first​Name String The first name of the customer. * last​Name String The last name of the customer. * latitude Float The approximate latitude of the address. * longitude Float The approximate longitude of the address. * name String The full name of the customer, based on firstName and lastName. * phone String A unique phone number for the customer. Formatted using E.164 standard. For example, +16135551111. * province​Code String The alphanumeric code for the region. For example, ON. * zip String The zip or postal code of the address. * market Market Deprecated * handle Handle! non-null A human-readable unique string for the market automatically generated from its title. * id ID! non-null A globally-unique identifier. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * regions \[Market​Region!]! non-null A geographic region which comprises a market. * name String The name of the region in the language of the current localization. * handle Handle! non-null The fulfillment group handle. * inventory​Location​Handles \[Handle!]! non-null A list of inventory location handles for the fulfillment group. * lines \[Cart​Line!]! non-null A list of lines containing information about the items that are part of the fulfillment group. * attribute Attribute The custom attributes associated with a cart to store additional information. Cart attributes allow you to collect specific information from customers on the **Cart** page, such as order notes, 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) object in Liquid. * key String ### Arguments The key of the cart attribute to retrieve. For example, `"gift_wrapping"`. *** * key String! non-null ### Fields The key or name of the attribute. For example, `"customer_first_order"`. * value String The value of the attribute. For example, `"true"`. * cost Cart​Line​Cost! non-null The cost of an item in a cart that the customer intends to purchase. Cart lines are entries in the customer's cart that represent 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. * amount​Per​Quantity Money​V2! non-null The cost of a single unit. For example, if a customer purchases three units of a product that are priced at $10 each, then the `amountPerQuantity` is $10. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * compare​At​Amount​Per​Quantity Money​V2 The cost 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. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * subtotal​Amount Money​V2! non-null The cost of items in the cart before applying any discounts to certain items. This amount serves as the starting point for calculating any potential savings customers might receive through promotions or discounts. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * total​Amount Money​V2! non-null The total cost of items in a cart. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * id ID! non-null The ID of the cart line. * merchandise Merchandise! non-null The item that the customer intends to purchase. * Custom​Product OBJECT A custom product represents a product that doesn't map to Shopify's [standard product categories](https://help.shopify.com/manual/products/details/product-type). For example, you can use a custom product to manage gift cards, shipping requirements, localized product information, or weight measurements and conversions. * is​Gift​Card Boolean! non-null Whether the merchandise is a gift card. * requires​Shipping Boolean! non-null Whether the item needs to be shipped to the customer. For example, a digital gift card doesn't need to be shipped, but a t-shirt does need to be shipped. * title String! non-null The localized name for the product that displays to customers. The title is used to construct the product's handle, which is a unique, human-readable string of the product's title. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * weight Float The product variant's weight, in the system of measurement set in the `weightUnit` field. * weight​Unit Weight​Unit! non-null The unit of measurement for weight. * GRAMS, KILOGRAMS, OUNCES, POUNDS * Product​Variant OBJECT A specific version of a product that comes in more than one option, such as size or color. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another. * id ID! non-null A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the product variant. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * product Product! non-null The product associated with the product variant. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another. The product associated with the product variant would be the t-shirt itself. * handle Handle! non-null A unique, human-readable string of the product's title. A handle can contain letters, hyphens (`-`), and numbers, but not spaces. The handle is used in the online store URL for the product. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * has​Any​Tag Boolean! non-null Whether the product is associated with any of the specified tags. The product must have at least one tag from the list to return `true`. * tags \[String!]! requiredDefault:\[] ### Arguments A comma-separated list of searchable keywords that are associated with the product. For example, `"sports, summer"` returns products with either the `sports` or `summer` tag. *** * has​Tags \[Has​Tag​Response!]! non-null Whether the product is associated with the specified tags. * tags \[String!]! requiredDefault:\[] ### Arguments A comma-separated list of searchable keywords that are associated with the product. For example, `"sports, summer"` returns products with both the `sports` and `summer` tags. *** * has​Tag Boolean! non-null ### Fields Whether the Shopify resource has the tag. * tag String! non-null A searchable keyword that's associated with a Shopify resource, such as a product or customer. For example, a merchant might apply the `sports` and `summer` tags to products that are associated with sportswear for summer. * id ID! non-null A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the product. * in​Any​Collection Boolean! non-null Whether the product is in any of the specified collections. The product must be in at least one collection from the list to return `true`. A collection is a group of products that can be displayed in online stores and other sales channels in categories, which makes it easy for customers to find them. For example, an athletics store might create different collections for running attire and accessories. * ids \[ID!]! requiredDefault:\[] ### Arguments A comma-separated list of [globally-unique collection IDs](https://shopify.dev/docs/api/usage/gids) that are associated with the product. For example, `gid://shopify/Collection/123`, `gid://shopify/Collection/456`. *** * in​Collections \[Collection​Membership!]! non-null Whether the product is in the specified collections. The product must be in all of the collections in the list to return `true`. A collection is a group of products that can be displayed in online stores and other sales channels in categories, which makes it easy for customers to find them. For example, an athletics store might create different collections for running attire and accessories. * ids \[ID!]! requiredDefault:\[] ### Arguments A comma-separated list of [globally-unique collection IDs](https://shopify.dev/docs/api/usage/gids) that are associated with the product. For example, `gid://shopify/Collection/123`, `gid://shopify/Collection/456`. *** * collection​Id ID! non-null ### Fields A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the collection. * is​Member Boolean! non-null Whether the product is in the specified collection. * is​Gift​Card Boolean! non-null Whether the product is a gift card. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * product​Type String A custom category for a product. Product types allow merchants to define categories other than the ones available in Shopify's [standard product categories](https://help.shopify.com/manual/products/details/product-type). * title String! non-null The localized name for the product that displays to customers. The title is used to construct the product's handle, which is a unique, human-readable string of the product's title. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * vendor String The name of the product's vendor. * requires​Shipping Boolean! non-null Whether the item needs to be shipped to the customer. For example, a digital gift card doesn't need to be shipped, but a t-shirt does need to be shipped. * sku String A case-sensitive identifier for the product variant in the merchant's store. For example, `"BBC-1"`. A product variant must have a SKU to be connected to a [fulfillment service](https://shopify.dev/docs/apps/build/orders-fulfillment/fulfillment-service-apps/build-for-fulfillment-services). * title String The localized name for the product variant that displays to customers. * weight Float The product variant's weight, in the system of measurement set in the `weightUnit` field. * weight​Unit Weight​Unit! non-null The unit of measurement for weight. * GRAMS, KILOGRAMS, OUNCES, POUNDS * quantity Int! non-null The quantity of the item that the customer intends to purchase. * selling​Plan​Allocation Selling​Plan​Allocation The [selling plan](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) associated with the cart line, including information about how a product variant can be sold and purchased. * price​Adjustments \[Selling​Plan​Allocation​Price​Adjustment!]! non-null A list of price adjustments, with a maximum of two. When there are two, the first price adjustment goes into effect at the time of purchase, while the second one starts after a certain number of orders. A price adjustment represents how a selling plan affects pricing when a variant is purchased with a selling plan. Prices display in the customer's currency if the shop is configured for it. * per​Delivery​Price Money​V2! non-null The effective price for a single delivery. For example, for a prepaid subscription plan that includes 6 deliveries at the price of $48.00, the per delivery price is $8.00. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * price Money​V2! non-null The price of the variant when it's purchased with a selling plan For example, for a prepaid subscription plan that includes 6 deliveries of $10.00 granola, where the customer gets 20% off, the price is 6 x $10.00 x 0.80 = $48.00. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * selling​Plan Selling​Plan! non-null A representation of how products and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of prepaid granola, delivered weekly'. * description String The description of the selling plan. * id ID! non-null A globally-unique identifier. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * name String! non-null The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'. * recurring​Deliveries Boolean! non-null Whether purchasing the selling plan will result in multiple deliveries. * delivery​Group Cart​Delivery​Group! non-nullDeprecated * cart​Lines \[Cart​Line!]! non-null Information about items in a cart that a 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 different sizes of the same t-shirt to their cart, then each size is represented as a separate cart line. * attribute Attribute The custom attributes associated with a cart to store additional information. Cart attributes allow you to collect specific information from customers on the **Cart** page, such as order notes, 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) object in Liquid. * key String ### Arguments The key of the cart attribute to retrieve. For example, `"gift_wrapping"`. *** * key String! non-null ### Fields The key or name of the attribute. For example, `"customer_first_order"`. * value String The value of the attribute. For example, `"true"`. * cost Cart​Line​Cost! non-null The cost of an item in a cart that the customer intends to purchase. Cart lines are entries in the customer's cart that represent 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. * amount​Per​Quantity Money​V2! non-null The cost of a single unit. For example, if a customer purchases three units of a product that are priced at $10 each, then the `amountPerQuantity` is $10. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * compare​At​Amount​Per​Quantity Money​V2 The cost 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. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * subtotal​Amount Money​V2! non-null The cost of items in the cart before applying any discounts to certain items. This amount serves as the starting point for calculating any potential savings customers might receive through promotions or discounts. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * total​Amount Money​V2! non-null The total cost of items in a cart. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * id ID! non-null The ID of the cart line. * merchandise Merchandise! non-null The item that the customer intends to purchase. * Custom​Product OBJECT A custom product represents a product that doesn't map to Shopify's [standard product categories](https://help.shopify.com/manual/products/details/product-type). For example, you can use a custom product to manage gift cards, shipping requirements, localized product information, or weight measurements and conversions. * is​Gift​Card Boolean! non-null Whether the merchandise is a gift card. * requires​Shipping Boolean! non-null Whether the item needs to be shipped to the customer. For example, a digital gift card doesn't need to be shipped, but a t-shirt does need to be shipped. * title String! non-null The localized name for the product that displays to customers. The title is used to construct the product's handle, which is a unique, human-readable string of the product's title. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * weight Float The product variant's weight, in the system of measurement set in the `weightUnit` field. * weight​Unit Weight​Unit! non-null The unit of measurement for weight. * GRAMS, KILOGRAMS, OUNCES, POUNDS * Product​Variant OBJECT A specific version of a product that comes in more than one option, such as size or color. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another. * id ID! non-null A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the product variant. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * product Product! non-null The product associated with the product variant. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another. The product associated with the product variant would be the t-shirt itself. * handle Handle! non-null A unique, human-readable string of the product's title. A handle can contain letters, hyphens (`-`), and numbers, but not spaces. The handle is used in the online store URL for the product. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * has​Any​Tag Boolean! non-null Whether the product is associated with any of the specified tags. The product must have at least one tag from the list to return `true`. * tags \[String!]! requiredDefault:\[] ### Arguments A comma-separated list of searchable keywords that are associated with the product. For example, `"sports, summer"` returns products with either the `sports` or `summer` tag. *** * has​Tags \[Has​Tag​Response!]! non-null Whether the product is associated with the specified tags. * tags \[String!]! requiredDefault:\[] ### Arguments A comma-separated list of searchable keywords that are associated with the product. For example, `"sports, summer"` returns products with both the `sports` and `summer` tags. *** * has​Tag Boolean! non-null ### Fields Whether the Shopify resource has the tag. * tag String! non-null A searchable keyword that's associated with a Shopify resource, such as a product or customer. For example, a merchant might apply the `sports` and `summer` tags to products that are associated with sportswear for summer. * id ID! non-null A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the product. * in​Any​Collection Boolean! non-null Whether the product is in any of the specified collections. The product must be in at least one collection from the list to return `true`. A collection is a group of products that can be displayed in online stores and other sales channels in categories, which makes it easy for customers to find them. For example, an athletics store might create different collections for running attire and accessories. * ids \[ID!]! requiredDefault:\[] ### Arguments A comma-separated list of [globally-unique collection IDs](https://shopify.dev/docs/api/usage/gids) that are associated with the product. For example, `gid://shopify/Collection/123`, `gid://shopify/Collection/456`. *** * in​Collections \[Collection​Membership!]! non-null Whether the product is in the specified collections. The product must be in all of the collections in the list to return `true`. A collection is a group of products that can be displayed in online stores and other sales channels in categories, which makes it easy for customers to find them. For example, an athletics store might create different collections for running attire and accessories. * ids \[ID!]! requiredDefault:\[] ### Arguments A comma-separated list of [globally-unique collection IDs](https://shopify.dev/docs/api/usage/gids) that are associated with the product. For example, `gid://shopify/Collection/123`, `gid://shopify/Collection/456`. *** * collection​Id ID! non-null ### Fields A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the collection. * is​Member Boolean! non-null Whether the product is in the specified collection. * is​Gift​Card Boolean! non-null Whether the product is a gift card. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * product​Type String A custom category for a product. Product types allow merchants to define categories other than the ones available in Shopify's [standard product categories](https://help.shopify.com/manual/products/details/product-type). * title String! non-null The localized name for the product that displays to customers. The title is used to construct the product's handle, which is a unique, human-readable string of the product's title. For example, if a product is titled "Black Sunglasses", then the handle is `black-sunglasses`. * vendor String The name of the product's vendor. * requires​Shipping Boolean! non-null Whether the item needs to be shipped to the customer. For example, a digital gift card doesn't need to be shipped, but a t-shirt does need to be shipped. * sku String A case-sensitive identifier for the product variant in the merchant's store. For example, `"BBC-1"`. A product variant must have a SKU to be connected to a [fulfillment service](https://shopify.dev/docs/apps/build/orders-fulfillment/fulfillment-service-apps/build-for-fulfillment-services). * title String The localized name for the product variant that displays to customers. * weight Float The product variant's weight, in the system of measurement set in the `weightUnit` field. * weight​Unit Weight​Unit! non-null The unit of measurement for weight. * GRAMS, KILOGRAMS, OUNCES, POUNDS * quantity Int! non-null The quantity of the item that the customer intends to purchase. * selling​Plan​Allocation Selling​Plan​Allocation The [selling plan](https://shopify.dev/docs/apps/build/purchase-options/subscriptions/selling-plans) associated with the cart line, including information about how a product variant can be sold and purchased. * price​Adjustments \[Selling​Plan​Allocation​Price​Adjustment!]! non-null A list of price adjustments, with a maximum of two. When there are two, the first price adjustment goes into effect at the time of purchase, while the second one starts after a certain number of orders. A price adjustment represents how a selling plan affects pricing when a variant is purchased with a selling plan. Prices display in the customer's currency if the shop is configured for it. * per​Delivery​Price Money​V2! non-null The effective price for a single delivery. For example, for a prepaid subscription plan that includes 6 deliveries at the price of $48.00, the per delivery price is $8.00. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * price Money​V2! non-null The price of the variant when it's purchased with a selling plan For example, for a prepaid subscription plan that includes 6 deliveries of $10.00 granola, where the customer gets 20% off, the price is 6 x $10.00 x 0.80 = $48.00. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * selling​Plan Selling​Plan! non-null A representation of how products and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of prepaid granola, delivered weekly'. * description String The description of the selling plan. * id ID! non-null A globally-unique identifier. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * name String! non-null The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'. * recurring​Deliveries Boolean! non-null Whether purchasing the selling plan will result in multiple deliveries. * delivery​Address Mailing​Address The shipping or destination address associated with the delivery group. * address1 String The first line of the address. Typically the street address or PO Box number. * address2 String The second line of the address. Typically the number of the apartment, suite, or unit. * city String The name of the city, district, village, or town. * company String The name of the customer's company or organization. * country​Code Country​Code The two-letter code for the country of the address. For example, US. * AC, AD, AE, AF, AG, AI, AL, AM, AN, AO, AR, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MK, ML, MM, MN, MO, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PS, PT, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TA, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VN, VU, WF, WS, XK, YE, YT, ZA, ZM, ZW, ZZ * first​Name String The first name of the customer. * last​Name String The last name of the customer. * latitude Float The approximate latitude of the address. * longitude Float The approximate longitude of the address. * name String The full name of the customer, based on firstName and lastName. * phone String A unique phone number for the customer. Formatted using E.164 standard. For example, +16135551111. * province​Code String The alphanumeric code for the region. For example, ON. * zip String The zip or postal code of the address. * market Market Deprecated * handle Handle! non-null A human-readable unique string for the market automatically generated from its title. * id ID! non-null A globally-unique identifier. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * regions \[Market​Region!]! non-null A geographic region which comprises a market. * name String The name of the region in the language of the current localization. * delivery​Options \[Cart​Delivery​Option!]! non-null The delivery options available for the delivery group. Delivery options are the different ways that customers can choose to have their orders shipped. Examples include express shipping or standard shipping. * code String A unique identifier that represents the delivery option offered to customers. For example, `Canada Post Expedited`. * cost Money​V2! non-null The amount that the customer pays if they select the delivery option. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * delivery​Method​Type Delivery​Method! non-null The delivery method associated with the delivery option. A delivery method is a way that merchants can fulfill orders from their online stores. Delivery methods include shipping to an address, [local pickup](https://help.shopify.com/manual/fulfillment/setup/delivery-methods/pickup-in-store), and shipping to a [pickup point](https://help.shopify.com/manual/fulfillment/shopify-shipping/pickup-points), all of which are natively supported by Shopify checkout. * LOCAL, NONE, PICK_UP, PICKUP_POINT, RETAIL, SHIPPING * description String A single-line description of the delivery option, with HTML tags removed. * handle Handle! non-null A unique, human-readable identifier of the delivery option's title. A handle can contain letters, hyphens (`-`), and numbers, but not spaces. For example, `standard-shipping`. * title String The name of the delivery option that displays to customers. The title is used to construct the delivery option's handle. For example, if a delivery option is titled "Standard Shipping", then the handle is `standard-shipping`. * group​Type Cart​Delivery​Group​Type! non-null The type of merchandise in the delivery group. * ONE_TIME_PURCHASE, SUBSCRIPTION * id ID! non-null A [globally-unique ID](https://shopify.dev/docs/api/usage/gids) for the delivery group. * selected​Delivery​Option Cart​Delivery​Option Information about the delivery option that the customer has selected. * code String A unique identifier that represents the delivery option offered to customers. For example, `Canada Post Expedited`. * cost Money​V2! non-null The amount that the customer pays if they select the delivery option. * amount Decimal! non-null A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99. * currency​Code Currency​Code! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard [standard ISO 4217 codes](https://en.wikipedia.org/wiki/ISO_4217), legacy codes, and non-standard codes. For example, USD. * AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF * delivery​Method​Type Delivery​Method! non-null The delivery method associated with the delivery option. A delivery method is a way that merchants can fulfill orders from their online stores. Delivery methods include shipping to an address, [local pickup](https://help.shopify.com/manual/fulfillment/setup/delivery-methods/pickup-in-store), and shipping to a [pickup point](https://help.shopify.com/manual/fulfillment/shopify-shipping/pickup-points), all of which are natively supported by Shopify checkout. * LOCAL, NONE, PICK_UP, PICKUP_POINT, RETAIL, SHIPPING * description String A single-line description of the delivery option, with HTML tags removed. * handle Handle! non-null A unique, human-readable identifier of the delivery option's title. A handle can contain letters, hyphens (`-`), and numbers, but not spaces. For example, `standard-shipping`. * title String The name of the delivery option that displays to customers. The title is used to construct the delivery option's handle. For example, if a delivery option is titled "Standard Shipping", then the handle is `standard-shipping`. * id ID! non-nullDeprecated * localization Localization! non-null The regional and language settings that determine how the Function handles currency, numbers, dates, and other locale-specific values during discount calculations. These settings are based on the store's configured [localization practices](https://shopify.dev/docs/apps/build/functions/localization-practices-shopify-functions). * country Country! non-null The country for which the store is customized, reflecting local preferences and regulations. Localization might influence the language, currency, and product offerings available in a store to enhance the shopping experience for customers in that region. * iso​Code Country​Code! non-null The ISO code of the country. * AC, AD, AE, AF, AG, AI, AL, AM, AN, AO, AR, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MK, ML, MM, MN, MO, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PS, PT, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TA, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VN, VU, WF, WS, XK, YE, YT, ZA, ZM, ZW, ZZ * language Language! non-null The language for which the store is customized, ensuring content is tailored to local customers. This includes product descriptions and customer communications that resonate with the target audience. * iso​Code Language​Code! non-null The ISO code. * AF, AK, AM, AR, AS, AZ, BE, BG, BM, BN, BO, BR, BS, CA, CE, CKB, CS, CU, CY, DA, DE, DZ, EE, EL, EN, EO, ES, ET, EU, FA, FF, FI, FIL, FO, FR, FY, GA, GD, GL, GU, GV, HA, HE, HI, HR, HU, HY, IA, ID, IG, II, IS, IT, JA, JV, KA, KI, KK, KL, KM, KN, KO, KS, KU, KW, KY, LB, LG, LN, LO, LT, LU, LV, MG, MI, MK, ML, MN, MR, MS, MT, MY, NB, ND, NE, NL, NN, NO, OM, OR, OS, PA, PL, PS, PT, PT_BR, PT_PT, QU, RM, RN, RO, RU, RW, SA, SC, SD, SE, SG, SI, SK, SL, SN, SO, SQ, SR, SU, SV, SW, TA, TE, TG, TH, TI, TK, TO, TR, TT, UG, UK, UR, UZ, VI, VO, WO, XH, YI, YO, ZH, ZH_CN, ZH_TW, ZU * market Market! non-nullDeprecated * handle Handle! non-null A human-readable unique string for the market automatically generated from its title. * id ID! non-null A globally-unique identifier. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * regions \[Market​Region!]! non-null A geographic region which comprises a market. * name String The name of the region in the language of the current localization. * location​Rule Order​Routing​Location​Rule! non-null The backend logic that the Function uses to [route orders](https://help.shopify.com/manual/fulfillment/setup/order-routing/understanding-order-routing). It includes the [metafields](https://shopify.dev/docs/apps/build/custom-data) that are associated with the customization. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * locations \[Location!]! non-null A list of all geographical locations where the inventory is stored, including warehouses, retail locations, and distribution centers. The list captures the locations that can fulfill items in the cart. * address Location​Address! non-null The address of this location. * address1 String The first line of the address for the location. * address2 String The second line of the address for the location. * city String The city of the location. * country String The country of the location. * country​Code String The country code of the location. * formatted \[String!]! non-null A formatted version of the address for the location. * latitude Float The approximate latitude coordinates of the location. * longitude Float The approximate longitude coordinates of the location. * phone String The phone number of the location. * province String The province of the location. * province​Code String The code for the province, state, or district of the address of the location. * zip String The ZIP code of the location. * handle Handle! non-null The location handle. * id ID! non-null The location id. * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). * name String! non-null The name of the location. * presentment​Currency​Rate Decimal! non-null The exchange rate used to convert discounts between the shop's default currency and the currency that displays to the customer during checkout. For example, if a store operates in USD but a customer is viewing discounts in EUR, then the presentment currency rate handles this conversion for accurate pricing. * shop Shop! non-null Information about the shop where the Function is running, including the shop's timezone setting and associated [metafields](https://shopify.dev/docs/apps/build/custom-data). * local​Time Local​Time! non-null The current time based on the [store's timezone setting](https://help.shopify.com/manual/intro-to-shopify/initial-setup/setup-business-settings). * date Date! non-null The current date relative to the parent object. * date​Time​After Boolean! non-null Returns true if the current date and time is at or past the given date and time, and false otherwise. * date​Time Date​Time​Without​Timezone! required ### Arguments The date and time to compare against, assumed to be in the timezone of the parent object. *** * date​Time​Before Boolean! non-null Returns true if the current date and time is before the given date and time, and false otherwise. * date​Time Date​Time​Without​Timezone! required ### Arguments The date and time to compare against, assumed to be in the timezone of the parent timezone. *** * date​Time​Between Boolean! non-null Returns true if the current date and time is between the two given date and times, and false otherwise. * start​Date​Time Date​Time​Without​Timezone! required ### Arguments The lower bound time to compare against, assumed to be in the timezone of the parent timezone. * end​Date​Time Date​Time​Without​Timezone! required The upper bound time to compare against, assumed to be in the timezone of the parent timezone. *** * time​After Boolean! non-null Returns true if the current time is at or past the given time, and false otherwise. * time Time​Without​Timezone! required ### Arguments The time to compare against, assumed to be in the timezone of the parent timezone. *** * time​Before Boolean! non-null Returns true if the current time is at or past the given time, and false otherwise. * time Time​Without​Timezone! required ### Arguments The time to compare against, assumed to be in the timezone of the parent timezone. *** * time​Between Boolean! non-null Returns true if the current time is between the two given times, and false otherwise. * start​Time Time​Without​Timezone! required ### Arguments The lower bound time to compare against, assumed to be in the timezone of the parent timezone. * end​Time Time​Without​Timezone! required The upper bound time to compare against, assumed to be in the timezone of the parent timezone. *** * metafield Metafield 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. * namespace String ### Arguments 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. * key String! required The unique identifier for the metafield within its namespace. A metafield is composed of a namespace and a key, in the format `namespace.key`. *** * json​Value JSON! non-null ### Fields The data that's stored in the metafield, using JSON format. * type String! non-null The [type of data](https://shopify.dev/apps/metafields/types) that the metafield stores in the `value` field. * value String! non-null The data that's stored in the metafield. The data is always stored as a string, regardless of the [metafield's type](https://shopify.dev/apps/metafields/types). #### Run function The logic that processes the input data. The function generates a list of operations that rank locations. Each location is associated with a fulfillment group. Each operation specifies how to rank locations. Shopify processes your response to determine how to best fulfill and ship orders. This return must follow the schema defined in the `CartFulfillmentGroupsLocationRankingsGenerateRunResult` object. * Cart​Fulfillment​Groups​Location​Rankings​Generate​Run​Result OBJECT The `CartFulfillmentGroupsLocationRankingsGenerateRunResult` object is the output of the function run target. The object contains the operations that rank locations for each fulfillment group. * operations \[Operation!]! non-null The ordered list of operations that rank locations for each fulfillment group, which includes one or more items to be shipped together. The locations with the highest ranking are selected to fulfill the order. * fulfillment​Group​Location​Ranking​Add Fulfillment​Group​Location​Ranking​Add​Operation A request to rank the locations associated with a fulfillment group. The ranking determines the priority in which the locations are selected to fulfill the order. * fulfillment​Group​Handle Handle! non-null The identifier for the fulfillment group. * rankings \[Ranked​Location!]! non-null The ranked locations for this fulfillment group. * location​Handle Handle! non-null The location handle. * rank Int! non-null The location's rank. Examples * ### Create a location priority rule for perishable products This function will prioritize locations that have a metafield `is_perishable` if there is a product with the tag `perishable`. The function demonstrates how to: \* Read a location metafield \* Read a product tag \* Prioritize locations based on the metafield and tag \* Change the ranking of the locations #### cart.fulfillment-groups.location-rankings.generate.run ##### Input Query ```graphql query Input { fulfillmentGroups { handle inventoryLocationHandles lines { merchandise { __typename ... on ProductVariant { product { id hasTags(tags: ["perishable"]) { hasTag tag } } } } } } locations { handle metafield(namespace: "custom", key: "is_perishable") { jsonValue } } } ``` ##### Input Object ```json { "fulfillmentGroups": [ { "handle": "1", "inventoryLocationHandles": [ "91260846373", "91260879141" ], "lines": [ { "merchandise": { "__typename": "ProductVariant", "product": { "id": "gid://shopify/Product/9837211844901", "hasTags": [ { "hasTag": true, "tag": "perishable" } ] } } } ] } ], "locations": [ { "handle": "91260846373", "metafield": { "jsonValue": { "isPerishable": true } } }, { "handle": "91260879141", "metafield": null } ] } ``` ##### Function Code (Rust) ```rust use crate::schema; use shopify_function::prelude::*; use shopify_function::Result; use std::collections::HashMap; #[derive(Deserialize, PartialEq)] #[shopify_function(rename_all = "camelCase")] pub struct Configuration { is_perishable: bool, } #[shopify_function] fn cart_fulfillment_groups_location_rankings_generate_run( input: schema::cart_fulfillment_groups_location_rankings_generate_run::Input, ) -> Result { // Create a map of location handles to their perishable status let mut perishable_locations = HashMap::new(); for location in input.locations() { let is_perishable = match &location.metafield() { Some(metafield) => { let config: &Configuration = metafield.json_value(); config.is_perishable } None => false, }; perishable_locations.insert(location.handle().clone(), is_perishable); } let operations = input .fulfillment_groups() .iter() .map(|group| { // Check if any products in this group have the perishable tag let has_perishable_product = group .lines() .iter() .filter_map(|line| { match &line.merchandise() { schema::cart_fulfillment_groups_location_rankings_generate_run::input::fulfillment_groups::lines::Merchandise::ProductVariant(variant) => { Some(variant.product()) }, _ => None, } }) .any(|product| { product.has_tags().iter().any(|tag_resp| *tag_resp.has_tag()) }); let rankings = group .inventory_location_handles() .iter() .map(|location_handle| { let mut rank = 0; // If we have perishable products, prioritize locations with perishable:true metafield if has_perishable_product { // Locations that can handle perishables get rank 0, others get rank 1 (lower priority) if let Some(is_perishable_location) = perishable_locations.get(location_handle) { if !is_perishable_location { rank = 1; // Deprioritize locations that can't handle perishables } } else { rank = 1; // If location not found in our map, deprioritize it } } schema::RankedLocation { location_handle: location_handle.clone(), rank, } }) .collect::>(); schema::Operation::FulfillmentGroupLocationRankingAdd(schema::FulfillmentGroupLocationRankingAddOperation { fulfillment_group_handle: group.handle().clone(), rankings, }) }) .collect(); Ok(schema::CartFulfillmentGroupsLocationRankingsGenerateRunResult { operations }) } ``` ##### Function Code (JavaScript) ```javascript // @ts-check /** * @typedef {import("../generated/api").RunInput} RunInput * @typedef {import("../generated/api").CartFulfillmentGroupsLocationRankingsGenerateRunResult} CartFulfillmentGroupsLocationRankingsGenerateRunResult */ /** * @param {RunInput} input * @returns {CartFulfillmentGroupsLocationRankingsGenerateRunResult} */ export function cartFulfillmentGroupsLocationRankingsGenerateRun(input) { // Create a map of location handles to their perishable status const perishableLocations = new Map(); if (input.locations) { input.locations.forEach(location => { let isPerishable = false; if (location.metafield && location.metafield.jsonValue) { try { // Handle both string JSON and already parsed objects const metafieldValue = typeof location.metafield.jsonValue === 'string' ? JSON.parse(location.metafield.jsonValue) : location.metafield.jsonValue; // Check for isPerishable (camelCase) isPerishable = metafieldValue.isPerishable === true; } catch (error) { // If parsing fails, assume the location is not perishable isPerishable = false; } } perishableLocations.set(location.handle, isPerishable); }); } const operations = input.fulfillmentGroups.map((group) => { // Check if any products in this group have the perishable tag const hasPerishableProduct = (group.lines || []).some(line => line.merchandise && line.merchandise.__typename === "ProductVariant" && line.merchandise.product && Array.isArray(line.merchandise.product.hasTags) && line.merchandise.product.hasTags.some(tagResp => tagResp.hasTag) ); const rankings = (group.inventoryLocationHandles || []).map((inventoryLocationHandle) => { let rank = 0; // If we have perishable products, prioritize locations with perishable:true metafield if (hasPerishableProduct) { // Locations that can handle perishables get rank 0, others get rank 1 (lower priority) const isPerishableLocation = perishableLocations.get(inventoryLocationHandle) || false; if (!isPerishableLocation) { // Deprioritize locations that can't handle perishables rank = 1; } } return { locationHandle: inventoryLocationHandle, rank, }; }); return { fulfillmentGroupLocationRankingAdd: { fulfillmentGroupHandle: group.handle, rankings, }, }; }); return {operations}; }; ``` ##### Output JSON ```json { "operations": [ { "fulfillmentGroupLocationRankingAdd": { "fulfillmentGroupHandle": "1", "rankings": [ { "locationHandle": "91260846373", "rank": 0 }, { "locationHandle": "91260879141", "rank": 1 } ] } } ] } ``` * ### Deprioritize fulfillment locations for age-restricted products This function will deprioritize a location if there is a product with the tag '21 year plus'. The function demonstrates how to: - Read a product tag - Deprioritize locations based on the tag - Change the ranking of the locations #### cart.fulfillment-groups.location-rankings.generate.run ##### Input Query ```graphql query Input { fulfillmentGroups { handle inventoryLocationHandles lines { merchandise { __typename ... on ProductVariant { product { id hasTags(tags: ["21 year plus"]) { hasTag tag } } } } } } } ``` ##### Input Object ```json { "fulfillmentGroups": [ { "handle": "group1", "inventoryLocationHandles": [ "AGE_RESTRICTED_LOCATION_HANDLE" ], "lines": [ { "merchandise": { "__typename": "ProductVariant", "product": { "id": "p1", "hasTags": [ { "hasTag": true, "tag": "21 year plus" } ] } } } ] }, { "handle": "group2", "inventoryLocationHandles": [ "OTHER_LOCATION" ], "lines": [ { "merchandise": { "__typename": "ProductVariant", "product": { "id": "p2", "hasTags": [ { "hasTag": false, "tag": "21 year plus" } ] } } } ] } ] } ``` ##### Function Code (Rust) ```rust use crate::schema; use shopify_function::prelude::*; use shopify_function::Result; // Set the deprioritized location handle here for now const DEPRIORITIZED_LOCATION_HANDLE: &str = "AGE_RESTRICTED_LOCATION_HANDLE"; #[shopify_function] fn cart_fulfillment_groups_location_rankings_generate_run( input: schema::cart_fulfillment_groups_location_rankings_generate_run::Input, ) -> Result { // Check if any product in any line has the '21 year plus' tag let has_21_year_plus = input .fulfillment_groups() .iter() .flat_map(|group| group.lines()) .filter_map(|line| { if let schema::cart_fulfillment_groups_location_rankings_generate_run::input::fulfillment_groups::lines::Merchandise::ProductVariant(variant) = &line.merchandise() { Some(variant) } else { None } }) .any(|variant| { variant .product() .has_tags() .iter() .any(|tag_resp| *tag_resp.has_tag() && tag_resp.tag() == "21 year plus") }); let operations = input .fulfillment_groups() .iter() .map(|group| { let rankings = group .inventory_location_handles() .iter() .map(|location_handle| { let mut rank = 0; if has_21_year_plus && location_handle == DEPRIORITIZED_LOCATION_HANDLE { rank = 1; // Deprioritize by setting a higher rank } schema::RankedLocation { location_handle: location_handle.clone(), rank, } }) .collect::>(); schema::Operation::FulfillmentGroupLocationRankingAdd( schema::FulfillmentGroupLocationRankingAddOperation { fulfillment_group_handle: group.handle().clone(), rankings, }, ) }) .collect(); Ok(schema::CartFulfillmentGroupsLocationRankingsGenerateRunResult { operations }) } ``` ##### Function Code (JavaScript) ```javascript ``` ##### Output JSON ```json { "operations": [ { "fulfillmentGroupLocationRankingAdd": { "fulfillmentGroupHandle": "group1", "rankings": [ { "locationHandle": "AGE_RESTRICTED_LOCATION_HANDLE", "rank": 1 } ] } }, { "fulfillmentGroupLocationRankingAdd": { "fulfillmentGroupHandle": "group2", "rankings": [ { "locationHandle": "OTHER_LOCATION", "rank": 0 } ] } } ] } ``` #### cart-fulfillment-groups-location-rankings-generate-run ##### Input Query ```graphql query Input { fulfillmentGroups { handle inventoryLocationHandles lines { merchandise { __typename ... on ProductVariant { product { id hasTags(tags: ["21 year plus"]) { hasTag tag } } } } } } } ``` ##### Input Object ```json { "fulfillmentGroups": [ { "handle": "group1", "inventoryLocationHandles": [ "AGE_RESTRICTED_LOCATION_HANDLE" ], "lines": [ { "merchandise": { "__typename": "ProductVariant", "product": { "id": "p1", "hasTags": [ { "hasTag": true, "tag": "21 year plus" } ] } } } ] }, { "handle": "group2", "inventoryLocationHandles": [ "OTHER_LOCATION" ], "lines": [ { "merchandise": { "__typename": "ProductVariant", "product": { "id": "p2", "hasTags": [ { "hasTag": false, "tag": "21 year plus" } ] } } } ] } ] } ``` ##### Function Code (Rust) ```rust ``` ##### Function Code (JavaScript) ```javascript // @ts-check /** * @typedef {import("../generated/api").Input} Input * @typedef {import("../generated/api").CartFulfillmentGroupsLocationRankingsGenerateRunResult} CartFulfillmentGroupsLocationRankingsGenerateRunResult */ const DEPRIORITIZED_LOCATION_HANDLE = 'AGE_RESTRICTED_LOCATION_HANDLE'; /** * @param {Input} input * @returns {CartFulfillmentGroupsLocationRankingsGenerateRunResult} */ export function cartFulfillmentGroupsLocationRankingsGenerateRun(input) { const has21YearPlus = input.fulfillmentGroups.some((group) => (group.lines || []).some( (line) => line.merchandise && line.merchandise.__typename === 'ProductVariant' && line.merchandise.product && Array.isArray(line.merchandise.product.hasTags) && line.merchandise.product.hasTags.some( (tagResp) => tagResp.hasTag && tagResp.tag === '21 year plus', ), ), ); const operations = input.fulfillmentGroups.map((group) => { const rankings = (group.inventoryLocationHandles || []).map( (inventoryLocationHandle) => { let rank = 0; if ( has21YearPlus && inventoryLocationHandle === DEPRIORITIZED_LOCATION_HANDLE ) { rank = 1; } return { locationHandle: inventoryLocationHandle, rank, }; }, ); return { fulfillmentGroupLocationRankingAdd: { fulfillmentGroupHandle: group.handle, rankings, }, }; }); return {operations}; } ``` ##### Output JSON ```json { "operations": [ { "fulfillmentGroupLocationRankingAdd": { "fulfillmentGroupHandle": "group1", "rankings": [ { "locationHandle": "AGE_RESTRICTED_LOCATION_HANDLE", "rank": 1 } ] } }, { "fulfillmentGroupLocationRankingAdd": { "fulfillmentGroupHandle": "group2", "rankings": [ { "locationHandle": "OTHER_LOCATION", "rank": 0 } ] } } ] } ``` * ### Prioritize locations for B2B orders How to implement an order routing location rule that checks if the order is a B2B order. If it is from a business it prioritizes Locations that accept business orders. We achieve this by: - Checking if `cart.buyerIdentity.purchasingCompany` exists. If it does, it's a B2B order - Checking each Location for a boolean metafield with a namespace of `routing` and key of `acceptsb2b`. - if it's a B2B order Locations with that metafield are assigned a rank of 1, otherwise they get a rank of 0. You can use this example to understand: - How to create an order routing location function. - How to check a metafield value on a location in an order routing location rule - How to check if an order is a froma business and should be treated as B2B - How to order locations - How to check if an order is B2B or B2C #### cart.fulfillment-groups.location-rankings.generate.run ##### Input Query ```graphql query Input { cart { # This is optional buyerIdentity { # This is optional: If it's present, we assume it's a B2B order purchasingCompany { company { id } } } } fulfillmentGroups { handle inventoryLocationHandles } locations { handle # Assume a Location metafield # Namespace and key is routing.acceptsb2b # The value is a boolean in this example metafield(namespace: "routing", key: "acceptsb2b") { value } } } ``` ##### Input Object ```json { "cart": { "buyerIdentity": { "purchasingCompany": { "company": { "id": "123" } } } }, "fulfillmentGroups": [ { "handle": "1", "inventoryLocationHandles": ["75667898613", "66494595317"] } ], "locations": [ { "handle": "75667898613", "metafield": { "value": "false" } }, { "handle": "66494595317", "metafield": { "value": "true" } } ] } ``` ##### Function Code (Rust) ```rust use crate::schema; use shopify_function::prelude::*; use shopify_function::Result; #[shopify_function] fn cart_fulfillment_groups_location_rankings_generate_run( input: schema::cart_fulfillment_groups_location_rankings_generate_run::Input, ) -> Result { // Is the order a B2B order? let mut is_b2b_order = false; // Check if this is a B2B order by looking for buyer identity, purchasing company, etc. if let Some(buyer_identity) = &input.cart().buyer_identity() { if let Some(_purchasing_company) = &buyer_identity.purchasing_company() { // We have a B2B order if we get this far in the graph is_b2b_order = true; } } let operations = input .fulfillment_groups() .iter() .map(|group| { let rankings = group .inventory_location_handles() .iter() .map(|location_handle| { // Default rank is 0 let mut rank = 0; // Only process B2B orders differently if is_b2b_order { // Find the location that matches this handle for location in input.locations() { if *location.handle() == *location_handle { // Set higher rank if this location accepts B2B if let Some(metafield) = &location.metafield() { if *metafield.value() == "true" { rank = 1; break; } } } } } schema::RankedLocation { location_handle: location_handle.clone(), rank, } }) .collect::>(); schema::Operation::FulfillmentGroupLocationRankingAdd( schema::FulfillmentGroupLocationRankingAddOperation { fulfillment_group_handle: group.handle().clone(), rankings, }, ) }) .collect(); Ok(schema::CartFulfillmentGroupsLocationRankingsGenerateRunResult { operations }) } ``` ##### Function Code (JavaScript) ```javascript // @ts-check /** * @typedef {import("../generated/api").RunInput} RunInput * @typedef {import("../generated/api").CartFulfillmentGroupsLocationRankingsGenerateRunResult} CartFulfillmentGroupsLocationRankingsGenerateRunResult */ /** * @param {RunInput} input * @returns {CartFulfillmentGroupsLocationRankingsGenerateRunResult} */ export function cartFulfillmentGroupsLocationRankingsGenerateRun(input) { // Is the order a B2B order? const isB2BOrder = input.cart?.buyerIdentity?.purchasingCompany?.company?.id; const operations = input.fulfillmentGroups.map((group) => { const rankings = group.inventoryLocationHandles?.map((locationHandle) => { // Default rank is 0 let rank = 0; // Only process B2B orders differently if (isB2BOrder) { // Find the location that matches this handle const location = input.locations?.find( ({ handle }) => handle === locationHandle ); // Set higher rank if this location accepts B2B if (location?.metafield?.value === "true") { rank = 1; } } return { locationHandle, rank }; }) || []; return { fulfillmentGroupLocationRankingAdd: { fulfillmentGroupHandle: group.handle, rankings, }, }; }); return { operations }; } ``` ##### Output JSON ```json { "operations": [ { "fulfillmentGroupLocationRankingAdd": { "fulfillmentGroupHandle": "1", "rankings": [ { "locationHandle": "75667898613", "rank": 0 }, { "locationHandle": "66494595317", "rank": 1 } ] } } ] } ``` * ### Prioritize locations based on delivery address This function will prioritize locations that are in the same province as the delivery address. The function demonstrates how to: \* Read the delivery address \* Prioritize locations based on the delivery address \* Change the ranking of the locations #### cart.fulfillment-groups.location-rankings.generate.run ##### Input Query ```graphql query Input { fulfillmentGroups { handle inventoryLocationHandles deliveryAddress { provinceCode } } locations { handle address { countryCode provinceCode } } } ``` ##### Input Object ```json { "fulfillmentGroups": [ { "handle": "1", "inventoryLocationHandles": [ "91260846373", "91260879141" ], "deliveryAddress": { "provinceCode": "ON" } } ], "locations": [ { "handle": "91260846373", "address": { "countryCode": "CA", "provinceCode": "ON" } }, { "handle": "91260879141", "address": { "countryCode": "CA", "provinceCode": "ON" } } ] } ``` ##### Function Code (Rust) ```rust use crate::schema; use shopify_function::prelude::*; use shopify_function::Result; #[shopify_function] fn cart_fulfillment_groups_location_rankings_generate_run( input: schema::cart_fulfillment_groups_location_rankings_generate_run::Input, ) -> Result { let operations = input .fulfillment_groups() .iter() .map(|group| { // Get the province code for this specific fulfillment group let group_province_code = group .delivery_address() .as_ref() .and_then(|addr| addr.province_code()) .map(|code| code.to_lowercase()) .unwrap_or_default(); let rankings = group .inventory_location_handles() .iter() .map(|inventory_location_handle| { let mut rank = 0; // Find the location details from the list of locations let location_details = input .locations() .iter() .find(|loc| loc.handle() == inventory_location_handle); // Get the location's province code let location_province_code = location_details .and_then(|loc| { // Address is a direct field, not an Option loc.address() .province_code() .as_ref() .map(|code| code.to_lowercase()) }) .unwrap_or_default(); // If we have both province codes and they don't match, deprioritize the location if !group_province_code.is_empty() && !location_province_code.is_empty() && location_province_code != group_province_code { // Deprioritize locations not in the same province as this fulfillment group rank = 1; } schema::RankedLocation { location_handle: inventory_location_handle.clone(), rank, } }) .collect::>(); schema::Operation::FulfillmentGroupLocationRankingAdd( schema::FulfillmentGroupLocationRankingAddOperation { fulfillment_group_handle: group.handle().clone(), rankings, }, ) }) .collect(); Ok(schema::CartFulfillmentGroupsLocationRankingsGenerateRunResult { operations }) } ``` ##### Function Code (JavaScript) ```javascript // @ts-check /** * @typedef {import("../generated/api").RunInput} RunInput * @typedef {import("../generated/api").CartFulfillmentGroupsLocationRankingsGenerateRunResult} CartFulfillmentGroupsLocationRankingsGenerateRunResult */ /** * @param {RunInput} input * @returns {CartFulfillmentGroupsLocationRankingsGenerateRunResult} */ export function cartFulfillmentGroupsLocationRankingsGenerateRun(input) { const operations = input.fulfillmentGroups.map((group) => { // Get the province code for this specific fulfillment group const groupProvinceCode = group.deliveryAddress?.provinceCode?.toLowerCase() || ''; const rankings = (group.inventoryLocationHandles || []).map((inventoryLocationHandle) => { let rank = 0; // Find the location details from the list of locations const locationDetails = input.locations?.find(loc => loc.handle === inventoryLocationHandle); // Get the location's province code const locationProvinceCode = locationDetails?.address?.provinceCode?.toLowerCase() || ''; // If we have both province codes and they don't match, deprioritize the location if (groupProvinceCode && locationProvinceCode && locationProvinceCode !== groupProvinceCode) { // Deprioritize locations not in the same province as this fulfillment group rank = 1; } return { locationHandle: inventoryLocationHandle, rank, }; }); return { fulfillmentGroupLocationRankingAdd: { fulfillmentGroupHandle: group.handle, rankings, }, }; }); return {operations}; }; ``` ##### Output JSON ```json { "operations": [ { "fulfillmentGroupLocationRankingAdd": { "fulfillmentGroupHandle": "1", "rankings": [ { "locationHandle": "91260846373", "rank": 0 }, { "locationHandle": "91260879141", "rank": 0 } ] } } ] } ``` *** ## How fulfillment groups are ranked For each fulfillment group, Shopify first sorts the output of each function based on the `locationRule` priority. Shopify then takes the first output, and sorts the locations of the fulfillment group based on the rank. If there are ties between the rankings, then Shopify breaks them using the ranks from the second output, and so on. If there are no ties, then only the output of the first `locationRule` is considered. *** ## Additional resources Explore comprehensive guides and references to help you build, deploy, and optimize your Shopify Functions. ### Working with Functions These guides cover essential concepts for building Shopify Functions effectively. Learn how functions process data, execute during checkout, and handle versioning, localization, and external APIs. [![](https://shopify.dev/images/icons/48/pickaxe-3.png)![](https://shopify.dev/images/icons/48/pickaxe-3-dark.png)](https://shopify.dev/docs/api/functions/current#function-anatomy) [Function anatomy](https://shopify.dev/docs/api/functions/current#function-anatomy) [Explore how functions process input data and generate operations.](https://shopify.dev/docs/api/functions/current#function-anatomy) [![](https://shopify.dev/images/icons/48/hearts.png)![](https://shopify.dev/images/icons/48/hearts-dark.png)](https://shopify.dev/docs/api/functions/current#function-execution-order-in-checkout) [Execution order in checkout](https://shopify.dev/docs/api/functions/current#function-execution-order-in-checkout) [Learn when Function APIs execute during the checkout process.](https://shopify.dev/docs/api/functions/current#function-execution-order-in-checkout) [![](https://shopify.dev/images/icons/48/graphql.png)![](https://shopify.dev/images/icons/48/graphql-dark.png)](https://shopify.dev/docs/api/functions/current#graphql-schema-and-versioning) [Schema and versioning](https://shopify.dev/docs/api/functions/current#graphql-schema-and-versioning) [Understand schema versioning, release and upgrade requirements.](https://shopify.dev/docs/api/functions/current#graphql-schema-and-versioning) [![](https://shopify.dev/images/icons/48/growth.png)![](https://shopify.dev/images/icons/48/growth-dark.png)](https://shopify.dev/docs/api/functions/current#api-availability) [API availability](https://shopify.dev/docs/api/functions/current#api-availability) [Check which Shopify plans support functions in custom apps.](https://shopify.dev/docs/api/functions/current#api-availability) [![](https://shopify.dev/images/icons/48/globe.png)![](https://shopify.dev/images/icons/48/globe-dark.png)](https://shopify.dev/docs/apps/build/functions/localization-practices-shopify-functions) [Localization practices](https://shopify.dev/docs/apps/build/functions/localization-practices-shopify-functions) [Localize functions for international markets.](https://shopify.dev/docs/apps/build/functions/localization-practices-shopify-functions) ### Performance and troubleshooting Optimize function performance and ensure reliable operation from development through production deployment. [![](https://shopify.dev/images/icons/48/gear.png)![](https://shopify.dev/images/icons/48/gear-dark.png)](https://shopify.dev/docs/api/functions/current#resource-limits-and-performance) [Resource limits and performance](https://shopify.dev/docs/api/functions/current#resource-limits-and-performance) [Understand function performance requirements and resource limitations for optimal execution.](https://shopify.dev/docs/api/functions/current#resource-limits-and-performance) [![](https://shopify.dev/images/icons/48/industries.png)![](https://shopify.dev/images/icons/48/industries-dark.png)](https://shopify.dev/docs/apps/build/functions/test-debug-functions) [Test and debug Shopify Functions](https://shopify.dev/docs/apps/build/functions/test-debug-functions) [Explore comprehensive testing workflows from local development to production deployment.](https://shopify.dev/docs/apps/build/functions/test-debug-functions) [![](https://shopify.dev/images/icons/48/clicode.png)![](https://shopify.dev/images/icons/48/clicode-dark.png)](https://shopify.dev/docs/apps/build/functions/programming-languages) [Considerations for programming languages](https://shopify.dev/docs/apps/build/functions/programming-languages) [Choose languages that compile to WebAssembly for optimal function performance.](https://shopify.dev/docs/apps/build/functions/programming-languages) [![](https://shopify.dev/images/icons/48/flag.png)![](https://shopify.dev/images/icons/48/flag-dark.png)](https://shopify.dev/docs/apps/build/functions/monitoring-and-errors) [Monitoring and handling errors in production](https://shopify.dev/docs/apps/build/functions/monitoring-and-errors) [Master testing and debugging workflows for reliable function development.](https://shopify.dev/docs/apps/build/functions/monitoring-and-errors)