{
  "batchPath": "batch",
  "resources": {
    "accounts": {
      "resources": {
        "conversionSources": {
          "methods": {
            "create": {
              "path": "conversions/v1beta/{+parent}/conversionSources",
              "description": "Creates a new conversion source.",
              "flatPath": "conversions/v1beta/accounts/{accountsId}/conversionSources",
              "parameterOrder": [
                "parent"
              ],
              "scopes": [
                "https://www.googleapis.com/auth/content"
              ],
              "id": "merchantapi.accounts.conversionSources.create",
              "parameters": {
                "parent": {
                  "pattern": "^accounts/[^/]+$",
                  "type": "string",
                  "location": "path",
                  "required": true,
                  "description": "Required. The merchant account that will own the new conversion source. Format: `accounts/{account}`"
                }
              },
              "request": {
                "$ref": "ConversionSource"
              },
              "response": {
                "$ref": "ConversionSource"
              },
              "httpMethod": "POST"
            },
            "list": {
              "httpMethod": "GET",
              "response": {
                "$ref": "ListConversionSourcesResponse"
              },
              "id": "merchantapi.accounts.conversionSources.list",
              "parameters": {
                "pageSize": {
                  "location": "query",
                  "type": "integer",
                  "format": "int32",
                  "description": "Optional. The maximum number of conversion sources to return in a page. If no `page_size` is specified, `100` is used as the default value. The maximum value is `200`. Values above `200` will be coerced to `200`. Regardless of pagination, at most `200` conversion sources are returned in total."
                },
                "showDeleted": {
                  "description": "Optional. Show deleted (archived) conversion sources. By default, deleted conversion sources are not returned.",
                  "location": "query",
                  "type": "boolean"
                },
                "parent": {
                  "pattern": "^accounts/[^/]+$",
                  "type": "string",
                  "description": "Required. The merchant account who owns the collection of conversion sources. Format: `accounts/{account}`",
                  "required": true,
                  "location": "path"
                },
                "pageToken": {
                  "description": "Optional. Page token.",
                  "location": "query",
                  "type": "string"
                }
              },
              "scopes": [
                "https://www.googleapis.com/auth/content"
              ],
              "parameterOrder": [
                "parent"
              ],
              "flatPath": "conversions/v1beta/accounts/{accountsId}/conversionSources",
              "path": "conversions/v1beta/{+parent}/conversionSources",
              "description": "Retrieves the list of conversion sources the caller has access to."
            },
            "get": {
              "parameterOrder": [
                "name"
              ],
              "scopes": [
                "https://www.googleapis.com/auth/content"
              ],
              "id": "merchantapi.accounts.conversionSources.get",
              "parameters": {
                "name": {
                  "description": "Required. The name of the conversion source to be fetched. Format: `accounts/{account}/conversionSources/{conversion_source}`",
                  "required": true,
                  "location": "path",
                  "pattern": "^accounts/[^/]+/conversionSources/[^/]+$",
                  "type": "string"
                }
              },
              "path": "conversions/v1beta/{+name}",
              "description": "Fetches a conversion source.",
              "flatPath": "conversions/v1beta/accounts/{accountsId}/conversionSources/{conversionSourcesId}",
              "response": {
                "$ref": "ConversionSource"
              },
              "httpMethod": "GET"
            },
            "undelete": {
              "httpMethod": "POST",
              "request": {
                "$ref": "UndeleteConversionSourceRequest"
              },
              "response": {
                "$ref": "ConversionSource"
              },
              "id": "merchantapi.accounts.conversionSources.undelete",
              "parameters": {
                "name": {
                  "pattern": "^accounts/[^/]+/conversionSources/[^/]+$",
                  "type": "string",
                  "required": true,
                  "location": "path",
                  "description": "Required. The name of the conversion source to be undeleted. Format: `accounts/{account}/conversionSources/{conversion_source}`"
                }
              },
              "scopes": [
                "https://www.googleapis.com/auth/content"
              ],
              "parameterOrder": [
                "name"
              ],
              "flatPath": "conversions/v1beta/accounts/{accountsId}/conversionSources/{conversionSourcesId}:undelete",
              "path": "conversions/v1beta/{+name}:undelete",
              "description": "Re-enables an archived conversion source. Only Available for Merchant Center Destination conversion sources."
            },
            "patch": {
              "path": "conversions/v1beta/{+name}",
              "description": "Updates information of an existing conversion source. Available only for Merchant Center Destination conversion sources.",
              "flatPath": "conversions/v1beta/accounts/{accountsId}/conversionSources/{conversionSourcesId}",
              "parameterOrder": [
                "name"
              ],
              "scopes": [
                "https://www.googleapis.com/auth/content"
              ],
              "id": "merchantapi.accounts.conversionSources.patch",
              "parameters": {
                "updateMask": {
                  "format": "google-fieldmask",
                  "location": "query",
                  "type": "string",
                  "description": "Optional. List of fields being updated."
                },
                "name": {
                  "description": "Output only. Identifier. Generated by the Content API upon creation of a new `ConversionSource`. Format: `[a-z]{4}:.+` The four characters before the colon represent the type of conversion source. Content after the colon represents the ID of the conversion source within that type. The ID of two different conversion sources might be the same across different types. The following type prefixes are supported: * `galk`: For GoogleAnalyticsLink sources. * `mcdn`: For MerchantCenterDestination sources.",
                  "required": true,
                  "location": "path",
                  "pattern": "^accounts/[^/]+/conversionSources/[^/]+$",
                  "type": "string"
                }
              },
              "request": {
                "$ref": "ConversionSource"
              },
              "response": {
                "$ref": "ConversionSource"
              },
              "httpMethod": "PATCH"
            },
            "delete": {
              "flatPath": "conversions/v1beta/accounts/{accountsId}/conversionSources/{conversionSourcesId}",
              "path": "conversions/v1beta/{+name}",
              "description": "Archives an existing conversion source. If the conversion source is a Merchant Center Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics Link, it will be deleted immediately and can be restored by creating a new one.",
              "scopes": [
                "https://www.googleapis.com/auth/content"
              ],
              "parameterOrder": [
                "name"
              ],
              "id": "merchantapi.accounts.conversionSources.delete",
              "parameters": {
                "name": {
                  "required": true,
                  "location": "path",
                  "description": "Required. The name of the conversion source to be deleted. Format: `accounts/{account}/conversionSources/{conversion_source}`",
                  "pattern": "^accounts/[^/]+/conversionSources/[^/]+$",
                  "type": "string"
                }
              },
              "response": {
                "$ref": "Empty"
              },
              "httpMethod": "DELETE"
            }
          }
        }
      }
    }
  },
  "rootUrl": "https://merchantapi.googleapis.com/",
  "mtlsRootUrl": "https://merchantapi.mtls.googleapis.com/",
  "fullyEncodeReservedExpansion": true,
  "kind": "discovery#restDescription",
  "discoveryVersion": "v1",
  "ownerName": "Google",
  "canonicalName": "Merchant",
  "version": "conversions_v1beta",
  "documentationLink": "https://developers.google.com/merchant/api",
  "description": "Programmatically manage your Merchant Center Accounts.",
  "parameters": {
    "access_token": {
      "description": "OAuth access token.",
      "type": "string",
      "location": "query"
    },
    "fields": {
      "description": "Selector specifying which fields to include in a partial response.",
      "type": "string",
      "location": "query"
    },
    "callback": {
      "description": "JSONP",
      "type": "string",
      "location": "query"
    },
    "quotaUser": {
      "type": "string",
      "location": "query",
      "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters."
    },
    "upload_protocol": {
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
      "type": "string",
      "location": "query"
    },
    "key": {
      "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
      "type": "string",
      "location": "query"
    },
    "uploadType": {
      "type": "string",
      "location": "query",
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")."
    },
    "alt": {
      "description": "Data format for response.",
      "enumDescriptions": [
        "Responses with Content-Type of application/json",
        "Media download with context-dependent Content-Type",
        "Responses with Content-Type of application/x-protobuf"
      ],
      "location": "query",
      "default": "json",
      "type": "string",
      "enum": [
        "json",
        "media",
        "proto"
      ]
    },
    "$.xgafv": {
      "type": "string",
      "enum": [
        "1",
        "2"
      ],
      "description": "V1 error format.",
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "location": "query"
    },
    "prettyPrint": {
      "description": "Returns response with indentations and line breaks.",
      "default": "true",
      "type": "boolean",
      "location": "query"
    },
    "oauth_token": {
      "type": "string",
      "location": "query",
      "description": "OAuth 2.0 token for the current user."
    }
  },
  "auth": {
    "oauth2": {
      "scopes": {
        "https://www.googleapis.com/auth/content": {
          "description": "Manage your product listings and accounts for Google Shopping"
        }
      }
    }
  },
  "schemas": {
    "ConversionSource": {
      "description": "Represents a conversion source owned by a Merchant account. A merchant account can have up to 200 conversion sources.",
      "properties": {
        "googleAnalyticsLink": {
          "$ref": "GoogleAnalyticsLink",
          "description": "Immutable. Conversion Source of type \"Link to Google Analytics Property\"."
        },
        "controller": {
          "readOnly": true,
          "type": "string",
          "enum": [
            "CONTROLLER_UNSPECIFIED",
            "MERCHANT",
            "YOUTUBE_AFFILIATES"
          ],
          "description": "Output only. Controller of the conversion source.",
          "enumDescriptions": [
            "Default value. This value is unused.",
            "Controlled by the Merchant who owns the Conversion Source.",
            "Controlled by the Youtube Affiliates program."
          ]
        },
        "name": {
          "type": "string",
          "readOnly": true,
          "description": "Output only. Identifier. Generated by the Content API upon creation of a new `ConversionSource`. Format: `[a-z]{4}:.+` The four characters before the colon represent the type of conversion source. Content after the colon represents the ID of the conversion source within that type. The ID of two different conversion sources might be the same across different types. The following type prefixes are supported: * `galk`: For GoogleAnalyticsLink sources. * `mcdn`: For MerchantCenterDestination sources."
        },
        "expireTime": {
          "format": "google-datetime",
          "type": "string",
          "description": "Output only. The time when an archived conversion source becomes permanently deleted and is no longer available to undelete.",
          "readOnly": true
        },
        "state": {
          "type": "string",
          "enum": [
            "STATE_UNSPECIFIED",
            "ACTIVE",
            "ARCHIVED",
            "PENDING"
          ],
          "readOnly": true,
          "enumDescriptions": [
            "Conversion source has unspecified state.",
            "Conversion source is fully functional.",
            "Conversion source has been archived in the last 30 days and is currently not functional. Can be restored using the undelete method.",
            "Conversion source creation has started but not fully finished yet."
          ],
          "description": "Output only. Current state of this conversion source. Can't be edited through the API."
        },
        "merchantCenterDestination": {
          "$ref": "MerchantCenterDestination",
          "description": "Conversion Source of type \"Merchant Center Tag Destination\"."
        }
      },
      "id": "ConversionSource",
      "type": "object"
    },
    "Empty": {
      "type": "object",
      "id": "Empty",
      "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }",
      "properties": {}
    },
    "ProductStatusChangeMessage": {
      "type": "object",
      "id": "ProductStatusChangeMessage",
      "description": "The message that the merchant will receive to notify about product status change event",
      "properties": {
        "resourceId": {
          "description": "The product id.",
          "type": "string"
        },
        "eventTime": {
          "description": "The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.",
          "format": "google-datetime",
          "type": "string"
        },
        "managingAccount": {
          "description": "The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id}`",
          "type": "string"
        },
        "attribute": {
          "description": "The attribute in the resource that changed, in this case it will be always `Status`.",
          "type": "string",
          "enumDescriptions": [
            "Unspecified attribute",
            "Status of the changed entity"
          ],
          "enum": [
            "ATTRIBUTE_UNSPECIFIED",
            "STATUS"
          ]
        },
        "expirationTime": {
          "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.",
          "type": "string",
          "format": "google-datetime"
        },
        "changes": {
          "type": "array",
          "description": "A message to describe the change that happened to the product",
          "items": {
            "$ref": "ProductChange"
          }
        },
        "resourceType": {
          "description": "The resource that changed, in this case it will always be `Product`.",
          "type": "string",
          "enumDescriptions": [
            "Unspecified resource",
            "Resource type : product"
          ],
          "enum": [
            "RESOURCE_UNSPECIFIED",
            "PRODUCT"
          ]
        },
        "resource": {
          "type": "string",
          "description": "The product name. Format: `accounts/{account}/products/{product}`"
        },
        "account": {
          "description": "The target account that owns the entity that changed. Format : `accounts/{merchant_id}`",
          "type": "string"
        }
      }
    },
    "ConversionType": {
      "description": "Message representing the type of a conversion event.",
      "properties": {
        "name": {
          "readOnly": true,
          "description": "Output only. Conversion event name, as it'll be reported by the client.",
          "type": "string"
        },
        "report": {
          "type": "boolean",
          "readOnly": true,
          "description": "Output only. Option indicating if the type should be included in Merchant Center reporting."
        }
      },
      "id": "ConversionType",
      "type": "object"
    },
    "MerchantCenterDestination": {
      "description": "\"Merchant Center Destination\" sources can be used to send conversion events from an online store using a Google tag directly to a Merchant Center account where the source is created.",
      "properties": {
        "destination": {
          "type": "string",
          "readOnly": true,
          "description": "Output only. Merchant Center Destination ID."
        },
        "displayName": {
          "type": "string",
          "description": "Required. Merchant-specified display name for the destination. This is the name that identifies the conversion source within the Merchant Center UI. The maximum length is 64 characters."
        },
        "currencyCode": {
          "type": "string",
          "description": "Required. Three-letter currency code (ISO 4217). The currency code defines in which currency the conversions sent to this destination will be reported in Merchant Center."
        },
        "attributionSettings": {
          "description": "Required. Attribution settings used for the Merchant Center Destination.",
          "$ref": "AttributionSettings"
        }
      },
      "type": "object",
      "id": "MerchantCenterDestination"
    },
    "AttributionSettings": {
      "type": "object",
      "id": "AttributionSettings",
      "description": "Represents attribution settings for conversion sources receiving pre-attribution data.",
      "properties": {
        "attributionLookbackWindowDays": {
          "format": "int32",
          "type": "integer",
          "description": "Required. Lookback window (in days) used for attribution in this source. Supported values are `7`, `30` & `40`."
        },
        "attributionModel": {
          "description": "Required. Attribution model.",
          "type": "string",
          "enumDescriptions": [
            "Unspecified model.",
            "Cross-channel Last Click model.",
            "Ads-preferred Last Click model.",
            "Cross-channel Data Driven model.",
            "Cross-channel First Click model.",
            "Cross-channel Linear model.",
            "Cross-channel Position Based model.",
            "Cross-channel Time Decay model."
          ],
          "enum": [
            "ATTRIBUTION_MODEL_UNSPECIFIED",
            "CROSS_CHANNEL_LAST_CLICK",
            "ADS_PREFERRED_LAST_CLICK",
            "CROSS_CHANNEL_DATA_DRIVEN",
            "CROSS_CHANNEL_FIRST_CLICK",
            "CROSS_CHANNEL_LINEAR",
            "CROSS_CHANNEL_POSITION_BASED",
            "CROSS_CHANNEL_TIME_DECAY"
          ]
        },
        "conversionType": {
          "description": "Immutable. Unordered list. List of different conversion types a conversion event can be classified as. A standard \"purchase\" type will be automatically created if this list is empty at creation time.",
          "items": {
            "$ref": "ConversionType"
          },
          "type": "array"
        }
      }
    },
    "GoogleAnalyticsLink": {
      "id": "GoogleAnalyticsLink",
      "type": "object",
      "description": "\"Google Analytics Link\" sources can be used to get conversion data from an existing Google Analytics property into the linked Merchant Center account.",
      "properties": {
        "propertyId": {
          "format": "int64",
          "type": "string",
          "description": "Required. Immutable. ID of the Google Analytics property the merchant is linked to."
        },
        "attributionSettings": {
          "description": "Output only. Attribution settings for the linked Google Analytics property.",
          "readOnly": true,
          "$ref": "AttributionSettings"
        },
        "property": {
          "readOnly": true,
          "description": "Output only. Name of the Google Analytics property the merchant is linked to.",
          "type": "string"
        }
      }
    },
    "UndeleteConversionSourceRequest": {
      "description": "Request message for the UndeleteConversionSource method.",
      "properties": {},
      "id": "UndeleteConversionSourceRequest",
      "type": "object"
    },
    "ProductChange": {
      "description": "The change that happened to the product including old value, new value, country code as the region code and reporting context.",
      "properties": {
        "oldValue": {
          "type": "string",
          "description": "The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)"
        },
        "regionCode": {
          "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.",
          "type": "string"
        },
        "newValue": {
          "type": "string",
          "description": "The new value of the changed resource or attribute. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)"
        },
        "reportingContext": {
          "enumDeprecated": [
            false,
            false,
            true,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false
          ],
          "type": "string",
          "enum": [
            "REPORTING_CONTEXT_ENUM_UNSPECIFIED",
            "SHOPPING_ADS",
            "DISCOVERY_ADS",
            "DEMAND_GEN_ADS",
            "DEMAND_GEN_ADS_DISCOVER_SURFACE",
            "VIDEO_ADS",
            "DISPLAY_ADS",
            "LOCAL_INVENTORY_ADS",
            "VEHICLE_INVENTORY_ADS",
            "FREE_LISTINGS",
            "FREE_LISTINGS_UCP_CHECKOUT",
            "FREE_LOCAL_LISTINGS",
            "FREE_LOCAL_VEHICLE_LISTINGS",
            "YOUTUBE_AFFILIATE",
            "YOUTUBE_SHOPPING",
            "CLOUD_RETAIL",
            "LOCAL_CLOUD_RETAIL",
            "PRODUCT_REVIEWS",
            "MERCHANT_REVIEWS",
            "YOUTUBE_CHECKOUT"
          ],
          "description": "Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)",
          "enumDescriptions": [
            "Not specified.",
            "[Shopping ads](https://support.google.com/merchants/answer/6149970).",
            "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).",
            "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).",
            "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).",
            "[Video ads](https://support.google.com/google-ads/answer/6340491).",
            "[Display ads](https://support.google.com/merchants/answer/6069387).",
            "[Local inventory ads](https://support.google.com/merchants/answer/3271956).",
            "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).",
            "[Free product listings](https://support.google.com/merchants/answer/9199328).",
            "[Free product listings on UCP checkout](https://developers.google.com/merchant/ucp).",
            "[Free local product listings](https://support.google.com/merchants/answer/9825611).",
            "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).",
            "[Youtube Affiliate](https://support.google.com/youtube/answer/13376398).",
            "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).",
            "[Cloud retail](https://cloud.google.com/solutions/retail).",
            "[Local cloud retail](https://cloud.google.com/solutions/retail).",
            "[Product Reviews](https://support.google.com/merchants/answer/14620732).",
            "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).",
            "YouTube Checkout ."
          ]
        }
      },
      "id": "ProductChange",
      "type": "object"
    },
    "ListConversionSourcesResponse": {
      "type": "object",
      "id": "ListConversionSourcesResponse",
      "description": "Response message for the ListConversionSources method.",
      "properties": {
        "conversionSources": {
          "items": {
            "$ref": "ConversionSource"
          },
          "description": "List of conversion sources.",
          "type": "array"
        },
        "nextPageToken": {
          "description": "Token to be used to fetch the next results page.",
          "type": "string"
        }
      }
    }
  },
  "protocol": "rest",
  "revision": "20260415",
  "name": "merchantapi",
  "basePath": "",
  "servicePath": "",
  "id": "merchantapi:conversions_v1beta",
  "icons": {
    "x32": "http://www.google.com/images/icons/product/search-32.gif",
    "x16": "http://www.google.com/images/icons/product/search-16.gif"
  },
  "version_module": true,
  "baseUrl": "https://merchantapi.googleapis.com/",
  "ownerDomain": "google.com",
  "title": "Merchant API"
}
