{
  "slug": "retool-paddle-refunds-secure-proxy",
  "title": "Retool connect paddle refunds securely",
  "metaDescription": "Retool connect paddle refunds securely. Retool queries RealComposer for Paddle write operations. Retool CORS fix for Paddle via RealComposer OPTIONS.",
  "headline": "Finance ops Paddle adjustments without keys in queries",
  "category": "ecosystem",
  "categoryLabel": "Platforms & Frameworks",
  "urgency": 9,
  "clientPlatform": "Retool",
  "upstreamServices": [
    "Paddle"
  ],
  "searchIntentQuery": "retool connect paddle refunds securely",
  "directAnswerSummary": "Retool queries RealComposer for Paddle write operations. For \"retool connect paddle refunds securely\", store PADDLE_API_KEY in Secret Vault, call https://api.paddle.com/adjustments?action=refund&per_page=20 from a Worker, and let Retool hit only https://realcomposer.com/v1/workspace/retool-paddle-refunds-secure-proxy with an rc_live_ client token.",
  "problem": {
    "title": "CORS blocks Paddle in Retool",
    "explanation": "Low-code Retool tools expose connector tokens in shared workspaces, so Paddle credentials leak to every editor.",
    "risks": [
      "Browser console CORS errors blocking launches",
      "Editors pasting secrets into reusable components",
      "Inability to test locally without disabling security"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Store upstream credentials in Secret Vault",
      "description": "Create PADDLE_API_KEY vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders."
    },
    {
      "stepNumber": 2,
      "title": "Target the real upstream URL",
      "description": "Configure headersTemplate to inject vault secrets, target https://api.paddle.com/adjustments?action=refund&per_page=20, and Add output mapping fields that mirror the JSON contract your screen already expects."
    },
    {
      "stepNumber": 3,
      "title": "Query from Retool",
      "description": "Allowed origins on the token should list every Retool host that calls this URL.",
      "codeSnippet": "// REST resource or JS query\nconst rows = await fetch('https://realcomposer.com/v1/workspace/retool-paddle-refunds-secure-proxy', {\n  headers: { Authorization: 'Bearer rc_live_token' }\n}).then(r => r.json());"
    }
  ],
  "pipelineConfig": {
    "name": "Retool connect paddle refunds securely",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "paddle",
        "upstreamUrlTemplate": "https://api.paddle.com/adjustments?action=refund&per_page=20",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.PADDLE_API_KEY}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "subscriptionId",
          "sourcePath": "data.id",
          "type": "string",
          "sourceStep": "paddle"
        },
        {
          "targetPath": "status",
          "sourcePath": "data.status",
          "type": "string",
          "sourceStep": "paddle"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_retool-p",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "retool-paddle-refunds-secure-proxy"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "subscriptionId": "sample",
    "status": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/retool-paddle-refunds-secure-proxy\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Does Retool need CORS changes after adding RealComposer?",
      "answer": "Store PADDLE_API_KEY for retool-paddle-refunds-secure-proxy. Retool never sees decrypted values."
    },
    {
      "question": "When does edge caching apply to this recipe?",
      "answer": "retool-paddle-refunds-secure-proxy forwards client JSON to POST upstreams unchanged; secrets interpolate only in URLs and header templates."
    },
    {
      "question": "What happens if an upstream step times out?",
      "answer": "Upstream steps in retool-paddle-refunds-secure-proxy honor timeoutMs and optional fallback JSON without leaking secrets."
    }
  ],
  "relatedRecipeSlugs": [
    "connect-stripe-to-retool-securely",
    "call-paddle-api-from-react-securely"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/retool-paddle-refunds-secure-proxy",
    "markdown": "https://realcomposer.com/recipes/retool-paddle-refunds-secure-proxy.md",
    "json": "https://realcomposer.com/recipes/retool-paddle-refunds-secure-proxy.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=retool-paddle-refunds-secure-proxy&via=agent"
  }
}