---
title: "Add Product"
uid: tps-add-product
description: "The addProduct operation adds a definition of a map product to the Topographic Production Service resource that can be used to generate a map."
slug: "tps-add-product"
url: "/tps-add-product"
guid: "GUID-ECAF6130-D283-4A80-84C2-D0B5B2F16160"
migratedTopicMetadata:
  FTITLE: "TPS Add Product"
  FDESCRIPTION: ""
  FCHANGES: "reverting decision to hide more of the JSON (#2928)"
  FISHRELEASELABEL: ""
  FESRISOFTWARERELEASE: ""
  FESRITAGCLOUD: ""
  FESRIRECREATIONPROCEDURE: ""
  FESRIPRODUCTLIFECYCLE: "11.2 - *"
  CREATED-ON: "14/11/2023 12:28:10"
  FAUTHOR: "jaguirre"
  FSTATUS: "Released"
  MODIFIED-ON: "21/12/2023 13:34:36"
  VERSION: "5"
  FRESOLUTION: ""
  DOC-LANGUAGE: "en"
  FISHREVCOUNTER: "11"
  ED: "GUID-FF8F58DE-D973-4719-A8D2-8FB023B59A02"
  FUSERGROUP: ""
  READ-ACCESS: ""
restInfoMetadata:
  apiPath: /<serviceName>/TopographicProductionServer/addProduct
  urlSegments:
    - name: <root>
      url: /catalog
    - name: /<serviceName>/TopographicProductionServer/addProduct
  methods:
    - post
  sslOnly: 'yes'
  versionIntroduced: '10.9'
  relatedResources:
    - name: Generate Product
      url: /tps-generate-product
    - name: Remove Product
      url: /tps-remove-product
    - name: Update Product
      url: /tps-update-product
  requiredCapability: Requires a Professional or Professional Plus user type account and a Topographic Mapping server extension license.
---

import GUID_0388E43D_C641_4E66_97EE_5C4E932EE3BA_GUID_2680DD44_F03A_444C_86E1_1624AF34BD55 from "./snippets/GUID-0388E43D-C641-4E66-97EE-5C4E932EE3BA/_GUID-2680DD44-F03A-444C-86E1-1624AF34BD55";
import GUID_0388E43D_C641_4E66_97EE_5C4E932EE3BA_GUID_BD0C4EE0_7864_4DD3_9692_AAED8631CB88 from "./snippets/GUID-0388E43D-C641-4E66-97EE-5C4E932EE3BA/_GUID-BD0C4EE0-7864-4DD3-9692-AAED8631CB88";
import GUID_0388E43D_C641_4E66_97EE_5C4E932EE3BA_GUID_65CB945B_3B13_4E4F_A845_64316D75C206 from "./snippets/GUID-0388E43D-C641-4E66-97EE-5C4E932EE3BA/_GUID-65CB945B-3B13-4E4F-A845-64316D75C206";
import GUID_0388E43D_C641_4E66_97EE_5C4E932EE3BA_GUID_BA4E48E6_74EB_4AC7_9327_0229D4E7ECF5 from "./snippets/GUID-0388E43D-C641-4E66-97EE-5C4E932EE3BA/_GUID-BA4E48E6-74EB-4AC7-9327-0229D4E7ECF5";
import GUID_0388E43D_C641_4E66_97EE_5C4E932EE3BA_GUID_A18FB935_347D_4950_9B14_B965925BD472 from "./snippets/GUID-0388E43D-C641-4E66-97EE-5C4E932EE3BA/_GUID-A18FB935-347D-4950-9B14-B965925BD472";

## Description

<!--Licensing note (first snippet per GUID), now covered with required capability in YAML above
<Note type={"note"}>
<GUID_0388E43D_C641_4E66_97EE_5C4E932EE3BA_GUID_2680DD44_F03A_444C_86E1_1624AF34BD55 />
</Note>
-->
The `addProduct` operation adds a definition of a map product to the Topographic Production Service resource that can be used to generate a map.

## Request parameters

