Skip to main content
This guide provides a detailed walkthrough on using Straddle’s Bridge API to create paykeys directly from bank account information.

Implementation Steps

Ensure that bank account details such as the account number, routing number, and account holder’s name are collected securely through your frontend. Utilize encryption or tokenization to protect sensitive data.
Once the bank account details are collected, send the information to your backend server over a secure connection (e.g., HTTPS). Your server should handle the data safely and securely for further processing.
On your backend, send a request to the Straddle Bridge API with the bank account details to create a paykey. Straddle will return a paykey that can be used for future transactions without needing to store sensitive bank information.
Store the paykey securely in your system. You can use this paykey to create charges, initiate payments, or perform other transactions via Straddle’s API in the future, without handling sensitive bank data again.

Using Bridge with ‘raw’ bank account details

To create a paykey using bank account details, make a POST request to the Straddle Bridge API. Here’s the HTTP request details:
Bridge a Bank Account
curl -X POST https://api.straddle.com/v1/bridge/bank_account \
  -H "Authorization: Bearer YOUR_STRADDLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "0191ef41-8de5-716c-bfa4-41cd79e85705",
  "routing_number": "011000138",
  "account_number": "123456789",
  "account_type": "checking",
  "metadata": {
    "user_reference": "user_12345"
  }
}
Replace YOUR_STRADDLE_API_KEY with your actual Straddle API key, and fill in the appropriate values for customer_id, routing_number, account_number, and account_type.

Handling the API Response

Upon successful creation of a paykey, the Straddle API will respond with a JSON object. Here’s an example of what you might receive:
{
  "data": {
    "paykey": "05f5d55cb14f7e8a0ec2e5689376e3b4665efc34834d30995babbd5010b39913",
    "bank_data": {
      "routing_number": "011000138",
      "account_number": "******6789",
      "account_type": "checking"
    },
    "id": "0191ef49-892c-7460-99d1-f5589d7d9989",
    "customer_id": "0191ef41-8de5-716c-bfa4-41cd79e85705",
    "label": "BANK OF AMERICA, N.A. - *6789",
    "source": "bank_account",
    "institution_name": "BANK OF AMERICA, N.A.",
    "status": "active",
    "created_at": "2024-09-14T06:47:39.5648743Z",
    "updated_at": "2024-09-14T06:47:39.5648746Z"
  },
  "meta": {
    "api_request_id": "243431dd-7deb-4445-820d-55a942ace70f"
  },
  "response_type": "object"
}
I