Not able to add tracking number to fulfillment using the fulfillmentTrackingInfoUpdateV2 endpoint

Solved
Highlighted
Tourist
4 1 0

Hi, I'm trying to add a custom tracking number post fulfillment creation using the graphql API (2020-01), but I'm getting a error with no useful description, my query is as follows:

mutation($id: ID!, $input: FulfillmentTrackingInput!){
  fulfillmentTrackingInfoUpdateV2(fulfillmentId: $id, notifyCustomer: false, trackingInfoInput: $input){
    fulfillment{
      id
      order{
        id
      }
      trackingInfo{
        company
        number
      }
    }
    userErrors{
      field
      message
    }
  }
}

With the params being:

{
	"id": "gid://shopify/Fulfillment/XXXXXXX",
	"input": {
		"company": "Other",
		"number": "TZ0001"
	}
}

I have tried with archived and unarchived orders, also without the "company" param without success, I'm able to add the custom tracking number at the admin without problems but with the API I just get:

{
  "data": {
    "fulfillmentTrackingInfoUpdateV2": {
      "fulfillment": {
        "id": "gid:\/\/shopify\/Fulfillment\/XXXXXXXX",
        "order": {
          "id": "gid:\/\/shopify\/Order\/YYYYYYYY"
        },
        "trackingInfo": []
      },
      "userErrors": [
        {
          "field": null,
          "message": "Tracking information update failed."
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 12,
      "actualQueryCost": 12,
      "throttleStatus": {
        "maximumAvailable": 1000.0,
        "currentlyAvailable": 988,
        "restoreRate": 50.0
      }
    }
  }
}

Am I missing something?

0 Likes
Tourist
4 1 0

This is an accepted solution.

At last I managed to make it works, I was missing the "Merchant managed fulfillment orders " permission, I thought mistakenly that "Third party fulfillment orders " was enough because it allowed me to make request to the endpoint, my bad.

 

Documentation that helped me: https://shopify.dev/tutorials/manage-fulfillments-with-fulfillment-and-fulfillmentorder-resources

 

I think that graphql documentation could mention which scopes are related to a resource, more importantly on mutations, but at least a more descriptive error other than "Tracking information update failed" in this case would have been enough to point me the right way.

0 Likes