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

# Create a Stakeholder Account

> Create a Stakeholder account using the Razorpay API.

Use this endpoint to create a stakeholder account.

<RequestExample>
  ```bash Curl theme={null}
  curl -X POST 'https://api.razorpay.com/v2/accounts/acc_GLGeLkU2JUeyDZ/stakeholders' \
       -u [YOUR_KEY_ID]:[YOUR_SECRET] \
       -H "Content-type: application/json" \
       -d '{
     "name":"Gaurav Kumar",
     "email": "gaurav.kumar@example.com",
     "addresses":{
        "residential":{
           "street":"506, Koramangala 1st block",
           "city":"Bengaluru",
           "state":"Karnataka",
           "postal_code":"560034",
           "country":"IN"
        }
     },
     "kyc":{
        "pan":"AVOPBXXXXX"
     },
     "notes":{
        "random_key":"random_value"
     }
  }'
  ```

  ```java Java theme={null}
  RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");

  String accountId = "acc_GLGeLkU2JUeyDZ";

  JSONObject StakeRequest = new JSONObject();
  StakeRequest.put("email","gaurav.kumar@example.com");
  StakeRequest.put("name","Gaurav Kumar");

  JSONObject residential = new JSONObject();
  residential.put("street","506, Koramangala 1st block");
  residential.put("city","Bengaluru");
  residential.put("state","Karnataka");
  residential.put("postal_code","560034");
  residential.put("country","IN");

  JSONObject addresses = new JSONObject();
  addresses.put("residential",residential);
  StakeRequest.put("addresses",addresses);

  JSONObject kyc = new JSONObject();
  kyc.put("pan","AVOPBXXXXX");

  StakeRequest.put("kyc",kyc);

  JSONObject notes = new JSONObject();
  notes.put("random_key_by_partner","random_value");

  StakeRequest.put("notes",notes);

  Stakeholder stakeholder = instance.stakeholder.create(accountId, StakeRequest);
  ```

  ```python Python theme={null}
  import razorpay
  client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))

  accountId = "acc_GLGeLkU2JUeyDZ"

  client.stakeholder.create(accountId, {
    "name": "Gaurav Kumar",
    "email": "gaurav.kumar@example.com",
    "addresses": {
      "residential": {
        "street": "506, Koramangala 1st block",
        "city": "Bengaluru",
        "state": "Karnataka",
        "postal_code": "560034",
        "country": "IN"
      }
    },
    "kyc": {
      "pan": "AVOPBXXXXX"
    },
    "notes": {
      "random_key_by_partner": "random_value"
    }
  })
  ```

  ```php PHP theme={null}
  $api = new Api($key_id, $secret);

  $accountId = "acc_GLGeLkU2JUeyDZ";

  $api->account->fetch("acc_GLGeLkU2JUeyDZ")->stakeholders()->create(array(
      "name" => "Gaurav Kumar",
      "email" => "gaurav.kumar@example.com",
      "addresses" => array(
          "residential" => array(
              "street" => "506, Koramangala 1st block",
              "city" => "Bengaluru",
              "state" => "Karnataka",
              "postal_code" => "560034",
              "country" => "IN"
          )
      ),
      "kyc" => array(
          "pan" => "AVOPBXXXXX"
      ),
      "notes" => array(
          "random_key_by_partner" => "random_value"
      )
  ));
  ```

  ```csharp .NET theme={null}
  RazorpayClient client = new RazorpayClient(your_key_id, your_secret);

  string accountId = "acc_GLGeLkU2JUeyDZ";

  Dictionary<string, object> StakeRequest = new Dictionary<string, object>();
  StakeRequest.Add("email", "gaurav.kumar@example.com");
  StakeRequest.Add("name", "Gaurav Kumar");

  Dictionary<string, object> residential = new Dictionary<string, object>();
  residential.Add("street", "506, Koramangala 1st block");
  residential.Add("city", "Bengaluru");
  residential.Add("state", "Karnataka");
  residential.Add("postal_code", "560034");
  residential.Add("country", "IN");

  Dictionary<string, object> addresses = new Dictionary<string, object>();
  addresses.Add("residential", residential);
  StakeRequest.Add("addresses", addresses);

  Dictionary<string, object> kyc = new Dictionary<string, object>();
  kyc.Add("pan", "AVOPBXXXXX");

  StakeRequest.Add("kyc", kyc);

  Dictionary<string, object> notes = new Dictionary<string, object>();
  notes.Add("random_key_by_partner", "random_value");

  StakeRequest.Add("notes", notes);

  Stakeholder stakeholder = client.Stakeholder.Create(accountId, StakeRequest);
  ```

  ```ruby Ruby theme={null}
  require "razorpay"
  Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')

  accountId = "acc_GLGeLkU2JUeyDZ"

  Razorpay::Stakeholder.create(accountId, {
    "name": "Gaurav Kumar",
    "email": "gaurav.kumar@example.com",
    "addresses": {
      "residential": {
        "street": "506, Koramangala 1st block",
        "city": "Bengaluru",
        "state": "Karnataka",
        "postal_code": "560034",
        "country": "IN"
      }
    },
    "kyc": {
      "pan": "AVOPBXXXXX"
    },
    "notes": {
      "random_key_by_partner": "random_value"
    }
  })
  ```

  ```javascript Node.js theme={null}
  var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })

  var accountId = "acc_GLGeLkU2JUeyDZ";

  instance.stakeholders.create(accountId, {
    "name": "Gaurav Kumar",
    "email": "gaurav.kumar@example.com",
    "addresses": {
      "residential": {
        "street": "506, Koramangala 1st block",
        "city": "Bengaluru",
        "state": "Karnataka",
        "postal_code": "560034",
        "country": "IN"
      }
    },
    "kyc": {
      "pan": "AVOPBXXXXX"
    },
    "notes": {
      "random_key_by_partner": "random_value"
    }
  });
  ```

  ```go Go theme={null}
  import ( razorpay "github.com/razorpay/razorpay-go" )
  client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")

  accountId := "acc_GLGeLkU2JUeyDZ"

  data := map[string]interface{}{
      "name": "Gaurav Kumar",
      "email": "gaurav.kumar@example.com",
      "addresses": map[string]interface{}{
          "residential": map[string]interface{}{
          "street": "506, Koramangala 1st block",
          "city": "Bengaluru",
          "state": "Karnataka",
          "postal_code": "560034",
          "country": "IN",
          },
      },
      "kyc": map[string]interface{}{
          "pan": "AVOPBXXXXX",
      },
      "notes": map[string]interface{}{
          "random_key_by_partner": "random_value",
      },
  }

  body, err := client.Stakeholder.Create(accountId, data, nil)
  ```

  ```bash CLI theme={null}
  razorpay route accounts stakeholder-create acc_IEIkSOM5VJb2Lm \
    --name "John Doe" \
    --email john@acme.example.com \
    --percentage-ownership 100 \
    --relationship-director \
    --phone-primary 9876543210 \
    --phone-secondary 9123456789 \
    --street "10 Park Ave" \
    --city Mumbai \
    --state Maharashtra \
    --postal-code 400001 \
    --country IN \
    --pan AAAPL1234C \
    --note role=founder
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
     "entity":"stakeholder",
     "relationship":{
        "executive":true
     },
     "phone":{
        "primary":9000090000,
        "secondary":999999991
     },
     "notes":[

     ],
     "kyc":{
        "pan":"CZCPG5228F"
     },
     "id":"sth_GLGgm8fFCKc92m",
     "name":"Gaurav Kumar",
     "email":"gaurav.kumar@example.com",
     "percentage_ownership":10,
     "addresses":{
        "residential":{
           "street":"506, Koramangala 1st block",
           "city":"Bengaluru",
           "state":"Karnataka",
           "postal_code":"560034",
           "country":"IN"
        }
     }
  }
  ```

  ```json Failure theme={null}
  {
     "error":{
        "code":"BAD_REQUEST_ERROR",
        "description":"Linked account does not exist",
        "source":"",
        "step":"",
        "reason":"linked_account_id_does_not_exist",
        "metadata":{

        }
     }
  }
  ```
