> ## Documentation Index
> Fetch the complete documentation index at: https://docs.straddle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create paykeys from Quiltt tokens

> Exchange Quiltt processor tokens for Straddle paykeys to enable verified ACH charges and payouts for customers connected through the Quiltt platform.

## Prerequisites

Before you begin, ensure you have:

* A Straddle account with API access
* A Quiltt account with processor token capabilities
* Quiltt Connector configured with `ACCOUNT_NUMBERS` and `ACCOUNT_BALANCE_REFRESHES` features

<Note>
  For a complete integration guide including Quiltt Connector setup, see our [detailed Quiltt integration guide](/integrations/open-banking/quiltt).
</Note>

## Quick Start

Follow these steps to create a paykey from a Quiltt processor token.

### Step 1: Obtain a Quiltt Processor Token

After your user connects their bank account through Quiltt Connector, create a processor token:

```bash theme={null}
curl https://api.quiltt.io/v1/accounts/{accountId}/processor_tokens \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {QUILTT_API_KEY}' \
  --data '{
    "processor": "STRADDLE", 
    "issuer": "QUILTT"
  }'
```

### Step 2: Create a Paykey via Bridge API

Use the processor token to create a paykey:

```bash theme={null}
curl -X POST https://api.straddle.com/v1/bridge/quiltt \
  -H "Authorization: Bearer YOUR_STRADDLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "0191ef41-8de5-716c-bfa4-41cd79e85705",
    "quiltt_token": "processor-sandbox-123abc...",
    "metadata": {
      "nickname": "My Bank Account"
    }
  }'
```

### Step 3: Handle the Response

A successful response returns the paykey and associated bank data:

```json theme={null}
{
  "data": {
    "paykey": "05f5d55cb14f7e8a0ec2e5689376e3b4665efc34834d30995babbd5010b39913",
    "bank_data": {
      "routing_number": "011000138",
      "account_number": "******7890",
      "account_type": "checking"
    },
    "id": "0191ef49-892c-7460-99d1-f5589d7d9989",
    "customer_id": "0191ef41-8de5-716c-bfa4-41cd79e85705",
    "label": "CHASE BANK - *7890",
    "source": "quiltt",
    "institution_name": "CHASE BANK",
    "status": "active",
    "created_at": "2024-09-14T06:47:39.5648743Z",
    "updated_at": "2024-09-14T06:47:39.5648746Z",
    "metadata": {
      "quiltt_connection_id": "conn_5f7a8b9c0d1e2f3g4h5i6j7k",
      "quiltt_account_id": "acc_1a2b3c4d5e6f7g8h9i0j"
    }
  },
  "meta": {
    "api_request_id": "243431dd-7deb-4445-820d-55a942ace70f"
  },
  "response_type": "object"
}
```

<Tip>
  Store the `paykey` securely for future transactions. Use it to [create charges](/api-reference/charges/create) and Straddle will verify the account balance before processing.
</Tip>

## Implementation Flow

<Steps>
  <Step title="Connect bank account">
    User connects their bank account via Quiltt Connector
  </Step>

  <Step title="Fetch account details">
    Fetch account details using Quiltt's GraphQL API
  </Step>

  <Step title="Create processor token">
    Create processor token for selected account
  </Step>

  <Step title="Bridge to Straddle">
    Bridge processor token to create Straddle paykey
  </Step>

  <Step title="Store paykey">
    Store paykey for payment processing
  </Step>
</Steps>

## Troubleshooting

Common issues and their solutions:

| Issue                   | Solution                                              |
| ----------------------- | ----------------------------------------------------- |
| Invalid processor token | Ensure `processor: "STRADDLE"` and `issuer: "QUILTT"` |
| Authentication errors   | Verify your Quiltt API key and Straddle API key       |
| Missing features        | Enable `ACCOUNT_NUMBERS` in Quiltt Connector          |
| Connection not active   | Wait for connection status to be `active`             |
