Graphql inventoryBulkAdjustQuantityAtLocation mutation from Postman

Solved
LeonardoMolina4
New Member
2 0 0

Hello!! 

We are trying to use the mutation From Postman

POST:

https://${v_api_key}:${v_api_password}@${v_store_name}.myshopify.com/admin/api/2021-04/graphql.json

Body:

mutation{
  inventoryBulkAdjustQuantityAtLocation(
    inventoryItemAdjustments: [{inventoryItemId: "41906055119006",availableDelta: 7}],
    locationId: "62368645278"
){
inventoryLevels {
   id
   }
   userErrors {
     field
     message
  }
}
}

 

Response: 200 ok

{
    "errors": [
        {
            "message""Invalid global id '41906055119006'",
            "locations": [
                {
                    "line"5,
                    "column"35
                }
            ],
            "path": [
                "mutation",
                "inventoryBulkAdjustQuantityAtLocation",
                "inventoryItemAdjustments",
                0,
                "inventoryItemId"
            ],
            "extensions": {
                "code""argumentLiteralsIncompatible",
                "typeName""CoercionError"
            }
        },
        {
            "message""Invalid global id '62368645278'",
            "locations": [
                {
                    "line"3,
                    "column"5
                }
            ],
            "path": [
                "mutation",
                "inventoryBulkAdjustQuantityAtLocation",
                "locationId"
            ],
            "extensions": {
                "code""argumentLiteralsIncompatible",
                "typeName""CoercionError"
            }
        }
    ]
}
 
LeonardoMolina4_1-1620849769377.png

 

Can you help us with that error?

 

0 Likes
Kevin_A
Shopify Staff
Shopify Staff
310 42 53

This is an accepted solution.

Hey @LeonardoMolina4 

First off, please make sure you delete that image from the post and immediately rotate those API keys as they are clearly visible in the screenshot you posted. In regards to your error, GraphQL uses global IDs so they would need to look something like: 

gid://shopify/InventoryItem/123456789

 

Kevin_A | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog