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

IStateSurface Interface

A structure holding a state file name and a surface name or a surface index.

    // When we get the product.
    .then(function(product) {
        // Add the third page from the state file.
                stateId: "3c040958-bfa8-4a3e-b3af-cff9257e7fa1",
                surface: "2"
        // If there was an error while adding the page to the product.
        .catch(function (error) {
            console.error("Adding surfaces failed with exception: ", error);



stateId: string

The name of a state file.

Optional surface

surface: string

Either name or index of a surface to be added to your product. The surface indexes start from 0. By default, the first page is added to a product.