fungies
v0.5.2
Published
Official CLI for the Fungies Merchant of Record API
Maintainers
Readme
Official command-line interface for the Fungies API.
What is Fungies?
Fungies is a Merchant of Record platform built for digital product sellers — game developers, SaaS founders, and indie creators. It handles the entire payment infrastructure for you: checkout, tax calculation, invoicing, subscriptions, refunds, and global compliance — so you can sell digital products without setting up Stripe, dealing with VAT, or incorporating in every country.
With Fungies you can:
- Sell game keys, digital downloads, one-time products, and SaaS subscriptions
- Accept payments globally with automatic tax handling (VAT, GST, sales tax)
- Manage customers, orders, and subscription billing programmatically
- Embed checkout (overlay, hosted, or embedded) directly into your website or app
- Get paid via Stripe, PayPal, crypto/stablecoins, and more
Full API docs: docs.fungies.io · Help center: help.fungies.io
What is fungies-cli?
fungies-cli lets you manage your entire Fungies store from the terminal. Query orders, manage products and offers, handle subscriptions, export data, and automate workflows — without opening a browser.
Useful for:
- Support workflows — look up orders and customers by ID instantly
- Data exports — pipe to CSV for spreadsheets or analytics
- Automation — shell scripts for bulk key uploads, subscription management
- Developers — explore and test the API without writing code
Installation
npm install -g fungiesOr run without installing:
npx fungies [command]Requirements: Node.js 18+
Quick Start
1. Get your API keys
Go to your Fungies Dashboard → Developers → API Keys and generate your keys.
| Key | Prefix | Required for |
|-----|--------|-------------|
| Public Key | pub_ | All read operations |
| Secret Key | sec_ | Write operations (create, update, archive) |
2. Authenticate
fungies auth set --public-key pub_your_key_here --secret-key sec_your_key_hereRead-only mode (no secret key):
fungies auth set --public-key pub_your_key_here3. Verify the connection
fungies auth whoami
# ✓ Connected | Public: pub_****abc= | Secret: sec_****xyz=Commands
Authentication
fungies auth set --public-key pub_... --secret-key sec_...
fungies auth whoami # Verify connection
fungies auth clear # Remove saved keysProducts
In Fungies, a Product is the top-level item you sell. Products can have multiple Variants (configurations — e.g. Standard Edition, Deluxe Edition) and each variant can have multiple Offers (prices — e.g. €9.99 one-time, €2.99/month). Prices always live on Offers, never directly on Products or Variants.
Product types:
OneTimePayment— standard one-time purchaseSubscription— recurring billing (SaaS, memberships)Membership— access-based productGameKey— digital key distribution (Steam keys, etc.)
fungies products list
fungies products get <id>
fungies products create
fungies products update <id>
fungies products archive <id> # Soft delete — reversible; also archives associated offers
fungies products duplicate <id> # Copies product + variants (offers not duplicated)📖 Help: Add Game Keys · Add Subscription Product · Variants
Offers
An Offer defines exactly how a product can be purchased — price, currency, billing interval, and (for game keys) key inventory. A product must have at least one offer before customers can buy it.
Offer examples:
Starter Plan — $19/monthProfessional Plan — $299/yearGame Key (Global) — €9.99 one-time
fungies offers list
fungies offers list --product-id <product-id> # Filter by product
fungies offers get <id>
fungies offers create
fungies offers update <id>
fungies offers archive <id> # Soft delete — existing subscriptions on this offer continueManaging license/game keys on an offer:
fungies offers keys add <offer-id> --keys "KEY1,KEY2,KEY3" # Add keys to inventory
fungies offers keys remove <offer-id> <key-id> # Remove a specific unsold keyNote: Keys are automatically assigned to customers at purchase. Only unsold keys can be removed — keys already delivered to customers are preserved.
📖 Help: Add Game Keys · Variants of the Product
Orders
An Order is created when a customer completes a purchase — one-time buy, free claim, or first subscription payment. Recurring subscription renewal payments are tracked as separate Payment objects, not new orders.
fungies orders list
fungies orders list --status PAID # PAID | PENDING | CANCELLED | REFUNDED | FAILED
fungies orders list --limit 50
fungies orders list --from 2025-01-01 # Filter by creation date
fungies orders get <id>
fungies orders get <order-number> # Also accepts the short order number (e.g. 9XMrb9HkzBPcLIaJ)
fungies orders cancel <id>Note: Cancelling an order changes its status to
CANCELLEDbut does not automatically issue a refund. To refund a paid order, use the Fungies Dashboard or process through your payment provider directly.
📖 Help: Orders APIs · Cancel Order
Payments
A Payment represents an individual financial transaction — one-time purchases, subscription renewals, refunds, or extra charges. Each payment includes charge details, invoice info, and the customer who paid.
Payment types you'll see:
one_time— single purchasesubscription_initial— first payment of a new subscriptionsubscription_interval— recurring subscription renewalsubscription_extra— additional charge on top of subscription (usage-based billing)claim_free— free product claim
fungies payments list
fungies payments list --limit 50
fungies payments list --from 2025-01-01
fungies payments get <id>Subscriptions
Fungies handles the full subscription lifecycle: automated billing every interval, transactional emails, invoice generation, and management (pause, cancel, upgrade/downgrade). You can also charge customers extra on top of an existing subscription for usage-based billing (credits, API calls, storage, etc.).
fungies subscriptions list
fungies subscriptions list --status active # active | canceled | all
fungies subscriptions get <id>
fungies subscriptions cancel <id>
fungies subscriptions pause <id> # Pauses payment collection only — access is maintained
fungies subscriptions charge <id> --amount 200 --currency EUR # Charge €2.00 on top of subscriptionNote on
pause: Pausing a subscription stops payment collection but does NOT affect subscription periods or access to the product. The customer retains access while paused.
Note on
charge: Use this for usage-based billing — charge extra for credits, data, API calls, etc. on top of the customer's existing subscription. A separate invoice is generated for each charge.
📖 Help: Managing Subscriptions via API · Editing & Pausing Subscriptions · Additional charges on top of Subscriptions · Upgrade/Downgrade Plans
Discounts
Fungies supports two types of discounts:
- Coupon codes — customers enter a code at checkout (e.g.
SUMMER50) - Sale discounts — automatically applied based on configured conditions
Both support fixed amount and percentage reductions.
fungies discounts list
fungies discounts list --status active # active | archived
fungies discounts get <id>
fungies discounts create
fungies discounts update <id>
fungies discounts archive <id> # Soft delete — reversibleUsers
Users are the customers who have purchased from your store. The API lets you manage user accounts programmatically — create users, update billing details, look up purchase history, or archive accounts.
fungies users list
fungies users list --search [email protected] # Filter by email
fungies users get <id>
fungies users create
fungies users update <id>
fungies users archive <id> # Soft delete — reversible
fungies users unarchive <id> # Restore archived user
fungies users inventory <id> # View all purchases: products, subscriptions, access itemsNote on
users create: The email must be unique. If you providebillingDetails, ensurecountryCodeis valid andpostalCodeis included for US, CA, UA, and IN.
Webhooks
Fungies sends webhook events to your server for real-time notifications — payments, subscription changes, refunds, and more.
Supported events:
| Event | Fires when |
|-------|-----------|
| payment.success | Payment successfully processed |
| payment.refunded | Payment or partial payment refunded |
| payment.failed | Payment attempt fails |
| subscription.created | New subscription created |
| subscription.interval | Subscription renewed successfully |
| subscription.updated | Subscription modified (upgrade/downgrade/pause) |
| subscription.cancelled | Subscription cancelled |
# Start a local webhook listener (like stripe listen)
fungies webhooks listen
# Listen on a custom port and path, with signature verification
fungies webhooks listen --port 3000 --path /webhooks/fungies --secret sec_your_key
# Only show specific events
fungies webhooks listen --filter-event payment.success --filter-event subscription.created
# List all supported event types
fungies webhooks events
# Verify a webhook signature (useful for debugging)
fungies webhooks verify --payload '{"event":"payment.success"}' \
--signature <sig-from-header> \
--secret sec_your_keySetting up local development with webhooks:
- Start the listener:
fungies webhooks listen --secret sec_your_key - Expose it publicly:
ngrok http 4242 - Copy the ngrok HTTPS URL → paste into Fungies Dashboard → Developers → Webhooks
- Events appear in your terminal as they fire
📖 Help: Using Webhooks · Webhook Event Types
Checkout Elements
Checkout Elements are embeddable or hosted checkout experiences you can integrate into your website or app. They handle the full checkout flow: payment collection, tax calculation, and order creation. There are three types:
- Overlay Checkout — pop-up buy button you embed anywhere on a page
- Hosted Checkout — standalone checkout page hosted by Fungies
- Embedded Checkout — checkout embedded directly inside your app
fungies elements list
fungies elements create
fungies elements open <id>📖 Help: Overlay Checkout · Hosted Checkout · Embedded Checkout
Output Formats
All list commands support --format:
fungies orders list --format table # Default — human-readable table
fungies orders list --format json # Raw JSON
fungies orders list --format csv # CSV for spreadsheetsExamples
Look up an order by ID or order number
fungies orders get 2d448c93-5945-416c-916a-90aef8cea058
fungies orders get 9XMrb9HkzBPcLIaJList all paid orders
fungies orders list --status PAID --limit 100Export all payments to CSV
fungies payments list --limit 100 --format csv > payments.csvFind a customer by email
fungies users list --search [email protected]View everything a customer has purchased
fungies users inventory <user-id>List active subscriptions
fungies subscriptions list --status activeExport subscriptions as JSON and filter with jq
fungies subscriptions list --format json | jq '.items[] | {id, status, userId}'Charge a customer extra on top of their subscription (usage billing)
# Charge €2.00 for API overage
fungies subscriptions charge <subscription-id> --amount 200 --currency EURAdd game keys to an offer in bulk
fungies offers keys add <offer-id> --keys "XXXX-YYYY-ZZZZ,AAAA-BBBB-CCCC"Check all offers for a specific product
fungies offers list --product-id <product-id>List all discount codes with usage stats
fungies discounts list --format tableArchive an expired discount
fungies discounts archive <discount-id>Resources
- Fungies website: fungies.io
- API documentation: docs.fungies.io
- Help center: help.fungies.io
- Dashboard: app.fungies.io
- Getting started with the API: help.fungies.io/for-saas-developers/getting-started-with-the-api
License
MIT
