All articles

AccountCraft Journal

Shopify New Customer Accounts: JSON Tames Repeatable Field Sprawl

New Customer Accounts lack native repeatable fields. Use JSON metafields and compareDigest for safer list updates, or add repeatable lists with AccountCraft.

9 min read

New Customer Accounts do not offer native, configurable repeatable fields in the admin, but you can build them. Store the list as structured data in a customer-bound metafield, render the inputs with a Customer Account UI Extension, and save changes with the Customer Account API’s metafieldsSet mutation. If you would rather skip custom code, an app can handle the same job.


TL;DR:

  • A single JSON metafield can hold the full list and simplify edits; mirror key values into separate metafields when external tools require flat fields.
  • Writes require a customer metafield declaration in shopify.extension.toml, customer_read_customers and customer_write_customers scopes, and protected customer data approval; undeclared fields may appear empty.
  • The metafieldsSet mutation saves up to 25 metafields atomically; pass compareDigest to reject conflicting edits, or use null when creating a metafield.
  • Choose a custom extension for full control or nested lists; otherwise, use an app that supports repeaters within New Customer Accounts.
  • Test creating, editing, deleting, and reordering records on a development store, and inspect mutation userErrors before exposing the feature to customers.

AccountCraft
apps.shopify.com
Personalize Shopify Customer Accounts
AccountCraft lets you customize Shopify New Customer Accounts with a Block Builder, personalized data fields, and built-in consent management, without coding or theme changes.
Install AccountCraft

Table of Contents

What does Shopify support natively for repeatable fields?

New Customer Accounts are Shopify’s current account system, and they replace the older legacy customer accounts that merchants are migrating away from. Legacy accounts relied on theme Liquid, so people often hacked repeaters into templates. New Customer Accounts live outside your theme, which means custom interactive fields need an extension.

According to Shopify’s documentation on metafields, there is no admin screen for configurable repeatable fields. Instead, you store structured data (JSON objects or arrays) in customer-bound metafields, and the Customer Account API lets an extension write that data back to the customer. Shopify supplies the UI components; the metafield is your persistence layer. Tools such as AccountCraft package this pattern for merchants who prefer not to write an extension themselves.

Should you use many metafields or one JSON metafield?

You can structure the data in different ways. One approach is to use a discrete metafield for each item, such as pet_name fields. Another approach is a JSON metafield that holds an array of objects, each with its own properties.

Discrete metafields scale poorly. Every new row needs a new definition, a new declaration in your extension, and a new slot in your mutation. A customer with many vehicles would need numerous keys, and you could hit write limits quickly. Reordering or deleting a row means rewriting the entries that follow it.

Comparison of discrete metafields and JSON arrays

A JSON metafield keeps the list in one place. Your extension reads the array, lets the customer add, edit, or remove entries, and writes the whole array back. The Customer Account API exposes a Metafield object with jsonValue and compareDigest fields, which fits this pattern well. A write call can cover the entire list, which simplifies atomic updates.

The trade-off is interoperability. Some reports, exports, and third-party integrations expect flat, discrete fields and may not parse a JSON array well. If an outside system must read individual items, consider mirroring a few key values into discrete metafields while keeping the JSON array as the source of truth. For most repeatable lists, we recommend the single JSON metafield.

How do you declare, build, and save repeatable data step by step?

Follow this sequence when you build the extension:

  1. Declare the customer metafield in shopify.extension.toml using [[extensions.metafields]], with its namespace and key. Define it on the customer owner type.
  2. Confirm your app requests the customer_read_customers and customer_write_customers scopes, and that protected customer data approval is in place.
  3. Build the interface with components such as a record list, update form, single field, or choice list so customers can add and remove items.
  4. Read the current JSON value through the Customer Account API and populate the UI with it.
  5. Write changes back with metafieldsSet, passing the customer GID as ownerId, your namespace and key, the JSON type, and the serialized array.
  6. Test create, update, delete, and reorder flows, and surface any userErrors the mutation returns.

Pro Tip: Keep each list item small and give it a stable id. Reordering and deleting rows is far easier when you match by id rather than by array position.

Shopify’s guide on building metafield writes into extensions covers the declaration and access requirements in detail. Missing either one is the most common reason a write fails.

How do you write safely when customers edit at the same time?

The metafieldsSet mutation is atomic and accepts up to 25 metafields in one call. If any item fails, none are saved, so your data never lands half updated. A customer can have your account page open in multiple browser tabs, and without protection a later save could silently overwrite an earlier one.