</ResponseExample>

## Path Parameters

<ParamField path="account_id" type="string">
  The unique identifier of the account generated by Razorpay. For example, acc\_GLGeLkU2JUeyDZ. This id is used to fetch or update a stakeholder.
</ParamField>

## Request Parameters

<ParamField body="name" type="string">
  The stakeholder's name as per the PAN card. The maximum length is 255 characters.<br />
</ParamField>

<ParamField body="email" type="string" required>
  The stakeholder's email address. The maximum length is:

  * local part (before @): 64 characters.
  * domain part (after @): 68 characters. <br /> The total character length supported is 132.
</ParamField>

<ParamField body="percentage_ownership" type="float">
  The stakeholder's ownership of the business in percentage. Only two decimal places are allowed. For example, `87.55`. The maximum length is 100 characters.
</ParamField>

<ParamField body="relationship" type="object">
  The stakeholder's relationship with the account's business.
</ParamField>

<ParamField body="director" type="boolean">
  Determines if stakeholder is a director of the account's legal entity.

  * `true`: Stakeholder is a director.
  * `false` (default): Stakeholder is not a director.
</ParamField>

<ParamField body="executive" type="boolean">
  Determines if the stakeholder is an executive of the account's legal entity.

  * `true`: Stakeholder is an executive.
  * `false` (false): Stakeholder is not an executive.
