All Collections
Customer Fields
How-to Guides
How to use account approval with Shopify B2B
How to use account approval with Shopify B2B

Use Shopify Flow to create a company account after approving an application

Brett Shelley avatar
Written by Brett Shelley
Updated over a week ago

This article discusses our recommended method of using the Customer Fields app alongside Shopfiy's B2B features. This specifically involves using a form created in the app to collect data about your customer, and then manually approving or denying each application received. You can use our method and templates exactly, or use them as a starting point for your own use case.

❗While Shopify Flow itself is available on any Shopify plan, Shopify's company and B2B features are only available on Shopify Plus.

Setup checklist

Here are some items to be sure you have set up before creating companies in Shopify:

  • Make sure you have the Shopify Flow app installed. If not, install it for free from the Shopify app store.
    ​

  • Use the Customer Fields app to build a custom registration form to collect the necessary information about your business customers.

    • We recommend using the 'Require account approval' setting which gives you the opportunity to review and approve or deny each application.

    • Make sure to include the default_address.company field on the form. This is used in our workflow to set the name of the company record created.
      ​

  • Install your custom form onto your storefront.

  • Enable Shopify's "New customer accounts" which is a requirement for using B2B company accounts. There are a couple of options for this, which can both be found in the Shopify admin settings under Customer accounts.

    • You can globally enable new customer accounts for your site, which will redirect the header account link to the new customer account login page. If using this option, you will need to provide your own link to the registration page.

    • You can also use the direct URL to the new customer account login, and add this to your site as a specific "B2B Login" link. With this option, you can leave classic customer accounts enabled, which is useful if you want B2C customers to continue using classic accounts.

Set up the company creation workflow in the Flow app

The easiest way to get this up and running is to use the following pre-made Flow templates, and customize as needed. To use our templates, download the files below, and then open the Flow app and click 'Import'.

Templates:

Breakdown of the Flow triggers and actions

Our pre-made templates are meant to be a starting point and the workflow can be customized using different triggers and actions to suit different use cases.

Create company on account approval

  • Customer approved

    • This triggers the workflow when a 'Pending' customer account is approved through the Customer Fields app.

      ❗Note: When approving a customer in the app, we recommend selecting the "Approve without sending invite" option. This will prevent the app from sending the generic approval email since a specific B2B approval email will already be sent as part of the workflow.

      ​

  • Create company

    • The first step in the process is to actually create the company record in Shopify. When using our template, this defaults to using the default_address.company field for the company name.
      ​

  • Assign address to company location

    • This action uses the approved customer's address as the default address for the company location that was created in the previous action.
      ​

  • Add customer tags

    • We are using this action to apply a specific tag to the customer, which is then used in the "Send B2B access email" Flow template to send a notification to the customer, letting them know that their access has been approved.
      ​

  • Assign customer as a company contact

    • Now that the company record has been created, this action will actually assign the customer account to be associated with the company.
      ​

  • Assign role to company contact

    • This action grants permissions to the customer so that they can make company orders. By default, the permission level is set to "Ordering only", but you can also select to grant "Location admin" permission.
      ​

  • Copy customer metafields to company

    • If you use any custom fields on your Customer Fields form, the data collected will by default be stored as customer metafields. This action copies the values from the customer metafields over to the company record itself. Please note that this action only copies over metafields that are using our customer_fields namespace.
      ​

Send B2B access email to approved customer

  • Company contact assigned permission

    • This workflow gets triggered when a customer is assigned company permissions, which happens automatically in the Flow discussed above during the Assign role to company contact action.
      ​

  • Check customer tag

    • This is a conditional statement that checks if the customer contains a specific tag. The tag being looked for here is applied in the Flow above, ensuring that the B2B access email is only automatically sent when triggered as part of this sequence, not when manually editing a customer's permissions.

  • Send B2B access email to company contact

    • This action triggers Shopify's B2B welcome email to notify the customer that they have been approved for access. You can view or edit the email template in your Shopify admin settings > Notifications or here.

  • Remove customer tag

    • Now that the email has been sent, we can remove the tag that had previously been applied specifically to trigger this email.

Did this answer your question?