Companies¶
The Companies push creates B2B companies in Shopify, each with its first location, and updates them. A company is a business customer. Its locations are the branches or sites that order, each with its own addresses, tax and payment terms.
On a push connector, select Companies as the Shopify Import Type. The push creates a company through Shopify's companyCreate mutation, and updates one through companyUpdate and the company location mutations.
The company imports need a store with B2B. Shopify offers B2B on Shopify Plus.
Building a B2B Customer¶
The B2B imports build on each other's ids. A typical order:
- Companies creates the company and its first location. It writes back the Company Id, the Location Id and the company's contact roles.
- Company Locations adds the company's other locations, and updates any location.
- Customers creates the people who buy for the company.
- Company - Assign Customer As Contacts makes each customer a contact of the company, and writes back the Contact Id.
- Company - Contact Assign Roles gives each contact a role at a location, such as Location admin.
- Pricelist and PricelistQtyBreak set the prices, and CatalogUpdate gives the locations their catalogs.
Creating and Updating¶
Company Id decides between creating a company and updating one:
- Leave Company Id blank to create the company with its first location, from the location, billing and shipping fields. IMan writes back the Company Id, the Location Id and the company's first two contact roles.
- Map a Company Id to update the company's name, external id and customer-since date. Map its Location Id as well to update that location's details, tax registration and addresses.
Under Insert, a record with a Company Id fails. Under Update, a record without one fails.
The Companies push adds no locations to an existing company. Use Company Locations for that. It also matches locations by their External ID.
Fields¶
| Field | Rule |
|---|---|
| Company Id | The company to update, as a numeric id or a gid. Written back after a create |
| Company Name, External Id, Customer Since | The company's name, its id in your system, and the date it became a customer |
| Location Id | The location to update, as a numeric id or a gid. Written back after a create |
| Location Name, External ID, Location Locale, Location Note, Location Phone | The location's details |
| Location Tax Registration Id | The location's tax registration number |
| Location Payment Terms Id | The location's payment terms template, as a numeric id or a gid |
| Location Checkout To Draft | True makes the location's checkouts into draft orders for review |
| Location Editable Shipping Address | True lets the location's buyers change the shipping address at checkout |
| Billing and Shipping fields | The location's billing and shipping addresses. An address replaces the location's address whole. Map every part of it |
| Billing Same As Shipping | True uses the shipping address for billing too, and ignores the billing fields |
| Company Contact Role 1 Id and Name, Company Contact Role 2 Id and Name | Written back after a create: the company's first two contact roles, such as Location admin and Ordering only |
Errors¶
Each step of an update is a request of its own: the company, the location, its tax registration, and its billing and shipping addresses. When one fails, the earlier steps stay applied, and the message names the step that failed with Shopify's reason.
The push has no bulk operations.
Access Scopes¶
The push needs write_companies. See Access Scopes.
Shopify Reference¶
companyCreate and companyUpdate in Shopify's GraphQL Admin API reference.