Error codes and exceptions

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