Quickstart
This walks through storing a card and charging it through an upstream API. Replace <org> with your organization’s slug from the dashboard’s Organization page.
1. Create a runtime API key
Section titled “1. Create a runtime API key”In the dashboard, open API keys and create a runtime key. It’s shown once; keep it in your backend’s secret store.
export FRYSIS_RUNTIME_KEY=fry_rt_…2. Store a payload
Section titled “2. Store a payload”curl https://<org>.frysis-proxy.net/v1/payloads \ -H "Authorization: Bearer $FRYSIS_RUNTIME_KEY" \ -H "Content-Type: application/json" \ -d '{"data": {"number": "4242424242424242", "exp_month": 12, "exp_year": 2030, "cvc": "123"}}'{ "token": "fry1.QCsC6MLZ74jxuFzDFf3XfvaqUCFU", "keys": ["number", "exp_month", "exp_year", "cvc"], "size_bytes": 72, "created_at": "…" }Save the token in your database instead of the card.
3. Describe the upstream request (egress)
Section titled “3. Describe the upstream request (egress)”In the dashboard, open Secrets and add your upstream API key, for example stripe_key. Then open Egress and create a template such as:
- Method:
POST - URL:
https://api.stripe.com/v1/payment_methods - Header:
Authorization: Bearer {{secret.stripe_key}} - Body format:
form - Body:
{ "type": "card", "card[number]": "{{payloads.card.number}}", "card[exp_month]": "{{payloads.card.exp_month}}", "card[exp_year]": "{{payloads.card.exp_year}}", "card[cvc]": "{{payloads.card.cvc}}"}4. Create an ingress endpoint
Section titled “4. Create an ingress endpoint”Open Ingress, create POST /charge and bind it to the egress. Its URL is https://<org>.frysis-proxy.net/ingress/charge.
5. Call it
Section titled “5. Call it”curl https://<org>.frysis-proxy.net/ingress/charge \ -H "Authorization: Bearer $FRYSIS_RUNTIME_KEY" \ -H "Content-Type: application/json" \ -d '{"payloads": {"card": "fry1.QCsC6MLZ74jxuFzDFf3XfvaqUCFU"}}'Frysis fills the card details into the upstream request and returns the upstream’s response as is.