> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gosurge.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Welcome to the Surge developer documentation. Embed a full BNPL checkout into any Nigerian store in under 30 minutes.

## What is Surge?

Surge is Nigeria's embedded Buy Now, Pay Later (BNPL) infrastructure. Merchants add a single script tag and their customers can immediately split any purchase into installments — without leaving the store. Surge handles risk scoring, payment collection, delinquency management, and merchant settlement.

<Card title="→ Start with the Quickstart" icon="rocket" href="/docs/quickstart">
  Go from zero to a working checkout in under 30 minutes. Includes Node.js, Python, React, and Next.js code examples.
</Card>

## How it works

1. **Register as a Merchant** — Sign up at [merchant.gosurge.xyz](https://merchant.gosurge.xyz/register).
2. **Get your API key** — Your `surge_live_sk_...` API key is issued on approval. Find your Merchant ID under **Settings → API Keys**.
3. **Create a Checkout Session** — Your backend calls `POST /api/v1/checkout/sessions` with your API key and the cart amount.
4. **Open the Widget** — Pass the session token to the Surge JS SDK on your frontend.
5. **Handle Webhooks** — Listen for `payment.success` to fulfill orders.

<CardGroup cols={2}>
  <Card title="Server Integration" icon="server" href="/docs/server-integration">
    Create checkout sessions from your backend and start accepting installments.
  </Card>

  <Card title="Client SDK" icon="code" href="/docs/client-integration">
    Embed the Surge widget into your frontend with our JavaScript SDK.
  </Card>

  <Card title="Webhooks" icon="webhook" href="/docs/webhooks">
    Receive real-time events for payment success, failures, and settlements.
  </Card>

  <Card title="Payment Methods" icon="credit-card" href="/docs/payment-methods">
    Manage customer cards and bank direct debit mandates via the API.
  </Card>
</CardGroup>

## Integration Overview

```
Merchant Backend  →  POST /checkout/sessions   →  Surge API
                       Authorization: Bearer surge_live_sk_...
                  ←  { session_token }          ←
Merchant Frontend →  surge.openCheckout({ sessionToken })
Customer          →  logs in, selects plan, pays deposit
Surge             →  fires payment.success webhook to merchant
```

<CardGroup cols={2}>
  <Card title="API Reference" icon="rectangle-terminal" href="/docs/api-reference/overview">
    Full REST API reference with request/response schemas.
  </Card>

  <Card title="Live Demo" icon="play" href="https://gosurge.xyz/demo">
    Try the Surge checkout experience right now.
  </Card>
</CardGroup>
