The Cart Validation API provides cart.deliveryGroups but this field groups items by customer shipping address and delivery method, not by fulfillment location. This makes it impossible to validate the number of shipments an order will generate when items are fulfilled from multiple warehouse locations.
Background
According to the Function execution order documentation, Cart Validation functions run at step 7 (Verification), after step 3 (Fulfillment groups) where Fulfillment Constraints and Order Routing functions execute. This suggests that fulfillment group assignments should be available to Cart Validation functions.
However, the Cart Validation API schema does not expose fulfillment group data. The Input type only provides access to cart.deliveryGroups, which represents customer-facing delivery characteristics, not internal fulfillment assignments.
The problem
When a merchant wants to limit the number of shipments per order (a common requirement for operational efficiency and shipping cost management), there is currently no way to implement this validation using Cart Validation functions.
Current behavior
Consider a cart with three items that will ship from three different warehouse locations:
At checkout time:
-
Shopify’s checkout UI displays: “Your order will arrive in 3 shipments”
-
Cart Validation function receives:
cart.deliveryGroupswith 1 delivery group (same customer address, same shipping method) -
The function cannot detect the 3-shipment split
Result: The validation function sees 1 delivery group and allows checkout, even though the merchant’s limit is 2 shipments. The order is created with 3 fulfillments, exceeding the merchant’s operational capacity.
What we need
Access to fulfillment group count at validation time, similar to how Order Routing functions receive fulfillmentGroups: [FulfillmentGroup!]! in their Input schema.
Use case
Merchants with multiple warehouse locations often need to limit how many separate shipments a single order can generate. This is important for:
-
Operational capacity: Each shipment requires picking, packing, and shipping labor
-
Cost control: Multiple shipments increase shipping and handling costs
-
Customer experience: Merchants may prefer to decline orders that would fragment into too many packages
Currently, merchants can see that checkout will generate multiple shipments (visible in the checkout UI), but they cannot programmatically validate or block checkout based on this information.
Proposed solution
Add fulfillment group data to the Cart Validation API schema, either by:
-
Adding
fulfillmentGroups: [FulfillmentGroup!]!to theInputtype (similar to Order Routing functions) -
Adding a
fulfillmentGroupCount: Int!field to theCarttype -
Modifying
CartDeliveryGroupto include fulfillment location information
Any of these approaches would enable validation functions to count the actual number of shipments an order will generate.
Additional context
The Function execution order documentation states that Cart Validation runs after fulfillment group assignment. The data exists in Shopify’s backend at this point (evidenced by the checkout UI displaying shipment counts), but the Cart Validation API schema does not expose it.