# Function API Delivery customization issue

**URL:** <https://community.shopify.com/t/function-api-delivery-customization-issue/278461>\
**Category:** Functions\
**Tags:** third-party-apps\
**Created:** [December 19, 2023, 5:02am UTC](https://community.shopify.com/t/function-api-delivery-customization-issue/278461 "2023-12-19T05:02:44Z")\
**Posts on this page:** 8\
**Page:** 1

## AI-generated summary

A developer is experiencing a bug with Shopify's Delivery Customization Function API when hiding shipping rates based on address content (specifically "PO Box").

**Core Issue:**
- The function successfully hides all shipping rates when an address contains "PO Box"
- However, when the address is changed or "PO Box" is removed, shipping rates don't reappear
- Rates only return after manually refreshing the checkout page

**Key Details:**
- The function works correctly when hiding only 1 rate out of 2 available rates
- Problem occurs specifically when hiding *all* shipping rates
- Video example and request IDs provided for troubleshooting
- Initially worked with address field changes, but now fails on both single-page and 3-step checkout

**Current Status:**
- Shopify staff member (Nick_Wesselman) confirmed reproduction of the issue
- Reported internally as a known bug: address changes are not re-triggering delivery customization functions
- Awaiting resolution from appropriate team
- Issue is impacting production users who had to switch from single-page to 3-step checkout as a workaround

<div class="post-metadata">

**Author:** ![siddhu\_kevadiya](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@siddhu\_kevadiya](https://community.shopify.com/u/siddhu_kevadiya)\
**Post date:** [December 19, 2023, 5:02am UTC](https://community.shopify.com/t/function-api-delivery-customization-issue/278461/1 "2023-12-19T05:02:44Z")

</div>

Facing an issue on delivery customisation!

> Hide all shipping method if address contains “po box”.

It works that hide all shipping rates if address contains “po box” but at checkout if address change, like remove PO Box or change address completely, it does not showing any shipping rates!

only works if refresh checkout page!

I am using [https://shopify.dev/docs/api/functions/reference/delivery-customization/graphql/common-objects/hideoperation](https://shopify.dev/docs/api/functions/reference/delivery-customization/graphql/common-objects/hideoperation)

See a video for example: [https://www.loom.com/share/ecaf01bbd419488284cfabbcf46fd3af](https://www.loom.com/share/ecaf01bbd419488284cfabbcf46fd3af)

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Nick\_Wesselman](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/nick_wesselman/32/309011_2.png) [@Nick\_Wesselman](https://community.shopify.com/u/Nick_Wesselman)\
**Post date:** [December 19, 2023, 2:51pm UTC](https://community.shopify.com/t/function-api-delivery-customization-issue/278461/2 "2023-12-19T14:51:06Z")

</div>

I’m unable to replicate this issue, can you provide an example of the function output that causes this for you, and the X-Request-ID header value that you see in checkout when it occurs?

---

<div class="post-metadata">

**Author:** ![siddhu\_kevadiya](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@siddhu\_kevadiya](https://community.shopify.com/u/siddhu_kevadiya)\
**Post date:** [December 20, 2023, 7:27am UTC](https://community.shopify.com/t/function-api-delivery-customization-issue/278461/3 "2023-12-20T07:27:47Z")

</div>

Hello @Nick_Wesselman

Actually once display an error, Shopify does not display logs unless refresh the page!

it display logs once rule execute to hide rates. and once hide all rates, it could not back to display rates unless refresh the page.

work with this if enter “PO Box”

9914d674-24c5-4133-88c1-5d593c6dbbdd

then no log unless I fresh checkout page.

ID: 76bbeddd-eb7a-4faf-a02c-40dbf3986c5d

Please make sure to create a rule that hides all shipping rates.

if there are 2 rates and hide 1 only using rule, then it works fine.

Let me know if still more details.

---

<div class="post-metadata">

**Author:** ![Nick\_Wesselman](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/nick_wesselman/32/309011_2.png) [@Nick\_Wesselman](https://community.shopify.com/u/Nick_Wesselman)\
**Post date:** [December 20, 2023, 2:00pm UTC](https://community.shopify.com/t/function-api-delivery-customization-issue/278461/4 "2023-12-20T14:00:56Z")

</div>

OK so this wasn’t clear at all to me – you want to hide all shipping rates? And the actual bug is that the rates aren’t coming back after removing PO Box?

---

<div class="post-metadata">

**Author:** ![Nick\_Wesselman](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/nick_wesselman/32/309011_2.png) [@Nick\_Wesselman](https://community.shopify.com/u/Nick_Wesselman)\
**Post date:** [December 20, 2023, 2:29pm UTC](https://community.shopify.com/t/function-api-delivery-customization-issue/278461/5 "2023-12-20T14:29:05Z")

</div>

I’m able to reproduce the issue now –

1. Create a function that hides all delivery options based on matching ‘po box’ in address
2. Test with that string in checkout — delivery options are removed and ‘Shipping not available’ appears (works as expected)
3. Remove that string from the address
  1. EXPECTED: Delivery options return
  2. ACTUAL: Error message remains until you hard refresh the page

I’ve reported the issue internally to the appropriate team, will let you know if I hear anything.

---

<div class="post-metadata">

**Author:** ![Nick\_Wesselman](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/nick_wesselman/32/309011_2.png) [@Nick\_Wesselman](https://community.shopify.com/u/Nick_Wesselman)\
**Post date:** [December 21, 2023, 6:57pm UTC](https://community.shopify.com/t/function-api-delivery-customization-issue/278461/6 "2023-12-21T18:57:35Z")

</div>

Confirmed that address changes not re-triggering functions is a known issue, if I hear back on resolution I will post here.

---

<div class="post-metadata">

**Author:** ![siddhu\_kevadiya](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@siddhu\_kevadiya](https://community.shopify.com/u/siddhu_kevadiya)\
**Post date:** [December 25, 2023, 6:29am UTC](https://community.shopify.com/t/function-api-delivery-customization-issue/278461/7 "2023-12-25T06:29:07Z")

</div>

It was working with changing any value in inputs on customer information fields. I am 200% sure.

because we have 3 users they are using this function and right now they have to switch 3 step checkout after facing issue. they preferred one page checkout.

---

<div class="post-metadata">

**Author:** ![siddhu\_kevadiya](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@siddhu\_kevadiya](https://community.shopify.com/u/siddhu_kevadiya)\
**Post date:** [December 25, 2023, 12:56pm UTC](https://community.shopify.com/t/function-api-delivery-customization-issue/278461/8 "2023-12-25T12:56:47Z")

</div>

Right now the same issue on 3 steps checkout as well 😞

even I change name or address, function does not execute.
