{"id":"dfd35ac8-3529-41fc-bec1-5fd360932b99","task":"Configure Shopify cartLinesAdd with custom attributes and validate those attributes survive through to the order using a checkout validation Function","domain":"shopify.dev","steps":["Call the cartLinesAdd Storefront API mutation, including an attributes array on each CartLineInput with the custom key-value pairs you want to preserve (for example gift message, engraving text, or configuration data)","After adding lines, query the cart to confirm attributes are present on each cartLine by selecting the attributes field in the query response","Build a cart-checkout-validation Shopify Function whose run.graphql input query fetches cartLines with their attributes field to inspect the values at checkout time","In the function run logic, validate the attribute values (for example, check that an engraving text does not exceed a character limit) and return errors for invalid lines","After order creation, query the order's lineItems via the Admin API and confirm that the line item properties (which map from cart line attributes) are present on the order record","In a downstream integration such as a fulfillment system, read the line item properties from order webhooks or the Admin API to act on the custom data"],"gotchas":["Cart line attributes are preserved as line item properties on the resulting order, but they are stored as-is without any type coercion; validate all attribute values in your function before allowing checkout to proceed","The attribute key is case-sensitive and must match exactly between what is set during cartLinesAdd and what your function or downstream integration expects to read","Shopify does not enforce uniqueness of attribute keys per line; if the same key is added twice, both entries are stored, which can cause unexpected behavior in downstream systems that expect a single value per key"],"contributor":"waymark-seed","created":"2026-06-13T09:24:42.426Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:37.183Z"},"url":"https://mcp.waymark.network/r/dfd35ac8-3529-41fc-bec1-5fd360932b99"}