<StyledTable headers={"Parameter,Details"}>
	<StyledTableRow>
		<StyledTableCell cellStyle="markdown">
			`productDefinition`
			<GUID_0388E43D_C641_4E66_97EE_5C4E932EE3BA_GUID_BD0C4EE0_7864_4DD3_9692_AAED8631CB88 />
		</StyledTableCell>
		<StyledTableCell cellStyle="markdown">
			The JSON definition of a map product. Review each property's help topic to learn more.
		</StyledTableCell>
	</StyledTableRow>
	<StyledTableRow>
		<StyledTableCell cellStyle="markdown">
			`raster`
			<GUID_0388E43D_C641_4E66_97EE_5C4E932EE3BA_GUID_65CB945B_3B13_4E4F_A845_64316D75C206 />
		</StyledTableCell>
		<StyledTableCell cellStyle="markdown">
			<GUID_0388E43D_C641_4E66_97EE_5C4E932EE3BA_GUID_BA4E48E6_74EB_4AC7_9327_0229D4E7ECF5 />
		</StyledTableCell>
	</StyledTableRow>
	<StyledTableRow>
		<StyledTableCell cellStyle="markdown">
			`ancillaryLayers`
			<GUID_0388E43D_C641_4E66_97EE_5C4E932EE3BA_GUID_65CB945B_3B13_4E4F_A845_64316D75C206 />
		</StyledTableCell>
		<StyledTableCell cellStyle="markdown">
			A JSON array of additional layers to include in the final product.
			Syntax:
				```json
				[
					{
						"layer": "<URL of the layer>",
						"featureClass": "<name of the feature class to extract to>",
						"map": "<name of the map the layer will be inserted into>",
						"layerIndex": "<insertion index of the layer>"
					},
					...
				]
				```
			<Note>
			<GUID_0388E43D_C641_4E66_97EE_5C4E932EE3BA_GUID_A18FB935_347D_4950_9B14_B965925BD472 />
			</Note>
			<!-- "This parameter supports services located in the same portal site sas the server object extension (SOE) or services that are publicly available. ..." -->
		</StyledTableCell>
	</StyledTableRow>
	<StyledTableRow>
    <StyledTableCell cellStyle="markdown">

      `f`

      <GUID_0388E43D_C641_4E66_97EE_5C4E932EE3BA_GUID_BD0C4EE0_7864_4DD3_9692_AAED8631CB88 />
	  
    </StyledTableCell>
    <StyledTableCell cellStyle="markdown">
      The response format. The default format is `html`.

      Values: `html` | `json` | `pjson`
    </StyledTableCell>
  </StyledTableRow>
</StyledTable>

## Example usage
Add a map product definition to the service using the `addProduct` REST operation.

Request URL and parameters:

```markdown
https://organization.example.com/<context>/rest/services/SampleService/TopographicProductionServer/addProduct
```

