Revolut Business API
Full CLI for Revolut Business — accounts, transactions, payments, FX, exports.
Entry point: INLINECODE0
Setup
Interactive Setup Wizard (recommended)
python3 {baseDir}/scripts/setup.py
Walks you through everything: key generation, Revolut certificate upload, OAuth callback, authorization.
Manual Setup
- - Python 3.10+, INLINECODE1
- Revolut Business account with API certificate
- See README for detailed step-by-step guide
Credentials
Stored in
~/.clawdbot/revolut/:
- -
private.pem — RSA private key (for JWT signing) - INLINECODE4 — X509 cert (uploaded to Revolut)
- INLINECODE5 — OAuth tokens (auto-managed)
- INLINECODE6 — client ID, domain, redirect URI
Environment variables (in .env):
- -
REVOLUT_CLIENT_ID — from Revolut API settings - INLINECODE9 — your redirect URI domain (without https://)
Commands
Accounts & Balances
CODEBLOCK1
Transactions
CODEBLOCK2
Transaction types: card_payment, transfer, exchange, topup, atm, fee, INLINECODE16
Counterparties
CODEBLOCK3
Payments
CODEBLOCK4
Currency Exchange
CODEBLOCK5
Internal Transfers
CODEBLOCK6
Export (CSV)
CODEBLOCK7
Token Status
CODEBLOCK8
Token Auto-Refresh
- - Access tokens expire after ~40 minutes
- Automatically refreshed using the refresh token before API calls
- No manual intervention needed after initial auth
Security Notes
- - Private key and tokens are stored in
~/.clawdbot/revolut/ — treat as sensitive - Payments require explicit confirmation (use
--yes to skip) - INLINECODE19 creates payment drafts that need approval in Revolut app
- Never share your private key, tokens, or client assertion JWT
Revolut Business API
Revolut Business 的完整命令行工具 — 账户、交易、支付、外汇、导出。
入口点: python3 {baseDir}/scripts/revolut.py
设置
交互式设置向导(推荐)
bash
python3 {baseDir}/scripts/setup.py
引导您完成所有步骤:密钥生成、Revolut 证书上传、OAuth 回调、授权。
手动设置
- - Python 3.10+,pip install PyJWT cryptography
- 拥有 API 证书的 Revolut Business 账户
- 详细的分步指南请参阅 README
凭据
存储在 ~/.clawdbot/revolut/ 中:
- - private.pem — RSA 私钥(用于 JWT 签名)
- certificate.pem — X509 证书(上传到 Revolut)
- tokens.json — OAuth 令牌(自动管理)
- config.json — 客户端 ID、域名、重定向 URI
环境变量(在 .env 中):
- - REVOLUTCLIENTID — 来自 Revolut API 设置
- REVOLUTISSDOMAIN — 您的重定向 URI 域名(不含 https://)
命令
账户与余额
bash
python3 {baseDir}/scripts/revolut.py accounts # 列出所有账户及余额
python3 {baseDir}/scripts/revolut.py balance # 欧元总余额
python3 {baseDir}/scripts/revolut.py accounts --json # JSON 输出
交易
bash
python3 {baseDir}/scripts/revolut.py transactions # 最近 20 笔
python3 {baseDir}/scripts/revolut.py tx -n 50 # 最近 50 笔
python3 {baseDir}/scripts/revolut.py tx --since 2026-01-01 # 自指定日期起
python3 {baseDir}/scripts/revolut.py tx --since 2026-01-01 --to 2026-01-31
python3 {baseDir}/scripts/revolut.py tx -a Main # 按账户筛选
python3 {baseDir}/scripts/revolut.py tx --type card_payment # 按类型筛选
python3 {baseDir}/scripts/revolut.py tx --json # JSON 输出
交易类型:card_payment(卡支付)、transfer(转账)、exchange(兑换)、topup(充值)、atm(ATM)、fee(费用)、refund(退款)
交易对手
bash
python3 {baseDir}/scripts/revolut.py counterparties # 列出所有
python3 {baseDir}/scripts/revolut.py cp --name Lisa # 按名称搜索
python3 {baseDir}/scripts/revolut.py cp --json
支付
bash
发送支付(带确认提示)
python3 {baseDir}/scripts/revolut.py pay -c Lisa Dreischer --amount 50.00 --currency EUR -r 午餐
创建草稿(不立即发送)
python3 {baseDir}/scripts/revolut.py pay -c Lisa Dreischer --amount 50.00 --draft -r 午餐
跳过确认
python3 {baseDir}/scripts/revolut.py pay -c Lisa Dreischer --amount 50.00 -y
货币兑换
bash
python3 {baseDir}/scripts/revolut.py exchange --amount 100 --sell EUR --buy USD
python3 {baseDir}/scripts/revolut.py fx --amount 500 --sell EUR --buy GBP
内部转账
bash
python3 {baseDir}/scripts/revolut.py transfer --from-account
--to-account --amount 100
导出(CSV)
bash
python3 {baseDir}/scripts/revolut.py export # 将 CSV 打印到标准输出
python3 {baseDir}/scripts/revolut.py export -n 200 -o transactions.csv # 保存到文件
python3 {baseDir}/scripts/revolut.py export --since 2026-01-01 -o jan.csv
令牌状态
bash
python3 {baseDir}/scripts/revolut.py token-info
令牌自动刷新
- - 访问令牌约 40 分钟后过期
- 在 API 调用前使用刷新令牌自动刷新
- 初始授权后无需手动干预
安全说明
- - 私钥和令牌存储在 ~/.clawdbot/revolut/ 中 — 请视为敏感信息
- 支付需要明确确认(使用 --yes 跳过)
- --draft 创建需要在 Revolut 应用中审批的支付草稿
- 切勿分享您的私钥、令牌或客户端断言 JWT