Hello!
Using the admin API, I need to do a bulk query to get all the B2B orders for the last year. Looking at the orders query, there is no filter documented for B2B orders, but the Shopify admin has one and when looking at the network request it’s making, it’s doing a query with business_to_business:"true". I tested it on queries with the admin API and it seems to be doing what I need.
I searched for that filter attribute in the doc but doesn’t seem to be mentioned anywhere. So my question is: Is it safe to use that filter business_to_business:"true" in a production app? (if so, it should probably be documented somewhere)
Thanks!
Undocumented API functionality can change or be removed without notice, so I wouldn’t recommend using business_to_business in production. A more reliable option is to filter using your own order tag or metafield, if you already use one to identify B2B orders. Otherwise, run a bulk orders query and identify B2B orders using purchasingEntity.
Hi @Paige-Shopify,
I’m asking because from my experience small details tend to get undocumented because it was forgotten.
The goal is to do a 1 year bulk export for B2B orders, before the app was installed. So no tag or metafield to use as a filter and getting all orders and then filtering out would be too much unnecessary data.
That’s fair. I can’t deny we’ve had a few of those. In this case, though, the filter was intentionally kept internal. But since you’ve brought it up, I’m looking into whether we can review it and prepare it for official public use 
Quick update: this is being considered for official public use, but I can’t confirm anything ahead of a docs update. Once it’s included in the docs, I’ll update this thread.
Thank you for following up on that @Paige-Shopify! 