API Reference
Complete API reference for integrating Margin's payment optimization products into your checkout flow.
Getting Started
Margin provides real-time APIs to optimize payment costs at checkout. Integrate our products to: detect high-cost commercial cards, promote lower-cost payment methods, analyze FX markups, optimize refund handling, and prevent interchange downgrades.
Authentication
Authenticate API requests using your API key. Include it in the X-API-Key header:
X-API-Key: sk_live_your_api_key_hereGet your API keys from the API Keys settings page. Most endpoints work without authentication for testing, but require an API key in production for usage tracking and billing.
Available Products
margin/steer
Intelligent steering away from high-cost commercial cards
margin/push
Proactive promotion of SEPA Instant and Open Banking rails
margin/fx
Detection and mitigation of hidden FX markups
margin/back
Minimization of non-recovered interchange on refunds
margin/down
Prevention of interchange downgrades
Base URL
https://margin.so/apiRate Limits
API requests are rate-limited based on your subscription plan. Free tier accounts are limited to 100 requests per minute. Contact sales for higher limits or upgrade your plan.