This is an old documentation. Go to the latest Customer's Canvas docs

addSurfaces Method


  • Adds a number of surfaces (pages) to the product.

        // When we get the product.
        .then(function(product) {
            // Add an empty page and the "postcard" template to the beginning.
                [{ width: 300, height: 300 }, { designFile: "postcard" }],
            // If there was an error while adding pages to the product.
            .catch(function (error) {
                console.error("Adding surfaces failed with exception: ", error);


    • surfaces: SurfaceTypes [] | IStateSurfaces

      An array of surfaces (pages) to add.

    • Optional position: number

      A position in the surface array where new surfaces should be added. The index of the first surface is 0. By default, this method adds pages to the end of the surface array.

    Returns Promise < Product >

    The product instance where the surfaces (pages) were added.