Skip to main content

Errors and Warnings

The PayData API uses a unified format for returning errors and warnings.

Resources in PayData have a list of errors and warnings, to get detailed insights into the state of a resource (e.g. account) or status of an operation (e.g. data import).

The format contains

  • a Message with a description of the error/warning which can be displayed to the user,
  • a Type to automatically handle specific classes of errors/warnings (e.g. translated messages),
  • a IsUserActionRequired information for errors/warnings that cannot be resolved without user intervention
  • and a IsTemporary flag that specifies if the error is temporary and will go away.

Errors

Errors contain information about why something is not working or why it has failed.

{
"Message": "Credentials expired 2024-09-01",
"Type": "CredentialsExpiration",
"IsUserActionRequired": true,
"IsTemporary": false
}

If IsUserActionRequired is true, a user is responsible for correcting the error (e.g. update account credentials). If IsTemporary is true, the error is expected to go away on its own. Common cases are temporary errors with a PSP that cause a data import to fail. In the case where both are false the error should be investigated.

The following table contains the possible values and the recommended actions.

IsTemporaryIsUserActionRequiredRecommended Action
falsefalse
  • Mark resource/operation as erroneous.
  • Display Message or custom message based on Type.
  • Investigate error.
falsetrue
  • Mark resource/operation as erroneous.
  • Display Message or custom message based on Type.
  • Request user to handle error based on Type.
truefalse
  • Inform user about temporary error.
  • Display Message or custom message based on Type
truetrue
  • Display Message or custom message based on Type
  • This case should not happen.

While uncommon, it is possible that resources have multiple errors at the same time. For example importing a report can fail because it contains unknown transactions and the sum of the transactions does not match the payout amount.

Warnings

A warning informs about potential issues or about something that will lead to an error if not handled. Some actions in PayData (e.g account creation) allow possible errors to be ignored. In this case the error is demoted to a warning.

{
"Message": "Credentials are expiring on 2024-09-01",
"Type": "CredentialsExpiration",
"IsUserActionRequired": true
}

If IsUserActionRequired is true, a user is responsible for correcting the error (e.g. update account credentials).

It is possible for resources to have multiple warnings at the same time. For example the account credentials might be expiring soon and the current credentials don't contain all required permissions. The latter can be a warning as PayData might need more permissions when we add functionality at a later date.

Types

Types are used to categorize errors and warnings so they can be handled in a unified way without interpreting the unstructured Message field.

TypeDescriptionWarningErrorResources
CredentialsSome issue with the credentials. Check Message.xxAccount
CredentialsExpirationCredentials are expiring or are expired.xxAccount
CredentialsFailureCredentials are invalid.-xAccount
CredentialsPermissionFailureCredentials have insufficient permissions.xxAccount
DataInconsistencyData received from the provider is inconsistent.xxReport, AccountType
ImportFailureGeneral data import failure.xxAccount, Report, DataImport, AccountType
ImportSuspensionData imports are suspended until the error is resolved.-xAccount
LoginFailureAuthentication with the provider is not possible.-xAccountType
ReportDownloadFailureDownloading the report failed.-xReport
ReportParseFailureParsing the report failed.-xReport
ReportSkipReport was skipped because it already exists or other reports with the same contents exist.x-Report
ThrottlingOperation was throttled by the PSPxxDataImport
UnknownFailureUnknown error/failure. Check Message.xxAll
warning

Errors and warnings depend on PSP behavior and can change without notice. New PSPs and functionality might require new error types. Design your code to handle unknown error types.