**Help needed kindly: Retrieving inventory inbound movements from Stocky with API deprecation**

Hello everyone!

I’m a 1.5-month IT intern working on a Python script to sync Shopify data with our client’s database. I’ve successfully implemented GraphQL queries to retrieve various entities (customers, orders, products, inventory_levels, inventory_shipments, inventory_transfers), but I’m facing a challenge with a specific requirement.

The Problem: Our client needs detailed inbound inventory movements (purchase orders received, stock adjustments from suppliers), which seem to be tracked in Stocky rather than Shopify’s core APIs. However, I noticed that Stocky APIs are being deprecated soon, and they recommend migrating to Shopify’s inventory_transfers API - but this only covers transfers between locations, not the supplier inbound movements our client actually needs.

What I’ve tried:

  • Shopify’s GraphQL APIs: Great for most data, but no detailed inbound movements from suppliers
  • inventory_transfers: Only shows location-to-location transfers, not supplier receipts
  • Looked into Stocky’s API documentation: Being deprecated by end of year

Possible solutions I’m considering:

  1. CSV export approach: Manually export purchase orders and stock adjustments from Stocky, then process with Python. Challenge: How to automate this process?
  2. Selenium automation: Use Selenium to automate the CSV export process, essentially creating a “robot” to handle downloads. Risk: Could break if Shopify/Stocky interface changes.

My questions:

  • Has anyone dealt with similar requirements for supplier inbound movements?
  • Are there any Shopify APIs I might have missed that track purchase order receipts?
  • What’s the most reliable approach for automating Stocky data extraction given the API deprecation?
  • Any experience with Selenium for this type of task - is it worth the maintenance overhead?

Given my limited experience, I’d really appreciate any guidance from the community on best practices for this scenario. The client needs this data for business intelligence reporting, so reliability is key.

Hey @user163,

Accessing purchase orders isn’t directly available through the API currently.

This recent post may give some more clarity on this limitation: Purchase Order API

First of all, thank you so much for the response. Now I’ll try to research the topic you sent me, but in my case, if I have data that interests me like incoming purchase orders that I find on Stocky, how would you suggest I retrieve them? Unfortunately, I’ve read that Stocky APIs will be deprecated soon.

Thank you because I’m an intern with one and a half months of experience.

Great question.

For the stocky API, if you’re going to need programmatic access, it may be worth discussing with your client to see about migrating off of stocky and using our inventory management API’s instead.

The full feature set is not yet supported. Use the inventoryTransfers and shipping API’s as much as you can, and then the standard inventory movement API’s to fill in any gaps. It would require a custom app at this point though to emulate the full feature set of stocky.

Thank you so much for your advice KyleG, unfortunately, I think migrating to a custom app isn’t the ideal solution for the client, but I’ll have to find an alternative approach. Thank you so much for your advice and guidance.

If possible, I’d like to ask you one last question: I’ve noticed that when using Shopify’s APIs for inventory_transfers (movements of goods between various locations), I’m unable to retrieve the origin_location_id and destination_location_id. Is it not possible to get this data, or am I doing something wrong?

Thank you very much anyway, you’ve been very kind and helpful. I wish you a great day and a wonderful start to your week!

You can get the location IDs from the inventory transfers API through the nested location object within both the origin and destination fields.

Here’s a working query that shows how to access these location IDs:

query {
  inventoryTransfers(first: 10) {
    edges {
      node {
        id
        name
        status
        origin {
          name
          location {
            id          # Your origin_location_id
            name
          }
        }
        destination {
          name
          location {
            id          # Your destination_location_id  
            name
          }
        }
        lineItems(first: 10) {
          edges {
            node {
              totalQuantity
              inventoryItem {
                id
              }
            }
          }
        }
      }
    }
  }
}

And here’s what the response structure looks like:

{
  "data": {
    "inventoryTransfers": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/InventoryTransfer/123456789",
            "name": "IT001",
            "status": "COMPLETED",
            "origin": {
              "name": "Main Warehouse",
              "location": {
                "id": "gid://shopify/Location/987654321",
                "name": "Main Warehouse"
              }
            },
            "destination": {
              "name": "Retail Store",
              "location": {
                "id": "gid://shopify/Location/456789123",
                "name": "Retail Store"
              }
            },
            "lineItems": {
              "edges": [
                {
                  "node": {
                    "totalQuantity": 5,
                    "inventoryItem": {
                      "id": "gid://shopify/InventoryItem/789123456"
                    }
                  }
                }
              ]
            }
          }
        }
      ]
    }
  }
}