Introduction

Welcome to the Opendeck API documentation. Build powerful financial applications with our comprehensive API and developer tools.

What is Opendeck?

Opendeck is an open-finance infrastructure platform built on top of payments. We provide APIs and tools for businesses and developers to integrate financial services, including:

  • Gaming & Gambling Payments - Process payments for online casinos, sportsbooks, esports platforms, and fantasy sports
  • Pension Payments - Enable users to make pension contributions through Open Banking
  • Utilities Payments - Manage utility bill payments with ML-powered affordability checks
  • Open Banking Integration - Connect to UK banks via PSD2-compliant APIs

Our ML-first infrastructure provides real-time affordability checks, usage predictions, and payment optimization to help you build smarter financial applications.

🔒

Secure by Default

Bank-grade encryption and PSD2 compliance

Fast & Reliable

99.9% uptime SLA with sub-100ms response times

🤖

ML-Powered

AI-driven affordability checks and predictions

Quick Start

Get Started in Minutes

Get started with the Opendeck API in minutes. Our RESTful API is designed for simplicity and power.

Base URL
https://api.opendeck.co.uk

Authentication

Opendeck uses JWT-based authentication. Register a user account to get started.

Getting Your API Token

  1. Register a new user account via POST /api/auth/register
  2. Login to get your access token via POST /api/auth/login
  3. Include the token in the Authorization: Bearer YOUR_TOKEN header

API Categories

Authentication

Secure JWT-based authentication with OAuth2 support.

  • • POST /api/auth/register
  • • POST /api/auth/login
  • • POST /api/auth/logout
  • • GET /api/auth/me

Gaming & Gambling

Payment processing for gaming operators and platforms.

  • • POST /api/gaming/operators
  • • POST /api/gaming/transactions
  • • GET /api/gaming/stats
  • • POST /api/gaming/affordability

Pension Payments

Manage pension contributions and accounts.

  • • GET /api/pensions/accounts
  • • POST /api/pensions/pay
  • • GET /api/pensions/payments
  • • GET /api/pensions/providers

Utilities Payments

ML-powered utility bill payments with affordability checks.

  • • GET /api/utilities/accounts
  • • POST /api/utilities/pay
  • • GET /api/utilities/payments
  • • GET /api/utilities/providers

Open Banking

Connect to UK banks via Open Banking APIs.

  • • GET /api/banks
  • • GET /api/accounts
  • • POST /api/payments
  • • GET /api/analytics/spending

Events & Entertainment

Proprietary feature: Automatic pension micro-contributions (0.01%) from event payments.

  • • POST /api/events/venues
  • • POST /api/events/
  • • POST /api/events/payments
  • • GET /api/events/contributions
✨ Proprietary

Analytics & Insights

Financial analytics and risk assessment.

  • • GET /api/risk-assessment/{id}
  • • GET /api/business-insights/{id}
  • • GET /api/products
  • • GET /api/offers/{user_id}

Admin Dashboard

Platform management and monitoring.

  • • POST /api/admin/auth/login
  • • GET /api/admin/operators
  • • GET /api/admin/revenue
  • • GET /api/admin/transactions

API Request & Response Examples

Request

curl -X POST https://api.opendeck.co.uk/api/gaming/operators \
  -H "Content-Type: application/json" \
  -d '{
    "company_name": "Example Gaming Ltd",
    "trading_name": "Example Casino",
    "contact_email": "api@example.com",
    "contact_phone": "+44 20 1234 5678",
    "company_number": "12345678",
    "uk_gambling_license": "LIC123456"
  }'

Response

200 OK
{
  "operator_id": "123e4567-e89b-12d3-a456-426614174000",
  "api_key": "opdk_live_TZfnxh-dZlRDQ2DWbam0grXwToSXjlPZt4OQSIpF7Tc",
  "api_secret": "KhSxDRVf6ymBgHZjKVWxNkjdmHj5ggkRTIud2cxdP3DuxqtAyTDQhYrPe4IPdfKP"
}

Note: Save your API credentials immediately - they won't be shown again!

Request

curl -X GET https://api.opendeck.co.uk/api/merchant/dashboard/overview?period=month \
  -H "X-API-Key: opdk_live_YOUR_API_KEY_HERE"

Response

