According to the GraphQL documentation, totalWeight is the weight of an order without adjustments for returns/removals, while currentTotalWeight is the weight with adjustments.
We've recently noticed many of our users' orders have totalWeight=0 and currentTotalWeight>0, which doesn't make sense according to the logic above.
Is there any specific reason for an order to lack this field? We're under the impression that all orders that have a currentTotalWeight should also have a totalWeight.
Any assistance would be greatly appreciated.
Solved! Go to the solution
I would be happy to take a closer look and pass on any insights I can. Would you be able to provide us with an example x-request-id header that was returned from a recent request where these unexpected values are returning on fields you mentioned? - cheers!
This is an accepted solution.
We took a closer look with the request-ID, and there doesn't appear to be an issue with the functionality of our API or how the data is being returned. To confirm, you are correct that the values mentioned totalWeight and currentTotalWeight can only be calculated and set by Shopify when an order is processed through the checkout.
In the event that orders have been created via API, these values would have to be manually defined by an app or service in the request. The API endpoint does not validate the passed values to ensure that they meet for example - weight criteria ie."total weight must be greater or equal to current weight", but instead validates for syntax. When an order is imported, these values would need to be set by the app that is importing them, and for this reason we would suggest contacting a merchant to confirm the origin of orders.
While we are unable to support authenticated app or store related issues from these forums at this time, we can still provide suggestions. I would first directly check an order (json) to determine if the values are expected. If the order was created through our checkout and has those values, have your client contact our support line directly so that we can gather authorization for a more thorough investigation. If the orders are API-created, you may need to work with your client directly to ensure correctly calculated values are being passed.