# Create Individual

- Sandbox: `POST https://sandbox.payme.io/api/sellers/{mpl_key}/individuals`
- Production: `POST https://live.payme.io/api/sellers/{mpl_key}/individuals`

## Credentials

- Header `PayMe-Signature` (optional): Example: sk_test_individual_123123213123
- Header `PayMe-Merchant-Key` (optional): Example: MPL123-123-123

## Overview

Using this method, you will be able to create a new individual under your company.

When creating an individual, you will need to set it's roles based on the following list:

Role | Enum 
-- | --
Owner | 1 
Signatory | 2
Director | 4 
Executive | 8
Back Office | 16

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `PayMe-Signature` | header | string | no | Example: sk_test_individual_123123213123 |
| `PayMe-Merchant-Key` | header | string | no | Example: MPL123-123-123 |
| `mpl_key` | path | string | yes |  |

## Request body

Content type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `first_name` | string | no | Individual's first name in the company's local language. |
| `first_name_en` | string | no | Individual's first name in English. |
| `last_name` | string | no | Individual's last name in the company's local language. |
| `last_name_en` | string | no | Individual's last name in english. |
| `national_id` | string | no | Individual's national ID. |
| `social_id` | string | no | Individual's national ID (Will be deprecated). |
| `social_id_issued` | string | no | Individual's Social ID issuing date. |
| `social_id_country` | string | no | Individual's Social ID issuing country. |
| `birthdate` | string | no | The birthdate of the individual. |
| `gender` | string | no | The gender of the individual. |
| `email` | string | no | The email address of the individual. Must be in an email address format. |
| `phone` | string | no | The phone number of the individual. |
| `bank` | string | no | The bank code of the invdividual. |
| `bank_account` | string | no | The bank account number of the invdividual. |
| `bank_account_branch` | string | no | The bank account branch of the invdividual. |
| `bank_account_number_foreign` | string | no | The foreign bank account number of the individual. |
| `bank_routing_number_foreign` | string | no | The foreign bank account routing number of the individual. |
| `iban` | string | no | The individual's bank account IBAN. |
| `is_active` | boolean | no | The indicator whether the individual is a part of the company or not. |
| `block_reason` | string | no | The block reason of the individual from accessing PayMe's platform and data. |
| `account_status` | string | no | The individual's account status. |
| `address_street` | string | no | The street address of the individual. |
| `address_street_intl` | string | no | The international street address of the individual. |
| `address_street_number` | string | no | The street address number of the individual. |
| `address_zip` | string | no | The street address ZIP code of the individual. |
| `address_city` | string | no | The street address city of the individual. |
| `address_city_intl` | string | no | The international street address city of the individual. |
| `address_country` | string | no | The street address country of the individual. |
| `address_state` | string | no | The street address state of the individual. |
| `additional_data` | string | no | Any additional data that needs to be stored under the individual in a JSON format. |
| `role` | array | no | 1 => "Owner", 2 => "Signatory", 4 => "Director", 8 => "Executive", 16 => "Back Office", |
| `is_primary` | boolean | no | Setting the primary flag under the company whether the individual is the primary of the company. |
| `ownership_percentage` | string | no | Example: "20.5" |
| `business_title` | string | no | The business title of the individual. |

### Request example

```json
{
  "individual_first_name": "John",
  "individual_first_name_en": "John",
  "individual_last_name": "Doe",
  "individual_last_name_en": "Doe",
  "individual_national_id": "1234567890",
  "individual_social_id": "987654321",
  "individual_social_id_issued": "2022-01-01",
  "individual_social_id_country": "US",
  "individual_birthdate": "1990-01-01",
  "individual_gender": "Male",
  "individual_email": "johndoe@example.com",
  "individual_phone": "1234567890",
  "individual_bank": "PayMe Bank",
  "individual_bank_account": "9876543210",
  "individual_bank_account_branch": "Main Branch",
  "individual_bank_account_number_foreign": "1234567890",
  "individual_bank_routing_number_foreign": "ABCDEFG12345",
  "individual_iban": "US00 ABCD 1234 5678 90",
  "individual_is_active": true,
  "individual_block_reason": "No reason",
  "individual_account_status": "Active",
  "individual_address_street": "123 PayMe St.",
  "individual_address_street_intl": "123 PayMe St.",
  "individual_address_street_number": "123",
  "individual_address_zip": "12345",
  "individual_address_city": "PayMe City",
  "individual_address_city_intl": "PayMe City",
  "individual_address_country": "US",
  "individual_address_state": "PayMe State",
  "individual_additional_data": "Additional data here"
}
```

## Code samples

### curl

```bash
curl -X POST 'https://sandbox.payme.io/api/sellers/<mpl_key>/individuals' \
  -H 'Content-Type: application/json' \
  -H 'PayMe-Signature: <PayMe-Signature>' \
  -H 'PayMe-Merchant-Key: <PayMe-Merchant-Key>' \
  --data-raw '{
  "individual_first_name": "John",
  "individual_first_name_en": "John",
  "individual_last_name": "Doe",
  "individual_last_name_en": "Doe",
  "individual_national_id": "1234567890",
  "individual_social_id": "987654321",
  "individual_social_id_issued": "2022-01-01",
  "individual_social_id_country": "US",
  "individual_birthdate": "1990-01-01",
  "individual_gender": "Male",
  "individual_email": "johndoe@example.com",
  "individual_phone": "1234567890",
  "individual_bank": "PayMe Bank",
  "individual_bank_account": "9876543210",
  "individual_bank_account_branch": "Main Branch",
  "individual_bank_account_number_foreign": "1234567890",
  "individual_bank_routing_number_foreign": "ABCDEFG12345",
  "individual_iban": "US00 ABCD 1234 5678 90",
  "individual_is_active": true,
  "individual_block_reason": "No reason",
  "individual_account_status": "Active",
  "individual_address_street": "123 PayMe St.",
  "individual_address_street_intl": "123 PayMe St.",
  "individual_address_street_number": "123",
  "individual_address_zip": "12345",
  "individual_address_city": "PayMe City",
  "individual_address_city_intl": "PayMe City",
  "individual_address_country": "US",
  "individual_address_state": "PayMe State",
  "individual_additional_data": "Additional data here"
}'
```