200 OK
{
  "total_volume": 125000.50,
  "total_revenue": 1875.75,
  "transaction_count": 342,
  "success_rate": 0.98,
  "active_players": 156,
  "pending_transactions": 3,
  "volume_change_percent": 12.5,
  "revenue_change_percent": 8.3,
  "period_start": "2024-11-17T00:00:00Z",
  "period_end": "2024-12-17T00:00:00Z"
}

Code Examples

Authentication (JavaScript)

// Register a new user
const response = await fetch('https://api.opendeck.co.uk/api/auth/register', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    email: 'user@example.com',
    password: 'securePassword123',
    firstName: 'Paul',
    lastName: 'Davis'
  })
});

const data = await response.json();
const token = data.token; // Store for authenticated requests

Authenticated Request (JavaScript)

// Make authenticated API call
const response = await fetch('https://api.opendeck.co.uk/api/accounts', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  }
});

const accounts = await response.json();

Python Example

import requests

# Authenticate
response = requests.post(
    'https://api.opendeck.co.uk/api/auth/login',
    json={'email': 'user@example.com', 'password': 'password'}
)
token = response.json()['token']

# Make authenticated request
headers = {'Authorization': f'Bearer {token}'}
accounts = requests.get(
    'https://api.opendeck.co.uk/api/accounts',
    headers=headers
).json()

Gaming Transaction (cURL)

curl -X POST https://api.opendeck.co.uk/api/gaming/transactions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operator_id": "op_123",
    "player_id": "player_456",
    "type": "deposit",
    "amount": 100.00,
    "currency": "GBP"
  }'

Register as Operator (cURL)

curl -X POST https://api.opendeck.co.uk/api/gaming/operators \
  -H "Content-Type: application/json" \
  -d '{
    "company_name": "Your Company Ltd",
    "trading_name": "Your Trading Name",
    "contact_email": "contact@example.com",
    "contact_phone": "+44 20 1234 5678",
    "uk_gambling_license": "LIC123456"
  }'

Returns API key and secret - save these!

Setting Up as an Operator

For Gaming & Gambling Operators

Gaming operators, casinos, sportsbooks, and esports platforms can integrate with Opendeck to process payments.

Step 1: Register Your Operator Account
POST /api/gaming/operators
Content-Type: application/json

{
  "company_name": "Your Company Ltd",
  "trading_name": "Your Trading Name",
  "contact_email": "contact@example.com",
  "contact_phone": "+44 20 1234 5678",
  "company_number": "12345678",
  "uk_gambling_license": "LIC123456",
  "website_url": "https://yourwebsite.com",
  "webhook_url": "https://yourwebsite.com/webhooks"
}

Response includes your api_key and api_secret. Save these immediately - they won't be shown again!

Step 2: Account Activation

After registration, your operator account starts with pending status. Opendeck will review and activate your account.

Once activated, you can use your API key to access the Merchant Dashboard and process transactions.

Note: Activation typically takes 1-2 business days for compliance review. You'll receive an email notification when your account is activated.

Step 3: Start Using the API

Once activated, use your API key in the X-API-Key header:

curl -X GET https://api.opendeck.co.uk/api/merchant/dashboard/overview \
  -H "X-API-Key: opdk_live_YOUR_API_KEY_HERE"

For Pension Service Providers

Production-ready integration guide for pension providers

🔒 Security First: All connections are encrypted, authenticated, and comply with PSD2 and GDPR regulations. Your API credentials are hashed and never stored in plain text.

1
Register as a Pension Provider

Start by registering your pension provider organization with Opendeck. This creates your operator account and generates secure API credentials.

API Endpoint

POST https://api.opendeck.co.uk/api/gaming/operators
Content-Type: application/json

{
  "company_name": "NEST Corporation",
  "trading_name": "NEST Pensions",
  "contact_email": "api@nestpensions.com",
  "contact_phone": "+44 20 1234 5678",
  "company_number": "RC000727",
  "website_url": "https://www.nestpensions.org.uk",
  "webhook_url": "https://api.nestpensions.com/webhooks/opendeck"
}

Response: You'll receive your API credentials immediately:

{
  "operator_id": "550e8400-e29b-41d4-a716-446655440000",
  "api_key": "opdk_live_abc123...",
  "api_secret": "opdk_secret_xyz789..."
}

⚠️ CRITICAL: Save these credentials immediately! They are only shown once and cannot be recovered.

Required Fields:

  • company_name - Your registered company name
  • trading_name - Your public-facing brand name
  • contact_email - Technical contact email

