When something is refused, the reply carries an error_code for your code and a message written for the customer. Show the message; branch on the code. You can write most messages yourself, in any language, in Applications → Messages
Signing in
| Code | Means | What to do |
INVALID_KEY | No such key for this app | Ask the customer to check the key |
HWID_MISMATCH | The key is bound to another PC | Offer to move it (how) |
DEVICE_LIMIT | The key is already on all the PCs it allows | Same as above, or sell a key with more machines |
EXPIRED | The key's time is over | Point them to renew |
BANNED | You banned the key | — |
PAUSED | You paused the key | — |
MAINTENANCE | The app is in maintenance; the message is yours | Try again later |
BLOCKED | A rule of yours refused this address, machine, country, network or VPN (Rules); the message is yours | Show the message. A customer on a VPN can turn it off and try again |
MISSING_FIELDS | The request lacked the key or HWID | A bug in the program |
While running (SessionEnded)
| Code | Means |
BANNED / PAUSED / EXPIRED | The key changed while the program was running |
SESSION_EXPIRED | The session ended: you ended it in Sessions, its machine was reset, it signed in again elsewhere, or it timed out. The message says which |
SESSION_REVOKED | The key or account no longer exists |
NETWORK_LOST | Three heartbeats in a row got no answer (set by the SDK) |
CLOCK_SKEW | The PC's clock is far off and could not be corrected |
Trials and HWID resets
| Code | Means |
TRIAL_DISABLED | Trials are off for this app |
TRIAL_USED / TRIAL_LIMIT | This PC (or network) already had its trial |
SELF_RESET_DISABLED | Self-service moves are off; the customer has to ask you |
RATE_LIMITED | Moved too recently; the message says how long to wait. Also sent (HTTP 429) when one network makes too many requests in a minute, or downloads an update too often. Running copies' check-ins have a much larger allowance, so many customers behind one address are fine |
KEY_NOT_ACTIVE | Only an active key can be moved |
NO_HWID | The key is not bound to any PC: nothing to move |
Add-ons
| Code | Means |
ADDON_KEY_NOT_FOUND | No add-on key like that in this app. It counts as a wrong key for the address |
ADDON_KEY_USED | The add-on key was already added, by this customer or another one |
ADDON_UNAVAILABLE | You took the add-on off sale (App settings) |
User variables
| Code | Means |
INVALID_NAME | A variable name is letters, digits, "_", "." or "-", up to 64 characters (User variables) |
VALUE_TOO_LONG | A value is at most 4 KB |
TOO_MANY_VARS | The customer already has 50 variables; delete one first |
In .NET every code is a constant on PwfErrorCodes, for example PwfErrorCodes.HwidMismatch.