Menu
draftOrderAvailableDeliveryOptions
Available delivery options for a DraftOrder based on the provided input. The query returns shipping rates, local delivery rates, and pickup locations that merchants can choose from when creating draft orders.
Use it in a workflow
- Add a step and choose the Shopify connector.
- Pick the draftOrderAvailableDeliveryOptions action (under Draft).
- Fill in the fields below, then reference the result from later steps as
{{draftorderavailabledeliveryoptions.response.data}}.
Query
This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.
query DraftOrderAvailableDeliveryOptions($input: DraftOrderAvailableDeliveryOptionsInput!, $search: String, $localPickupFrom: Int, $localPickupCount: Int, $sessionToken: String) {
draftOrderAvailableDeliveryOptions(
input: $input
search: $search
localPickupFrom: $localPickupFrom
localPickupCount: $localPickupCount
sessionToken: $sessionToken
) {
availableLocalDeliveryRates {
code
handle
price {
amount
currencyCode
}
source
title
}
availableLocalPickupOptions {
code
distanceFromBuyer {
unit
value
}
handle
instructions
locationId
source
title
}
availableShippingRates {
code
handle
price {
amount
currencyCode
}
source
title
}
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"input": {
"appliedDiscount": {
"value": 0,
"valueType": "FIXED_AMOUNT",
"amount": "string",
"amountWithCurrency": {
"amount": "string",
"currencyCode": "string"
},
"description": "string",
"title": "string"
},
"discountCodes": [
"string"
],
"acceptAutomaticDiscounts": false,
"lineItems": [
{
"quantity": "string",
"appliedDiscount": "string",
"customAttributes": "string",
"grams": "string",
"originalUnitPrice": "string",
"originalUnitPriceWithCurrency": "string",
"requiresShipping": "string",
"sku": "string",
"taxable": "string",
"title": "string",
"variantId": "string",
"weight": "string"
}
],
"shippingAddress": {
"address1": "string",
"address2": "string",
"city": "string",
"company": "string",
"country": "string",
"countryCode": "AF",
"firstName": "string",
"id": "string",
"lastName": "string",
"phone": "string",
"province": "string",
"provinceCode": "string"
},
"marketRegionCountryCode": "AF",
"purchasingEntity": {
"customerId": "string",
"purchasingCompany": {
"companyId": "string",
"companyContactId": "string",
"companyLocationId": "string"
}
}
},
"search": "string",
"localPickupFrom": 0,
"localPickupCount": 0,
"sessionToken": "string"
}
Response
Read the result with {{draftorderavailabledeliveryoptions.response.data.data.draftOrderAvailableDeliveryOptions}}. If the API returns errors, the step fails and they are at {{draftorderavailabledeliveryoptions.response.data.errors}}.
Need more? See the Shopify guide for connection setup and behaviour shared by every action.
Was this page helpful?