Combine Stripe Customer and Invoices into Single REST Call
One edge call merges Stripe for Frontend / Web
To combine stripe customer and invoices into single rest call, configure parallel steps for Stripe. Frontend / Web performs one authorized GET/POST to RealComposer and receives a merged payload.
Serial Stripe calls slow Frontend / Web pages
Each extra Stripe hop adds hundreds of milliseconds and another OAuth refresh path your UI must manage.
- One slow upstream blocking an entire page
- Partial failures leaving UI in inconsistent states
- Duplicate auth refresh logic per service
How RealComposer Solves This at the Edge
Store upstream credentials in Secret Vault
Store STRIPE_SECRET_KEY in the vault. Frontend / Web never embeds the raw secret, only a revocable rc_live_ client token.
Target the real upstream URL
Point step customer at https://api.stripe.com/v1/customers/{{query.customerId}} 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).
Call from Frontend / Web
Allowed origins on the token should list every Frontend / Web host that calls this URL.
const res = await fetch('https://realcomposer.com/v1/workspace/combine-stripe-customer-and-invoices', {
headers: { Authorization: 'Bearer rc_live_your_token' }
});
{
"requestId": "req_combine-",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "combine-stripe-customer-and-invoices"
},
"payload": {
"id": "sample_id",
"status": "active",
"nested": {
"tags": [
"demo"
],
"internal": true
},
"unused_blob": {
"foo": "bar",
"bar": "baz"
}
}
}
{
"customer_customerId": "sample",
"customer_email": "sample",
"invoices_customerId": "sample",
"invoices_email": "sample"
}
Recipe Specs
- HTTP method
- GET
- Upstream calls
- 2
- Edge cache TTL
- No caching
- Client auth
- Restricted client token
- Mapped output fields
- 4
- Payload
- 255 B to 115 B (-55%)
curl -X GET "https://realcomposer.com/v1/workspace/combine-stripe-customer-and-invoices" \ -H "Authorization: Bearer rc_live_client_token"
Developer Questions & Troubleshooting
Does Frontend / Web need CORS changes after adding RealComposer?
Store STRIPE_SECRET_KEY for combine-stripe-customer-and-invoices. Frontend / Web never sees decrypted values.
When does edge caching apply to this recipe?
combine-stripe-customer-and-invoices forwards client JSON to POST upstreams unchanged; secrets interpolate only in URLs and header templates.
How do I rotate upstream credentials?
Upstream steps in combine-stripe-customer-and-invoices honor timeoutMs and optional fallback JSON without leaking secrets.
Sources & Definitions Used in This Answer
Deploy this Frontend / Web + Stripe Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.