Anchor to Discount Function APIDiscount Function API
The Discount Function API provides a unified schema for creating Function extensions. A single Function processes one discount (either code-based or automatic), but can apply savings across three discount classes: product, order, and shipping.
For example, one discount can simultaneously reduce both order total and delivery costs.
Shopify Functions enable you to customize Shopify's backend logic. The Discount Function API integrates this logic into the checkout flow.
You can activate a maximum of 25 Discount Functions on each store. All Discount Functions run concurrently, and have no knowledge of each other. The potential discount that a Function outputs can be combined with the candidate from another discount, in alignment with the combination and stacking rules set on the discount node.
Anchor to Use casesUse cases
- Exclusions, where the discount doesn't apply to some cart lines in the order.
- Tiered discounts on products, orders, and shipping when orders include qualifying item, subtotal, and delivery requirements.
- Discount to cartlines that contain specific properties, such as an engraving on a ring.
The fetch target is limited to custom apps installed on Shopify Plus and Enterprise stores. You'll also need to request network access for Functions, as it's not currently available on development stores or in a development preview.
Anchor to Getting startedGetting started
Scaffolding the Function using Shopify CLI automatically configures your TOML file. You can alter the default configuration to customize the way your Function operates.
Anchor to TargetsTargets
A target 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.
You can't configure discount classes from a checkout UI extension.
Discount classes are assigned based on their associated Discount Function targets:
OrderDiscountCandidateTarget
,
ProductDiscountCandidateTarget
, and
DeliveryDiscountCandidateTarget
.
Anchor to Cart run targetCart run target
cart.lines.discounts.generate.run
The run target calculates and applies discounts to cart lines, orders, and shipping based on the provided cart context and discount configuration, including metafields.
When your Function is executed, Shopify provides the cart context as input to the run target, including details about cart lines, prices, quantities, buyer identity, and optionally fetch results from external providers. The target returns an ordered list of operations for calculating discounts.
For example, you might use this to generate product and order discounts, and validate discounts.
- Anchor to InputInputOBJECT
The
Input
object is the complete GraphQL schema that your Function can query as an input to generate discounts. Your Function only receives 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.- Anchor to cartcart•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.
- Anchor to attributeattribute•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.
- •String
The key of the cart attribute to retrieve. For example,
.
Arguments
- •String!non-null
The key or name of the attribute. For example,
.
- Anchor to valuevalue•String
The value of the attribute. For example,
"true"
.
Fields
- •
- Anchor to buyerIdentitybuyer•
Identity BuyerIdentity 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.
- Anchor to customercustomer•Customer
The customer that's interacting with the cart. A customer is a buyer who has an account with the store.
- Anchor to amountSpentamount•
Spent MoneyV2! 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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to displayNamedisplay•
Name String!non-null The full name of the customer, based on the values for
and
. If
and
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.
- Anchor to emailemail•String
The customer's email address.
- Anchor to firstNamefirst•
Name String The customer's first name.
- Anchor to hasAnyTaghas•
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
.- Anchor to hasTagshas•
Tags [HasTag Response!]! non-null Whether the customer is associated with the specified tags. The customer must have all of the tags in the list to return
true
.- •[String!]!required
A comma-separated list of searchable keywords that are associated with the customer. For example,
returns customers with both the
and
Gold
tags.
Arguments
- Anchor to hasTaghas•
Tag Boolean!non-null Whether the Shopify resource has the 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
andsummer
tags to products that are associated with sportswear for summer.
Fields
- •
- •ID!non-null
A globally-unique ID for the customer.
- Anchor to lastNamelast•
Name String The customer's last name.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to numberOfOrdersnumber•
Of Orders Int!non-null The total number of orders that the customer has made at the store.
- Anchor to emailemail•String
The email address of the customer that's interacting with the cart.
- Anchor to isAuthenticatedis•
Authenticated Boolean!non-null Whether the customer is authenticated through their customer account. If the customer is authenticated, then the
customer
field returns the customer's information. If the customer isn't authenticated, then thecustomer
field returnsnull
.- Anchor to phonephone•String
The phone number of the customer that's interacting with the cart.
- Anchor to purchasingCompanypurchasing•
Company PurchasingCompany 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.
- Anchor to companycompany•Company!non-null
The company associated to the order or draft order.
- Anchor to createdAtcreated•
At DateTime! non-null The date and time (ISO 8601 format) at which the company was created in Shopify.
- Anchor to externalIdexternal•
Id String A unique externally-supplied ID for the company.
- •ID!non-null
The ID of the company.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to namename•String!non-null
The name of the company.
- Anchor to updatedAtupdated•
At DateTime! non-null The date and time (ISO 8601 format) at which the company was last modified.
- Anchor to contactcontact•Company
Contact The company contact associated to the order or draft order.
- Anchor to createdAtcreated•
At DateTime! non-null The date and time (ISO 8601 format) at which the company contact was created in Shopify.
- •ID!non-null
The ID of the company.
- Anchor to localelocale•String
The company contact's locale (language).
- Anchor to titletitle•String
The company contact's job title.
- Anchor to updatedAtupdated•
At DateTime! non-null The date and time (ISO 8601 format) at which the company contact was last modified.
- Anchor to locationlocation•Company
Location! non-null The company location associated to the order or draft order.
- Anchor to createdAtcreated•
At DateTime! non-null The date and time (ISO 8601 format) at which the company location was created in Shopify.
- Anchor to externalIdexternal•
Id String A unique externally-supplied ID for the company.
- •ID!non-null
The ID of the company.
- Anchor to localelocale•String
The preferred locale of the company location.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to namename•String!non-null
The name of the company location.
- Anchor to updatedAtupdated•
At DateTime! non-null The date and time (ISO 8601 format) at which the company location was last modified.
- Anchor to costcost•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.
- Anchor to subtotalAmountsubtotal•
Amount MoneyV2! non-null The amount for the customer to pay at checkout, excluding taxes and discounts.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to totalAmounttotal•
Amount MoneyV2! non-null The total amount for the customer to pay at checkout.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to totalDutyAmounttotal•
Duty Amount MoneyV2 The duty charges for a customer to pay at checkout.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to totalTaxAmounttotal•
Tax Amount MoneyV2 The total tax amount for the customer to pay at checkout.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to deliverableLinesdeliverable•
Lines [DeliverableCart Line!]! non-null The items in a cart that are eligible for fulfillment and can be delivered to the customer.
- Anchor to attributeattribute•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
object in Liquid.
- •String
The key of the cart attribute to retrieve. For example,
.
Arguments
- •String!non-null
The key or name of the attribute. For example,
.
- Anchor to valuevalue•String
The value of the attribute. For example,
"true"
.
Fields
- •
- •ID!non-null
The ID of the cart line.
- Anchor to merchandisemerchandise•Merchandise!non-null
The item that the customer intends to purchase.
- Anchor to CustomProduct•OBJECTCustom
Product A custom product represents a product that doesn't map to Shopify's standard product categories. For example, you can use a custom product to manage gift cards, shipping requirements, localized product information, or weight measurements and conversions.
- Anchor to isGiftCardis•
Gift Card Boolean!non-null Whether the merchandise is a gift card.
- Anchor to requiresShippingrequires•
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.
- Anchor to titletitle•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
.- Anchor to weightweight•Float
The product variant's weight, in the system of measurement set in the
field.
- Anchor to weightUnitweight•
Unit WeightUnit! non-null The unit of measurement for weight.
GRAMS, KILOGRAMS, OUNCES, POUNDS
- Anchor to ProductVariant•OBJECTProduct
Variant 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!non-null
A globally-unique ID for the product variant.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to productproduct•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.
- Anchor to handlehandle•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 isblack-sunglasses
.- Anchor to hasAnyTaghas•
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
.- Anchor to hasTagshas•
Tags [HasTag Response!]! non-null Whether the product is associated with the specified tags. The product must have all of the tags in the list to return
true
.- •[String!]!required
A comma-separated list of searchable keywords that are associated with the product. For example,
"sports, summer"
returns products with both thesports
andsummer
tags.
Arguments
- Anchor to hasTaghas•
Tag Boolean!non-null Whether the Shopify resource has the 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
andsummer
tags to products that are associated with sportswear for summer.
Fields
- •
- •ID!non-null
A globally-unique ID for the product.
- Anchor to inAnyCollectionin•
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.
- Anchor to inCollectionsin•
Collections [CollectionMembership!]! 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.
- •[ID!]!required
A comma-separated list of globally-unique collection IDs that are associated with the product. For example,
,
.
Arguments
- Anchor to collectionIdcollection•
Id ID!non-null A globally-unique ID for the collection.
- Anchor to isMemberis•
Member Boolean!non-null Whether the product is in the specified collection.
Fields
- •
- Anchor to isGiftCardis•
Gift Card Boolean!non-null Whether the product is a gift card.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to productTypeproduct•
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.
- Anchor to titletitle•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
.- Anchor to vendorvendor•String
The name of the product's vendor.
- Anchor to requiresShippingrequires•
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.
- •String
A case-sensitive identifier for the product variant in the merchant's store. For example,
. A product variant must have a SKU to be connected to a fulfillment service.
- Anchor to titletitle•String
The localized name for the product variant that displays to customers.
- Anchor to weightweight•Float
The product variant's weight, in the system of measurement set in the
field.
- Anchor to weightUnitweight•
Unit WeightUnit! non-null The unit of measurement for weight.
GRAMS, KILOGRAMS, OUNCES, POUNDS
- •
- Anchor to quantityquantity•Int!non-null
The quantity of the item that the customer intends to purchase.
- Anchor to deliveryGroupsdelivery•
Groups [CartDelivery 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 and Product Discount legacy APIs, the
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 instead.
- Anchor to cartLinescart•
Lines [CartLine!]! 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.
- Anchor to attributeattribute•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
object in Liquid.
- •String
The key of the cart attribute to retrieve. For example,
.
Arguments
- •String!non-null
The key or name of the attribute. For example,
.
- Anchor to valuevalue•String
The value of the attribute. For example,
"true"
.
Fields
- •
- Anchor to costcost•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.
- Anchor to amountPerQuantityamount•
Per Quantity MoneyV2! 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
is $10.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to compareAtAmountPerQuantitycompare•
At Amount Per Quantity MoneyV2 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
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.- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to subtotalAmountsubtotal•
Amount MoneyV2! 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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to totalAmounttotal•
Amount MoneyV2! non-null The total cost of items in a cart.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- •ID!non-null
The ID of the cart line.
- Anchor to merchandisemerchandise•Merchandise!non-null
The item that the customer intends to purchase.
- Anchor to CustomProduct•OBJECTCustom
Product A custom product represents a product that doesn't map to Shopify's standard product categories. For example, you can use a custom product to manage gift cards, shipping requirements, localized product information, or weight measurements and conversions.
- Anchor to isGiftCardis•
Gift Card Boolean!non-null Whether the merchandise is a gift card.
- Anchor to requiresShippingrequires•
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.
- Anchor to titletitle•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
.- Anchor to weightweight•Float
The product variant's weight, in the system of measurement set in the
field.
- Anchor to weightUnitweight•
Unit WeightUnit! non-null The unit of measurement for weight.
GRAMS, KILOGRAMS, OUNCES, POUNDS
- Anchor to ProductVariant•OBJECTProduct
Variant 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!non-null
A globally-unique ID for the product variant.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to productproduct•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.
- Anchor to handlehandle•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 isblack-sunglasses
.- Anchor to hasAnyTaghas•
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
.- Anchor to hasTagshas•
Tags [HasTag Response!]! non-null Whether the product is associated with the specified tags. The product must have all of the tags in the list to return
true
.- •[String!]!required
A comma-separated list of searchable keywords that are associated with the product. For example,
"sports, summer"
returns products with both thesports
andsummer
tags.
Arguments
- Anchor to hasTaghas•
Tag Boolean!non-null Whether the Shopify resource has the 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
andsummer
tags to products that are associated with sportswear for summer.
Fields
- •
- •ID!non-null
A globally-unique ID for the product.
- Anchor to inAnyCollectionin•
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.
- Anchor to inCollectionsin•
Collections [CollectionMembership!]! 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.
- •[ID!]!required
A comma-separated list of globally-unique collection IDs that are associated with the product. For example,
,
.
Arguments
- Anchor to collectionIdcollection•
Id ID!non-null A globally-unique ID for the collection.
- Anchor to isMemberis•
Member Boolean!non-null Whether the product is in the specified collection.
Fields
- •
- Anchor to isGiftCardis•
Gift Card Boolean!non-null Whether the product is a gift card.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to productTypeproduct•
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.
- Anchor to titletitle•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
.- Anchor to vendorvendor•String
The name of the product's vendor.
- Anchor to requiresShippingrequires•
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.
- •String
A case-sensitive identifier for the product variant in the merchant's store. For example,
. A product variant must have a SKU to be connected to a fulfillment service.
- Anchor to titletitle•String
The localized name for the product variant that displays to customers.
- Anchor to weightweight•Float
The product variant's weight, in the system of measurement set in the
field.
- Anchor to weightUnitweight•
Unit WeightUnit! non-null The unit of measurement for weight.
GRAMS, KILOGRAMS, OUNCES, POUNDS
- •
- Anchor to quantityquantity•Int!non-null
The quantity of the item that the customer intends to purchase.
- Anchor to sellingPlanAllocationselling•
Plan Allocation SellingPlan Allocation The selling plan associated with the cart line, including information about how a product variant can be sold and purchased.
- Anchor to priceAdjustmentsprice•
Adjustments [SellingPlan 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.
- Anchor to perDeliveryPriceper•
Delivery Price MoneyV2! 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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to priceprice•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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to sellingPlanselling•
Plan SellingPlan! 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'.
- Anchor to descriptiondescription•String
The description of the selling plan.
- •ID!non-null
A globally-unique identifier.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to namename•String!non-null
The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'.
- Anchor to recurringDeliveriesrecurring•
Deliveries Boolean!non-null Whether purchasing the selling plan will result in multiple deliveries.
- Anchor to deliveryAddressdelivery•
Address MailingAddress The shipping or destination address associated with the delivery group.
- Anchor to address1address1•String
The first line of the address. Typically the street address or PO Box number.
- Anchor to address2address2•String
The second line of the address. Typically the number of the apartment, suite, or unit.
- Anchor to citycity•String
The name of the city, district, village, or town.
- Anchor to companycompany•String
The name of the customer's company or organization.
- Anchor to countryCodecountry•
Code CountryCode 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- Anchor to firstNamefirst•
Name String The first name of the customer.
- Anchor to lastNamelast•
Name String The last name of the customer.
- Anchor to latitudelatitude•Float
The approximate latitude of the address.
- Anchor to longitudelongitude•Float
The approximate longitude of the address.
- Anchor to namename•String
The full name of the customer, based on firstName and lastName.
- Anchor to phonephone•String
A unique phone number for the customer. Formatted using E.164 standard. For example, +16135551111.
- Anchor to provinceCodeprovince•
Code String The alphanumeric code for the region. For example, ON.
- •String
The zip or postal code of the address.
- Anchor to marketmarket•MarketDeprecated
- Anchor to deliveryOptionsdelivery•
Options [CartDelivery 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.
- Anchor to codecode•String
A unique identifier that represents the delivery option offered to customers. For example,
Canada Post Expedited
.- Anchor to costcost•Money
V2! non-null The amount that the customer pays if they select the delivery option.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to deliveryMethodTypedelivery•
Method Type DeliveryMethod! 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, and shipping to a pickup point, all of which are natively supported by Shopify checkout.
LOCAL, NONE, PICK_UP, PICKUP_POINT, RETAIL, SHIPPING- Anchor to descriptiondescription•String
A single-line description of the delivery option, with HTML tags removed.
- Anchor to handlehandle•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
.- Anchor to titletitle•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!non-null
A globally-unique ID for the delivery group.
- Anchor to selectedDeliveryOptionselected•
Delivery Option CartDelivery Option Information about the delivery option that the customer has selected.
- Anchor to codecode•String
A unique identifier that represents the delivery option offered to customers. For example,
Canada Post Expedited
.- Anchor to costcost•Money
V2! non-null The amount that the customer pays if they select the delivery option.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to deliveryMethodTypedelivery•
Method Type DeliveryMethod! 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, and shipping to a pickup point, all of which are natively supported by Shopify checkout.
LOCAL, NONE, PICK_UP, PICKUP_POINT, RETAIL, SHIPPING- Anchor to descriptiondescription•String
A single-line description of the delivery option, with HTML tags removed.
- Anchor to handlehandle•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
.- Anchor to titletitle•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
.
- Anchor to lineslines•[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.
- Anchor to attributeattribute•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
object in Liquid.
- •String
The key of the cart attribute to retrieve. For example,
.
Arguments
- •String!non-null
The key or name of the attribute. For example,
.
- Anchor to valuevalue•String
The value of the attribute. For example,
"true"
.
Fields
- •
- Anchor to costcost•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.
- Anchor to amountPerQuantityamount•
Per Quantity MoneyV2! 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
is $10.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to compareAtAmountPerQuantitycompare•
At Amount Per Quantity MoneyV2 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
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.- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to subtotalAmountsubtotal•
Amount MoneyV2! 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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to totalAmounttotal•
Amount MoneyV2! non-null The total cost of items in a cart.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- •ID!non-null
The ID of the cart line.
- Anchor to merchandisemerchandise•Merchandise!non-null
The item that the customer intends to purchase.
- Anchor to CustomProduct•OBJECTCustom
Product A custom product represents a product that doesn't map to Shopify's standard product categories. For example, you can use a custom product to manage gift cards, shipping requirements, localized product information, or weight measurements and conversions.
- Anchor to isGiftCardis•
Gift Card Boolean!non-null Whether the merchandise is a gift card.
- Anchor to requiresShippingrequires•
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.
- Anchor to titletitle•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
.- Anchor to weightweight•Float
The product variant's weight, in the system of measurement set in the
field.
- Anchor to weightUnitweight•
Unit WeightUnit! non-null The unit of measurement for weight.
GRAMS, KILOGRAMS, OUNCES, POUNDS
- Anchor to ProductVariant•OBJECTProduct
Variant 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!non-null
A globally-unique ID for the product variant.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to productproduct•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.
- Anchor to handlehandle•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 isblack-sunglasses
.- Anchor to hasAnyTaghas•
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
.- Anchor to hasTagshas•
Tags [HasTag Response!]! non-null Whether the product is associated with the specified tags. The product must have all of the tags in the list to return
true
.- •[String!]!required
A comma-separated list of searchable keywords that are associated with the product. For example,
"sports, summer"
returns products with both thesports
andsummer
tags.
Arguments
- Anchor to hasTaghas•
Tag Boolean!non-null Whether the Shopify resource has the 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
andsummer
tags to products that are associated with sportswear for summer.
Fields
- •
- •ID!non-null
A globally-unique ID for the product.
- Anchor to inAnyCollectionin•
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.
- Anchor to inCollectionsin•
Collections [CollectionMembership!]! 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.
- •[ID!]!required
A comma-separated list of globally-unique collection IDs that are associated with the product. For example,
,
.
Arguments
- Anchor to collectionIdcollection•
Id ID!non-null A globally-unique ID for the collection.
- Anchor to isMemberis•
Member Boolean!non-null Whether the product is in the specified collection.
Fields
- •
- Anchor to isGiftCardis•
Gift Card Boolean!non-null Whether the product is a gift card.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to productTypeproduct•
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.
- Anchor to titletitle•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
.- Anchor to vendorvendor•String
The name of the product's vendor.
- Anchor to requiresShippingrequires•
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.
- •String
A case-sensitive identifier for the product variant in the merchant's store. For example,
. A product variant must have a SKU to be connected to a fulfillment service.
- Anchor to titletitle•String
The localized name for the product variant that displays to customers.
- Anchor to weightweight•Float
The product variant's weight, in the system of measurement set in the
field.
- Anchor to weightUnitweight•
Unit WeightUnit! non-null The unit of measurement for weight.
GRAMS, KILOGRAMS, OUNCES, POUNDS
- •
- Anchor to quantityquantity•Int!non-null
The quantity of the item that the customer intends to purchase.
- Anchor to sellingPlanAllocationselling•
Plan Allocation SellingPlan Allocation The selling plan associated with the cart line, including information about how a product variant can be sold and purchased.
- Anchor to priceAdjustmentsprice•
Adjustments [SellingPlan 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.
- Anchor to perDeliveryPriceper•
Delivery Price MoneyV2! 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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to priceprice•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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to sellingPlanselling•
Plan SellingPlan! 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'.
- Anchor to descriptiondescription•String
The description of the selling plan.
- •ID!non-null
A globally-unique identifier.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to namename•String!non-null
The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'.
- Anchor to recurringDeliveriesrecurring•
Deliveries Boolean!non-null Whether purchasing the selling plan will result in multiple deliveries.
- Anchor to localizedFieldslocalized•
Fields [LocalizedField!]! 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.
- Anchor to keyskeys•[Localized
Field Key!]! required 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
Arguments
- •Localized
Field Key! non-null 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- Anchor to titletitle•String!non-null
The title of the localized field.
- Anchor to valuevalue•String
The value of the localized field.
Fields
- Anchor to discountdiscount•Discount!non-null
The discount node that owns the Shopify Function. Discounts are a way for merchants to promote sales and special offers, or as customer loyalty rewards. A single discount can be automatic or code-based, and can be applied to a cart lines, orders, and delivery.
- Anchor to discountClassesdiscount•
Classes [DiscountClass!]! non-null The discount classes) that the discountNode) supports.
ORDER, PRODUCT, SHIPPING- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to fetchResultfetch•
Result HttpResponse The result of the fetch target. Refer to network access for Shopify Functions. This input is only available in the
cart.lines.discounts.generate.run
andcart.delivery-options.discounts.generate.run
extension targets.- Anchor to bodybody•String
The HTTP response body as a plain string. Use this field when the body is not in JSON format.
- Anchor to headerheader•Http
Response Header An HTTP header.
- Anchor to namename•String!required
A case-insensitive header name.
Arguments
- Anchor to namename•String!non-null
Header name.
- Anchor to valuevalue•String!non-null
Header value.
Fields
- Anchor to jsonBodyjson•
Body JSON The HTTP response body parsed as JSON. If the body is valid JSON, it will be parsed and returned as a JSON object. If parsing fails, then raw body is returned as a string. Use this field when you expect the response to be JSON, or when you're dealing with mixed response types, meaning both JSON and non-JSON. Using this field reduces function instruction consumption and ensures that the data is formatted in logs. To prevent increasing the function target input size unnecessarily, avoid querying both
body
andsimultaneously.
- Anchor to statusstatus•Int!non-null
The HTTP status code.
- Anchor to headersheaders•[Http
Response Header!]! non-nullDeprecated
- Anchor to localizationlocalization•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.
- Anchor to countrycountry•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.
- Anchor to isoCodeiso•
Code CountryCode! 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
- Anchor to languagelanguage•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.
- Anchor to isoCodeiso•
Code LanguageCode! 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
- Anchor to marketmarket•Market!non-nullDeprecated
- Anchor to presentmentCurrencyRatepresentment•
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.
- Anchor to shopshop•Shop!non-null
Information about the shop where the Function is running, including the shop's timezone setting and associated metafields.
- Anchor to localTimelocal•
Time LocalTime! non-null The current time based on the store's timezone setting.
- Anchor to datedate•Date!non-null
The current date relative to the parent object.
- Anchor to dateTimeAfterdate•
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.
- Anchor to dateTimeBeforedate•
Time Before Boolean!non-null Returns true if the current date and time is before the given date and time, and false otherwise.
- Anchor to dateTimeBetweendate•
Time Between Boolean!non-null Returns true if the current date and time is between the two given date and times, and false otherwise.
- Anchor to timeAftertime•
After Boolean!non-null Returns true if the current time is at or past the given time, and false otherwise.
- Anchor to timeBeforetime•
Before Boolean!non-null Returns true if the current time is at or past the given time, and false otherwise.
- Anchor to timeBetweentime•
Between Boolean!non-null Returns true if the current time is between the two given times, and false otherwise.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to triggeringDiscountCodetriggering•
Discount Code String The discount code entered by a customer, which caused the Discount Function) to run. This input is only available in the
cart.lines.discounts.generate.run
andcart.delivery-options.discounts.generate.run
extension targets.
Anchor to Cart run FunctionCart run Function
The Function processes input schema data to calculate and allocate discounts across cart lines. The Function handles both fixed and percentage-based discounts while respecting discount caps and generating any messages associated with the discount, such as error messages associated with validation.
This return must follow the schema defined in the CartLinesDiscountsGenerateRunResult
object.
- OBJECT
The
CartLinesDiscountsGenerateRunResult
object is the output of the Function run target. The object contains the operations to generate, validate, and apply discounts to the cart.- Anchor to operationsoperations•[Cart
Operation!]! non-null The list of operations to apply discounts to the cart.
- Anchor to enteredDiscountCodesAcceptentered•
Discount Codes Accept EnteredDiscount Codes Accept Operation An operation that selects which entered discount codes to accept. Use this to validate discount codes from external systems.
- Anchor to codescodes•[Discount
Code!]! non-null The list of discount codes to accept.
- Anchor to codecode•String!non-null
The discount code.
- Anchor to orderDiscountsAddorder•
Discounts Add OrderDiscounts Add Operation An operation that applies order discounts to a cart that share a selection strategy.
- Anchor to candidatescandidates•[Order
Discount Candidate!]! non-null The list of discounts that can be applied to an order.
- Anchor to associatedDiscountCodeassociated•
Discount Code AssociatedDiscount Code The discount code associated with this discount candidate, for code-based discounts.
- Anchor to codecode•String!non-null
The discount code.
- Anchor to conditionsconditions•[Condition!]
The conditions that must be satisfied for an order to be eligible for a discount candidate.
- Anchor to cartLineMinimumQuantitycart•
Line Minimum Quantity CartLine Minimum Quantity The condition for checking the minimum quantity of products across a group of cart lines.
- •[ID!]!non-null
Cart line IDs with a merchandise line price that's included to calculate the minimum quantity purchased to receive the discount.
- Anchor to minimumQuantityminimum•
Quantity Int!non-null The minimum quantity of a cart line to be eligible for a discount candidate.
- •
- Anchor to cartLineMinimumSubtotalcart•
Line Minimum Subtotal CartLine Minimum Subtotal The condition for checking the minimum subtotal of products across a group of cart lines.
- •[ID!]!non-null
Cart line IDs with a merchandise line price that's included to calculate the minimum subtotal purchased to receive the discount.
- Anchor to minimumAmountminimum•
Amount Decimal!non-null The minimum subtotal amount of the cart line to be eligible for a discount candidate.
- •
- Anchor to orderMinimumSubtotalorder•
Minimum Subtotal OrderMinimum Subtotal The condition for checking the minimum subtotal amount of the order.
- Anchor to excludedCartLineIdsexcluded•
Cart Line Ids [ID!]!non-null Cart line IDs with a merchandise line price that's excluded to calculate the minimum subtotal amount of the order.
- Anchor to minimumAmountminimum•
Amount Decimal!non-null The minimum subtotal amount of the order to be eligible for the discount.
- Anchor to messagemessage•String
A notification that informs customers about available discounts. The message is displayed on the Cart page. For example, "Save 20% on all t-shirts."
- Anchor to targetstargets•[Order
Discount Candidate Target!]! non-null The targets of the order discount candidate.
- Anchor to orderSubtotalorder•
Subtotal OrderSubtotal Target A method for applying a discount to the entire order subtotal. The subtotal is the total amount of the order before any taxes, shipping fees, or discounts are applied. For example, if a customer places an order for a t-shirt and a pair of shoes, then the subtotal is the sum of the prices of those items.
- Anchor to excludedCartLineIdsexcluded•
Cart Line Ids [ID!]!non-null The list of excluded cart line IDs. These cart lines are excluded from the order subtotal calculation when calculating the maximum value of the discount.
- Anchor to valuevalue•Order
Discount Candidate Value! non-null The value of the order discount candidate.
- Anchor to fixedAmountfixed•
Amount FixedAmount A fixed amount value.
- Anchor to amountamount•Decimal!non-null
The fixed amount value of the discount, in the currency of the cart.
The amount must be greater than or equal to 0.
- Anchor to percentagepercentage•Percentage
A percentage value.
- Anchor to valuevalue•Decimal!non-null
The percentage value.
The value is validated against: >= 0 and <= 100.
- Anchor to selectionStrategyselection•
Strategy OrderDiscount Selection Strategy! non-null The strategy that's applied to the list of discounts.
FIRST, MAXIMUM
- Anchor to productDiscountsAddproduct•
Discounts Add ProductDiscounts Add Operation An operation that applies product discounts to a cart that share a selection strategy.
- Anchor to candidatescandidates•[Product
Discount Candidate!]! non-null The list of products that are eligible for the discount.
- Anchor to associatedDiscountCodeassociated•
Discount Code AssociatedDiscount Code The discount code associated with this discount candidate, for code-based discounts.
- Anchor to codecode•String!non-null
The discount code.
- Anchor to messagemessage•String
A notification that informs customers about available discounts. The message is displayed on the Cart page. For example, "Save 20% on all t-shirts."
- Anchor to targetstargets•[Product
Discount Candidate Target!]! non-null The targets of the discount to be applied to a cart line.
- Anchor to cartLinecart•
Line CartLine Target A method for applying a discount to a specific line item in the cart. A cart line is an entry in the customer's cart that represents a single unit of a product variant. For example, if a customer adds two different sizes of the same t-shirt to their cart, then each size is represented as a separate cart line.
- •ID!non-null
The ID of the targeted cart line.
- Anchor to quantityquantity•Int
The number of line items that are being discounted. The default value is
null
, which represents the quantity of the matching line items.The value is validated against: > 0.
- •
- Anchor to valuevalue•Product
Discount Candidate Value! non-null The value of the discount to be applied to a cart line. For example, a fixed amount of $5 off or percentage value of 20% off.
- Anchor to fixedAmountfixed•
Amount ProductDiscount Candidate Fixed Amount The fixed-amount value of the discount to be applied to a cart line. For example, if the cart total is $100 and the discount is $10, then the fixed amount is $10.
- Anchor to amountamount•Decimal!non-null
The fixed-amount value of the discount to be applied to a cart line, in the currency of the cart. The amount must be greater than or equal to 0.
- Anchor to appliesToEachItemapplies•
To Each Item Boolean Whether to apply the value of each eligible discount to each eligible cart line.
The default value is
false
, which causes the value to be applied once across the entitled items. When the value istrue
, the value will be applied to each of the entitled items.
- Anchor to percentagepercentage•Percentage
A percentage value.
- Anchor to valuevalue•Decimal!non-null
The percentage value.
The value is validated against: >= 0 and <= 100.
- Anchor to selectionStrategyselection•
Strategy ProductDiscount Selection Strategy! non-null The strategy that's applied to the list of products that are eligible for the cart line discount.
ALL, FIRST, MAXIMUM
Anchor to Delivery run targetDelivery run target
cart.delivery-options.discounts.generate.run
The run target that's responsible for generating the discount on shipping costs using either Shopify data, hardcoded values, or fetch results from external providers. The target returns an ordered list of operations to be applied to the cart.
The run target evaluates carts against discount rules, calculates applicable reductions, and returns the final discount. This target generates and returns a shipping discount to potentially apply to the cart.
- Anchor to InputInputOBJECT
The
Input
object is the complete GraphQL schema that your Function receives to generate discounts for a delivery option or delivery group. Your Function only receives 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.- Anchor to cartcart•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.
- Anchor to attributeattribute•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.
- •String
The key of the cart attribute to retrieve. For example,
.
Arguments
- •String!non-null
The key or name of the attribute. For example,
.
- Anchor to valuevalue•String
The value of the attribute. For example,
"true"
.
Fields
- •
- Anchor to buyerIdentitybuyer•
Identity BuyerIdentity 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.
- Anchor to customercustomer•Customer
The customer that's interacting with the cart. A customer is a buyer who has an account with the store.
- Anchor to amountSpentamount•
Spent MoneyV2! 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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to displayNamedisplay•
Name String!non-null The full name of the customer, based on the values for
and
. If
and
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.
- Anchor to emailemail•String
The customer's email address.
- Anchor to firstNamefirst•
Name String The customer's first name.
- Anchor to hasAnyTaghas•
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
.- Anchor to hasTagshas•
Tags [HasTag Response!]! non-null Whether the customer is associated with the specified tags. The customer must have all of the tags in the list to return
true
.- •[String!]!required
A comma-separated list of searchable keywords that are associated with the customer. For example,
returns customers with both the
and
Gold
tags.
Arguments
- Anchor to hasTaghas•
Tag Boolean!non-null Whether the Shopify resource has the 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
andsummer
tags to products that are associated with sportswear for summer.
Fields
- •
- •ID!non-null
A globally-unique ID for the customer.
- Anchor to lastNamelast•
Name String The customer's last name.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to numberOfOrdersnumber•
Of Orders Int!non-null The total number of orders that the customer has made at the store.
- Anchor to emailemail•String
The email address of the customer that's interacting with the cart.
- Anchor to isAuthenticatedis•
Authenticated Boolean!non-null Whether the customer is authenticated through their customer account. If the customer is authenticated, then the
customer
field returns the customer's information. If the customer isn't authenticated, then thecustomer
field returnsnull
.- Anchor to phonephone•String
The phone number of the customer that's interacting with the cart.
- Anchor to purchasingCompanypurchasing•
Company PurchasingCompany 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.
- Anchor to companycompany•Company!non-null
The company associated to the order or draft order.
- Anchor to createdAtcreated•
At DateTime! non-null The date and time (ISO 8601 format) at which the company was created in Shopify.
- Anchor to externalIdexternal•
Id String A unique externally-supplied ID for the company.
- •ID!non-null
The ID of the company.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to namename•String!non-null
The name of the company.
- Anchor to updatedAtupdated•
At DateTime! non-null The date and time (ISO 8601 format) at which the company was last modified.
- Anchor to contactcontact•Company
Contact The company contact associated to the order or draft order.
- Anchor to createdAtcreated•
At DateTime! non-null The date and time (ISO 8601 format) at which the company contact was created in Shopify.
- •ID!non-null
The ID of the company.
- Anchor to localelocale•String
The company contact's locale (language).
- Anchor to titletitle•String
The company contact's job title.
- Anchor to updatedAtupdated•
At DateTime! non-null The date and time (ISO 8601 format) at which the company contact was last modified.
- Anchor to locationlocation•Company
Location! non-null The company location associated to the order or draft order.
- Anchor to createdAtcreated•
At DateTime! non-null The date and time (ISO 8601 format) at which the company location was created in Shopify.
- Anchor to externalIdexternal•
Id String A unique externally-supplied ID for the company.
- •ID!non-null
The ID of the company.
- Anchor to localelocale•String
The preferred locale of the company location.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to namename•String!non-null
The name of the company location.
- Anchor to updatedAtupdated•
At DateTime! non-null The date and time (ISO 8601 format) at which the company location was last modified.
- Anchor to costcost•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.
- Anchor to subtotalAmountsubtotal•
Amount MoneyV2! non-null The amount for the customer to pay at checkout, excluding taxes and discounts.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to totalAmounttotal•
Amount MoneyV2! non-null The total amount for the customer to pay at checkout.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to totalDutyAmounttotal•
Duty Amount MoneyV2 The duty charges for a customer to pay at checkout.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to totalTaxAmounttotal•
Tax Amount MoneyV2 The total tax amount for the customer to pay at checkout.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to deliverableLinesdeliverable•
Lines [DeliverableCart Line!]! non-null The items in a cart that are eligible for fulfillment and can be delivered to the customer.
- Anchor to attributeattribute•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
object in Liquid.
- •String
The key of the cart attribute to retrieve. For example,
.
Arguments
- •String!non-null
The key or name of the attribute. For example,
.
- Anchor to valuevalue•String
The value of the attribute. For example,
"true"
.
Fields
- •
- •ID!non-null
The ID of the cart line.
- Anchor to merchandisemerchandise•Merchandise!non-null
The item that the customer intends to purchase.
- Anchor to CustomProduct•OBJECTCustom
Product A custom product represents a product that doesn't map to Shopify's standard product categories. For example, you can use a custom product to manage gift cards, shipping requirements, localized product information, or weight measurements and conversions.
- Anchor to isGiftCardis•
Gift Card Boolean!non-null Whether the merchandise is a gift card.
- Anchor to requiresShippingrequires•
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.
- Anchor to titletitle•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
.- Anchor to weightweight•Float
The product variant's weight, in the system of measurement set in the
field.
- Anchor to weightUnitweight•
Unit WeightUnit! non-null The unit of measurement for weight.
GRAMS, KILOGRAMS, OUNCES, POUNDS
- Anchor to ProductVariant•OBJECTProduct
Variant 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!non-null
A globally-unique ID for the product variant.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to productproduct•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.
- Anchor to handlehandle•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 isblack-sunglasses
.- Anchor to hasAnyTaghas•
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
.- Anchor to hasTagshas•
Tags [HasTag Response!]! non-null Whether the product is associated with the specified tags. The product must have all of the tags in the list to return
true
.- •[String!]!required
A comma-separated list of searchable keywords that are associated with the product. For example,
"sports, summer"
returns products with both thesports
andsummer
tags.
Arguments
- Anchor to hasTaghas•
Tag Boolean!non-null Whether the Shopify resource has the 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
andsummer
tags to products that are associated with sportswear for summer.
Fields
- •
- •ID!non-null
A globally-unique ID for the product.
- Anchor to inAnyCollectionin•
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.
- Anchor to inCollectionsin•
Collections [CollectionMembership!]! 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.
- •[ID!]!required
A comma-separated list of globally-unique collection IDs that are associated with the product. For example,
,
.
Arguments
- Anchor to collectionIdcollection•
Id ID!non-null A globally-unique ID for the collection.
- Anchor to isMemberis•
Member Boolean!non-null Whether the product is in the specified collection.
Fields
- •
- Anchor to isGiftCardis•
Gift Card Boolean!non-null Whether the product is a gift card.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to productTypeproduct•
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.
- Anchor to titletitle•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
.- Anchor to vendorvendor•String
The name of the product's vendor.
- Anchor to requiresShippingrequires•
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.
- •String
A case-sensitive identifier for the product variant in the merchant's store. For example,
. A product variant must have a SKU to be connected to a fulfillment service.
- Anchor to titletitle•String
The localized name for the product variant that displays to customers.
- Anchor to weightweight•Float
The product variant's weight, in the system of measurement set in the
field.
- Anchor to weightUnitweight•
Unit WeightUnit! non-null The unit of measurement for weight.
GRAMS, KILOGRAMS, OUNCES, POUNDS
- •
- Anchor to quantityquantity•Int!non-null
The quantity of the item that the customer intends to purchase.
- Anchor to deliveryGroupsdelivery•
Groups [CartDelivery 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 and Product Discount legacy APIs, the
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 instead.
- Anchor to cartLinescart•
Lines [CartLine!]! 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.
- Anchor to attributeattribute•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
object in Liquid.
- •String
The key of the cart attribute to retrieve. For example,
.
Arguments
- •String!non-null
The key or name of the attribute. For example,
.
- Anchor to valuevalue•String
The value of the attribute. For example,
"true"
.
Fields
- •
- Anchor to costcost•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.
- Anchor to amountPerQuantityamount•
Per Quantity MoneyV2! 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
is $10.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to compareAtAmountPerQuantitycompare•
At Amount Per Quantity MoneyV2 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
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.- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to subtotalAmountsubtotal•
Amount MoneyV2! 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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to totalAmounttotal•
Amount MoneyV2! non-null The total cost of items in a cart.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- •ID!non-null
The ID of the cart line.
- Anchor to merchandisemerchandise•Merchandise!non-null
The item that the customer intends to purchase.
- Anchor to CustomProduct•OBJECTCustom
Product A custom product represents a product that doesn't map to Shopify's standard product categories. For example, you can use a custom product to manage gift cards, shipping requirements, localized product information, or weight measurements and conversions.
- Anchor to isGiftCardis•
Gift Card Boolean!non-null Whether the merchandise is a gift card.
- Anchor to requiresShippingrequires•
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.
- Anchor to titletitle•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
.- Anchor to weightweight•Float
The product variant's weight, in the system of measurement set in the
field.
- Anchor to weightUnitweight•
Unit WeightUnit! non-null The unit of measurement for weight.
GRAMS, KILOGRAMS, OUNCES, POUNDS
- Anchor to ProductVariant•OBJECTProduct
Variant 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!non-null
A globally-unique ID for the product variant.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to productproduct•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.
- Anchor to handlehandle•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 isblack-sunglasses
.- Anchor to hasAnyTaghas•
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
.- Anchor to hasTagshas•
Tags [HasTag Response!]! non-null Whether the product is associated with the specified tags. The product must have all of the tags in the list to return
true
.- •[String!]!required
A comma-separated list of searchable keywords that are associated with the product. For example,
"sports, summer"
returns products with both thesports
andsummer
tags.
Arguments
- Anchor to hasTaghas•
Tag Boolean!non-null Whether the Shopify resource has the 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
andsummer
tags to products that are associated with sportswear for summer.
Fields
- •
- •ID!non-null
A globally-unique ID for the product.
- Anchor to inAnyCollectionin•
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.
- Anchor to inCollectionsin•
Collections [CollectionMembership!]! 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.
- •[ID!]!required
A comma-separated list of globally-unique collection IDs that are associated with the product. For example,
,
.
Arguments
- Anchor to collectionIdcollection•
Id ID!non-null A globally-unique ID for the collection.
- Anchor to isMemberis•
Member Boolean!non-null Whether the product is in the specified collection.
Fields
- •
- Anchor to isGiftCardis•
Gift Card Boolean!non-null Whether the product is a gift card.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to productTypeproduct•
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.
- Anchor to titletitle•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
.- Anchor to vendorvendor•String
The name of the product's vendor.
- Anchor to requiresShippingrequires•
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.
- •String
A case-sensitive identifier for the product variant in the merchant's store. For example,
. A product variant must have a SKU to be connected to a fulfillment service.
- Anchor to titletitle•String
The localized name for the product variant that displays to customers.
- Anchor to weightweight•Float
The product variant's weight, in the system of measurement set in the
field.
- Anchor to weightUnitweight•
Unit WeightUnit! non-null The unit of measurement for weight.
GRAMS, KILOGRAMS, OUNCES, POUNDS
- •
- Anchor to quantityquantity•Int!non-null
The quantity of the item that the customer intends to purchase.
- Anchor to sellingPlanAllocationselling•
Plan Allocation SellingPlan Allocation The selling plan associated with the cart line, including information about how a product variant can be sold and purchased.
- Anchor to priceAdjustmentsprice•
Adjustments [SellingPlan 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.
- Anchor to perDeliveryPriceper•
Delivery Price MoneyV2! 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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to priceprice•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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to sellingPlanselling•
Plan SellingPlan! 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'.
- Anchor to descriptiondescription•String
The description of the selling plan.
- •ID!non-null
A globally-unique identifier.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to namename•String!non-null
The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'.
- Anchor to recurringDeliveriesrecurring•
Deliveries Boolean!non-null Whether purchasing the selling plan will result in multiple deliveries.
- Anchor to deliveryAddressdelivery•
Address MailingAddress The shipping or destination address associated with the delivery group.
- Anchor to address1address1•String
The first line of the address. Typically the street address or PO Box number.
- Anchor to address2address2•String
The second line of the address. Typically the number of the apartment, suite, or unit.
- Anchor to citycity•String
The name of the city, district, village, or town.
- Anchor to companycompany•String
The name of the customer's company or organization.
- Anchor to countryCodecountry•
Code CountryCode 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- Anchor to firstNamefirst•
Name String The first name of the customer.
- Anchor to lastNamelast•
Name String The last name of the customer.
- Anchor to latitudelatitude•Float
The approximate latitude of the address.
- Anchor to longitudelongitude•Float
The approximate longitude of the address.
- Anchor to namename•String
The full name of the customer, based on firstName and lastName.
- Anchor to phonephone•String
A unique phone number for the customer. Formatted using E.164 standard. For example, +16135551111.
- Anchor to provinceCodeprovince•
Code String The alphanumeric code for the region. For example, ON.
- •String
The zip or postal code of the address.
- Anchor to marketmarket•MarketDeprecated
- Anchor to deliveryOptionsdelivery•
Options [CartDelivery 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.
- Anchor to codecode•String
A unique identifier that represents the delivery option offered to customers. For example,
Canada Post Expedited
.- Anchor to costcost•Money
V2! non-null The amount that the customer pays if they select the delivery option.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to deliveryMethodTypedelivery•
Method Type DeliveryMethod! 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, and shipping to a pickup point, all of which are natively supported by Shopify checkout.
LOCAL, NONE, PICK_UP, PICKUP_POINT, RETAIL, SHIPPING- Anchor to descriptiondescription•String
A single-line description of the delivery option, with HTML tags removed.
- Anchor to handlehandle•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
.- Anchor to titletitle•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!non-null
A globally-unique ID for the delivery group.
- Anchor to selectedDeliveryOptionselected•
Delivery Option CartDelivery Option Information about the delivery option that the customer has selected.
- Anchor to codecode•String
A unique identifier that represents the delivery option offered to customers. For example,
Canada Post Expedited
.- Anchor to costcost•Money
V2! non-null The amount that the customer pays if they select the delivery option.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to deliveryMethodTypedelivery•
Method Type DeliveryMethod! 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, and shipping to a pickup point, all of which are natively supported by Shopify checkout.
LOCAL, NONE, PICK_UP, PICKUP_POINT, RETAIL, SHIPPING- Anchor to descriptiondescription•String
A single-line description of the delivery option, with HTML tags removed.
- Anchor to handlehandle•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
.- Anchor to titletitle•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
.
- Anchor to lineslines•[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.
- Anchor to attributeattribute•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
object in Liquid.
- •String
The key of the cart attribute to retrieve. For example,
.
Arguments
- •String!non-null
The key or name of the attribute. For example,
.
- Anchor to valuevalue•String
The value of the attribute. For example,
"true"
.
Fields
- •
- Anchor to costcost•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.
- Anchor to amountPerQuantityamount•
Per Quantity MoneyV2! 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
is $10.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to compareAtAmountPerQuantitycompare•
At Amount Per Quantity MoneyV2 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
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.- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to subtotalAmountsubtotal•
Amount MoneyV2! 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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to totalAmounttotal•
Amount MoneyV2! non-null The total cost of items in a cart.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- •ID!non-null
The ID of the cart line.
- Anchor to merchandisemerchandise•Merchandise!non-null
The item that the customer intends to purchase.
- Anchor to CustomProduct•OBJECTCustom
Product A custom product represents a product that doesn't map to Shopify's standard product categories. For example, you can use a custom product to manage gift cards, shipping requirements, localized product information, or weight measurements and conversions.
- Anchor to isGiftCardis•
Gift Card Boolean!non-null Whether the merchandise is a gift card.
- Anchor to requiresShippingrequires•
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.
- Anchor to titletitle•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
.- Anchor to weightweight•Float
The product variant's weight, in the system of measurement set in the
field.
- Anchor to weightUnitweight•
Unit WeightUnit! non-null The unit of measurement for weight.
GRAMS, KILOGRAMS, OUNCES, POUNDS
- Anchor to ProductVariant•OBJECTProduct
Variant 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!non-null
A globally-unique ID for the product variant.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to productproduct•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.
- Anchor to handlehandle•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 isblack-sunglasses
.- Anchor to hasAnyTaghas•
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
.- Anchor to hasTagshas•
Tags [HasTag Response!]! non-null Whether the product is associated with the specified tags. The product must have all of the tags in the list to return
true
.- •[String!]!required
A comma-separated list of searchable keywords that are associated with the product. For example,
"sports, summer"
returns products with both thesports
andsummer
tags.
Arguments
- Anchor to hasTaghas•
Tag Boolean!non-null Whether the Shopify resource has the 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
andsummer
tags to products that are associated with sportswear for summer.
Fields
- •
- •ID!non-null
A globally-unique ID for the product.
- Anchor to inAnyCollectionin•
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.
- Anchor to inCollectionsin•
Collections [CollectionMembership!]! 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.
- •[ID!]!required
A comma-separated list of globally-unique collection IDs that are associated with the product. For example,
,
.
Arguments
- Anchor to collectionIdcollection•
Id ID!non-null A globally-unique ID for the collection.
- Anchor to isMemberis•
Member Boolean!non-null Whether the product is in the specified collection.
Fields
- •
- Anchor to isGiftCardis•
Gift Card Boolean!non-null Whether the product is a gift card.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to productTypeproduct•
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.
- Anchor to titletitle•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
.- Anchor to vendorvendor•String
The name of the product's vendor.
- Anchor to requiresShippingrequires•
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.
- •String
A case-sensitive identifier for the product variant in the merchant's store. For example,
. A product variant must have a SKU to be connected to a fulfillment service.
- Anchor to titletitle•String
The localized name for the product variant that displays to customers.
- Anchor to weightweight•Float
The product variant's weight, in the system of measurement set in the
field.
- Anchor to weightUnitweight•
Unit WeightUnit! non-null The unit of measurement for weight.
GRAMS, KILOGRAMS, OUNCES, POUNDS
- •
- Anchor to quantityquantity•Int!non-null
The quantity of the item that the customer intends to purchase.
- Anchor to sellingPlanAllocationselling•
Plan Allocation SellingPlan Allocation The selling plan associated with the cart line, including information about how a product variant can be sold and purchased.
- Anchor to priceAdjustmentsprice•
Adjustments [SellingPlan 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.
- Anchor to perDeliveryPriceper•
Delivery Price MoneyV2! 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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to priceprice•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.
- Anchor to amountamount•Decimal!non-null
A monetary value in decimal format, allowing for precise representation of cents or fractional currency. For example, 12.99.
- Anchor to currencyCodecurrency•
Code CurrencyCode! non-null The three-letter currency code that represents a world currency used in a store. Currency codes include standard standard ISO 4217 codes, 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, UYU, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XXX, YER, ZAR, ZMW, BYR, STD, VEF
- Anchor to sellingPlanselling•
Plan SellingPlan! 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'.
- Anchor to descriptiondescription•String
The description of the selling plan.
- •ID!non-null
A globally-unique identifier.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to namename•String!non-null
The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'.
- Anchor to recurringDeliveriesrecurring•
Deliveries Boolean!non-null Whether purchasing the selling plan will result in multiple deliveries.
- Anchor to localizedFieldslocalized•
Fields [LocalizedField!]! 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.
- Anchor to keyskeys•[Localized
Field Key!]! required 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
Arguments
- •Localized
Field Key! non-null 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- Anchor to titletitle•String!non-null
The title of the localized field.
- Anchor to valuevalue•String
The value of the localized field.
Fields
- Anchor to discountdiscount•Discount!non-null
The discount node that owns the Shopify Function. Discounts are a way for merchants to promote sales and special offers, or as customer loyalty rewards. A single discount can be automatic or code-based, and can be applied to a cart lines, orders, and delivery.
- Anchor to discountClassesdiscount•
Classes [DiscountClass!]! non-null The discount classes) that the discountNode) supports.
ORDER, PRODUCT, SHIPPING- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to fetchResultfetch•
Result HttpResponse The result of the fetch target. Refer to network access for Shopify Functions. This input is only available in the
cart.lines.discounts.generate.run
andcart.delivery-options.discounts.generate.run
extension targets.- Anchor to bodybody•String
The HTTP response body as a plain string. Use this field when the body is not in JSON format.
- Anchor to headerheader•Http
Response Header An HTTP header.
- Anchor to namename•String!required
A case-insensitive header name.
Arguments
- Anchor to namename•String!non-null
Header name.
- Anchor to valuevalue•String!non-null
Header value.
Fields
- Anchor to jsonBodyjson•
Body JSON The HTTP response body parsed as JSON. If the body is valid JSON, it will be parsed and returned as a JSON object. If parsing fails, then raw body is returned as a string. Use this field when you expect the response to be JSON, or when you're dealing with mixed response types, meaning both JSON and non-JSON. Using this field reduces function instruction consumption and ensures that the data is formatted in logs. To prevent increasing the function target input size unnecessarily, avoid querying both
body
andsimultaneously.
- Anchor to statusstatus•Int!non-null
The HTTP status code.
- Anchor to headersheaders•[Http
Response Header!]! non-nullDeprecated
- Anchor to localizationlocalization•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.
- Anchor to countrycountry•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.
- Anchor to isoCodeiso•
Code CountryCode! 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
- Anchor to languagelanguage•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.
- Anchor to isoCodeiso•
Code LanguageCode! 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
- Anchor to marketmarket•Market!non-nullDeprecated
- Anchor to presentmentCurrencyRatepresentment•
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.
- Anchor to shopshop•Shop!non-null
Information about the shop where the Function is running, including the shop's timezone setting and associated metafields.
- Anchor to localTimelocal•
Time LocalTime! non-null The current time based on the store's timezone setting.
- Anchor to datedate•Date!non-null
The current date relative to the parent object.
- Anchor to dateTimeAfterdate•
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.
- Anchor to dateTimeBeforedate•
Time Before Boolean!non-null Returns true if the current date and time is before the given date and time, and false otherwise.
- Anchor to dateTimeBetweendate•
Time Between Boolean!non-null Returns true if the current date and time is between the two given date and times, and false otherwise.
- Anchor to timeAftertime•
After Boolean!non-null Returns true if the current time is at or past the given time, and false otherwise.
- Anchor to timeBeforetime•
Before Boolean!non-null Returns true if the current time is at or past the given time, and false otherwise.
- Anchor to timeBetweentime•
Between Boolean!non-null Returns true if the current time is between the two given times, and false otherwise.
- Anchor to metafieldmetafield•Metafield
A custom field that stores additional information about a Shopify resource, such as products, orders, and many more. Using metafields with Shopify Functions enables you to customize the checkout experience.
- Anchor to namespacenamespace•String
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts between different apps or different parts of the same app. If omitted, then the app-reserved namespace is used.
- •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
.
Arguments
- Anchor to jsonValuejson•
Value JSON!non-null The data that's stored in the metafield, using JSON format.
- Anchor to typetype•String!non-null
The type of data that the metafield stores in the
value
field.- Anchor to valuevalue•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.
Fields
- Anchor to triggeringDiscountCodetriggering•
Discount Code String The discount code entered by a customer, which caused the Discount Function) to run. This input is only available in the
cart.lines.discounts.generate.run
andcart.delivery-options.discounts.generate.run
extension targets.
Anchor to Delivery run FunctionDelivery run Function
The Function processes input schema data to calculate and allocate shipping discounts across cart lines, handling both fixed and percentage-based discounts while respecting discount caps and displaying messages associated with the discount.
This return must follow the schema defined in the CartDeliveryOptionsDiscountsGenerateRunResult
object.
- Anchor to CartDeliveryOptionsDiscountsGenerateRunResultCartOBJECT
Delivery Options Discounts Generate Run Result The
CartDeliveryOptionsDiscountsGenerateRunResult
object is the output of the Function run target. The object contains the operations to generate, validate, and apply shipping discounts to the cart.- Anchor to operationsoperations•[Delivery
Operation!]! non-null An ordered list of operations to generate delivery discounts, such as validating and applying discounts to the cart.
- Anchor to deliveryDiscountsAdddelivery•
Discounts Add DeliveryDiscounts Add Operation Applies delivery discounts to a cart that share a method for determining which shipping and delivery discounts to apply when multiple discounts are eligible.
- Anchor to candidatescandidates•[Delivery
Discount Candidate!]! non-null The list of discounts that are eligible to be applied to a delivery.
- Anchor to associatedDiscountCodeassociated•
Discount Code AssociatedDiscount Code The discount code that's eligible to be applied to a delivery.
- Anchor to codecode•String!non-null
The discount code.
- Anchor to messagemessage•String
A notification that informs customers about available discounts. The message is displayed on the Cart page. For example, "Save 20% on all t-shirts."
- Anchor to targetstargets•[Delivery
Discount Candidate Target!]! non-null The targets of the discount that are eligible to be applied to a delivery.
- Anchor to deliveryGroupdelivery•
Group DeliveryGroup Target A method for applying a discount to a delivery group. 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.
- •ID!non-null
The ID of the target delivery group.
- •
- Anchor to deliveryOptiondelivery•
Option DeliveryOption Target A method for applying a discount to a delivery option within a delivery group. Delivery options are the different ways that customers can choose to have their orders shipped. Examples of delivery options include express shipping or standard shipping.
- Anchor to handlehandle•Handle!non-null
The handle of the target delivery option.
- Anchor to valuevalue•Delivery
Discount Candidate Value! non-null The value of the discount that's eligible to be applied to a delivery.
- Anchor to fixedAmountfixed•
Amount FixedAmount A fixed amount value.
- Anchor to amountamount•Decimal!non-null
The fixed amount value of the discount, in the currency of the cart.
The amount must be greater than or equal to 0.
- Anchor to percentagepercentage•Percentage
A percentage value.
- Anchor to valuevalue•Decimal!non-null
The percentage value.
The value is validated against: >= 0 and <= 100.
- Anchor to selectionStrategyselection•
Strategy DeliveryDiscount Selection Strategy! non-null The method for determining which shipping and delivery discounts to apply when multiple discounts are eligible. For example, when the "ALL" strategy is selected, every shipping and delivery discount that qualifies is applied to the cart (for example, free shipping on orders over $50 and $5 off express shipping). This controls how shipping and delivery discounts interact when multiple conditions are satisfied simultaneously.
ALL
- Anchor to enteredDiscountCodesAcceptentered•
Discount Codes Accept EnteredDiscount Codes Accept Operation An operation that selects which entered discount codes to accept. Use this to validate discount codes from external systems.
- Anchor to codescodes•[Discount
Code!]! non-null The list of discount codes to accept.
- Anchor to codecode•String!non-null
The discount code.
Anchor to ValidationsValidations
The following is a summary of validations that are run on Functions results. Violating any of the following checks will yield an error when the Function runs:
- There can only be one of each operation (
addDiscountCodeValidations
,addDeliveryDiscounts
,addOrderDiscounts
, oraddProductDiscounts
) in a single Function result. addDiscountCodeValidations.codes
must only contain discount codes that are a subset ofenteredDiscountCodes
.- The
associatedDiscountCode.code
field in theaddProductDiscounts
,addOrderDiscounts
andaddDeliveryDiscounts
operations must only contain discount codes that are a subset ofaddDiscountCodeValidations.codes
.
Anchor to Migrate from deprecated Discount Function APIsMigrate from deprecated Discount Function APIs
The following sections outline the changes to the Product Discount, Order Discount, and Shipping Discount Function APIs, and how you can migrate from Shopify Scripts to Discount Functions.
Anchor to Product Discount Function API and Order Discount Function APIProduct Discount Function API and Order Discount Function API
The Product Discount Function API and Order Discount Function API are now merged into the Discount Function API in the cart.lines.discounts.generate.run
target. The target returns a CartLinesDiscountsGenerateRunResult
object, which returns an operations
field that includes fields that aren't present in the deprecated FunctionRunResult
object. The following table outlines key changes:
Anchor to Input queryInput query
Product Discount Function API and Order Discount Function API | Discount Function API | Description | Available in run target | Available in fetch target |
---|---|---|---|---|
discounts | operations | Lists of discount operations to be applied | Yes | No |
discountApplicationStrategy | ProductDiscountSelectionStrategy or OrderDiscountSelectionStrategy | Specifies which outputs to apply FIRST , MAXIMUM , or ALL (product discounts only) | No | Yes |
N/A | candidates | The list of product or order discount candidates to be applied. | Yes | No |
N/A | associatedDiscountCode | A list of valid discount codes that correspond to external discounts. This can only be used by Functions with network access. | No | Yes |
N/A | orderDiscountsAdd | A group of order discounts that share a selection strategy. | Yes | No |
N/A | productDiscountsAdd | A group of product discounts that share a selection strategy. | Yes | No |
Product Discount Function API and Order Discount Function API | Discount Function API | Description | Available in run target | Available in fetch target |
---|---|---|---|---|
discounts | operations | Lists of discount operations to be applied | Yes | No |
discountApplicationStrategy | ProductDiscountSelectionStrategy or OrderDiscountSelectionStrategy | Specifies which outputs to apply FIRST, MAXIMUM, or ALL (product discounts only) | No | Yes |
N/A | candidates | The list of product or order discount candidates to be applied. | Yes | No |
N/A | associatedDiscountCode | A list of valid discount codes that correspond to external discounts. This can only be used by Functions with network access. | No | Yes |
N/A | orderDiscountsAdd | A group of order discounts that share a selection strategy. | Yes | No |
N/A | productDiscountsAdd | A group of product discounts that share a selection strategy. | Yes | No |
Anchor to Shipping Discount Function APIShipping Discount Function API
The Shipping Discount Function API is now merged into the Discount Function API in the cart.delivery-options.discounts.generate.run
target. The target returns a CartDeliveryOptionsDiscountsGenerateRunResult
object, which includes fields that aren't present in the deprecated FunctionRunResult
object. The following table outlines key changes:
Anchor to Input queryInput query
Shipping Discount Function API | Discount Function API | Description | Available in run target | Available in fetch target |
---|---|---|---|---|
N/A | enteredDiscountCodes | The discounts entered at checkout by the buyer | No | Yes |
discountNode | discount | The discount associated to the Function that can be queried by the input query | Yes | Yes |
N/A | triggeringDiscountCode | The discount code that triggered the Function | Yes | Yes |
Anchor to CartDeliveryOptionsDiscountsGenerateRunResultCart Delivery Options Discounts Generate Run Result
Shipping Discount Function API | Discount Function API | Description | Available in run target | Available in fetch target |
---|---|---|---|---|
discounts | operations | Lists of discount operations to be applied | Yes | No |
N/A | deliveryDiscountsAdd | A group of delivery discounts that share a selection strategy. | Yes | No |
N/A | enteredDiscountCodesAccept | A list of valid discount codes that correspond to external discounts. | No | Yes |
N/A | candidates | The list of delivery discount candidates to be applied. | Yes | No |
N/A | selectionStrategy | The strategy that's applied to the list of discounts. | Yes | No |
productVariant | cartLineIds | Target identifiers for the discount application | Yes | No |
Anchor to Migrate from line item scripts to Discount FunctionsMigrate from line item scripts to Discount Functions
If you want to migrate an existing line item script to Shopify Functions, then you can use the following mappings:
Shopify Scripts method | Description | Shopify Functions target | Additional context |
---|---|---|---|
change_line_price | Applies a discount to a cart line such as a loyalty discount on a product by specifying a new reduced price, and a message either set by the developer or the merchant in the Function's configuration. | Discount | Apply order discounts or product discounts by specifying the OrderDiscountCandidateValue or ProductDiscountCandidateValue (percentage or fixedAmount off), and an optional message. |
split | Splits a product into multiple lines so that you can apply discounts to partial quantities. For example, if a customer has five t-shirts in their cart, you can apply a discount to only two items while keeping the other three at full price | Discount | Use the optional quantity field in the ProductDiscountCandidateTarget object to limit the number of units the discount may be applied to. |
change_properties | Adds or changes a line item property | Not available | Refer to applyAttributeChange in the checkout UI extensions API to apply attribute changes. |
reject | Disallows a discounts code from being applied at checkout | Not available | Use a Discount Function that contains the necessary logic. For example, you can use conditions to exclude a discount from applying, such as preventing a discount code when cart value is below $50 or when specific products are in the cart. |
Anchor to Migrate from shipping scripts to Discount FunctionsMigrate from shipping scripts to Discount Functions
To migrate an existing shipping script to Shopify Functions, then you can use the following mapping:
Shopify Scripts method | Description | Shopify Functions target |
---|---|---|
apply_discount | Applies a discount to a shipping rate | Shipping discounts |