Getting started with delivery profiles

You can use delivery profiles to manage advanced shipping information in Shopify. Shops that use delivery profiles gain the ability to create shipping rates per product variant and location.

Delivery profiles

Delivery profiles store the information about what delivery methods and rates apply to specific products:

Profiles

Products that require shipping are associated to location groups, delivery zones, and delivery methods within a delivery profile:

Delivery profile Represents a set of shipping settings for a set of product variants. For example, you might have a delivery profile for heavy variants and another for fragile variants.
Location group Represents a set of locations that ship the product variants to the same delivery zones. For example, you might have a location group for the Americas that ships to Canada and Germany, and another location group for Europe that also ships to Canada and Germany.
Delivery zone Represents a group of countries where the variants in the delivery profile are shipped to. For example, you might ship products to Canada.
Delivery methods Delivery methods specify the static rates or carrier-calculated rates (participant) for the delivery zones. For static rates, you can set conditional rates that take effect only if certain conditions are met. For example, you can specify a condition that applies free shipping when a cart's total is greater than or equal to $100. Shipping rates are surfaced at checkout to the customer.

Query walkthrough

The following query walkthrough demonstrates the different parts of a delivery profile.

Delivery profiles

The following query returns a delivery profile with its ID, name and default setting. Product variants stay in the default profile until they are added to another delivery profile. The example response indicates that the default profile is returned.

POST /admin/api/unstable/graphql.json

query {
  deliveryProfiles (first: 1) {
    edges {
      node {
        id
        name
        default
      }
    }
  }
}

View response

JSON response

{
  "data": {
    "deliveryProfiles": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/DeliveryProfile/4227128",
            "name": "Default",
            "default": true
          }
        }
      ]
    }
  },
  ...
}

Profile items

Product variants are associated to delivery profiles using the profileItems object. Each profile item can include an array of objects where each object includes a product and a list of associated variants.

POST /admin/api/unstable/graphql.json

