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

# Returning Customer Total COGS: Repeat Buyer Cost of Goods

> Track total cost of goods sold for returning customer orders. Combines product COGS and user-defined COGS for repeat buyers in Shopify.

<Tip>
  Returning Customer Total COGS measures the combined product costs and user-defined COGS for repeat buyer orders.
</Tip>

## Formula

<Info>
  **RC Total COGS** = **RC COGS** + **RC Other COGS**
</Info>

### Formula Components

| Metric                                                                                                  | Definition                                   |
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| [**RC COGS**](/reference/metrics/orders/cogs/returning-customer-cogs)                                   | Product cost of goods sold for repeat buyers |
| [**RC Other COGS**](/reference/metrics/orders/cogs/returning-customer-other-cogs)                       | User-defined COGS for repeat buyers          |
| [**customer\_type = returning\_customer**](/data-dictionary/measures-and-dimensions#visitor-dimensions) | Filters to repeat buyer orders               |

| Metadata        |                                                                                      |
| --------------- | ------------------------------------------------------------------------------------ |
| **Type**        | Currency                                                                             |
| **Data Source** | [Shopify](/sources/catalog/shopify), [Upstack Costs](/sources/catalog/upstack-costs) |
| **Aggregation** | Sum                                                                                  |

***

## Example

Your Shopify store incurred \$29,400 in total COGS for 900 returning customer orders.

| Cost Category     | Value        |
| ----------------- | ------------ |
| RC Product COGS   | \$28,500     |
| RC Other COGS     | \$900        |
| **RC Total COGS** | **\$29,400** |

***

## How It Works

Returning Customer Total COGS combines the product-level cost of goods (pulled from Shopify variant costs) with any user-defined COGS entries configured in cost settings. This total is deducted from returning customer net revenue to calculate RC CM1 (gross margin).

***

## When to Use

| Scenario                         | Action                                                  |
| -------------------------------- | ------------------------------------------------------- |
| Calculating RC gross margin      | RC Net Revenue − RC Total COGS = RC CM1                 |
| Comparing NC vs RC product costs | Track if repeat buyers have different product mix       |
| Analyzing product cost trends    | RC Total COGS/order shows repeat purchase cost patterns |
| Validating CM1 margins           | Ensure RC Total COGS allows for healthy gross margin    |

***

## Related Metrics

| Metric                                                                                        | Relationship                     |
| --------------------------------------------------------------------------------------------- | -------------------------------- |
| [Returning Customer COGS](/reference/metrics/orders/cogs/returning-customer-cogs)             | Product-level COGS component     |
| [Returning Customer Other COGS](/reference/metrics/orders/cogs/returning-customer-other-cogs) | User-defined COGS component      |
| [New Customer Total COGS](/reference/metrics/orders/cogs/new-customer-total-cogs)             | Total COGS for first-time buyers |

[See all COGS metrics →](/reference/metrics/orders/cogs)
