Update inventory adjust getting error 'The HTTP request failed with status code Unauthorized'

Topic summary

A developer is encountering an ‘Unauthorized’ HTTP error when attempting to update inventory quantities via Shopify’s GraphQL API using C#.

Key Details:

  • Products without inventory tracking update successfully
  • Products with inventory tracking fail with the unauthorized error
  • Using the inventoryAdjustQuantities mutation with API version 2024-01
  • Access token includes comprehensive scopes: write_inventory, read_inventory, write_products, read_products, and various order/fulfillment permissions

Technical Setup:

  • GraphQL mutation targets inventory adjustments with parameters for inventoryItemId and locationId
  • Request headers include X-Shopify-Access-Token
  • Code snippet shows proper mutation structure with userErrors handling

Status: The issue remains unresolved. The developer is seeking support to understand why authorization fails specifically for tracked inventory items despite having appropriate API scopes configured.

Summarized with AI on October 23. AI used: claude-sonnet-4-5-20250929.

Hi Shopify,

We created two products — one with “Track Inventory” enabled and one without.
After testing the quantity update from my App to Shopify, we found that the product without tracking updated successfully, while the one with tracking did not.
This is my screenshot
var adjustRequest = new GraphQLRequest
{
Query = [email removed] mutation inventoryAdjustQuantities($input: InventoryAdjustQuantitiesInput!) {
inventoryAdjustQuantities(input: $input) {
userErrors {
field
message
}
inventoryAdjustmentGroup {
createdAt
reason
referenceDocumentUri
changes {
name
delta
}
}
}
}"
};
I using C#, Send params:
inventoryItemAdjustmentsVariablesForGraphQL.Add(new
{
inventoryItemId = $“gid://shopify/InventoryItem/{inventoryAdjust.InventoryItemId}”,
delta = inventoryAdjust.AvailableAdjustment,
locationId = $“gid://shopify/Location/{inventoryAdjust.LocationId}
});

var graphQLClient = new GraphQLHttpClient(webUrl + “admin/api/2024-01/graphql.json”, new NewtonsoftJsonSerializer());
graphQLClient.HttpClient.DefaultRequestHeaders.Add(“X-Shopify-Access-Token”, _store.

Admin API access scopeswrite_order_edits, read_order_edits, write_orders, read_orders, write_customers, read_customers, write_product_listings, read_product_listings, write_products, read_products, write_assigned_fulfillment_orders, read_assigned_fulfillment_orders, write_merchant_managed_fulfillment_orders, read_merchant_managed_fulfillment_orders, write_third_party_fulfillment_orders, read_third_party_fulfillment_orders, write_inventory, read_inventory, write_locations, read_locations

Looking for your support
Thank you!!