Anchor to section titled 'undefined'

fulfillmentTrackingInfoUpdateV2
mutation
deprecated

Requires write_assigned_fulfillment_orders access scope, write_merchant_managed_fulfillment_orders access scope or write_third_party_fulfillment_orders access scope. Also: The user must have fulfill_and_ship_orders permission.

Updates tracking information for a fulfillment. Use fulfillmentTrackingInfoUpdate instead.


Anchor to fulfillmentId
fulfillmentId
required

The ID of the fulfillment.

Whether the customer will be notified of this update and future updates for the fulfillment. If this field is left blank, then notifications won't be sent to the customer when the fulfillment is updated.

The tracking input for the mutation, including tracking URL, number, and company.


Was this section helpful?

The updated fulfillment with tracking information.

The list of errors that occurred from executing the mutation.


Was this section helpful?

Examples

Hide code
DescriptionCopy
mutation fulfillmentTrackingInfoUpdateV2($fulfillmentId: ID!, $trackingInfoInput: FulfillmentTrackingInput!, $notifyCustomer: Boolean) {
  fulfillmentTrackingInfoUpdateV2(fulfillmentId: $fulfillmentId, trackingInfoInput: $trackingInfoInput, notifyCustomer: $notifyCustomer) {
    fulfillment {
      id
      status
      trackingInfo {
        company
        number
        url
      }
    }
    userErrors {
      field
      message
    }
  }
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation fulfillmentTrackingInfoUpdateV2($fulfillmentId: ID!, $trackingInfoInput: FulfillmentTrackingInput!, $notifyCustomer: Boolean) { fulfillmentTrackingInfoUpdateV2(fulfillmentId: $fulfillmentId, trackingInfoInput: $trackingInfoInput, notifyCustomer: $notifyCustomer) { fulfillment { id status trackingInfo { company number url } } userErrors { field message } } }",
 "variables": {
    "fulfillmentId": "gid://shopify/Fulfillment/255858046",
    "notifyCustomer": true,
    "trackingInfoInput": {
      "company": "UPS",
      "number": "1Z001985YW99744790"
    }
  }
}'
const { admin } = await authenticate.admin(request);

const response = await admin.graphql(
  `#graphql
  mutation fulfillmentTrackingInfoUpdateV2($fulfillmentId: ID!, $trackingInfoInput: FulfillmentTrackingInput!, $notifyCustomer: Boolean) {
    fulfillmentTrackingInfoUpdateV2(fulfillmentId: $fulfillmentId, trackingInfoInput: $trackingInfoInput, notifyCustomer: $notifyCustomer) {
      fulfillment {
        id
        status
        trackingInfo {
          company
          number
          url
        }
      }
      userErrors {
        field
        message
      }
    }
  }`,
  {
    variables: {
      "fulfillmentId": "gid://shopify/Fulfillment/255858046",
      "notifyCustomer": true,
      "trackingInfoInput": {
        "company": "UPS",
        "number": "1Z001985YW99744790"
      }
    },
  },
);

const data = await response.json();
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 fulfillmentTrackingInfoUpdateV2($fulfillmentId: ID!, $trackingInfoInput: FulfillmentTrackingInput!, $notifyCustomer: Boolean) {
    fulfillmentTrackingInfoUpdateV2(fulfillmentId: $fulfillmentId, trackingInfoInput: $trackingInfoInput, notifyCustomer: $notifyCustomer) {
      fulfillment {
        id
        status
        trackingInfo {
          company
          number
          url
        }
      }
      userErrors {
        field
        message
      }
    }
  }
QUERY

variables = {
  "fulfillmentId": "gid://shopify/Fulfillment/255858046",
  "notifyCustomer": true,
  "trackingInfoInput": {
    "company": "UPS",
    "number": "1Z001985YW99744790"
  }
}

response = client.query(query: query, variables: variables)
const client = new shopify.clients.Graphql({session});
const data = await client.query({
  data: {
    "query": `mutation fulfillmentTrackingInfoUpdateV2($fulfillmentId: ID!, $trackingInfoInput: FulfillmentTrackingInput!, $notifyCustomer: Boolean) {
      fulfillmentTrackingInfoUpdateV2(fulfillmentId: $fulfillmentId, trackingInfoInput: $trackingInfoInput, notifyCustomer: $notifyCustomer) {
        fulfillment {
          id
          status
          trackingInfo {
            company
            number
            url
          }
        }
        userErrors {
          field
          message
        }
      }
    }`,
    "variables": {
      "fulfillmentId": "gid://shopify/Fulfillment/255858046",
      "notifyCustomer": true,
      "trackingInfoInput": {
        "company": "UPS",
        "number": "1Z001985YW99744790"
      }
    },
  },
});
use Shopify\Clients\Graphql;

$client = new Graphql("your-development-store.myshopify.com", $accessToken);
$query = <<<QUERY
  mutation fulfillmentTrackingInfoUpdateV2($fulfillmentId: ID!, $trackingInfoInput: FulfillmentTrackingInput!, $notifyCustomer: Boolean) {
    fulfillmentTrackingInfoUpdateV2(fulfillmentId: $fulfillmentId, trackingInfoInput: $trackingInfoInput, notifyCustomer: $notifyCustomer) {
      fulfillment {
        id
        status
        trackingInfo {
          company
          number
          url
        }
      }
      userErrors {
        field
        message
      }
    }
  }
QUERY;

$variables = [
  "fulfillmentId" => "gid://shopify/Fulfillment/255858046",
  "notifyCustomer" => true,
  "trackingInfoInput" => [
    "company" => "UPS",
    "number" => "1Z001985YW99744790",
  ],
];

$response = $client->query(["query" => $query, "variables" => $variables]);
Hide code
Input variables
Copy
{
  "fulfillmentId": "gid://shopify/Fulfillment/255858046",
  "notifyCustomer": true,
  "trackingInfoInput": {
    "company": "UPS",
    "number": "1Z001985YW99744790"
  }
}
Hide code
Response
JSON
{
  "fulfillmentTrackingInfoUpdateV2": {
    "fulfillment": {
      "id": "gid://shopify/Fulfillment/255858046",
      "status": "SUCCESS",
      "trackingInfo": [
        {
          "company": "UPS",
          "number": "1Z001985YW99744790",
          "url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z001985YW99744790"
        }
      ]
    },
    "userErrors": []
  }
}