Use the field mappings to upgrade each step of your partner link workflows
from the Google Ads API to the Data Manager API:

- [Object field mappings](https://developers.google.com/data-manager/api/devguides/accounts/partner-links/google-ads/upgrade/field-mappings#object) contains field mappings for the resource that represents a partner link object.
- [Link management request mappings](https://developers.google.com/data-manager/api/devguides/accounts/partner-links/google-ads/upgrade/field-mappings#management) contains field mappings for requests to create and delete a partner link.
- [Link retrieval request mappings](https://developers.google.com/data-manager/api/devguides/accounts/partner-links/google-ads/upgrade/field-mappings#retrieval) contains field mappings for retrieving partner links.

## Authentication

The Data Manager API requires credentials with a different scope than the
Google Ads API. You must generate new credentials that include the
[Data Manager API scope for managing partner
links](https://developers.google.com/data-manager/api/devguides/accounts/partner-links#get-credentials).

## Object field mappings

Use the mappings in the tables to map a
[`ProductLink`](https://developers.google.com/google-ads/api/reference/rpc/latest/ProductLink) in the
Google Ads API to its [`PartnerLink`](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#partnerlink)
equivalent in the Data Manager API.

> [!IMPORTANT]
> **Key Point:** A [`ProductLink`](https://developers.google.com/google-ads/api/reference/rpc/latest/ProductLink) and a [`PartnerLink`](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#partnerlink) are different representations of the same underlying link entity. If you already have a `ProductLink` in the Google Ads API , you can retrieve and manage it as a `PartnerLink` in the Data Manager API. Don't attempt to create another `PartnerLink` for the same pair of accounts.

| [`ProductLink` (Google Ads API)](https://developers.google.com/google-ads/api/reference/rpc/latest/ProductLink) | [`PartnerLink` (Data Manager API)](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#partnerlink) | Notes |
|---|---|---|
| - `advertising_partner` - `data_partner` - `google_ads` - `merchant_center` | `partner_account` | The Data Manager API doesn't have separate fields for each type of linked account. For all account types, set the `partner_account` field to a [`ProductAccount`](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#productaccount), and set its `account_type` and `account_id` to identify the linked account. |
| `product_link_id` | `partner_link_id` |   |
| `resource_name` | `name` | In the Google Ads API, the `customer_id` of the `resource_name` of a `ProductLink` indicates which account owns an existing link. When you create a `ProductLink`, you indicate the owner of the link by setting the `customer_id` of a [`CreateProductLinkRequest`](https://developers.google.com/google-ads/api/reference/rpc/latest/CreateProductLinkRequest). In the Data Manager API, the combination of `accountType` and `accountId` of the `owning_account` indicates which account owns an existing link. When you create a `PartnerLink`, you indicate the owner of the link by setting the `name` to the resource name of the owner. See [Resource names](https://developers.google.com/data-manager/api/devguides/accounts/partner-links/google-ads/upgrade/field-mappings#resource-names) and [Create request](https://developers.google.com/data-manager/api/devguides/accounts/partner-links/google-ads/upgrade/field-mappings#create-request) for details. |
| `type` | `owning_account.account_type` |   |

### Resource names

The Data Manager API uses a different resource name format than the Google Ads API.

Google Ads API

:   In the Google Ads API, a `ProductLink` resource name uses the format:

    `customers/{customer_id}/productLinks/{product_link_id}`

Data Manager API

:   In the Data Manager API, a `PartnerLink` resource name uses the format:

    `accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link}`

## Link management request mappings

Use the request mappings in this section to convert requests for creating,
deleting, and retrieving partner links.

### Create request

Here are the field mappings to convert a
[`CreateProductLinkRequest`](https://developers.google.com/google-ads/api/reference/rpc/latest/CreateProductLinkRequest) in the Google Ads API to its
equivalent [`CreatePartnerLinkRequest`](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#createpartnerlinkrequest) in
the Data Manager API.

| [`CreateProductLinkRequest` (Google Ads API)](https://developers.google.com/google-ads/api/reference/rpc/latest/CreateProductLinkRequest) | [`CreatePartnerLinkRequest` (Data Manager API)](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#createpartnerlinkrequest) | Notes |
|---|---|---|
| `customer_id` | `parent` | Set to the resource name of the owning advertiser account. |
| `product_link` | `partner_link` | Set to the `PartnerLink` resource. See [Object field mappings](https://developers.google.com/data-manager/api/devguides/accounts/partner-links/google-ads/upgrade/field-mappings#object) |

### Delete request

Here are the field mappings to convert a
[`RemoveProductLinkRequest`](https://developers.google.com/google-ads/api/reference/rpc/latest/RemoveProductLinkRequest) in the Google Ads API to its
equivalent [`DeletePartnerLinkRequest`](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#deletepartnerlinkrequest) in
the Data Manager API.

| [`RemoveProductLinkRequest` (Google Ads API)](https://developers.google.com/google-ads/api/reference/rpc/latest/RemoveProductLinkRequest) | [`DeletePartnerLinkRequest` (Data Manager API)](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#deletepartnerlinkrequest) | Notes |
|---|---|---|
| `customer_id` | No equivalent. | The `name` field encapsulates the owning and partner accounts, so this additional field isn't needed. |
| `resource_name` | `name` | Set to the resource name of the `PartnerLink` you want to remove. |
| `validate_only` | No equivalent. |   |

## Link retrieval request mappings

The approach for retrieving partner links differs between the Google Ads API
and the Data Manager API.

Google Ads API

:   Send a [`SearchGoogleAdsRequest`](https://developers.google.com/google-ads/api/reference/rpc/latest/SearchGoogleAdsRequest) containing a
    `query`. The optional `WHERE` clause of the query defines which resources to
    return. The `SELECT` clause of the query defines which fields to populate
    on the returned *partial* resources.

        SELECT
          product_link.product_link_id,
          ...
        FROM product_link
        WHERE
          ...

Data Manager API

:   Send a [`SearchPartnerLinksRequest`](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#searchpartnerlinksrequest).
    The optional `filter` request field defines which resources to return.
    The response contains *complete* resources, with all fields populated.

Here are the field mappings to convert a
[`SearchGoogleAdsRequest`](https://developers.google.com/google-ads/api/reference/rpc/latest/SearchGoogleAdsRequest) in the Google Ads API to its
equivalent [`SearchPartnerLinksRequest`](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#searchpartnerlinksrequest) in
the Data Manager API.

| [`SearchGoogleAdsRequest` (Google Ads API)](https://developers.google.com/google-ads/api/reference/rpc/latest/SearchGoogleAdsRequest) | [`SearchPartnerLinksRequest` (Data Manager API)](https://developers.google.com/data-manager/api/reference/rpc/google.ads.datamanager.v1#searchpartnerlinksrequest) | Notes |
|---|---|---|
| `customer_id` | `parent` | Set to the resource name of the account to search. |
| `page_size` | `page_size` |   |
| `page_token` | `page_token` |   |
| `query` | `filter` | Set the `filter` to define which resources to return. The Data Manager API returns *complete* resources, so there isn't an equivalent to the `SELECT` clause. |
| `search_settings` | No equivalent. |   |
| `validate_only` | No equivalent. |   |

Check out [Retrieve partner
links](https://developers.google.com/data-manager/api/devguides/accounts/partner-links/retrieve-partner-links) for more
information, including how to construct the `filter` of a
`SearchPartnerLinksRequest` request and set request headers for different
scenarios.