---
title: "swapSurfaces Method"
canonical: https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.product.swapsurfaces.htm
archived: true
applies_to:
  - product: "Customer's Canvas On-Premises"
  - product: "Design Editor"
    versions: ["6.15.0", "6.x (may differ)"]
---

**You’re viewing outdated documentation.** [View the latest Customer’s Canvas On-Premises documentation](https://customerscanvas.com/docs/on-premises/).

# swapSurfaces Method

**Applies to:** Customer's Canvas On-Premises; Design Editor 6.15.0, 6.x (may differ) · **Archived documentation**
 
### Callable
 
- swapSurfaces(lhsSurface:  [Surface](https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.surface.htm.md), rhsSurface:  [Surface](https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.surface.htm.md) ) :  Promise &lt; [Product](https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.product.htm.md) &gt;

- Swaps two surfaces (pages) in the product. Returns the product instance where the surfaces (pages) were swapped.
  
 - example
     - ```
    editor.getProduct()
        // When we get the product.
        .then(function(product) {
            // Swap the first and last pages in the product.
            product.swapSurfaces(product.surfaces[0], product.surfaces[product.surfaces.length - 1])
            // If there was an error while swapping pages in the product.
            .catch(function (error) {
                console.error("Swapping surfaces failed with exception: ", error);
            });
        });
    ```

#### Parameters

    - ##### lhsSurface: [Surface](https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.surface.htm.md) 
  
        The first surface (page) to swap.
    - ##### rhsSurface: [Surface](https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.objectmodel.surface.htm.md) 
  
        The second surface (page) to swap.

#### Returns Promise &lt; Product &gt;
 
    The product instance where the surfaces (pages) were swapped.
