エラーコードと例外
API エラー レスポンス
次の表に、Google Wallet API から返されるエラーコード、考えられる原因、解決策を示します。
例外 |
メッセージ例 |
候補 |
400 - BadRequestException(BadRequestException) |
リクエストに無効な引数が含まれています。無効なリソース ID: {1234567891234567899 - ABCD1234567}。 |
データ構造の型、形式、長さを確認し、正しい引数を渡します。 |
403 - PermissionDeniedException |
アクセスの拒否 |
サービス アカウントの正しいメールアドレスが、Business Pay and Wallet Console 内で承認されたユーザーであることを確認します。 |
404 - NotFoundException |
ウォレット オブジェクト {1234567891234567899.SampleClubCardxf6a8edf-87ca-4022-a813-694cc57e9fd3} が見つかりません。 |
PATCH リクエストまたは PUT リクエストを試す前にオブジェクト ID に対して GET を実行し、更新するオブジェクトがあり、それが最新であることを確認します。 |
404 - IssuerClassNotFoundException |
ウォレットのオブジェクト クラス {1234567891234567899.ABCD.1234567} が見つかりません。 |
更新を行う際は、PATCH リクエストまたは PUT リクエストの前に GET リクエストを行い、参照するクラスがあることを確認してください。また、リクエストで正しいペイロード(オブジェクトとクラス)が適切に使用されていることも確認します。 |
409 - AlreadyExistsException(すでに存在する例外) |
ウォレットのオブジェクト クラス {1234567891234567899.ABCD.1234567} はすでに存在します。 |
同じクラス ID の作成を試みる前に、クラス ID に対して GET を実行します。リソースが存在する場合は、PATCH または PUT を使用できます。 |
ウェブベースのエラー メッセージ
[Google ウォレットに追加] を使用してパスを保存しようとしたときにエラーが発生した場合リンクをクリックすると、デバッグに役立つエラー メッセージが表示されます。これらのメッセージは「デベロッパー」権限のあるユーザーにのみ表示されます。または「管理者」ロールが必要です。
表示されるエラー メッセージの例を以下に示します。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-02-28 UTC。
[null,null,["最終更新日 2025-02-28 UTC。"],[[["This page explains the different error codes that may be returned by the Google Wallet API, including BadRequestException, PermissionDeniedException, NotFoundException, IssuerClassNotFoundException, and AlreadyExistsException."],["Each error code has an explanation for the possible causes and suggestions for solutions, focusing on data structure validation, service account authorization, object and class ID verification, and using appropriate HTTP methods like GET, PATCH, or PUT."],["The table provides example error messages to help with troubleshooting, along with links to relevant documentation for further assistance."],["For 'Add to Google Wallet' links, web-based error messages are displayed for users with 'Developer' or 'Admin' roles to assist with debugging, offering insights into the issue."]]],["The Google Wallet API returns specific error codes: 400 (BadRequestException) indicates an invalid argument, requiring checks on data structure. 403 (PermissionDeniedException) means the service account lacks authorization. 404 (NotFoundException) signals a missing Wallet Object or Class, needing a GET request before PATCH/PUT actions. 409 (AlreadyExistsException) indicates an existing class, suggesting a GET request and potential PATCH/PUT instead of creating it again. Web errors are displayed to developers and admins.\n"]]