# Create Bank Account (Plaid)

<table data-header-hidden><thead><tr><th width="74.8046875" align="center"></th><th></th></tr></thead><tbody><tr><td align="center"><mark style="color:blue;"><strong>POST</strong></mark> </td><td>https://api.sfox.com/v1/bank-accounts/plaid-processors</td></tr></tbody></table>

Link and verify an end user's bank account via Plaid processor token(s).

***

sFOX and Plaid have partnered to enable end users to instantly link and verify a bank account. sFOX will use the Plaid `processor_token` provided to securely retrieve bank account details from Plaid and enable ACH transfers.

## Request

{% hint style="info" %}

* Requires a [User Auth Token](/connect/rest-api/end-users/create-user-auth-token.md) for authentication. Requests attempted using an Connect API Key will result in an error.
* There is a limit of one linked bank account per sFOX account. If you would like to link a different bank account, you must first [disconnect the currently linked bank](/connect/rest-api/payments/delete-bank-account.md).
  {% endhint %}

### Body Parameters

<table><thead><tr><th width="202.58203125">Name</th><th width="105">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>data</code></strong> <mark style="color:red;">required</mark></td><td>[object]</td><td>The Plaid <code>processor_token</code>s and associated processors</td></tr><tr><td>    <strong><code>processor</code></strong> <mark style="color:red;">required</mark></td><td>string</td><td>The processor associated with this <code>token</code>.<br><br><em>Possible values: <code>sfox</code>, <code>dwolla</code></em></td></tr><tr><td>    <strong><code>token</code></strong> <mark style="color:red;">required</mark></td><td>string</td><td>The <code>processor_token</code> retrieved from Plaid.</td></tr></tbody></table>

### Example Requests

{% tabs %}
{% tab title="Shell" %}

```shell
#sFOX & Dwolla p-token: Link bank account and enable ACH transfers
curl -X POST 'https://api.sfox.com/v1/bank-accounts/plaid-processors' \
  -H 'Content-type: application/json' \
  -H "Authorization: Bearer ${USER_AUTH_TOKEN}" \
  -d '{ 
      "data": [
        {
          "processor": "sfox",
          "token": "${SFOX_PLAID_PROCESSOR_TOKEN}"
        },
        {
          "processor": "dwolla",
          "token": "${DWOLLA_PLAID_PROCESSOR_TOKEN}"
        }
      ]
   }'

#sFOX p-token only: Links bank account, does not enable ACH transfers
curl -X POST 'https://api.sfox.com/v1/bank-accounts/plaid-processors' \
  -H 'Content-type: application/json' \
  -H "Authorization: Bearer ${USER_AUTH_TOKEN}" \
  -d '{ 
      "data": [{
        "processor": "sfox",
        "token": "${SFOX_PLAID_PROCESSOR_TOKEN}"
      }]
   }'
```

{% endtab %}

{% tab title="NodeJS" %}
{% code overflow="wrap" %}

```javascript
//sFOX & Dwolla p-token: Link bank account and enable ACH transfers
const axios = require('axios');

const payload = JSON.stringify({
    "data": [
      {
        "processor": "sfox",
        "token": "${SFOX_PLAID_PROCESSOR_TOKEN}"
      },
      {
        "processor": "dwolla",
        "token": "${DWOLLA_PLAID_PROCESSOR_TOKEN}"
      }
    ]
})

const config = {
  method: 'post',
  url: 'https://api.sfox.com/v1/bank-accounts/plaid-processors',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${process.env.USER_AUTH_TOKEN}`
  },
  data: data
}

axios(config)
  .then(response => {
    console.log(response.status)
    console.log(response.data)
  }).catch(err => {
    console.error(err.response.status)
    console.error(err.response.data)
  });


  
//sFOX p-token only: Links bank account, does not enable ACH transfers
const axios = require('axios');

const payload = JSON.stringify({
    "data": [
      {
        "processor": "sfox",
        "token": "${SFOX_PLAID_PROCESSOR_TOKEN}"
      }
    ]
})

