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

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

Resource requests use HTTP response codes to provide a coarse-grain indication of the result of each request. The most common response codes for supported HTTP methods include:

The **Endpoint / Flow** column shows which operation can return each error. To see the full request and response schema for any of these operations, refer to the [API Reference](https://developer.mastercard.com/india-online-dispute-resolution/documentation/api-reference/index.md).

| HTTP Code |            Reason Code            |                                         Endpoint / Flow                                          |                Description                 |                                              Resolution Tips                                              |
|-----------|-----------------------------------|--------------------------------------------------------------------------------------------------|--------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| 400       | REQUEST_BODY_EMPTY                | `POST /complaints`, `PUT /complaints`, `POST /complaints/searches`, `POST /transactions/details` | Request body empty                         | Provide a valid request payload with required fields.                                                     |
| 400       | ODR026                            | All endpoints                                                                                    | Invalid request parameter                  | Verify parameter names, values, and formats.                                                              |
| 400       | INVALID_INPUT                     | `POST /complaints/searches` (Search complaints)                                                  | Invalid searchType parameter value         | Use a supported searchType value.                                                                         |
| 400       | Request-Id                        | All endpoints                                                                                    | Invalid Request-Id provided                | Provide Request-Id in the expected format.                                                                |
| 400       | ODR023                            | `PUT /complaints` (Update dispute)                                                               | Invalid Comment                            | Ensure comment meets validation rules.                                                                    |
| 400       | trackingNumber                    | `POST /transactions/details`, `GET /transactions/status`, `PUT /complaints`                      | Invalid tracking number                    | Verify tracking number format and existence.                                                              |
| 400       | ODR031                            | `PUT /complaints` (Update dispute)                                                               | Invalid commentTo parameter value          | Use a supported commentTo value.                                                                          |
| 403       | ODR017                            | All endpoints (authorization)                                                                    | Client not onboarded                       | Complete onboarding through Mastercard Developer Portal.                                                  |
| 401       | ODR019                            | `POST /complaints` (Create complaint)                                                            | Not authorized to access this endpoint     | Verify OAuth credentials, roles and permissions.                                                          |
| 403       | ODR022                            | `GET /transactions/status`, `PUT /complaints`                                                    | Tracking number does not belong to you     | Use a tracking number associated with your organization.                                                  |
| 403       | OR024                             | `PUT /complaints` (Update dispute)                                                               | Provided ID does not belong to you         | Verify ownership of the supplied identifier.                                                              |
| 404       | NO_MAPPING_FOUND_FOR_URI          | All endpoints                                                                                    | No mapping found for requested URI         | Verify endpoint URL, API version and request path.                                                        |
| 404       | ODR018                            | `GET /transactions/status`, `POST /complaints/searches`                                          | Record not found                           | Verify tracking number, dispute ID or search criteria.                                                    |
| 405       | HTTP_REQUEST_METHOD_NOT_SUPPORTED | All endpoints                                                                                    | HTTP method not supported                  | Use the HTTP method documented for the endpoint.                                                          |
| 409       | ODR015                            | `POST /complaints` (Create complaint)                                                            | Record already exist                       | Use existing record or perform update instead of create.                                                  |
| 422       | ODR011                            | `POST /complaints` (Create complaint)                                                            | Complaint limit failed                     | Review complaint limits and existing complaints.                                                          |
| 422       | ODR016                            | `POST /complaints` (Create complaint)                                                            | Issuer information not updated             | Contact issuer support and request profile update in IODR.                                                |
| 422       | ODR021                            | `GET /transactions/status`                                                                       | Transaction status is empty                | Call Transaction Details API and ensure data is available.                                                |
| 422       | ODR025                            | `POST /transactions/details`, `POST /complaints`                                                 | Bank details missing in IODR system        | Contact bank support to complete configuration.                                                           |
| 422       | ODR027                            | All endpoints (authorization)                                                                    | Company Id not updated                     | Contact support to complete company setup.                                                                |
| 422       | ODR028                            | `PUT /complaints` (Update dispute)                                                               | Acquirer information not updated           | Contact acquirer support and update profile details.                                                      |
| 422       | ODR029                            | `POST /complaints` (Create complaint)                                                            | Card number does not belong to this issuer | Verify the card belongs to the specified issuer.                                                          |
| 422       | ODR030                            | `POST /transactions/details` (Validate transaction)                                              | Issuer and Acquirer ICA are same           | Use a valid transaction where ICAs are different.                                                         |
| 500       | ODR003                            | All endpoints                                                                                    | Internal server error                      | Contact support team. Check application logs, database connectivity, downstream services and server logs. |

Note: To move from an error to the operation that produced it, use the **Endpoint / Flow** column above and open the matching operation in the [API Reference](https://developer.mastercard.com/india-online-dispute-resolution/documentation/api-reference/index.md). For business context on each flow, see the [Use Cases](https://developer.mastercard.com/india-online-dispute-resolution/documentation/use-cases/index.md) section.

## 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/).

## 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.

## 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 that 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)          |
| **403 FORBIDDEN**             | Indicates that the server understands the request but refuses to authorize it.                                                         |
| **404 NOT FOUND**             | The requested resource is not found.                                                                                                   |
| **405 METHOD NOT ALLOWED**    | The HTTP method used is not supported for the requested resource.                                                                      |
| **409 CONFLICT**              | The request could not be completed due to a conflict with the current state of the resource. (For example, the record already exists.) |
| **422 UNPROCESSABLE ENTITY**  | Indicates that the action could not be processed properly due to invalid data provided.                                                |
| **500 INTERNAL SERVER ERROR** | An unexpected error occurred while processing the request. Contact the support team if the issue persists.                             |

## Next Steps {#next-steps}

If an error persists after following the resolution tips above, review the frequently asked questions on the [Support](https://developer.mastercard.com/india-online-dispute-resolution/documentation/support/index.md#faq) page for further guidance, or [contact us for technical support](https://developer.mastercard.com/india-online-dispute-resolution/documentation/support/index.md#get-help).
