> ## Documentation Index
> Fetch the complete documentation index at: https://docs.treasuryprime.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Adding Authorized Users

> This guide describes how to add authorized users to existing accounts and issue them debit cards. Authorized users do not require the same amount of KYC as account owners, and as such adding them to accounts requires permission from the bank.

### This guide uses the following endpoints

* [`/apply/additional_person_endpoint`](/reference/additional-person)
* [`/apply/person_application`](/reference/person-application)
* [`/card`](/reference/card)

### To add an authorized user to an account, you must

1. [Create a person application](#1-create-a-person-application)
2. [Use the additional person application flow](#2-create-an-additional-person-application)
3. [Issue the card](#3-issue-the-card)

## 1. Create a Person Application

[`person_application`](/reference/person-application) objects represent natural persons who are applying for new bank accounts or to be added to existing bank accounts. Before you can add a person to an account, you must create a `person_application` to represent them.

To create a `person_application`, make a `POST` request to the `/apply/person_application` endpoint.

<CodeGroup>
  ```bash bash theme={null}
  curl -u $API_KEY_ID:$API_KEY_VALUE https://api.treasuryprime.com/apply/person_application \
      -H 'Content-Type: application/json' \
      -d '{
            "bankdata": {
              "ip_address": "127.0.0.40"
            },
            "citizenship": "US",
            "date_of_birth": "1732-02-22",
            "email_address": "[email protected]",
            "first_name": "George",
            "last_name": "Washington",
            "phone_number": "2025551111",
            "physical_address": {
              "street_line_1": "1600 Pennsylvania Ave",
              "city": "Washington",
              "state": "DC",
              "postal_code": "20500"
            },
            "tin": "111222444"
          }'
  ```
</CodeGroup>

This will return the `person_application` object with a unique `id`:

<CodeGroup>
  ```bash bash theme={null}
  {
    "bankdata": {
      "ip_address": "127.0.0.40"
    },
    "citizenship": "US",
    "created_at": "2019-03-02T11:55:14Z",
    "date_of_birth": "1732-02-22",
    "email_address": "[email protected]",
    "first_name": "George",
    "id": "apsn_01d5w7mvmwvy",
    "last_name": "Washington",
    "middle_name": null,
    "occupation": null,
    "phone_number": "2025551111",
    "physical_address": {
      "street_line_1": "1600 Pennsylvania Ave",
      "street_line_2": null,
      "city": "Washington",
      "state": "DC",
      "country": "US",
      "postal_code": "20500"
    },
    "updated_at": "2019-03-02T11:55:14Z",
    "userdata": null
  }
  ```
</CodeGroup>

The id for `person application` is prefixed with `apsn_`, which aids in distinguishing them from the `person` objects created at the end of the application process.

## 2. Create an Additional Person Application

Once the `person_application` representing the authorized user you wish to add to an account has been created, you can add them to the account by making a request to the [`additional_person_application`](/reference/additional-person) endpoint:

<CodeGroup>
  ```bash bash theme={null}
  curl -u $API_KEY_ID:$API_KEY_VALUE https://api.treasuryprime.com/apply/additional_person_application \
      -H 'Content-Type: application/json' \
      -d '{
            "bankdata": {
              "ip_address": "127.0.0.40"
            },
            "account_id": "acct_1029384756",
            "person_application_id: "apsn_01d5w7mvmwvy",
            "role": "authorized_user"
          }'
  ```
</CodeGroup>

This will start an `additional_person_application` to add the supplied `person_application` to the specified `account`, with the given role. The response will look like this:

<CodeGroup>
  ```bash bash theme={null}
  {
    "account_id": "acct_1029384756",
    "bankdata": {
      "ip_address": "127.0.0.40"
    },
    "created_at": "2019-03-02T11:55:14Z",
    "id": "aapa_01d5w7mvmwvy",
    "person_application_id": "apsn_01d5w7mvmwvy",
    "role": "authorized_user",
    "status": "pending",
    "updated_at": "2019-03-02T11:55:14Z",
    "userdata": null
  }
  ```
</CodeGroup>

The `status` of the application will begin in `pending` and end in `approved`; once the application is approved, you can issue a card to the new user.

## 3. Issue the Card

Once the `additional_person_application` has been approved, you can fetch the `person_application` attached to it and look up the `person` created and linked to the account:

<CodeGroup>
  ```bash bash theme={null}
  curl -u $API_KEY_ID:$API_KEY_VALUE https://api.treasuryprime.com/apply/person_application/apsn_01d5w7mvmwvy
  ```
</CodeGroup>

<CodeGroup>
  ```bash bash theme={null}
  {
    "first_name": "George",
    "secondary_email_address": null,
    "bankdata": {
      "ip_address": "127.0.0.40"
    },
    "phone_number": "+1 202-555-1111",
    "mailing_address": null,
    "occupation": null,
    "physical_address": {
      "street_line_1": "1600 Pennsylvania Ave",
      "street_line_2": null,
      "city": "Washington",
      "state": "DC",
      "postal_code": "20500",
      "country": "US"
    },
    "person_id": "psn_11gqnx6f69zv0g",
    "middle_name": null,
    "updated_at": "2021-10-28T19:06:55Z",
    "gov_id": null,
    "document_ids": [],
    "id": "apsn_11gqkcek69rv55",
    "citizenship": "US",
    "date_of_birth": "1991-02-22",
    "last_name": "Washington",
    "user_id": null,
    "email_address": "[email protected]",
    "created_at": "2021-10-27T20:08:51Z",
    "userdata": null
  }
  ```
</CodeGroup>

The `person_id` attribute of the `person_application` object is what is required to create a card; it is prefixed with `psn`.

Once you have the id of the person you wish to issue a card to, you can make a call to issue them a card in the [normal way](/reference/card):

<CodeGroup>
  ```bash bash theme={null}
    curl -u $API_KEY_ID:$API_KEY_VALUE https://api.treasuryprime.com/card \
      -H 'Content-Type: application/json' \
      -d '{
            "account_id": "acct_1029384756",
            "person_id": "psn_11gqnx6f69zv0g5",
            "card_product_id": "cdpt_w10r2sebv0nl"
          }'
  ```
</CodeGroup>

This will return a card object:

<CodeGroup>
  ```bash bash theme={null}
  {
    "account_id": "acct_1029384756",
    "card_controls": null,
    "card_product_id": "cdpt_w10r2sebv0nl",
    "cvv": null,
    "created_at": "2021-02-19T20:42:40Z",
    "expiration": "0225",
    "fulfillment": {
      "status": "issued"
    },
    "id": "card_zuhqnmz7e085",
    "last4": "3385",
    "pan": null,
    "person_id": "psn_11gqnx6f69zv0g5",
    "pin_is_set": false,
    "status": "unactivated",
    "updated_at": "2021-02-19T20:42:41Z",
    "userdata": null
  }
  ```
</CodeGroup>
