Коды ошибок и исключения
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Ответы об ошибках API
В следующей таблице описаны коды ошибок, которые может возвращать API Google Кошелька, их возможные причины и решения.
Исключение | Пример сообщения | Предположение |
---|
400 — исключение BadRequestException | Запрос содержит недопустимый аргумент. Неверный идентификатор ресурса: {1234567891234567899 - ABCD1234567}. | Проверьте структуру данных на тип, формат и длину и передайте правильный аргумент. |
403 – исключение PermissionDeniedException. | Доступ запрещен | Убедитесь, что правильный адрес электронной почты сервисного аккаунта является авторизованным пользователем в вашей консоли Business Pay и Wallet. |
404 – NotFoundException | Объект кошелька {1234567891234567899.SampleClubCardxf6a8edf-87ca-4022-a813-694cc57e9fd3} не найден. | Выполните GET для идентификатора объекта перед попыткой перед запросом PATCH или PUT , чтобы убедиться, что у вас есть объект для обновления и что он является последним. |
404 — IssuerClassNotFoundException | Класс объекта кошелька {1234567891234567899.ABCD.1234567} не найден. | При выполнении обновления убедитесь, что вы выполняете запрос GET перед запросом PATCH или PUT , чтобы убедиться, что у вас есть класс, на который можно ссылаться, и что это последний класс. Также убедитесь, что в запросе правильно используются правильные полезные данные (объект и класс). |
409 – ужеExistsException | Класс объекта кошелька {1234567891234567899.ABCD.1234567} уже существует. | Выполните GET для идентификатора класса, прежде чем пытаться создать тот же идентификатор класса. Если ресурс существует, вы можете использовать PATCH или PUT. |
Сообщения об ошибках через Интернет
Если что-то пойдет не так, когда вы попытаетесь сохранить пропуск с помощью ссылки «Добавить в Google Кошелек», вам будет показано информативное сообщение об ошибке, которое поможет вам выполнить отладку. Эти сообщения отображаются только пользователям с ролью «Разработчик» или «Администратор» для связанной учетной записи эмитента.
Вот пример типа сообщения об ошибке, которое может отображаться:
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-09-04 UTC.
[null,null,["Последнее обновление: 2025-09-04 UTC."],[[["\u003cp\u003eThis page explains the different error codes that may be returned by the Google Wallet API, including BadRequestException, PermissionDeniedException, NotFoundException, IssuerClassNotFoundException, and AlreadyExistsException.\u003c/p\u003e\n"],["\u003cp\u003eEach error code has an explanation for the possible causes and suggestions for how to resolve the issue.\u003c/p\u003e\n"],["\u003cp\u003eThe table provides example messages for each exception, and links to relevant documentation for further troubleshooting.\u003c/p\u003e\n"],["\u003cp\u003eWeb-based error messages are shown to users with 'Developer' or 'Admin' roles when saving a pass using the 'Add to Google Wallet' link to assist with debugging.\u003c/p\u003e\n"],["\u003cp\u003eThese informative error messages provide detailed information about the issue, helping users identify and resolve problems quickly.\u003c/p\u003e\n"]]],["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"],null,["# Error codes and exceptions\n\nAPI error responses\n-------------------\n\nThe following table explains error codes that mayn be returned by the Google Wallet API, their possible causes, and solutions.\n\n| Exception | Example Message | Suggestion |\n|------------------------------------|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 400 - BadRequestException | Request contains an invalid argument. Invalid resource ID: {1234567891234567899 - ABCD1234567}. | Check the data structure for type, format and length and pass the correct argument. |\n| 403 - PermissionDeniedException | Permission Denied | Ensure the correct [Service Account](https://developers.google.com/wallet/retail/loyalty-cards/web/prerequisites#4.-authorize-the-service-account) email is an authorized user within your Business Pay and Wallet Console. |\n| 404 - NotFoundException | Wallet Object {1234567891234567899.SampleClubCardxf6a8edf-87ca-4022-a813-694cc57e9fd3} not found. | Perform a [GET](https://developers.google.com/wallet/generic/rest/v1/genericclass/get#http-request) on the Object ID before trying before a [PATCH](https://developers.google.com/wallet/generic/rest/v1/genericclass/patch#http-request) or [PUT](https://developers.google.com/wallet/generic/rest/v1/genericclass/update#http-request) request to ensure you have an object to update and that it's the latest. |\n| 404 - IssuerClassNotFoundException | Wallet Object Class {1234567891234567899.ABCD.1234567} not found. | When performing an update , ensure you do a [GET](https://developers.google.com/wallet/generic/rest/v1/genericclass/get#http-request) request before a [PATCH](https://developers.google.com/wallet/generic/rest/v1/genericclass/patch#http-request) or [PUT](https://developers.google.com/wallet/generic/rest/v1/genericclass/update#http-request) request to ensure you have a class to reference that it's the latest class. Also ensure the correct payload (object and class) is being used in the request correctly. |\n| 409 - AlreadyExistsException | Wallet Object Class {1234567891234567899.ABCD.1234567} already exists. | Perform a [GET](https://developers.google.com/wallet/generic/rest/v1/genericclass/get#http-request) on the Class ID before trying to create the same Class ID. If the resource exists you may want to use [PATCH](https://developers.google.com/wallet/generic/rest/v1/genericclass/patch#http-request) or [PUT.](https://developers.google.com/wallet/generic/rest/v1/genericclass/update#http-request) |\n\nWeb-based error messages\n------------------------\n\nIf something goes wrong when you attempt to save a pass using an 'Add to Google Wallet' link, you will be shown an informative error message to help you debug. These messages are only shown to users that have the 'Developer' or 'Admin' role for the associated Issuer account.\n\nHere is an example of the type of error message that might be displayed:"]]