API 与集成
JSON API,路径前缀为 /api/v1/…。当前路由见您部署环境中的 OpenAPI。示例中请将 YOUR_HOST 替换为您的主机。
文档
- 交互式: /docs(若已启用)。
- 模式:
GET /api/v1/openapi.json。 - 状态:
GET /health、GET /readiness、GET /api/v1/status。
约定
- 生产环境使用 HTTPS。
Content-Type: application/json(争议文件上传除外)。POST /api/v1/auth/login之后 — cookie 和/或Authorization: Bearer …。- 刷新:
POST /api/v1/auth/refresh。 - 敏感操作可能使用
Idempotency-Key— 见 OpenAPI。
主要分组
- 认证与会话: register、login、refresh、logout、MFA。
- 个人资料与钱包:
/api/v1/me、/api/v1/wallet/balances、/api/v1/wallet/activity。 - 托管(Escrow): create、list、fund、release、dispute。
- Helpdesk: 工单。
- 完整列表 — 见 OpenAPI。
集成支持
关于访问与场景的问题:帮助 或 support@evopay.biz。已登录客户端可通过 POST /api/v1/helpdesk/tickets 创建工单。
示例
json · 请求体
{
"email": "user@example.com",
"password": "YourStrongPassw0rd!",
"display_name": "Demo User"
}
bash · 注册
curl -sS -X POST "https://YOUR_HOST/api/v1/auth/register" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "YourStrongPassw0rd!",
"display_name": "Demo User"
}'
bash · 登录
curl -sS -X POST "https://YOUR_HOST/api/v1/auth/login" \
-H "Content-Type: application/json" \
-c cookies.txt \
-d '{
"email": "user@example.com",
"password": "YourStrongPassw0rd!"
}'
bash · 个人资料与钱包
curl -sS "https://YOUR_HOST/api/v1/me" -b cookies.txt
curl -sS "https://YOUR_HOST/api/v1/wallet/balances" -b cookies.txt
curl -sS "https://YOUR_HOST/api/v1/wallet/activity?limit=20" -b cookies.txt
bash · 创建托管
curl -sS -X POST "https://YOUR_HOST/api/v1/escrow" \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"title": "设备交付",
"description": "按规格的服务器设备",
"amount": "8000.00",
"currency": "USD"
}'
然后替换 ESCROW_ID:
bash · 托管生命周期
curl -sS "https://YOUR_HOST/api/v1/escrow/contracts/ESCROW_ID" -b cookies.txt
curl -sS -X POST "https://YOUR_HOST/api/v1/escrow/ESCROW_ID/fund" \
-H "Content-Type: application/json" -b cookies.txt -d '{}'
curl -sS -X POST "https://YOUR_HOST/api/v1/escrow/ESCROW_ID/release" \
-H "Content-Type: application/json" -b cookies.txt -d '{}'
bash · 状态
curl -sS "https://YOUR_HOST/api/v1/status"
curl -sS "https://YOUR_HOST/readiness"