Emergency

In urgent situations or outages, you can send a text message to our emergency line

Emergency line (text message only)

+45 29 70 15 95

Send a text message with the following information:

  • Your name and webshop
  • A description of the problem

Note: This service is only for critical situations where your webshop is down or has serious problems. For regular support, please use our normal support channels.

Migrate your product profiles to shared values

How to link the same sizes, colors, and other values across many product profiles to shared values. In the admin, via the REST API, or with Claude, with a dry run first and without touching stock, variants, or prices.

Reading time: about 23 minutes
Store owner Developer

If you have many product profiles, you probably have the same size or color in all of them. "Medium" in the T-shirt profile, "Medium" in the pants profile, and maybe "M" in a third. With shared values, they become one and the same value, so you and your customers can find everything in Medium across profiles. This article shows how to migrate your existing product profiles and attribute values to shared values, whether you have five profiles or 600.

There are three ways to do it. Choose the one that suits you:

  • Option A, in the admin: for you if you have few profiles. You click through the profiles one at a time.
  • Option B, via the REST API: for your developer or integrator when there are many profiles.
  • Option C, with Claude: for you if you have many profiles and would rather write in plain English than write code.

If you are unsure what a shared value is, start with the main article Shared values or the short explanation in the glossary.

Before you start

What changes, and what doesn't?

When you link a profile value to a shared value, you only add a link. The profile's value stays exactly as it is. This means:

  • Your products, variants, stock levels, prices, and orders do not change.
  • Customers who have products in their cart won't notice anything.
  • Everything can be undone. If you remove the link again, the profile value remains as a regular value.

Names only change when you ask for it: when you rename a value before linking it, when a developer uses the setting that corrects the spelling (see option B), or when you later rename a shared value. All linked values then get the new name, including those that were previously spelled differently. Orders always keep the name the product had when it was bought.

Plan the names first

Spend five minutes writing down which shared values you want. These are the names customers see when they filter. A few tips:

  • Choose one spelling. Should it be "M" or "Medium"? Decide, and use the same spelling everywhere.
  • Keep different things separate. If two values mean different things, create two shared values. An adult M and a kids' M are not the same size, so create, for example, "M" and "M (kids)".
  • Only link attributes that mean the same thing. "No" in the attribute Waterproof is not the same as "No" in the attribute Organic. If you link them, customers will see both kinds of products when they filter on "No".
  • Upper and lower case don't matter. "medium" and "Medium" count as the same name.

Shared values only work on attributes of the type List of values, which you fill in yourself. Fields that customers type into cannot be shared.

Option A: in the admin (few profiles)

This method works well when you have a handful of profiles. You can find screenshots of all the screens in the main article Shared values.

1. Create the shared values

  1. Go to Webshop → Product profiles.
  2. Click the Shared Values button at the top right.
  3. Type the name in the Add value here and press enter field, and press Enter. You can create several at once by separating them with semicolons, for example Small;Medium;Large.
  4. Drag the values into the order you want them displayed in.

2. Make the profile's values shared

  1. Open a profile under Webshop → Product profiles.
  2. Find the attribute, for example Size, and click in the Values field.
  3. Type the name of a value the profile already has, for example "Medium".
  4. A list of suggestions appears. Next to the shared value, it says makes your value shared. Select it with the mouse, or with the arrow keys and Enter.
  5. The profile's existing value now gets a link icon. No new value is created, and variants, stock, and prices are the same as before.
  6. Repeat for each value. The link is saved immediately.

If it says already exists next to the suggestion, the value is already shared in this profile, and you can skip it.

If the profile spells the value differently

If the value is called "M" in the profile but "Medium" among your shared values, you need to rename it first:

  1. Click the pencil next to "M" in the profile, and change the name to "Medium".
  2. Type "Medium" in the Values field, and select the suggestion marked makes your value shared.

If the attribute already has other shared values, the value is linked the moment you rename it. You can tell from the link icon, and the suggestion list then says already exists. You are then done with that value and can skip step 2. If the attribute has no shared values yet, the link is only made when you select the suggestion in step 2.

Renaming a variant value only changes the name. Stock levels and stock history carry over.

Watch out for two things

  • Don't select the shared value without renaming first. If the suggestion doesn't say "makes your value shared", the profile gets a new, extra value next to the old one. If the attribute is a variant attribute, that means a new variant with no stock.
  • Never delete a value in order to select the shared one instead. When you delete a variant value, the variant's stock history disappears. Rename it instead.

Option B: via the REST API (many profiles)

For developers. This section is technical and is aimed at whoever builds integrations for your store. If you are a store owner without a developer, use option A or option C.

The REST API has three endpoints for the migration: find the candidates, link them, and remove the link again if you change your mind. All calls send your API key as the raw key in the Authorization header, without "Bearer" in front. POST calls must include Content-Type: application/json. See Find or create an API key. In the examples, YOUR_TOKEN stands in for the key.

1. Create the shared values

Create the names that should appear in your store. If a value already exists, the existing one is returned instead of a copy.

curl -X POST https://www.shoporama.dk/REST/attribute-shared-value \
  -H "Authorization: YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"values": ["Small", "Medium", "Large"]}'

