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