Skip to content

Latest commit

 

History

History
363 lines (300 loc) · 13 KB

stakeholder.md

File metadata and controls

363 lines (300 loc) · 13 KB

Stakeholders

Create an Stakeholder

String accountId = "acc_GP4lfNA0iIMn5B";

JSONObject StakeRequest = new JSONObject();
StakeRequest.put("email","[email protected]");
StakeRequest.put("percentage_ownership",10);
StakeRequest.put("name","Gaurav Kumar");

JSONObject relationship = new JSONObject();
relationship.put("director",true);
relationship.put("executive",false);

StakeRequest.put("relationship",relationship);

JSONObject phone = new JSONObject();
phone.put("primary","7474747474");
phone.put("secondary","7474747474");

StakeRequest.put("phone",phone);

JSONObject residential = new JSONObject();
residential.put("street","507, Koramangala 6th block");
residential.put("city","Bengaluru");
residential.put("state","Karnataka");
residential.put("postal_code","560047");
residential.put("country","IN");

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


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

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);

Parameters:

Name Type Description
email string The sub-merchant's business email address.
name* string The stakeholder's name as per the PAN card. The maximum length is 255 characters.
percentage_ownership 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.
relationship boolean The stakeholder's relationship with the account’s business.
phone object All keys listed here are supported
addresses object All keys listed here are supported
kyc object All keys listed here are supported
notes object A key-value pair

Response:

{
  "entity": "stakeholder",
  "relationship": {
    "director": true
  },
  "phone": {
    "primary": "7474747474",
    "secondary": "7474747474"
  },
  "notes": {
    "random_key_by_partner": "random_value"
  },
  "kyc": {
    "pan": "AVOPB1111K"
  },
  "id": "sth_GLGgm8fFCKc92m",
  "name": "Gaurav Kumar",
  "email": "[email protected]",
  "percentage_ownership": 10,
  "addresses": {
    "residential": {
      "street": "506, Koramangala 1st block",
      "city": "Bengaluru",
      "state": "Karnataka",
      "postal_code": "560034",
      "country": "IN"
    }
  }
}

Edit Account

String accountId = "acc_GP4lfNA0iIMn5B";

String stakeholderId = "sth_GOQ4Eftlz62TSL";

JSONObject StakeRequest = new JSONObject();
StakeRequest.put("email","[email protected]");
StakeRequest.put("percentage_ownership",10);
StakeRequest.put("name","Gaurav Kumar");

JSONObject relationship = new JSONObject();
relationship.put("director",true);
relationship.put("executive",false);

StakeRequest.put("relationship",relationship);

JSONObject phone = new JSONObject();
phone.put("primary","7474747474");
phone.put("secondary","7474747474");

StakeRequest.put("phone",phone);

JSONObject residential = new JSONObject();
residential.put("street","507, Koramangala 6th block");
residential.put("city","Bengaluru");
residential.put("state","Karnataka");
residential.put("postal_code","560047");
residential.put("country","IN");

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


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

StakeRequest.put("kyc",kyc);

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

StakeRequest.put("notes",notes);

Stakeholder stakeholder = instance.stakeholder.edit(accountId, stakeholderId, StakeRequest);

Parameters:

Name Type Description
accountId* string The unique identifier of a sub-merchant account generated by Razorpay.
stakeholderId* string The unique identifier of the stakeholder whose details are to be fetched.
name string The stakeholder's name as per the PAN card. The maximum length is 255 characters.
percentage_ownership 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.
relationship boolean The stakeholder's relationship with the account’s business.
phone object All keys listed here are supported
addresses object All keys listed here are supported
kyc object All keys listed here are supported
notes object A key-value pair

Response:

{
  "id": "acc_GP4lfNA0iIMn5B",
  "type": "standard",
  "status": "created",
  "email": "[email protected]",
  "profile": {
    "category": "healthcare",
    "subcategory": "clinic",
    "addresses": {
      "registered": {
        "street1": "507, Koramangala 1st block",
        "street2": "MG Road-1",
        "city": "Bengalore",
        "state": "KARNATAKA",
        "postal_code": "560034",
        "country": "IN"
      }
    }
  },
  "notes": [],
  "created_at": 1610603081,
  "phone": "9000090000",
  "reference_id": "randomId",
  "business_type": "partnership",
  "legal_business_name": "Acme Corp",
  "customer_facing_business_name": "ABCD Ltd"
}

