# Retrieve profile extension requirements (deprecated)

{% admonition type="warning" %}
This endpoint is deprecated. Please check the Additional Verification endpoints for providing additional verification details for a profile.
{% /admonition %}

After having a profile created, in some situations we can need more specific information about it. In order to know which fields are required for a given profile, and to send the information over, we expose a few endpoints:

- GET /v1/profiles/{profileId}/extension-requirements
- POST /v1/profiles/{profileId}/extension-requirements

and

- POST /v1/profiles/{profileId}/extensions
- GET /v1/profiles/{profileId}/extensions

The GET and POST profile extension-requirements endpoints help you to figure out which fields are required to create a valid profile for different regions. You can use this data to build a dynamic user interface on top of these endpoints.

The POST and GET profile extensions endpoints allow you to send the extra profile information and retrieve it, respectively.

This format for dynamic forms is the same as the one used for recipient creation. See Recipient Requirements.

Using profile extension requirements {% .title-4 .m-t-3 %}

1. First create a profile. See Create Personal Profile and Create Business Profile.
2. Call GET /v1/profiles/{profileId}/extension-requirements to get the list of fields you need to fill with values in the "details" section for adding information that will make a profile valid.
3. Some fields require multiple levels of fields in the details request. This should be handled by the client based on the refreshRequirementsOnChange field. A top level field can have this field set to true, indicating that there are additional fields required depending on the selected value. To manage this you should create a request with all of the initially requested data and call the POST extension-requirements endpoint. You will be returned a response similar the previously returned data from GET extension-requirements but with additional fields.
4. Once you have built your full profile extension details object you can add it to add information to the profile.

Building a user interface {% .title-4 .m-t-3 %}

When requesting the form data from the extension-requirements endpoint, the response defines different types of extensions that can be added. Each extension type then has multiple fields describing the form elements required to be shown to collect information from the user. Each field will have a type value, these tell you the field type that your front end needs to render to be able to collect the data. A number of field types are permitted, these are:

| type   | UI element                        |
|--------|-----------------------------------|
| text   | A free text box                   |
| select | A selection box/dialog            |
| radio  | A radio button choice between options |
| date   | A text box with a date picker     |

Example data is also included in each field which should be shown to the user, along with a regex or min and max length constraints that should be applied as field level validations. You can optionally implement the dynamic validation using the validationAsync field, however these checks will also be done when a completed profile extension is submitted to POST /v1/profiles/{profileId}/extensions.

Endpoint: GET /v1/profiles/{profileId}/extension-requirements
Security: UserToken

## Path parameters:

  - `profileId` (integer, required)
    Profile ID.

## Response 200 fields (application/json):

  - `type` (string)
    "profile-extensions-requirements"
    Example: "profile-extensions-requirements"

  - `usageInfo` (string,null)

  - `fields` (array)

  - `fields.name` (string)
    Field description.

  - `fields.group` (array)

  - `fields.group.key` (string)
    Key is name of the field you should include in the JSON.

  - `fields.group.name` (string)
    Display name.

  - `fields.group.type` (string)
    Display type of field (e.g. text, select, etc).

  - `fields.group.refreshRequirementsOnChange` (boolean)
    Tells you whether you should call POST extension-requirements once the field value is set to discover required lower level fields.

  - `fields.group.required` (boolean)
    Indicates if the field is mandatory or not.

  - `fields.group.displayFormat` (string,null)
    Display format pattern.

  - `fields.group.example` (string,null)
    Example value.

  - `fields.group.minLength` (integer,null)
    Min valid length of field value.

  - `fields.group.maxLength` (integer,null)
    Max valid length of field value.

  - `fields.group.validationRegexp` (string,null)
    Regexp validation pattern.

  - `fields.group.validationAsync` (string,null)
    Deprecated. This validation will instead be performed when submitting the request.

  - `fields.group.valuesAllowed` (array,null)

  - `fields.group.valuesAllowed.key` (string)
    Value key.

  - `fields.group.valuesAllowed.name` (string)
    Value name.


