You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document describes the minimum Admin API surface for external payment systems (for example, sub2apipay) to complete balance top-up and reconciliation.
3
+
## 中文
4
4
5
-
## Base URL
5
+
### 概述
6
+
7
+
本文档描述外部支付系统(例如 sub2apipay)对接 Sub2API 时的最小 Admin API 集合,用于完成充值发放与对账。
8
+
9
+
### 基础地址
10
+
11
+
- 生产环境:`https://<your-domain>`
12
+
- Beta 环境:`http://<your-server-ip>:8084`
13
+
14
+
### 认证方式
15
+
16
+
以下接口均建议使用:
17
+
18
+
- 请求头:`x-api-key: admin-<64hex>`(服务间调用推荐)
19
+
- 请求头:`Content-Type: application/json`
20
+
21
+
说明:管理员 JWT 也可访问 admin 路由,但机器对机器调用建议使用 Admin API Key。
This document defines the minimum Admin API surface for integrating external payment systems (for example, sub2apipay) with Sub2API for recharge fulfillment and reconciliation.
164
+
165
+
### Base URL
6
166
7
167
- Production: `https://<your-domain>`
8
168
- Beta: `http://<your-server-ip>:8084`
9
169
10
-
All endpoints below use:
170
+
### Authentication
11
171
12
-
- Header: `x-api-key: admin-<64hex>` (recommended for server-to-server)
13
-
- Header: `Content-Type: application/json`
172
+
Recommended headers:
14
173
15
-
Note: Admin JWT is also accepted by admin routes, but machine-to-machine integration should use admin API key.
174
+
-`x-api-key: admin-<64hex>` (recommended for server-to-server calls)
175
+
-`Content-Type: application/json`
16
176
17
-
## 1) Create + Redeem in One Step
177
+
Note: Admin JWT is also accepted by admin routes, but Admin API key is recommended for machine integrations.
-Existing reusable admin interface for manual correction.
255
+
-Reuse existing admin endpoint for manual reconciliation.
94
256
- Supports `set`, `add`, `subtract`.
95
257
96
258
Request body example (`subtract`):
@@ -117,18 +279,35 @@ curl -X POST "${BASE}/api/v1/admin/users/123/balance" \
117
279
}'
118
280
```
119
281
120
-
## 4) Error Handling Recommendations
282
+
### 4) Purchase URL Query Parameters (Iframe + New Tab)
283
+
284
+
When Sub2API frontend opens `purchase_subscription_url`, it appends the same query parameters for both iframe and “open in new tab” to keep context consistent.
0 commit comments