</ParamField>

<ParamField body="phone" type="object">
  The stakeholder's phone number.
</ParamField>

<ParamField body="primary" type="integer">
  The primary contact number of the stakeholder. The minimum length is 8 characters and the maximum length is 11.
</ParamField>

<ParamField body="secondary" type="integer">
  The secondary contact number of the stakeholder. The minimum length is 8 characters and the maximum length is 11.
</ParamField>

<ParamField body="addresses" type="object">
  Details of stakeholder's address.
</ParamField>

<ParamField body="residential" type="object">
  Details of the stakeholder's residential address.
</ParamField>

<ParamField body="street" type="string">
  The stakeholder's street address. The minimum length is 10 characters and maximum length is 255.
</ParamField>

<ParamField body="city" type="string">
  The city. The minimum length is 2 and maximum length is 32.
</ParamField>

<ParamField body="state" type="string">
  The state. The minimum length is 2 and maximum length is 32.
</ParamField>

<ParamField body="postal_code" type="string">
  The postal code. The minimum length is 2 and maximum length is 10.
</ParamField>

<ParamField body="country" type="string">
  The country. The minimum length is 2 and maximum length is 64. This can either be a country code in capital letters or the full name of the country in lower case letters. For example, for India, you must write either `IN` or `india`.
</ParamField>

<ParamField body="kyc" type="object">
  The type of document required to establish the stakeholder's identity.
</ParamField>

<ParamField body="pan" type="string">
  The PAN number of the stakeholder.

  * This is a 10-digit alphanumeric code. For example, `AVOPBXXXXX`.
  * **Regex for Stakeholder PAN**: `/^[a-zA-z]{5}\d{4}[a-zA-Z]{1}$/`.
  * **Validation for Stakeholder PAN**: The 4th digit should be `P`.
</ParamField>

<ParamField body="notes" type="object">
  Contains user-defined fields stored for reference purposes. Maximum 15 key-value pairs, 512 characters (maximum) each.
</ParamField>

## Response Parameters

<ResponseField name="id" type="string">
  The unique identifier of a stakeholder generated by Razorpay, used to fetch or update a stakeholder. For example, `sth_GLGgm8fFCKc92m`. Maximum length supported is 18 characters.
</ResponseField>

<ResponseField name="entity" type="string">
  Here it is `stakeholder`.
