Integrationsarbejdsgange

Overblik

Fenerum tilbyder fleksible integrationsmuligheder, der matcher jeres forretningsbehov. Vælg den tilgang, der passer bedst til jeres use case:

Vælg din integrationsmetode:

Brug Fenerum UI, eksportér data til BI

Self-Service + API til backend

Komplet headless-integration (Anbefales til B2B SaaS)


UI-first-integration

Bedst til: Små teams, startups eller virksomheder, der vil bruge Fenerums indbyggede funktioner med minimal udvikling.

Sådan fungerer det

  1. Administrér alt i Fenerum UI

    • Opret konti, abonnementer og pakker via webgrænsefladen
    • Udsted fakturaer og håndtér fakturering manuelt eller med automatiseringsregler
    • Overvåg metrics med indbyggede dashboards
  2. Eksportér data via API til analytics

    • Brug read-only API-endpoints til at hente data til jeres BI-værktøjer
    • Almindelige endpoints: /api/v1/accounts/, /api/v1/invoices/, /api/v1/subscriptions/
    • Synkronisér data til jeres data warehouse for skræddersyede rapporter

Nøglefordele

  • Hurtig opsætning - Ingen integrationskode nødvendig
  • Fuld adgang til funktioner - Brug alle Fenerum-funktioner via UI
  • Enkel analytics - Eksportér data, når I har brug for det

Eksempel: Eksport af fakturaer

curl https://app.fenerum.com/api/v1/invoices/?created_date__gte=2025-01-01 \
  -H "Authorization: Token your-token-here" \
  -H "X-Client-System: BIExport"

Hybrid-integration

Bedst til: Virksomheder, der vil automatisere backend-operationer og samtidig tilbyde kunder en self-service-portal.

Sådan fungerer det

  1. Kundevendt: Fenerum Self-Service

    • Kunder administrerer egne betalingsmetoder via Self-Service
    • Tilføj/fjern kort, opdater faktureringsoplysninger, se fakturaer
    • Ingen udvikling nødvendig hos jer
  2. Backend: API-integration

    • Opret konti og abonnementer automatisk via API, når kunder tilmelder sig
    • Synkronisér forbrugsdata, opdater mængder, håndtér lifecycle-events
    • Håndtér kompleks forretningslogik i jeres applikation

Integrationsflow

Your App (Backend)           Fenerum API              Customer
     │                            │                       │
     │  Create Account            │                       │
     ├──────────────────────────► │                       │
     │                            │                       │
     │  Create Subscription       │                       │
     ├──────────────────────────► │                       │
     │                            │                       │
     │  Generate Self-Service Link │                      │
     ├──────────────────────────► │                       │
     │  ◄────────────────────────┤                       │
     │                            │                       │
     │         Redirect Customer to Self-Service         │
     ├──────────────────────────────────────────────────► │
     │                            │                       │
     │                            │   Add Payment Card   │
     │                            │ ◄──────────────────── │
curl -X POST https://app.fenerum.com/api/self-service/initiate-organization/ \
  -H "Authorization: Token your-token-here" \
  -H "X-Client-System: YourApp" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "customer@example.com"
  }'
{
  "url": "https://yourcompany.hostedsignup.com/auth/login?token=..."
}

Se Self-Service-guiden for komplette opsætningsinstruktioner.


Fuld API-integration

Bedst til: B2B SaaS-virksomheder, der ønsker fuld kontrol og en fuldt branded oplevelse.

✨ Anbefales til B2B SaaS - Dine kunder ser aldrig Fenerum direkte. Alt sker gennem jeres applikation, mens Stripe eller QuickPay håndterer betalingsopkrævning.

Sådan fungerer det

