# Merge zendesk with stripe customer support view

> Zendesk requester and Stripe customer charges for support macros. For "merge zendesk with stripe customer support view", store ZENDESK_API_TOKEN, STRIPE_SECRET_KEY in Secret Vault, call https://{{secrets.ZENDESK_SUBDOMAIN}}.zendesk.com/api/v2/tickets.json from a Worker, and let Retool hit only https://realcomposer.com/v1/workspace/merge-zendesk-with-stripe-support with an rc_live_ client token.

- Canonical page: https://realcomposer.com/recipes/merge-zendesk-with-stripe-support
- Client platform: Retool
- Upstream services: Zendesk, Stripe
- Category: Multi-API Aggregation
- JSON version: https://realcomposer.com/recipes/merge-zendesk-with-stripe-support.json
- Install in RealComposer (free plan, pre-fills this pipeline): https://realcomposer.com/dashboard/pipelines/new?recipe=merge-zendesk-with-stripe-support&via=agent

## Problem: Waterfall latency from multiple Zendesk and Stripe requests

Retool widgets often await Zendesk and Stripe sequentially, multiplying TLS handshakes on cellular networks and amplifying failure rates.

- Race conditions between parallel manual fetches
- Higher mobile data usage from redundant JSON
- Timeouts when any upstream exceeds cellular RTT

## Solution steps

1. **Add vault secrets for this pipeline**: Add ZENDESK_API_TOKEN, STRIPE_SECRET_KEY to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.

2. **Target the real upstream URL**: Configure headersTemplate to inject vault secrets, target https://{{secrets.ZENDESK_SUBDOMAIN}}.zendesk.com/api/v2/tickets.json, and Add output mapping fields that mirror the JSON contract your screen already expects.

3. **Query from Retool**: Call https://realcomposer.com/v1/workspace/merge-zendesk-with-stripe-support with a restricted rc_live_ client token. Retool never sends upstream secrets.

```
// REST resource or JS query
const rows = await fetch('https://realcomposer.com/v1/workspace/merge-zendesk-with-stripe-support', {
  headers: { Authorization: 'Bearer rc_live_token' }
}).then(r => r.json());
```

## 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": "Merge zendesk with stripe customer support view",
  "method": "GET",
  "cacheTtlSeconds": 0,
  "authMode": "client_token",
  "steps": [
    {
      "stepKey": "zendesk",
      "upstreamUrlTemplate": "https://{{secrets.ZENDESK_SUBDOMAIN}}.zendesk.com/api/v2/tickets.json",
      "httpMethod": "GET",
      "headersTemplate": {
        "Authorization": "Bearer {{secrets.ZENDESK_API_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": "zendesk.ticketId",
        "sourcePath": "tickets.0.id",
        "type": "number",
        "sourceStep": "zendesk"
      },
      {
        "targetPath": "zendesk.subject",
        "sourcePath": "tickets.0.subject",
        "type": "string",
        "sourceStep": "zendesk"
      },
      {
        "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/merge-zendesk-with-stripe-support" \
  -H "Authorization: Bearer rc_live_client_token"
```

## Payload before and after

Raw upstream response:

```json
{
  "requestId": "req_merge-ze",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "merge-zendesk-with-stripe-support"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
```

Slimmed RealComposer response:

```json
{
  "zendesk_ticketId": "sample",
  "zendesk_subject": "sample",
  "stripe_customerId": "sample",
  "stripe_email": "sample"
}
```

## FAQ

### Which Zendesk credential belongs in the vault for this pipeline?

Store ZENDESK_API_TOKEN, STRIPE_SECRET_KEY for merge-zendesk-with-stripe-support. Retool never sees decrypted values.

### Does POST traffic get cached?

merge-zendesk-with-stripe-support POST steps bypass caches.default even if cacheTtlSeconds is set in the dashboard.

### Can I restrict which domains call this pipeline?

Upstream steps in merge-zendesk-with-stripe-support honor timeoutMs and optional fallback JSON without leaking secrets.