Compare-and-swap solves this. Query the metafield’s compareDigest before editing, then send it back with your write. Shopify rejects the save if the value changed in between. The Customer Account API reference for metafieldsSet describes this workflow.

  • Plan each update so it stays within the 25-metafield limit.
  • Query compareDigest right before you save, and pass it in the mutation.
  • Set compareDigest to null when you want a safe write to a metafield that does not exist yet.
  • Prefer a JSON metafield so one entry covers the whole list.

Shopify states that metafieldsSet allows a maximum of 25 metafields per call and supports compare-and-swap through compareDigest. In practice, a JSON metafield with a digest check can provide a simple, safe design.

What should you check in shopify.extension.toml and scopes when writes fail?

Most failures trace back to configuration, not code. Work through this list:

  • Declare every metafield your extension needs in shopify.extension.toml. The customer account UI extensions reference explains the declaration syntax, and undeclared metafields are not returned to your extension.
  • Verify your scopes include customer_read_customers and customer_write_customers, and that protected customer data approval is granted.
  • Inspect the network request for the metafieldsSet response and read any userErrors it contains.
  • Confirm the namespace and key match exactly between your declaration and your mutation, including capitalization.

The Metafields API pre-loads only declared metafields, so a typo in the declaration looks like empty data rather than an error. Check that first before debugging your UI. If you are also collecting consent, our post on customer consent in Shopify walks through how to test it.

What can merchants do without writing an extension?

Some metafield apps expose repeatable field groups that write arrays into metafields. Community threads show how that data is consumed: one Stack Overflow question on looping through field groups and a Shopify Community thread on repeater data both show merchants iterating over array metafields with Liquid loops. Those examples mostly cover storefront display, though, not editing inside customer accounts.

Before you pick any app, confirm it writes customer-bound metafields and supports record lists or repeaters inside New Customer Accounts. Then test writes on a development store before touching live customer data.

We built AccountCraft for exactly this gap. Our block builder works with New Customer Accounts and includes repeatable record lists, fields bound to customer metafields, conditional rendering, and built-in consent components. There is a free plan, so you can try it without commitment. For more on this approach, see our guide to no-code account UI extensions.

When should you build it yourself and when should you use an app?

My rule of thumb is simple. If you need full control or complex nested repeaters, plan a custom extension and store a structured JSON array. If you want speed and little development work, use a vetted app that writes customer metafields. Either way, test with small lists first, watch for concurrent edits, and write down your namespace and key conventions so future integrations do not guess. Treat the data model as a contract.

— Ivan Signorile

Add repeatable lists to New Customer Accounts without custom code

AccountCraft

If you would rather not maintain an extension, we can get you to a working repeatable list faster. Our visual Block Builder works inside New Customer Accounts, and customer data stays in Shopify the whole time. Any change you make to account pages should be measured afterward, and this conversion optimization guide is a useful starting point for that.

  • Repeatable record lists for items like pets or vehicles
  • Customer fields bound to customer metafields
  • Conditional rendering by customer tag, metafield, market, B2B, and account age
  • Translations and built-in consent components that help record and honor customer consent through Shopify’s privacy APIs

Install the free plan from the Shopify App Store to test it. Paid plans (Pro, Plus) are billed through Shopify, and the listing shows current pricing. You can also read more at Accountcraft.

FAQ

Does Shopify have native repeatable fields for customer accounts?

No. New Customer Accounts have no admin setting for configurable repeatable fields. You store structured data in customer-bound metafields and render it with an extension or an app.

What are metafields in Shopify?

Metafields are custom data fields attached to Shopify resources such as customers, products, and orders. Each has a namespace, a key, and a type, and customer metafields are what hold repeatable account data. Our guide to letting customers edit metafields shows the admin steps.

How many metafields can I save in one request?

The metafieldsSet mutation allows up to 25 metafields per call, and the call is atomic, so it saves all of them or none. Storing a list in a JSON metafield can help keep the number of metafields used low.

How do I avoid overwriting a customer’s changes?

Query the metafield’s compareDigest before you edit, then pass it back in your mutation so Shopify can detect a conflicting write. Use null as the digest when creating a metafield that does not exist yet.

Shopify’s privacy APIs help you collect, record, and honor customer consent, but compliance stays your responsibility as the merchant. Review your obligations and consult a professional for legal questions. For custom field patterns more broadly, see our custom fields guide.