# Codes and Formats
source: https://developer.mastercard.com/transaction-notifications/documentation/codes-and-formats/index.md

## Error Codes {#error-codes}

### Error Structure {#error-structure}

Mastercard returns errors in the following structure.

```json
{
  "Errors": {
    "Error": [
      {
        "Source": "<source>",
        "ReasonCode": "<unique code>",
        "Description": "<short description of the error>",
        "Recoverable": true/false,
        "Details": "<Optional detailed description of the issue>"
      }
    ]
  }
}
```

### Gateway Error Codes {#gateway-error-codes}

In addition to service error codes, error codes can also be returned by Mastercard's gateway, which is used to verify your request's signature and route it to the correct location.

For a list of gateway errors and resolutions, see [Gateway Error Codes](https://developer.mastercard.com/platform/documentation/security-and-authentication/gateway-error-codes/).

## HTTP Response Codes and Reason Codes {#http-response-codes-and-reason-codes}

The following table lists the HTTP response codes and reason codes returned by the Transaction Notifications APIs.

| HTTP Status Code |   Reason Code   |                                                                                    Typical Cause                                                                                     |                                   Endpoints                                   |                                                                                                         Resolution Steps                                                                                                          |
|------------------|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 200              | `Success`       | Request processed successfully.                                                                                                                                                      | All                                                                           | N/A                                                                                                                                                                                                                               |
| 400              | `MissingFields` | Required fields are missing.                                                                                                                                                         | `POST /notifications/transactions`, `POST /notifications/transactions/search` | Verify that all required fields are included in the request and retry. See the [API Reference](https://developer.mastercard.com/transaction-notifications/documentation/api-reference/index.md) for required fields per endpoint. |
| 404              | `UnknownCard`   | Either the card reference is invalid or the card is not yet enrolled through [Consent Management \& Enrollment](https://developer.mastercard.com/consent-management/documentation/). | `POST /notifications/transactions`, `POST /notifications/transactions/search` | Ensure the card reference is valid and that the card is enrolled before retrying.                                                                                                                                                 |