Optional Fields:

  • company_number - UK Companies House number
  • webhook_url - Your webhook endpoint for real-time notifications
  • uk_gambling_license - Not required for pension providers
2
Account Activation & Verification

After registration, your account starts with pending status. Opendeck performs compliance verification before activation.

Verification Process:

  1. Company Verification: We verify your company registration with Companies House (UK)
  2. Compliance Review: Review of pension provider regulations and FCA requirements
  3. Security Assessment: Validation of your webhook endpoint and security practices
  4. API Testing: We may request test API calls to verify integration readiness

Check Activation Status:

GET https://api.opendeck.co.uk/api/gaming/operators/me
Headers:
  X-API-Key: opdk_live_YOUR_API_KEY

Status values: pendingactive

⏱️ Typical Timeline: 1-2 business days for standard verification. Complex cases may take up to 5 business days. You'll receive email notifications at each stage.

3
Establish Secure Connection

Once activated, establish a secure connection between Opendeck and your pension provider system. This enables real-time account verification and payment processing.

Connection Methods:

Option A: API Token Exchange (Recommended)

Exchange secure tokens for authenticated API access:

POST https://api.opendeck.co.uk/api/pensions/providers/connect
Headers:
  X-API-Key: opdk_live_YOUR_API_KEY
  Content-Type: application/json

Body:
{
  "provider_token": "your_secure_provider_token",
  "provider_api_endpoint": "https://api.yourpension.com/v1",
  "encryption_key": "base64_encoded_public_key"
}

Option B: OAuth 2.0 Integration

For providers with OAuth support:

POST https://api.opendeck.co.uk/api/pensions/providers/oauth/authorize
Headers:
  X-API-Key: opdk_live_YOUR_API_KEY

Body:
{
  "oauth_client_id": "your_client_id",
  "oauth_client_secret": "your_client_secret",
  "redirect_uri": "https://api.opendeck.co.uk/api/pensions/providers/oauth/callback"
}

✅ Connection Verified: Once connected, Opendeck can:

  • Verify pension account details in real-time
  • Process contribution payments securely
  • Sync account balances and transaction history
  • Send webhook notifications for payment events
4
User Account Connection Flow

When users connect their pension accounts, Opendeck securely verifies and links them to your provider system.

Connection Flow:

1

User Initiates Connection

User provides pension account details via Opendeck app/web

2

Opendeck Validates Account

Opendeck calls your API to verify account exists and is valid

3

Secure Token Exchange

Provider returns encrypted access token for future API calls

4

Account Linked

User can now make contributions through Opendeck

Provider API Endpoint (Your Side):

POST https://api.yourpension.com/v1/accounts/verify
Headers:
  Authorization: Bearer YOUR_PROVIDER_TOKEN
  X-Opendeck-Signature: HMAC_SIGNATURE

Body:
{
  "account_number": "PEN123456",
  "scheme_name": "Workplace Pension Scheme",
  "user_national_insurance": "AB123456C"
}

Response:
{
  "valid": true,
  "account_id": "ACC789",
  "account_name": "John Smith",
  "current_balance": 50000.00,
  "currency": "GBP"
}
5
Payment Processing & Webhooks

When users make pension contributions, Opendeck processes payments and notifies your system via webhooks.

Payment Flow:

  1. User initiates contribution via Opendeck (e.g., £100)
  2. Opendeck processes payment via Open Banking or wallet
  3. Opendeck sends webhook to your provider API
  4. Your system confirms receipt and updates pension account
  5. Opendeck updates payment status to completed

Webhook Payload Example:

POST https://api.yourpension.com/webhooks/opendeck
Headers:
  X-Opendeck-Event: pension.payment.completed
  X-Opendeck-Signature: HMAC_SHA256_SIGNATURE
  X-Opendeck-Timestamp: 1703123456

Body:
{
  "event_id": "evt_abc123",
  "event_type": "pension.payment.completed",
  "created_at": "2024-01-15T10:30:00Z",
  "data": {
    "payment_id": "pay_xyz789",
    "pension_account_id": "acc_456",
    "user_id": "usr_123",
    "amount": 100.00,
    "currency": "GBP",
    "tax_relief_amount": 25.00,
    "gross_amount": 125.00,
    "payment_source": "bank_account",
    "provider_payment_id": "PEN-2024-001234"
  }
}

