電話驗證

電話驗證包含兩種帳戶方法,可用於新增及驗證商家帳戶的電話號碼。透過電話號碼驗證提交的電話號碼,會取代您透過 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 欄位,以預設語言 (英文 (美國)) 以外的語言進行驗證。

每四小時最多可嘗試驗證同一組電話號碼五次。

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

將帳戶的電話號碼、verificationId (來自 accounts.requestphoneverification)、傳送至您手機的六位數 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