Capture VAT numbers on the Customer registration page

To let Sufio capture and validate VAT registration numbers on your Shopify store, you can add a VAT registration number field to the customer registration form.

This way, your business customers will be able to enter their VAT registration numbers when creating their customer accounts on your online store.

Shopify customer registration VAT number

Example of a customer registration form with the VAT number field

In this article, we will cover

VAT registration numbers in your Shopify admin

When a customer enters their VAT registration number, this will later be stored in your Shopify admin as part of customer notes.

Sufio will automatically validate this VAT registration number and set your business customers as tax-exempt when applicable. More importantly, this VAT registration number will be automatically included on your invoices.

Add the VAT registration number field to the Customer Registration page

To add the VAT registration number field to the customer registration form you need to customize your Shopify store theme:

  1. In your Shopify admin, go to the Online Store → Themes page.
  2. Click the Actions button, then click Edit code
  3. Select customers/register.liquid in the left sidebar. You might use the upper search bar for a faster search.
  4. Insert the following code snippet inside the <form>. A good place for the field is before the Email field.
<!-- Shopify customer registration -- capture VAT numbers from customers. Used by Sufio for Shopify (www.sufio.com/shopify). -->
<label for="vat_reg_no">VAT Registration Number</label>
<input type="text" id="vat_reg_no" name="customer[note][VAT Registration Number]" placeholder="VAT Registration Number" />

Tip

You can modify the label part of the code snippet by replacing the VAT Registration Number text with anything else you'd like. Please contact our support team if you need to make the label multilingual. We'll be happy to help!

  1. Select index.liquid in the left sidebar. 
  2. Insert the following code snippet at the end of the file.

<!-- Shopify customer account -- set business customers as VAT exempt when applicable. Used by Sufio for Shopify (www.sufio.com/shopify). -->
<script type="text/javascript">
  function getCookieValue(a) { var b = document.cookie.match('(^|;)\\s*' + a + '\\s*=\\s*([^;]+)'); return b ? b.pop() : ''; }
  
  document.addEventListener("DOMContentLoaded", function(event) {
    var email = "{{ customer.email }}";
    if (email && getCookieValue("sufio_vat_email_init") != email) {
      document.cookie = "sufio_vat_email_init="+email+";expires=Tue, 31 Dec 2030 00:00:00 GMT;path=/";
      $.ajax({
        type : "GET",
        dataType: "jsonp",
        url: "/apps/sufio/customer-vat/",
        data: { email: email }
      }); 
    }
  });
</script>

Required customer accounts

If your Shopify store requires customers to create an account before placing an order, then some additional steps are needed in addition to those above:

  1. Select customers/register.liquid in the left sidebar. 
  2. Insert the following code snippet inside the <form>.
<!-- Shopify redirect -- redirect new user with items in the cart to cart after registration. Used by Sufio for Shopify (www.sufio.com/shopify). -->
{% if cart.item_count > 0 %}
  <input type="hidden" name="return_to" value="/cart" />
{% endif %}

  1. Select cart.liquid in the left sidebar.
  2. Insert the following code snippet at the end of this file.

<!-- Shopify customer account -- set business customers as VAT exempt when applicable. Used by Sufio for Shopify (www.sufio.com/shopify). -->
<script type="text/javascript">
  function getCookieValue(a) { var b = document.cookie.match('(^|;)\\s*' + a + '\\s*=\\s*([^;]+)'); return b ? b.pop() : ''; }
  
  document.addEventListener("DOMContentLoaded", function(event) {
    var email = "{{ customer.email }}";
    if (email && getCookieValue("sufio_vat_email_init") != email) {
      document.cookie = "sufio_vat_email_init="+email+";expires=Tue, 31 Dec 2030 00:00:00 GMT;path=/";
      $.ajax({
        type : "GET",
        dataType: "jsonp",
        url: "/apps/sufio/customer-vat/",
        data: { email: email }
      }); 
    }
  });
</script>

Need help?

Do you need help with customizing your Shopify store theme? Please contact our experienced support team. We'll be happy to assist!

View VAT Exemptions

When your business customer enters a VAT registration number using the newly added VAT registration number field, a VAT exemption request will be listed on the View VAT Exemptions page in your Sufio account.

EU VAT Exemptions page in Sufio

An overview of VAT Exemption requests from the EU business customers

On this page, you can access all successful and unsuccessful exemption requests made on your Shopify store. The provided filtering options make it possible for you to quickly review and troubleshoot the VAT exemption requests when needed.

To access the View VAT Exemptions page:

  1. In your Sufio account, go to the Settings → Taxes page.
  2. Click on View VAT Exemptions.