Base URLs
The M2M Partner API is available in two environments:| Environment | Base URL |
|---|---|
| Sandbox | https://api.sandbox.m2m.leapfinancial.com |
| Production | https://api.m2m.leapfinancial.com |
Always use the sandbox environment for development and testing. Switch to production only when you’re ready to process real transactions.
Authentication
All API requests require authentication via theX-API-Key header:
Your API key. Use
m2m_test_* for sandbox, m2m_live_* for production.Must be
application/json for all POST/PUT requests.Response format
All successful responses follow this structure:Always
true for successful responses.The response payload. Structure varies by endpoint.
Error responses
When an error occurs, the response includes an error code and message:Always
false for error responses.Error details.
HTTP status codes
| Status | Description |
|---|---|
200 | Success |
201 | Created (for POST requests that create resources) |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Valid key but insufficient permissions |
404 | Not Found - Resource doesn’t exist |
409 | Conflict - Resource already exists (e.g., active link for user) |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |
Common error codes
| Code | Description |
|---|---|
UNAUTHORIZED | Missing or invalid authentication |
INVALID_API_KEY | API key is invalid or revoked |
PARTNER_SUSPENDED | Partner account is suspended |
INVALID_REQUEST | Request validation failed |
RESOURCE_NOT_FOUND | Requested resource doesn’t exist |
ACTIVE_LINK_EXISTS | User already has an active link |
LINK_EXPIRED | Magic link has expired |
REFERENCE_ID_MISMATCH | Reference ID doesn’t match |
Rate limiting
The API enforces rate limits to ensure fair usage:| Endpoint | Limit |
|---|---|
| Create Link | 100 requests/minute |
| Other endpoints | 1000 requests/minute |
429 Too Many Requests response:
Pagination
List endpoints support pagination usinglimit and offset parameters:
Maximum number of results to return. Range: 1-100.
Number of results to skip for pagination.
Idempotency
For POST requests, you can include anIdempotency-Key header to ensure the request is processed only once:
Idempotency-Key, you’ll receive the same response as the original request.
Available endpoints
Create Link
Generate a magic link for your user.