Skip to main content

Prerequisites

Before you begin, make sure you have:
Use your sandbox API key (m2m_test_*) for this guide. You can switch to production once you’re ready to go live.
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).
1

Make the API call

curl -X POST https://api.sandbox.m2m.leapfinancial.com/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"
        }
      }
    }
  }'
2

Get the response

Response
{
  "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"
  }
}
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.
3

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.

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:
cURL
curl -X POST https://api.sandbox.m2m.leapfinancial.com/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"
        }
      }
    }
  }'
The more data you provide, the less your users need to enter. See the User Data Guide to understand the trade-offs.

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
Configure a webhook URL in the Partner Portal to receive real-time notifications:
Webhook: link.opened
{
  "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"
  }
}
Webhooks are signed with HMAC-SHA256. See Webhook Security to learn how to verify signatures.

Next steps

Authentication

Learn about API keys and security.

Create Link API

See all available options for creating links.

User Data Guide

Understand the friction vs. integration trade-off.

Webhooks

Set up real-time notifications.