| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- {
- "info": {
- "_postman_id": "a0f8f4c6-3e22-4bd4-a3c8-billing-module",
- "name": "租户费用模块联调集合",
- "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
- },
- "item": [
- {
- "name": "1. 创建方案",
- "request": {
- "method": "POST",
- "header": [{ "key": "Content-Type", "value": "application/json" }],
- "url": { "raw": "{{baseUrl}}/api/fee/plan/create", "host": ["{{baseUrl}}"], "path": ["api","fee","plan","create"] },
- "body": {
- "mode": "raw",
- "raw": "{\n \"planCode\": \"STANDARD\",\n \"planName\": \"标准方案\",\n \"version\": 1,\n \"remark\": \"postman初始化\"\n}"
- }
- }
- },
- {
- "name": "2. 保存计费项",
- "request": {
- "method": "POST",
- "header": [{ "key": "Content-Type", "value": "application/json" }],
- "url": { "raw": "{{baseUrl}}/api/fee/plan/item/save", "host": ["{{baseUrl}}"], "path": ["api","fee","plan","item","save"] },
- "body": {
- "mode": "raw",
- "raw": "{\n \"planCode\": \"STANDARD\",\n \"version\": 1,\n \"items\": [\n {\"itemCode\":\"FLOW_POSTPAID\",\"unit\":\"GB\",\"unitPrice\":0.2,\"enabled\":1},\n {\"itemCode\":\"CALL_OUT\",\"unit\":\"MIN\",\"unitPrice\":0.3,\"minChargeUnit\":1,\"enabled\":1},\n {\"itemCode\":\"CALL_IN\",\"unit\":\"MIN\",\"unitPrice\":0.2,\"minChargeUnit\":1,\"enabled\":1},\n {\"itemCode\":\"AI_CALL\",\"unit\":\"MIN\",\"unitPrice\":0.15,\"minChargeUnit\":1,\"enabled\":1},\n {\"itemCode\":\"SOP_TOKEN\",\"unit\":\"TOKEN\",\"unitPrice\":1,\"tokenUnit\":100000,\"enabled\":1},\n {\"itemCode\":\"AI_REPLY_TOKEN\",\"unit\":\"TOKEN\",\"unitPrice\":1,\"tokenUnit\":100000,\"enabled\":1},\n {\"itemCode\":\"ADD_WECHAT\",\"unit\":\"COUNT\",\"unitPrice\":0.5,\"enabled\":1},\n {\"itemCode\":\"OPEN_ACCOUNT_NON_AI\",\"unit\":\"TIME\",\"unitPrice\":1000,\"enabled\":1},\n {\"itemCode\":\"OPEN_ACCOUNT_AI\",\"unit\":\"TIME\",\"unitPrice\":3000,\"enabled\":1}\n ]\n}"
- }
- }
- },
- {
- "name": "3. 保存流量阶梯",
- "request": {
- "method": "POST",
- "header": [{ "key": "Content-Type", "value": "application/json" }],
- "url": { "raw": "{{baseUrl}}/api/fee/plan/flow-tier/save", "host": ["{{baseUrl}}"], "path": ["api","fee","plan","flow-tier","save"] },
- "body": {
- "mode": "raw",
- "raw": "{\n \"planCode\":\"STANDARD\",\n \"version\":1,\n \"tiers\":[\n {\"minPrepayAmount\":100000,\"maxPrepayAmount\":200000,\"unitPrice\":0.1,\"sortNo\":1},\n {\"minPrepayAmount\":200000,\"maxPrepayAmount\":null,\"unitPrice\":0.08,\"sortNo\":2}\n ]\n}"
- }
- }
- },
- {
- "name": "4. 发布方案",
- "request": {
- "method": "POST",
- "url": { "raw": "{{baseUrl}}/api/fee/plan/publish?planCode=STANDARD&version=1", "host": ["{{baseUrl}}"], "path": ["api","fee","plan","publish"], "query": [{"key":"planCode","value":"STANDARD"},{"key":"version","value":"1"}] }
- }
- },
- {
- "name": "5. 绑定租户方案",
- "request": {
- "method": "POST",
- "header": [{ "key": "Content-Type", "value": "application/json" }],
- "url": { "raw": "{{baseUrl}}/api/fee/tenant/bind-plan", "host": ["{{baseUrl}}"], "path": ["api","fee","tenant","bind-plan"] },
- "body": {
- "mode": "raw",
- "raw": "{\n \"tenantId\": 1,\n \"tenantType\": \"AI\",\n \"billingMode\": \"PREPAID\",\n \"planCode\": \"STANDARD\",\n \"planVersion\": 1\n}"
- }
- }
- },
- {
- "name": "6. 钱包充值",
- "request": {
- "method": "POST",
- "header": [{ "key": "Content-Type", "value": "application/json" }],
- "url": { "raw": "{{baseUrl}}/api/fee/wallet/recharge", "host": ["{{baseUrl}}"], "path": ["api","fee","wallet","recharge"] },
- "body": {
- "mode": "raw",
- "raw": "{\n \"tenantId\": 1,\n \"amount\": 100000,\n \"bizNo\": \"RC001\",\n \"remark\": \"预存充值\"\n}"
- }
- }
- },
- {
- "name": "7. 上报CALL事件(AI外呼)",
- "request": {
- "method": "POST",
- "header": [{ "key": "Content-Type", "value": "application/json" }],
- "url": { "raw": "{{baseUrl}}/api/fee/usage/report", "host": ["{{baseUrl}}"], "path": ["api","fee","usage","report"] },
- "body": {
- "mode": "raw",
- "raw": "{\n \"eventId\": \"evt_call_001\",\n \"tenantId\": 1,\n \"eventType\": \"CALL\",\n \"subType\": \"CALL_OUT\",\n \"bizId\": \"callBiz001\",\n \"usageValue\": 47,\n \"usageUnit\": \"SECOND\",\n \"extJson\": {\"isAiCall\": true}\n}"
- }
- }
- },
- {
- "name": "8. 查询计费明细",
- "request": {
- "method": "GET",
- "url": { "raw": "{{baseUrl}}/api/fee/billing/detail/list?tenantId=1", "host": ["{{baseUrl}}"], "path": ["api","fee","billing","detail","list"], "query": [{"key":"tenantId","value":"1"}] }
- }
- },
- {
- "name": "9. 生成账单",
- "request": {
- "method": "POST",
- "url": {
- "raw": "{{baseUrl}}/api/fee/statement/generate?tenantId=1&periodType=MONTHLY&periodStart=2026-04-01%2000:00:00&periodEnd=2026-04-30%2023:59:59",
- "host": ["{{baseUrl}}"],
- "path": ["api","fee","statement","generate"],
- "query": [
- {"key":"tenantId","value":"1"},
- {"key":"periodType","value":"MONTHLY"},
- {"key":"periodStart","value":"2026-04-01 00:00:00"},
- {"key":"periodEnd","value":"2026-04-30 23:59:59"}
- ]
- }
- }
- }
- ],
- "variable": [
- {
- "key": "baseUrl",
- "value": "http://127.0.0.1:8004"
- }
- ]
- }
|