# Code and Formats
source: https://developer.mastercard.com/india-online-dispute-resolution/documentation/code-and-formats/index.md

## Error Handling {#error-handling}

The India Online Dispute Resolution (IODR) API uses standard HTTP response codes for success and failure notifications, and our errors are further classified by error type. In general, 200 HTTP codes correspond to success, 40X codes are for developer or user-related failures, and 50X codes are for runtime or system errors.

This section contains information about the response codes and error messages that can be returned by the APIs.

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

Apart from the error codes returned by the IODR APIs, other error codes can be returned by the Mastercard gateway, which verifies your request's signature and routes it to the correct location.

For further information about 4xx/5xx response codes returned by the gateway and their possible resolutions, see [Gateway Error Codes](https://developer.mastercard.com/platform/documentation/security-and-authentication/gateway-error-codes/).

## Application Error Codes {#application-error-codes}

### Error Structure {#error-structure}

4xx/5xx error response messages have the following format (the Error array may contain multiple error items):

```json

{
   "Errors": {
     "Error": [
       {
         "Source": "<Source api of the error, e.g. INDIA_ONLINE_DISPUTE_RESOLUTION",
         "ReasonCode": "<Unique code>",
         "Description": "<Description of the error>",
         "Recoverable": "true/false",
         "Details": "null"
       }
     ]
   }
 }
```

|      Field      |                                                                                                                                                                          Description                                                                                                                                                                          |
|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Source**      | The application (INDIA_ONLINE_DISPUTE_RESOLUTION) generates this error. Every error message that is generated and returned by the Gateway will have this field equal to Gateway. When the value of the source field is something else, it means the error was generated elsewhere. For example, INDIA_ONLINE_DISPUTE_RESOLUTION.                              |
| **ReasonCode**  | A unique constant identifying the error case encountered when the India Online Dispute Resolution API is called. For example, INVALID_INPUT, ACCOUNT_NOT_FOUND                                                                                                                                                                                                |
| **Description** | Description of the `ReasonCode` field with additional details.                                                                                                                                                                                                                                                                                                |
| **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 request parameter, 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**     | Provide detailed error information wherever appropriate to help in resolving errors.                                                                                                                                                                                                                                                                          |

## HTTP Response Codes {#http-response-codes}

|      HTTP Response Code      |                                                          Description                                                          |
|------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| **200 OK**                   | The request was completed successfully.                                                                                       |
| **400 BAD REQUEST**          | General error when the request could not be fulfilled due to errors such as validation errors, or missing required data.      |
| **401 UNAUTHORIZED**         | Error code response for missing or invalid authentication token. (for example, a client with a clientId does not have access) |
| **404 NOT FOUND**            | The requested resource is not found.                                                                                          |
| **422 UNPROCESSABLE ENTITY** | Indicates that the action could not be processed properly due to invalid data provided.                                       |

## India Online Dispute Resolution Error Codes {#india-online-dispute-resolution-error-codes}

| HTTP Code |  Reason Code   |                                                                          Description                                                                           | Recoverable |                                                             Resolution Tips                                                             |
|-----------|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| 400       | ODR028         | Acquirer's information is not updated in the system by them. Please contact the Acquirer's customer support to lodge your complaint.                           | false       | Please get the acquirer email id updated for IODR system.                                                                               |
| 400       | Request-Id     | Invalid input field Request-Id provided in request.                                                                                                            | true        | Please pass 'Request-Id' request header value in UUID format. This is use for request tracking purpose.                                 |
| 400       | searchType     | Invalid input field searchType provided in request.                                                                                                            | true        | The input field is invalid. Please check the API specification to pass the correct input field value.                                   |
| 400       | searchValue    | Invalid input field searchValue provided in request.                                                                                                           | true        | The input field is invalid. Please check the API specification to pass the correct input field value.                                   |
| 400       | trackingNumber | Invalid input field tracking number provided in request.                                                                                                       | true        | Please pass correct tracking number.                                                                                                    |
| 401       | ODR017         | The client is not onboarded. Please create a project on the Mastercard developer portal to successfully onboard yourself.                                      | true        | Please create a project on the Mastercard developer portal with the correct customer ID or company ID.                                  |
| 401       | ODR019         | You're not authorize to access this endpoint                                                                                                                   | false       | You're not authorized user to access this endpoint. In case of POST /complaints create complaint endpoint is accessible by Issuer only. |
| 401       | ODR022         | You are not the owner of dispute,The entered tracking number does not belong to you.                                                                           | false       | You do not have access to this data. Please use tracking number which is belongs to you.                                                |
| 404       | ODR016         | Issuer's information is not updated in the system by them. Dispute could not be created. Please contact the Issuer's customer support to lodge your complaint. | false       | Please get the issuer email id updated for IODR system.                                                                                 |
| 404       | ODR018         | Record not found                                                                                                                                               | false       | There is no complaints available in system for requested data                                                                           |
| 404       | ODR029         | Card number is not belongs to this issuer.                                                                                                                     | true        | Issuer details is not found in system or card number is not belongs to this issuer.                                                     |

