{
  "slug": "avoid-stripe-api-rate-limit",
  "title": "Avoid Stripe API Rate Limit 100 Requests Per Second",
  "metaTitle": "Avoid Stripe API Rate Limit 100 - RealComposer",
  "metaDescription": "Avoid stripe api rate limit 100 requests per second. Shield Stripe with 300s GET edge cache; cache key uses query params on avoid-stripe-api-rate-limit.",
  "headline": "Stripe GET traffic cached ahead of rate limits",
  "category": "caching",
  "categoryLabel": "Edge Caching & Rate Limits",
  "urgency": 9,
  "clientPlatform": "Frontend / Web",
  "upstreamServices": [
    "Stripe"
  ],
  "searchIntentQuery": "avoid stripe api rate limit 100 requests per second",
  "directAnswerSummary": "Stripe rate limits hit fast from Frontend / Web. Cache 300s on GET calls where the query string scopes the response.",
  "problem": {
    "title": "Stripe rate limits from Frontend / Web traffic",
    "explanation": "Without edge caching, identical Stripe reads during a session still round-trip to the origin.",
    "risks": [
      "HTTP 429 responses during launch traffic",
      "Surprise SaaS overages from duplicate reads",
      "Slower repeat views than necessary"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Add vault secrets for this pipeline",
      "description": "Store STRIPE_SECRET_KEY in the vault. Frontend / Web never embeds the raw secret, only a revocable rc_live_ client token."
    },
    {
      "stepNumber": 2,
      "title": "Target the real upstream URL",
      "description": "Configure headersTemplate to inject vault secrets, target https://api.stripe.com/v1/customers/{{query.customerId}}, and Add output mapping fields that mirror the JSON contract your screen already expects."
    },
    {
      "stepNumber": 3,
      "title": "Call from Frontend / Web",
      "description": "Allowed origins on the token should list every Frontend / Web host that calls this URL.",
      "codeSnippet": "const res = await fetch('https://realcomposer.com/v1/workspace/avoid-stripe-api-rate-limit', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "Avoid Stripe API Rate Limit 100 Requests Per Second",
    "method": "GET",
    "cacheTtlSeconds": 300,
    "authMode": "client_token",
    "steps": [
      {
        "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": "customerId",
          "sourcePath": "id",
          "type": "string",
          "sourceStep": "stripe"
        },
        {
          "targetPath": "email",
          "sourcePath": "email",
          "type": "string",
          "sourceStep": "stripe"
        },
        {
          "targetPath": "name",
          "sourcePath": "name",
          "type": "string",
          "sourceStep": "stripe"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_avoid-st",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "avoid-stripe-api-rate-limit"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "customerId": "sample",
    "email": "sample",
    "name": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/avoid-stripe-api-rate-limit\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Does Frontend / Web need CORS changes after adding RealComposer?",
      "answer": "Log request IDs for avoid-stripe-api-rate-limit, not raw Stripe payloads, because upstream bodies may include PII."
    },
    {
      "question": "What cache key does RealComposer use?",
      "answer": "avoid-stripe-api-rate-limit: only GET requests cache (300s on caches.default). Key is workspace slug plus sorted query params, not Authorization."
    },
    {
      "question": "What happens if an upstream step times out?",
      "answer": "Rotate vault secrets for avoid-stripe-api-rate-limit anytime; clients keep the same rc_live_ token."
    }
  ],
  "relatedRecipeSlugs": [
    "merge-airtable-and-sendgrid-templates",
    "filter-unnecessary-fields-rest-api",
    "slim-notion-block-children-payload"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/avoid-stripe-api-rate-limit",
    "markdown": "https://realcomposer.com/recipes/avoid-stripe-api-rate-limit.md",
    "json": "https://realcomposer.com/recipes/avoid-stripe-api-rate-limit.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=avoid-stripe-api-rate-limit&via=agent"
  }
}