How to query deliveryOptions.handle via shopify admin API

23 views Asked by At

I'm trying to build a discount app which gives free shipping on a certain shipping method when items with a certain tag are in the cart using shopify functions/shipping discount api. Currently, I received a cart.deliveryGroups.deliveryOptions.handle from on function input:

"deliveryOptions": [
          {
            "handle": "16c3896838b1c095431f263d073856c9-73a2bf35e295daaa5f6254f4ae9788b8",
            "title": "Standard",
            "code": "Standard",
            "deliveryMethodType": "SHIPPING",
            "description": ""
          },

And I applied a discount using discout.targets.deliveryOption.handle and it works great because I basically hardcoded handle variable in my code. Questions is how can I query what deliveryOptions handles are available via admin API when I built UI for my app?

I want user in admin ui be able to select which shipping method to make free, and in order to do that i need shipping method handle(or at least i think i need that, maybe it's done some other way)?

Tried reading docs, but i can't find connection between admin api and shippin discount functions api.

0

There are 0 answers