query {
  deliveryProfiles (first: 1) {
    edges {
      node {
        profileItems (first: 2) {
          edges {
            node {
              product {
                id
                handle
              }
              variants (first: 2) {
                edges {
                  node {
                    id
                    title
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}       

View response

JSON response

{
  "data": {
    "deliveryProfiles": {
      "edges": [
        {
          "node": {
            "profileItems": {
              "edges": [
                {
                  "node": {
                    "product": {
                      "id": "gid://shopify/Product/8092548998",
                      "handle": "ajtestproduct"
                    },
                    "variants": {
                      "edges": [
                        {
                          "node": {
                            "id": "gid://shopify/ProductVariant/26669237382",
                            "title": "1"
                          }
                        },
                        {
                          "node": {
                            "id": "gid://shopify/ProductVariant/27700365318",
                            "title": "2"
                          }
                        }
                      ]
                    }
                  }
                },
                {
                  "node": {
                    "product": {
                      "id": "gid://shopify/Product/8104668422",
                      "handle": "burton-custom-freestlye-151"
                    },
                    "variants": {
                      "edges": [
                        {
                          "node": {
                            "id": "gid://shopify/ProductVariant/26756068422",
                            "title": "First"
                          }
                        },
                        {
                          "node": {
                            "id": "gid://shopify/ProductVariant/26756068550",
                            "title": "Second"
                          }
                        }
                      ]
                    }
                  }
                }
              ]
            }
          }
        }
      ]
    }
  },
  ...
}

Profile location groups

Profile location groups represent groupings of origin locations that have common shipping properties within a delivery profile.

POST /admin/api/unstable/graphql.json

query {
  deliveryProfiles (first: 1) {
    edges {
      node {
        profileLocationGroups {
          locationGroup {
            id
            locations (first: 3) {
              edges {
                node {
                  id
                  name
                }
              }
            }
          }
        }
      }
    }
  }
}

View response

JSON response

{
  "data": {
    "deliveryProfiles": {
      "edges": [
        {
          "node": {
            "profileLocationGroups": [
              {
                "locationGroup": {
                  "id": "gid://shopify/DeliveryLocationGroup/3014712",
                  "locations": {
                    "edges": [
                      {
                        "node": {
                          "id": "gid://shopify/Location/45141830",
                          "name": "99 chemin mahon"
                        }
                      },
                      {
                        "node": {
                          "id": "gid://shopify/Location/9562054",
                          "name": "mahon"
                        }
                      }
                    ]
                  }
                }
              },
              {
                "locationGroup": {
                  "id": "gid://shopify/DeliveryLocationGroup/6946872",
                  "locations": {
                    "edges": [
                      {
                        "node": {
                          "id": "gid://shopify/Location/17225842744",
                          "name": "downtown location"
                        }
                      }
                    ]
                  }
                }
              }
            ]
          }
        }
      ]
    }
  },
  ...
}

Location group zones

The locationGroupZones object represents one or more delivery zones where products can ship to. Each profile location group can have multiple location group zones.

POST /admin/api/unstable/graphql.json

query {
  deliveryProfiles (first: 1) {
    edges {
      node {
        profileLocationGroups {
          locationGroupZones (first: 2) {
            edges {
              node {
                zone {
                  id
                  name
                  countries {
                    name
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

View response

JSON response

{
  "data": {
    "deliveryProfiles": {
      "edges": [
        {
          "node": {
            "profileLocationGroups": [
              {
                "locationGroupZones": {
                  "edges": [
                    {
                      "node": {
                        "zone": {
                          "id": "gid://shopify/DeliveryZone/9961528",
                          "name": "Domestic",
                          "countries": [
                            {
                              "name": "Canada"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "node": {
                        "zone": {
                          "id": "gid://shopify/DeliveryZone/10027064",
                          "name": "Europe",
                          "countries": [
                            {
                              "name": "United Kingdom"
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              },
              {
                "locationGroupZones": {
                  "edges": [
                    {
                      "node": {
                        "zone": {
                          "id": "gid://shopify/DeliveryZone/15368248",
                          "name": "germany",
                          "countries": [
                            {
                              "name": "Germany"
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  },
  ...
}

Method definitions

Method definitions represent delivery methods within the context of a delivery profile, location group, and zone. Each method definition includes a name property, representing the name of the delivery method that is displayed to the customer at checkout.

POST /admin/api/unstable/graphql.json

query {
  deliveryProfiles (first: 1) {
    edges {
      node {
        profileLocationGroups {
          locationGroupZones (first: 3) {
            edges {
              node {
                methodDefinitions (first:3) {
                  edges {
                    node {
                      id
                      name
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

View response

JSON response

{
  "data": {
    "deliveryProfiles": {
      "edges": [
        {
          "node": {
            "profileLocationGroups": [
              {
                "locationGroupZones": {
                  "edges": [
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": [
                            {
                              "node": {
                                "id": "gid://shopify/DeliveryMethodDefinition/24739896",
                                "name": "Standard Shipping"
                              }
                            },
                            {
                              "node": {
                                "id": "gid://shopify/DeliveryMethodDefinition/24772664",
                                "name": "Heavy Goods Shipping"
                              }
                            },
                            {
                              "node": {
                                "id": "gid://shopify/DeliveryMethodDefinition/24805432",
                                "name": "carrier service app"
                              }
                            }
                          ]
                        }
                      }
                    },
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": [
                            {
                              "node": {
                                "id": "gid://shopify/DeliveryMethodDefinition/24641592",
                                "name": "price based"
                              }
                            }
                          ]
                        }
                      }
                    },
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": [
                            {
                              "node": {
                                "id": "gid://shopify/DeliveryMethodDefinition/24674360",
                                "name": "International Shipping"
                              }
                            },
                            {
                              "node": {
                                "id": "gid://shopify/DeliveryMethodDefinition/24707128",
                                "name": "carrier service app"
                              }
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              },
              {
                "locationGroupZones": {
                  "edges": [
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": []
                        }
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  },
  ...
}

Method conditions

Method conditions can be used to make rates available at checkout when certain conditions apply. For example, you can set a price-based condition that displays the rate only when a cart's total passes a price threshold. Method conditions can be applied only to statically defined rates.

POST /admin/api/unstable/graphql.json

query {
  deliveryProfiles (first: 1) {
    edges {
      node {
        profileLocationGroups {
          locationGroupZones (first: 2) {
            edges {
              node {
                methodDefinitions (first:2) {
                  edges {
                    node {
                      methodConditions {
                        id
                        operator
                        conditionCriteria {
                          ... on Weight {
                            value
                          }
                          ... on MoneyV2 {
                            amount
                            currencyCode
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

View response

JSON response

{
  "data": {
    "deliveryProfiles": {
      "edges": [
        {
          "node": {
            "profileLocationGroups": [
              {
                "locationGroupZones": {
                  "edges": [
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": [
                            {
                              "node": {
                                "methodConditions": [
                                  {
                                    "id": "gid://shopify/DeliveryCondition/19595320",
                                    "operator": "GREATER_THAN_OR_EQUAL_TO",
                                    "conditionCriteria": {
                                      "value": 0
                                    }
                                  },
                                  {
                                    "id": "gid://shopify/DeliveryCondition/19628088",
                                    "operator": "LESS_THAN_OR_EQUAL_TO",
                                    "conditionCriteria": {
                                      "value": 5
                                    }
                                  }
                                ]
                              }
                            },
                            {
                              "node": {
                                "methodConditions": [
                                  {
                                    "id": "gid://shopify/DeliveryCondition/19660856",
                                    "operator": "GREATER_THAN_OR_EQUAL_TO",
                                    "conditionCriteria": {
                                      "value": 5
                                    }
                                  },
                                  {
                                    "id": "gid://shopify/DeliveryCondition/19693624",
                                    "operator": "LESS_THAN_OR_EQUAL_TO",
                                    "conditionCriteria": {
                                      "value": 20
                                    }
                                  }
                                ]
                              }
                            }
                          ]
                        }
                      }
                    },
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": [
                            {
                              "node": {
                                "methodConditions": [
                                  {
                                    "id": "gid://shopify/DeliveryCondition/19464248",
                                    "operator": "GREATER_THAN_OR_EQUAL_TO",
                                    "conditionCriteria": {
                                      "amount": "0.0",
                                      "currencyCode": "USD"
                                    }
                                  },
                                  {
                                    "id": "gid://shopify/DeliveryCondition/19497016",
                                    "operator": "LESS_THAN_OR_EQUAL_TO",
                                    "conditionCriteria": {
                                      "amount": "100.0",
                                      "currencyCode": "USD"
                                    }
                                  }
                                ]
                              }
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              },
              {
                "locationGroupZones": {
                  "edges": [
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": []
                        }
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  },
  ...
}

Rate provider

The rates that are displayed at checkout are found in the rateProvider object. Shopify supports two types of rates:

  • DeliveryRateDefinition: Static rates, stored within Shopify.
  • DeliveryParticipant: Dynamic rates, retrieved with the CarrierService API.

The following example returns both static and dynamic rates:

POST /admin/api/unstable/graphql.json

query {
  deliveryProfiles(first: 1) {
    edges {
      node {
        profileLocationGroups {
          locationGroupZones(first: 3) {
            edges {
              node {
                methodDefinitions(first: 3) {
                  edges {
                    node {
                      rateProvider {
                        ... on DeliveryRateDefinition {
                          id
                          price {
                            amount
                          }
                        }
                        ... on DeliveryParticipant {
                          id
                          fixedFee {
                            amount
                            currencyCode
                          }
                          percentageOfRateFee
                          participantServices {
                            active
                            name
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

View response

JSON response

{
  "data": {
    "deliveryProfiles": {
      "edges": [
        {
          "node": {
            "profileLocationGroups": [
              {
                "locationGroupZones": {
                  "edges": [
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": [
                            {
                              "node": {
                                "rateProvider": {
                                  "id": "gid://shopify/DeliveryRateDefinition/13172792",
                                  "price": {
                                    "amount": "8.0"
                                  }
                                }
                              }
                            },
                            {
                              "node": {
                                "rateProvider": {
                                  "id": "gid://shopify/DeliveryRateDefinition/13205560",
                                  "price": {
                                    "amount": "18.0"
                                  }
                                }
                              }
                            },
                            {
                              "node": {
                                "rateProvider": {
                                  "id": "gid://shopify/DeliveryParticipant/11567160",
                                  "fixedFee": {
                                    "amount": "0.0",
                                    "currencyCode": "USD"
                                  },
                                  "percentageOfRateFee": 0,
                                  "participantServices": []
                                }
                              }
                            }
                          ]
                        }
                      }
                    },
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": [
                            {
                              "node": {
                                "rateProvider": {
                                  "id": "gid://shopify/DeliveryRateDefinition/13107256",
                                  "price": {
                                    "amount": "5.0"
                                  }
                                }
                              }
                            }
                          ]
                        }
                      }
                    },
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": [
                            {
                              "node": {
                                "rateProvider": {
                                  "id": "gid://shopify/DeliveryRateDefinition/13140024",
                                  "price": {
                                    "amount": "18.0"
                                  }
                                }
                              }
                            },
                            {
                              "node": {
                                "rateProvider": {
                                  "id": "gid://shopify/DeliveryParticipant/11534392",
                                  "fixedFee": {
                                    "amount": "0.0",
                                    "currencyCode": "USD"
                                  },
                                  "percentageOfRateFee": 0,
                                  "participantServices": []
                                }
                              }
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              },
              {
                "locationGroupZones": {
                  "edges": [
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": []
                        }
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  },
  ...
}

Create a delivery profile

To create a delivery profile, use the deliveryProfileCreate mutation, which accepts a profile argument as input.

The following mutation creates a delivery profile for products that ship from a single location to a new delivery zone for Canada.

The following list explains the important fields of the input object:

  • locationGroupsToCreate - Defines the locations that will be grouped together for the included zones.
  • zonesToCreate - Defines the countries for the zone and the delivery method.
  • methodDefinitionsToCreate - Specifies a static rate using rateDefinition or a carrier-provided rate using participant.

POST /admin/api/unstable/graphql.json

mutation {
  deliveryProfileCreate (
    profile: {
      name: "My Fulfillment Service's Profile",
      variantsToAssociate: [
        "gid://shopify/ProductVariant/13672596209720",
      ],
      locationGroupsToCreate: {
        locations: [
          # your location id
          "gid://shopify/Location/17225842744"
        ],
        zonesToCreate: [
          {
            name: "Canada",
            countries: [
              {
                code: CA
              }
            ],
            methodDefinitionsToCreate: [
              {
                name: "my_carrier_service_name"
                active: true,
                participant: {
                  # your carrier service id
                  carrierServiceId: "gid://shopify/DeliveryCarrierService/11499270"
                }
              }
            ]
          }
        ]
        }
    }
  )
  {
    profile {
      id
      name
      profileLocationGroups {
        locationGroup {
          id
          locations (first: 1, includeLegacy:true) {
            edges {
              node {
                id
                name
              }
            }
          }
        }
        locationGroupZones (first: 1) {
          edges {
            node {
              zone {
                name
                countries {
                  name
                }
              }
              methodDefinitions (first: 1) {
                edges {
                  node {
                    id
                    name
                    active
                    rateProvider {
                      ... on DeliveryParticipant {
                        id
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    userErrors {
      field
      message
    }
  }
}

View response

JSON response:

{
  "data": {
    "deliveryProfileCreate": {
      "profile": {
        "id": "gid://shopify/DeliveryProfile/7372856",
        "name": "My Fulfillment Service's Profile",
        "profileLocationGroups": [
          {
            "locationGroup": {
              "id": "gid://shopify/DeliveryLocationGroup/6094904",
              "locations": {
                "edges": [
                  {
                    "node": {
                      "id": "gid://shopify/Location/45141830",
                      "name": "150 Elgin"
                    }
                  }
                ]
              }
            },
            "locationGroupZones": {
              "edges": [
                {
                  "node": {
                    "zone": {
                      "name": "Canada",
                      "countries": [
                        {
                          "name": "Canada"
                        }
                      ]
                    },
                    "methodDefinitions": {
                      "edges": [
                        {
                          "node": {
                            "id": "gid://shopify/DeliveryMethodDefinition/35684408",
                            "name": "my_carrier_service_name",
                            "active": true,
                            "rateProvider": {
                              "id": "gid://shopify/DeliveryParticipant/13664312"
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              ]
            }
          }
        ]
      },
      "userErrors": []
    }
  },
  ...
}

List of Country and Province codes

This table contains the ISO codes for all countries and their subdivisions, for use with the countries field of zonesToCreate.

View table

Country Name ISO code
Afghanistan AF
Aland Islands AX
Albania AL
Algeria DZ
Andorra AD
Angola AO
Anguilla AI
Antigua And Barbuda AG
Argentina
Provinces
Name ISO code
Buenos Aires B
Catamarca K
Chaco H
Chubut U
Ciudad Autónoma de Buenos Aires C
Córdoba X
Corrientes W
Entre Ríos E
Formosa P
Jujuy Y
La Pampa L
La Rioja F
Mendoza M
Misiones N
Neuquén Q
Río Negro R
Salta A
San Juan J
San Luis D
Santa Cruz Z
Santa Fe S
Santiago Del Estero G
Tierra Del Fuego V
Tucumán T
AR
Armenia AM
Aruba AW
Australia
States and territories
Name ISO code
Australian Capital Territory ACT
New South Wales NSW
Northern Territory NT
Queensland QLD
South Australia SA
Tasmania TAS
Victoria VIC
Western Australia WA
AU
Austria AT
Azerbaijan AZ
Bahamas BS
Bahrain BH
Bangladesh BD
Barbados BB
Belarus BY
Belgium BE
Belize BZ
Benin BJ
Bermuda BM
Bhutan BT
Bolivia BO
Bonaire, Sint Eustatius and Saba BQ
Bosnia And Herzegovina BA
Botswana BW
Bouvet Island BV
Brazil
States
Name ISO code
Acre AC
Alagoas AL
Amapá AP
Amazonas AM
Bahia BA
Ceará CE
Distrito Federal DF
Espírito Santo ES
Goiás GO
Maranhão MA
Mato Grosso MT
Mato Grosso do Sul MS
Minas Gerais MG
Pará PA
Paraíba PB
Paraná PR
Pernambuco PE
Piauí PI
Rio Grande do Norte RN
Rio Grande do Sul RS
Rio de Janeiro RJ
Rondônia RO
Roraima RR
Santa Catarina SC
São Paulo SP
Sergipe SE
Tocantins TO
BR
British Indian Ocean Territory IO
Brunei BN
Bulgaria BG
Burkina Faso BF
Burundi BI
Cambodia KH
Canada
Provinces and territories
Name ISO code
Alberta AB
British Columbia BC
Manitoba MB
New Brunswick NB
Newfoundland NL
Northwest Territories NT
Nova Scotia NS
Nunavut NU
Ontario ON
Prince Edward Island PE
Quebec QC
Saskatchewan SK
Yukon YT
CA
Cape Verde CV
Cayman Islands KY
Central African Republic CF
Chad TD
Chile
Regions
Name ISO code
Antofagasta AN
Araucanía AR
Arica and Parinacota AP
Atacama AT
Aysén AI
Biobío BI
Coquimbo CO
Los Lagos LL
Los Ríos LR
Magallanes MA
Maule ML
Ñuble NB
O'Higgins LI
Santiago RM
Tarapacá TA
Valparaíso VS
CL
China
Provinces
Name ISO code
Anhui AH
Beijing BJ
Chongqing CQ
Fujian FJ
Gansu GS
Guangdong GD
Guangxi GX
Guizhou GZ
Hainan HI
Hebei HE
Heilongjiang HL
Henan HA
Hubei HB
Hunan HN
Inner Mongolia NM
Jiangsu JS
Jiangxi JX
Jilin JL
Liaoning LN
Ningxia NX
Qinghai QH
Shaanxi SN
Shandong SD
Shanghai SH
Shanxi SX
Sichuan SC
Tianjin TJ
Xinjiang XJ
Xizang YZ
Yunnan YN
Zhejiang ZJ
CN
Christmas Island CX
Cocos (Keeling) Islands CC
Colombia
Departments
Name ISO code
Amazonas AMA
Antioquia ANT
Arauca ARA
Atlántico ATL
Bogotá, D.C. DC
Bolívar BOL
Boyacá BOY
Caldas CAL
Caquetá CAQ
Casanare CAS
Cauca CAU
Cesar CES
Chocó CHO
Córdoba COR
Cundinamarca CUN
Guainía GUA
Guaviare GUV
Huila HUI
La Guajira LAG
Magdalena MAG
Meta MET
Nariño NAR
Norte de Santander NSA
Putumayo PUT
Quindío QUI
Risaralda RIS
San Andrés, Providencia y Santa Catalina SAP
Santander SAN
Sucre SUC
Tolima TOL
Valle del Cauca VAC
Vaupés VAU
Vichada VID
CO
Comoros KM
Congo CG
Congo, The Democratic Republic Of The CD
Cook Islands CK
Costa Rica CR
Croatia HR
Cuba CU
Curaçao CW
Cyprus CY
Czech Republic CZ
Côte dIvoireIvoire CI
Denmark DK
Djibouti DJ
Dominica DM
Dominican Republic DO
Ecuador EC
Egypt
Governorates
Name ISO code
6th of October SU
Al Sharqia SHR
Alexandria ALX
Aswan ASN
Asyut AST
Beheira BH
Beni Suef BNS
Cairo C
Dakahlia DK
Damietta DT
Faiyum FYM
Gharbia GH
Giza GZ
Helwan HU
Ismailia IS
Kafr el-Sheikh KFS
Luxor LX
Matrouh MT
Minya MN
Monufia MNF
New Valley WAD
North Sinai SIN
Port Said PTS
Qalyubia KB
Qena KN
Red Sea BA
Sohag SHG
South Sinai JS
Suez SUZ
EG
El Salvador SV
Equatorial Guinea GQ
Eritrea ER
Estonia EE
Ethiopia ET
Falkland Islands (Malvinas) FK
Faroe Islands FO
Fiji FJ
Finland FI
France FR
French Guiana GF
French Polynesia PF
French Southern Territories TF
Gabon GA
Gambia GM
Georgia GE
Germany DE
Ghana GH
Gibraltar GI
Greece GR
Greenland GL
Grenada GD
Guadeloupe GP
Guatemala
Departments
Name ISO code
Alta Verapaz AVE
Baja Verapaz BVE
Chimaltenango CMT
Chiquimula CQM
El Progreso EPR
Escuintla ESC
Guatemala GUA
Huehuetenango HUE
Izabal IZA
Jalapa JAL
Jutiapa JUT
Petén PET
Quetzaltenango QUE
Quiché QUI
Retalhuleu RET
Sacatepéquez SAC
San Marcos SMA
Santa Rosa SRO
Sololá SOL
Suchitepéquez SUC
Totonicapán TOT
Zacapa ZAC
GT
Guernsey GG
Guinea GN
Guinea Bissau GW
Guyana GY
Haiti HT
Heard Island And Mcdonald Islands HM
Holy See (Vatican City State) VA
Honduras HN
Hong Kong
Provinces
Name ISO code
Hong Kong Island HK
Kowloon KL
New Territories NT
HK
Hungary HU
Iceland IS
India
States and territories
Name ISO code
Andaman and Nicobar AN
Andhra Pradesh AP
Arunachal Pradesh AR
Assam AS
Bihar BR
Chandigarh CH
Chattisgarh CG
Dadra and Nagar Haveli DN
Daman and Diu DD
Delhi DL
Goa GA
Gujarat GJ
Haryana HR
Himachal Pradesh HP
Jammu and Kashmir JK
Jharkhand JH
Karnataka KA
Kerala KL
Lakshadweep LD
Madhya Pradesh MP
Maharashtra MH
Manipur MN
Meghalaya ML
Mizoram MZ
Nagaland NL
Orissa OR
Puducherry PY
Punjab PB
Rajasthan RJ
Sikkim SK
Tamil Nadu TN
Telangana TS
Tripura TR
Uttar Pradesh UP
Uttarakhand UK
West Bengal WB
IN
Indonesia
Provinces
Name ISO code
Aceh AC
Bali BA
Bangka Belitung BB
Banten BT
Bengkulu BE
Gorontalo GO
Jakarta JK
Jambi JA
Jawa Barat JB
Jawa Tengah JT
Jawa Timur JI
Kalimantan Barat KB
Kalimantan Selatan KS
Kalimantan Tengah KT
Kalimantan Timur KI
Kalimantan Utara KU
Kepulauan Riau KR
Lampung LA
Maluku MA
Maluku Utara MU
Nusa Tenggara Barat NB
Nusa Tenggara Timur NT
Papua PA
Papua Barat PB
Riau RI
Sulawesi Barat SR
Sulawesi Selatan SN
Sulawesi Tengah ST
Sulawesi Tenggara SG
Sulawesi Utara SA
Sumatra Barat SB
Sumatra Selatan SS
Sumatra Utara SU
Yogyakarta YO
ID
Iran, Islamic Republic Of IR
Iraq IQ
Ireland
Counties
Name ISO code
Carlow CW
Cavan CN
Clare CE
Cork CO
Donegal DL
Dublin D
Galway G
Kerry KY
Kildare KE
Kilkenny KK
Laois LS
Leitrim LM
Limerick LK
Longford LD
Louth LH
Mayo MO
Meath MH
Monaghan MN
Offaly OY
Roscommon RN
Sligo SO
Tipperary TA
Waterford WD
Westmeath WH
Wexford WX
Wicklow WW
IE
Isle Of Man IM
Israel IL
Italy
Provinces
Name ISO code
Agrigento AG
Alessandria AL
Ancona AN
Aosta AO
Arezzo AR
Ascoli Piceno AP
Asti AT
Avellino AV
Bari BA
Barletta-Andria-Trani BT
Belluno BL
Benevento BN
Bergamo BG
Biella BI
Bologna BO
Bolzano BZ
Brescia BS
Brindisi BR
Cagliari CA
Caltanissetta CL
Campobasso CB
Carbonia-Iglesias CI
Caserta CE
Catania CT
Catanzaro CZ
Chieti CH
Como CO
Cosenza CS
Cremona CR
Crotone KR
Cuneo CN
Enna EN
Fermo FM
Ferrara FE
Firenze FI
Foggia FG
Forlì-Cesena FC
Frosinone FR
Genova GE
Gorizia GO
Grosseto GR
Imperia IM
Isernia IS
LAquilaAquila AQ
La Spezia SP
Latina LT
Lecce LE
Lecco LC
Livorno LI
Lodi LO
Lucca LU
Macerata MC
Mantova MN
Massa-Carrara MS
Matera MT
Medio Campidano VS
Messina ME
Milano MI
Modena MO
Monza e Brianza MB
Napoli NA
Novara NO
Nuoro NU
Ogliastra OG
Olbia-Tempio OT
Oristano OR
Padova PD
Palermo PA
Parma PR
Pavia PV
Perugia PG
Pesaro e Urbino PU
Pescara PE
Piacenza PC
Pisa PI
Pistoia PT
Pordenone PN
Potenza PZ
Prato PO
Ragusa RG
Ravenna RA
Reggio Calabria RC
Reggio Emilia RE
Rieti RI
Rimini RN
Roma RM
Rovigo RO
Salerno SA
Sassari SS
Savona SV
Siena SI
Siracusa SR
Sondrio SO
Taranto TA
Teramo TE
Terni TR
Torino TO
Trapani TP
Trento TN
Treviso TV
Trieste TS
Udine UD
Varese VA
Venezia VE
Verbano-Cusio-Ossola VB
Vercelli VC
Verona VR
Vibo Valentia VV
Vicenza VI
Viterbo VT
IT
Jamaica JM
Japan
Prefectures
Name ISO code
Hokkaidō JP-01
Aomori JP-02
Iwate JP-03
Miyagi JP-04
Akita JP-05
Yamagata JP-06
Fukushima JP-07
Ibaraki JP-08
Tochigi JP-09
Gunma JP-10
Saitama JP-11
Chiba JP-12
Tōkyō JP-13
Kanagawa JP-14
Niigata JP-15
Toyama JP-16
Ishikawa JP-17
Fukui JP-18
Yamanashi JP-19
Nagano JP-20
Gifu JP-21
Shizuoka JP-22
Aichi JP-23
Mie JP-24
Shiga JP-25
Kyōto JP-26
Ōsaka JP-27
Hyōgo JP-28
Nara JP-29
Wakayama JP-30
Tottori JP-31
Shimane JP-32
Okayama JP-33
Hiroshima JP-34
Yamaguchi JP-35
Tokushima JP-36
Kagawa JP-37
Ehime JP-38
Kōchi JP-39
Fukuoka JP-40
Saga JP-41
Nagasaki JP-42
Kumamoto JP-43
Ōita JP-44
Miyazaki JP-45
Kagoshima JP-46
Okinawa JP-47
JP
Jersey JE
Jordan JO
Kazakhstan KZ
Kenya KE
Kiribati KI
Korea, Democratic Peoples Republic Ofs Republic Of KP
Kosovo XK
Kuwait KW
Kyrgyzstan KG
Lao Peoples Democratic Republics Democratic Republic LA
Latvia LV
Lebanon LB
Lesotho LS
Liberia LR
Libyan Arab Jamahiriya LY
Liechtenstein LI
Lithuania LT
Luxembourg LU
Macao MO
Macedonia, Republic Of MK
Madagascar MG
Malawi MW
Malaysia
States and territories
Name ISO code
Johor JHR
Kedah KDH
Kelantan KTN
Kuala Lumpur KUL
Labuan LBN
Melaka MLK
Negeri Sembilan NSN
Pahang PHG
Perak PRK
Perlis PLS
Pulau Pinang PNG
Putrajaya PJY
Sabah SBH
Sarawak SWK
Selangor SGR
Terengganu TRG
MY
Maldives MV
Mali ML
Malta MT
Martinique MQ
Mauritania MR
Mauritius MU
Mayotte YT
Mexico
States
Name ISO code
Aguascalientes AGS
Baja California BC
Baja California Sur BCS
Campeche CAMP
Chiapas CHIS
Chihuahua CHIH
Ciudad de México DF
Coahuila COAH
Colima COL
Durango DGO
Guanajuato GTO
Guerrero GRO
Hidalgo HGO
Jalisco JAL
México MEX
Michoacán MICH
Morelos MOR
Nayarit NAY
Nuevo León NL
Oaxaca OAX
Puebla PUE
Querétaro QRO
Quintana Roo Q ROO
San Luis Potosí SLP
Sinaloa SIN
Sonora SON
Tabasco TAB
Tamaulipas TAMPS
Tlaxcala TLAX
Veracruz VER
Yucatán YUC
Zacatecas ZAC
MX
Moldova, Republic of MD
Monaco MC
Mongolia MN
Montenegro ME
Montserrat MS
Morocco MA
Mozambique MZ
Myanmar MM
Namibia NA
Nauru NR
Nepal NP
Netherlands NL
Netherlands Antilles AN
New Caledonia NC
New Zealand
Regions
Name ISO code
Auckland AUK
Bay of Plenty BOP
Canterbury CAN
Gisborne GIS
Hawkes Bays Bay HKB
Manawatu-Wanganui MWT
Marlborough MBH
Nelson NSN
Northland NTL
Otago OTA
Southland STL
Taranaki TKI
Tasman TAS
Waikato WKO
Wellington WGN
West Coast WTC
NZ
Nicaragua NI
Niger NE
Nigeria
Provinces
Name ISO code
Abia AB
Abuja Federal Capital Territory FC
Adamawa AD
Akwa Ibom AK
Anambra AN
Bauchi BA
Bayelsa BY
Benue BE
Borno BO
Cross River CR
Delta DE
Ebonyi EB
Edo ED
Ekiti EK
Enugu EN
Gombe GO
Imo IM
Jigawa JI
Kaduna KD
Kano KN
Katsina KT
Kebbi KE
Kogi KO
Kwara KW
Lagos LA
Nasarawa NA
Niger NI
Ogun OG
Ondo ON
Osun OS
Oyo OY
Plateau PL
Rivers RI
Sokoto SO
Taraba TA
Yobe YO
Zamfara ZA
NG
Niue NU
Norfolk Island NF
Norway NO
Oman OM
Pakistan PK
Palestinian Territory, Occupied PS
Panama
Provinces
Name ISO code
Bocas del Toro PA-1
Chiriquí PA-4
Coclé PA-2
Colón PA-3
Darién PA-5
Emberá PA-EM
Herrera PA-6
Kuna Yala PA-KY
Los Santos PA-7
Ngöbe-Buglé PA-NB
Panamá PA-8
Panamá Oeste PA-10
Veraguas PA-9
PA
Papua New Guinea PG
Paraguay PY
Peru
Provinces
Name ISO code
Amazonas PE-AMA
Áncash PE-ANC
Apurímac PE-APU
Arequipa PE-ARE
Ayacucho PE-AYA
Cajamarca PE-CAJ
Callao PE-CAL
Cuzco PE-CUS
Huancavelica PE-HUV
Huánuco PE-HUC
Ica PE-ICA
Junín PE-JUN
La Libertad PE-LAL
Lambayeque PE-LAM
Lima (departamento) PE-LIM
Lima (provincia) PE-LMA
Loreto PE-LOR
Madre de Dios PE-MDD
Moquegua PE-MOQ
Pasco PE-PAS
Piura PE-PIU
Puno PE-PUN
San Martín PE-SAM
Tacna PE-TAC
Tumbes PE-TUM
Ucayali PE-UCA
PE
Philippines PH
Pitcairn PN
Poland PL
Portugal
Provinces
Name ISO code
Açores PT-20
Aveiro PT-01
Beja PT-02
Braga PT-03
Bragança PT-04
Castelo Branco PT-05
Coimbra PT-06
Évora PT-07
Faro PT-08
Guarda PT-09
Leiria PT-10
Lisboa PT-11
Madeira PT-30
Portalegre PT-12
Porto PT-13
Santarém PT-14
Setúbal PT-15
Viana do Castelo PT-16
Vila Real PT-17
Viseu PT-18
PT
Qatar QA
Republic of Cameroon CM
Reunion RE
Romania
Provinces
Name ISO code
Alba AB
Arad AR
Argeș AG
Bacău BC
Bihor BH
Bistrița-Năsăud BN
Botoșani BT
Brașov BV
Brăila BR
București B
Buzău BZ
Călărași CL
Caraș-Severin CS
Cluj CJ
Constanța CT
Covasna CV
Dâmbovița DB
Dolj DJ
Galați GL
Giurgiu GR
Gorj GJ
Harghita HR
Hunedoara HD
Iași IS
Ialomița IL
Ilfov IF
Maramureș MM
Mehedinți MH
Mureș MS
Neamț NT
Olt OT
Prahova PH
Sălaj SJ
Satu Mare SM
Sibiu SB
Suceava SV
Teleorman TR
Timiș TM
Tulcea TL
Vâlcea VL
Vaslui VS
Vrancea VN
RO
Russia
Provinces
Name ISO code
Republic of Adygeya AD
Altai Republic AL
Altai Krai ALT
Amur Oblast AMU
Arkhangelsk Oblast ARK
Astrakhan Oblast AST
Republic of Bashkortostan BA
Belgorod Oblast BEL
Bryansk Oblast BRY
Republic of Buryatia BU
Chechen Republic CE
Chelyabinsk Oblast CHE
Chukotka Autonomous Okrug CHU
Chuvash Republic CU
Republic of Dagestan DA
Republic of Ingushetia IN
Irkutsk Oblast IRK
Ivanovo Oblast IVA
Jewish Autonomous Oblast YEV
Kabardino-Balkarian Republic KB
Kaliningrad Oblast KGD
Republic of Kalmykia KL
Kaluga Oblast KLU
Kamchatka Krai KAM
Karachay–Cherkess Republic KC
Republic of Karelia KR
Kemerovo Oblast KEM
Khabarovsk Krai KHA
Republic of Khakassia KK
Khanty-Mansi Autonomous Okrug KHM
Kirov Oblast KIR
Komi Republic KO
Kostroma Oblast KOS
Krasnodar Krai KDA
Krasnoyarsk Krai KYA
Kurgan Oblast KGN
Kursk Oblast KRS
Leningrad Oblast LEN
Lipetsk Oblast LIP
Magadan Oblast MAG
Mari El Republic ME
Republic of Mordovia MO
Moscow MOW
Moscow Oblast MOS
Murmansk Oblast MUR
Nizhny Novgorod Oblast NIZ
Novgorod Oblast NGR
Novosibirsk Oblast NVS
Omsk Oblast OMS
Orenburg Oblast ORE
Oryol Oblast ORL
Penza Oblast PNZ
Perm Krai PER
Primorsky Krai PRI
Pskov Oblast PSK
Rostov Oblast ROS
Ryazan Oblast RYA
Saint Petersburg SPE
Sakha Republic (Yakutia) SA
Sakhalin Oblast SAK
Samara Oblast SAM
Saratov Oblast SAR
Republic of North Ossetia–Alania SE
Smolensk Oblast SMO
Stavropol Krai STA
Sverdlovsk Oblast SVE
Tambov Oblast TAM
Republic of Tatarstan TA
Tomsk Oblast TOM
Tula Oblast TUL
Tver Oblast TVE
Tyumen Oblast TYU
Tyva Republic TY
Udmurtia UD
Ulyanovsk Oblast ULY
Vladimir Oblast VLA
Volgograd Oblast VGG
Vologda Oblast VLG
Voronezh Oblast VOR
Yamalo-Nenets Autonomous Okrug YAN
Yaroslavl Oblast YAR
Zabaykalsky Krai ZAB
RU
Rwanda RW
Saint Barthélemy BL
Saint Helena SH
Saint Kitts And Nevis KN
Saint Lucia LC
Saint Martin MF
Saint Pierre And Miquelon PM
Samoa WS
San Marino SM
Sao Tome And Principe ST
Saudi Arabia SA
Senegal SN
Serbia RS
Seychelles SC
Sierra Leone SL
Singapore SG
Sint Maarten SX
Slovakia SK
Slovenia SI
Solomon Islands SB
Somalia SO
South Africa
Provinces
Name ISO code
Eastern Cape EC
Free State FS
Gauteng GT
KwaZulu-Natal NL
Limpopo LP
Mpumalanga MP
North West NW
Northern Cape NC
Western Cape WC
ZA
South Georgia And The South Sandwich Islands GS
South Korea
Provinces
Name ISO code
Busan KR-26
Chungbuk KR-43
Chungnam KR-44
Daegu KR-27
Daejeon KR-30
Gangwon KR-42
Gwangju KR-29
Gyeongbuk KR-47
Gyeonggi KR-41
Gyeongnam KR-48
Incheon KR-28
Jeju KR-49
Jeonbuk KR-45
Jeonnam KR-46
Sejong KR-50
Seoul KR-11
Ulsan KR-31
KR
South Sudan SS
Spain
Provinces
Name ISO code
A Coruña C
Álava VI
Albacete AB
Alicante A
Almería AL
Asturias O
Ávila AV
Badajoz BA
Balears PM
Barcelona B
Burgos BU
Cáceres CC
Cádiz CA
Cantabria S
Castellón CS
Ceuta CE
Ciudad Real CR
Córdoba CO
Cuenca CU
Girona GI
Granada GR
Guadalajara GU
Guipúzcoa SS
Huelva H
Huesca HU
Jaén J
La Rioja LO
Las Palmas GC
León LE
Lleida L
Lugo LU
Madrid M
Málaga MA
Melilla ML
Murcia MU
Navarra NA
Ourense OR
Palencia P
Pontevedra PO
Salamanca SA
Santa Cruz de Tenerife TF
Segovia SG
Sevilla SE
Soria SO
Tarragona T
Teruel TE
Toledo TO
Valencia V
Valladolid VA
Vizcaya BI
Zamora ZA
Zaragoza Z
ES
Sri Lanka LK
St. Vincent VC
Sudan SD
Suriname SR
Svalbard And Jan Mayen SJ
Swaziland SZ
Sweden SE
Switzerland CH
Syria SY
Taiwan TW
Tajikistan TJ
Tanzania, United Republic Of TZ
Thailand
Provinces
Name ISO code
Amnat Charoen TH-37
Ang Thong TH-15
Bangkok TH-10
Bueng Kan TH-38
Buriram TH-31
Chachoengsao TH-24
Chai Nat TH-18
Chaiyaphum TH-36
Chanthaburi TH-22
Chiang Mai TH-50
Chiang Rai TH-57
Chon Buri TH-20
Chumphon TH-86
Kalasin TH-46
Kamphaeng Phet TH-62
Kanchanaburi TH-71
Khon Kaen TH-40
Krabi TH-81
Lampang TH-52
Lamphun TH-51
Loei TH-42
Lopburi TH-16
Mae Hong Son TH-58
Maha Sarakham TH-44
Mukdahan TH-49
Nakhon Nayok TH-26
Nakhon Pathom TH-73
Nakhon Phanom TH-48
Nakhon Ratchasima TH-30
Nakhon Sawan TH-60
Nakhon Si Thammarat TH-80
Nan TH-55
Narathiwat TH-96
Nong Bua Lam Phu TH-39
Nong Khai TH-43
Nonthaburi TH-12
Pathum Thani TH-13
Pattani TH-94
Pattaya TH-S
Phangnga TH-82
Phatthalung TH-93
Phayao TH-56
Phetchabun TH-67
Phetchaburi TH-76
Phichit TH-66
Phitsanulok TH-65
Phra Nakhon Si Ayutthaya TH-14
Phrae TH-54
Phuket TH-83
Prachin Buri TH-25
Prachuap Khiri Khan TH-77
Ranong TH-85
Ratchaburi TH-70
Rayong TH-21
Roi Et TH-45
Sa Kaeo TH-27
Sakon Nakhon TH-47
Samut Prakan TH-11
Samut Sakhon TH-74
Samut Songkhram TH-75
Saraburi TH-19
Satun TH-91
Sing Buri TH-17
Sisaket TH-33
Songkhla TH-90
Sukhothai TH-64
Suphan Buri TH-72
Surat Thani TH-84
Surin TH-32
Tak TH-63
Trang TH-92
Trat TH-23
Ubon Ratchathani TH-34
Udon Thani TH-41
Uthai Thani TH-61
Uttaradit TH-53
Yala TH-95
Yasothon TH-35
TH
Timor Leste TL
Togo TG
Tokelau TK
Tonga TO
Trinidad and Tobago TT
Tunisia TN
Turkey TR
Turkmenistan TM
Turks and Caicos Islands TC
Tuvalu TV
Uganda UG
Ukraine UA
United Arab Emirates
Provinces
Name ISO code
Abu Dhabi AZ
Ajman AJ
Dubai DU
Fujairah FU
Ras al-Khaimah RK
Sharjah SH
Umm al-Quwain UQ
AE
United Kingdom GB
United States of America
States
Name ISO code
Alabama AL
Alaska AK
American Samoa AS
Arizona AZ
Arkansas AR
California CA
Colorado CO
Connecticut CT
Delaware DE
District of Columbia DC
Federated States of Micronesia FM
Florida FL
Georgia GA
Guam GU
Hawaii HI
Idaho ID
Illinois IL
Indiana IN
Iowa IA
Kansas KS
Kentucky KY
Louisiana LA
Maine ME
Marshall Islands MH
Maryland MD
Massachusetts MA
Michigan MI
Minnesota MN
Mississippi MS
Missouri MO
Montana MT
Nebraska NE
Nevada NV
New Hampshire NH
New Jersey NJ
New Mexico NM
New York NY
North Carolina NC
North Dakota ND
Northern Mariana Islands MP
Ohio OH
Oklahoma OK
Oregon OR
Palau PW
Pennsylvania PA
Puerto Rico PR
Rhode Island RI
South Carolina SC
South Dakota SD
Tennessee TN
Texas TX
Utah UT
Vermont VT
Virginia VA
Washington WA
West Virginia WV
Wisconsin WI
Wyoming WY
Virgin Islands VI
Armed Forces Americas AA
Armed Forces Europe AE
Armed Forces Pacific AP
US
United States Minor Outlying Islands UM
Uruguay UY
Uzbekistan UZ
Vanuatu VU
Venezuela VE
Vietnam VN
Virgin Islands, British VG
Wallis And Futuna WF
Western Sahara EH
Yemen YE
Zambia ZM
Zimbabwe ZW

Create a conditional rate

The following deliveryProfileCreate mutation specifies a static rate for the delivery profile that is conditional on price. The rate is shown at checkout for orders that are greater than or equal to $100. The profile input object for the mutation includes the methodDefinitionsToCreate array that indicates the rateDefinition and conditional criteria:

POST /admin/api/unstable/graphql.json

mutation {
  deliveryProfileCreate (
    profile: {
      name: "A condition profile",
      variantsToAssociate: [
        "gid://shopify/ProductVariant/13672596242488"
      ],
      locationGroupsToCreate: {
        locations: [
          "gid://shopify/Location/9562054"
        ],
        zonesToCreate: [
          {
            name: "United States",
            countries: [
              {
                code: US
              }
            ],
            methodDefinitionsToCreate: [
              {
                name: "conditional_rate"
                active: true
                rateDefinition: {
                  price: {
                    amount: 20.5
                    currencyCode:USD
                  }
                }
                priceConditionsToCreate: {
                  criteria: {
                    amount:100.00
                    currencyCode:USD
                  },
                  operator: GREATER_THAN_OR_EQUAL_TO
                }
              }
            ]
          }
        ]
      }
    }
  )
  {
    profile {
      id
      name
      profileLocationGroups {
        locationGroup {
          id
          locations (first: 1, includeLegacy:true) {
            edges {
              node {
                id
                name
              }
            }
          }
        }
        locationGroupZones (first: 1) {
          edges {
            node {
              zone {
                name
                countries {
                  name
                }
              }
              methodDefinitions (first: 1) {
                edges {
                  node {
                    id
                    name
                    active
                    rateProvider {
                      ... on DeliveryParticipant {
                        id
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    userErrors {
      field
      message
    }
  }
}

View response

JSON response:

{
  "data": {
    "deliveryProfileCreate": {
      "profile": {
        "id": "gid://shopify/DeliveryProfile/7929912",
        "name": "A conditional profile",
        "profileLocationGroups": [
          {
            "locationGroup": {
              "id": "gid://shopify/DeliveryLocationGroup/6651960",
              "locations": {
                "edges": [
                  {
                    "node": {
                      "id": "gid://shopify/Location/9562054",
                      "name": "Elgin"
                    }
                  }
                ]
              }
            },
            "locationGroupZones": {
              "edges": [
                {
                  "node": {
                    "zone": {
                      "name": "United States",
                      "countries": [
                        {
                          "name": "United States"
                        }
                      ]
                    },
                    "methodDefinitions": {
                      "edges": [
                        {
                          "node": {
                            "id": "gid://shopify/DeliveryMethodDefinition/36077624",
                            "name": "conditional_rate",
                            "active": true,
                            "rateProvider": {}
                          }
                        }
                      ]
                    }
                  }
                }
              ]
            }
          }
        ]
      },
      "userErrors": []
    }
  },
  ...
}

Delivery profiles use cases

It can be useful to retrieve delivery profiles under a variety of scenarios.

Find which delivery profile a product belongs to

The following example uses the variant ID to return the delivery profile ID.

POST /admin/api/unstable/graphql.json

{
  productVariant(id: "gid://shopify/ProductVariant/21788692185193") {
    id
    deliveryProfile {
      id
      name
    }
  }
}

View response

JSON response

{
  "data": {
    "productVariant": {
      "id": "gid://shopify/ProductVariant/21788692185193",
      "deliveryProfile": {
        "id": "gid://shopify/DeliveryProfile/7897144",
        "name": "My Other Fulfillment Service's Profile"
      }
    }
  },
  ...
}

Determine what rates apply to a product

The following example uses the location group and delivery zones to see what rates are associated with a variant's delivery profile:

POST /admin/api/unstable/graphql.json

query {
  productVariant(id: "gid://shopify/ProductVariant/21788698476649") {
    deliveryProfile {
      profileLocationGroups {
        locationGroupZones(first: 3) {
          edges {
            node {
              zone {
                name
                countries {
                  name
                }
              }
              methodDefinitions(first: 3) {
                edges {
                  node {
                    id
                    name
                    methodConditions {
                      id
                      operator
                      conditionCriteria {
                        ... on Weight {
                          value
                        }
                        ... on MoneyV2 {
                          amount
                          currencyCode
                        }
                      }
                    }
                    rateProvider {
                      ... on DeliveryRateDefinition {
                        id
                        price {
                          amount
                          currencyCode
                        }
                      }
                      ... on DeliveryParticipant {
                        id
                        fixedFee {
                          amount
                          currencyCode
                        }
                        percentageOfRateFee
                        participantServices {
                          active
                          name
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

View response

JSON response

{
  "data": {
    "productVariant": {
      "deliveryProfile": {
        "profileLocationGroups": [
          {
            "locationGroupZones": {
              "edges": [
                {
                  "node": {
                    "zone": {
                      "name": "Canada",
                      "countries": [
                        {
                          "name": "Canada"
                        }
                      ]
                    },
                    "methodDefinitions": {
                      "edges": [
                        {
                          "node": {
                            "id": "gid://shopify/DeliveryMethodDefinition/36044856",
                            "name": "my_carrier_service_name",
                            "methodConditions": [],
                            "rateProvider": {
                              "id": "gid://shopify/DeliveryParticipant/13697080",
                              "fixedFee": {
                                "amount": "0.0",
                                "currencyCode": "USD"
                              },
                              "percentageOfRateFee": 0,
                              "participantServices": []
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    }
  },
  ...
}

Return the rate provider

You can use the following query to return the rate providers that apply to a delivery profile's delivery methods:

POST /admin/api/unstable/graphql.json

query {
  deliveryProfiles(first: 1) {
    edges {
      node {
        profileLocationGroups {
          locationGroupZones(first: 3) {
            edges {
              node {
                methodDefinitions(first: 3) {
                  edges {
                    node {
                      rateProvider {
                        ... on DeliveryRateDefinition {
                          id
                          price {
                            amount
                          }
                        }
                        ... on DeliveryParticipant {
                          id
                          fixedFee {
                            amount
                            currencyCode
                          }
                          percentageOfRateFee
                          participantServices {
                            active
                            name
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

View response

JSON response:

{
  "data": {
    "deliveryProfiles": {
      "edges": [
        {
          "node": {
            "profileLocationGroups": [
              {
                "locationGroupZones": {
                  "edges": [
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": [
                            {
                              "node": {
                                "rateProvider": {
                                  "id": "gid://shopify/DeliveryRateDefinition/13172792",
                                  "price": {
                                    "amount": "8.0"
                                  }
                                }
                              }
                            },
                            {
                              "node": {
                                "rateProvider": {
                                  "id": "gid://shopify/DeliveryRateDefinition/13205560",
                                  "price": {
                                    "amount": "18.0"
                                  }
                                }
                              }
                            },
                            {
                              "node": {
                                "rateProvider": {
                                  "id": "gid://shopify/DeliveryParticipant/11567160",
                                  "fixedFee": {
                                    "amount": "0.0",
                                    "currencyCode": "USD"
                                  },
                                  "percentageOfRateFee": 0,
                                  "participantServices": []
                                }
                              }
                            }
                          ]
                        }
                      }
                    },
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": [
                            {
                              "node": {
                                "rateProvider": {
                                  "id": "gid://shopify/DeliveryRateDefinition/13107256",
                                  "price": {
                                    "amount": "5.0"
                                  }
                                }
                              }
                            }
                          ]
                        }
                      }
                    },
                    {
                      "node": {
                        "methodDefinitions": {
                          "edges": [
                            {
                              "node": {
                                "rateProvider": {
                                  "id": "gid://shopify/DeliveryRateDefinition/13140024",
                                  "price": {
                                    "amount": "18.0"
                                  }
                                }
                              }
                            },
                            {
                              "node": {
                                "rateProvider": {
                                  "id": "gid://shopify/DeliveryParticipant/11534392",
                                  "fixedFee": {
                                    "amount": "0.0",
                                    "currencyCode": "USD"
                                  },
                                  "percentageOfRateFee": 0,
                                  "participantServices": []
                                }
                              }
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  },
  ...
}

Sign up for a Partner account to get started.

Sign up