@shegerpay/cli
v1.4.0
Published
ShegerPay CLI — verify Ethiopian payments, manage payment links and webhooks. Connect with one approval, no API key to paste.
Maintainers
Readme
ShegerPay CLI
Official command-line interface for ShegerPay - The African Payment Gateway. Manage payments, crypto, PayPal, webhooks, and your account from the terminal.
Installation
npm install -g @shegerpay/cliQuick Start
Get your API key from shegerpay.com/dashboard/settings/api-keys
Configure the CLI:
shegerpay config set sk_test_your_api_key_here- Start using ShegerPay:
shegerpay verify payment FT241227ABC123 --amount 500Commands
Configuration
# Set your API key
shegerpay config set <api-key>
# Show current configuration
shegerpay config get
# Clear all configuration
shegerpay config clearPayment Verification
# Verify Ethiopian bank payment
shegerpay verify payment <transaction-id> [options]
-a, --amount <amount> Expected payment amount
-p, --provider <provider> Provider (cbe, telebirr, awash, boa, ebirr)
-j, --json Output as JSON
# Quick verify (auto-detect provider)
shegerpay verify quick <transaction-id>
# Get payment history
shegerpay verify history [options]
-l, --limit <limit> Maximum results (default: 50)
-p, --provider <provider> Filter by provider
-s, --status <status> Filter by status
-j, --json Output as JSONExamples:
shegerpay verify payment FT241227ABC123 --amount 500 --provider cbe
shegerpay verify quick TB123456789
shegerpay verify history --limit 20 --status verifiedCryptocurrency
# Get current crypto prices
shegerpay crypto prices
# Create crypto payment
shegerpay crypto create [options]
-a, --amount <amount> Payment amount (required)
-c, --currency <currency> Fiat currency (required)
--crypto <crypto> Crypto currency (required)
-e, --email <email> Customer email
-j, --json Output as JSON
# Verify crypto payment
shegerpay crypto verify <reference> <tx-hash>Examples:
shegerpay crypto prices
shegerpay crypto create -a 100 -c USD --crypto USDT_TRC20
shegerpay crypto verify ref_abc123 0x123abc...Payment Links
# Create payment link
shegerpay links create [options]
-t, --title <title> Link title (required)
-a, --amount <amount> Payment amount (required)
-c, --currency <currency> Currency (default: ETB)
-d, --description <desc> Description
-j, --json Output as JSON
# List payment links
shegerpay links list [options]
-l, --limit <limit> Maximum results
-s, --status <status> Filter by status
-j, --json Output as JSON
# Get link analytics
shegerpay links analytics <link-id>
# Delete payment link
shegerpay links delete <link-id>Examples:
shegerpay links create -t "Product Invoice" -a 1000 -c ETB
shegerpay links list --status active
shegerpay links analytics link_abc123
shegerpay links delete link_abc123Webhooks
# Create webhook
shegerpay webhooks create <url> [options]
-e, --events <events...> Event types (required)
-d, --description <desc> Description
-j, --json Output as JSON
# List webhooks
shegerpay webhooks list
# Test webhook
shegerpay webhooks test <url> <event>
# Delete webhook
shegerpay webhooks delete <webhook-id>
# List available events
shegerpay webhooks eventsExamples:
shegerpay webhooks create https://myapp.com/webhook -e payment.verified refund.created
shegerpay webhooks list
shegerpay webhooks test https://myapp.com/webhook payment.verified
shegerpay webhooks eventsWallet Management
# Get wallet balances
shegerpay wallet balance
# Convert currency
shegerpay wallet convert [options]
-f, --from <currency> Source currency (required)
-t, --to <currency> Target currency (required)
-a, --amount <amount> Amount to convert (required)
-j, --json Output as JSONExamples:
shegerpay wallet balance
shegerpay wallet convert -f USD -t ETB -a 100Transactions
# List transaction history
shegerpay transactions list [options]
shegerpay tx list [options] # Alias
-l, --limit <limit> Maximum results (default: 50)
-s, --status <status> Filter by status
-p, --provider <provider> Filter by provider
-j, --json Output as JSONExamples:
shegerpay tx list --limit 50 --status verified
shegerpay transactions list --provider cbeAPI Keys
# Generate new API key
shegerpay keys generate <mode> [options]
Mode: test or live
-n, --name <name> Key name/description
-j, --json Output as JSON
# List all API keys
shegerpay keys list
# Revoke API key
shegerpay keys revoke <key-id>Examples:
shegerpay keys generate test --name "Development"
shegerpay keys list
shegerpay keys revoke key_abc123Account
# Get subscription status
shegerpay account subscription
# Get API usage statistics
shegerpay account usageExamples:
shegerpay account subscription
shegerpay account usagePayouts
# Request payout
shegerpay payouts request [options]
-a, --amount <amount> Payout amount (required)
-c, --currency <currency> Currency code (required)
-d, --destination <id> Destination ID (required)
-m, --method <method> Method: bank, crypto, mobile (required)
-j, --json Output as JSON
# List payouts
shegerpay payouts list [options]
-l, --limit <limit> Maximum results
-s, --status <status> Filter by status
-j, --json Output as JSONExamples:
shegerpay payouts request -a 5000 -c ETB -d dest_123 -m bank
shegerpay payouts list --status pendingGlobal Options
-j, --json Output results as JSON (available on most commands)
-h, --help Display help for command
-V, --version Display version numberEnvironment Variables
Instead of storing your API key in the CLI configuration, you can use environment variables:
export SHEGERPAY_API_KEY=sk_test_your_api_key_here
export SHEGERPAY_BASE_URL=https://api.shegerpay.com # OptionalAPI Key Modes
ShegerPay supports two modes:
- Test Mode (
sk_test_...): Use for testing without real money - Live Mode (
sk_live_...): Use for production payments
The CLI automatically detects the mode from your API key.
Output Formats
Table Format (Default)
Most commands display results in a formatted table:
shegerpay transactions listJSON Format
Add -j or --json to any command for JSON output:
shegerpay transactions list --jsonAliases
Some commands have shorter aliases:
shegerpay→spshegerpay transactions→shegerpay tx
sp tx list
sp verify quick FT123456Examples
Complete Payment Verification Workflow
# 1. Configure your API key
shegerpay config set sk_test_abc123
# 2. Verify a payment
shegerpay verify payment FT241227ABC123 --amount 500 --provider cbe
# 3. Check payment history
shegerpay verify history --limit 10
# 4. Create webhook for notifications
shegerpay webhooks create https://myapp.com/webhook -e payment.verified
# 5. Check wallet balance
shegerpay wallet balanceCrypto Payment Workflow
# 1. Check crypto prices
shegerpay crypto prices
# 2. Create crypto payment
shegerpay crypto create -a 100 -c USD --crypto USDT_TRC20 -e [email protected]
# 3. Customer sends crypto, you verify with transaction hash
shegerpay crypto verify ref_abc123 0x123abc...Payment Link Workflow
# 1. Create payment link
shegerpay links create -t "Product A" -a 1500 -c ETB -d "Premium product"
# 2. Share link with customer (displays QR code)
# 3. Check analytics
shegerpay links analytics link_abc123
# 4. List all links
shegerpay links listTroubleshooting
"Error: No API key configured"
Solution: Set your API key:
shegerpay config set sk_test_your_keyOr use environment variable:
export SHEGERPAY_API_KEY=sk_test_your_key"API Error: Unauthorized"
Solution: Your API key may be invalid or revoked. Generate a new one:
shegerpay keys generate test"Connection Error"
Solution: Check your internet connection and verify the API URL:
shegerpay config getDevelopment
Local Development
# Clone repository
git clone https://github.com/shegerpay/shegerpay-cli.git
cd shegerpay-cli
# Install dependencies
npm install
# Build
npm run build
# Test locally
node dist/index.js --helpPublishing
npm version patch # or minor, major
npm publishSupport
- Documentation: shegerpay.com/docs
- Email: [email protected]
- Telegram: @shegerpay0
- Telegram Channel: @shegerPa
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
MIT License - see LICENSE for details
About ShegerPay
ShegerPay is the leading payment gateway for African businesses, providing seamless payment verification for:
- 🇪🇹 Ethiopian banks (CBE, Telebirr, Awash, BoA, E-Birr)
- 🌍 International payments (PayPal, Wise, Payoneer, Bank transfers)
- ₿ Cryptocurrency (USDT, ETH, BNB, TRX on multiple networks)
Join thousands of businesses using ShegerPay to accept payments from anywhere in the world.
Made with ❤️ by the ShegerPay Team
