curl https://dev.methodfi.com/elements/token \
  -X POST \
  -H "Method-Version: 2024-04-04" \
  -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "connect",
    "connect": {
      "products": ["balance"],
      "entity": {
        "type": "individual",
        "individual": {
          "first_name": "Kevin",
          "last_name": "Doyle"
        }
      }
    }
  }'
{
  "element_token": "pk_elem_qPmypE9wwphr3WL3yTj7JhxjrPzAmK8G"
}

To start using Connect, you will first need to create a Connect Element Token. There are a few different use cases that will determine what you pass to the endpoint.

New Entities

If you do not have any identity information about your users, you will likely create a token using a payload similar to this:

{
  "type": "connect",
  "connect": {
    "products": ["balance"],
    "entity": {
      "type": "individual",
      "individual": {}
    }
  }
}

This will return a token that you can use to create a new entity and connect their accounts. Fill in the products array with a list of the different products you want to connect (for example ["balance", "card"]).

New Entities with Partial Information

If you have some information already about a given user (such as their name), you can pass that information into the individual object:

{
  "type": "connect",
  "connect": {
    "products": ["balance"],
    "entity": {
      "type": "individual",
      "individual": {
        "first_name": "Kevin",
        "last_name": "Doyle"
      }
    }
  }
}

You can also pass in a user’s phone number, address, DOB, or the last 4 digits of their SSN to make the identity verification process faster.

Using with Existing Entities

You can also pass in an existing entity_id:

{
  "type": "connect",
  "entity_id": "ent_au22b1fbFJbp8",
  "connect": {
    "products": ["balance"]
  }
}

Using with Existing Accounts

If you also have specific accounts you’d like to connect, you can pass the account ids:

{
  "type": "connect",
  "entity_id": "ent_au22b1fbFJbp8",
  "connect": {
    "products": ["balance"],
    "accounts": ["acc_k8LAKDnED7kti", "acc_KUaFnxn7eUAeH"]
  }
}
curl https://dev.methodfi.com/elements/token \
  -X POST \
  -H "Method-Version: 2024-04-04" \
  -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "connect",
    "connect": {
      "products": ["balance"],
      "entity": {
        "type": "individual",
        "individual": {
          "first_name": "Kevin",
          "last_name": "Doyle"
        }
      }
    }
  }'
{
  "element_token": "pk_elem_qPmypE9wwphr3WL3yTj7JhxjrPzAmK8G"
}