Fetch tote history and purchase order in order api

Hello,

I hope you are doing well.

I am currently using the GraphQL API to fetch order data.

I have a question regarding fetching tote history and purchase order data for a particular order. I cannot find these details in the order query response. I also noticed that the tote_history and purchase_orders APIs require specific arguments, but the required data is not available in the order API response.

Could you please advise on the following:

  1. How can I fetch the tote history for a particular order?
  2. How can I retrieve the related purchase order data for an order?
  3. Is there another API endpoint or GraphQL field that provides the required arguments (tote_id, tote_name, purchase order identifiers, etc.) needed to call these APIs?

Could you please guide me on the correct approach to retrieve this information?

Thank you for your assistance, and I look forward to your response.

Hi,

Tote history and purchase orders are not returned directly from the order query.

For tote history, the current approach is to first fetch the order line items and request tote_picks on each line item. Those records include the tote_id, which you can then pass to the tote_history query:

  1. Query the order and line item tote picks.
  2. Take the returned tote_id.
  3. Query tote_history(tote_id: "...").

Please note that tote_history is scoped to the tote, not directly to the order, so there is no order_id argument on that query.

For purchase orders, there is no direct purchase-order relationship exposed from an outbound order. Purchase orders are queried separately using purchase_order(id: ...), purchase_order(po_number: ...), or purchase_orders(...) filters such as sku, warehouse_id, po_number, and date/status filters. If you are working from an order, you can use the order line item SKUs/warehouse context to search purchase orders, but that is not a guaranteed one-to-one “related PO for this order” link.

Hello,

Thank you for your response.

I have an order with tote_history.

I am successfully retrieving the tote_id from an order’s tote_picks. However, when I pass this tote_id as an argument to the tote_history query, the response is always an empty array ([]).

I have included the GraphQL query and the corresponding response below for your reference.
Query :

query Tote_history {

tote_history(tote_id: "VG90ZTozNDM4M3OA==") {

    request_id

    complexity

    data {

        edges {

            node {

                tote_name

                tote_id

                created_at

                action

            }

        }

    }

}

}

Response:

{

"data": {

    "tote_history": {

        "request_id": "6a45fc92f438fb447b124e",

        "complexity": 101,

        "data": {

            "edges": \[\]

        }

    }

},

"extensions": {

    "throttling": {

        "estimated_complexity": 101,

        "cost": 1,

        "cost_detail": {

            "tote_history": {

                "items_count": 0,

                "cost": 1,

                "total_cost": 1,

                "fields": {}

            }

        },

        "user_quota": {

            "credits_remaining": 4003,

            "max_available": 4004,

            "increment_rate": 60

        }

    }

}

}

Since I am passing the exact tote_id data returned from the order, could you please explain why the tote_history data is empty?

Also, I would like to know if there are any required permissions or scopes for accessing tote_history. While creating the access token, I did not see any option to select scopes.

Could you please assist me by explaining the complete process step by step, including:

  • How to correctly retrieve tote_history for an order.

  • Whether the tote_id from tote_picks is the correct ID to use.

  • Any required permissions or access settings.

  • Any prerequisites or limitations that might cause the query to return an empty result.

Thank you for your assistance. I look forward to your guidance.

Are you sure the id doesn’t have a typo? I tried to decode with base64 VG90ZTozNDM4Mw== and I get an error. Please share the request you used to get it.

Also in your Profile section you can add your ShipHero account id. If you complete that I can give you a more accurate response.

We are developing a private app to display ShipHero order data and order history. For this, we require the tote_history data for tote_id: VG90ZTozNDM4NzM3OA==.

I have shared a video showing how we are trying to fetch the tote history data and how we are currently receiving null in the admin, even though the data is available in the ShipHero admin for the same order:

The requested ShipHero account ID is something I am not sure how to retrieve. However, I am able to get this value from the Order API:

Account id : QWNjb3VudDo4MzQzOQ==

Please confirm if this can help, or let us know how we can get the correct ShipHero account ID.

I have also requested the same issue from the client account: rickto@pm.me.

Please check and guide us on how we can access the tote history data for ShipHero orders.

Ok, found the problem. First in your previous message the tote id was wrong. Now I see a valid one. The thing is that totes belong to the 3pl, no the child account and the user you’re using to do the request is from the child account.

If I impersonate in the 3pl account I do get responses.

Hello,
I tried to find where to create a 3PL account, but I couldn’t locate the option.
I also referred to the following ShipHero documentation:

However, as shown in the screenshot below, the article displays the Legacy Flow, which is marked as Deprecated. I am unable to find the current process or the required option in my account.
Screenshot:

Could you please let me know the current process for creating a 3PL account? If there is any additional setup or permissions required, please let me know.
If possible, could we also go through this during a call? That way, I can understand the process and get everything working in one session.
Thank you in advance for your assistance.

Hello,

I hope you’re doing well.

I wanted to follow up on my previous email regarding creating a 3PL account, as I haven’t received a response yet.

Please give a response as soon as possible.