POST
/
elements
/
token
curl https://production.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"
}

Element tokens are used as the starting point and authentication key to instantiate Method’s embeddable UI components within your experience.

For security purposes, element tokens are for one-time use only, and expire after 30 minutes.

Body

The structure of the request body differs slightly depending on the type of Element you are trying to use. See the Elements Guide for more information about specific flows.

type
enum
required

The name of the element type you want to generate the token for. One of connect or balance_transfer

entity_id
string

An existing entity id that the Element session will initiate for.

connect
object

Information needed if creating a Connect Element token.

balance_transfer
object

Information needed if creating a Balance Transfer Element token.

Returns

The element token that was created.

curl https://production.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"
}