Delivery Customization Functions: OutputTooLargeError

Topic summary

Issue: A Shopify Delivery Customization Function throws “The output size limit of 20000 bytes was exceeded” when attempting to hide all shipping rates in a zone that has 250 rates (the documented maximum).

Context: The author expects to handle all 250 rates but hits the 20 KB output cap when trying to suppress them. They wonder if the output can be minimized by removing structures or shortening names (e.g., renaming OptionHandleDelivery) to fit within the limit.

Key questions:

  • Can payload size be reduced (e.g., shorter handles/titles) within the function’s schema?
  • Are there best practices or workarounds for managing/hiding many rates without exceeding the 20 KB limit?

Status: No confirmed solution or guidance yet; the author is seeking advice and experiences. Discussion remains open.

Summarized with AI on December 23. AI used: gpt-5.

Hi everyone,

I’m facing an issue with a Shopify Function where I add 250 rates in a zone (the maximum limit). However, when I try to hide them all if needed, I encounter the following error:

The output size limit of 20000 bytes was exceeded.

I thought it should be possible to handle all 250 rates, but this limit is causing problems.

Is there a way to minimize the output by removing unnecessary structures or abbreviating names? For instance, renaming OptionHandleDelivery to something shorter.

Has anyone else encountered this issue, and is there a solution to make it work within the size limit?

Thanks in advance!