```javascript
productDefinition=
{
  "version": 0,
  "name": "ExampleProduct",
  "type": "MTM",
  "gridType": "TM50",
  "description": "Test Masking Product",
  "sheetIDField": "NRN",
  "featureDataset": "BM",
  "extractionDatabase": "MTM.gdb",
  "scale": "1:50,000",
  "productVersions": [
    {
      "name": "TRD_4_5",
      "template": "MTM50_Layout.pagx"
    }
  ],
  "resources": [
    {
      "name": "SourceWorkspace",
      "type": 3,
      "value": ""
    },
    {
      "name": "AOILayer",
      "type": 2,
      "value": ""
    },
    {
      "name": "SheetID",
      "type": 1,
      "value": ""
    },
    {
      "name": "Layout",
      "type": 6,
      "value": ""
    },
    {
      "name": "ProductFiles",
      "type": 7,
      "value": ""
    }
  ],
  "dataExtraction": [
    {
      "name": "MapService",
      "type": 19,
      "id": "MapService",
      "description": "Test extract from Map Service",
      "parameters": [
        {
          "name": "input_data",
          "value": "https://organization.example.com/<context>/rest/services/PostGreTest/MapServer"
        },
        {
          "name": "AOI",
          "value": "[AOILayer]\\Extent"
        },
        {
          "name": "buffer",
          "value": "5 kilometers"
        },
        {
          "name": "spatial_relationship",
          "value": "esriSpatialRelIntersects"
        },
        {
          "name": "DefinitionQuery",
          "value": ""
        },
        {
          "name": "includeDatasets",
          "value": ""
        },
        {
          "name": "excludedDatasets",
          "value": ""
        }
      ]
    }
  ],
  "operations": [
    {
      "name": "MapResource",
      "type": 11,
      "id": "62C3FFDE-F2C9-401E-9F57-50BECC3E15AP",
      "description": "Update BaseMap DataSources",
      "parameters": [
        {
          "name": "in_map",
          "value": "BaseMap"
        }
      ]
    },
    {
      "name": "Grid",
      "type": 4,
      "id": "22C3FFDE-F4C9-401E-9F57-50BRCC3E15GN",
      "description": "BaseMap Grid",
      "toolName": "MakeGridsAndGraticulesLayer_topographic",
      "validation": 2,
      "properties": {
        "type": "PropertySet",
        "propertySetItems": [
          "AddOutputToMap",
          "BaseMap"
        ]
      },
      "parameters": [
        {
          "name": "in_grid_xml",
          "value": "[GridLocator]\\BaseMap"
        },
        {
          "name": "area_of_interest",
          "value": "[AOILayer]"
        },
        {
          "name": "target_feature_dataset",
          "value": "[SourceWorkspace]\\BM_GRD"
        },
        {
          "name": "out_layer_name",
          "value": "BMGrid"
        },
        {
          "name": "grid_name",
          "value": "BMGrid"
        },
        {
          "name": "configure_layout",
          "value": "CONFIGURE_LAYOUT"
        },
        {
          "name": "layout",
          "value": "[Layout]"
        },
        {
          "name": "map_frame",
          "value": "BaseMap Map Frame"
        }
      ]
    },
    {
      "name": "CreateMasks",
      "type": 7,
      "id": "35C3FFRF-F2C9-401E-9F57-30BECC3E15KF",
      "description": "Create Masks for Base Map",
      "toolName": "MakeMasksFromRules_topographic",
      "validation": 2,
      "properties": {
        "type": "PropertySet",
        "propertySetItems": [
          "MapName",
          "BaseMap"
        ]
      },
      "parameters": [
        {
          "name": "in_map",
          "value": "BaseMap"
        },
        {
          "name": "rule_file",
          "value": "[ProductFiles]\\MTM_Basemap_Masking_Rules.xml"
        },
        {
          "name": "out_feature_dataset",
          "value": "[SourceWorkspace]\\Masks"
        }
      ]
    },
    {
      "name": "ApplyMasks",
      "type": 7,
      "id": "93C3FFDE-F2C9-401K-9F57-50BRCC3E15RW",
      "description": "Apply Masks for Base Map",
      "toolName": "ApplyMasksFromRules_topographic",
      "validation": 2,
      "properties": {
        "type": "PropertySet",
        "propertySetItems": [
          "MapName",
          "BaseMap"
        ]
      },
      "parameters": [
        {
          "name": "in_map",
          "value": "BaseMap"
        },
        {
          "name": "rule_file",
          "value": "[ProductFiles]\\MTM_Basemap_Masking_Rules.xml"
        },
        {
          "name": "in_feature_dataset",
          "value": "[SourceWorkspace]\\Masks"
        }
      ]
    }
  ]
}
raster=https://gisserver.example.com/server/rest/services/DEM/ImageServer
ancillaryLayers=
{
	"layer": "https://gisserver.example.com/server/rest/services/SampleWorldCities/MapServer/1",
	"featureClass": "",
	"map": "BaseMap",
	"layerIndex": "0"
}
f=json

```

## JSON Response syntax
The following is the syntax of a response:
```json
{
  "success": <true | false>
}
```

## JSON Response example

The following is an example response when the product is added successfully:
```json
{
  "productName": "ExampleProduct",
  "success": true
}
```

The following is an example error response:
```json
{
  "error": {
    "code": -2147211754,
    "message": "Map product ExampleProduct already exists. Map product names must be unique.",
    "details": [
    ]
  }
}
```
