Skip to content

Plaid Integration

PayStream integrates with Plaid for instant bank account verification, eliminating the need for micro-deposit verification.

Benefits

FeatureWith PlaidWithout Plaid
Verification TimeInstant (seconds)1-3 business days
User ExperienceFamiliar Plaid UIManual entry
PCI ScopeReducedHigher

Setup

1. Get Plaid Credentials

  1. Sign up at plaid.com
  2. Create a sandbox application
  3. Copy your client_id and secret

2. Configure PayStream

Add Plaid credentials to your environment:

bash
PLAID_CLIENT_ID=your_client_id
PLAID_SECRET=your_secret
PLAID_ENV=sandbox
bash
curl -X POST https://api.paystream.fi/api/v1/plaid/link-token \
  -H "Authorization: Bearer psk_test_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "purpose": "payment_method",
    "recipientId": "rec_abc123"
  }'

Response:

json
{
  "data": {
    "linkToken": "link-sandbox-xxxxxx",
    "expiration": "2026-02-19T01:00:00Z"
  }
}

Frontend Integration

Initialize Plaid Link in your frontend:

javascript
const linkHandler = Plaid.create({
  token: linkToken,
  onSuccess: (publicToken, metadata) => {
    // Send publicToken to your backend
    exchangeToken(publicToken, metadata.account_id);
  },
  onExit: (err, metadata) => {
    console.log('User exited Plaid Link');
  }
});

linkHandler.open();

Exchange Token

Exchange the public token for a processor token:

bash
curl -X POST https://api.paystream.fi/api/v1/plaid/exchange-token \
  -H "Authorization: Bearer psk_test_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "publicToken": "public-sandbox-xxxxxx",
    "accountId": "account-sandbox-xxxxxx"
  }'

Response:

json
{
  "data": {
    "processorToken": "processor-sandbox-xxxxxx",
    "accountId": "account-sandbox-xxxxxx"
  }
}

Create Payment Method

Use the processor token to create a verified payment method:

bash
curl -X POST https://api.paystream.fi/api/v1/recipients/rec_abc123/payment-methods \
  -H "Authorization: Bearer psk_test_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "plaidProcessorToken": "processor-sandbox-xxxxxx",
    "plaidAccountId": "account-sandbox-xxxxxx",
    "accountHolderName": "John Driver"
  }'

Test Credentials

Use these Plaid sandbox credentials for testing:

ItemUsernamePassword
Standarduser_goodpass_good
MFA Requireduser_goodpass_good (then 1234)

Webhooks

Plaid sends webhooks for account updates:

EventDescription
Item errorAccount connection issue
Account balance updatedBalance refresh complete

Configure Plaid webhooks to point to:

https://api.paystream.fi/webhooks/plaid

Released under the MIT License.