Metafields
Metafields store extra information that your eCommerce platform doesn't usually capture. SparkLayer uses them for additional B2B data:
| Type | Used for |
|---|---|
| Product metafields | Configuring the frontend interfaces, such as pack sizes and RRP prices |
| Customer metafields | Adding customer information, such as credit limits |
| Order metafields | Adding invoicing information to an order, and importing order history |
This page lists every metafield SparkLayer supports. On Shopify, each one uses the namespace sparklayer, for example sparklayer.pack_size. For setting them up on your platform, see:
Automatically configure metafields
On Shopify, SparkLayer can create its metafield definitions for you.
- Go to Integrations,Platform,Configurations (opens in your SparkLayer Dashboard in a new tab).
- Next to Metafields, click Configure. You'll see every metafield that can be configured for Product and Customer data.
Each metafield you enable is added to Metafields and metaobjects (opens in a new tab) in your Shopify admin and pinned, so it's easy to find when you edit products or customers.

Metafields created this way are named B2B - [name], for example B2B - Pack Size. To change or remove them, use Metafields and metaobjects (opens in a new tab) in your Shopify admin.
Product metafields
Apply all product metafields at the variant level.
| Metafield | Key | Type |
|---|---|---|
| Recommended retail price (RRP). Sets an RRP ("MSRP") price for a variant. See pricing display. | rrp | json |
| Pack size. Sets pack size rules for products, such as 6, 12 or 18. See quantity rules. | pack_size | integer |
| Minimum purchasable quantity (variant level). The minimum quantity of the variant customers must buy. See quantity rules. | min_order_quantity | integer |
| Maximum purchasable quantity (variant level). The maximum quantity of the variant customers can buy. See quantity rules. | max_order_quantity | integer |
| Minimum purchasable quantity (product level). The minimum quantity customers must buy across all variants. See quantity rules. | min_order_parent_quantity | integer |
| Maximum purchasable quantity (product level). The maximum quantity customers can buy across all variants. See quantity rules. | max_order_parent_quantity | integer |
| Reserve stock. Reserves an amount of stock that isn't available for regular purchase, for example to hold inventory for specific customers, events or direct-to-consumer sales. See stock display. | reserve_stock_quantity | integer |
| Product visibility. Whether a variant is visible on the storefront. If disabled, customers don't see the variant, even if it can still be bought in other ways. See product display. | display | boolean |
| Purchasing. Whether a variant can be added to the cart and bought. When disabled, the product stays visible but can't be bought, for example to showcase upcoming or unavailable items. See product display. | sell | boolean |
| Customer group product rules. B2B product rules, such as pack size and orderable quantities, for specific customer groups. Overrides the metafields above. See product settings. | settings | json |
| Reserved DTC stock quantity. A stock quantity to reserve for your direct-to-consumer (DTC) customers. See stock display. | min_stock_level | integer |
| Restock date. The date a product in pre-order status is expected to be available. See stock display. | restock_date | date |
| Stock location settings. B2B stock settings, such as minimum stock level and restock date, for specific stock locations. See stock display. | stock_location_data | json |
You can also set customer-specific product rules: see Product rules per customer group.
Customer metafields
| Metafield | Key | Type |
|---|---|---|
| Customer title. The customer's title (such as Mr, Ms or Dr), for personalising invoices, emails and account records. See account and addresses. | title | single line text |
| Company name. The name of the customer's company. See account and addresses. | company_name | single line text |
| Assigned group. The customer group assigned to the customer. Overrides any tags assigned to the customer. | group | single line text |
| Customer-specific price lists. The price lists assigned to the customer. Overrides any price lists assigned to the customer group. See customer pricing. | price_lists | jsonsingle_line_text |
| Invoice payment. JSON settings that define whether the customer can pay by invoice, so approved customers can complete purchases without paying straight away. See credit, net terms and invoicing. | payment_by_invoice | json |
| Credit limit and account balance. The customer's credit limit and account balance. See credit, net terms and invoicing. | payment_on_account | json |
| Accounting ID. A unique accounting ID for the customer. See account and addresses. | accounting_id | single line text |
| Additional percentage discount. A flat discount percentage applied on top of other discounted pricing. See customer pricing. | discount_percentage | single line textintegerfloat |
| Sales rep groups. The sales rep groups assigned to the customer, so dedicated representatives can manage the account. On Shopify, the definition is limited to preset choices, one per group, and SparkLayer keeps the choices in step with the groups made in the app. See restricting which customers a sales rep can see. | sales_agent_groups | list.single_line_text |
| Parent account. Links the customer to a parent customer account, for businesses with multi-level accounts, sub-customers and centralised purchasing. See company users. | parent_customer_id | single line text |
| Customer role. The customer's role in their company, used to apply permissions. See company users. | role | single line text |
| Default shipping address ID. The shipping address to use by default for orders. See account and addresses. | shipping_address_id | single line text |
| Default billing address ID. The billing address to use by default for orders. See account and addresses. | billing_address_id | single line text |
| Available shipping addresses. JSON listing every shipping address available to the customer, for businesses with several delivery locations. See account and addresses. | available_shipping_address_ids | json |
To use the advanced metafields, speak to our team about how they work.
Order metafields
| Metafield | Key | Type |
|---|---|---|
| Invoice link. A URL to the order's invoice, so customers can get to digital invoices quickly. See credit, net terms and invoicing. | invoice_url | urllist.urlfile_referencelist.file_reference |
Order import. Set to true to import a historic order into SparkLayer, so customers see it in their order history. See importing order history. | order_import | boolean |
| Visible ID. A custom order ID shown instead of the platform's order number, for example your ERP order number, so the ID is the same in every system. Shopify only. See setting a custom order number. | visible_id | single line text |
Next steps
- Shopify metafields and data mapping: set up and fill in metafields on Shopify.
- Data limitations: limits on the data you send to SparkLayer.
- Building integrations: how data flows between SparkLayer and your other systems.
Last updated