> ## Documentation Index
> Fetch the complete documentation index at: https://shipmagic-docs.speedysquirrelhq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rates from Metafields

> Store a shipping price on each product or variant and have ShipMagic read it

Metafields let you drive shipping from data stored on your products rather than from rules alone. There are two distinct ways to do it, and choosing the right one matters — they behave completely differently.

## The two approaches

| Approach | Parameters | What the metafield value is |
| - | - | - |
| **Direct** | Product Metafield, Variant Metafield | **The shipping price itself** |
| **Summed** | Sum Of Product Metafield, Sum Of Variant Metafield | **An input** measured against a range or incremental table |
| | | |

## Direct: the metafield holds the price

Use **Product Metafield** or **Variant Metafield** when each product carries its own shipping cost and you want that number charged as-is.

<Steps>
  <Step title="Create and populate the metafield">
    In **Settings → Custom data**, add a numeric metafield on Product or Variant and fill it in across your catalogue.
  </Step>

  <Step title="Add a rate and pick the parameter">
    Set **Calculation parameter** to **Product Metafield** or **Variant Metafield**.
  </Step>

  <Step title="Enter the metafield reference">
    * **Product Metafield** — enter the **Key**.
    * **Variant Metafield** — enter it as **`Namespace.Key`**.
  </Step>

  <Step title="Decide whether to multiply by quantity">
    Tick **Increase rate per item** if the stored value is a per-unit price that should scale with how many the customer bought. Leave it off for a flat charge per product regardless of quantity.
  </Step>

  <Step title="Set a Default rate">
    Used whenever a product or variant has no value in the metafield.
  </Step>
</Steps>

### Always set a Default rate

<Warning>
  If a product has no value in the metafield and no default rate is set, that product contributes nothing. The customer may see no shipping option at all.

  Every new product starts with an empty metafield, so the default rate is what protects you between a product going live and someone filling in its shipping cost.
</Warning>

## Summed: the metafield feeds a rate table

Use **Sum Of Product Metafield** or **Sum Of Variant Metafield** when the metafield holds a *quantity* rather than a price — a shipping score, a volume figure, a handling weight — and you want to price on tiers of that total.

ShipMagic adds the metafield value across every item in the cart, then evaluates that total against a rate table exactly as it would for cart weight or item count.

<Steps>
  <Step title="Add a rate and pick a Sum Of parameter">
    Set **Calculation parameter** to **Sum Of Product Metafield** or **Sum Of Variant Metafield**.
  </Step>

  <Step title="Enter the metafield reference">
    **Key** for product metafields, **`Namespace.Key`** for variant metafields.
  </Step>

  <Step title="Choose a Rate Type">
    **Range**, **Incremental**, **Range + Incremental**, or **Range + Range** — the same four types available to weight and quantity.
  </Step>

  <Step title="Build the table">
    Fill in the bands or increments. See [Ranged Rates](/ranged-rates) and [Incremental / Per Item Rates](/incremental-per-item-rates).
  </Step>
</Steps>

### Cover the whole scale

Because the summed value drives a table, the same rules apply as any [ranged rate](/ranged-rates): bands must not overlap, and the final band should have an empty **Range End** so an unusually large cart still gets a price.

<Warning>
  Products with no metafield value contribute zero. A cart made entirely of unconfigured products sums to `0` — make sure your first band starts at `0` and produces a sensible price, or such a cart may get no rate.
</Warning>

## Keeping the data current

Metafield values are read live at checkout, so edits in Shopify take effect immediately.

<Note>
  This is different from [product syncing](/core-concepts/syncing-products), which applies to tags, type, title, barcode, and compare-at price used in **conditions**. Metafield rate values need no sync.
</Note>

## Examples

**Each variant carries its own shipping cost** (direct)

```text theme={null}
Rate name: Standard Shipping
Calculation parameter: Variant Metafield
Namespace and key: shipping.cost
Increase rate per item: on
Default rate: 9.95
```

**Products carry a volume, priced in bands** (summed)

```text theme={null}
Rate name: Standard Shipping
Calculation parameter: Sum Of Product Metafield
Key: shipping_volume
Rate Type: Range
  Range Start: 0  | Range End: 10        | Price: 5.00
  Range Start: 11 | Range End: 25        | Price: 9.00
  Range Start: 26 | Range End: (empty)   | Price: 15.00
```

## Related

<Columns cols={2}>
  <Card title="Ranged Rates" icon="chart-simple" href="/ranged-rates">
    Building the bands a Sum Of rate needs.
  </Card>

  <Card title="Incremental rates" icon="plus-minus" href="/incremental-per-item-rates">
    The other rate type available to Sum Of.
  </Card>

  <Card title="Product Attributes" icon="box" href="/cart">
    Using metafields in conditions rather than as rates.
  </Card>

  <Card title="Maximum and minimum" icon="arrows-up-down" href="/setting-maximum-and-minimum-shipping-rates">
    Bounding the result.
  </Card>
</Columns>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.