# Error Codes

## **Sandbox**

* **INVALID\_REFERREL**\
  \
  **Reason:** When request is initiated from unauthorized/invalid website

  **Solution:** Try initiating request from authorized website only (the website domain should be registered and approved with the registered merchant account of PayKun)<br>
* **INVALID\_MERCHANT**\
  \
  **Reason:** Merchant ID is not found, or Merchant is not active to perform the transaction.

  **Solution:** Get the Merchant ID as available in your PayKun Dashboard. For Live mode the account needs to be activated from the onboarding team.<br>
* **INVALID\_TOKEN**\
  \
  **Reason:** Provided access token is invalid.

  **Solution:** Follow the steps and instructions as in [Generate Access Token & API Secret KEY](https://docs.paykun.com/technical-guide/api-encryption-key-guide)<br>
* **PRIMARY\_VALIDATION\_FAIL**\
  \
  **Reason:** Primary data validation is failed, might be due to the following reason:

  1. Duplicate Order ID
  2. Invalid Amount
  3. Invalid Order ID
  4. Empty Transaction Limit

  **Solution:** Enter the correct respective values

## **Production**

In Production mode/phase, no error code will be displayed.

For any other cases, one of the following general messages will be displayed:

* **Invalid Request**<br>

  **Reasons :**

  This error will be shown in the following conditions:

  1. Invalid Merchant ID/Token
  2. Merchant is inactive for live transaction
  3. Duplicate/Invalid Order ID
  4. Invalid Amount
  5. Empty Transaction Limit<br>

  **Solutions :**

  1. Get the [Merchant ID](https://docs.paykun.com/technical-guide/api-encryption-key-guide) as available in your PayKun Dashboard.
  2. Get the account activated with the onboarding team
  3. Enter respective Correct values

* **Unauthorized Request**<br>

  **Reasons:**

  1. This error will be shown only if there is an error with Access Token or API Secret
  2. When request is initiated from unauthorized website.<br>

  **Solutions :**

  1. Follow the steps and instructions as in [Generate Access Token & API Secret KEY](https://docs.paykun.com/technical-guide/api-encryption-key-guide)
  2. Try initiating request from authorized website only, means the website domain which is registered and approved with the registered merchant account of PayKun<br>

* **Internal Server Error:**\
  \
  **Reasons:** This error will be displayed when something went wrong in server.

  **Solutions :** Generally it is a temporary error. But if you are facing this error continuously, please report it to <support@paykun.com>
