Skip to main content

Use cases

Balance reload via Stripe Checkout

Pay-as-you-go API balance top-up

Scell.io is usage-based: each issued invoice, initiated signature and OCR consumes credit from the tenant balance. To reload: `POST /api/v1/balance/reload` returns a pre-filled Stripe Checkout URL (amount, EUR currency, tenant_id metadata). The client pays via Stripe (card, SEPA, Bacs), Stripe notifies Scell.io via signed webhook, and the balance is credited in under 60 seconds. Idempotency-Key recommended to avoid double reloads on network retry. The `balance.reloaded` webhook notifies your backend. Configurable auto-reload: min threshold (e.g. €50) → automatic top-up (e.g. €500) with saved Stripe card.

Key facts

  • `POST /api/v1/balance/reload` endpoint → Stripe Checkout URL
  • Stripe methods: card, SEPA, Bacs
  • Balance credited < 60s after payment
  • Idempotency-Key recommended
  • `balance.reloaded` webhook after crediting
  • Configurable auto-reload (threshold + amount + saved card)

Code example

import { ScellClient } from '@scell/sdk';
import { randomUUID } from 'node:crypto';

const scell = new ScellClient({ apiKey: process.env.SCELL_SECRET_KEY! });

// 1. Top-up manuel : générer la session Checkout
const session = await scell.balance.reload({
  amount: 500_00, // en centimes (500€)
  currency: 'EUR',
  return_url: 'https://app.example.com/billing/success',
  cancel_url: 'https://app.example.com/billing/cancel',
}, { idempotencyKey: randomUUID() });

console.log('Redirect user to:', session.checkout_url);

// 2. Configurer l'auto-reload (carte sauvegardée requise)
await scell.balance.configureAutoReload({
  enabled: true,
  threshold_cents: 50_00, // déclenche à 50€
  topup_amount_cents: 500_00, // recharge 500€
});

See also

Your cookie preferences

We use cookies to improve your experience. Essential cookies are always active. Cookie policy.