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

# Shopify order settings

> How Dema processes Shopify orders: order exclusions (tags, payment gateways, zero-value, fully discounted and gift card orders), zero-tax markets, order types, warehouse names, imported orders and field mappings, with each transformation setting's default.

Order settings decide how Dema turns your Shopify orders into the orders you see in reports. Each storefront has its own settings, and each setting uses its default until it's changed. Some Dema screens call them transformation settings.

> [card] [Order exclusions](#order-exclusions)
>
> Orders and gift cards left out of reports

> [card] [Zero-tax markets](#zero-tax-markets)
>
> Countries where orders carry no tax

> [card] [Order types](#order-types)
>
> How each order's type is set

> [card] [Warehouse names](#warehouse-names)
>
> Which warehouse each product ships from

> [card] [Imported orders](#imported-orders)
>
> Products on orders imported into Shopify

> [card] [Field mappings](#field-mappings)
>
> Which Shopify fields fill Dema's fields

***

## Viewing and changing order settings

To see a storefront's settings, go to **Settings → Integrations**, open Shopify and expand the storefront under **Order settings**. Each group shows its saved values, or the default if nothing is saved. If order settings are turned off for a storefront, Dema doesn't process its new orders, and **Order settings** shows a warning for that storefront.

To change a setting, contact your Customer Success Manager. You can also ask the Dema Agent to explain a setting and preview how a change would affect your recent orders.

> [!WARNING]
>
> **Changes only affect orders processed after they're saved.** Orders Dema has already processed keep their old result. To apply a change to past orders, ask your Customer Success Manager to process them again.

> [!NOTE]
>
> A few accounts have adjustments that Dema sets outside these settings, such as a fixed order type or warehouse name. If your data doesn't match the settings shown, contact your Customer Success Manager.

***

## Order exclusions

An excluded order gets the order type `EXCLUDED` and is left out of every report, so it adds nothing to revenue, order counts, costs or returns. Exclusions are for orders that aren't real sales, such as test orders, internal orders, wholesale orders you report elsewhere, or orders from a store you no longer track.

By default nothing is excluded, not even zero-value orders, fully discounted orders or gift card purchases. An order's status can still keep it out of some figures. Cancelled orders, for example, don't count as revenue by default.

### Order filters

| Setting | What it excludes | Default |
| - | - | - |
| **Tags** | **Exclude list:** orders with any of the listed tags. **Include list:** orders with none of the listed tags. Orders with no tags are excluded too. | None |
| **Excluded tags** | Orders with any of the listed tags. Works the same as the exclude list under **Tags**. | None |
| **Payment gateways** | **Exclude list:** orders paid only through listed gateways. An order that also used an unlisted gateway is kept. **Include list:** orders that used none of the listed gateways. **Orders with no payment:** kept by an exclude list, excluded by an include list. | None |
| **Source names** | Shopify's label for where an order was created, for example `web`, `pos` or `shopify_draft_order`. **Exclude list:** orders whose source name is listed. **Include list:** orders whose source name isn't listed. | None |
| **Excluded shop domains** | All orders from the listed Shopify stores, entered by their store handle, the part before `.myshopify.com`, for example `old-store`. If a start date is set, only orders created after it are excluded. | None |

Tags, gateways, source names and shop domains must match exactly, including case: `VIP` and `vip` are different tags. An order is excluded if any one of these filters excludes it.

### Zero-value, discounted and gift card orders

| Setting | When on | Default |
| - | - | - |
| **Zero-value orders** | Excludes orders with a final total of 0, shipping and tax included. | Off |
| **Fully discounted orders** | Excludes orders where discounts cover the full product price, even if the customer paid for shipping. | Off |
| **Gift card line items** | Removes gift cards from orders. An order with only gift cards is excluded. A mixed order keeps its other products, and Dema recalculates its total and tax without the gift cards. | Off (gift cards count as revenue) |

> [!TIP]
>
> Set up exclusions before your order history is first imported, so past orders don't need to be processed again.

> [accordion] Zero-value vs fully discounted
>
> The difference is shipping. Free products with paid shipping make a fully discounted order with a total above 0. Free products with free shipping make an order that is both.

> [accordion] Paying with a gift card
>
> The gift card setting looks at what was bought, not how it was paid for. An order paid with a gift card is processed like any other order, and its products count as revenue.

> [accordion] Other exclusions set by Dema
>
> Your Customer Success Manager can also exclude orders by mapping their source name to the order type `EXCLUDED` (see [Order types](#order-types)). Some stores have extra rules set by Dema, for example to leave out exchange items fulfilled outside the online store.

***

## Zero-tax markets

Use zero-tax markets where the tax Shopify reports shouldn't be deducted from revenue. For orders to a listed country, Dema sets product, shipping and order tax to 0 and keeps the order total Shopify reports.

Dema uses the shipping address country. Without a shipping address it uses the billing country, and without either, the country of the retail location. Countries are entered as two-letter codes, such as `NO` or `CH`.

**Default:** no markets. Dema uses the tax Shopify reports, capped at the order total, and recalculates it when products such as gift cards are removed.

> [!NOTE]
>
> Some accounts have tax adjustments set by Dema, shown here as **All markets** or **Other markets**. They can calculate VAT from each country's rate, or remove taxes itemized separately, such as US sales tax.

***

## Order types

Each order gets one order type, which you can use as a [dimension](https://docs.dema.ai/guides/fundamentals/dimensions.md) in reports. Dema checks these rules in order and uses the first that applies:

| Priority | Rule | Default |
| - | - | - |
| 1 | `EXCLUDED` when an [order exclusion](#order-exclusions) applies. | — |
| 2 | `SUBSCRIPTION` for orders with a subscription item, when subscription order types are turned on. | Off |
| 3 | The order's sales channel name (for example `Point of Sale`), when sales channel order types are turned on. | Off |
| 4 | The type set in the **Mapping** for the order's source name, for example `pos` → `RETAIL`. Mapping a source name to `EXCLUDED` excludes those orders. | No mapping |
| 5 | `ONLINE` for every other order. | Always |

**Default:** every order that isn't excluded is `ONLINE`, unless Dema has set a fixed order type for your store.

***

## Warehouse names

These settings give each product on an order the name of the warehouse it shipped from, which you can use as a dimension and in cost rules. To control which storefronts a warehouse's stock counts for, use the [warehouse mapping](https://docs.dema.ai/guides/setup/warehouse-mapping.md) instead.

By default, every product gets the warehouse name `WAREHOUSE`, unless Dema has set a different default for your account.

If you fulfill from several Shopify locations, Dema can name warehouses after them instead. This option is shown as **Shopify locations**. Each product then takes the location that fulfilled it, or the location Shopify assigned it to. A product with neither takes the order's first fulfillment location, or the default warehouse if the order has none.

When Shopify locations are used, two more settings control the names:

| Setting | What it does | Default |
| - | - | - |
| **Mapping** | Renames Shopify locations, for example `Main St Store` → `STOCKHOLM`. Several locations can map to the same warehouse. | None (Shopify location names are used as is) |
| **Other locations** | The warehouse name for locations missing from the mapping. Shown as **All locations** when there is no mapping. | None (Shopify location names are used as is) |

***

## Imported orders

Orders imported into Shopify from another system often contain products that aren't linked to a Shopify variant (the specific size or color of a product). Dema identifies each product by a product ID and a variant number. For these products, the **Line items without a variant** setting decides where both come from, so they match your catalog.

| Option | Product ID | Variant number |
| - | - | - |
| **Default** | The Shopify product ID, or the order line's ID when there is no product. A line with neither product nor variant becomes a one-off product. | The product's variant with the same SKU. Failing that, the product ID, then the line ID. |
| **Matched by SKU as is** | The SKU | The SKU |
| **Matched by normalised SKU** | The SKU without its last hyphen-separated part, so `TR100-GRN-42` gives `TR100-GRN`. A SKU with no hyphen is used as is. | The full SKU |

Products linked to a Shopify variant aren't affected, and products without a SKU keep the default.

> [!NOTE]
>
> Other product ID rules set by Dema, for example reading IDs from the SKU on every order, may also show in this group.

***

## Field mappings

Field mappings decide which Shopify field fills each of Dema's order and order-line fields. Most stores never change them, because the defaults already cover the standard fields such as IDs, prices, discounts, customer and country.

Every Shopify store gets three order-level custom attributes by default:

| Custom attribute | Filled from | Example |
| - | - | - |
| **Order custom attribute 1** | Point-of-sale retail location name, empty for online orders | `Stockholm Central` |
| **Order custom attribute 2** | Shopify order name | `#1001` |
| **Order custom attribute 3** | The order's tags, separated by commas, empty when the order has no tags | `wholesale, vip` |

Your Customer Success Manager can map other Shopify fields into custom attributes, such as a bundle ID, a product's fulfillment date or import duties, so you can filter and segment by them as [dimensions](https://docs.dema.ai/guides/fundamentals/dimensions.md). A mapping can replace a default attribute or add a new one.

***

## Need help?

> [card] Contact support
>
> Email us at [support@dema.ai](mailto:support@dema.ai) for further assistance

> [card] [Shopify integration](https://docs.dema.ai/integrations/ecommerce/shopify.md)
>
> Install the Dema app and connect your store


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