M2Squared Finance Logo

Build with M2Square APIs

Integrate stablecoin payment infrastructure into your application with our RESTful APIs. Simple, powerful, and production-ready.

Quick Start Guide

1

Get API Keys

Sign up and generate your API keys from the dashboard. Keep your secret key secure.

API_KEY=sk_live_...
2

Install SDK

Install our SDK for your preferred language (JavaScript, Python, Go, PHP).

npm install @m2square/sdk
3

Make Your First Call

Initialize the SDK and make your first API request.

m2square.payments.create()

Authentication

All API requests require authentication using your API key. Include your key in the Authorization header:

curl https://api.m2square.com/v1/settlements \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json"

Security Note: Never share your secret key or commit it to version control. Use environment variables in production.

Core API Endpoints

Settlement API

Create and manage cross-border settlements

POST /settlements
GET /settlements/:id

Payment API

Process payments and payouts globally

POST /payments
GET /payments/:id
POST /payouts

Liquidity API

Manage liquidity pools and yields

POST /liquidity/deposit
GET /liquidity/positions

KYC API

Identity verification and compliance

POST /kyc/verify
GET /kyc/status/:id

Code Examples

Create a Settlement

const m2square = require('@m2square/sdk');

// Initialize with your API key
const client = new m2square.Client({
  apiKey: process.env.M2SQUARE_API_KEY
});

// Create a cross-border settlement
const settlement = await client.settlements.create({
  amount: 10000,
  currency: 'USD',
  recipient: {
    country: 'MX',
    currency: 'MXN',
    accountId: 'recipient_id_123'
  },
  settlementMethod: 'instant',
  metadata: {
    orderId: 'order_123'
  }
});

console.log('Settlement ID:', settlement.id);
console.log('Status:', settlement.status);

Rate Limits & Best Practices

API Rate Limits

  • • Standard: 100 requests/minute
  • • Premium: 1,000 requests/minute
  • • Enterprise: Custom limits
  • • Webhook deliveries: Unlimited

Best Practices

  • • Use webhooks for async updates
  • • Implement exponential backoff
  • • Cache responses when appropriate
  • • Use idempotency keys

Ready to Start Building?

Get your API keys and start integrating M2Square today.