StablePay Product Documentation

website·Indexed 31 days ago

https://docs.wenfu.cn

StablePay 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.

Tokens
31.3K
Snippets
112
Records
250
Agent score
49%

What's inside StablePay

  1. Overview of StablePay Stablecoin Subscriptions

    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.
  2. 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.
  3. 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 include invoice.created (initial or renewal), invoice.paid (payment success), and invoice.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"
        }
      }
    }
  4. 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.
  5. 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
  6. StablePay API Service Overview

    StablePay provides three primary API services for cryptocurrency management:

    1. 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.
    2. Subscription API: Used for recurring billing, managing membership subscriptions, and handling subscription-related invoices and refunds.
    3. Refund API: Used for processing full or partial refunds, tracking blockchain transactions, and managing asynchronous refund requests.
  7. 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.
  8. Refund object data structure

    The Refund object 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
    }
  9. 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.co
  10. StablePay 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
  11. 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.
  12. 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.