> ## 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.

# Quick Start

> Create your first magic link and enable cross-border payments in minutes

## Prerequisites

Before you begin, make sure you have:

* A M2M partner account (contact [sales@leapfinancial.com](mailto:sales@leapfinancial.com))
* Your API key from the [Partner Portal](https://partner.m2m.leapfinancial.com)

<Note>
  Use your sandbox API key (`m2m_test_*`) for this guide.
</Note>

## Create your first magic link

Let's say you have a US-based user, Michael Johnson, who holds a bank account in Mexico and needs to send money there. To create a magic link you need at minimum: the user's **first name**, **last name**, and a **payment method** (in this case, their Mexican bank account).

<Steps>
  <Step title="Make the API call">
    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://m2m-backend-qa.up.railway.app/partner/links \
        -H "X-API-Key: m2m_test_your_api_key_here" \
        -H "Content-Type: application/json" \
        -d '{
          "referenceId": "user_12345",
          "userData": {
            "name": {
              "firstName": "Michael",
              "lastName": "Johnson"
            },
            "paymentMethod": {
              "type": "bank_account",
              "bankAccount": {
                "country": "MX",
                "accountNumber": "014027000005555558"
              }
            }
          }
        }'
      ```

      ```javascript Node.js theme={null}
      const response = await fetch('https://m2m-backend-qa.up.railway.app/partner/links', {
        method: 'POST',
        headers: {
          'X-API-Key': 'm2m_test_your_api_key_here',
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({
          referenceId: 'user_12345',
          userData: {
            name: {
              firstName: 'Michael',
              lastName: 'Johnson'
            },
            paymentMethod: {
              type: 'bank_account',
              bankAccount: {
                country: 'MX',
                accountNumber: '014027000005555558'
              }
            }
          }
        })
      });

      const data = await response.json();
      console.log(data.data.url); // The magic link URL
      ```

      ```python Python theme={null}
      import requests

      response = requests.post(
          'https://m2m-backend-qa.up.railway.app/partner/links',
          headers={
              'X-API-Key': 'm2m_test_your_api_key_here',
              'Content-Type': 'application/json'
          },
          json={
              'referenceId': 'user_12345',
              'userData': {
                  'name': {
                      'firstName': 'Michael',
                      'lastName': 'Johnson'
                  },
                  'paymentMethod': {
                      'type': 'bank_account',
                      'bankAccount': {
                          'country': 'MX',
                          'accountNumber': '014027000005555558'
                      }
                  }
              }
          }
      )

      data = response.json()
      print(data['data']['url'])  # The magic link URL
      ```
    </CodeGroup>
  </Step>

  <Step title="Get the response">
    ```json Response theme={null}
    {
      "success": true,
      "data": {
        "linkId": "link_yourpartner_a1b2c3d4e5f6",
        "referenceId": "user_12345",
        "status": "created",
        "url": "https://widget.m2m.leapfinancial.com/link_yourpartner_a1b2c3d4e5f6/m2m-basic",
        "token": "550e8400-e29b-41d4-a716-446655440000",
        "expiresAt": "2026-02-10T15:30:00.000Z",
        "createdAt": "2026-02-10T14:30:00.000Z"
      }
    }
    ```

    <Check>
      You now have a magic link! The `url` field contains the link you'll send to your user. Michael's name and bank account will be pre-populated in the widget.
    </Check>
  </Step>

  <Step title="Send the link to your user">
    Share the magic link URL with your user through your preferred channel:

    * Email
    * SMS
    * Push notification
    * In-app button or link

    When Michael opens the link, he'll see the M2M widget with his name and bank account already filled in, and can complete the transfer.
  </Step>
</Steps>

## Reduce user friction even further

The example above covers the minimum required fields, but you can pre-fill additional data to skip more steps in the widget:

```bash cURL theme={null}
curl -X POST https://m2m-backend-qa.up.railway.app/partner/links \
  -H "X-API-Key: m2m_test_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "referenceId": "user_12345",
    "userData": {
      "name": {
        "firstName": "Michael",
        "lastName": "Johnson"
      },
      "idNumber": "123-45-6789",
      "idType": "SSN",
      "dob": "1988-03-22",
      "paymentMethod": {
        "type": "bank_account",
        "bankAccount": {
          "country": "MX",
          "accountNumber": "014027000005555558"
        }
      }
    }
  }'
```

<Tip>
  The more data you provide, the less your users need to enter. See the [User Data Guide](/m2m/integration/user-data) to understand the trade-offs.
</Tip>

## What happens next

After you create a link:

1. **User opens the link** - They see the M2M widget with any pre-populated data
2. **User completes verification** - If needed, they verify their identity (CIP)
3. **User initiates transfer** - They select amount, payment method, and confirm
4. **You receive webhooks** - Get notified about link status and transaction events

## Handle webhooks (optional but recommended)

Configure a webhook URL in the Partner Portal to receive real-time notifications:

```json Webhook: link.opened theme={null}
{
  "event": "link.opened",
  "timestamp": "2026-01-26T14:35:00.000Z",
  "data": {
    "linkId": "link_yourpartner_a1b2c3d4e5f6",
    "referenceId": "user_12345",
    "openedAt": "2026-01-26T14:35:00.000Z"
  }
}
```

<Info>
  Webhooks are signed with HMAC-SHA256. See [Webhook Security](/m2m/webhooks/security) to learn how to verify signatures.
</Info>

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/m2m/authentication">
    Learn about API keys and security.
  </Card>

  <Card title="Create Link API" icon="link" href="/m2m/api-reference/create-link">
    See all available options for creating links.
  </Card>

  <Card title="User Data Guide" icon="user" href="/m2m/integration/user-data">
    Understand the friction vs. integration trade-off.
  </Card>

  <Card title="Webhooks" icon="bell" href="/m2m/webhooks/overview">
    Set up real-time notifications.
  </Card>
</CardGroup>
