Integrations
Shopify
Shopify Metafields & Data Mapping
introduction see what's possible with metafields to see all available metafields for sparklayer, please see our metafields docid\ otlhhi8sq6os4pat23 8h guide metafields help you to customise the functionality and appearance of your shopify store by letting you save specialised information that isn't usually captured in the shopify admin you can use metafields for internal tracking, or to display specialised information on your online store in a variety of ways for full details, please refer to this official shopify guide in the context of sparklayer, metafields are used to capture additional b2b data that you can then use in a variety of ways type details product metafields updating the frontend interfaces docid\ ccz1vnh0o6d 722w35xpa by adding configurations such as quantity rules docid\ cmxfrpgjqxfz9vjztvv0d , pricing display docid\ s vtljborgmnwjjfsmom9 , and more customer metafields updating a customer's information by adding information such as credit, net terms, & invoicing docid\ ywm70oquosykooiqb4z4g order metafields updating an order with credit, net terms, & invoicing docid\ ywm70oquosykooiqb4z4g important considerations in order for sparklayer to work with shopify metafields, please note the following product metafields metafields are always added at the product variant level, even if the product only comes in a single variant json data some sparklayer settings require metafields to be set up as json strings these will need to be carefully added, making sure the formatting is set correctly automatically adding metafields within the sparklayer dashboard , you can speed up the creation of metafields using our built in tool to automatically configure them to get started, go to integrations and click configure within the configure metafields section you'll then see all available metafields that can be configured for product and customer data when a metafield is enabled, this will automatically be added to the custom data section of your shopify admin and will be 'pinned' for easy access when configuring metafields for products or customers any metafields automatically created by sparklayer in this way will be prefixed with b2b \[name] for example b2b pack size should you need to modify or remove metafields, you can manage this via the custom data section within your shopify store manually adding metafields please note shopify has built in ways to set up metafields and we recommend referring to their official shopify guide on the best ways to do this within your shopify store, navigate to settings and click custom data and you'll see an interface similar to the below in this example, you can see how pricing display docid\ s vtljborgmnwjjfsmom9 is set up at a variant level and we've also included a video below to see the full steps setting up product metafields see what's possible with product metafields to see all available metafields for sparklayer, please see our metafields docid\ otlhhi8sq6os4pat23 8h guide metafields at a variant level generally speaking, in the context of sparklayer, all metafields are added at the variant level not the product level this is very important to remember when configuring any metafields that you're looking to add when setting up metafields in shopify, you'll be required to specify the following at a minimum item details metafield type this sets the data type, e g a text field, json, a selection of values namespace this defines the category and naming convention of the metafield in the case of sparklayer, this must be set as sparklayer key this defines the key to use, e g pack size value this is then added against a product variant within shopify (see below) when you're setting up the namespace and key via the shopify admin, you'll be required to "combine" this in the "namespace and key" field in our example below, we've illustrated how this works for quantity rules docid\ cmxfrpgjqxfz9vjztvv0d , entered as sparklayer pack size setting up customer metafields see what's possible with customer metafields to see all available metafields for sparklayer, please see our metafields docid\ otlhhi8sq6os4pat23 8h guide customer metafields work in just the same way as product metafields (see above) and, once they are setup within shopify, you can navigate to any customer record and add or edit data as required in our example below, we've set up credit, net terms, & invoicing docid\ ywm70oquosykooiqb4z4g , a sales agent ordering docid\ uw8mdbmefwwkqzrvb5cqx , and a customer pricing docid\ v8dvucj7ju0fh7bvinrew populating metafields once you've set up metafields, you can navigate to a product, customer, or order record within shopify and add your sparklayer settings within the fields shown importing metafields in bulk currently, shopify offers no "built in" way to bulk import metafield data at a variant level so it's necessary to use third party apps to get around this one of the most recommended, is an app called matrixify which allows you to easily "map" metafield data and import in bulk order data see what's possible with order metafields to see all available metafields for sparklayer, please see our metafields docid\ otlhhi8sq6os4pat23 8h guide when an order is passed to shopify, the following attributes are attached to the order attribute notes note order note sparkcartid this is added as an order note this is primarily for internal use for debugging note order note sparkpaymenttype this is added as an order note this contains the name of the payment option used upfrontpayment paymentonaccount paymentbyinvoice quote tag a tag of b2b is added to any order placed via sparklayer on each line item, there is also a charged price attribute which contains the final line item price order mapping shopify spark layer processsed at created at id external id name visible id currency currency code note customer reference customer id customer id billing address billing address shipping lines\[0] title packages\[0] shipping name packages\[0] shipping sku === 'shopify' shipping address packages\[0] shipping address shopifyorder shipping lines\[x] price (sum) packages\[0] total shipping gross shopifyorder shipping lines\[x] tax lines price (sum) packages\[0] total shipping net line items\[t] name packages\[0] items\[t] name line items\[t] quantity packages\[0] items\[t] quantity line items\[t] id packages\[0] items\[t] variant id (t) packages\[0] items\[t] line total gross (t) packages\[0] items\[t] line total net order history importing orders into sparklayer it's possible to import historic b2b order data into sparklayer, allowing customers to see their previous order history once they access their account on your store to do this apply a metafield as shown below item details custom data type order metafield type this must be set as an boolean namespace this must be set as sparklayer key this must be set as order import value this must be set as a boolean of true any orders that are imported this way must also have a tag of b2b assigned to them within shopify if you're working with a large data set and would prefer to do this manually, you can instead use order metafields within shopify to do this our recommendation is to use a bulk import tool such as matrixify https //apps shopify com/excel export import?st source=autocomplete to manage this more quickly when importing using this tool, you can use the format below simply by adding the shopify order id in the id column we also have a sample csv template https //cdn shopify com/s/files/1/0612/7602/9065/files/example historic order import csv?v=1738672207 you can start with id metafield sparklayer order import \[boolean] command \[order id here] true update please note the note attribute must be added to the order after sparklayer is installed for the order to be synchronised correctly orders synced in this way can then be reported upon and will appear in the orders section of the sparklayer dashboard advanced settings to learn about more advanced settings, including customer level product metafield settings, please see product settings docid\ cm9b1i6cz0volc67g fji