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

Implementation Steps

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.io/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"
}