Search Results :

×

How to Integrate B2B Company Onboarding template with Shopify Flow App?


Integrate the B2B company onboarding template with the Shopify Flow app to automatically assign new customers to the right B2B company using custom rules. Using the MO Customer Accounts Login app together with Shopify Flow, every customer created on your store is evaluated against the rules you define and assigned to the right company automatically.

Rules can be built on customer fields such as Email Domain, Tag, Country, State/Province, City, Zip/Postal Code, Note, Created At, Total Spend, No of Orders and Metafield. This removes the manual step of adding each buyer to a company and is ideal for B2B stores, wholesale portals and partner storefronts on Shopify Plus.

  • Log in to your Shopify Admin.
  • Go to AppsShopify App Store
  • Search for Shopify Flow
  • Click Install to add the app to your store
  • Make sure Shopify Flow is installed on your store. (Flow is available on Shopify Plus and on eligible plans from the Shopify App Store.)
  • Make sure the B2B companies you want to assign customers to already exist under CustomersCompanies in your Shopify Admin.
  • In your Shopify Admin, navigate to AppsFlow to open the Shopify Flow dashboard.
  • Click on the Browse templates button.
Browse Flow Templates - Shopify B2B Company Assignment

  • In the Search field, type b2b to filter the available B2B automation templates.
  • Select the template named Assign customer to B2B company when customer is created.
Search B2B Templates - Shopify B2B Company Assignment

  • Review the workflow preview and the About this template panel. The template uses the MO Customer Accounts Login app by miniOrange and contains the following steps:
Customer created Trigger — the workflow starts when a new customer is created.
Company Assignment Rule configuration miniOrange action — set the conditions used to automatically assign customers to a company.
Condition Checks if the company query was generated successfully.
Get company data Fetches companies using an advanced query, sorted by created at in ascending order.
Assign Company to Customer miniOrange action — assigns the matched B2B company to the customer based on the configured rules.
B2B Flow Template Preview - Shopify B2B Company Assignment

  • Click on the Install button on the top right of the template.
  • A Before you install dialog appears with a pre-install note. Read the note and click on Install to continue.
Before You Install Dialog - Shopify B2B Company Assignment

  • The workflow is installed as a Draft and opens in the Flow editor. A Review label is shown on the Company Assignment Rule configuration step, indicating that this step still needs to be configured.
Template Installed as Draft - Shopify B2B Company Assignment

  • Click on the Company Assigment Rule configuration step in the workflow to open its settings panel.
  • You will see the error "Please set rules for company assignment. Click on Configure Rule to continue." until the rules are defined.
  • Click on the Configure Rule button.
Configure Rule Button - Shopify B2B Company Assignment

  • You will be redirected to the Company Assignment Rule Configuration page of the MO Customer Accounts Login app. The page is divided into three steps.
Company Assignment Rule Configuration Page - Shopify B2B Company Assignment

Step 1: Select Matching Strategy


  • Choose how you want to match customers to companies from the Matching Strategy dropdown. Select Static Rules to assign companies based on the fixed conditions you define in the next step.

Step 2: Define Rule Conditions


  • Under Rule 1, configure the condition using the table below:
Customer field The customer attribute to match on. Available options are Email Domain, Tag, Country, State/Province, City, Zip/Postal Code, Note, Created At, Total Spend, No of Orders and Metafield.
Operator The comparison to apply, for example Equals. The available operators change based on the selected customer field.
Value The value to compare against. For example, enter xecurify.com when matching on Email Domain.
Customer Field Options - Shopify B2B Company Assignment

  • Click on + Add condition to add more conditions to the same rule (all conditions within a rule must match).
  • Click on + Add Rule to create additional rules for other companies, for example a second rule that maps a different email domain to a different B2B company.

Step 3: Assign to Company


  • In the Company field for Rule 1, search for and select the B2B company that matching customers should be assigned to, for example MiniOrange.
  • The Configuration Summary card on the left updates in real time and shows what your rule will do, for example: Automatically assign a customer to "MiniOrange" if their email domain is "xecurify.com".
