AgentFin — Virtual Cards for Agents
You have access to the AgentFin API. Use it to check your balance, get virtual card credentials for online purchases, and fetch OTP codes for 3DS verification.
Authentication
All requests require a Bearer token. Use the AGENTFIN_API_KEY environment variable.
CODEBLOCK0
Base URL: INLINECODE1
Endpoints
Check Balance & Card Status
CODEBLOCK1
Response includes balance (USD string), card object with maskedPan and status, and depositAddress for USDT top-ups.
Get Card Credentials (for online purchases)
CODEBLOCK2
Returns pan, cvv, expiryMonth, expiryYear, cardHolderName, billingAddress. Rate limited to 10 requests/minute.
Important: Use the cardId from the /api/me response (card.cardId field).
Fetch Latest OTP Code (for 3DS verification)
CODEBLOCK3
Returns the most recent email with extracted OTP codes. The extractedCodes field is an array of strings. Use the first element as the verification code.
If a purchase triggers 3DS, wait 10-30 seconds for the OTP email to arrive, then call this endpoint.
Top Up Card Balance
CODEBLOCK4
Moves funds from your account balance to the card. The card is prepaid — you cannot spend more than the loaded amount.
View Transaction History
CODEBLOCK5
Returns all deposits, card charges, top-ups, and refunds.
Typical Purchase Flow
- 1. Check balance with
GET /api/me — ensure sufficient funds - Get card credentials with INLINECODE18
- Use PAN, CVV, expiry to fill in payment form on merchant site
- If 3DS is triggered, wait ~15 seconds then INLINECODE19
- Submit the OTP code from INLINECODE20
- Purchase complete
Important Notes
- - The card is prepaid. You cannot spend more than the loaded balance.
- Card credentials are rate-limited (10/min). Cache them for the duration of a purchase session.
- OTP codes arrive via email to a dedicated inbox. There may be a 10-30 second delay.
- Fund the account by sending USDT (TRC20) to the deposit address from
GET /api/me.
AgentFin — 面向代理的虚拟卡
您可以使用AgentFin API。通过它查询余额、获取用于在线购物的虚拟卡凭证,以及获取用于3DS验证的OTP验证码。
身份验证
所有请求都需要Bearer令牌。请使用AGENTFINAPIKEY环境变量。
Authorization: Bearer $AGENTFINAPIKEY
基础URL:https://agentfin.tech/api
接口
查询余额与卡片状态
bash
curl -H Authorization: Bearer $AGENTFINAPIKEY \
https://agentfin.tech/api/me
响应包含balance(美元金额字符串)、包含maskedPan和status的card对象,以及用于USDT充值的depositAddress。
获取卡片凭证(用于在线购物)
bash
curl -H Authorization: Bearer $AGENTFINAPIKEY \
https://agentfin.tech/api/cards/{cardId}/sensitive
返回pan、cvv、expiryMonth、expiryYear、cardHolderName、billingAddress。速率限制为每分钟10次请求。
重要提示: 请使用/api/me响应中的cardId(card.cardId字段)。
获取最新OTP验证码(用于3DS验证)
bash
curl -H Authorization: Bearer $AGENTFINAPIKEY \
https://agentfin.tech/api/inbox/latest-otp
返回包含提取的OTP验证码的最新邮件。extractedCodes字段为字符串数组。使用第一个元素作为验证码。
如果购买触发3DS验证,请等待10-30秒让OTP邮件到达,然后调用此接口。
充值卡片余额
bash
curl -X POST -H Authorization: Bearer $AGENTFINAPIKEY \
-H Content-Type: application/json \
-d {amount: 50, currency: USD} \
https://agentfin.tech/api/cards/{cardId}/topup
将资金从您的账户余额转入卡片。该卡为预付卡——您不能消费超过已充值金额。
查看交易历史
bash
curl -H Authorization: Bearer $AGENTFINAPIKEY \
https://agentfin.tech/api/me/transactions
返回所有存款、卡片消费、充值和退款记录。
典型购买流程
- 1. 使用GET /api/me查询余额——确保资金充足
- 使用GET /api/cards/{cardId}/sensitive获取卡片凭证
- 在商户网站填写支付表单时使用PAN、CVV、有效期
- 如果触发3DS验证,等待约15秒后调用GET /api/inbox/latest-otp
- 提交extractedCodes[0]中的OTP验证码
- 购买完成
重要说明
- - 该卡为预付卡。您不能消费超过已充值余额。
- 卡片凭证有速率限制(10次/分钟)。请在购买会话期间缓存它们。
- OTP验证码通过邮件发送至专用收件箱。可能存在10-30秒的延迟。
- 通过向GET /api/me返回的充值地址发送USDT(TRC20)来为账户充值。