Integrating Plaid with Straddle to create paykeys for account-to-account payments
1. Set up Plaid Link for user bank account connection
2. Obtain an access token from Plaid
3. Use the access token to get a Straddle processor token from Plaid
4. Use the Straddle processor token to create a paykey via Straddle's Bridge API
paykey
which is linked to the user’s bank account, allowing future transactions to be processed.5. Store and use the paykey for future transactions
paykey
securely in your system. Use this paykey
to create charges, initiate payments, or perform other transactions via Straddle’s API in the future.link_token
link_token
. A link_token
is a short-lived, one-time use token that is used to authenticate your app with Link. To create one, make a /link/token/create
request with your client_id
, secret
, and a few other required parameters from your app server. View the /link/token/create
documentation for a full list of link_token
configurations.
To see your client_id
and secret
, visit the Plaid Dashboard.
link_token
, all it takes is a few lines of client-side JavaScript to launch Link. Then, in the onSuccess
callback, you can call a simple server-side handler to exchange the Link public_token
for a Plaid access_token
and a Straddle processor_token
.
'straddle'
is the specific processor you’re requesting the token for. This tells Plaid to generate a token compatible with Straddle’s systems.
YOUR_STRADDLE_API_KEY
with your actual Straddle API key, and fill in the appropriate values for customer_id
and plaid_token
. The metadata
field is optional but can be useful for storing additional information related to the Plaid account.
source
field is set to “plaid” in this case, indicating that the paykey was created using a Plaid token.
You should store this paykey securely for future use in transactions.