# Code and Formats
source: https://developer.mastercard.com/authentication-consent/documentation/code-and-formats/index.md

## Error Codes {#error-codes}

### Error Structure {#error-structure}

```json
{
  "Errors": {
    "Error": [
      {
        "Source": "AES_CONSENT_SERVICE",
        "ReasonCode": "system.error",
        "Description": "Something went wrong while handling your request. Please try again later",
        "Recoverable": false,
        "Details": null
      }
    ]
  }
}
```

## Reason codes {#reason-codes}

### Structure {#structure}

The structure should be in comply with Enterprise Error Library. (that is, only alphabets with . or camel case separated)

For example, `resource.not.found`  or  `input.parameter.missing`

### Basic Strategy {#basic-strategy}

* Missing field is equal to `input.parameter.missing` (HTTP Status = 400)
* Invalid field is equal to `input.parameter.invalid` (HTTP Status = 400)
* Record not found for a combination of input query values is equal to `transaction.not.found` (HTTP Status = 400)
* Input format invalid (expected Date but provided Integer) is equal to `format.invalid`

### Common Reason codes {#common-reason-codes}

| HTTP Status |  Reason Code   |                          Description                           | Applicable To |
|-------------|----------------|----------------------------------------------------------------|---------------|
| 400         | `system.error` | Something went wrong with your request. Please try again later | All methods   |

In addition to the Common Reason codes, the APIs will return the below error codes:

### Consent Languages {#consent-languages}

| HTTP Status |         Reason Code          | Description |    Details     |
|-------------|------------------------------|-------------|----------------|
| 400         | `querystring.locale.invalid` | locale      | Invalid locale |

### User Consent {#user-consent}

| HTTP Status |     Reason Code      |              Description              |
|-------------|----------------------|---------------------------------------|
| 404         | `resource.not.found` | The requested resource does not exist |