You can also skip this step and let the link call create the missing values (see create_missing below). The names will then be whatever the profiles happen to use, though.

2. Find the candidates

This call finds list attributes with the same name in several profiles, for example Size in 40 profiles. You get the attribute IDs, all values with counts, spellings that differ only in upper and lower case (for example "s" and "S"), and which shared value each value already matches. Different names for the same size, for example "S" and "Small", are listed as two values. You combine them with mapping in the next step.

curl "https://www.shoporama.dk/REST/attribute-shared-value/candidates?search=Size" \
  -H "Authorization: YOUR_TOKEN"

Excerpt from the response:

{
    "candidates": [
        {
            "name": "Size",
            "attribute_count": 3,
            "profile_count": 3,
            "attributes": [
                {
                    "attribute_id": 3667,
                    "name": "Size",
                    "profile_id": 2939,
                    "profile_name": "Sweatshirts",
                    "is_variant": true,
                    "value_count": 3,
                    "linked_count": 0
                }
            ],
            "values": [
                {
                    "value": "S",
                    "count": 3,
                    "spellings": ["S"],
                    "attribute_shared_value_id": null
                }
            ]
        }
    ],
    "max_attributes_per_link": 50
}

Use min_attributes (default 2) to only see names that appear in at least that many attributes. Go through the list, and select only the attributes that mean the same thing.

3. Do a dry run of the linking

The link call links each value in the attributes to the shared value with the same name. It runs as a dry run unless you send "dry_run": false, so nothing is saved the first time around.

curl -X POST https://www.shoporama.dk/REST/attribute-shared-value/link \
  -H "Authorization: YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "attribute_ids": [3667, 3673, 3689],
    "mapping": {"S": "Small", "M": "Medium", "L": "Large"},
    "create_missing": false,
    "dry_run": true
  }'

The fields in the call:

  • attribute_ids: the attributes from step 2. At most 50 per call. If you have more, split the list and make several calls.
  • mapping: translates the profiles' spelling into the shared value, for example {"S": "Small"}. Upper and lower case don't matter. Values without a mapping are matched on their own name.
  • create_missing: the default, true, creates shared values for names that don't exist yet. With false, only the shared values you already have are used, and the rest are listed as unmatched.
  • rename: the default, false, lets the profiles keep their own spelling ("S" stays, but is linked to "Small"). With true, the profile values are also renamed so they match the name of the shared value. This carries through to the variant names in the stock lists, but not to old orders.
  • dry_run: default true.

4. Read the response

The response shows what will happen for each attribute and each value. Here it is shortened to one attribute:

{
    "dry_run": true,
    "summary": {
        "attributes": 3,
        "values_linked": 9,
        "values_already_linked": 0,
        "shared_values_created": 0,
        "values_unmatched": 0,
        "values_renamed": 0
    },
    "attributes": [
        {
            "attribute_id": 3667,
            "name": "Size",
            "profile_id": 2939,
            "profile_name": "Sweatshirts",
            "values": [
                {
                    "attribute_value_id": 22302,
                    "value": "S",
                    "action": "link",
                    "attribute_shared_value_id": 1,
                    "shared_value": "Small"
                },
                {
                    "attribute_value_id": 22558,
                    "value": "M",
                    "action": "link",
                    "attribute_shared_value_id": 2,
                    "shared_value": "Medium"
                },
                {
                    "attribute_value_id": 22304,
                    "value": "L",
                    "action": "link",
                    "attribute_shared_value_id": 3,
                    "shared_value": "Large"
                }
            ]
        }
    ],
    "created_shared_values": [],
    "warnings": [],
    "errors": [],
    "notes": [
        "dry_run: nothing was changed. Call again with dry_run=false to apply."
    ]
}

Pay particular attention to these fields:

  • action for each value: link (will be linked), already_linked (already linked), unmatched (no shared value, and create_missing is turned off), or skipped_empty (empty value, skipped).
  • created_shared_values: the shared values that will be created. If you see names you didn't expect, add them to mapping.
  • warnings: attributes where two values end up on the same shared value, for example both "S" and "Small". Both are linked, but neither is renamed, so the attribute doesn't end up with two identical values.
  • errors: for example an attribute that doesn't exist, isn't a list, or belongs to a deleted profile, or more than 50 attributes. In that case, the API responds with 400, and nothing is saved.

5. Run the linking

If the dry run looks right, send exactly the same call with "dry_run": false. The response has the same structure. The call is safe to run again: values that are already linked are listed as already_linked.

6. Check the result

Fetch the shared values with GET /attribute-shared-value. The linked_count field shows how many profile values use each shared value. Then fetch the products with a given shared value across profiles:

curl "https://www.shoporama.dk/REST/product?attribute_shared_value_id=2" \
  -H "Authorization: YOUR_TOKEN"

| means or, and a comma means and: attribute_shared_value_id=2|3,5 means (Medium or Large) and the shared value with ID 5. Add in_stock=1 to only get variants that are in stock. You can also add is_online=1. The other list filters on the product list, such as search, category_id, and profile_id, cannot be combined with it.

