Shopify Functions bug - delivery groups array is empty

Topic summary

Issue: In a checkout reached via “Send invoice” for an unpaid order, the Payment Customization function sees deliveryGroups as empty, despite a delivery method being preselected. This prevents hiding disallowed payment methods based on delivery choice, risking buyers selecting invalid options.

Context/Terms: deliveryGroups is the checkout data structure listing selected/available delivery methods. Payment Customization API is a Shopify Functions API used to show/hide payment methods. Draft orders are invoice-style orders with API limitations.

Positions:

  • One response cites official docs: Payment Customization API doesn’t support draft orders, implying invoice checkouts fall under this limitation.
  • The original poster argues the order isn’t a draft (it already exists), notes the function runs (even throws an error), and suspects a different bug.
  • Another reply links a related Checkout UI Extensions bug that might share the root cause.

Status: Unresolved. No confirmed workaround. Open questions: whether invoice checkout uses a draft-like flow causing the limitation, or if there’s a bug in deliveryGroups population.

Summarized with AI on January 9. AI used: gpt-5.

Currently, I am working on an app that makes use of Shopify Functions and I have a question regarding payment customization.

I have noticed that the deliveryGroups array is empty when a buyer visits the checkout page sent through the “Send invoice” button on unpaid orders, despite a delivery method being preselected at that stage of the checkout. I suspect this to be a bug.

This issue creates a problem as we have a function that hides payment methods based on the selected delivery method. If we do not receive information about the selected delivery method, no payment method will be hidden, which means that the buyer can select a payment method that is not allowed for a specific delivery method.

Is there a way to resolve this issue?

Thank you.

The Payment Customization API doesn’t currently support draft orders.

https://shopify.dev/docs/api/functions/reference/payment-customization#limitations

@agastify , I find this situation perplexing because when the merchant clicks “Send invoice” for an unpaid order, the order already exists in the system and is not considered a draft. We can confirm that the function has been executed as it has thrown an error. Therefore, I suspect that the issue may lie elsewhere.

Might have the same underlying cause as this checkout UI extensions bug.