> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay-881012b3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Generic API Errors

> List of errors encountered while using Partners API with solutions.

<div style={{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"0.35rem 0.9rem",border:"1px solid rgba(128,128,128,0.28)",borderRadius:"0.5rem",padding:"0.45rem 0.75rem",margin:"0 0 1.25rem",fontSize:"0.875rem"}}>
  <span style={{fontWeight:600}}>Available in</span>
  <span>🇮🇳 India</span>
</div>

Given below are the error codes and descriptions that are common to all Onboarding APIs.

* [400 Bad Request Error](#400-bad-request-error)
* [401 Unauthorized](#401-unauthorized)
* [500 Internal Server Error](#500-internal-server-error)

## 400 Bad Request Error

Given below are sample error objects for bad request errors.

### Data Exceeds Specified Length

This error occurs when the value sent for a particular field exceeds the specified limit. For example, if you had sent a phone number with more than 10 digits.

| Error Description                    | Solution                                                    |
| ------------------------------------ | ----------------------------------------------------------- |
| The `field_name` must be `x` digits. | Check the length mentioned in the documentation and resend. |

<CodeGroup>
  ```json Length Exceeded theme={null}
  {
    "error": {
      "code": "BAD_REQUEST_ERROR",
      "description": "The phone must be 10 digits.",
      "source": "business",
      "step": "payment_initiation",
      "reason": "input_validation_failed",
      "metadata": {},
      "field": "phone"
    }
  }
  ```
</CodeGroup>

### Invalid URL Sent

This error occurs when you the send an invalid URL.

| Error Description           | Solution                  |
| --------------------------- | ------------------------- |
| The url is not a valid URL. | Check the URL and resend. |

<CodeGroup>
  ```json Invalid URL theme={null}
  {
     "error": {
         "code": "BAD_REQUEST_ERROR",
         "description": "The url is not a valid URL.",
         "source": "business",
         "step": "payment_initiation",
         "reason": "input_validation_failed",
         "metadata": {}
     }
  }
  ```
</CodeGroup>

### Invalid Data Sent

This error occurs when the value sent for a particular field is incorrect. For example, if you sent an invalid webhook event name.

| Error Description                            | Solution                                                         |
| -------------------------------------------- | ---------------------------------------------------------------- |
| Invalid event name/names: payment.authorized | Check the mentioned field (here, webhook event name) and resend. |

<CodeGroup>
  ```json Invalid Data theme={null}
  {
    "error": {
      "code": "BAD_REQUEST_ERROR",
      "description": "Invalid event name/names: payment.authorized",
      "source": "business",
      "step": "payment_initiation",
      "reason": "input_validation_failed",
      "metadata": {}
    }
  }
  ```
</CodeGroup>

### Blank Field

This error occurs when a field is sent without any values. For example, if the Account entity parameter `customer_facing_business_name` is sent without any value.

| Error Description                   | Solution                                                                       |
| ----------------------------------- | ------------------------------------------------------------------------------ |
| The business dba field is required. | Ensure all mandatory fields and values are present. (Here, the business name). |

<CodeGroup>
  ```json Blank Business Name Field theme={null}
  {
    "error": {
      "code": "BAD_REQUEST_ERROR",
      "description": "The business dba field is required.",
      "source": "business",
      "step": "payment_initiation",
      "reason": "input_validation_failed",
      "metadata": {},
      "field": "business_dba"
    }
  }
  ```
</CodeGroup>

### Extra Fields Submitted at Needs Clarification State

This error occurs when the Razorpay team has evaluated the details, changed the activation status to `needs_clarification` and has sought more details. Therefore, only those fields which are present in the `requirements array` in the [Fetch Product Configuration API](https://razorpay.com/docs/api/partners/product-configuration/fetch) response should be resent. You cannot send any additional fields.

| Error Description                                                     | Solution                          |
| --------------------------------------------------------------------- | --------------------------------- |
| Only fields requested for needs clarification are allowed for update. | Send only the highlighted fields. |

<CodeGroup>
  ```json Extra Fields theme={null}
  {
    "error": {
      "code": "BAD_REQUEST_ERROR",
      "description": "Only fields requested for needs clarification are allowed for update"
    }
  }
  ```
</CodeGroup>

### Extra Fields Submitted at Under Review State

This error occurs when the Razorpay team is evaluating the submitted details and changed the activation status to `under_review`. Therefore, you cannot send any fields.

| Error Description                                             | Solution                                                    |
| ------------------------------------------------------------- | ----------------------------------------------------------- |
| Merchant activation form has been locked for editing by admin | Do not send any requests. Wait for Razorpay team to revert. |

<CodeGroup>
  ```json Extra Fields theme={null}
  {
    "error": {
      "code": "BAD_REQUEST_ERROR",
      "description": "Merchant activation form has been locked for editing by admin"
    }
  }
  ```
</CodeGroup>

### Extra Fields Submitted at Activated State

This error occurs when the activation is complete. At this point, you cannot send any fields.

| Error Description                                             | Solution                  |
| ------------------------------------------------------------- | ------------------------- |
| Merchant activation form has been locked for editing by admin | Do not send any requests. |

<CodeGroup>
  ```json Extra Fields theme={null}
  {
    "error": {
      "code": "BAD_REQUEST_ERROR",
      "description": "Merchant activation form has been locked for editing by admin"
    }
  }
  ```
</CodeGroup>

## 401 Unauthorized

This error occurs when you use incorrect API keys while making the requests.

| Error Description                   | Solution                                                                                                                                                                                              |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The api secret provided is invalid. | The API credentials passed in the API call differ from the ones generated on the Dashboard. Possible reasons: <ul><li>Different keys for test mode and live modes.</li><li>Expired API key.</li></ul> |

<CodeGroup>
  ```json Invalid Key theme={null}
  {
    "error": {
      "code": "BAD_REQUEST_ERROR",
      "description": "The api key provided is invalid",
      "source": "NA",
      "step": "NA",
      "reason": "NA",
      "metadata": {}
    }
  }
  ```

  ```json Invalid Secret theme={null}
  {
    "error": {
      "code": "BAD_REQUEST_ERROR",
      "description": "The api secret provided is invalid",
      "source": "NA",
      "step": "NA",
      "reason": "NA",
      "metadata": {}
    }
  }
  ```
</CodeGroup>

## 500 Internal Server Error

This error occurs when emojis are sent in the API request.

| Error Description                                                                           | Solution                                                     |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| We are facing some trouble completing your request at the moment. Please try again shortly. | Ensure that the API request does not have emojis and resend. |

<CodeGroup>
  ```json Server Error theme={null}
  {
    "error": {
      "code": "SERVER_ERROR",
      "description": "We are facing some trouble completing your request at the moment. Please try again shortly.",
      "source": "NA",
      "step": "NA",
      "reason": "NA",
      "metadata": {}
    }
  }
  ```
</CodeGroup>