Security: Always verify the X-Opendeck-Signature header using HMAC SHA256 with your webhook secret.

Webhook Events:

  • pension.payment.completed - Payment successfully processed
  • pension.payment.failed - Payment failed
  • pension.account.connected - User connected their account
  • pension.account.disconnected - User disconnected their account
Security & Best Practices

🔐 API Key Security

  • Never commit API keys to version control
  • Rotate keys immediately if compromised
  • Use environment variables for key storage
  • Implement IP whitelisting for production

🔒 Webhook Security

  • Always verify HMAC signatures
  • Check timestamp to prevent replay attacks
  • Use HTTPS for all webhook endpoints
  • Implement idempotency for payment processing

📋 Compliance

  • PSD2 compliance for payment processing
  • GDPR compliance for user data handling
  • FCA regulations for pension providers
  • Audit logging for all transactions
Testing & Support

🧪 Sandbox Environment

Test your integration in our sandbox:

https://sandbox-api.opendeck.co.uk

📚 API Documentation

Full API reference:

View Swagger Docs →

💬 Support

Need help? Contact our integration team:

integrations@opendeck.co.uk

📊 Merchant Dashboard

Monitor payments and transactions:

Access Dashboard →

Full API Documentation

Interactive API Docs

Explore all endpoints with our interactive Swagger documentation.

View Swagger Docs →

ReDoc Documentation

Beautiful, responsive API documentation with examples.

View ReDoc →

SDKs & Libraries

Official SDKs for popular programming languages.

JavaScript Python Swift Coming Soon

Webhooks

Receive real-time notifications for events.

Contact for Webhook Setup →

Built for Developers

Fast & Reliable

99.9% uptime SLA with sub-100ms response times.

🔒

Secure by Default

Bank-grade encryption and PSD2 compliance.

📚

Comprehensive Docs

Detailed guides, examples, and best practices.

For Utility Service Providers

Utility providers (electricity, gas, water, broadband, mobile) can integrate with Opendeck to enable bill payments from users with ML-powered affordability checks and usage predictions.

Step 1: Register as an Operator

Utility providers use the same operator registration endpoint as gaming operators:

POST /api/gaming/operators
Content-Type: application/json

{
  "company_name": "Utility Provider Ltd",
  "trading_name": "Your Utility Service",
  "contact_email": "api@utilityprovider.com",
  "contact_phone": "+44 20 1234 5678",
  "company_number": "12345678",
  "website_url": "https://utilityprovider.com"
}

Note: uk_gambling_license is not required for utility providers.

Step 2: Account Activation

Utility provider accounts require activation by Opendeck for compliance and verification purposes.

After registration, Opendeck will:

  • Verify your company registration
  • Review compliance requirements
  • Activate your account (typically 1-2 business days)

Activation Status: Check your account status by calling GET /api/gaming/operators/me with your API key. Status will change from pending to active when approved.

Step 3: Enable Utility Payments

Once activated, users can connect their utility accounts and make payments through Opendeck:

  • Users link their utility accounts via POST /api/utilities/accounts
  • Users make bill payments via POST /api/utilities/pay
  • ML-powered affordability checks ensure users can afford payments
  • Usage predictions help optimize payment timing
  • You receive payments and can track them via the Merchant Dashboard
Supported Utility Types

Opendeck supports payments for:

Electricity

🔥

Gas

💧

Water

📡

Broadband

📱

Mobile

📞

Landline

📺

TV

🏛️

Council Tax

ML-Powered Features

Our ML-first infrastructure provides:

  • Usage Predictions - Predict future usage based on historical patterns
  • Affordability Checks - Real-time assessment of user's ability to pay
  • Payment Optimization - Suggest optimal payment timing and amounts
  • Risk Assessment - Identify users at risk of payment default
  • Auto-Pay Recommendations - ML-driven suggestions for automatic payments

GPU Acceleration: Our infrastructure uses GPU-accelerated ML models for sub-100ms inference times, ensuring fast affordability checks even with large datasets.

Example: Creating a Utility Account
POST /api/utilities/accounts
Authorization: Bearer YOUR_USER_TOKEN
Content-Type: application/json

