{
  "slug": "merge-plaid-accounts-and-transactions",
  "title": "Merge Plaid Accounts and Transactions into Single Mobile Payload",
  "metaTitle": "Merge Plaid Accounts and - RealComposer",
  "metaDescription": "Merge plaid accounts and transactions into single mobile payload. Merge Plaid in one Mobile App (iOS & Android) call with parallel Worker steps.",
  "headline": "Parallel Plaid fetch merged before Mobile App (iOS & Android) hydrates",
  "category": "aggregation",
  "categoryLabel": "Multi-API Aggregation",
  "urgency": 9,
  "clientPlatform": "Mobile App (iOS & Android)",
  "upstreamServices": [
    "Plaid"
  ],
  "searchIntentQuery": "merge plaid accounts and transactions into single mobile payload",
  "directAnswerSummary": "Instead of Mobile App (iOS & Android) firing serial fetches to Plaid, one pipeline hits https://production.plaid.com/accounts/get (and sibling steps) in parallel and returns mapped JSON.",
  "problem": {
    "title": "Waterfall latency from multiple Plaid requests",
    "explanation": "Mobile App (iOS & Android) widgets often await Plaid sequentially, multiplying TLS handshakes on cellular networks and amplifying failure rates.",
    "risks": [
      "Race conditions between parallel manual fetches",
      "Higher mobile data usage from redundant JSON",
      "Timeouts when any upstream exceeds cellular RTT"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Bind vault keys to the Worker",
      "description": "Store PLAID_SECRET in the vault. Mobile App (iOS & Android) never embeds the raw secret, only a revocable rc_live_ client token."
    },
    {
      "stepNumber": 2,
      "title": "Set headers, mapping, and cache TTL",
      "description": "Use POST against https://production.plaid.com/accounts/get. Allowed origins on the client token should match post pipelines set cache ttl to 0 because realcomposer only stores get responses at the edge."
    },
    {
      "stepNumber": 3,
      "title": "Call from Mobile App (iOS & Android)",
      "description": "Authorize with Bearer rc_live_ and fetch the mapped JSON contract your UI already expects.",
      "codeSnippet": "let url = URL(string: \"https://realcomposer.com/v1/workspace/merge-plaid-accounts-and-transactions\")!\nvar request = URLRequest(url: url)\nrequest.addValue(\"Bearer rc_live_token\", forHTTPHeaderField: \"Authorization\")"
    }
  ],
  "pipelineConfig": {
    "name": "Merge Plaid Accounts and Transactions into Single Mobile Payload",
    "method": "POST",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "plaid",
        "upstreamUrlTemplate": "https://production.plaid.com/accounts/get",
        "httpMethod": "POST",
        "headersTemplate": {
          "Content-Type": "application/json"
        },
        "timeoutMs": 10000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "accountId",
          "sourcePath": "accounts.0.account_id",
          "type": "string",
          "sourceStep": "plaid"
        },
        {
          "targetPath": "name",
          "sourcePath": "accounts.0.name",
          "type": "string",
          "sourceStep": "plaid"
        },
        {
          "targetPath": "type",
          "sourcePath": "accounts.0.type",
          "type": "string",
          "sourceStep": "plaid"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_merge-pl",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "merge-plaid-accounts-and-transactions"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "accountId": "sample",
    "name": "sample",
    "type": "sample"
  },
  "curlSnippet": "curl -X POST \"https://realcomposer.com/v1/workspace/merge-plaid-accounts-and-transactions\" \\\n  -H \"Authorization: Bearer rc_live_client_token\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"example\"}'",
  "faqs": [
    {
      "question": "Does Mobile App (iOS & Android) need CORS changes after adding RealComposer?",
      "answer": "Yes for merge-plaid-accounts-and-transactions. Ship only an rc_live_ client token in Mobile App (iOS & Android); RealComposer injects PLAID_SECRET on https://production.plaid.com/accounts/get."
    },
    {
      "question": "What cache key does RealComposer use?",
      "answer": "merge-plaid-accounts-and-transactions forwards client JSON to POST upstreams unchanged; secrets interpolate only in URLs and header templates."
    },
    {
      "question": "How do I rotate upstream credentials?",
      "answer": "Rotate vault secrets for merge-plaid-accounts-and-transactions anytime; clients keep the same rc_live_ token."
    }
  ],
  "relatedRecipeSlugs": [
    "merge-airtable-and-sendgrid-templates",
    "google-maps-api-proxy-edge",
    "call-stripe-from-flutterflow-securely"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/merge-plaid-accounts-and-transactions",
    "markdown": "https://realcomposer.com/recipes/merge-plaid-accounts-and-transactions.md",
    "json": "https://realcomposer.com/recipes/merge-plaid-accounts-and-transactions.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=merge-plaid-accounts-and-transactions&via=agent"
  }
}