curl --request POST \
--url https://m2m-backend-qa.up.railway.app/partner/links \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"referenceId": "user-12345",
"expiresInMinutes": 120,
"metadata": {
"orderId": "ORD-2026-001",
"campaign": "february-promo"
},
"flow": "m2m-basic",
"theme": "dark",
"language": "es",
"callbackUrl": "https://api.example.com/callbacks/m2m"
}
'import requests
url = "https://m2m-backend-qa.up.railway.app/partner/links"
payload = {
"referenceId": "user-12345",
"expiresInMinutes": 120,
"metadata": {
"orderId": "ORD-2026-001",
"campaign": "february-promo"
},
"flow": "m2m-basic",
"theme": "dark",
"language": "es",
"callbackUrl": "https://api.example.com/callbacks/m2m"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
referenceId: 'user-12345',
expiresInMinutes: 120,
metadata: {orderId: 'ORD-2026-001', campaign: 'february-promo'},
flow: 'm2m-basic',
theme: 'dark',
language: 'es',
callbackUrl: 'https://api.example.com/callbacks/m2m'
})
};
fetch('https://m2m-backend-qa.up.railway.app/partner/links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://m2m-backend-qa.up.railway.app/partner/links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'referenceId' => 'user-12345',
'expiresInMinutes' => 120,
'metadata' => [
'orderId' => 'ORD-2026-001',
'campaign' => 'february-promo'
],
'flow' => 'm2m-basic',
'theme' => 'dark',
'language' => 'es',
'callbackUrl' => 'https://api.example.com/callbacks/m2m'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://m2m-backend-qa.up.railway.app/partner/links"
payload := strings.NewReader("{\n \"referenceId\": \"user-12345\",\n \"expiresInMinutes\": 120,\n \"metadata\": {\n \"orderId\": \"ORD-2026-001\",\n \"campaign\": \"february-promo\"\n },\n \"flow\": \"m2m-basic\",\n \"theme\": \"dark\",\n \"language\": \"es\",\n \"callbackUrl\": \"https://api.example.com/callbacks/m2m\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://m2m-backend-qa.up.railway.app/partner/links")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"referenceId\": \"user-12345\",\n \"expiresInMinutes\": 120,\n \"metadata\": {\n \"orderId\": \"ORD-2026-001\",\n \"campaign\": \"february-promo\"\n },\n \"flow\": \"m2m-basic\",\n \"theme\": \"dark\",\n \"language\": \"es\",\n \"callbackUrl\": \"https://api.example.com/callbacks/m2m\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://m2m-backend-qa.up.railway.app/partner/links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"referenceId\": \"user-12345\",\n \"expiresInMinutes\": 120,\n \"metadata\": {\n \"orderId\": \"ORD-2026-001\",\n \"campaign\": \"february-promo\"\n },\n \"flow\": \"m2m-basic\",\n \"theme\": \"dark\",\n \"language\": \"es\",\n \"callbackUrl\": \"https://api.example.com/callbacks/m2m\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"linkId": "link_acme_a1b2c3d4e5f6",
"referenceId": "user-12345",
"status": "created",
"url": "https://widget.m2m.leapfinancial.com/link_acme_a1b2c3d4e5f6/m2m-basic",
"token": "550e8400-e29b-41d4-a716-446655440000",
"expiresAt": "2026-02-11T12:00:00.000Z",
"createdAt": "2026-02-10T12:00:00.000Z"
}
}Create a magic link
Creates a new magic link that can be sent to an end user to initiate a money transfer. Optionally pre-fill user data (name, ID, payment method) and configure the link’s expiration, flow, theme, and language. Returns the full widget URL and authentication token.
curl --request POST \
--url https://m2m-backend-qa.up.railway.app/partner/links \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"referenceId": "user-12345",
"expiresInMinutes": 120,
"metadata": {
"orderId": "ORD-2026-001",
"campaign": "february-promo"
},
"flow": "m2m-basic",
"theme": "dark",
"language": "es",
"callbackUrl": "https://api.example.com/callbacks/m2m"
}
'import requests
url = "https://m2m-backend-qa.up.railway.app/partner/links"
payload = {
"referenceId": "user-12345",
"expiresInMinutes": 120,
"metadata": {
"orderId": "ORD-2026-001",
"campaign": "february-promo"
},
"flow": "m2m-basic",
"theme": "dark",
"language": "es",
"callbackUrl": "https://api.example.com/callbacks/m2m"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
referenceId: 'user-12345',
expiresInMinutes: 120,
metadata: {orderId: 'ORD-2026-001', campaign: 'february-promo'},
flow: 'm2m-basic',
theme: 'dark',
language: 'es',
callbackUrl: 'https://api.example.com/callbacks/m2m'
})
};
fetch('https://m2m-backend-qa.up.railway.app/partner/links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://m2m-backend-qa.up.railway.app/partner/links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'referenceId' => 'user-12345',
'expiresInMinutes' => 120,
'metadata' => [
'orderId' => 'ORD-2026-001',
'campaign' => 'february-promo'
],
'flow' => 'm2m-basic',
'theme' => 'dark',
'language' => 'es',
'callbackUrl' => 'https://api.example.com/callbacks/m2m'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://m2m-backend-qa.up.railway.app/partner/links"
payload := strings.NewReader("{\n \"referenceId\": \"user-12345\",\n \"expiresInMinutes\": 120,\n \"metadata\": {\n \"orderId\": \"ORD-2026-001\",\n \"campaign\": \"february-promo\"\n },\n \"flow\": \"m2m-basic\",\n \"theme\": \"dark\",\n \"language\": \"es\",\n \"callbackUrl\": \"https://api.example.com/callbacks/m2m\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://m2m-backend-qa.up.railway.app/partner/links")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"referenceId\": \"user-12345\",\n \"expiresInMinutes\": 120,\n \"metadata\": {\n \"orderId\": \"ORD-2026-001\",\n \"campaign\": \"february-promo\"\n },\n \"flow\": \"m2m-basic\",\n \"theme\": \"dark\",\n \"language\": \"es\",\n \"callbackUrl\": \"https://api.example.com/callbacks/m2m\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://m2m-backend-qa.up.railway.app/partner/links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"referenceId\": \"user-12345\",\n \"expiresInMinutes\": 120,\n \"metadata\": {\n \"orderId\": \"ORD-2026-001\",\n \"campaign\": \"february-promo\"\n },\n \"flow\": \"m2m-basic\",\n \"theme\": \"dark\",\n \"language\": \"es\",\n \"callbackUrl\": \"https://api.example.com/callbacks/m2m\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"linkId": "link_acme_a1b2c3d4e5f6",
"referenceId": "user-12345",
"status": "created",
"url": "https://widget.m2m.leapfinancial.com/link_acme_a1b2c3d4e5f6/m2m-basic",
"token": "550e8400-e29b-41d4-a716-446655440000",
"expiresAt": "2026-02-11T12:00:00.000Z",
"createdAt": "2026-02-10T12:00:00.000Z"
}
}Authorizations
Your partner API key. Use m2m_test_* keys for the sandbox environment.
Body
Your unique identifier for the end user in your system. Used to correlate M2M users with your records and to detect returning users.
"user-12345"
Link time-to-live in minutes. The link becomes inaccessible after expiration. Minimum: 5 minutes. Maximum: 10,080 minutes (7 days). Defaults to the partner-level configuration (usually 60 minutes).
5 <= x <= 10080120
Pre-filled user data. Any fields provided here will be pre-populated in the widget, allowing the user to skip those steps.
Show child attributes
Show child attributes
Arbitrary key-value metadata to attach to the link. Useful for storing internal references, campaign IDs, etc. Returned in link detail and webhook payloads.
{
"orderId": "ORD-2026-001",
"campaign": "february-promo"
}
Widget flow type that determines the user experience. Defaults to "m2m-basic" if not specified.
"m2m-basic"
Theme identifier to customize the widget appearance. Overrides the partner-level theme configuration for this link.
"dark"
Language code for the widget UI (ISO 639-1). Overrides browser detection.
en, es "es"
URL to receive callback notifications for this specific link. Overrides the partner-level webhook URL for link-specific events.
"https://api.example.com/callbacks/m2m"