{
  "auth": {
    "oauth2": {
      "scopes": {
        "https://www.googleapis.com/auth/content": {
          "description": "Manage your product listings and accounts for Google Shopping"
        }
      }
    }
  },
  "protocol": "rest",
  "fullyEncodeReservedExpansion": true,
  "icons": {
    "x16": "http://www.google.com/images/icons/product/search-16.gif",
    "x32": "http://www.google.com/images/icons/product/search-32.gif"
  },
  "documentationLink": "https://developers.google.com/merchant/api",
  "basePath": "",
  "ownerName": "Google",
  "resources": {
    "accounts": {
      "resources": {
        "loyaltyCustomers": {
          "methods": {
            "manage": {
              "response": {
                "$ref": "ManageLoyaltyCustomerMatchResponse"
              },
              "request": {
                "$ref": "ManageLoyaltyCustomerMatchRequest"
              },
              "flatPath": "loyaltyCustomers/v1/accounts/{accountsId}/loyaltyCustomers:manage",
              "path": "loyaltyCustomers/v1/{+parent}/loyaltyCustomers:manage",
              "parameterOrder": [
                "parent"
              ],
              "parameters": {
                "parent": {
                  "pattern": "^accounts/[^/]+$",
                  "required": true,
                  "description": "Required. The parent account where this loyalty customer will be handled. Format: `accounts/{account}`",
                  "type": "string",
                  "location": "path"
                }
              },
              "scopes": [
                "https://www.googleapis.com/auth/content"
              ],
              "id": "merchantapi.accounts.loyaltyCustomers.manage",
              "httpMethod": "POST",
              "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."
            }
          }
        }
      }
    }
  },
  "ownerDomain": "google.com",
  "version_module": true,
  "discoveryVersion": "v1",
  "canonicalName": "Merchant",
  "schemas": {
    "AddressInfo": {
      "description": "Represents a customer’s physical address.",
      "properties": {
        "regionCode": {
          "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.",
          "type": "string"
        },
        "state": {
          "type": "string",
          "description": "Optional. The state or province of the customer."
        },
        "givenName": {
          "type": "string",
          "description": "Optional. The given name of the customer."
        },
        "postalCode": {
          "type": "string",
          "description": "Optional. The postal code (zip code) of the customer. **Format Rules:** * **United States:** 5-digit zip codes (e.g., \"94108\")."
        },
        "city": {
          "type": "string",
          "description": "Optional. The city of the customer."
        },
        "familyName": {
          "type": "string",
          "description": "Optional. The family name of the customer."
        }
      },
      "type": "object",
      "id": "AddressInfo"
    },
    "LoyaltyCustomer": {
      "properties": {
        "pointBalance": {
          "format": "int64",
          "description": "Optional. The point balance of the loyalty customer.",
          "type": "string"
        },
        "userIdentifier": {
          "description": "Required. The identifiers for the customer.",
          "$ref": "UserIdentifier"
        },
        "loyaltyTier": {
          "enum": [
            "LOYALTY_TIER_UNSPECIFIED",
            "TIER1",
            "TIER2",
            "TIER3",
            "TIER4",
            "TIER5",
            "TIER6",
            "TIER7",
            "NON_MEMBER"
          ],
          "description": "Required. The tier label of the loyalty tier the customer belongs to.",
          "type": "string",
          "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."
          ]
        }
      },
      "type": "object",
      "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.",
      "id": "LoyaltyCustomer"
    },
    "ManageLoyaltyCustomerMatchRequest": {
      "description": "Request message for the ManageLoyaltyCustomerMatch method.",
      "properties": {
        "loyaltyCustomer": {
          "$ref": "LoyaltyCustomer",
          "description": "Required. The loyalty customer to insert, update, or remove."
        }
      },
      "type": "object",
      "id": "ManageLoyaltyCustomerMatchRequest"
    },
    "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.",
      "id": "ManageLoyaltyCustomerMatchResponse",
      "type": "object"
    },
    "ProductStatusChangeMessage": {
      "properties": {
        "eventTime": {
          "type": "string",
          "format": "google-datetime",
          "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."
        },
        "resource": {
          "type": "string",
          "description": "The product name. Format: `accounts/{account}/products/{product}`"
        },
        "changes": {
          "type": "array",
          "items": {
            "$ref": "ProductChange"
          },
          "description": "A message to describe the change that happened to the product"
        },
        "expirationTime": {
          "format": "google-datetime",
          "type": "string",
          "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event."
        },
        "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"
        },
        "resourceId": {
          "type": "string",
          "description": "The product id."
        },
        "account": {
          "description": "The target account that owns the entity that changed. Format : `accounts/{merchant_id}`",
          "type": "string"
        },
        "resourceType": {
          "description": "The resource that changed, in this case it will always be `Product`.",
          "enumDescriptions": [
            "Unspecified resource",
            "Resource type : product",
            "Account service"
          ],
          "type": "string",
          "enum": [
            "RESOURCE_UNSPECIFIED",
            "PRODUCT",
            "ACCOUNT_SERVICE"
          ]
        },
        "attribute": {
          "enum": [
            "ATTRIBUTE_UNSPECIFIED",
            "STATUS"
          ],
          "type": "string",
          "enumDescriptions": [
            "Unspecified attribute",
            "Status of the changed entity"
          ],
          "description": "The attribute in the resource that changed, in this case it will be always `Status`."
        }
      },
      "description": "The message that the merchant will receive to notify about product status change event",
      "type": "object",
      "id": "ProductStatusChangeMessage"
    },
    "UserIdentifier": {
      "type": "object",
      "id": "UserIdentifier",
      "description": "The user identifiers associated with the customer. At least one of the fields within this message must be provided.",
      "properties": {
        "address": {
          "description": "Optional. The customer’s physical address.",
          "$ref": "AddressInfo"
        },
        "emailAddress": {
          "type": "string",
          "description": "Optional. The customer’s email address."
        },
        "phoneNumber": {
          "type": "string",
          "description": "Optional. The customer's phone number, in [E.164 format](https://support.google.com/google-ads/answer/16355235) (e.g., \"+16502530000\")."
        }
      }
    },
    "ProductChange": {
      "id": "ProductChange",
      "description": "The change that happened to the product including old value, new value, country code as the region code and reporting context.",
      "type": "object",
      "properties": {
        "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. ."
          ],
          "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)",
          "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"
          ],
          "type": "string"
        },
        "regionCode": {
          "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.",
          "type": "string"
        },
        "oldValue": {
          "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`, ``)",
          "type": "string"
        },
        "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"
        }
      }
    }
  },
  "kind": "discovery#restDescription",
  "servicePath": "",
  "parameters": {
    "uploadType": {
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
      "type": "string",
      "location": "query"
    },
    "oauth_token": {
      "description": "OAuth 2.0 token for the current user.",
      "location": "query",
      "type": "string"
    },
    "callback": {
      "type": "string",
      "location": "query",
      "description": "JSONP"
    },
    "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"
    },
    "$.xgafv": {
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "type": "string",
      "location": "query",
      "enum": [
        "1",
        "2"
      ],
      "description": "V1 error format."
    },
    "quotaUser": {
      "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.",
      "type": "string",
      "location": "query"
    },
    "access_token": {
      "location": "query",
      "type": "string",
      "description": "OAuth access token."
    },
    "upload_protocol": {
      "location": "query",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
      "type": "string"
    },
    "fields": {
      "type": "string",
      "description": "Selector specifying which fields to include in a partial response.",
      "location": "query"
    },
    "prettyPrint": {
      "default": "true",
      "location": "query",
      "type": "boolean",
      "description": "Returns response with indentations and line breaks."
    },
    "alt": {
      "location": "query",
      "type": "string",
      "enumDescriptions": [
        "Responses with Content-Type of application/json",
        "Media download with context-dependent Content-Type",
        "Responses with Content-Type of application/x-protobuf"
      ],
      "enum": [
        "json",
        "media",
        "proto"
      ],
      "default": "json",
      "description": "Data format for response."
    }
  },
  "revision": "20260924",
  "description": "Programmatically manage your Merchant Center Accounts.",
  "version": "loyaltycustomers_v1",
  "title": "Merchant API",
  "batchPath": "batch",
  "rootUrl": "https://merchantapi.googleapis.com/",
  "id": "merchantapi:loyaltycustomers_v1",
  "name": "merchantapi",
  "baseUrl": "https://merchantapi.googleapis.com/",
  "mtlsRootUrl": "https://merchantapi.mtls.googleapis.com/"
}
