Error codes and exceptions
Stay organized with collections
Save and categorize content based on your preferences.
API error responses
The following table explains error codes that mayn be returned by the Google Wallet API, their possible causes, and solutions.
Exception |
Example Message |
Suggestion |
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. |
403 - PermissionDeniedException |
Permission Denied |
Ensure the correct Service Account email is an authorized user within your Business Pay and Wallet Console. |
404 - NotFoundException |
Wallet Object {1234567891234567899.SampleClubCardxf6a8edf-87ca-4022-a813-694cc57e9fd3} not found. |
Perform a GET on the Object ID before trying before a PATCH or PUT request to ensure you have an object to update and that it's the latest. |
404 - IssuerClassNotFoundException |
Wallet Object Class {1234567891234567899.ABCD.1234567} not found. |
When performing an update , ensure you do a GET request before a PATCH or PUT 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. |
409 - AlreadyExistsException |
Wallet Object Class {1234567891234567899.ABCD.1234567} already exists. |
Perform a GET on the Class ID before trying to create the same Class ID. If the resource exists you may want to use PATCH or PUT. |
Web-based error messages
If 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.
Here is an example of the type of error message that might be displayed:
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-11 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-11 UTC."],[[["This page explains the various error codes returned by the Google Wallet API, including BadRequestException, PermissionDeniedException, NotFoundException, IssuerClassNotFoundException, and AlreadyExistsException."],["Each error code is accompanied by a description, potential causes, and suggestions for resolution, such as data validation, permission checks, and resource verification."],["Before update requests (PATCH or PUT), it's crucial to perform a GET request to ensure the resource exists and you have the latest version to prevent conflicts."],["For 'Add to Google Wallet' links, web-based error messages are displayed to developers and admins to aid in debugging issues during pass saving."],["These messages provide insights into the problem, helping developers understand and resolve issues effectively."]]],["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"]]