手机验证

电话号码验证包含两种账号方法,您可以使用这两种方法为商家账号添加和验证电话号码。 通过电话验证提交的电话号码会替换您可能通过 accounts.AccountBusinessInformation 提交的电话号码。

我们强烈建议所有新商家和现有商家都完成电话验证。否则,您的账号可能会因账号状态问题 PENDING_PHONE_VERIFICATION 而被中止,直到您验证电话号码为止。

验证电话号码需要完成两个步骤:

  1. 调用 accounts.requestphoneverification 以启动电话验证请求。
    输入双字母地区代码
    输入您的电话号码。
    选择验证方法(SMSPHONE_CALL)。
  2. 拨打 accounts.verifyphonenumber 验证电话号码。
    输入第 1 步中的 verificationId
    输入发送到您手机的 6 位数verificationCode
    输入所使用的 phoneVerificationMethod
    此调用会返回 verifiedPhoneNumber。此电话号码现已通过验证。

您可以在 AccountBusinessInformation.phoneVerificationStatus 中查看账号的电话号码验证状态。

accounts.requestphoneverification

通过将 phoneRegionCodephoneNumberphoneVerificationMethod 传递到 accounts.requestphoneverification 中,启动手机号码验证流程。 此调用会返回 verificationId

您可以使用可选的 languageCode 字段以非默认语言(美国英语)进行验证。

您每 4 小时最多可以尝试验证同一电话号码 5 次。

POST https://www.googleapis.com/content/v2.1/merchantId/accounts/accountId/requestphoneverification

以下是一个调用示例:

{
  "phoneRegionCode": "US",
  "phoneNumber": "phoneNumber",
  "phoneVerificationMethod": "SMS",
  "languageCode": "en-US"
}

以下是示例响应:

{
  "verificationId": "2-47b7ef80ff494daf8079f4808e750dcb-1626331725036"
}

accounts.verifyphonenumber

通过将 accounts.requestphoneverification 中的 verificationId、发送到您手机的六位数 verificationCode 和您使用的 phoneVerificationMethod(例如 SMS)传递到 accounts.verifyphonenumber 中,验证账号的电话号码。 此调用会以您所在地区的标准格式返回经过验证的电话号码。

您的初始验证请求会在 15 分钟后过期。之后,您必须先发起新的电话验证请求,然后才能调用 accounts.verifyphonenumber

POST https://www.googleapis.com/content/v2.1/merchantId/accounts/accountId/verifyphonenumber

以下是一个调用示例:

{
  "verificationId": "verificationId",
  "verificationCode": "verificationCode",
  "phoneVerificationMethod": "SMS"
}

以下是示例响应:

{
  "verifiedPhoneNumber": "(123) 456-7890"
}

AccountBusinessInformation.phoneVerificationStatus

您可以在AccountBusinessInformation.phoneVerificationStatus字段中查看账号的电话号码验证状态。

使用 accountIdmerchantId 调用 accounts.get 方法,以查看您账号的商家信息

GET https://www.googleapis.com/content/v2.1/v2.1/merchantId/accounts/accountId