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

# Introduction

> Enable cross-border payments for your users with M2M's embeddable widget and simple API

## What is M2M?

M2M (Me2Me) is a B2B2C payment platform that enables your users to send money across borders through a secure, embeddable widget. As a partner, you integrate once and let M2M handle the complexity of cross-border payments, compliance, and user verification.

```mermaid theme={null}
sequenceDiagram
    participant Partner
    participant M2M_API as M2M API
    participant User
    participant Widget
    
    Partner->>M2M_API: Create magic link
    M2M_API-->>Partner: Return link URL
    Partner->>User: Send link (email, SMS, app)
    User->>Widget: Open link
    Widget->>User: Complete transaction
    Widget->>Partner: Webhook notification
```

## How it works

<Steps>
  <Step title="Create a magic link">
    Call the M2M API with your user's reference ID. Optionally include user data to reduce friction.
  </Step>

  <Step title="Share the link">
    Send the magic link to your user via email, SMS, push notification, or embed it in your app.
  </Step>

  <Step title="User completes transaction">
    Your user opens the link and completes their transfer through M2M's secure widget.
  </Step>

  <Step title="Receive notifications">
    Get real-time webhook notifications about link status and transaction events.
  </Step>
</Steps>

## Core concepts

<AccordionGroup>
  <Accordion title="Magic Links">
    A magic link is a secure, one-time URL that opens the M2M widget for a specific user. Each link is tied to a `referenceId` that identifies the user in your system.

    * Links expire after a configurable time (default: 60 minutes)
    * One active link per user at a time
    * Links can be pre-populated with user data
  </Accordion>

  <Accordion title="Reference ID">
    The `referenceId` is your unique identifier for a user. M2M uses this to:

    * Track users across multiple transactions
    * Detect if a user has completed identity verification (CIP)
    * Request additional data when needed

    Always use the same `referenceId` for the same user to ensure a seamless experience.
  </Accordion>

  <Accordion title="User Data & Friction">
    You control how much user data you provide upfront:

    * **Minimal integration**: Provide only `referenceId`. Users complete full verification in the widget.
    * **Full integration**: Provide all user data upfront. Users skip verification entirely.
    * **Hybrid**: Provide what you have, respond to webhooks for the rest.

    More data upfront = less friction for your users.
  </Accordion>

  <Accordion title="Webhooks">
    M2M sends real-time notifications to your configured webhook URL:

    * `link.opened` - User opened the magic link
    * `user.data_request` - M2M needs additional user data

    All webhooks are signed with HMAC-SHA256 for security.
  </Accordion>
</AccordionGroup>

## Get started

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/m2m/quickstart">
    Create your first magic link in minutes.
  </Card>

  <Card title="Authentication" icon="key" href="/m2m/authentication">
    Get your API keys and configure security.
  </Card>

  <Card title="User Data Guide" icon="user" href="/m2m/integration/user-data">
    Learn how to reduce friction for your users.
  </Card>

  <Card title="API Reference" icon="code" href="/m2m/api-reference/introduction">
    Explore the full API documentation.
  </Card>
</CardGroup>

## Environments

M2M provides a sandbox environment for your integration:

| Environment | Base URL                                | API Key Prefix | Purpose                 |
| ----------- | --------------------------------------- | -------------- | ----------------------- |
| Sandbox     | `https://m2m-backend-qa.up.railway.app` | `m2m_test_`    | Development and testing |

<Warning>
  Never use production API keys in development or testing environments. Use sandbox keys for all non-production work.
</Warning>