Fetch all accounts

String accountId = "acc_GP4lfNA0iIMn5B";

List<Stakeholder> stakeholder = instance.stakeholder.fetchAll(accountId);

Parameters:

Name Type Description
accountId* string The unique identifier of a sub-merchant account generated by Razorpay.

Response:

{
  "entity": "collection",
  "items": [
    {
      "id": "GZ13yPHLJof9IE",
      "entity": "stakeholder",
      "relationship": {
        "director": true
      },
      "phone": {
        "primary": "9000090000",
        "secondary": "9000090000"
      },
      "notes": {
        "random_key_by_partner": "random_value"
      },
      "kyc": {
        "pan": "AVOPB1111K"
      },
      "name": "Gaurav Kumar",
      "email": "[email protected]",
      "percentage_ownership": 10,
      "addresses": {
        "residential": {
          "street": "506, Koramangala 1st block",
          "city": "Bengaluru",
          "state": "Karnataka",
          "postal_code": "560034",
          "country": "in"
        }
      }
    }
  ],
  "count": 1
}

Fetch an stakeholder

String accountId = "acc_GP4lfNA0iIMn5B";

String stakeholderId = "sth_GOQ4Eftlz62TSL";

Stakeholder stakeholder = instance.stakeholder.fetch(accountId, stakeholderId);

Parameters:

Name Type Description
accountId* string The unique identifier of a sub-merchant account generated by Razorpay.
stakeholderId* string The unique identifier of the stakeholder whose details are to be fetched.

Response:

{
  "entity": "stakeholder",
  "relationship": {
    "director": true
  },
  "phone": {
    "primary": "9000090000",
    "secondary": "9000090000"
  },
  "notes": {
    "random_key_by_partner": "random_value2"
  },
  "kyc": {
    "pan": "AVOPB1111J"
  },
  "id": "sth_GOQ4Eftlz62TSL",
  "name": "Gauri Kumar",
  "email": "[email protected]",
  "percentage_ownership": 20,
  "addresses": {
    "residential": {
      "street": "507, Koramangala 1st block",
      "city": "Bangalore",
      "state": "Karnataka",
      "postal_code": "560035",
      "country": "in"
    }
  }
}

Upload stakeholders documents

String accoundId = "acc_LryDIBIjBDbOWy";
String stakeholderId = "sth_M0zjeiVOLRJRPW";

JSONObject request = new JSONObject();
request.put("file","/Users/your_name/Downloads/sample_uploaded.jpeg");
request.put("document_type","aadhar_front");

Stakeholder stakeholder = instance.stakeholder.uploadStakeholderDoc(accoundId, stakeholderId, request);

Parameters:

Name Type Description
accountId* string The unique identifier of a sub-merchant account generated by Razorpay.
stakeholderId* string The unique identifier of the stakeholder whose details are to be fetched.
file* string The URL generated once the business proof document is uploaded.
document_type* string The documents valid for the proof type to be shared. In case of individual_proof_of_address, both the front and back of a document proof must be uploaded. Possible values :
individual_proof_of_identification: personal_pan

individual_proof_of_address : voter_id_back, voter_id_front, aadhar_front, aadhar_back, passport_front, passport_back

Response:

{
  "individual_proof_of_address": [
    {
      "type": "aadhar_front",
      "url": "https://rzp.io/i/bzDAbNg"
    }
  ]
}

Fetch stakeholders documents

String accoundId = "acc_LryDIBIjBDbOWy";
String stakeholderId = "sth_M0zjeiVOLRJRPW";

Stakeholder stakeholder = instance.stakeholder.fetchStakeholderDoc(accoundId, stakeholderId);

Parameters:

Name Type Description
accountId* string The unique identifier of a sub-merchant account generated by Razorpay.
stakeholderId* string The unique identifier of the stakeholder whose details are to be fetched.

Response:

{
  "business_proof_of_identification": [
    {
      "type": "business_proof_url",
      "url": "<https://rzp.io/i/bzDKbNg>"
    }
  ]
}

PN: * indicates mandatory fields

For reference click here