# Generic Code and Formats
source: https://developer.mastercard.com/eligibility-api/documentation/code-and-formats/generic-code-and-formats/index.md

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

| **HTTP Status Code** |        **Response**         |                                      **Typical Cause**                                      |                                                            **Resolution Steps**                                                            |
|----------------------|-----------------------------|---------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| 200                  | "ReasonCode":"OK"           | Request was successful                                                                      | No action required                                                                                                                         |
| 400                  | "ReasonCode":"BAD_REQUEST"  | Not all mandatory parameters are provided or sent incorrectly. The request was invalid.     | Refer to the structure of the body in your request for missing, mandatory, or misspelled parameters.                                       |
| 401                  | "ReasonCode":"UNAUTHORIZED" | Authentication failed. Authentication is required to access this resource.                  | Check that your authentication is correctly configured for the environment you are using. Reach out to API Support if you need assistance. |
| 403                  | "ReasonCode":"FORBIDDEN"    | You may not have the permission to access this endpoint.                                    | Check you are using the correct credentials and that you are on the correct tier for the request you are making.                           |
| 404                  | "ReasonCode":"NOT_FOUND"    | Invalid request parameters. Requested resource could not be found for the given identifier. | Verify that the request parameters used to trigger the API endpoint are correct which could result in resource lookup.                     |

## 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>"
      }
    ]
  }
}
```

### Field Overview: {#field-overview}

* **Source**: The source of the error. This can be the service, gateway, or other source.
* **ReasonCode**: A unique constant identifying the error case encountered during transaction processing. For example, INVALID_SIGNATURE is used when the request signature does not match the expected one.
* **Description**: A short description of the error.
* **Recoverable**: Indicates whether this error will always be returned for this request, or retrying could change the outcome. For example, if the request contains an invalid signature, retrying will never result in success. However, if the error is related to some unexpected timeout with the service, retrying the call could result in a successful response.
* **Details**: An optional field that provides a more detailed description of the error.

<br />

### Service Error Codes {#service-error-codes}

To review errors related to eligibility checks such as benefit validation, token verification, product eligibility, and card number mismatches, click here [Eligibility Error Codes](https://developer.mastercard.com/eligibility-api/documentation/code-and-formats/eligibility-error-codes/index.md).
To explore errors associated with widget operations including card number validation and benefit search failures, click here [Widget Error Codes](https://developer.mastercard.com/eligibility-api/documentation/code-and-formats/widget-error-codes/index.md).

### 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.
You can find a list of the errors returned by our Gateway, as well as resolutions to each, on the following page [Gateway Error Codes](https://developer.mastercard.com/platform/documentation/security-and-authentication/gateway-error-codes/).