Komplet headless-integration, hvor al fakturering håndteres programmatisk:

  • Kontoadministration - Opret/opdatér kundekonti via API
  • Abonnementslivscyklus - Start, opgrader, nedgrader, opsig abonnementer
  • Betalingsopkrævning - Brug Stripe eller QuickPay direkte (se Modtag betalinger)
  • Forbrugsregistrering - Rapportér forbrug til forbrugsbaseret fakturering
  • Fakturering - Automatisk fakturagenerering og -levering

Vigtigt: Oprettelsesrækkefølge

Opret altid ressourcer i denne rækkefølge:

  1. Konto - Din kunde
  2. Kontrakter (valgfrit) - Særlige priser eller mængderabatter med tiers
  3. Betalingsmetode - Stripe- eller QuickPay-kortregistrering
  4. Abonnement - Brug af aktiv pakke

Trin 1: Opret konto

curl -X POST https://app.fenerum.com/api/v1/accounts/ \
  -H "Authorization: Token your-token-here" \
  -H "X-Client-System: YourApp" \
  -H "X-User: admin@yourapp.com" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "CUST001",
    "name": "Acme Corporation",
    "email": "billing@acme.com",
    "type": "company",
    "legal_address": "123 Main Street",
    "legal_zipcode": "12345",
    "legal_city": "Copenhagen",
    "legal_country": "DK"
  }'
{
  "uuid": "123e4567-e89b-12d3-a456-426614174000",
  "code": "CUST001",
  "name": "Acme Corporation",
  "email": "billing@acme.com",
  "type": "company"
}

Trin 2: Tilføj kontrakter (valgfrit)

Hvis kunden har forhandlet særlige priser eller mængderabatter, skal du oprette en kontrakt med rabat-tiers:

# First, create the contract
curl -X POST https://app.fenerum.com/api/v1/accounts/CUST001/contracts/ \
  -H "Authorization: Token your-token-here" \
  -H "X-Client-System: YourApp" \
  -H "Content-Type: application/json" \
  -d '{
    "plan_terms": "plan-terms-uuid",
    "start_date": "2025-01-01",
    "end_date": "2025-12-31"
  }'
{
  "uuid": "contract-uuid-here",
  "plan_terms": "plan-terms-uuid",
  "start_date": "2025-01-01",
  "end_date": "2025-12-31"
}

Tilføj derefter rabat-tiers til kontrakten:

# Add a tier: 15% discount when quantity >= 10
curl -X POST https://app.fenerum.com/api/v1/accounts/CUST001/contracts/contract-uuid-here/tiers/ \
  -H "Authorization: Token your-token-here" \
  -H "X-Client-System: YourApp" \
  -H "Content-Type: application/json" \
  -d '{
    "minimum_quantity": 10,
    "discount": "15.00",
    "discount_type": "percentage"
  }'

Trin 3: Registrer betalingsmetode

Brug Stripe eller QuickPay til at indsamle kortoplysninger, og registrér derefter tokenet hos Fenerum:

For Stripe:

curl -X POST https://app.fenerum.com/api/v1/paymentcards/ \
  -H "Authorization: Token your-token-here" \
  -H "X-Client-System: YourApp" \
  -H "Content-Type: application/json" \
  -d '{
    "account": "123e4567-e89b-12d3-a456-426614174000",
    "token": "pm_1234567890",
    "gateway": "stripe"
  }'

For QuickPay:

curl -X POST https://app.fenerum.com/api/v1/paymentcards/ \
  -H "Authorization: Token your-token-here" \
  -H "X-Client-System: YourApp" \
  -H "Content-Type: application/json" \
  -d '{
    "account": "123e4567-e89b-12d3-a456-426614174000",
    "token": "12345678",
    "gateway": "quickpay"
  }'

Se guiden Modtag betalinger for komplette eksempler på betalingsintegration.

Trin 4: Opret abonnement

Til sidst opret abonnementet for at starte fakturering:

