API Documentation
Everything you need to integrate MagnetPay into your platform. RESTful endpoints, typed responses, and HMAC-signed webhooks.
https://api.magnetpay.org/v1Authentication
All API requests require authentication. MagnetPay supports two authentication methods: API key pair (for server-to-server) and Bearer token (for dashboard sessions). Include your credentials in every request header. Keys are scoped per environment (sandbox / production).
Payments
Accept payments via cards, bank transfers, UPI, and 30+ local methods. MagnetPay automatically routes to the optimal provider based on currency, region, and cost.
Subscriptions
Manage recurring billing with flexible intervals, trial periods, metered usage, and automatic retry logic. Supports proration and mid-cycle plan changes.
Payment Links
Create shareable payment links with no code required. Perfect for invoicing, one-time charges, and donation pages. Links can expire and support quantity limits.
Invoices
Create professional invoices with line items, tax calculations, and automated reminders. Invoices can be paid via hosted payment page or marked as paid manually.
Crypto
Accept and send crypto across 8 blockchain networks. HD wallet derivation per customer. Automatic deposit detection with configurable confirmation thresholds.
Cards
Issue virtual and physical cards across multiple providers through a unified API. Manage card lifecycle, set spending controls, and fund cards instantly.
Customers
Manage customer profiles for payments, subscriptions, and cards. Customers store payment methods, addresses, and billing preferences.
Coupons
Create discount coupons for payments and subscriptions. Supports percentage and fixed-amount discounts with optional usage limits and expiration dates.
Usage Records
Report metered usage for usage-based billing subscriptions. Usage is aggregated per billing period and charged on the next invoice.
Webhooks
Receive real-time notifications for payment events. All webhooks are signed with HMAC-SHA256 for verification. Failed deliveries are retried with exponential backoff (up to 72 hours).