7. Undo with unlink

Unlink removes the link for all values in the specified attributes. The profile values and the shared values remain. Just like link, unlink is a dry run unless you send "dry_run": false:

curl -X POST https://www.shoporama.dk/REST/attribute-shared-value/unlink \
  -H "Authorization: YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"attribute_ids": [3667], "dry_run": true}'
{
    "dry_run": true,
    "attribute_ids": [3667],
    "values_unlinked": 3,
    "errors": []
}

The limit here is also 50 attributes per call. If you used rename, the new name stays after unlink. The full API is described in the REST API documentation under "Shared Values".

Option C: with Claude

If you have connected Claude to your store (see Control the shop with AI), Claude can handle the entire migration for you. You write what you want, and Claude finds the attributes, shows you the result, and links them once you give the go-ahead.

Examples of what you can write

  • "Find all attributes called Size across my profiles, and show me what happens if you link them to the shared values Small, Medium, and Large."
  • "Create the shared values XS, Small, Medium, Large, and XL, and link all my sizes to them. Where a profile says S, M, or L, link them to Small, Medium, and Large."
  • "Which spellings of the colors do I have in my profiles? Suggest which shared values I should create."
  • "Remove the link to the shared values in the Kids' clothing profile."

How Claude works

Claude uses the same functions as the REST API. For developers who want to follow along in the audit log, the tools are called:

  • attribute_shared_value_candidates (Find matching attribute values): finds attributes with the same name in several profiles.
  • attribute_shared_value_link (Link values to shared values): links the values, at most 50 attributes at a time.
  • attribute_shared_value_unlink (Remove link to shared values): undoes the linking.
  • Also attribute_shared_value_list and attribute_shared_value_create for viewing and creating the shared values.

Claude is instructed to always do a dry run first and show you what will be linked, which shared values will be created, and any warnings. Only after you have said yes does Claude link the values for real. If you have many profiles, Claude splits the work into batches of 50 on its own.

If you have turned on Extra Security, you must approve linking and unlinking in the admin before they are carried out. The same applies if Claude needs to delete a shared value. The dry run changes nothing and therefore runs without approval.

After the migration

  • New values are linked automatically. When an attribute has shared values, a new value with the same name as a shared value is linked automatically. This also applies when you import products via CSV, or when an integration creates values. Attributes without shared values are not affected, and new shared values are never created automatically.
  • The name is locked in the profile. A shared value has the same name in all profiles, so you change the name under Shared Values, and the change then applies to all profiles. If one profile needs its own name, click the pencil and select Convert to regular value.
  • Filtering in your store. In the Montana and MontanaB2B themes, the product filter merges the linked values under the shared value's name. If a customer filters on Medium, products from all profiles are shown. This requires the filter to be set up under Design → Filter. See the article on product filtering. Other themes show no difference to the customer.

How to undo

  • One value in one profile: click the pencil next to the value in the profile, and select Convert to regular value.
  • An entire shared value: delete it with the cross on the Shared Values page. The profiles keep the value; it's just no longer shared.
  • Many attributes at once: use unlink in the REST API, or ask Claude to remove the link.

In all cases, the profile values remain as regular values. If you renamed values along the way, they keep the new name.

Frequently asked questions

Can I break my products by doing this?

No. The link is an extra layer on top of your profiles. Products, variants, stock levels, prices, and orders are not touched, and you can always remove the link again. The only thing to watch out for is not to delete values along the way.

How can I see whether a value is already shared?

In the profile, a shared value has a link icon. On the Shared Values page, each value shows a number indicating how many profile values use it. If the number is 0, nothing has been linked yet.

I have over 400 profiles. Do I really have to click through all of them?

No. Ask Claude to do it, or have your developer use the REST API. Both link up to 50 attributes at a time, so even many hundreds of profiles can be handled in a handful of calls, with a dry run first.

Does it change anything on my pick lists or in my stock?

No, not unless you rename something. Stock levels and stock history stay the same. If you rename a value, either yourself or with rename in the API, the variant gets the new name in the stock lists. Orders that have already been placed, and therefore also their pick lists, keep the name the product had when it was bought.

When will my customers see a difference?

As soon as the values are linked, if you use Montana or MontanaB2B with product filtering set up. A filter on, for example, Medium then shows products from all profiles. If you use a different theme, customers won't see any difference until the theme is built for it.

Will products from my next CSV import be included automatically?

Yes, if the attribute already has shared values, and the value in the file has the same name as a shared value. Upper and lower case don't matter. If the file spells the value differently, or it doesn't exist as a shared value, it becomes a regular value.

What happens if a profile has both "S" and "Small"?

If both point to the same shared value, both are linked, but neither is renamed, so the profile doesn't end up with two identical values. The API and Claude show a warning about this in the dry run, so you can clean up the profile afterward.

I'm new and didn't create the profiles. How do I know which ones belong together?

Ask Claude to find attributes with the same name across your profiles and show the values, or ask your developer for a list of the candidates. That way you can see where there are different spellings before anything is linked. If you are in doubt, write to support@shoporama.dk.