Skip to content

Metafields

Metafields store extra information that your eCommerce platform doesn't usually capture. SparkLayer uses them for additional B2B data:

TypeUsed for
Product metafieldsConfiguring the frontend interfaces, such as pack sizes and RRP prices
Customer metafieldsAdding customer information, such as credit limits
Order metafieldsAdding 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.

  1. In the SparkLayer Dashboard (opens in a new tab), go to Integrations > Platform connection.
  2. In the Configure metafields section, click Configure. You'll see every metafield that can be configured for Product and Customer data.

Each metafield you enable is added to Custom data (opens in a new tab) in your Shopify admin and pinned, so it's easy to find when you edit products or customers.

SparkLayer metafields pinned in Shopify's custom data settings

Metafields created this way are named B2B - [name], for example B2B - Pack Size. To change or remove them, use Custom data (opens in a new tab) in your Shopify admin.

Product metafields

Apply all product metafields at the variant level.

MetafieldKeyType
Recommended retail price (RRP). Sets an RRP ("MSRP") price for a variant. See pricing display.rrpjson
Pack size. Sets pack size rules for products, such as 6, 12 or 18. See quantity rules.pack_sizeinteger
Minimum purchasable quantity (variant level). The minimum quantity of the variant customers must buy. See quantity rules.min_order_quantityinteger
Maximum purchasable quantity (variant level). The maximum quantity of the variant customers can buy. See quantity rules.max_order_quantityinteger
Minimum purchasable quantity (product level). The minimum quantity customers must buy across all variants. See quantity rules.min_order_parent_quantityinteger
Maximum purchasable quantity (product level). The maximum quantity customers can buy across all variants. See quantity rules.max_order_parent_quantityinteger
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_quantityinteger
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.displayboolean
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.sellboolean
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.settingsjson
Reserved DTC stock quantity. A stock quantity to reserve for your direct-to-consumer (DTC) customers. See stock display.min_stock_levelinteger
Restock date. The date a product in pre-order status is expected to be available. See stock display.restock_datedate
Stock location settings. B2B stock settings, such as minimum stock level and restock date, for specific stock locations. See stock display.stock_location_datajson

You can also set customer-specific product rules: see Product rules per customer group.

Customer metafields

MetafieldKeyType
Customer title. The customer's title (such as Mr, Ms or Dr), for personalising invoices, emails and account records. See account and addresses.titlesingle line text
Company name. The name of the customer's company. See account and addresses.company_namesingle line text
Assigned group. The customer group assigned to the customer. Overrides any tags assigned to the customer.groupsingle 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_listsjson
single_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_invoicejson
Credit limit and account balance. The customer's credit limit and account balance. See credit, net terms and invoicing.payment_on_accountjson
Accounting ID. A unique accounting ID for the customer. See account and addresses.accounting_idsingle line text
Additional percentage discount. A flat discount percentage applied on top of other discounted pricing. See customer pricing.discount_percentagesingle line text
integer
float
Sales agent groups. The sales agent groups assigned to the customer, so dedicated representatives can manage the account. See restricting which customers a sales agent can see.sales_agent_groupslist.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_idsingle line text
Customer role. The customer's role in their company, used to apply permissions. See company users.rolesingle line text
Default shipping address ID. The shipping address to use by default for orders. See account and addresses.shipping_address_idsingle line text
Default billing address ID. The billing address to use by default for orders. See account and addresses.billing_address_idsingle 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_idsjson

To use the advanced metafields, speak to our team about how they work.

Order metafields

MetafieldKeyType
Invoice link. A URL to the order's invoice, so customers can get to digital invoices quickly. See credit, net terms and invoicing.invoice_urlurl
list.url
file_reference
list.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_importboolean
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_idsingle line text

Next steps

Was this page helpful?

Last updated