How can I export the Shopify B2B customer's Company and Location info from a Shopify order?
EZ Exporter can export the B2B company name, company external ID, location name, and location external ID as part of a Shopify Order data export.
On the Shopify Admin's order detail page, the name values are displayed under "Company" of the "Customer" section:
To export them, you can enter the following in the Custom Fields or Calculated Fields section in the Data Settings:
- {{ purchasing_entity.company.name }}
- {{ purchasing_entity.company.external_id }}
- {{ purchasing_entity.location.name }}
- {{ purchasing_entity.location.external_id }}
In case you also need to export the Shopify auto-generated company ID and location ID, these are available as well via the following variables:
- {{ purchasing_entity.company.id }}
- {{ purchasing_entity.location.id }}
These fields above will use the new GraphQL API's ID structure which will look something like gid://shopify/Company/491600
. If you just want to export the last part of this auto-generated ID (i.e. 491600
), you can use a formula like this in the Calculated Fields:
{{ purchasing_entity.company.id }}.split("/")[-1]
App: EZ Exporter