{
  "openapi": "3.1.0",
  "info": {
    "title": "E8 Wallet Partner API",
    "version": "v1",
    "description": "E8 Wallet 开放接口（/partner/v1）。每个请求都要带 X-TE-Key、X-TE-Timestamp、X-TE-Nonce、X-TE-Signature 四个请求头，只接受接入白名单里的服务器 IP。回调（webhook）的验签、事件类型和测试回调见开发者文档 https://www.e8qianbao.com/developers.html 。测试回调（test: true、请求头 X-TE-Test: 1）不能入账。"
  },
  "servers": [
    {
      "url": "https://open.e8qianbao.com"
    }
  ],
  "security": [
    {
      "TeKey": [],
      "TeTimestamp": [],
      "TeNonce": [],
      "TeSignature": []
    }
  ],
  "paths": {
    "/partner/v1/me": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "当前 API 客户端信息（连通性与签名自检）",
        "operationId": "me_partner_v1_me_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/partner/v1/orders": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "创建收款单（买家在 Telegram 中确认后才生成订单）",
        "operationId": "create_order_partner_v1_orders_post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerOrderIn"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "查询本客户端的收款单",
        "operationId": "list_orders_partner_v1_orders_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "pending",
                    "accepted",
                    "cancelled",
                    "expired"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "external_ref",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 64
                },
                {
                  "type": "null"
                }
              ],
              "title": "External Ref"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/orders/{po_id}": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "查询授权订单",
        "operationId": "get_order_partner_v1_orders__po_id__get",
        "parameters": [
          {
            "name": "po_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Po Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/orders/{po_id}/cancel": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "取消买家尚未确认的收款单",
        "operationId": "cancel_order_partner_v1_orders__po_id__cancel_post",
        "parameters": [
          {
            "name": "po_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Po Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/orders/{po_id}/deliver": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "商家确认已交付（订单需买家已付款）",
        "operationId": "deliver_partner_v1_orders__po_id__deliver_post",
        "parameters": [
          {
            "name": "po_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Po Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliverIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/orders/{po_id}/refund": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "商家主动全额退款给买家（已付款、未完成的订单）",
        "operationId": "refund_partner_v1_orders__po_id__refund_post",
        "parameters": [
          {
            "name": "po_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Po Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliverIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/webhooks/test": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "回调测试：立即向已配置的回调地址发送一条签名测试事件；收款商户可选 event_type（测试事件 test=true、带 X-TE-Test: 1，不能入账，每分钟最多 10 条）",
        "operationId": "webhook_test_partner_v1_webhooks_test_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PartnerWebhookTestIn"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/webhooks/events/{event_id}/resend": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "重发本接入最近 7 天的一条回调（事件编号不变，每分钟最多 5 次）",
        "operationId": "webhook_resend_partner_v1_webhooks_events__event_id__resend_post",
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Event Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/statements": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "每日对账单（北京时间自然日；不传 day 返回最近 31 天汇总）",
        "operationId": "list_statements_partner_v1_statements_get",
        "parameters": [
          {
            "name": "day",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Day"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/assets/{asset}/networks": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "这个币当前可用的网络（充值、提现、收款）",
        "operationId": "asset_networks_partner_v1_assets__asset__networks_get",
        "parameters": [
          {
            "name": "asset",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Asset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/orders": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "创建钱包付款单（买家打开 E8 Wallet，用余额和支付密码付款）",
        "operationId": "create_collect_order_partner_v1_collect_orders_post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CollectOrderIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "钱包付款单列表（新到旧；可按状态、商户单号、创建时间筛选）",
        "operationId": "list_collect_orders_partner_v1_collect_orders_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "pending",
                    "paid",
                    "expired"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "external_ref",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_\\-:.]{1,64}$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "External Ref"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Until"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ],
              "description": "上一页返回的 next_cursor",
              "title": "Cursor"
            },
            "description": "上一页返回的 next_cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/orders/{order_id}": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "查询钱包付款单",
        "operationId": "get_collect_order_partner_v1_collect_orders__order_id__get",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/addresses": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "为玩家生成专属充值地址（同一个 customer_ref 永远返回同一个地址）",
        "operationId": "collect_address_partner_v1_collect_addresses_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CollectAddressIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/addresses/{customer_ref}": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "查询已生成的玩家充值地址",
        "operationId": "get_collect_address_partner_v1_collect_addresses__customer_ref__get",
        "parameters": [
          {
            "name": "customer_ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Customer Ref"
            }
          },
          {
            "name": "network",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "TRC20",
                    "ERC20"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Network"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/deposits": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "玩家充值到账记录（新到旧；可按 customer_ref / 起始时间筛选）",
        "operationId": "list_collect_deposits_partner_v1_collect_deposits_get",
        "parameters": [
          {
            "name": "customer_ref",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_\\-:.]{1,64}$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Ref"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100000,
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "network",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "TRC20",
                    "ERC20"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Network"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/deposits/{txid}": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "按交易哈希查询到账（补单 / 对账）",
        "operationId": "get_collect_deposit_partner_v1_collect_deposits__txid__get",
        "parameters": [
          {
            "name": "txid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Txid"
            }
          },
          {
            "name": "network",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "TRC20",
                    "ERC20"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Network"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/balance": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "商户钱包余额（到账进商户余额；下分/提现都从这里扣，不够则失败）",
        "operationId": "collect_balance_partner_v1_collect_balance_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/payouts": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "下分到玩家 E8 钱包（需商户在 Mini App 开启接口出款；扣商户余额，受 24 小时上限；余额不足返回 MERCHANT_INSUFFICIENT_BALANCE，不会动平台资金）",
        "operationId": "collect_payout_partner_v1_collect_payouts_post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CollectPayoutIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "下分记录（新到旧；可按 customer_ref、状态、起始时间筛选）",
        "operationId": "list_collect_payouts_partner_v1_collect_payouts_get",
        "parameters": [
          {
            "name": "customer_ref",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_\\-:.]{1,64}$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Ref"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "completed",
                    "failed"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ],
              "description": "上一页返回的 next_cursor",
              "title": "Cursor"
            },
            "description": "上一页返回的 next_cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/chain-payouts": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "用户链上提现（需商户开启接口出款；只扣该商户自己的余额，受 24 小时上限，余额不足直接失败）",
        "operationId": "collect_chain_payout_partner_v1_collect_chain_payouts_post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CollectChainIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "链上出款记录（新到旧；含交易哈希、手续费、网络和状态）",
        "operationId": "list_collect_chain_payouts_partner_v1_collect_chain_payouts_get",
        "parameters": [
          {
            "name": "customer_ref",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_\\-:.]{1,64}$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Ref"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "pending_review",
                    "approved",
                    "processing",
                    "completed",
                    "failed",
                    "rejected"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ],
              "description": "上一页返回的 next_cursor",
              "title": "Cursor"
            },
            "description": "上一页返回的 next_cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/chain-payouts/{payout_id}/approve": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "商户审核通过后出款",
        "operationId": "collect_chain_approve_partner_v1_collect_chain_payouts__payout_id__approve_post",
        "parameters": [
          {
            "name": "payout_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Payout Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/chain-payouts/{payout_id}/reject": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "商户拒绝这笔用户提现",
        "operationId": "collect_chain_reject_partner_v1_collect_chain_payouts__payout_id__reject_post",
        "parameters": [
          {
            "name": "payout_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Payout Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/payout-mode": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "关闭自动出款：之后链上出款先停在待审核；开启只能由商户主账号在 Mini App 输入支付密码",
        "operationId": "collect_payout_mode_partner_v1_collect_payout_mode_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CollectAutoIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/statements": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "收款日对账单列表（北京时间自然日，新到旧，每个币种一份）",
        "operationId": "list_statements_partner_v1_collect_statements_get",
        "parameters": [
          {
            "name": "asset",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "USDT",
                    "TRX",
                    "EB",
                    "USDC",
                    "ETH",
                    "TON"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Asset"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Until"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 31,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 10000,
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/statements/{day}.csv": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "下载某日某币种对账单明细（CSV，和生成时记下的 SHA-256 一致）",
        "operationId": "statement_csv_partner_v1_collect_statements__day__csv_get",
        "parameters": [
          {
            "name": "day",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Day"
            }
          },
          {
            "name": "asset",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "USDT",
                "TRX",
                "EB",
                "USDC",
                "ETH",
                "TON"
              ],
              "type": "string",
              "default": "USDT",
              "title": "Asset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/statements/{day}/lines": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "某日某币种对账单明细（JSON，分页）",
        "operationId": "statement_lines_partner_v1_collect_statements__day__lines_get",
        "parameters": [
          {
            "name": "day",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Day"
            }
          },
          {
            "name": "asset",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "USDT",
                "TRX",
                "EB",
                "USDC",
                "ETH",
                "TON"
              ],
              "type": "string",
              "default": "USDT",
              "title": "Asset"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/statements/{day}": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "某日对账单（全部币种：期初、收入、支出、其他、期末、是否核对一致）",
        "operationId": "statement_day_partner_v1_collect_statements__day__get",
        "parameters": [
          {
            "name": "day",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Day"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/ledger": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "商户钱包流水（旧到新，游标分页；只含商户钱包）",
        "operationId": "ledger_partner_v1_collect_ledger_get",
        "parameters": [
          {
            "name": "asset",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "USDT",
                "TRX",
                "EB",
                "USDC",
                "ETH",
                "TON"
              ],
              "type": "string",
              "default": "USDT",
              "title": "Asset"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Until"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/orders/by-ref/{external_ref}": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "按商户自己的订单号查询钱包付款单",
        "operationId": "get_collect_order_by_ref_partner_v1_collect_orders_by_ref__external_ref__get",
        "parameters": [
          {
            "name": "external_ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_\\-:.]{1,64}$",
              "title": "External Ref"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/orders/{order_id}/close": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "提前截止未付款的付款单（截止时间改为现在；截止前已上链的转账仍按规则完成）",
        "operationId": "close_collect_order_partner_v1_collect_orders__order_id__close_post",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/payouts/{payout_id}": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "查询一笔下分",
        "operationId": "get_collect_payout_partner_v1_collect_payouts__payout_id__get",
        "parameters": [
          {
            "name": "payout_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Payout Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/chain-payouts/{payout_id}": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "查询一笔链上出款（含交易哈希、手续费、网络和状态）",
        "operationId": "get_collect_chain_payout_partner_v1_collect_chain_payouts__payout_id__get",
        "parameters": [
          {
            "name": "payout_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Payout Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/unmatched": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "付款单地址的异常到账（金额不符、截止后上链、重复付款、币种不对；不能据此发货）",
        "operationId": "list_collect_unmatched_partner_v1_collect_unmatched_get",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "name": "order_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Order Id"
            }
          },
          {
            "name": "external_ref",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_\\-:.]{1,64}$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "External Ref"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ],
              "description": "上一页返回的 next_cursor",
              "title": "Cursor"
            },
            "description": "上一页返回的 next_cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/orders/{order_id}/refunds": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "提交钱包付款单的退款申请（需接口退款开关；钱不会动，商户主账号输入支付密码同意后才退；必须带 Idempotency-Key）",
        "operationId": "request_order_refund_partner_v1_collect_orders__order_id__refunds_post",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/trust_engine__api__routes__partner_collect_refunds__RefundIn"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "一笔钱包付款单的全部退款",
        "operationId": "order_refunds_partner_v1_collect_orders__order_id__refunds_get",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Order Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/unmatched/{unmatched_id}/refunds": {
      "post": {
        "tags": [
          "partner"
        ],
        "summary": "提交异常到账的退款申请（最多退实际进商户余额的金额、原币种；退到链上地址）",
        "operationId": "request_unmatched_refund_partner_v1_collect_unmatched__unmatched_id__refunds_post",
        "parameters": [
          {
            "name": "unmatched_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Unmatched Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/trust_engine__api__routes__partner_collect_refunds__RefundIn"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/refunds": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "退款记录（新到旧；可按状态、付款单、异常到账、起始时间筛选）",
        "operationId": "list_refunds_partner_v1_collect_refunds_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "awaiting_merchant",
                    "approved",
                    "processing",
                    "completed",
                    "failed",
                    "rejected",
                    "expired"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "order_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Order Id"
            }
          },
          {
            "name": "unmatched_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Unmatched Id"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/collect/refunds/{refund_id}": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "查询一笔退款（状态、去向、链上哈希）",
        "operationId": "get_refund_partner_v1_collect_refunds__refund_id__get",
        "parameters": [
          {
            "name": "refund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Refund Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CollectAddressIn": {
        "properties": {
          "customer_ref": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_\\-:.]{1,64}$",
            "title": "Customer Ref"
          },
          "network": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "TRC20",
                  "ERC20"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Network"
          }
        },
        "type": "object",
        "required": [
          "customer_ref"
        ],
        "title": "CollectAddressIn"
      },
      "CollectAutoIn": {
        "properties": {
          "auto": {
            "type": "boolean",
            "title": "Auto"
          }
        },
        "type": "object",
        "required": [
          "auto"
        ],
        "title": "CollectAutoIn"
      },
      "CollectChainIn": {
        "properties": {
          "customer_ref": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_\\-:.]{1,64}$",
            "title": "Customer Ref"
          },
          "amount": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "string"
              }
            ],
            "title": "Amount"
          },
          "asset": {
            "type": "string",
            "enum": [
              "USDT",
              "TRX",
              "USDC"
            ],
            "title": "Asset",
            "default": "USDT"
          },
          "to_address": {
            "type": "string",
            "maxLength": 42,
            "minLength": 34,
            "title": "To Address"
          },
          "memo": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Memo"
          },
          "network": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "TRC20",
                  "ERC20"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Network"
          }
        },
        "type": "object",
        "required": [
          "customer_ref",
          "amount",
          "to_address"
        ],
        "title": "CollectChainIn"
      },
      "CollectOrderIn": {
        "properties": {
          "external_ref": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_\\-:.]{1,64}$",
            "title": "External Ref"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "amount": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "string"
              }
            ],
            "title": "Amount"
          },
          "expires_in_minutes": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1440.0,
                "minimum": 5.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires In Minutes"
          },
          "payer_telegram_id": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMaximum": 1000000000000000.0,
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Payer Telegram Id"
          },
          "return_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Return Url"
          },
          "links": {
            "type": "boolean",
            "title": "Links",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "external_ref",
          "amount"
        ],
        "title": "CollectOrderIn",
        "description": "Wallet bill. Amount may be a decimal string or a JSON number; both are stored to the cent."
      },
      "CollectPayoutIn": {
        "properties": {
          "customer_ref": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_\\-:.]{1,64}$",
            "title": "Customer Ref"
          },
          "amount": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "string"
              }
            ],
            "title": "Amount"
          },
          "asset": {
            "type": "string",
            "enum": [
              "USDT",
              "TRX",
              "EB"
            ],
            "title": "Asset",
            "default": "USDT"
          },
          "user_ref": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "title": "User Ref"
          },
          "memo": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Memo"
          }
        },
        "type": "object",
        "required": [
          "customer_ref",
          "amount",
          "user_ref"
        ],
        "title": "CollectPayoutIn"
      },
      "DeliverIn": {
        "properties": {
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          }
        },
        "type": "object",
        "title": "DeliverIn"
      },
      "DestinationIn": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "payer_wallet",
              "chain"
            ],
            "title": "Type"
          },
          "network": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "TRC20",
                  "ERC20"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Network"
          },
          "to_address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 42,
                "minLength": 34
              },
              {
                "type": "null"
              }
            ],
            "title": "To Address"
          }
        },
        "type": "object",
        "required": [
          "type"
        ],
        "title": "DestinationIn",
        "description": "{\"type\": \"payer_wallet\"}: back to the E8 wallet that paid (bills paid from an E8 balance only);\n{\"type\": \"chain\", \"network\": \"TRC20\" | \"ERC20\", \"to_address\": \"...\"}: an address the buyer gave."
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "PartnerOrderIn": {
        "properties": {
          "external_ref": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_\\-:.]{1,64}$",
            "title": "External Ref"
          },
          "title": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Title"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "amount": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "string"
              }
            ],
            "title": "Amount"
          },
          "expires_in_minutes": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1440.0,
                "minimum": 5.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires In Minutes"
          },
          "payer_telegram_id": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMaximum": 1000000000000000.0,
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Payer Telegram Id"
          }
        },
        "type": "object",
        "required": [
          "external_ref",
          "title",
          "amount"
        ],
        "title": "PartnerOrderIn"
      },
      "PartnerWebhookTestIn": {
        "properties": {
          "event_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "collect.order_paid",
                  "partner_order.expired",
                  "collect.deposit_credited",
                  "collect.chain_payout_updated",
                  "collect.bill_unmatched",
                  "collect.refund_requested",
                  "collect.order_refunded"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Type",
            "description": "不传 = 连通性测试 webhook.test；传了发一条该类型的测试事件（test=true）"
          }
        },
        "type": "object",
        "title": "PartnerWebhookTestIn"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "trust_engine__api__routes__partner_collect_refunds__RefundIn": {
        "properties": {
          "amount": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "string"
              }
            ],
            "title": "Amount"
          },
          "destination": {
            "$ref": "#/components/schemas/DestinationIn"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "amount",
          "destination"
        ],
        "title": "RefundIn"
      }
    },
    "securitySchemes": {
      "TeKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-TE-Key",
        "description": "API 密钥编号（商户密钥 tek_…，开发者密钥 tdk_…）"
      },
      "TeTimestamp": {
        "type": "apiKey",
        "in": "header",
        "name": "X-TE-Timestamp",
        "description": "Unix 秒；与平台时间相差超过 300 秒拒绝"
      },
      "TeNonce": {
        "type": "apiKey",
        "in": "header",
        "name": "X-TE-Nonce",
        "description": "16–64 位 A-Z a-z 0-9 _ -，每个请求新生成，用过即作废"
      },
      "TeSignature": {
        "type": "apiKey",
        "in": "header",
        "name": "X-TE-Signature",
        "description": "64 位小写十六进制 HMAC-SHA256(Secret, 待签名串)；待签名串为方法、完整路径（含查询串）、X-TE-Timestamp、X-TE-Nonce、请求体原始字节的 SHA-256 小写十六进制，5 行用 \\n 连接，末尾不加换行"
      }
    }
  }
}
