# Codes and Formats
source: https://developer.mastercard.com/mdes-pre-digitization/documentation/code-formats/index.md

## Error Codes {#error-codes}

|        Error Code        |          Error Description           |                                                   Error Circumstances                                                    |
|--------------------------|--------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
| INVALID_JSON             | Invalid JSON                         | The JSON could not be parsed.                                                                                            |
| MISSING_REQUIRED_FIELD   | Missing Required Field - {fieldName} | A required field is missing.                                                                                             |
| INVALID_FIELD_FORMAT     | Invalid Field Format - {fieldName}   | The field is not in the correct format. For instance, it should be a number but is a string.                             |
| INVALID_FIELD_LENGTH     | Invalid Field Length - {fieldName}   | The value does not fall between the minimum and maximum length for the field.                                            |
| INVALID_FIELD_VALUE      | Invalid Field Value - {fieldName}    | The value is not allowed for the field.                                                                                  |
| CRYPTOGRAPHY_ERROR       | Cryptography Error                   | There was an error decrypting the encrypted payload.                                                                     |
| INTERNAL_SERVICE_FAILURE | The system had an internal exception | The system had an internal exception.                                                                                    |
| MISSING_EXPIRY_DATE      | Missing Expiry Date                  | The expiry date is required for this product but was missing. Retry the request supplying the expiry date for this card. |

## Reason Codes {#reason-codes}

### Approved Reason Codes {#approved-reason-codes}

|           Reason Code            |                                                                                                                                                                                Description                                                                                                                                                                                 |
|----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| LONG_ACCOUNT_TENURE              | Account has existed for an extended period of not less than one year. A Payment App Provider may determine a longer account tenure to qualify for this reason.                                                                                                                                                                                                             |
| GOOD_ACTIVITY_HISTORY            | There has been financial activity linked to the account for at least and within a period of not less than six months; no suspicious activity is linked to the account within a period of at least one year.                                                                                                                                                                |
| ADDITIONAL_DEVICE                | The digitization is for an additional device for the same Account PAN and consumer account. There must be a currently active (not suspended) Token that was previously digitized and activated on an existing device for the same Account PAN and consumer account.                                                                                                        |
| SOFTWARE_UPDATE                  | The digitization has been requested due to an authenticated operating system or other software update being installed on the device, causing mobile payment data to be wiped and unable to be restored. This digitization must be for the same paymentAppInstanceId to which a Token was previously digitized and activated for the same Account PAN and consumer account. |
| RECENT_APPROVED_TOKEN            | A Companion Cloud Token is being provisioned from an existing device token which has been approved by the issuer using risk-based decisioning, within the system time validation window.                                                                                                                                                                                   |
| RECENT_CARDHOLDER_AUTHENTICATION | A Companion Cloud Token is being provisioned from an existing device token, which was provisioned and successfully completed cardholder authentication within the system time validation window.                                                                                                                                                                           |
| DEVICE_AUTHENTICATION_VERIFIED   | A Companion Cloud Token or Recurring Payment Cloud Token is being provisioned from an existing device token. A DSRP cryptogram was provided and will be validated as proof of authentication.                                                                                                                                                                              |

### Require Additional Authentication or Declined Reason Codes {#require-additional-authentication-or-declined-reason-codes}

