# Add Payee

This API allows merchants to add payees to the system. Merchants can provide necessary information such as payee's name, email, account details, or any other relevant information required for payouts.

#### Sample Payload Data to be Encrypted

```json

[{
    id: "11-22-33",
    fname: "Rohan",
    lname: "Singh",
    email: "testing998824@yopmail.com",
    label: "TestingL",
    businessname: "Testing2",
    },
    {
    id: "11-22-34",
    fname: "Rohan",
    lname: "Singh",
    email: "testing998825@yopmail.com",
    label: "TestingL",
    businessname: "Testing2",
    }]
```

## This API will take encrypted data as request payload.

<mark style="color:green;">`POST`</mark> `/payout/payee`

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{token}} |

#### Request Body

| Name                                           | Type   | Description                     |
| ---------------------------------------------- | ------ | ------------------------------- |
| encryptedReq<mark style="color:red;">\*</mark> | String | Encrypted array of payee object |

{% tabs %}
{% tab title="200: OK " %}
When all data is correct

```json
{
  "ok": true,
  "result": {
    "success": true,
    "payees": [
      {
        "First Name": "Rohan",
        "Last Name": "Singh",
        "Email": "testing998877@yopmail.com",
        "Label": "TestingL",
        "Error(s)": ""
      },
      {
        "First Name": "Rohan",
        "Last Name": "Singh",
        "Email": "testing998879@yopmail.com",
        "Label": "TestingL",
        "Error(s)": ""
      }
    ],
    "insertedCount": 2,
    "errorMsg": ""
  }
}
```

When Encrypted Data is not in Correct Formate

```json
{
  "ok": true,
  "result": {
    "success": false,
    "errorMsg": "Invalid Encrypted Data"
  }
}
```

When Decrypted Data is not in Correct Format (Array)

```json
{
  "ok": true,
  "result": {
    "success": false,
    "errorMsg": "Invalid Formate of Decrypted Data"
  }
}
```

When Decrypted Data is missing a required key

```json
{
  "ok": true,
  "result": {
    "success": false,
    "errorMsg": "Invalid Data: Row - 1, Key - email"
  }
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
  "ok": false,
  "statusCode": 500,
  "message": "Internal Server Error"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```json
{
  "ok": false,
  "statusCode": 401,
  "data": {},
  "message": "Token expired"
}
```

{% endtab %}
{% endtabs %}


---

# 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.rocketfuel.inc/developer-guides/api-reference/payout/add-payee.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.
