Marketplace Redemption Error Handling
When working with marketplace redemption APIs, it’s crucial to have robust error handling. This article explores best practices for handling errors, from understanding common error codes to implementing graceful error recovery strategies. Errors are returned using the standard PlayFab Error WrapperAPIErrorWrapper
TheAPIErrorWrapper is a wrapper around every failed API response.
For any marketplacemrelated issues, we return a Key-Value Pair (KVP) in the
errorDetails object.
This is a passthrough of the error code and error code message returned by the marketplace.
wrapper.errorDetails['MarketplaceErrorCode'] is not null and then parse the first element to handle different marketplace error codes accordingly.
Public Failure HTTP Status Codes
This section lists the error codes returned by redeem APIs.- 400 - Bad Request
- All request and input validation failures
GenericErroCodes.InvalidRequest - All configuration validation failures
GenericErrorCodes.InvalidServiceConfiguration - All marketplace authorization failures
GenericErrorCodes.InvalidServiceConfiguration- Related to service identity failures.GenericErrorCodes.InvalidAuthToken- Related to player identity failures.
- All catalog item configuration failures
GenericErrorCodes.InvalidCatalogItemConfiguration
- All request and input validation failures
- 401/403 - Not Authorized/Forbidden
- PlayFab authorization failures
GenericErrorCodes.NotAuthorized
- PlayFab authorization failures
- 503 - MarketplaceUnavailable
GenericErrorCodes.DownstreamServiceUnavailable
