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

saveProduct Method


  • Saves a product current state. For details, see the Introducing the IFrame API topic.

    // Saving a product to the "" file.
        // If the product is saved correctly.
        .then(function (result) {
            // Get the promise properties.
            userId = result.userId;
            stateId = result.stateId;
            returnToEditUrl = result.returnToEditUrl;
            console.log("User " + userId + " successfully saved state " + stateId);
        // If there was an error thrown while saving the product.
        .catch(function (error) {
            console.error("Saving product failed with exception: ", error);


    • Optional stateId: string

      Specifies a state file name without an extension, up to 36 symbols length. If such a file exists, it will be overwritten. You can pass this parameter for any user except master and default. If you omit this parameter, then a new file name is generated.

    • Optional data: object

      Data for personalization. You can pass either dataSet or itemsData into this method.

      • Optional dataSet: IDataSet

        Creates a new product from the initial product definition and applies variable data to it.

      • Optional itemsData: IItemsData

        Applies a single set of variable data to the product.

    Returns Promise < ISaveProductResult >

    Returns a promise with a return-to-edit URL, userId, and stateId.