curl -X POST https://app.fenerum.com/api/v1/subscriptions/ \
  -H "Authorization: Token your-token-here" \
  -H "X-Client-System: YourApp" \
  -H "X-User: admin@yourapp.com" \
  -H "Content-Type: application/json" \
  -d '{
    "account": "CUST001",
    "terms": "plan-terms-uuid",
    "quantity": 5,
    "collection_method": "card",
    "start_date": "2025-01-01"
  }'
{
  "uuid": "sub-uuid-here",
  "account": "CUST001",
  "terms": "plan-terms-uuid",
  "quantity": 5,
  "collection_method": "card",
  "status": "active",
  "current_period_start": "2025-01-01",
  "current_period_end": "2025-02-01"
}

Komplet integrationseksempel

Her er hele flowet i den rigtige rækkefølge:

<!-- focus-start -->
import requests

# Configuration
FENERUM_TOKEN = 'your-token-here'
FENERUM_BASE_URL = 'https://app.fenerum.com/api/v1'
headers = {
    'Authorization': f'Token {FENERUM_TOKEN}',
    'X-Client-System': 'YourApp',
    'X-User': 'admin@yourapp.com',
    'Content-Type': 'application/json'
}

# Step 1: Create Account
account_response = requests.post(
    f'{FENERUM_BASE_URL}/accounts/',
    headers=headers,
    json={
        'code': 'CUST001',
        'name': 'Acme Corporation',
        'email': 'billing@acme.com',
        'type': 'company',
        'legal_address': '123 Main Street',
        'legal_zipcode': '12345',
        'legal_city': 'Copenhagen',
        'legal_country': 'DK'
    }
)
account = account_response.json()
account_uuid = account['uuid']

# Step 2: Add Contract with discount tiers (optional)
contract_response = requests.post(
    f'{FENERUM_BASE_URL}/accounts/CUST001/contracts/',
    headers=headers,
    json={
        'plan_terms': 'plan-terms-uuid',
        'start_date': '2025-01-01',
        'end_date': '2025-12-31'
    }
)
contract = contract_response.json()

# Add a discount tier: 15% off when quantity >= 10
tier_response = requests.post(
    f'{FENERUM_BASE_URL}/accounts/CUST001/contracts/{contract["uuid"]}/tiers/',
    headers=headers,
    json={
        'minimum_quantity': 10,
        'discount': '15.00',
        'discount_type': 'percentage'
    }
)

# Step 3: Register Payment Method
# (After collecting card via Stripe/QuickPay)
card_response = requests.post(
    f'{FENERUM_BASE_URL}/paymentcards/',
    headers=headers,
    json={
        'account': account_uuid,
        'token': 'pm_1234567890',  # From Stripe
        'gateway': 'stripe'
    }
)

# Step 4: Create Subscription
subscription_response = requests.post(
    f'{FENERUM_BASE_URL}/subscriptions/',
    headers=headers,
    json={
        'account': 'CUST001',
        'terms': 'plan-terms-uuid',
        'quantity': 5,
        'collection_method': 'card',
        'start_date': '2025-01-01'
    }
)
subscription = subscription_response.json()
<!-- focus-end -->

print(f"Created subscription: {subscription['uuid']}")

Nøglefordele

  • Fuld kontrol - Komplet programmatisk kontrol over fakturering
  • Branded oplevelse - Kunderne forlader aldrig jeres applikation
  • Fleksible workflows - Implementér den forretningslogik, I har brug for
  • Skalerbar - Automatisér alt fra onboarding til opsigelse

Næste skridt


Brug for hjælp til at vælge?

Start småt, skalér op:

  1. Begynd med UI-first-integration for at lære Fenerum at kende
  2. Tilføj Hybrid-integration, når I har brug for kundeself-service
  3. Gå over til Fuld API-integration, når jeres forretning skalér

Kontakt vores supportteam, hvis I har brug for hjælp til at vælge den rette tilgang.

background logo

Vi fakturerer for mere end 2 millarder årligt for vores kunder. Skal vi hjælpe dig med at sætte din fakturering på autopilot?