### Node.js

```javascript
const response = await fetch("https://sandbox.payme.io/api/sellers/<mpl_key>/individuals", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "PayMe-Signature": "<PayMe-Signature>",
    "PayMe-Merchant-Key": "<PayMe-Merchant-Key>",
  },
  body: JSON.stringify({
    "individual_first_name": "John",
    "individual_first_name_en": "John",
    "individual_last_name": "Doe",
    "individual_last_name_en": "Doe",
    "individual_national_id": "1234567890",
    "individual_social_id": "987654321",
    "individual_social_id_issued": "2022-01-01",
    "individual_social_id_country": "US",
    "individual_birthdate": "1990-01-01",
    "individual_gender": "Male",
    "individual_email": "johndoe@example.com",
    "individual_phone": "1234567890",
    "individual_bank": "PayMe Bank",
    "individual_bank_account": "9876543210",
    "individual_bank_account_branch": "Main Branch",
    "individual_bank_account_number_foreign": "1234567890",
    "individual_bank_routing_number_foreign": "ABCDEFG12345",
    "individual_iban": "US00 ABCD 1234 5678 90",
    "individual_is_active": true,
    "individual_block_reason": "No reason",
    "individual_account_status": "Active",
    "individual_address_street": "123 PayMe St.",
    "individual_address_street_intl": "123 PayMe St.",
    "individual_address_street_number": "123",
    "individual_address_zip": "12345",
    "individual_address_city": "PayMe City",
    "individual_address_city_intl": "PayMe City",
    "individual_address_country": "US",
    "individual_address_state": "PayMe State",
    "individual_additional_data": "Additional data here"
  }),
});

console.log(await response.text());
```

### Python

```python
import requests

response = requests.post(
    "https://sandbox.payme.io/api/sellers/<mpl_key>/individuals",
    headers={
        "PayMe-Signature": "<PayMe-Signature>",
        "PayMe-Merchant-Key": "<PayMe-Merchant-Key>",
    },
    json={
        "individual_first_name": "John",
        "individual_first_name_en": "John",
        "individual_last_name": "Doe",
        "individual_last_name_en": "Doe",
        "individual_national_id": "1234567890",
        "individual_social_id": "987654321",
        "individual_social_id_issued": "2022-01-01",
        "individual_social_id_country": "US",
        "individual_birthdate": "1990-01-01",
        "individual_gender": "Male",
        "individual_email": "johndoe@example.com",
        "individual_phone": "1234567890",
        "individual_bank": "PayMe Bank",
        "individual_bank_account": "9876543210",
        "individual_bank_account_branch": "Main Branch",
        "individual_bank_account_number_foreign": "1234567890",
        "individual_bank_routing_number_foreign": "ABCDEFG12345",
        "individual_iban": "US00 ABCD 1234 5678 90",
        "individual_is_active": True,
        "individual_block_reason": "No reason",
        "individual_account_status": "Active",
        "individual_address_street": "123 PayMe St.",
        "individual_address_street_intl": "123 PayMe St.",
        "individual_address_street_number": "123",
        "individual_address_zip": "12345",
        "individual_address_city": "PayMe City",
        "individual_address_city_intl": "PayMe City",
        "individual_address_country": "US",
        "individual_address_state": "PayMe State",
        "individual_additional_data": "Additional data here",
    },
)

print(response.text)
```

### PHP

```php
<?php

$body = <<<'BODY'
{
  "individual_first_name": "John",
  "individual_first_name_en": "John",
  "individual_last_name": "Doe",
  "individual_last_name_en": "Doe",
  "individual_national_id": "1234567890",
  "individual_social_id": "987654321",
  "individual_social_id_issued": "2022-01-01",
  "individual_social_id_country": "US",
  "individual_birthdate": "1990-01-01",
  "individual_gender": "Male",
  "individual_email": "johndoe@example.com",
  "individual_phone": "1234567890",
  "individual_bank": "PayMe Bank",
  "individual_bank_account": "9876543210",
  "individual_bank_account_branch": "Main Branch",
  "individual_bank_account_number_foreign": "1234567890",
  "individual_bank_routing_number_foreign": "ABCDEFG12345",
  "individual_iban": "US00 ABCD 1234 5678 90",
  "individual_is_active": true,
  "individual_block_reason": "No reason",
  "individual_account_status": "Active",
  "individual_address_street": "123 PayMe St.",
  "individual_address_street_intl": "123 PayMe St.",
  "individual_address_street_number": "123",
  "individual_address_zip": "12345",
  "individual_address_city": "PayMe City",
  "individual_address_city_intl": "PayMe City",
  "individual_address_country": "US",
  "individual_address_state": "PayMe State",
  "individual_additional_data": "Additional data here"
}
BODY;

$ch = curl_init('https://sandbox.payme.io/api/sellers/<mpl_key>/individuals');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'PayMe-Signature: <PayMe-Signature>',
        'PayMe-Merchant-Key: <PayMe-Merchant-Key>',
    ],
    CURLOPT_POSTFIELDS => $body,
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
```

## Responses

### 200 — OK (success)
