Matching DeliveryMethodDefinition to its CartDeliveryOption (GraphQL to Function Input)

Hi there!

I’m working on an app to customize delivery options where I pull the existing options from GraphQL’s DeliveryMethodDefinition to determine customization of shipping options on checkout.

Where I’ve run into trouble is pairing the Delivery Customization API Function Input CartDeliveryOption to the GraphQL equivalent DeliveryMethodDefinition.

For some reason the CartDeliveryOption doesn’t reference the DeliveryMethodDefinition ID, and only has properties like title or cost in common (which are not unique).

I do see a handle on the Function Input which seems unique but it’s not available in GraphQL.

Anyone run into this before? Any thoughts?

References:
GraphQL DeliveryMethodDefinition
Function Input CartDeliveryOption

Bumping this as I’ve had a few merchant complains related to it.

As a workaround I’ve resorted to using the title field as a ‘unique’ identifier which has come with some consequences. Any response from Shopify devs around when we could expect we could close the loop on this customization?

Seems crazy to give us a Delivery Customization API yet not directly show a link to the underlying Delivery Methods which merchants setup.

Hi Majd,

I’ve connected with the relevant team on this and will update here with their recommendation. In the meantime, would the code field on the CartDeliveryOption object match up with anything you could use?

Hi Liam, thanks for checking with the team. I’ve looked into the code field however I don’t see where this is generated and how it’s linked? It seems like an arbitrary ID that’s not referenced in the DeliveryMethod

Hi again Majd,

So it looks like the current state is actually intentional, our product team have said that Delivery Customization is a buyer facing checkout UI customisation – it’s for tweaking presentation rather than really changing business logic.

Delivery Method Defitions are the business logic, but there’s isn’t a one-to-one mapping into options because methods are filtered and consolidated into options before they are presented to user.

If you could describe your usecase a bit more and what you’re trying to achieve that will give us a better sense on the best approach here.