</ResponseField>

<ResponseField name="percentage_ownership" type="float">
  The stakeholder's ownership of the business in percentage. Only two decimal places are allowed. For example, `87.55`. The maximum length is 100 characters.
</ResponseField>

<ResponseField name="name" type="string">
  The stakeholder's name as per the PAN card. The maximum length is 255 characters.<br />
</ResponseField>

<ResponseField name="email" type="string">
  The stakeholder's email address. The maximum length is:

  * local part (before @): 64 characters.
  * domain part (after @): 68 characters.
</ResponseField>

<ResponseField name="relationship" type="object">
  The stakeholder's relationship with the account's business.
</ResponseField>

<ResponseField name="director" type="boolean">
  Determines if stakeholder is a director of the account's legal entity.

  * `true`: Stakeholder is a director.
  * `false` (default): Stakeholder is not a director.
</ResponseField>

<ResponseField name="executive" type="boolean">
  Determines if the stakeholder is an executive of the account's legal entity.

  * `true`: Stakeholder is an executive.
  * `false` (false): Stakeholder is not an executive.
</ResponseField>

<ResponseField name="phone" type="object">
  The stakeholder's phone number.
</ResponseField>

<ResponseField name="primary" type="integer">
  The primary contact number of the stakeholder. The minimum length is 8 characters and the maximum length is 11.
</ResponseField>

<ResponseField name="secondary" type="integer">
  The secondary contact number of the stakeholder. The minimum length is 8 characters and the maximum length is 11.
</ResponseField>

<ResponseField name="addresses" type="object">
  Details of stakeholder's address.
</ResponseField>

<ResponseField name="residential" type="string">
  Details of the stakeholder's residential address.
</ResponseField>

<ResponseField name="street" type="string">
  The stakeholder's street address. The minimum length is 10 characters and maximum length is 255.
</ResponseField>

<ResponseField name="city" type="string">
  The city. The minimum length is 2 and maximum length is 32.
</ResponseField>

<ResponseField name="state" type="string">
  The state. The minimum length is 2 and maximum length is 32.
</ResponseField>

<ResponseField name="postal_code" type="string">
  The postal code. The minimum length is 2 and maximum length is 10.
</ResponseField>

<ResponseField name="country" type="string">
  The country. The minimum length is 2 and maximum length is 64. This can either be a country code in capital letters or the full name of the country in lower case letters. For example, for India, you must write either `IN` or `india`.
</ResponseField>

<ResponseField name="kyc" type="object">
  The type of document required to establish the stakeholder's identity.
</ResponseField>

<ResponseField name="pan" type="string">
  The PAN of the stakeholder.<br />

  * This is a 10-digit alphanumeric code. For example, `AVOPBXXXXX`.
  * **Regex for Stakeholder PAN**: `/^[a-zA-z]{5}\d{4}[a-zA-Z]{1}$/`
  * **Validation for Stakeholder PAN**: The 4th digit should be 'P'.<br />

  <Info>
    **Handy Tip**

    <br />

    To complete the KYC process, this API parameter might be required, but it is optional for this API.
  </Info>
</ResponseField>

<ResponseField name="notes" type="object">
  Contains user-defined fields stored by the partner for reference purposes. It can hold a maximum of 15 key-value pairs, 512 characters (maximum) each. For example, "note\_key": "Beam me up Scotty”.
</ResponseField>

## Errors

<AccordionGroup>
  <Accordion title="Linked account does not exist.">
    **Code:** `400`

    This error occurs when the requester is not the parent of the child account, or the child account does not exist.

    **Solution:** Ensure the Linked Account id exists before proceeding with the update API.
  </Accordion>

  <Accordion title="Stakeholders cannot be more than one for Route product.">
    **Code:** `400`

    This error occurs when you try to create more than one stakeholder for Linked Accounts.

    **Solution:** Route products cannot have more than one stakeholder.
  </Accordion>
</AccordionGroup>
