JSPM

@uniwebpay/cli

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 141
  • Score
    100M100P100Q74681F
  • License MIT

uniweb CLI - Payment infrastructure for the AI era. Accept cards, e-wallets, and QR payments in Southeast Asia.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@uniwebpay/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    @uniwebpay/cli

    Command line tools for Uniweb payments. The installed executable is uniweb.

    Install

    npm install -g @uniwebpay/cli
    uniweb --version

    Production defaults:

    Setting Default
    API URL https://apiskill.uniwebpay.com
    Pay URL https://skill.uniwebpay.com

    Quick Start

    Create a wallet and save the generated secret locally:

    uniweb wallet create
    uniweb wallet info

    Create a one-time SGD 1.00 payment link:

    uniweb link create 100 -c SGD -n "Test order" --methods card

    Create a product, price, and checkout session:

    uniweb product create "Pro Plan" -d "Monthly subscription"
    uniweb price create prod_xxx -a 999 -t recurring -c SGD -i month
    uniweb checkout create -p price_xxx --mode subscription --success-url https://example.com/success --cancel-url https://example.com/cancel

    Amounts are always in the currency's minor unit. For example, 100 means SGD 1.00 and 1000 means SGD 10.00.

    Configuration

    The CLI stores local configuration in:

    ~/.uniweb/config.json

    Environment variables override the local config:

    Variable Purpose
    UNIWEB_SECRET API secret used for authenticated requests
    UNIWEB_API_URL Override API host
    UNIWEB_PAY_URL Override checkout/pay host
    UNIWEB_OUTPUT human or json

    Use --json on any command to get machine-readable output:

    uniweb --json payment list -s succeeded

    Commands

    Wallet

    uniweb wallet create
    uniweb wallet info
    uniweb wallet claim

    Products and Prices

    uniweb product create <name> [-d description] [-w webhook-url]
    uniweb product list
    uniweb product get <id>
    uniweb product update <id> [-n name] [-d description] [-w webhook-url]
    uniweb product delete <id>
    
    uniweb price create <productId> -a <cents> -t one_time [-c currency]
    uniweb price create <productId> -a <cents> -t recurring -i month [-c currency]
    uniweb price list

    price create prints a permanent /buy/price_xxx payment URL using the configured Pay URL.

    Checkout Sessions

    uniweb checkout create -p <priceId> [--success-url url] [--cancel-url url]
    uniweb checkout create -p <priceId> -m subscription --trial-days 14
    uniweb checkout get <id>
    uniweb checkout get <id> --watch

    Useful options:

    Option Purpose
    -m, --mode payment or subscription, default payment
    -q, --quantity Quantity, default 1
    --methods Comma-separated methods: card,alipay,paynow,wechat
    --customer-id Existing customer ID

    Subscription checkout uses card payments only.

    uniweb link create <amount> [-c currency] [-n name] [-d description] [--methods card,paynow]
    uniweb link list
    uniweb link get <id>
    uniweb link update <id> [-n name] [-d description] [--success-url url] [--cancel-url url]
    uniweb link activate <id>
    uniweb link deactivate <id>

    Customers

    uniweb customer create -e <email> [-n name]
    uniweb customer list
    uniweb customer get <id>
    uniweb customer update <id> [-e email] [-n name]
    uniweb customer delete <id>

    Payments and Refunds

    uniweb payment list [-s status] [-c customerId]
    uniweb payment get <id> [--gateway]
    uniweb payment void <id>
    uniweb payment refund <id> [-a cents] [--offline] [-r reason]
    
    uniweb refund create -p <paymentId> [-a cents] [-r reason] [--offline-refund]
    uniweb refund get <id> [--gateway]

    Payment statuses include pending, authorized, succeeded, failed, refunded, partially_refunded, and abandoned.

    Subscriptions

    uniweb subscription list
    uniweb subscription get <id>
    uniweb subscription cancel <id>
    uniweb subscription pause <id>
    uniweb subscription resume <id>

    API Keys

    uniweb key create -t server -n "Checkout Backend" -s products.read,prices.read,checkout.create,payments.read
    uniweb key create -t full -n "Admin CLI"
    uniweb key list
    uniweb key revoke <id>
    uniweb key roll <id>

    Use server keys for application backends. Keep full keys for local administration and wallet ownership flows.

    Webhooks

    uniweb webhook set https://example.com/webhooks/uniweb
    uniweb webhook info
    uniweb webhook remove
    uniweb webhook roll-secret
    uniweb webhook events

    Webhook URLs must use HTTPS. Store the returned whsec_xxx secret when setting or rolling the webhook secret.

    KYC, Bank Accounts, and Payouts

    uniweb kyc submit
    uniweb kyc status
    
    uniweb bank list
    uniweb bank add
    uniweb bank remove <id>
    uniweb bank set-default <id>
    
    uniweb payout list
    uniweb payout create -a <cents> -b <bankAccountId>
    uniweb payout cancel <id>
    uniweb payout status

    Local Development

    From the monorepo root:

    pnpm --filter @uniwebpay/cli dev -- --help
    pnpm --filter @uniwebpay/cli build