Assign to Company and Configuration Summary - Shopify B2B Company Assignment

  • Click on the Save Configuration button on the top right.
  • You will see the Configuration saved successfully confirmation banner.
  • Click on Exit in the top left to return to your Shopify Flow workflow.
Configuration Saved Successfully - Shopify B2B Company Assignment

  • Back in the Flow editor, the Company Assigment Rule configuration step now shows a Configuration Page Preview instead of the error.
  • Click on the Turn on workflow button on the top right.
  • In the Ready to turn on your automation workflow? dialog, click on Turn on.
Turn on Workflow - Shopify B2B Company Assignment

  • On the Flow Workflows list, the workflow status changes to Active with the trigger Customer created.
Workflow Active - Shopify B2B Company Assignment

You have completed the workflow configuration.

  • Go to your Shopify Store. (https://<your-shopify-storedomain>)
  • Click on the User login icon in the storefront header and sign in with an account whose email matches the rule you configured, for example an email ending in @xecurify.com.
Storefront Login - Shopify B2B Company Assignment

  • Complete the sign-in. On successful login you will land on the customer account page of your store, and a new customer record is created in Shopify.
  • Now go back to your Shopify Admin and navigate to Customers. Open the customer that was just created.
Customer Created - Shopify B2B Company Assignment

  • On the customer detail page, the Company card shows the assigned B2B company and the Permissions card shows the location permissions granted to the customer.
  • The Timeline confirms the automation, showing entries such as "MO Customer Accounts Login added this customer to <Company>" and "This customer was given Ordering only permissions for <Company>".
Customer Assigned to B2B Company - Shopify B2B Company Assignment

Note: You can review every execution of the workflow under AppsFlowRecent runs. Workflow runs are deleted 14 days after completion.


You've completed the integration of the B2B Company Onboarding template with Shopify Flow. With this setup, every new customer created on your store is evaluated against your rules and assigned to the correct B2B company automatically, so buyers get their company pricing, catalogs and payment terms from their very first login without any manual work from your team.


This error means the assignment rules have not been saved yet. Open the step, click Configure Rule, complete Step 1 to Step 3 on the Company Assignment Rule Configuration page and click Save Configuration. Once you see the Configuration saved successfully banner, exit back to Flow and the error will be replaced with a configuration preview.

First confirm the workflow status is Active and not Draft under AppsFlow. Then open Recent runs and inspect the run for that customer to see which step stopped the flow. The most common causes are the customer's field value not matching the rule (for example the email domain is different from the value you entered), or the selected company no longer existing under CustomersCompanies.

Yes. Open the workflow, click the Company Assigment Rule configuration step and click Configure Rule again. Update the matching strategy, conditions or target company and click Save Configuration. The updated rules apply to customers created after the change. Customers created earlier keep their existing company assignment and can be updated manually from the customer's Company card.

More FAQs ➔

Yes. On the Company Assignment Rule Configuration page, create one rule per company. Set the Customer field to Email Domain, the Operator to Equals and the Value to the domain you want to match, then select the corresponding company in Step 3. Use + Add Rule to repeat this for every domain and company pair you need.

The Customer field dropdown supports Email Domain, Tag, Country, State/Province, City, Zip/Postal Code, Note, Created At, Total Spend, No of Orders and Metafield. You can combine several of these within a single rule using + Add condition, for example matching both an email domain and a country.

Yes. When a buyer signs in for the first time through SSO, Shopify creates the customer record and the Customer created trigger fires, which runs this workflow and assigns the company. This lets you onboard B2B buyers end to end: they authenticate with your identity provider and immediately receive their company's catalog, pricing and payment terms. See the Shopify SSO setup guides to configure your identity provider.

Customers assigned by the workflow are given Ordering only permissions on the company location, which lets them place orders on behalf of the company. The assignment and the permission grant are both recorded on the customer's Timeline. You can change the permission level at any time from the customer's Permissions card in the Shopify Admin.

 Thank you for your response. We will get back to you soon.

Something went wrong. Please submit your query again


ADFS_sso ×
Hello there!

Need Help? We are right here!

support