Error codes and exceptions

  • 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 troubleshooting and resolution.

  • It highlights the importance of data structure validation, proper authorization, and resource verification to avoid these errors.

  • Developers and administrators with the associated Issuer account can see informative web-based error messages when saving passes using the 'Add to Google Wallet' link.

  • These error messages aid in debugging issues encountered during the process of adding passes to Google Wallet.

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:

example error message