Skip to main content

Custom Platform Integration Guide

Learn how to integrate Fanfare experiences with any e-commerce platform or custom-built system.

Overview

This guide covers building a complete Fanfare integration for platforms without a pre-built plugin or app. Whether you’re using a headless commerce platform, custom-built store, or enterprise solution, this guide provides the patterns and code you need. What you’ll learn:
  • Designing your integration architecture
  • Implementing the consumer-facing experience
  • Building the server-side validation layer
  • Handling checkout and order completion
  • Setting up webhooks for real-time updates
Complexity: Advanced Time to complete: 60+ minutes

Prerequisites

  • Fanfare organization and API credentials
  • Backend server with API capabilities
  • Understanding of your platform’s checkout flow
  • Ability to store custom data with orders

Architecture Overview

Custom platform architecture showing frontend SDK, backend API, database, and Fanfare platform APIs.

Step 1: Backend Configuration

Environment Setup

Fanfare API Client

Step 2: Database Schema

Store Fanfare-related data with your orders:

Step 3: Frontend Integration

HTML/JavaScript (Vanilla)

React Integration

Step 4: Server-Side Validation

Validation Middleware

Checkout API Endpoint

Step 5: Webhook Handler

Step 6: Product Configuration API

CSS Styles

Best Practices

1. Handle Network Failures Gracefully

2. Implement Idempotency

3. Monitor Integration Health

Troubleshooting

SDK Not Loading

  1. Check if script tag is present in page source
  2. Verify no CSP (Content Security Policy) blocks
  3. Check browser console for network errors

Validation Failures

Webhook Not Receiving Events

  1. Verify webhook URL is publicly accessible
  2. Check webhook secret is configured correctly
  3. Test with webhook debugging tools
  4. Review server logs for signature mismatches

What’s Next