Skip to main content
The Fluxrate Customer Portal lets your customers view their invoices and usage data without leaving your app. Embed it as a widget using a secure token.

How It Works

  1. Your backend requests a widget token from Fluxrate using an API key
  2. You embed the widget in your frontend using the token
  3. The widget securely displays the customer’s billing data

Generating a Widget Token

From your backend (server-side only), generate a token for a specific customer:
curl -X POST https://api.fluxrate.co/api/v1/widget/token \
  -H "Content-Type: application/json" \
  -H "X-API-Key: org_live_<your_api_key>" \
  -d '{
    "customer_external_id": "acme-corp-001"
  }'
Response:
{
  "token": "eyJ...",
  "expires_at": "2025-01-15T11:30:00Z"
}

Embedding in Your Frontend

Pass the token to your frontend and embed the portal:
<iframe 
  src="https://app.fluxrate.co/embed?token=eyJ..."
  width="100%"
  height="600px"
  frameborder="0"
>
</iframe>
Individual invoices can also be shared via a public URL (no login required):
# Generate a public token for an invoice
POST /api/v1/invoices/<invoice_id>/generate-token
The response includes a public_token. Share this URL with the customer:
https://app.fluxrate.co/p/<public_token>
The public invoice page shows all invoice details including line items, organization branding, and bank payment information.
Widget tokens are short-lived (1 hour). Generate a fresh token on each page load in your frontend.