Skip to main content

What is Suby.fi?

Suby.fi is a payment platform for one-time and subscription payments. Accept credit/debit card payments and cryptocurrency payments, with pricing in USD or EUR. Whether you’re running a SaaS business, online community, or digital product service, Suby provides the infrastructure to handle payments, manage subscriptions, and grant access to your customers automatically.

Payment Methods

Suby.fi supports three payment configurations depending on your needs: You configure payment methods per product using the paymentMethods field: ["CARD"], ["CRYPTO"], or ["CARD", "CRYPTO"].

Supported Currencies

Products can be priced in USD or EUR. The currency is set at product creation via the currency field.
  • Card payments: Charged in the product’s currency (USD or EUR)
  • Crypto payments: Converted automatically using real-time oracle rates (Pyth)

Supported Chains & Assets

You can restrict accepted chains and assets per product, or leave them open to accept all available options. Need a different EVM-compatible chain or token? Additional chains and assets can be added on request, [contact us](https://discord.com/invite/C8dxBm3hpj).

Who is this API for?

This API is intended for merchants who want to:
  • Accept fiat and/or crypto payments for one-time purchases & subscriptions
  • Automate subscription management and renewals
  • Integrate payments into their existing web applications
  • Receive real-time notifications about payment events via webhooks
  • Build custom checkout flows with payment intents

Getting Started

Before you begin integrating the API, you’ll need:
  1. Create a Suby.fi Account: Sign up at https://app.suby.fi
  2. Generate Your API Key:
    • Navigate to Dashboard Settings
    • Generate your merchant API key
    • Store it securely, it will only be shown once
    • Use this key in the X-Suby-Api-Key header for all API requests
  3. Create a Product:
    • Set up your one-time or subscription products from the dashboard or via the API
    • Configure pricing, currency, payment methods, and accepted assets
    • Note your product IDs for API integration
  4. Set Up Webhooks (recommended):
    • Configure your webhook URL in the dashboard settings
    • Store your webhook secret securely for signature verification
    • Implement handlers for the events relevant to your use case
  5. **Get Approved for Card Payments **(if using card):
    • Navigate to Card Request
    • Submit your proof of business (website, description, expected volume)
    • Once approved, you can enable "CARD" as a payment method on your products

Integration Flow

Customer Identity

Every customer has a stable customerId, returned by the GET /api/customer endpoints and on every payment/subscription response and webhook. It never changes — even if the customer later changes their email — so it is the reliable key for long-term account history. On POST /api/payment/create and POST /api/subscription/create you can identify the customer two ways: When neither is provided, webhooks fired before the buyer supplies their email (e.g. CHECKOUT_INITIATED) carry customerId: null and customerEmail: null. Webhooks fired after a successful payment (CHECKOUT_SUCCESS, PAYMENT_SUCCESS, …) always include both. customerFirstName / customerLastName are optional; they only backfill a display name when the customer has none, and are ignored when neither customerId nor customerEmail is provided.

Idempotent Refunds

POST /api/refund/:paymentId accepts an optional Idempotency-Key header — any unique string you generate per refund. If a request times out, retry it with the same key: the original result is replayed instead of issuing the refund again, and the response carries Idempotency-Replayed: true.
This matters most for partial refunds, which are otherwise legitimately repeatable — without a key, a retried timeout would refund twice. A full refund is naturally idempotent (a second call returns a “not refundable” error). Reusing a key with a different request body returns 409 (IDEMPOTENCY_KEY_CONFLICT). Retrying while the first request is still in flight also returns 409 (IDEMPOTENCY_REQUEST_IN_PROGRESS) — retry shortly. The key can also be passed as an idempotencyKey body field; the header takes precedence.

Webhook Events

Suby.fi sends signed webhooks to notify your server about payment lifecycle events. Configure your webhook URL in the dashboard settings. Payment events: Subscription events:

Webhook Payload

Every webhook is signed with HMAC-SHA256 for security. The signature is sent in the X-Webhook-Signature header. Payment webhook:
Payment settled webhook: The PAYMENT_SETTLED event has a different payload structure since it bundles every merchant payout settled in this event and every payment they include. Each payment carries a payoutId so you can link it back to the originating payout.
Card payments only. This event is emitted only for card payouts (funds sent to the merchant’s bank account / IBAN / ACH). Crypto payments settle directly on-chain to the merchant wallet and never trigger a PAYMENT_SETTLED event.
Subscription webhook:

Webhook Headers

Verifying Webhook Signatures

Reject webhooks with a timestamp older than 5 minutes to prevent replay attacks.

Sample Webhook Server

We provide a complete example server that demonstrates webhook reception and signature verification: Repository: https://github.com/hunterlabs-fi/suby-test-server This example includes:
  • Webhook signature verification
  • Event handling for all webhook types
  • Payment intent creation
  • Product management via API
  • Express.js + TypeScript implementation

API Endpoints Overview

All endpoints require the X-Suby-Api-Key header.

Quick Example: Create a Payment

Key Features

  • Flexible Payment Methods: Card only, crypto only, or both, per product
  • Multi-Currency Pricing: Price in USD or EUR
  • Multi-Chain Crypto: Accept payments on Ethereum, Base, Arbitrum, BSC, and Solana
  • Multi-Asset Support: USDC, USDT, ETH, SOL, and more
  • One-Time & Subscriptions: Set frequencyInDays for recurring, omit for one-time
  • Automatic Renewals: Recurring subscriptions are handled automatically
  • Webhook Notifications: Signed webhooks for all payment lifecycle events
  • Secure Authentication: API key-based authentication with HMAC-SHA256 webhook verification
  • Metadata Support: Attach custom data to payments for your internal tracking
  • Platform Integrations: Web, Invoice, Discord and Telegram, with automatic access management