|          Reason Code           |                                  Description                                   |
|--------------------------------|--------------------------------------------------------------------------------|
| ACCOUNT_TOO_NEW_SINCE_LAUNCH   | Account is considered new relative to the Payment App Provider service launch. |
| ACCOUNT_TOO_NEW                | Account is considered new relative to provisioning request.                    |
| ACCOUNT_CARD_TOO_NEW           | Account/card is considered new relative to provisioning request.               |
| ACCOUNT_RECENTLY_CHANGED       | Changes have recently been made to account data.                               |
| SUSPICIOUS_ACTIVITY            | Suspicious activity has been linked to this account.                           |
| INACTIVE_ACCOUNT               | Inactive account.                                                              |
| HAS_SUSPENDED_TOKENS           | Device contains suspended tokens.                                              |
| DEVICE_RECENTLY_LOST           | Device has recently been reported lost.                                        |
| TOO_MANY_RECENT_ATTEMPTS       | Excessive recent tokenization attempts to this device.                         |
| TOO_MANY_RECENT_TOKENS         | Excessive recent tokenization to this device.                                  |
| TOO_MANY_DIFFERENT_CARDHOLDERS | Excessive non-matching Cardholder names within the device.                     |
| LOW_DEVICE_SCORE               | Low device score.                                                              |
| LOW_ACCOUNT_SCORE              | Low account score.                                                             |
| OUTSIDE_HOME_TERRITORY         | Non-domestic tokenization attempt.                                             |
| UNABLE_TO_ASSESS               | Unable to provide recommendation due to system issues.                         |
| HIGH_RISK                      | High fraud risk identified. Enhanced verification recommended.                 |
| LOW_PHONE_NUMBER_SCORE         | Low phone number score                                                         |

## ISO Device Types {#iso-device-types}

| Code |                                                                   Device Type                                                                   |
|------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| 00   | Card                                                                                                                                            |
| 01   | Mobile Network Operator (MNO) controlled removable secure element (SIM or UICC) personalized for use with a mobile phone or smartphone          |
| 02   | Key Fob                                                                                                                                         |
| 03   | Watch using a contactless chip or a fixed (non-removable) secure element not controlled by the MNO                                              |
| 04   | Mobile Tag                                                                                                                                      |
| 05   | Wristband                                                                                                                                       |
| 06   | Mobile Phone Case or Sleeve                                                                                                                     |
| 07   | Mobile phone or smartphone with a fixed (non-removable) secure element controlled by the MNO, for example, code division multiple access (CDMA) |
| 08   | Removable secure element not controlled by the MNO, for example, memory card personalized for used with a mobile phone or smartphone            |
| 09   | Mobile Phone or Smartphone with a fixed (non-removable) secure element not controlled by the mobile network operator                            |
| 10   | MNO controlled removable secure element (SIM or UICC) personalized for use with a tablet or e-book                                              |
| 11   | Tablet or e-book with a fixed (non-removable) secure element controlled by the MNO                                                              |
| 12   | Removable secure element not controlled by the MNO, for example, memory card personalized for use with a tablet or e-book                       |
| 13   | Tablet or e-reader with a fixed (non-removable) secure element not controlled by the mobile network operator                                    |
| 14   | Mobile phone or Smartphone with a payment application running in a host processor                                                               |
| 15   | Tablet or E-Book with a payment application running in a host processor                                                                         |
| 16   | Mobile Phone or Smartphone with a payment application running in the TEE of a host processor                                                    |
| 17   | Tablet or E-Book with a payment application running in the TEE of a host processor                                                              |
| 18   | Watch with a payment application running in the TEE of a host processor                                                                         |
| 19   | Watch with a payment application running in a host processor                                                                                    |
| 21   | Phone - Mobile phone                                                                                                                            |
| 22   | Tablet                                                                                                                                          |
| 23   | Watch \*\*\*                                                                                                                                    |
| 24   | Sticker                                                                                                                                         |
| 25   | Personal Computer                                                                                                                               |
| 26   | Device Peripheral                                                                                                                               |
| 27   | Tag                                                                                                                                             |
| 28   | Jewelry                                                                                                                                         |
| 29   | Fashion Accessory                                                                                                                               |
| 30   | Garment                                                                                                                                         |
| 31   | Domestic Appliance                                                                                                                              |
| 32   | Vehicle                                                                                                                                         |
| 33   | Media or Gaming Device                                                                                                                          |
| 34   | Virtual Reality Headset                                                                                                                         |
| 99   | None of above                                                                                                                                   |

Note: Values from 20--99 exclusively indicate the form factor only without also indicating the storage technology. Any value in this range may occur within form factor and transaction data without prior notice.