const config = {
  method: 'post',
  url: 'https://api.sfox.com/v1/bank-accounts/plaid-processors',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${process.env.USER_AUTH_TOKEN}`
  },
  data: data
}

axios(config)
  .then(response => {
    console.log(response.status)
    console.log(response.data)
  }).catch(err => {
    console.error(err.response.status)
    console.error(err.response.data)
  });
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}

```python
#sFOX & Dwolla p-token: Link bank account and enable ACH transfers
import requests
import os

data = requests.post(
  "https://api.sfox.com/v1/bank-accounts/plaid-processors",
  headers={
    "Authorization": f"Bearer {os.environ['USER_AUTH_TOKEN']}"
  },
  json={
    "data": [
      {
        "processor": "sfox",
        "token": "SFOX_PLAID_PROCESSOR_TOKEN"
      },
      {
        "processor": "dwolla",
        "token": "DWOLLA_PLAID_PROCESSOR_TOKEN"
      }      
    ]
  }
)
print(data.status_code)
print(data.json())



#sFOX p-token only: Links bank account, does not enable ACH transfers
import requests
import os

data = requests.post(
  "https://api.sfox.com/v1/bank-accounts/plaid-processors",
  headers={
    "Authorization": f"Bearer {os.environ['USER_AUTH_TOKEN']}"
  },
  json={
    "data": [
      {
        "processor": "sfox",
        "token": "PLAID_PROCESSOR_TOKEN"
      }
    ]
  }
)
print(data.status_code)
print(data.json())
```

{% endtab %}
{% endtabs %}

## Response

### Response Body

<table><thead><tr><th width="191.47265625">Name</th><th width="105">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>data</code></strong></td><td>[object]</td><td>The Plaid <code>processor_token</code>s and associated processors</td></tr><tr><td>    <strong><code>processor</code></strong></td><td>string</td><td>The processor associated with the token that was processed.<br><br><em>Possible values: <code>sfox</code>, <code>dwolla</code></em></td></tr><tr><td>    <strong><code>status</code></strong></td><td>string</td><td>The status of processing the token.</td></tr><tr><td>    <strong><code>bank_account_id</code></strong></td><td>string</td><td>The ID of the associated bank account. (<code>id</code> from <a href="/pages/gzqSghpKFdTw4CfFMXGw">Get Bank Account</a>)</td></tr><tr><td>    <strong><code>date_added</code></strong></td><td>string</td><td>Date-time the token was added.</td></tr><tr><td>    <strong><code>date_updated</code></strong></td><td>string</td><td>Date-time the token was last updated.</td></tr></tbody></table>

### Responses

<details>

<summary><mark style="color:green;">201</mark>: Created</summary>

sFOX and Dwolla p-tokens processed successfully

{% code overflow="wrap" %}

```json
{
    "data": [
        {
            "processor": "sfox",
            "status": "created",
            "bank_account_id": "05a59670-e7c2-4611-a356-d20cae93e939",
            "date_added": "2025-05-14T01:55:35.664Z",
            "date_updated": "2025-05-14T01:55:35.664Z"
        },
        {
            "processor": "dwolla",
            "status": "created",
            "bank_account_id": "05a59670-e7c2-4611-a356-d20cae93e939",
            "date_added": "2025-05-14T01:55:38.786Z",
            "date_updated": "2025-05-14T01:55:38.786Z"
        }
    ]
}
```

{% endcode %}

sFOX p-token successfully processed

{% code overflow="wrap" %}

```json
{
    "data": [
        {
            "processor": "sfox",
            "status": "created",
            "bank_account_id": "05a59670-e7c2-4611-a356-d20cae93e939",
            "date_added": "2025-05-14T01:55:35.664Z",
            "date_updated": "2025-05-14T01:55:35.664Z"
        }
    ]
}
```

{% endcode %}

</details>

<details>

<summary><mark style="color:red;">422</mark>: Unprocessable Entity</summary>

Active bank account is linked to this end user's account. To link a new bank account, [remove the current bank account](/connect/rest-api/payments/delete-bank-account.md) and try again.

{% code overflow="wrap" %}

```json
{
    "error": "could not process your sfox processor token: This account already has a bank account linked to it that is active"
}
```

{% endcode %}

sFOX p-token not included in a request with a Dwolla p-token.

{% code overflow="wrap" %}

```json
{
    "error": "At least one sfox processor token is required if a dwolla processor token is given"
}
```

{% endcode %}

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sfox.com/connect/rest-api/payments/create-bank-account-plaid.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
