draftOrder Available Delivery Options (spaces to beat Shopify's retarded title AI) doesn't show local pickup options

The draftOrderAvailableDeliveryOptions does not show local pickup options

query {

draftOrderAvailableDeliveryOptions(input:{

lineItems: [{

variantId: “gid://shopify/ProductVariant/X”,

quantity: 1

}]

}){

availableLocalDeliveryRates{

code

}

}

}

response:

{

“data”: {

“draftOrderAvailableDeliveryOptions”: {

“availableLocalDeliveryRates”:

}

},

“extensions”: {

“cost”: {

“requestedQueryCost”: 2,

“actualQueryCost”: 2,

“throttleStatus”: {

“maximumAvailable”: 20000.0,

“currentlyAvailable”: 19998,

“restoreRate”: 1000.0

}

}

}

}

Visiting the store page of the Variant ID shows local pickup options, so it’s enabled

Hey @Kunal_Gupta :waving_hand:

I think you’d just need to include a shipping address in that query like this:

query {
  draftOrderAvailableDeliveryOptions(input: {
    lineItems: [{
      variantId: "gid://shopify/ProductVariant/id-here",
      quantity: 1
    }],
    shippingAddress: {
      address1: "1234 Street Name",
      city: "Bothell",
      provinceCode: "WA",
      zip: "98012",
      countryCode: US
    }
  }) {
    availableLocalDeliveryRates {
      code
      title
      price {
        amount
        currencyCode
      }
    }
    availableShippingRates {
      code
      title
      price {
        amount
        currencyCode
      }
    }
  }
}

If the shipping address you include in the query (along with the variant) is within the local delivery radius for the local delivery-enabled fulfillment location, the local delivery rate should pop up in the response output. Hope this helps!

What version of the graphql api are you using? I can’t seem to find any documentation on the draftOrderAvailableDeliveryOptions query.

Hey @ozzyonfire :waving_hand: - right now this is only available in the unstable version of the API:

We generally don’t recommend using unstable features in production, but there is no “hard” limit in terms of doing that, it could just be risky.

This is for local PICKUP, not delivery. I tried this anyway, but it still did not surface the local pickup. I have a complete hack around your API that I use to supply customers with local pickup functionality for API generated orders, so I know it CAN work, it just doesn’t via the API.