{ "swagger": "2.0", "info": { "title": "LINUX DO Credit", "contact": {}, "version": "1.0.0" }, "paths": { "/api.php": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payment" ], "parameters": [ { "type": "string", "name": "act", "in": "query" }, { "type": "string", "name": "key", "in": "query", "required": true }, { "type": "string", "name": "out_trade_no", "in": "query" }, { "type": "string", "name": "pid", "in": "query", "required": true }, { "type": "integer", "name": "trade_no", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/payment.QueryMerchantOrderResponse" } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payment" ], "parameters": [ { "description": "退款请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/payment.RefundOrderRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/payment.RefundMerchantOrderResponse" } } } } }, "/api/v1/admin/system-configs": { "get": { "produces": [ "application/json" ], "tags": [ "admin" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/system_config.CreateSystemConfigRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/admin/system-configs/{key}": { "get": { "produces": [ "application/json" ], "tags": [ "admin" ], "parameters": [ { "type": "string", "description": "配置键", "name": "key", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } }, "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "parameters": [ { "type": "string", "description": "配置键", "name": "key", "in": "path", "required": true }, { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/system_config.UpdateSystemConfigRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } }, "delete": { "produces": [ "application/json" ], "tags": [ "admin" ], "parameters": [ { "type": "string", "description": "配置键", "name": "key", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/admin/user-pay-configs": { "get": { "produces": [ "application/json" ], "tags": [ "admin" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user_pay_config.CreateUserPayConfigRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/admin/user-pay-configs/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "admin" ], "parameters": [ { "type": "string", "description": "配置ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } }, "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "parameters": [ { "type": "string", "description": "配置ID", "name": "id", "in": "path", "required": true }, { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user_pay_config.UpdateUserPayConfigRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } }, "delete": { "produces": [ "application/json" ], "tags": [ "admin" ], "parameters": [ { "type": "string", "description": "配置ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/config/public": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "config" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/dashboard/stats/daily": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "获取每日收支统计", "parameters": [ { "type": "integer", "description": "查询天数,最大7天", "name": "days", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/dashboard/stats/top-customers": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "获取Top客户", "parameters": [ { "type": "integer", "description": "查询天数,最大7天", "name": "days", "in": "query", "required": true }, { "type": "integer", "description": "返回数量,最大10", "name": "limit", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/health": { "get": { "produces": [ "application/json" ], "tags": [ "health" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/merchant/api-keys": { "get": { "produces": [ "application/json" ], "tags": [ "merchant" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "merchant" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api_key.CreateAPIKeyRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/merchant/api-keys/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "merchant" ], "parameters": [ { "type": "integer", "format": "int64", "description": "API Key ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } }, "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "merchant" ], "parameters": [ { "type": "integer", "format": "int64", "description": "API Key ID", "name": "id", "in": "path", "required": true }, { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api_key.UpdateAPIKeyRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } }, "delete": { "produces": [ "application/json" ], "tags": [ "merchant" ], "parameters": [ { "type": "integer", "format": "int64", "description": "API Key ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/merchant/api-keys/{id}/payment-links": { "get": { "produces": [ "application/json" ], "tags": [ "merchant" ], "parameters": [ { "type": "integer", "format": "int64", "description": "API Key ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "merchant" ], "parameters": [ { "type": "integer", "format": "int64", "description": "API Key ID", "name": "id", "in": "path", "required": true }, { "description": "创建支付链接请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/link.CreatePaymentLinkRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/merchant/api-keys/{id}/payment-links/{linkId}": { "delete": { "produces": [ "application/json" ], "tags": [ "merchant" ], "parameters": [ { "type": "integer", "format": "int64", "description": "API Key ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "format": "int64", "description": "Payment Link ID", "name": "linkId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/merchant/payment": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payment" ], "parameters": [ { "description": "支付订单请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/payment.PayOrderRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/merchant/payment-links/pay": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "merchant" ], "parameters": [ { "description": "支付请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/link.PayByLinkRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/merchant/payment-links/{token}": { "get": { "produces": [ "application/json" ], "tags": [ "merchant" ], "parameters": [ { "type": "string", "description": "支付链接 Token", "name": "token", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/merchant/payment/order": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payment" ], "parameters": [ { "type": "string", "description": "订单号", "name": "order_no", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/oauth/callback": { "post": { "produces": [ "application/json" ], "tags": [ "oauth" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/oauth.CallbackRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/oauth/login": { "get": { "produces": [ "application/json" ], "tags": [ "oauth" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/oauth/logout": { "get": { "produces": [ "application/json" ], "tags": [ "oauth" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/oauth/user-info": { "get": { "produces": [ "application/json" ], "tags": [ "oauth" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/order/dispute": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "order" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dispute.CreateDisputeRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/order/dispute/close": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "order" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dispute.CloseDisputeRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/order/disputes": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "order" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "schema": { "$ref": "#/definitions/dispute.ListDisputesRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/order/disputes/merchant": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "order" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "schema": { "$ref": "#/definitions/dispute.ListDisputesRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/order/refund-review": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "order" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/dispute.RefundReviewRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/order/transactions": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "order" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "schema": { "$ref": "#/definitions/order.TransactionListRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/payment/transfer": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payment" ], "parameters": [ { "description": "转账请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/payment.TransferRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/api/v1/user/pay-key": { "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.UpdatePayKeyRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } }, "/pay/submit.php": { "post": { "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "tags": [ "payment" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/payment.CreateOrderRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/util.ResponseAny" } } } } } }, "definitions": { "api_key.CreateAPIKeyRequest": { "type": "object", "required": [ "app_homepage_url", "app_name", "notify_url" ], "properties": { "app_description": { "type": "string", "maxLength": 100 }, "app_homepage_url": { "type": "string", "maxLength": 100 }, "app_name": { "type": "string", "maxLength": 20 }, "notify_url": { "type": "string", "maxLength": 100 }, "redirect_uri": { "type": "string", "maxLength": 100 } } }, "api_key.UpdateAPIKeyRequest": { "type": "object", "properties": { "app_description": { "type": "string", "maxLength": 100 }, "app_homepage_url": { "type": "string", "maxLength": 100 }, "app_name": { "type": "string", "maxLength": 20 }, "notify_url": { "type": "string", "maxLength": 100 }, "redirect_uri": { "type": "string", "maxLength": 100 } } }, "dispute.CloseDisputeRequest": { "type": "object", "required": [ "dispute_id" ], "properties": { "dispute_id": { "type": "integer" } } }, "dispute.CreateDisputeRequest": { "type": "object", "required": [ "order_id", "reason" ], "properties": { "order_id": { "type": "integer" }, "reason": { "type": "string", "maxLength": 100 } } }, "dispute.ListDisputesRequest": { "type": "object", "properties": { "dispute_id": { "type": "integer" }, "page": { "type": "integer", "minimum": 1 }, "page_size": { "type": "integer", "maximum": 100, "minimum": 1 }, "status": { "type": "string", "enum": [ "disputing", "refund", "closed" ] } } }, "dispute.RefundReviewRequest": { "type": "object", "required": [ "dispute_id", "status" ], "properties": { "dispute_id": { "type": "integer" }, "reason": { "type": "string", "maxLength": 100 }, "status": { "type": "string", "enum": [ "refund", "closed" ] } } }, "link.CreatePaymentLinkRequest": { "type": "object", "required": [ "amount", "product_name" ], "properties": { "amount": { "type": "number" }, "product_name": { "type": "string", "maxLength": 30 }, "remark": { "type": "string", "maxLength": 100 } } }, "link.PayByLinkRequest": { "type": "object", "required": [ "pay_key", "token" ], "properties": { "pay_key": { "type": "string", "maxLength": 6 }, "remark": { "type": "string", "maxLength": 100 }, "token": { "type": "string" } } }, "model.PayLevel": { "type": "integer", "format": "int32", "enum": [ 0, 1, 2, 3 ], "x-enum-varnames": [ "PayLevelFree", "PayLevelBasic", "PayLevelStandard", "PayLevelPremium" ] }, "oauth.CallbackRequest": { "type": "object", "properties": { "code": { "type": "string" }, "state": { "type": "string" } } }, "order.TransactionListRequest": { "type": "object", "properties": { "client_id": { "type": "string" }, "endTime": { "type": "string" }, "page": { "type": "integer", "minimum": 1 }, "page_size": { "type": "integer", "maximum": 100, "minimum": 1 }, "startTime": { "type": "string" }, "status": { "type": "string", "enum": [ "success", "pending", "failed", "expired", "disputing", "refund", "refused" ] }, "type": { "type": "string", "enum": [ "receive", "payment", "transfer", "community", "online" ] } } }, "payment.CreateOrderRequest": { "type": "object", "required": [ "amount", "order_name" ], "properties": { "amount": { "type": "number" }, "merchant_order_no": { "type": "string" }, "order_name": { "type": "string", "maxLength": 64 }, "payment_type": { "type": "string" }, "remark": { "type": "string", "maxLength": 100 } } }, "payment.PayOrderRequest": { "type": "object", "required": [ "order_no", "pay_key" ], "properties": { "order_no": { "type": "string" }, "pay_key": { "type": "string", "maxLength": 6 } } }, "payment.QueryMerchantOrderResponse": { "type": "object", "properties": { "addtime": { "type": "string", "example": "2023-12-08 12:00:00" }, "code": { "type": "integer", "example": 1 }, "endtime": { "type": "string", "example": "2023-12-08 12:05:00" }, "money": { "type": "string", "example": "10.00" }, "msg": { "type": "string", "example": "查询订单号成功!" }, "name": { "type": "string", "example": "商品名称" }, "out_trade_no": { "type": "string", "example": "M202312080001" }, "pid": { "type": "string", "example": "1001" }, "status": { "type": "integer", "example": 1 }, "trade_no": { "type": "string", "example": "123456" }, "type": { "type": "string", "example": "epay" } } }, "payment.RefundMerchantOrderResponse": { "type": "object", "properties": { "code": { "type": "integer", "example": 1 }, "msg": { "type": "string", "example": "退款成功" } } }, "payment.RefundOrderRequest": { "type": "object", "required": [ "key", "money", "pid", "trade_no" ], "properties": { "key": { "type": "string" }, "money": { "type": "number" }, "out_trade_no": { "type": "string" }, "pid": { "type": "string" }, "trade_no": { "type": "integer" } } }, "payment.TransferRequest": { "type": "object", "required": [ "amount", "pay_key", "recipient_id", "recipient_username" ], "properties": { "amount": { "type": "number" }, "pay_key": { "type": "string", "maxLength": 6 }, "recipient_id": { "type": "integer" }, "recipient_username": { "type": "string" }, "remark": { "type": "string", "maxLength": 100 } } }, "system_config.CreateSystemConfigRequest": { "type": "object", "required": [ "key", "value" ], "properties": { "description": { "type": "string", "maxLength": 255 }, "key": { "type": "string", "maxLength": 64 }, "value": { "type": "string", "maxLength": 255 } } }, "system_config.UpdateSystemConfigRequest": { "type": "object", "required": [ "value" ], "properties": { "description": { "type": "string", "maxLength": 255 }, "value": { "type": "string", "maxLength": 255 } } }, "user.UpdatePayKeyRequest": { "type": "object", "required": [ "pay_key" ], "properties": { "pay_key": { "type": "string", "maxLength": 6 } } }, "user_pay_config.CreateUserPayConfigRequest": { "type": "object", "required": [ "fee_rate", "score_rate" ], "properties": { "daily_limit": { "type": "integer" }, "fee_rate": { "type": "number" }, "level": { "$ref": "#/definitions/model.PayLevel" }, "max_score": { "type": "integer" }, "min_score": { "type": "integer", "minimum": 0 }, "score_rate": { "type": "number" } } }, "user_pay_config.UpdateUserPayConfigRequest": { "type": "object", "required": [ "fee_rate", "score_rate" ], "properties": { "daily_limit": { "type": "integer" }, "fee_rate": { "type": "number" }, "max_score": { "type": "integer" }, "min_score": { "type": "integer", "minimum": 0 }, "score_rate": { "type": "number" } } }, "util.ResponseAny": { "type": "object", "properties": { "data": {}, "error_msg": { "type": "string", "example": "" } } } } }