{
  "basePath": "",
  "kind": "discovery#restDescription",
  "ownerDomain": "google.com",
  "resources": {
    "accounts": {
      "resources": {
        "loyaltyCustomers": {
          "methods": {
            "manage": {
              "httpMethod": "POST",
              "request": {
                "$ref": "ManageLoyaltyCustomerMatchRequest"
              },
              "path": "loyaltyCustomers/v1alpha/{+parent}/loyaltyCustomers:manage",
              "description": "Manages (inserts, updates, or removes) a customer's loyalty tier information. This method serves as a single interface for all changes to a customer's loyalty status. The specific action (insert, update, or remove) is determined by the current state of the merchant-to-customer association and the `loyalty_tier` value provided in the request. For more information on how to use this method, see [Overview of the loyalty customer match service](/merchant/api/guides/loyalty/customer-match-service). **Operation Logic:** * **Upsert (Insert/Update):** Providing any valid tier other than `NON_MEMBER` will associate the customer with that tier. If an association already exists, it will be updated; otherwise, a new one will be created. * **Removal:** Setting `loyalty_tier` to `NON_MEMBER` will remove any existing loyalty association for the customer. **Privacy Note:** To protect user privacy, this method consistently returns a `200 OK` status with a default `LoyaltyCustomer` response if the customer's identifier cannot be matched to a Google account or if the user has not opted into loyalty personalization.",
              "response": {
                "$ref": "ManageLoyaltyCustomerMatchResponse"
              },
              "flatPath": "loyaltyCustomers/v1alpha/accounts/{accountsId}/loyaltyCustomers:manage",
              "scopes": [
                "https://www.googleapis.com/auth/content"
              ],
              "parameters": {
                "parent": {
                  "location": "path",
                  "type": "string",
                  "required": true,
                  "description": "Required. The parent account where this loyalty customer will be handled. Format: `accounts/{account}`",
                  "pattern": "^accounts/[^/]+$"
                }
              },
              "id": "merchantapi.accounts.loyaltyCustomers.manage",
              "parameterOrder": [
                "parent"
              ]
            }
          }
        }
      }
    }
  },
  "id": "merchantapi:loyaltycustomers_v1alpha",
  "servicePath": "",
  "version": "loyaltycustomers_v1alpha",
  "schemas": {
    "ManageLoyaltyCustomerMatchRequest": {
      "type": "object",
      "properties": {
        "loyaltyCustomer": {
          "$ref": "LoyaltyCustomer",
          "description": "Required. The loyalty customer to insert, update, or remove."
        }
      },
      "id": "ManageLoyaltyCustomerMatchRequest",
      "description": "Request message for the ManageLoyaltyCustomerMatch method."
    },
    "AddressInfo": {
      "description": "Represents a customer’s physical address.",
      "properties": {
        "givenName": {
          "type": "string",
          "description": "Optional. The given name of the customer."
        },
        "city": {
          "type": "string",
          "description": "Optional. The city of the customer."
        },
        "regionCode": {
          "type": "string",
          "description": "Optional. The Unicode country/region code (CLDR) of the customer, such as \"US\" or \"CH\". This field is case-insensitive. For more information, see https://cldr.unicode.org/ and https://www.unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html."
        },
        "familyName": {
          "description": "Optional. The family name of the customer.",
          "type": "string"
        },
        "postalCode": {
          "description": "Optional. The postal code (zip code) of the customer. **Format Rules:** * **United States:** 5-digit zip codes (e.g., \"94108\").",
          "type": "string"
        },
        "state": {
          "description": "Optional. The state or province of the customer.",
          "type": "string"
        }
      },
      "id": "AddressInfo",
      "type": "object"
    },
    "ProductStatusChangeMessage": {
      "type": "object",
      "description": "The message that the merchant will receive to notify about product status change event",
      "id": "ProductStatusChangeMessage",
      "properties": {
        "account": {
          "description": "The target account that owns the entity that changed. Format : `accounts/{merchant_id}`",
          "type": "string"
        },
        "resourceType": {
          "type": "string",
          "enum": [
            "RESOURCE_UNSPECIFIED",
            "PRODUCT",
            "ACCOUNT_SERVICE"
          ],
          "description": "The resource that changed, in this case it will always be `Product`.",
          "enumDescriptions": [
            "Unspecified resource",
            "Resource type : product",
            "Account service"
          ]
        },
        "resource": {
          "description": "The product name. Format: `accounts/{account}/products/{product}`",
          "type": "string"
        },
        "expirationTime": {
          "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.",
          "format": "google-datetime",
          "type": "string"
        },
        "resourceId": {
          "description": "The product id.",
          "type": "string"
        },
        "eventTime": {
          "format": "google-datetime",
          "type": "string",
          "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."
        },
        "attribute": {
          "enumDescriptions": [
            "Unspecified attribute",
            "Status of the changed entity"
          ],
          "description": "The attribute in the resource that changed, in this case it will be always `Status`.",
          "type": "string",
          "enum": [
            "ATTRIBUTE_UNSPECIFIED",
            "STATUS"
          ]
        },
        "changes": {
          "items": {
            "$ref": "ProductChange"
          },
          "description": "A message to describe the change that happened to the product",
          "type": "array"
        },
        "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"
        }
      }
    },
    "LoyaltyCustomer": {
      "properties": {
        "pointBalance": {
          "format": "int64",
          "type": "string",
          "description": "Optional. The point balance of the loyalty customer."
        },
        "loyaltyTier": {
          "description": "Required. The tier label of the loyalty tier the customer belongs to.",
          "type": "string",
          "enum": [
            "LOYALTY_TIER_UNSPECIFIED",
            "TIER1",
            "TIER2",
            "TIER3",
            "TIER4",
            "TIER5",
            "TIER6",
            "TIER7",
            "NON_MEMBER"
          ],
          "enumDescriptions": [
            "Loyalty tier unspecified.",
            "Loyalty tier 1.",
            "Loyalty tier 2.",
            "Loyalty tier 3.",
            "Loyalty tier 4.",
            "Loyalty tier 5.",
            "Loyalty tier 6.",
            "Loyalty tier 7.",
            "Disassociates the user from any loyalty tier. Only set to “NON_MEMBER” when the intent is to remove the user association from Google organic loyalty customer match experience."
          ]
        },
        "userIdentifier": {
          "$ref": "UserIdentifier",
          "description": "Required. The identifiers for the customer."
        }
      },
      "id": "LoyaltyCustomer",
      "description": "Represents a customer’s loyalty information. Represents loyalty customer data in `ManageLoyaltyCustomerMatch` API, but is not a resource that can be retrieved or listed by other methods.",
      "type": "object"
    },
    "UserIdentifier": {
      "type": "object",
      "properties": {
        "emailAddress": {
          "description": "Optional. The customer’s email address.",
          "type": "string"
        },
        "address": {
          "description": "Optional. The customer’s physical address.",
          "$ref": "AddressInfo"
        },
        "phoneNumber": {
          "description": "Optional. The customer's phone number, in [E.164 format](https://support.google.com/google-ads/answer/16355235) (e.g., \"+16502530000\").",
          "type": "string"
        }
      },
      "id": "UserIdentifier",
      "description": "The user identifiers associated with the customer. At least one of the fields within this message must be provided."
    },
    "ManageLoyaltyCustomerMatchResponse": {
      "id": "ManageLoyaltyCustomerMatchResponse",
      "properties": {
        "loyaltyCustomer": {
          "$ref": "LoyaltyCustomer",
          "description": "The loyalty customer that was inserted, updated, or removed. If the customer's identifier cannot be matched to a Google account or if the user has not opted into loyalty personalization, this field will contain a default `LoyaltyCustomer` instance."
        }
      },
      "description": "Response message for the ManageLoyaltyCustomerMatch method.",
      "type": "object"
    },
    "ProductChange": {
      "type": "object",
      "properties": {
        "regionCode": {
          "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.",
          "type": "string"
        },
        "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`, ``)"
        },
        "newValue": {
          "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`, ``)",
          "type": "string"
        },
        "reportingContext": {
          "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 .",
            "Real Estate Rental Ads. ."
          ],
          "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",
            "RENTAL_ADS"
          ],
          "enumDeprecated": [
            false,
            false,
            true,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false
          ],
          "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)"
        }
      },
      "id": "ProductChange",
      "description": "The change that happened to the product including old value, new value, country code as the region code and reporting context."
    }
  },
  "ownerName": "Google",
  "parameters": {
    "$.xgafv": {
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "location": "query",
      "type": "string",
      "enum": [
        "1",
        "2"
      ],
      "description": "V1 error format."
    },
    "access_token": {
      "description": "OAuth access token.",
      "type": "string",
      "location": "query"
    },
    "prettyPrint": {
      "location": "query",
      "type": "boolean",
      "description": "Returns response with indentations and line breaks.",
      "default": "true"
    },
    "uploadType": {
      "location": "query",
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
      "type": "string"
    },
    "callback": {
      "description": "JSONP",
      "location": "query",
      "type": "string"
    },
    "oauth_token": {
      "description": "OAuth 2.0 token for the current user.",
      "type": "string",
      "location": "query"
    },
    "fields": {
      "location": "query",
      "description": "Selector specifying which fields to include in a partial response.",
      "type": "string"
    },
    "upload_protocol": {
      "location": "query",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
      "type": "string"
    },
    "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"
      ],
      "default": "json",
      "location": "query",
      "type": "string",
      "enum": [
        "json",
        "media",
        "proto"
      ]
    },
    "key": {
      "location": "query",
      "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"
    },
    "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."
    }
  },
  "documentationLink": "https://developers.google.com/merchant/api",
  "batchPath": "batch",
  "name": "merchantapi",
  "discoveryVersion": "v1",
  "description": "Programmatically manage your Merchant Center Accounts.",
  "baseUrl": "https://merchantapi.googleapis.com/",
  "revision": "20260930",
  "auth": {
    "oauth2": {
      "scopes": {
        "https://www.googleapis.com/auth/content": {
          "description": "Manage your product listings and accounts for Google Shopping"
        }
      }
    }
  },
  "protocol": "rest",
  "mtlsRootUrl": "https://merchantapi.mtls.googleapis.com/",
  "rootUrl": "https://merchantapi.googleapis.com/",
  "version_module": true,
  "canonicalName": "Merchant",
  "icons": {
    "x32": "http://www.google.com/images/icons/product/search-32.gif",
    "x16": "http://www.google.com/images/icons/product/search-16.gif"
  },
  "fullyEncodeReservedExpansion": true,
  "title": "Merchant API"
}
