Anchor to deliveryProfileUpdatedelivery
deliveryProfileUpdate
mutation
Requires Any of shipping
access scopes or user permission.
Update a delivery profile.
Anchor to Arguments
Arguments
- •ID!required
The ID of the delivery profile to update.
- Anchor to leaveLegacyModeProfilesleave•
Legacy Mode Profiles Whether this delivery profile should leave legacy mode.
- Anchor to profileprofile•Delivery
Profile requiredInput! Specifies the input fields for a delivery profile.
Was this section helpful?
Anchor to DeliveryProfileUpdatePayload returnsDeliveryProfileUpdatePayload returns
- Anchor to profileprofile•
The delivery profile that was updated.
- Anchor to userErrorsuser•
Errors [UserError!]! non-null The list of errors that occurred from executing the mutation.
Was this section helpful?
- Update delivery profile to add a location and a zone to an existing group
- Update delivery profile to add a location group
- deliveryProfileUpdate reference
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation deliveryProfileUpdate($id: ID!, $profile: DeliveryProfileInput!) {
deliveryProfileUpdate(id: $id, profile: $profile) {
profile {
id
name
profileLocationGroups {
locationGroup {
id
locations(first: 5) {
nodes {
name
address {
country
}
}
}
}
locationGroupZones(first: 2) {
edges {
node {
zone {
id
mutation deliveryProfileUpdate($id: ID!, $profile: DeliveryProfileInput!) {
deliveryProfileUpdate(id: $id, profile: $profile) {
profile {
id
name
profileLocationGroups {
locationGroup {
id
locations(first: 5) {
nodes {
name
address {
country
}
}
}
}
locationGroupZones(first: 2) {
edges {
node {
zone {
id
name
countries {
code {
countryCode
}
provinces {
code
}
}
}
}
}
}
}
}
userErrors {
field
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation deliveryProfileUpdate($id: ID!, $profile: DeliveryProfileInput!) { deliveryProfileUpdate(id: $id, profile: $profile) { profile { id name profileLocationGroups { locationGroup { id locations(first: 5) { nodes { name address { country } } } } locationGroupZones(first: 2) { edges { node { zone { id name countries { code { countryCode } provinces { code } } } } } } } } userErrors { field message } } }",
"variables": {
"id": "gid://shopify/DeliveryProfile/593363170",
"profile": {
"name": "Sample Updated Delivery Profile",
"locationGroupsToUpdate": [
{
"id": "gid://shopify/DeliveryLocationGroup/955592432",
"locationsToAdd": [
"gid://shopify/Location/884687543"
],
"zonesToCreate": [
{
"name": "USA Zone",
"countries": {
"code": "US",
"provinces": [
{
"code": "CO"
}
]
},
"methodDefinitionsToCreate": [
{
"name": "Standard",
"rateDefinition": {
"price": {
"amount": 1.0,
"currencyCode": "USD"
}
}
}
]
}
]
}
]
}
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation deliveryProfileUpdate($id: ID!, $profile: DeliveryProfileInput!) {
deliveryProfileUpdate(id: $id, profile: $profile) {
profile {
id
name
profileLocationGroups {
locationGroup {
id
locations(first: 5) {
nodes {
name
address {
country
}
}
}
}
locationGroupZones(first: 2) {
edges {
node {
zone {
id
name
countries {
code {
countryCode
}
provinces {
code
}
}
}
}
}
}
}
}
userErrors {
field
message
}
}
}`,
{
variables: {
"id": "gid://shopify/DeliveryProfile/593363170",
"profile": {
"name": "Sample Updated Delivery Profile",
"locationGroupsToUpdate": [
{
"id": "gid://shopify/DeliveryLocationGroup/955592432",
"locationsToAdd": [
"gid://shopify/Location/884687543"
],
"zonesToCreate": [
{
"name": "USA Zone",
"countries": {
"code": "US",
"provinces": [
{
"code": "CO"
}
]
},
"methodDefinitionsToCreate": [
{
"name": "Standard",
"rateDefinition": {
"price": {
"amount": 1.0,
"currencyCode": "USD"
}
}
}
]
}
]
}
]
}
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation deliveryProfileUpdate($id: ID!, $profile: DeliveryProfileInput!) {
deliveryProfileUpdate(id: $id, profile: $profile) {
profile {
id
name
profileLocationGroups {
locationGroup {
id
locations(first: 5) {
nodes {
name
address {
country
}
}
}
}
locationGroupZones(first: 2) {
edges {
node {
zone {
id
name
countries {
code {
countryCode
}
provinces {
code
}
}
}
}
}
}
}
}
userErrors {
field
message
}
}
}`,
"variables": {
"id": "gid://shopify/DeliveryProfile/593363170",
"profile": {
"name": "Sample Updated Delivery Profile",
"locationGroupsToUpdate": [
{
"id": "gid://shopify/DeliveryLocationGroup/955592432",
"locationsToAdd": [
"gid://shopify/Location/884687543"
],
"zonesToCreate": [
{
"name": "USA Zone",
"countries": {
"code": "US",
"provinces": [
{
"code": "CO"
}
]
},
"methodDefinitionsToCreate": [
{
"name": "Standard",
"rateDefinition": {
"price": {
"amount": 1.0,
"currencyCode": "USD"
}
}
}
]
}
]
}
]
}
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation deliveryProfileUpdate($id: ID!, $profile: DeliveryProfileInput!) {
deliveryProfileUpdate(id: $id, profile: $profile) {
profile {
id
name
profileLocationGroups {
locationGroup {
id
locations(first: 5) {
nodes {
name
address {
country
}
}
}
}
locationGroupZones(first: 2) {
edges {
node {
zone {
id
name
countries {
code {
countryCode
}
provinces {
code
}
}
}
}
}
}
}
}
userErrors {
field
message
}
}
}
QUERY
variables = {
"id": "gid://shopify/DeliveryProfile/593363170",
"profile": {
"name": "Sample Updated Delivery Profile",
"locationGroupsToUpdate": [{"id"=>"gid://shopify/DeliveryLocationGroup/955592432", "locationsToAdd"=>["gid://shopify/Location/884687543"], "zonesToCreate"=>[{"name"=>"USA Zone", "countries"=>{"code"=>"US", "provinces"=>[{"code"=>"CO"}]}, "methodDefinitionsToCreate"=>[{"name"=>"Standard", "rateDefinition"=>{"price"=>{"amount"=>1.0, "currencyCode"=>"USD"}}}]}]}]
}
}
response = client.query(query: query, variables: variables)
Input variables
JSON{
"id": "gid://shopify/DeliveryProfile/593363170",
"profile": {
"name": "Sample Updated Delivery Profile",
"locationGroupsToUpdate": [
{
"id": "gid://shopify/DeliveryLocationGroup/955592432",
"locationsToAdd": [
"gid://shopify/Location/884687543"
],
"zonesToCreate": [
{
"name": "USA Zone",
"countries": {
"code": "US",
"provinces": [
{
"code": "CO"
}
]
},
"methodDefinitionsToCreate": [
{
"name": "Standard",
"rateDefinition": {
Response
JSON{
"deliveryProfileUpdate": {
"profile": {
"id": "gid://shopify/DeliveryProfile/593363170",
"name": "Sample Updated Delivery Profile",
"profileLocationGroups": [
{
"locationGroup": {
"id": "gid://shopify/DeliveryLocationGroup/955592432",
"locations": {
"nodes": [
{
"name": "Ottawa Store",
"address": {
"country": "Canada"
}
},
{
"name": "Ottawa Warehouse",
"address": {
"country": "Canada"
}
},
{