# 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](/technical-guide/api-encryption-key-guide.md)<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](/technical-guide/api-encryption-key-guide.md) 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](/technical-guide/api-encryption-key-guide.md)
  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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.paykun.com/technical-guide/web-integration/checkout-integration/web-integration-error-codes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