{
  "provider": "british_gas",
  "provider_name": "British Gas",
  "utility_type": "electricity",
  "account_number": "12345678",
  "meter_number": "1234567890",
  "property_address": "123 Main St, London, SW1A 1AA",
  "is_primary": true
}
Example: Making a Utility Payment
POST /api/utilities/pay
Authorization: Bearer YOUR_USER_TOKEN
Content-Type: application/json

{
  "utility_account_id": "account-uuid-here",
  "amount": 125.50,
  "payment_source": "bank_account",
  "bill_reference": "BG-2024-001234",
  "bill_period_start": "2024-11-01T00:00:00Z",
  "bill_period_end": "2024-11-30T23:59:59Z",
  "usage_data": {
    "kwh_used": 450,
    "days_in_period": 30,
    "average_daily_usage": 15
  }
}

The usage_data field is used by our ML models for predictions and affordability analysis.

For Event Organizers & Venues

🎭

Events & Entertainment Integration

Enable automatic pension micro-contributions (0.01% of payments) to incentivize attendance at sports events, music shows, and entertainment venues. This proprietary feature helps venues stand out while promoting financial wellness.

Proprietary Feature: This is a unique Opendeck feature that automatically contributes 0.01% of all event payments to users' chosen pension accounts.

Supported Event Types

Sports Events

🎵

Music Shows

🎭

Theater

🎪

Entertainment

Payments include tickets, concessions, merchandise, parking, and upgrades.

How It Works
  1. Register Your Venue - Create a venue account and enable micro-contributions
  2. Create Events - Register events (sports, music, theater, etc.)
  3. Process Payments - When users pay at your venue, 0.01% is automatically calculated
  4. Automatic Contribution - Micro-contributions are batched daily and sent to users' pension accounts
  5. User Benefits - Users see their contributions in real-time, incentivizing attendance
Step 1: Register a Venue
POST /api/events/venues
Authorization: Bearer YOUR_USER_TOKEN
Content-Type: application/json

{
  "name": "Wembley Stadium",
  "venue_type": "stadium",
  "address": "Wembley, London",
  "city": "London",
  "postcode": "HA9 0WS",
  "capacity": 90000,
  "description": "National football stadium",
  "contribution_rate": 0.0001
}

The contribution_rate defaults to 0.0001 (0.01%) but can be customized per venue.

Step 2: Create an Event
POST /api/events/
Authorization: Bearer YOUR_USER_TOKEN
Content-Type: application/json

{
  "name": "Premier League Match: Arsenal vs Chelsea",
  "event_type": "sports",
  "venue_id": "venue-uuid-here",
  "start_date": "2024-12-15T15:00:00Z",
  "end_date": "2024-12-15T17:00:00Z",
  "description": "Premier League football match",
  "contribution_rate": 0.0001
}
Step 3: Process Event Payment with Micro-Contribution
POST /api/events/payments
Authorization: Bearer USER_TOKEN
Content-Type: application/json

{
  "event_id": "event-uuid-here",
  "payment_type": "ticket",
  "amount": 75.00,
  "pension_account_id": "pension-account-uuid",
  "payment_source": "open_banking",
  "currency": "GBP",
  "operator_transaction_id": "VENUE-TXN-12345"
}

Automatic Calculation: For a £75 payment, the system automatically calculates £0.0075 (0.01%) as a micro-contribution to the user's pension account. This happens seamlessly with every payment.

Viewing Micro-Contributions

Users can view their pension micro-contributions from events:

GET /api/events/contributions
Authorization: Bearer USER_TOKEN

Response:
{
  "contributions": [
    {
      "id": "contrib-uuid",
      "event_payment_id": "payment-uuid",
      "pension_account_id": "pension-uuid",
      "amount": 0.0075,
      "currency": "GBP",
      "status": "completed",
      "created_at": "2024-12-15T15:30:00Z"
    }
  ],
  "total_contributed": 0.0525,
  "total_count": 7
}
Benefits for Venues
  • Marketing Advantage - Unique value proposition to attract attendees
  • Social Impact - Demonstrates commitment to financial wellness
  • Competitive Differentiation - Stand out from competitors
  • Low Integration Cost - Minimal setup, automatic processing
  • User Engagement - Users see real-time contributions, increasing loyalty
Example Payment Flow

User buys: Match ticket (£50) + Food & drinks (£25) = £75 total

Micro-contribution: £0.0075 (0.01% of £75)

Result: Payment processed normally, micro-contribution automatically added to user's pension account

User sees: Real-time notification of contribution in their Opendeck dashboard