Skip to main content

Obtain customer consent in Shopify Point of Sale

If you are selling products instore that require an additional terms of service or purchase agreement, it's important that you can track this in Shopify. This might include terms of service for products with an ongoing service agreement, data consent, or simple email marketing consent.

You may want to do this on the customer level using customer tags, or, you may want to track consent against individual products.

In any case, using the ShopFields app you can collect customer consent quickly and easily.

One way to do this would be to create a simple binary (yes/no) custom field in the custom fields app. Your field might look like this:

screenshot of pos custom fields showing how to track terms of service

Then, in Shopify POS, marking off whether the customer has agreed to the terms of service is as simple as:

  • Clicking on the Add custom field tile
  • Selecting our TOS field
  • Saving

applying the terms of service consent field to shopify pos order

Once applied, the field will show up on the order in point of sale.

applied the terms of service consent field to shopify pos order

Now that the field has been applied, we can use Shopify Flow to handle any follow-on actions. This might include:

  • Adding the customer to a specific list in Klaviyo
  • Adding a tag to the customer or order based on if they have agreed to the terms of service
  • Setting up email alerts if an order comes through that contains a specific product, and the customer has not agreed to the terms of service.

shopify flow email alert when terms of service accepted

There are lot of ways to extend and customize this to suit your needs too. Perhaps you want to offer consent on individual products, or instead of a binary yes/no option you have a list where the customer can choose what level of consent or marketing they are comfortable with.

When clicking 'accepts marketing' in Shopify POS, either in the customer's profile or checkout, the customer will be subscribed to email marketing, but not SMS marketing. Using ShopFields and Shopify Flow you can automate this process and update a customer's SMS marketing consent.

Before enabling, make sure you understand and follow your region's privacy rules for collecting SMS marketing consent.

customer does not have SMS marketing enabled

This customer has email marketing consent, but not SMS

To set this up all we need to do is:

  • Create a field in ShopFields with the key 'accepts_sms'
  • Create a Shopify Flow that listens for this key anytime it gets an order and updates the customer's profile

1. Create the field in ShopField app

First I create a field in the ShopFields app. Note the "key" is "accepts_sms" and I'm using a true / false field. I'm also using an order field instead of applying the field to individual items in the cart.

create shopField custom field for sms marketing consent with Shopify POS

2. Create the Shopify Flow

Next I create a Flow using the free Shopify Flow app. It simply:

  1. Listens for anytime an order is created
  2. Checks if the order contain an attribute with the key 'accepts_sms' (the key we set on our field)
  3. Sends a HTTP Request to Shopify. This is where the magic happens. We send a GraphQL request to Shopify to update the customer's profile.

Here's each step in detail (I'd recommend opening the image in a new tab if needed):

Shopify Flow for checking sms marketing consent condition

Checking if the order contains the 'accepts_sms' key

Shopify Flow HTTP request to update SMS marketing condition

Our HTTP Request which updates the customer the Shopify Admin API

There are a two things you will need to update in your HTTP Request action:

Here are the fields:

URL

https://{YOUR-STORE}.myshopify.com/admin/api/2023-10/graphql.json

Headers

X-Shopify-Access-Token : { Your Admin API Access Token}
Content-Type : application/json

Body

Credit for the GraphQL request goes to Kevnob's post on the Shopify community
{
"query": "mutation customerSMSMarketingConsentUpdate($input: CustomerSmsMarketingConsentUpdateInput!) {\n customerSmsMarketingConsentUpdate(input: $input) {\n customer {\n id\n smsMarketingConsent {\n marketingState\n consentUpdatedAt\n marketingOptInLevel\n }\n }\n userErrors {\n field\n message\n }\n }\n}",
"variables": {
"input": {
"customerId": "{{order.customer.id}}",
"smsMarketingConsent": {
"marketingOptInLevel": "SINGLE_OPT_IN",
"marketingState": "SUBSCRIBED"
}
}
}
}

Now that it's all set up, when a staff member adds the field to that order, the customer's SMS marketing consent will be updated.

Shopify Flow HTTP request to update SMS marketing condition

The field is available in POS

Shopify Flow HTTP request to update SMS marketing condition

The order was completed with our field

Shopify Flow HTTP request to update SMS marketing condition

Shopify Flow successfully updated our customer

Shopify Flow HTTP request to update SMS marketing condition

Customer's SMS marketing Consent is updated

Troubleshooting and next steps

If you're running into issues, the first thing to check is the Flow run history. If there's any errors they should be logged there. Check you've added your HTTP Request fields in correctly, and that the customer has a phone number, as this is required to enable SMS marketing consent.

You may want to extend this flow to tag the customer, to handle un-subscriptions, or to only subscribe under certain conditions. You might want to change the API version as well.