Skip to content

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.

In the dashboard, open API keys and create a runtime key. It’s shown once; keep it in your backend’s secret store.

Terminal window
export FRYSIS_RUNTIME_KEY=fry_rt_…
Terminal window
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.

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}}"
}

Open Ingress, create POST /charge and bind it to the egress. Its URL is https://<org>.frysis-proxy.net/ingress/charge.

Terminal window
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.