# Flutterflow call salesforce and stripe one endpoint

> Replaces two FlutterFlow API calls with one composed edge URL. For "flutterflow call salesforce and stripe one endpoint", store SALESFORCE_ACCESS_TOKEN, STRIPE_SECRET_KEY in Secret Vault, call https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}} from a Worker, and let FlutterFlow hit only https://realcomposer.com/v1/workspace/flutterflow-salesforce-stripe-one-endpoint with an rc_live_ client token.

- Canonical page: https://realcomposer.com/recipes/flutterflow-salesforce-stripe-one-endpoint
- Client platform: FlutterFlow
- Upstream services: Salesforce, Stripe
- Category: Platforms & Frameworks
- JSON version: https://realcomposer.com/recipes/flutterflow-salesforce-stripe-one-endpoint.json
- Install in RealComposer (free plan, pre-fills this pipeline): https://realcomposer.com/dashboard/pipelines/new?recipe=flutterflow-salesforce-stripe-one-endpoint&via=agent

## Problem: CORS blocks Salesforce and Stripe in FlutterFlow

Low-code FlutterFlow tools expose connector tokens in shared workspaces, so Salesforce and Stripe credentials leak to every editor.

- Browser console CORS errors blocking launches
- Editors pasting secrets into reusable components
- Inability to test locally without disabling security

## Solution steps

1. **Store upstream credentials in Secret Vault**: Add SALESFORCE_ACCESS_TOKEN, STRIPE_SECRET_KEY to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.

2. **Configure upstream steps and output mapping**: Point step salesforce at https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}} with GET. Add output mapping fields that mirror the JSON contract your screen already expects. Leave cache TTL at 0 when each response is user-specific (include userId or record id in query params before enabling cache).

3. **Wire the FlutterFlow API Call**: Authorize with Bearer rc_live_ and fetch the mapped JSON contract your UI already expects.

```
// FlutterFlow API Call
URL: https://realcomposer.com/v1/workspace/flutterflow-salesforce-stripe-one-endpoint
Header Authorization: Bearer rc_live_your_token
```

## Pipeline config

Import this config into a RealComposer pipeline. `{{secrets.NAME}}` values are read from the encrypted Secret Vault at request time, so the client never sees them.

```json
{
  "name": "Flutterflow call salesforce and stripe one endpoint",
  "method": "GET",
  "cacheTtlSeconds": 0,
  "authMode": "client_token",
  "steps": [
    {
      "stepKey": "salesforce",
      "upstreamUrlTemplate": "https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}}",
      "httpMethod": "GET",
      "headersTemplate": {
        "Authorization": "Bearer {{secrets.SALESFORCE_ACCESS_TOKEN}}"
      },
      "timeoutMs": 3000
    },
    {
      "stepKey": "stripe",
      "upstreamUrlTemplate": "https://api.stripe.com/v1/customers/{{query.customerId}}",
      "httpMethod": "GET",
      "headersTemplate": {
        "Authorization": "Bearer {{secrets.STRIPE_SECRET_KEY}}"
      },
      "timeoutMs": 3000
    }
  ],
  "outputMapping": {
    "version": 1,
    "fields": [
      {
        "targetPath": "salesforce.contactId",
        "sourcePath": "Id",
        "type": "string",
        "sourceStep": "salesforce"
      },
      {
        "targetPath": "salesforce.email",
        "sourcePath": "Email",
        "type": "string",
        "sourceStep": "salesforce"
      },
      {
        "targetPath": "stripe.customerId",
        "sourcePath": "id",
        "type": "string",
        "sourceStep": "stripe"
      },
      {
        "targetPath": "stripe.email",
        "sourcePath": "email",
        "type": "string",
        "sourceStep": "stripe"
      }
    ]
  }
}
```

## Call the pipeline

```bash
curl -X GET "https://realcomposer.com/v1/workspace/flutterflow-salesforce-stripe-one-endpoint" \
  -H "Authorization: Bearer rc_live_client_token"
```

## Payload before and after

Raw upstream response:

```json
{
  "requestId": "req_flutterf",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "flutterflow-salesforce-stripe-one-endpoint"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
```

Slimmed RealComposer response:

```json
{
  "salesforce_contactId": "sample",
  "salesforce_email": "sample",
  "stripe_customerId": "sample",
  "stripe_email": "sample"
}
```

## FAQ

### What should FlutterFlow store instead of Salesforce secrets?

Yes for flutterflow-salesforce-stripe-one-endpoint. Ship only an rc_live_ client token in FlutterFlow; RealComposer injects SALESFORCE_ACCESS_TOKEN on https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}}.

### Will Anthropic or Linear prompt bodies be rewritten?

Cache key for flutterflow-salesforce-stripe-one-endpoint: internal edge-cache path plus sorted query. Identical params hit; vary userId per user.

### What happens if an upstream step times out?

Upstream steps in flutterflow-salesforce-stripe-one-endpoint honor timeoutMs and optional fallback JSON without leaking secrets.
