## Finding Your Partner Integration in Fountain

Once your Partner account has been set up, tested, and approved on Fountain, your service will be listed in Fountain's partner marketplace and be available to integrate with all Fountain customers. Customers can enable your integration using their account credentials for your service.

Below is a selected list of how partners are shown in the Fountain product. For all available partners on Fountain, view [get.fountain.com/integrations](/content/integrations/index.html).

Our Partner integrations generally use Account ID and/or API Key to connect Fountain with your Partner Service. These credentials are used whenever account-specific settings are needed from your service.

## Setting up Partner Stages

Stages are key parts of the user's Fountain workflow. The Partner Stage is where Fountain directs applicants to your service.

After adding a Partner Stage to the Fountain workflow, it may require additional configuration using Partner Rules and Partner Stage Options.

## Partner Rules

When a user adds a Partner Stage in their Fountain Workflow Editor, they can add rules based on the specific Partner Status or Details associated with your Partner settings. Partner Rules can evaluate and automate actions based on the values you send and associate with an Applicant.

For example, a user could look for a Partner Status with value "Complete" and move the Applicant to the next stage. Or they could look for a Partner Detail labelled "Score" with a value less than 55 and choose to move the Applicant to a rejected stage.

## Partner Stage Options in Fountain

Partner Stage Options are useful if you offer customers multiple services or packages. For example, if your service is to send different loaves of bread to new applicants, a customer might be able to choose between sourdough and marbled rye. In the future, you may expand your services to also send cinnamon rolls.

After you set up a `settings_url` on your Fountain partner account, you should expect the following request from Fountain at that URL:

HTTP

```http
GET "{settings_url}/settings_webhook?account_id=<String>&query_id=<String>"
```

The `account_id` will be the value of the **Client Account ID** configured in the Fountain account's integration settings. The `query_id` is a UUID that ensures the query has a unique signature.

When you receive the above request, Fountain expects you to return the Partner Stage Options formatted as `account_options`.

JSON

```json
{
  "account_options": [
    { "id_1": "Bread: Sourdough" },
    { "id_2": "Bread: Marbled Rye" },
    { "id_3": "Pastry: Cinnamon Roll" },
    { "id_4": "Pastry: Strudel" }
  ]
}
```

The Partner Stage Options returned to Fountain when queried will appear in a drop down menu at the top of the Partner Stage as **Stage Option Types**.

Fountain users can choose one from the available options and when an Applicant lands on the Partner Stage, the selected Partner Stage Option will be added to the Applicant's information.

## Authenticating your Settings Webhook

Fountain can authenticate your `settings_webhook` using either your **API Key** or using **HTTP Basic Auth**.

### Authenticating with your API Key

To setup authentication using your API key, you'll need set values the parameters `settings_auth_method` and `settings_auth_header` in your Partner settings:

1. `settings_auth_method` must equal "auth_header" if you wish to authenticate using your API key.
2. `settings_auth_header` is the name of the authentication header that will be sent with the validation request.

For example, if your `settings_webhook` is `api.partner.com/accounts/:account_id/settings` and `settings_auth_header` is `X-FOUNTAIN-ACCOUNT-KEY`, Fountain will send a `GET` request to this url with the `X-FOUNTAIN-ACCOUNT-KEY` header with the User's partner account API key.

cURL

```curl
curl --request GET \
  --url https://api.partner.com/account/0af0327b-219b-4682-adfc-3e2119f2dae6/settings \
  --header 'x-fountain-account-key: 66690bcb-7acc-4765-9dc2-0b7182f74305'
```

### Authenticating with HTTP Basic Auth

To setup authentication using HTTP Basic Auth, the value of the parameter `settings_auth_method` must equal `basicauth`. If you also provide a `settings_username` and `settings_password`, all requests coming from Fountain will use that username and password. If you do not provide a `settings_username` and `settings_password`, the User will enter their own username and password credentials when configuring the integration.

cURL

```curl
curl --request GET \
  --url https://api.partner.com/account/0af0327b-219b-4682-adfc-3e2119f2dae6/settings \
  -u '<settings_username>'
  # You will be prompted for your password
```
