When we got data on webhooks related to orders ( create or update ) or when we GET order using rest API, we see field total_price_usd under order document. However we can't find this field in documentation. We want build some mechanism that make use of this in one of our apps but as field is not documented we are not sure if we can rely on it or not.
Could you provide some more details on what you meant by reliable? Reliable in terms of accuracy of the value of total_price_usd itself, or reliability in terms of the field being present at all?
As a general rule of thumb, I always advise against relying on undocumented fields on any API because they can be changed or removed at any time without warning. So if it was an important/vital feature you were planning to develop around that field, I'd personally advise against it.
To argue against myself though, total_price_usd has been around for a very long time and I'm not aware of any plans to remove it, but it's still a risky move to use anything we haven't put into our documentation.
Im Derek's teammate. We do not afraid of removal of total_price_usd. We don't know if we can trust data accuracy.
I found for example thing like this : https://github.com/nozzlegear/ShopifySharp/issues/136.
During tests i have never met total_price_usd to be null, but above suggests thats possible.
Also would be nice to know what are currency rates. It's just example, intentionally exaggerate to show the problem, but if one day i will see that 100 CAD order is worth 10000 USD i won't be happy. Could you tell me what is reason behind the fact Shopify didn't add it to docs?
I will be grateful if you could remove those doubts.
There have been some orders with a null total_price_usd in the past it turns out, but there have been under ~3k in the history of Shopify and they were all so long ago it's not possible to tell why they happened. There doesn't seem to be any commonality between any of them.
In terms of the sourcing of our currency conversion rates, those aren't details that I can disclose publicly. If memory serves as well, total_price_usd is meant for internal use so its likely undocumented because it wasn't meant for public consumption. In all honesty I think it would make a lot more sense if we were to just remove it, so I want to advise again against using it.
If you need the USD price for an order, it'll be a lot safer to convert order totals on your own.