# Combine mailchimp with shopify customer tags

> Shopify customer tags and Mailchimp list membership for segmentation UI. For "combine mailchimp with shopify customer tags", store MAILCHIMP_BASIC_AUTH, SHOPIFY_ACCESS_TOKEN in Secret Vault, call https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10 from a Worker, and let Bubble.io hit only https://realcomposer.com/v1/workspace/combine-mailchimp-with-shopify-tags with an rc_live_ client token.

- Canonical page: https://realcomposer.com/recipes/combine-mailchimp-with-shopify-tags
- Client platform: Bubble.io
- Upstream services: Mailchimp, Shopify
- Category: Multi-API Aggregation
- JSON version: https://realcomposer.com/recipes/combine-mailchimp-with-shopify-tags.json
- Install in RealComposer (free plan, pre-fills this pipeline): https://realcomposer.com/dashboard/pipelines/new?recipe=combine-mailchimp-with-shopify-tags&via=agent

## Problem: Waterfall latency from multiple Mailchimp and Shopify requests

Bubble.io widgets often await Mailchimp and Shopify 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. **Bind vault keys to the Worker**: Add MAILCHIMP_BASIC_AUTH, SHOPIFY_ACCESS_TOKEN to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.

2. **Set headers, mapping, and cache TTL**: Configure headersTemplate to inject vault secrets, target https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10, and Add output mapping fields that mirror the JSON contract your screen already expects.

3. **Connect Bubble API Connector**: Authorize with Bearer rc_live_ and fetch the mapped JSON contract your UI already expects.

```
API Connector GET https://realcomposer.com/v1/workspace/combine-mailchimp-with-shopify-tags
Private 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": "Combine mailchimp with shopify customer tags",
  "method": "GET",
  "cacheTtlSeconds": 0,
  "authMode": "client_token",
  "steps": [
    {
      "stepKey": "mailchimp",
      "upstreamUrlTemplate": "https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10",
      "httpMethod": "GET",
      "headersTemplate": {
        "Authorization": "Basic {{secrets.MAILCHIMP_BASIC_AUTH}}"
      },
      "timeoutMs": 3000
    },
    {
      "stepKey": "shopify",
      "upstreamUrlTemplate": "https://{{secrets.SHOPIFY_STORE}}.myshopify.com/admin/api/2026-10/products.json?limit=5",
      "httpMethod": "GET",
      "headersTemplate": {
        "X-Shopify-Access-Token": "{{secrets.SHOPIFY_ACCESS_TOKEN}}"
      },
      "timeoutMs": 3000
    }
  ],
  "outputMapping": {
    "version": 1,
    "fields": [
      {
        "targetPath": "mailchimp.memberId",
        "sourcePath": "members.0.id",
        "type": "string",
        "sourceStep": "mailchimp"
      },
      {
        "targetPath": "mailchimp.email",
        "sourcePath": "members.0.email_address",
        "type": "string",
        "sourceStep": "mailchimp"
      },
      {
        "targetPath": "shopify.productId",
        "sourcePath": "products.0.id",
        "type": "number",
        "sourceStep": "shopify"
      },
      {
        "targetPath": "shopify.title",
        "sourcePath": "products.0.title",
        "type": "string",
        "sourceStep": "shopify"
      }
    ]
  }
}
```

## Call the pipeline

```bash
curl -X GET "https://realcomposer.com/v1/workspace/combine-mailchimp-with-shopify-tags" \
  -H "Authorization: Bearer rc_live_client_token"
```

## Payload before and after

Raw upstream response:

```json
{
  "requestId": "req_combine-",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "combine-mailchimp-with-shopify-tags"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
```

Slimmed RealComposer response:

```json
{
  "mailchimp_memberId": "sample",
  "mailchimp_email": "sample",
  "shopify_productId": "sample",
  "shopify_title": "sample"
}
```

## FAQ

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

Store MAILCHIMP_BASIC_AUTH, SHOPIFY_ACCESS_TOKEN for combine-mailchimp-with-shopify-tags. Bubble.io never sees decrypted values.

### Does POST traffic get cached?

combine-mailchimp-with-shopify-tags POST steps bypass caches.default even if cacheTtlSeconds is set in the dashboard.

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

Rotate vault secrets for combine-mailchimp-with-shopify-tags anytime; clients keep the same rc_live_ token.
