{ "swagger": "2.0", "info": { "title": "LINUX DO PAY", "contact": {}, "version": "0.1.0" }, "paths": { "/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/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/merchant.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/merchant.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/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/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/merchant/payment/orders": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payment" ], "parameters": [ { "type": "string", "description": "Bearer {ClientID}:{ClientSecret}", "name": "Authorization", "in": "header", "required": true }, { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/payment.CreateOrderRequest" } } ], "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" } } } } } }, "definitions": { "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" ] } } }, "merchant.CreateAPIKeyRequest": { "type": "object", "required": [ "app_homepage_url", "app_name", "redirect_uri" ], "properties": { "app_description": { "type": "string", "maxLength": 100 }, "app_homepage_url": { "type": "string", "maxLength": 100 }, "app_name": { "type": "string", "maxLength": 20 }, "redirect_uri": { "type": "string", "maxLength": 100 } } }, "merchant.UpdateAPIKeyRequest": { "type": "object", "properties": { "app_description": { "type": "string", "maxLength": 100 }, "app_homepage_url": { "type": "string", "maxLength": 100 }, "app_name": { "type": "string", "maxLength": 20 }, "redirect_uri": { "type": "string", "maxLength": 100 } } }, "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" ] } } }, "payment.CreateOrderRequest": { "type": "object", "required": [ "amount", "order_name" ], "properties": { "amount": { "type": "number" }, "order_name": { "type": "string", "maxLength": 64 }, "remark": { "type": "string", "maxLength": 200 } } }, "payment.PayOrderRequest": { "type": "object", "required": [ "order_no", "pay_key" ], "properties": { "order_no": { "type": "string" }, "pay_key": { "type": "string", "maxLength": 10 } } }, "payment.TransferRequest": { "type": "object", "required": [ "amount", "pay_key", "recipient_id", "recipient_username" ], "properties": { "amount": { "type": "number" }, "pay_key": { "type": "string" }, "recipient_id": { "type": "integer" }, "recipient_username": { "type": "string" }, "remark": { "type": "string" } } }, "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": 10 } } }, "user_pay_config.CreateUserPayConfigRequest": { "type": "object", "required": [ "fee_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 } } }, "user_pay_config.UpdateUserPayConfigRequest": { "type": "object", "required": [ "fee_rate" ], "properties": { "daily_limit": { "type": "integer" }, "fee_rate": { "type": "number" }, "max_score": { "type": "integer" }, "min_score": { "type": "integer", "minimum": 0 } } }, "util.ResponseAny": { "type": "object", "properties": { "data": {}, "error_msg": { "type": "string", "example": "" } } } } }