StablePay Product Documentation
website·Indexed 31 days ago
https://docs.wenfu.cnStablePay provides global merchants with low-cost stablecoin payment capabilities for USDT and USDC across TRON, Ethereum, BSC, and Solana networks. The platform features a REST API for payment and refund management, a stablecoin subscription service for periodic billing, and automatic currency conversion to USD. It offers dedicated integration guides for SaaS platforms including Shopify, WooCommerce, Shoplazza, and SHOPYY.
What's inside StablePay
- StablePay Stablecoin Subscription manages the recurring billing lifecycle for customers using USDC/USDT. It allows merchants to set flexible billing cycles (daily, weekly, monthly, or yearly). The process involves an initial on-session wallet authorization, followed by off-session automatic renewal billing. The business state of the subscription is driven by Webhooks.
Overview of StablePay Stablecoin Subscriptions
StablePay Stablecoin Subscription manages the recurring billing lifecycle for customers using USDC/USDT. It allows merchants to set up flexible billing cycles (daily, weekly, monthly, or yearly). The process begins with an on-session wallet authorization, enabling subsequent off-session automatic renewal billing. Business state updates are driven by Webhooks.Handle Invoice Subscription Events
The Subscription API sends webhook events to notify your system about invoice status changes. These events include the invoice ID, subscription ID, customer ID, and payment details. Common event types includeinvoice.created(initial or renewal),invoice.paid(payment success), andinvoice.payment_failed(payment failure).{ "id": "evt_1774924900123456789", "type": "invoice.paid", "created_at": 1774924800, "data": { "object": { "invoice_id": "202603311103103103010000000001", "subscription_id": "202603311103103101010000000001", "customer_id": "cust_001", "amount_due": 1999, "amount_paid": 1999, "amount_remaining": 0, "currency": "USD", "status": "paid", "payment_status": "paid", "billing_reason": "subscription_cycle", "period_start": 1774886400, "period_end": 1777478400, "paid_at": 1774925100, "source": "api" } } }StablePay product capabilities overview
StablePay provides a suite of financial tools for global products:
- Payments: Create sessions to accept multi-chain, multi-currency crypto payments.
- Subscription Services: Manage subscription plans, recurring billing, trial periods, and billing tracking.
- Refunds: Process full or partial refunds directly back to the customer's wallet.
- Currency Conversion: Real-time exchange between 15 fiat currencies and stablecoins.
- Account Management: Query merchant balances, transaction history, and manage multi-currency funds.
Understand StablePay Webhook request specifications
StablePay sends HTTP POST requests to a merchant's configured Webhook URL when payment statuses change (e.g., payment completed, payment failed, or refund succeeded).
Request Details:
- Method: POST
- Content-Type: application/json
- Character Encoding: UTF-8
- Timeout: 30 seconds
StablePay API Service Overview
StablePay provides three primary API services for cryptocurrency management:
- Payment API: Used for creating and managing checkout sessions, querying payment status, and handling multi-currency support (e.g., USDT, USDC) with automatic exchange rate locking.
- Subscription API: Used for recurring billing, managing membership subscriptions, and handling subscription-related invoices and refunds.
- Refund API: Used for processing full or partial refunds, tracking blockchain transactions, and managing asynchronous refund requests.
Understand StablePay Payment Sessions
A Payment Session is the core concept of the StablePay payment flow, acting as a temporary container for a single payment request. It encapsulates the payment amount, currency, merchant order details, the receiving address, and the session's expiration time.Refund object data structure
TheRefundobject represents a refund transaction and contains details about the payment session, order, amount, and current status.interface Refund { refund_id: string; // Refund ID (provided by merchant) session_id: string; // Payment session ID order_id: string; // Order ID amount: int64; // Refund amount (Minimum currency precision) currency: "USDT" | "USDC"; // Currency type status: RefundStatus; // Refund status reason?: RefundReason; // Refund reason description?: string; // Refund description failure_reason?: string; // Refund failure reason (only when failed) transaction_hash?: string; // Blockchain transaction hash (only when completed) receipt_number?: string; // Refund receipt number (only when completed) created_at: number; // Creation timestamp processed_at?: number; // Processing completion timestamp metadata?: Record<string, any>; // Metadata }StablePay API Overview and Base URL
The StablePay payment API provides cryptocurrency payment capabilities for stablecoins (USDT, USDC) across TRON, Ethereum, BSC, and Solana networks. All requests use HTTPS, JSON data format, and UTF-8 character encoding.Base URL:https://api.stablepay.coStablePay Subscription API Overview
The Subscription API uses JSON over HTTPS for managing subscriptions, invoices, payments, and refunds.
- Base URL:
https://api.stablepay.co - API Prefix:
/api/v1 - Protocol: HTTPS
- Data Format: JSON
- Character Encoding: UTF-8
- Base URL:
Understand StablePay automatic currency conversion
StablePay automatically converts non-USD product pricing to USD using real-time exchange rates (based on major international bank mid-rates) during the payment process. All settlements are completed in USDT or USDC on a 1:1 basis with the converted USD amount. This feature is enabled by default and cannot be disabled via the dashboard.Understand StablePay automatic currency conversion
StablePay automatically converts non-USD product pricing into USD at real-time exchange rates during the payment process. All transactions are settled in USDT or USDC. This feature is enabled by default and cannot be disabled via the dashboard. The system uses major international bank mid-rates for conversion with no additional markup. Settlement remains T+1.