> For the complete documentation index, see [llms.txt](https://help.orderdesk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.orderdesk.com/guided-walkthroughs/products-and-inventory/how-to-use-code-replace.md).

# How to Use Code Replace

Code replace is a feature in Order Desk that lets you swap one product SKU for another or turn one product into multiple products if you have bundles. It also works for print on demand bundles.

### Code Replace

Code replace swaps one product SKU for another in your orders here in Order Desk.

To set this up, first make sure your store is automatically syncing orders with your inventory items. Click on **Store Settings** (under the **Settings** menu in the left sidebar) and under the Inventory Settings section, enable the **Add Inventory Details to Order Items** setting:

![](https://251457507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQOLMUJWMYtrpQ7Oxxca%2Fuploads%2FuN7ALPsvWiuDxfD95nki%2Flegacy-a64c8de473c3a04191df.png?alt=media)

Your inventory items need to be stored in Order Desk. If you haven’t done this yet, read [this getting started guide](/start-here/getting-started-series/quick-start-orders-and-inventory.md#working-with-inventory) for information on the ways you can add your inventory.

To access your current inventory items in Order Desk, click **Inventory Items** in the left sidebar under the **Tools** menu:

![](https://251457507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQOLMUJWMYtrpQ7Oxxca%2Fuploads%2FqMpehlBCTUI3p2m9H88w%2Flegacy-d4f24995067df65e2266.png?alt=media)

Add a metadata field called `code_replace` to any item that needs to have the SKU changed when the order gets to Order Desk. Set the value of that metadata field to the new SKU.

![](https://251457507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQOLMUJWMYtrpQ7Oxxca%2Fuploads%2FCJUPSMGLZKBAkPUFIF6s%2Flegacy-ee20325016c900814f8d.png?alt=media)

In this example, when the item 1200AT comes into Order Desk, it will be replaced with PD-999.

Set up an item in Order Desk for PD-999 as well:

![](https://251457507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQOLMUJWMYtrpQ7Oxxca%2Fuploads%2FtZ911Ihx7TMw24bWuYvB%2Flegacy-b0cebb2154b3ad18e099.png?alt=media)

When an order with this item comes in, the SKU will automatically be replaced, and the details from the new SKU will be applied to the order:

![](https://251457507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQOLMUJWMYtrpQ7Oxxca%2Fuploads%2FFrnJiPTtkTfUXHzcJayP%2Flegacy-885065f192c7da804586.gif?alt=media)

If using code replace, some integrations inventory counts can be synced back into the shopping carts for the original SKUs. For details on how to set this up and which integrations it works with, please refer to the [How to Work with Inventory Quantities guide](/guided-walkthroughs/products-and-inventory/how-to-work-with-inventory-quantities.md#inventory-quantities-for-replaced-skus).

### Code Replace Bundles

Code replace can also be used with bundles.

To do this, apply `code_replace` to the metadata of an inventory item and add the individual SKUs that make up the bundle, separated by a comma:

![](https://251457507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQOLMUJWMYtrpQ7Oxxca%2Fuploads%2FsI6xyKQXb2DFH2KouMBB%2Flegacy-439ca6143e012d91fe7b.png?alt=media)

When an order comes in for the bundle item, it will be replaced by the individual items:

![](https://251457507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQOLMUJWMYtrpQ7Oxxca%2Fuploads%2FKMXowZWOJwJJsmob5on1%2Flegacy-c943a1e7975817fa1588.gif?alt=media)

### Print on Demand Bundles

For general information on adding print on demand products to your inventory, please refer to the [print on demand fulfillment guide](/guided-walkthroughs/print-on-demand-walkthrough/print-on-demand-fulfillment.md)

Set print on demand bundles up using the code replace bundles instructions above. Each of your individual items will need to be added to Order Desk, with the print details included.

To access your current inventory items in Order Desk, click **Inventory Items** in the left sidebar under the **Tools** menu:

![](https://251457507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQOLMUJWMYtrpQ7Oxxca%2Fuploads%2FkohBOobFjzR9kCm5MtKi%2Flegacy-94caab06366679710f56.png?alt=media)

As an example, if you sell a bundle of two separate mugs, set up your bundled item in Order Desk with the code replace pointing to the two individual mug SKUs:

![](https://251457507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQOLMUJWMYtrpQ7Oxxca%2Fuploads%2FTsM78ILRCzroysIcbb2W%2Flegacy-c4f5e05742bb55077c45.png?alt=media)

In each of the individual items, add the print details. For instance:

![](https://251457507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQOLMUJWMYtrpQ7Oxxca%2Fuploads%2F1p1aTuOScBXLXlBaQN47%2Flegacy-e4d04ad4b8bda3aea809.png?alt=media)

When an order for the bundled item comes in, Order Desk will split it out into the individual products and sync their print details into the order:

![](https://251457507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQOLMUJWMYtrpQ7Oxxca%2Fuploads%2Fs7geuDlqJ0YJmNiYP8hm%2Flegacy-e89ec3e6d2946fb63a4d.gif?alt=media)

### Related Articles

* How to Work with Inventory Details
* Quick Start: Orders and Inventory
* How to Match Shopify to Amazon MCF SKUs


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.orderdesk.com/guided-walkthroughs/products-and-inventory/how-to-use-code-replace.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
