{
  "openapi": "3.1.0",
  "info": {
    "title": "PA SSBO API",
    "version": "1.1.0",
    "description": "由 PA 项目制定、SSBO 按此接入的版本化业务契约。业务请求复用 unipay RSA 签名、请求时间和 nonce 防重放机制；Webhook 使用版本化 RSA-SHA256 元数据头和至少一次投递。"
  },
  "x-contract-status": "stable",
  "x-environment-policy": "访问路径统一约束查询、下单和换通道；新订单冻结 PRODUCTION 或 SANDBOX 并参与幂等校验。同一幂等键换环境返回 2001，不产生第二笔订单；原商户订单号唯一边界保持不变。ALL 允许发现查询（含银行查询）及存提款查询，写操作返回 1001。RSA 签名仍使用 JSON 正文，路径通过 HTTPS 传输，不加入原有签名串。",
  "x-compatibility-policy": "2026-10-20 已确认调整 V1：创建、查询和同步未确认结果省略 status，确认后仅 SUCCEEDED/FAILED；两种回调只通知确认终态。接入方须适配 status 缺失，内部五态及未知结果保护保持。后续破坏性变更仍须发布新主版本。",
  "servers": [
    {
      "url": "/unipay/pa/v1",
      "description": "默认生产环境"
    },
    {
      "url": "/unipay/pa/v1/production",
      "description": "生产环境，与默认路径等价"
    },
    {
      "url": "/unipay/pa/v1/sandbox",
      "description": "沙盒环境"
    },
    {
      "url": "/unipay/pa/v1/all",
      "description": "跨环境只读查询；禁止存提款创建和 trades/sync"
    }
  ],
  "paths": {
    "/merchant-capabilities": {
      "post": {
        "operationId": "queryMerchantCapabilities",
        "summary": "查询当前商户支持的国家、币种和交易方向",
        "description": "需要 deposit:options 权限。仅需公共签名字段；按商户已发布授权、请求环境的启用账户及支付方式过滤。countries 返回法币国家和币种，cryptoAssets 返回无国家的数字资产；均无匹配时对应列表为空。不检查实时余额或额度，不承诺本笔可下单；继续查询 payment-methods 获取已授权网络和金额规则。",
        "requestBody": {
          "$ref": "#/components/requestBodies/MerchantCapabilitiesRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/MerchantCapabilitiesResponse"
          }
        }
      }
    },
    "/deposit/options": {
      "post": {
        "operationId": "queryDepositOptions",
        "summary": "查询当前可用存款金额范围",
        "requestBody": {
          "$ref": "#/components/requestBodies/DepositOptionsRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/DepositOptionsResponse"
          }
        }
      }
    },
    "/payment-methods": {
      "post": {
        "operationId": "listPaymentMethods",
        "parameters": [
          {
            "in": "header",
            "name": "Accept-Language",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            },
            "description": "Validated language ranges and q weights. Signed body locale takes priority; defaults to en-US."
          }
        ],
        "summary": "查询当前商户的存款或提款支付方式",
        "requestBody": {
          "$ref": "#/components/requestBodies/PaymentMethodsRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/PaymentMethodsResponse"
          }
        }
      }
    },
    "/deposits": {
      "post": {
        "operationId": "createDeposit",
        "summary": "发起存款",
        "requestBody": {
          "$ref": "#/components/requestBodies/CreateDepositRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/DepositResponse"
          }
        }
      }
    },
    "/deposits/query": {
      "post": {
        "operationId": "queryDeposit",
        "summary": "查询存款",
        "description": "读取 PA 当前订单记录，不直接向 PG 查单。4001 不证明此前超时的创建不会落单；保留原商户订单号继续核查。",
        "requestBody": {
          "$ref": "#/components/requestBodies/TradeQueryRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/DepositResponse"
          }
        }
      }
    },
    "/withdrawals": {
      "post": {
        "operationId": "createWithdrawal",
        "summary": "发起提款",
        "requestBody": {
          "$ref": "#/components/requestBodies/CreateWithdrawalRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/WithdrawalResponse"
          }
        }
      }
    },
    "/deposits/banks": {
      "post": {
        "operationId": "queryDepositBanks",
        "summary": "查询统一存款银行",
        "description": "需要 deposit:options 权限及原公共签名。按商户、环境、国家、币种、支付方式、金额、银行用途和可选通道筛选。bankRole=PAYER 查询付款人银行，TARGET 查询目标银行。无匹配返回 banks=[]，不回退代付列表。PA 维护 PG 映射；下单及发单前重新核验。",
        "parameters": [
          {
            "in": "header",
            "name": "Accept-Language",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            },
            "description": "签名正文 locale 优先，默认 en-US。"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/DepositBanksRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/DepositBanksResponse"
          }
        }
      }
    },
    "/withdrawals/banks": {
      "post": {
        "operationId": "queryWithdrawalBanks",
        "summary": "查询统一提款银行",
        "description": "需要 deposit:options 权限；沿用公共签名字段。按商户授权、路径环境、国家、币种、提款方式和本次金额过滤银行及匿名通道。可传 channelOptionId 缩小范围。无匹配返回 banks=[]；查询不保证下单成功，提交及执行时重新核验。真实银行数据由 PA 后台配置。",
        "parameters": [
          {
            "in": "header",
            "name": "Accept-Language",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            },
            "description": "签名正文 locale 优先，默认 en-US。"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/WithdrawalBanksRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/WithdrawalBanksResponse"
          }
        }
      }
    },
    "/withdrawals/query": {
      "post": {
        "operationId": "queryWithdrawal",
        "summary": "查询提款",
        "description": "读取 PA 当前订单记录，不直接向 PG 查单。4001 不证明此前超时的创建不会落单；保留原商户订单号继续核查。",
        "requestBody": {
          "$ref": "#/components/requestBodies/TradeQueryRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/WithdrawalResponse"
          }
        }
      }
    },
    "/trades/sync": {
      "post": {
        "operationId": "syncTrade",
        "summary": "主动同步存款或提款状态",
        "description": "尝试向 PG 查询原交易并更新 PA 状态，可能触发通知，不重新创建交易。不保证立即终态；按应用限流退避，禁止无间隔轮询。",
        "requestBody": {
          "$ref": "#/components/requestBodies/TradeSyncRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/TradeResponse"
          }
        }
      }
    },
    "/merchant-support": {
      "post": {
        "operationId": "queryMerchantSupport",
        "summary": "Read complete merchant support or country/currency blocks",
        "description": "需要 deposit:options；沿用公共签名与 production/sandbox/all 路径。只按当前商户已启用授权和配置返回 markets，含币种精度、存提款方式、展示分组、匿名通道、完整 amountRules/restrictions 与逐规则字段要求，以及 PAYER/TARGET/RECIPIENT 银行目录和相交后的通道金额规则。数字资产 countryCode=null，无国家银行。无需遍历旧接口或指定金额；下单仍校验实时条件，不需要先查询金额的凭证。无支持时 markets=[]。version 为跨展示语言稳定内容版本；不返回账户、PG 凭据、余额、剩余额度或实时可用承诺。 Optional keys selects complete country/currency blocks and constrains SQL before assembly; omission keeps the legacy full shape. Same deposit:options signature, replay, merchant/application ownership, Scope, IP and rate-limit checks apply to both modes. Partial results contain environment and parts, including explicit deletion results; errors never mean deletion. Banks are a shared dictionary referenced by channels with their own limits. Clients isolate caches by merchant/environment/locale and synchronize serially; notifications or event IDs do not replace authenticated API requests.",
        "requestBody": {
          "$ref": "#/components/requestBodies/MerchantSupportRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/MerchantSupportResponse"
          }
        }
      }
    }
  },
  "webhooks": {
    "tradeStatusChanged": {
      "post": {
        "summary": "RAW_BODY_V1 已确认终态标准事件回调",
        "description": "应用选择标准事件回调时使用 RAW_BODY_V1，按原始请求体字节签名并使用 JSON ACK。两种模式均只投递已确认的 SUCCEEDED/FAILED；处理中、未知结果及金额差异留在 PA 内部跟进。终态事件至少投递一次，可能重复或乱序；按 eventId 幂等，并按同一订单的 sequence 防止状态倒退。历史待投递、重试及人工重发同样只允许终态。",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "等于请求体 eventId；重试时保持不变。"
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "本次投递发起时的 Unix 秒时间戳；每次重试重新生成。"
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "v1-rsa,<Base64签名>；使用 PA 平台私钥对 webhook-id.webhook-timestamp.原始请求体字节执行 RSA-SHA256。"
          },
          {
            "name": "webhook-attempt",
            "in": "header",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10
            },
            "description": "当前投递次数，首次为 1。"
          }
        ],
        "x-pa-delivery-policy": {
          "deliveryGuarantee": "AT_LEAST_ONCE",
          "orderGuaranteed": false,
          "timeoutSeconds": 30,
          "maxAttempts": 10,
          "retryDelays": [
            "PT0S",
            "PT30S",
            "PT2M",
            "PT5M",
            "PT15M",
            "PT30M",
            "PT1H",
            "PT3H",
            "PT6H",
            "PT12H"
          ],
          "successHttpStatus": 200,
          "followRedirects": false,
          "deadLetterAfterExhaustion": true,
          "deadLetterRetentionDays": 30,
          "manualResendChangesTradeState": false
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "仅 HTTP 200、合法 JSON、code=0、message=OK 且 eventId 与请求一致时视为成功；其他响应均按失败处理。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookAck"
                }
              }
            }
          }
        }
      }
    },
    "finalTradeStatusFields": {
      "post": {
        "summary": "FIELDS_RSA_V1 已确认终态字段签名回调",
        "description": "新商户默认使用 FIELDS_RSA_V1；已有商户沿用保存的应用回调规则。仅通知已确认的 SUCCEEDED/FAILED；处理中、未知结果及金额差异留在 PA 内部跟进，不发送回调。历史待投递、重试及人工重发执行同样规则；协议切换保持各自签名与 ACK。",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "等于请求体 eventId；重试时保持不变。"
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "本次投递发起时的 Unix 秒时间戳；每次重试重新生成。"
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "v1-fields-rsa,<Base64签名>；签名同正文 sign。投递时间和次数仅追踪，不参与字段签名。"
          },
          {
            "name": "webhook-attempt",
            "in": "header",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10
            },
            "description": "当前投递次数，首次为 1。"
          }
        ],
        "x-pa-delivery-policy": {
          "deliveryGuarantee": "AT_LEAST_ONCE",
          "orderGuaranteed": false,
          "timeoutSeconds": 30,
          "maxAttempts": 10,
          "retryDelays": [
            "PT0S",
            "PT30S",
            "PT2M",
            "PT5M",
            "PT15M",
            "PT30M",
            "PT1H",
            "PT3H",
            "PT6H",
            "PT12H"
          ],
          "successHttpStatus": 200,
          "followRedirects": false,
          "deadLetterAfterExhaustion": true,
          "deadLetterRetentionDays": 30,
          "manualResendChangesTradeState": false,
          "successBody": "SUCCESS"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FieldWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "仅 HTTP 200 且原始响应体严格等于 7 个 ASCII 字节 SUCCESS 才成功；重复且事实一致的事件同样 ACK。",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "const": "SUCCESS"
                }
              }
            }
          }
        },
        "x-pa-field-signature": {
          "fields": [
            "callbackMode",
            "mchNo",
            "eventId",
            "merchantOrderNo",
            "orderNo",
            "tradeType",
            "sequence",
            "status",
            "amount",
            "currency",
            "finishTime",
            "failReason",
            "extend"
          ],
          "valueEncoding": "UTF-8 bytes percent-encoded per RFC3986; unreserved A-Z a-z 0-9 - . _ ~; uppercase hex; space %20, never +",
          "separator": "&",
          "pairSeparator": "=",
          "emptyFieldsIncluded": true,
          "exclude": [
            "sign"
          ],
          "algorithm": "RSASSA-PKCS1-v1_5 with SHA-256",
          "output": "standard Base64"
        }
      }
    }
  },
  "components": {
    "requestBodies": {
      "MerchantCapabilitiesRequest": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/MerchantCapabilitiesRequest"
            }
          }
        }
      },
      "DepositOptionsRequest": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DepositOptionsRequest"
            }
          }
        }
      },
      "PaymentMethodsRequest": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PaymentMethodsRequest"
            }
          }
        }
      },
      "CreateDepositRequest": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreateDepositRequest"
            }
          }
        }
      },
      "DepositBanksRequest": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DepositBanksRequest"
            }
          }
        }
      },
      "WithdrawalBanksRequest": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/WithdrawalBanksRequest"
            }
          }
        }
      },
      "CreateWithdrawalRequest": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreateWithdrawalRequest"
            }
          }
        }
      },
      "TradeQueryRequest": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TradeQueryRequest"
            }
          }
        }
      },
      "TradeSyncRequest": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TradeSyncRequest"
            }
          }
        }
      },
      "MerchantSupportRequest": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/MerchantSupportRequest"
            }
          }
        }
      }
    },
    "responses": {
      "MerchantCapabilitiesResponse": {
        "description": "当前商户支持的国家、币种和交易方向",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/MerchantCapabilitiesResponse"
            }
          }
        }
      },
      "DepositOptionsResponse": {
        "description": "业务响应，code=0 表示成功",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DepositOptionsResponse"
            }
          }
        }
      },
      "PaymentMethodsResponse": {
        "description": "当前商户支付方式及实时可用性",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PaymentMethodsResponse"
            }
          }
        }
      },
      "DepositResponse": {
        "description": "业务响应，code=0 表示成功",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DepositResponse"
            }
          }
        }
      },
      "DepositBanksResponse": {
        "description": "统一银行及本次可用匿名通道",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DepositBanksResponse"
            }
          }
        }
      },
      "WithdrawalBanksResponse": {
        "description": "统一银行及本次可用匿名通道",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/WithdrawalBanksResponse"
            }
          }
        }
      },
      "WithdrawalResponse": {
        "description": "业务响应，code=0 表示成功",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/WithdrawalResponse"
            }
          }
        }
      },
      "TradeResponse": {
        "description": "业务响应，code=0 表示成功",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TradeResponse"
            }
          }
        }
      },
      "MerchantSupportResponse": {
        "description": "当前商户完整配置支持范围",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/MerchantSupportResponse"
            }
          }
        }
      }
    },
    "schemas": {
      "MerchantCapabilitiesRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonRequest"
          },
          {
            "type": "object",
            "properties": {
              "environment": {
                "$ref": "#/components/schemas/PgQueryEnvironment"
              }
            }
          }
        ]
      },
      "PgQueryEnvironment": {
        "type": "string",
        "enum": [
          "PRODUCTION",
          "SANDBOX",
          "ALL"
        ],
        "deprecated": true,
        "description": "兼容旧查询签名的可选字段，不再用于选择环境。传入时仍参与签名，且必须等于路径环境（PRODUCTION、SANDBOX 或 ALL），否则返回 1001。新接入应省略，通过 API 基础路径统一选择环境。"
      },
      "MerchantCapabilities": {
        "type": "object",
        "required": [
          "countries"
        ],
        "properties": {
          "countries": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "countryCode",
                "name",
                "currencies"
              ],
              "properties": {
                "countryCode": {
                  "type": "string",
                  "pattern": "^[A-Z]{2}$"
                },
                "name": {
                  "type": "string"
                },
                "currencies": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "object",
                    "required": [
                      "currency",
                      "decimalPlaces",
                      "tradeTypes"
                    ],
                    "properties": {
                      "currency": {
                        "type": "string",
                        "pattern": "^[A-Z][A-Z0-9]{1,15}$"
                      },
                      "decimalPlaces": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 18
                      },
                      "tradeTypes": {
                        "type": "array",
                        "minItems": 1,
                        "uniqueItems": true,
                        "items": {
                          "type": "string",
                          "enum": [
                            "DEPOSIT",
                            "WITHDRAWAL"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            },
            "description": "法币国家及币种；数字资产在 cryptoAssets 中独立返回。"
          },
          "cryptoAssets": {
            "type": "array",
            "description": "全局数字资产，不关联国家。仅返回本商户已发布授权且账户支持的币种和方向；网络及本笔可用性继续查询 payment-methods。",
            "items": {
              "type": "object",
              "required": [
                "currency",
                "decimalPlaces",
                "tradeTypes"
              ],
              "properties": {
                "currency": {
                  "type": "string",
                  "pattern": "^[A-Z][A-Z0-9]{1,15}$"
                },
                "decimalPlaces": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 18
                },
                "tradeTypes": {
                  "type": "array",
                  "minItems": 1,
                  "uniqueItems": true,
                  "items": {
                    "type": "string",
                    "enum": [
                      "DEPOSIT",
                      "WITHDRAWAL"
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "MerchantCapabilitiesResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseBase"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/MerchantCapabilities"
              }
            }
          }
        ]
      },
      "CommonRequest": {
        "type": "object",
        "required": [
          "mchNo",
          "appId",
          "reqId",
          "nonceStr",
          "reqTime",
          "sign"
        ],
        "properties": {
          "mchNo": {
            "type": "string",
            "maxLength": 32
          },
          "appId": {
            "type": "string",
            "maxLength": 32
          },
          "reqId": {
            "type": "string",
            "maxLength": 64
          },
          "nonceStr": {
            "type": "string",
            "maxLength": 32
          },
          "reqTime": {
            "type": "string",
            "format": "date-time",
            "description": "带时区的 ISO 8601 时间"
          },
          "clientIp": {
            "type": "string",
            "maxLength": 64,
            "description": "可选终端用户 IP；首次创建时固化，幂等重放不得改写。"
          },
          "sign": {
            "type": "string",
            "maxLength": 1024,
            "description": "沿用 unipay RSA 签名规则"
          }
        }
      },
      "DepositOptionsRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonRequest"
          },
          {
            "type": "object",
            "required": [
              "currency",
              "paymentMethod"
            ],
            "properties": {
              "environment": {
                "$ref": "#/components/schemas/PgQueryEnvironment"
              },
              "countryCode": {
                "type": "string",
                "pattern": "^[A-Z]{2}$",
                "description": "法币必填。数字资产可省略；兼容请求中的国家仅作上下文，不参与数字资产支持范围或选路。"
              },
              "currency": {
                "$ref": "#/components/schemas/Currency"
              },
              "paymentMethod": {
                "type": "string",
                "maxLength": 64
              }
            }
          }
        ]
      },
      "PaymentMethodsRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonRequest"
          },
          {
            "type": "object",
            "required": [
              "currency",
              "tradeType"
            ],
            "properties": {
              "environment": {
                "$ref": "#/components/schemas/PgQueryEnvironment"
              },
              "countryCode": {
                "type": "string",
                "pattern": "^[A-Z]{2}$",
                "description": "法币必填。数字资产可省略；兼容请求中的国家仅作上下文，不参与数字资产支持范围或选路。"
              },
              "currency": {
                "$ref": "#/components/schemas/Currency"
              },
              "tradeType": {
                "type": "string",
                "enum": [
                  "DEPOSIT",
                  "WITHDRAWAL"
                ]
              },
              "locale": {
                "type": "string",
                "maxLength": 16,
                "pattern": "^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8})*$",
                "example": "zh-CN"
              },
              "amount": {
                "$ref": "#/components/schemas/Amount",
                "description": "可选。不传时返回商户授权范围内的通道配置、金额规则与必填参数，不代表本笔交易可用；传入时按金额和额度实时过滤通道。自动路由的字段查询不受收银台展示开关影响；指定存款通道仍遵守展示设置。下单重新校验，提款余额在执行路由前实时检查。"
              }
            }
          }
        ]
      },
      "CreateDepositRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonRequest"
          },
          {
            "type": "object",
            "required": [
              "merchantOrderNo",
              "idempotencyKey",
              "amount",
              "currency",
              "paymentMethod",
              "playerId"
            ],
            "properties": {
              "countryCode": {
                "type": "string",
                "pattern": "^[A-Z]{2}$",
                "description": "法币沿用原国家校验及 v1 兼容规则。数字资产可省略；兼容请求中的国家仅作上下文，不参与数字资产支持范围或选路。"
              },
              "merchantOrderNo": {
                "type": "string",
                "maxLength": 64
              },
              "idempotencyKey": {
                "type": "string",
                "maxLength": 64
              },
              "amount": {
                "$ref": "#/components/schemas/Amount"
              },
              "currency": {
                "$ref": "#/components/schemas/Currency"
              },
              "paymentMethod": {
                "type": "string",
                "maxLength": 64
              },
              "channelOptionId": {
                "type": "string",
                "maxLength": 40,
                "description": "可选。传入时使用 payment-methods 返回的实时通道并校验可用性，不受当前路由模式限制；未传时按已配置路由模式选择，下单方指定模式会返回 3005。"
              },
              "playerId": {
                "type": "string",
                "maxLength": 64
              },
              "payer": {
                "$ref": "#/components/schemas/Payer"
              },
              "targetBankId": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,18}$",
                "maxLength": 19,
                "description": "TARGET 统一存款银行查询返回的 bankId；与 paymentMethodFields.targetBankCode 互斥。"
              },
              "paymentMethodFields": {
                "$ref": "#/components/schemas/PaymentMethodFields"
              },
              "notifyUrl": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri",
                "maxLength": 500,
                "description": "可选 HTTPS 回调地址；传入时优先使用，省略或 null 时读取应用已启用的存款默认地址。最终地址创建时保存，后台变更不影响原订单及重试。"
              },
              "returnUrl": {
                "type": "string",
                "format": "uri",
                "maxLength": 500
              },
              "clientIp": {
                "type": "string",
                "maxLength": 64
              },
              "extend": {
                "type": "string",
                "maxLength": 1024,
                "description": "可选扩展字符串；不 trim，原样保存并参与请求签名和幂等比较。Webhook 回传并签名。"
              }
            }
          }
        ]
      },
      "CreateWithdrawalRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonRequest"
          },
          {
            "type": "object",
            "required": [
              "merchantOrderNo",
              "idempotencyKey",
              "amount",
              "currency",
              "payoutMethod",
              "recipient"
            ],
            "properties": {
              "merchantOrderNo": {
                "type": "string",
                "maxLength": 64
              },
              "idempotencyKey": {
                "type": "string",
                "maxLength": 64
              },
              "amount": {
                "$ref": "#/components/schemas/Amount"
              },
              "currency": {
                "$ref": "#/components/schemas/Currency"
              },
              "payoutMethod": {
                "type": "string",
                "maxLength": 64
              },
              "channelOptionId": {
                "type": "string",
                "maxLength": 40,
                "description": "可选。传入时使用 payment-methods 返回的实时通道并校验可用性，不受当前路由模式限制；未传时按已配置路由模式选择，下单方指定模式会返回 3005。"
              },
              "recipient": {
                "$ref": "#/components/schemas/Recipient"
              },
              "paymentMethodFields": {
                "$ref": "#/components/schemas/PaymentMethodFields"
              },
              "notifyUrl": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri",
                "maxLength": 500,
                "description": "可选 HTTPS 回调地址；传入时优先使用，省略或 null 时读取应用已启用的提款默认地址，未配置独立提款地址时沿用存款地址。最终地址创建时保存，后台变更不影响原订单及重试。"
              },
              "extend": {
                "type": "string",
                "maxLength": 1024,
                "description": "可选扩展字符串；不 trim，原样保存并参与请求签名和幂等比较。Webhook 回传并签名。"
              }
            }
          }
        ]
      },
      "TradeQueryRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonRequest"
          },
          {
            "type": "object",
            "required": [
              "merchantOrderNo"
            ],
            "properties": {
              "merchantOrderNo": {
                "type": "string",
                "maxLength": 64
              }
            }
          }
        ]
      },
      "TradeSyncRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonRequest"
          },
          {
            "type": "object",
            "required": [
              "tradeType",
              "merchantOrderNo"
            ],
            "properties": {
              "tradeType": {
                "type": "string",
                "enum": [
                  "DEPOSIT",
                  "WITHDRAWAL"
                ]
              },
              "merchantOrderNo": {
                "type": "string",
                "maxLength": 64
              }
            }
          }
        ]
      },
      "DepositBanksRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonRequest"
          },
          {
            "type": "object",
            "required": [
              "countryCode",
              "currency",
              "paymentMethod",
              "bankRole",
              "amount"
            ],
            "properties": {
              "countryCode": {
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              },
              "currency": {
                "$ref": "#/components/schemas/Currency"
              },
              "amount": {
                "$ref": "#/components/schemas/Amount"
              },
              "channelOptionId": {
                "type": "string",
                "maxLength": 40
              },
              "locale": {
                "type": "string",
                "maxLength": 16,
                "pattern": "^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8})*$"
              },
              "paymentMethod": {
                "type": "string",
                "maxLength": 64
              },
              "bankRole": {
                "type": "string",
                "enum": [
                  "PAYER",
                  "TARGET"
                ],
                "pattern": "PAYER|TARGET"
              }
            }
          }
        ]
      },
      "DepositBanksResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseBase"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/DepositBanks"
              }
            }
          }
        ]
      },
      "DepositBanks": {
        "type": "object",
        "required": [
          "countryCode",
          "currency",
          "paymentMethod",
          "bankRole",
          "amount",
          "banks"
        ],
        "properties": {
          "decimalPlaces": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18,
            "description": "币种最小单位精度（0～18）；适用于本 data 内所有金额、区间、面额和步长。金额单位及原签名算法不变；旧服务可缺失。"
          },
          "countryCode": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "amount": {
            "$ref": "#/components/schemas/Amount"
          },
          "banks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DepositBank"
            }
          },
          "paymentMethod": {
            "type": "string"
          },
          "bankRole": {
            "type": "string",
            "enum": [
              "PAYER",
              "TARGET"
            ]
          }
        }
      },
      "DepositBank": {
        "type": "object",
        "required": [
          "bankId",
          "code",
          "name",
          "channels"
        ],
        "properties": {
          "bankId": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "稳定 PA 银行标识。PAYER 查询结果填 payer.bankId；TARGET 查询结果填顶层 targetBankId。不得混用同角色原始 PG 银行字段。"
          },
          "code": {
            "type": "string",
            "description": "PA 统一编码，供展示及缓存识别；不作为 PG 编码发送。"
          },
          "ssCode": {
            "type": "string",
            "nullable": true,
            "description": "已核实的 SS 原始编码；未绑定时为空。按国家区分，不代表 PG 原始编码。"
          },
          "name": {
            "type": "string",
            "description": "优先显示当前商户展示别名，否则显示 PA 本地化名称，缺指定语言时回退 en-US；下单仍传 bankId，不接受名称或别名。"
          },
          "channels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WithdrawalBankChannel"
            }
          }
        }
      },
      "WithdrawalBanksRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonRequest"
          },
          {
            "type": "object",
            "required": [
              "countryCode",
              "currency",
              "payoutMethod"
            ],
            "properties": {
              "environment": {
                "$ref": "#/components/schemas/PgQueryEnvironment"
              },
              "countryCode": {
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              },
              "currency": {
                "$ref": "#/components/schemas/Currency"
              },
              "payoutMethod": {
                "type": "string",
                "maxLength": 64
              },
              "amount": {
                "$ref": "#/components/schemas/Amount",
                "description": "可选的最小单位正整数。不传时返回已授权银行及各银行通道的完整金额规则，支持先选银行再填金额；传入时按实际金额过滤。创建提款仍须传实际金额并重新校验银行及通道。"
              },
              "channelOptionId": {
                "type": "string",
                "maxLength": 40
              },
              "locale": {
                "type": "string",
                "maxLength": 16,
                "pattern": "^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8})*$"
              }
            }
          }
        ]
      },
      "WithdrawalBanksResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseBase"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/WithdrawalBanks"
              }
            }
          }
        ]
      },
      "WithdrawalBanks": {
        "type": "object",
        "required": [
          "countryCode",
          "currency",
          "payoutMethod",
          "banks"
        ],
        "properties": {
          "decimalPlaces": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18,
            "description": "币种最小单位精度（0～18）；适用于本 data 内所有金额、区间、面额和步长。金额单位及原签名算法不变；旧服务可缺失。"
          },
          "countryCode": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "payoutMethod": {
            "type": "string"
          },
          "amount": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Amount"
              },
              {
                "type": "null"
              }
            ],
            "description": "带金额查询时回显本次金额；无金额预览时省略或为 null。"
          },
          "banks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WithdrawalBank"
            }
          }
        }
      },
      "WithdrawalBank": {
        "type": "object",
        "required": [
          "bankId",
          "code",
          "name",
          "channels"
        ],
        "properties": {
          "bankId": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "稳定 PA 标识；下单传 recipient.bankId。"
          },
          "code": {
            "type": "string",
            "description": "PA 统一编码，供展示及缓存识别；不作为 PG 编码发送。"
          },
          "ssCode": {
            "type": "string",
            "nullable": true,
            "description": "已核实的 SS 原始编码；未绑定时为空。按国家区分，不代表 PG 原始编码。"
          },
          "name": {
            "type": "string",
            "description": "优先显示当前商户展示别名，否则显示 PA 本地化名称，缺指定语言时回退 en-US；下单仍传 bankId，不接受名称或别名。"
          },
          "channels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WithdrawalBankChannel"
            }
          }
        }
      },
      "WithdrawalBankChannel": {
        "type": "object",
        "required": [
          "channelOptionId",
          "name",
          "ruleType",
          "denominations"
        ],
        "properties": {
          "amountRules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AmountRule"
            }
          },
          "channelOptionId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "ruleType": {
            "type": "string",
            "enum": [
              "RANGE",
              "FIXED_DENOMINATIONS",
              "MIXED"
            ]
          },
          "minAmount": {
            "$ref": "#/components/schemas/Amount"
          },
          "maxAmount": {
            "$ref": "#/components/schemas/Amount"
          },
          "denominations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Amount"
            }
          }
        }
      },
      "Recipient": {
        "type": "object",
        "required": [
          "name",
          "account"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 128
          },
          "account": {
            "type": "string",
            "maxLength": 128
          },
          "phone": {
            "type": "string",
            "maxLength": 32
          },
          "countryCode": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "法币提款必填；数字资产提款可省略，国家不参与数字资产授权或选路。"
          },
          "bankId": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "maxLength": 19,
            "description": "统一银行查询返回的 PA 标识（正 int64）。所选 PG 产品要求银行时必填；不接受 bankCode、bankCodeScheme 或 paymentMethodFields 中的银行代码、名称、分行。PA 校验有效映射并保存实际 PG 发单快照。"
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "ifsc": {
            "type": "string",
            "maxLength": 32
          }
        }
      },
      "Payer": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 128
          },
          "account": {
            "type": "string",
            "maxLength": 128
          },
          "phone": {
            "type": "string",
            "maxLength": 32
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "bankId": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "maxLength": 19,
            "description": "PAYER 统一存款银行查询返回的 PA 标识；所选 PG 要求付款银行时必填。不接受 payer.bankCode 或 paymentMethodFields 中的原始银行值。"
          }
        }
      },
      "PaymentMethodFields": {
        "type": "object",
        "maxProperties": 32,
        "additionalProperties": true,
        "properties": {
          "payerBirthDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "付款人出生日期。所有 inputType=date 的商户字段统一为 yyyy-MM-dd（0001–9999 年），例如 1990-05-21；必须为真实公历日期，不带时间或时区。可选时省略或 null；必填条件以通道规则为准。PA 统一校验，PG 格式由适配器转换。"
          },
          "network": {
            "type": "string",
            "pattern": "^[A-Z0-9_]{1,32}$",
            "description": "数字资产存款和提款必填。使用 payment-methods 动态字段给出的已授权网络代码，区分同币不同网络。缺失、停用、未授权或与指定通道不符时拒绝，不自动换网；法币不要求此字段。"
          }
        },
        "description": "由 payment-methods 接口 requiredFields 返回的非银行动态字段。银行只接受 payer.bankId、targetBankId、recipient.bankId；禁止 bankCode/bankName/bankBranch/payerBankCode/payerBankName/targetBankCode 及内部银行选择字段。"
      },
      "Amount": {
        "oneOf": [
          {
            "type": "integer",
            "minimum": 1
          },
          {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          }
        ],
        "description": "最小货币单位的精确正整数，不受有符号 64 位容量限制。请求支持整数或十进制整数字符串；响应中可被 JavaScript 精确表示的值保留数字形状，超出 9007199254740991 的值使用十进制字符串。接入方应使用字符串或大整数解析，禁止经浮点数转换。币种精度和最小单位不变。"
      },
      "Currency": {
        "type": "string",
        "pattern": "^[A-Z][A-Z0-9]{1,15}$",
        "description": "已开通市场的法币或虚拟币代码。虚拟币订单直接使用该资产金额；金额为按返回 decimalPlaces 换算的 int64 最小单位整数，不做法币换算。"
      },
      "TradeStatus": {
        "type": "string",
        "enum": [
          "SUCCEEDED",
          "FAILED"
        ],
        "description": "仅已确认的支付/出款成功或失败；建单成功或取得付款资料不是 SUCCEEDED。未确认结果时 API 省略 status，不返回 null 或中间态。"
      },
      "PaymentMedium": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "REDIRECT_URL",
              "QR_CONTENT",
              "QR_IMAGE_URL",
              "BANK_ACCOUNT",
              "TOKEN"
            ]
          },
          "redirectUrl": {
            "type": "string",
            "format": "uri"
          },
          "cashierAccessCode": {
            "type": "string",
            "description": "可选的当前订单收银台访问码；存在时付款页面应展示给付款人，与 API 凭据无关。"
          },
          "ticketnara": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "receiverName": {
                "type": "string"
              },
              "receiverMobile": {
                "type": "string"
              },
              "partnerCode": {
                "type": "string"
              },
              "productPageUrl": {
                "type": "string",
                "format": "uri"
              }
            },
            "description": "VaultOne 原单赠送收件人、伙伴代码和商品恢复链接。展示已提供的值；每次继续前查询原单取得最新介质。先向会员本人虚拟账户充值，再选择赠送，购买并持有不算完成。"
          },
          "qrContent": {
            "type": "string"
          },
          "qrImageUrl": {
            "type": "string",
            "format": "uri"
          },
          "bankAccount": {
            "type": "string"
          },
          "token": {
            "type": "string",
            "description": "仅按该支付方式已约定的客户端流程使用；无相应接入说明时不得猜测用途，不是支付成功凭证。"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DepositOptions": {
        "type": "object",
        "required": [
          "available",
          "currency",
          "paymentMethod"
        ],
        "properties": {
          "decimalPlaces": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18,
            "description": "币种最小单位精度（0～18）；适用于本 data 内所有金额、区间、面额和步长。金额单位及原签名算法不变；旧服务可缺失。"
          },
          "amountRules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AmountRule"
            }
          },
          "available": {
            "type": "boolean"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "paymentMethod": {
            "type": "string"
          },
          "minAmount": {
            "$ref": "#/components/schemas/Amount",
            "description": "第一段连续可用区间的最小金额，兼容旧调用方。"
          },
          "maxAmount": {
            "$ref": "#/components/schemas/Amount",
            "description": "第一段连续可用区间的最大金额；为空表示无上限。"
          },
          "amountRanges": {
            "type": "array",
            "description": "当前真实可用的连续金额区间；存在覆盖空档时返回多段。",
            "items": {
              "$ref": "#/components/schemas/DepositAmountRange"
            }
          },
          "ruleType": {
            "type": "string",
            "enum": [
              "RANGE",
              "FIXED_DENOMINATIONS",
              "MIXED"
            ]
          },
          "denominations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Amount"
            }
          },
          "retryable": {
            "type": "boolean"
          }
        }
      },
      "PaymentFieldDefinition": {
        "type": "object",
        "required": [
          "code",
          "name",
          "nameEn",
          "requestPath",
          "inputType",
          "configurable"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "nameEn": {
            "type": "string"
          },
          "requestPath": {
            "type": "string"
          },
          "inputType": {
            "type": "string",
            "enum": [
              "text",
              "date",
              "email",
              "tel",
              "url",
              "select"
            ],
            "description": "date 统一提交 yyyy-MM-dd 的真实公历日期，不带时间或时区；PA 校验并由 PG 适配器转换厂商格式。"
          },
          "configurable": {
            "type": "boolean"
          },
          "label": {
            "type": "string",
            "description": "Field label in the resolved display language; name/nameEn remain compatible."
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentFieldChoice"
            },
            "description": "Channel-specific finite values; submit the string value, never the label."
          }
        }
      },
      "PaymentFieldChoice": {
        "type": "object",
        "required": [
          "value",
          "label"
        ],
        "properties": {
          "value": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        }
      },
      "PaymentMethods": {
        "type": "object",
        "required": [
          "currency",
          "tradeType",
          "methods"
        ],
        "properties": {
          "decimalPlaces": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18,
            "description": "币种最小单位精度（0～18）；适用于本 data 内所有金额、区间、面额和步长。金额单位及原签名算法不变；旧服务可缺失。"
          },
          "fieldDefinitions": {
            "type": "array",
            "description": "Logical field metadata, not a required-field list. Apply the selected method/channel requiredFields. Optional values must suit the selected PG. Never infer provider support from this catalog.",
            "items": {
              "$ref": "#/components/schemas/PaymentFieldDefinition"
            }
          },
          "groups": {
            "type": "array",
            "description": "Optional processed presentation groups. Preserve option code, amount rules, required fields and routing mode when rendering. Unassigned methods form individual groups.",
            "items": {
              "$ref": "#/components/schemas/PaymentPresentationGroup"
            }
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "tradeType": {
            "type": "string",
            "enum": [
              "DEPOSIT",
              "WITHDRAWAL"
            ]
          },
          "methods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentMethodOption"
            }
          }
        }
      },
      "PaymentPresentationGroup": {
        "type": "object",
        "required": [
          "code",
          "name",
          "options"
        ],
        "description": "PA-resolved merchant display group. The group code is display-only and must not be submitted as paymentMethod. Empty groups are omitted; existing methods remain compatible.",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentMethodOption"
            }
          }
        }
      },
      "PaymentMethodOption": {
        "type": "object",
        "required": [
          "code",
          "name",
          "available",
          "ruleType",
          "requiredFields",
          "routeMode",
          "channels"
        ],
        "properties": {
          "amountRules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AmountRule"
            },
            "description": "任一规则满足即可；规则内所有 restrictions 同时生效。MIXED 必须使用本列表，不能只用 minAmount/maxAmount。"
          },
          "channelSelection": {
            "type": "string",
            "enum": [
              "AUTOMATIC",
              "PLAYER",
              "OPERATOR"
            ],
            "description": "AUTOMATIC: do not ask the player to select a channel. PLAYER: deposit caller-designated selection. OPERATOR: withdrawal channel selected by merchant operations, never by the player. Grouping does not merge routing or field requirements."
          },
          "code": {
            "type": "string",
            "maxLength": 64
          },
          "name": {
            "type": "string"
          },
          "available": {
            "type": "boolean"
          },
          "ruleType": {
            "type": "string",
            "enum": [
              "RANGE",
              "FIXED_DENOMINATIONS",
              "MIXED"
            ]
          },
          "minAmount": {
            "$ref": "#/components/schemas/Amount"
          },
          "maxAmount": {
            "$ref": "#/components/schemas/Amount"
          },
          "amountRanges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DepositAmountRange"
            }
          },
          "denominations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Amount"
            }
          },
          "requiredFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "routeMode": {
            "type": "string",
            "enum": [
              "PRIORITY",
              "ROUND_ROBIN",
              "QUOTA_BALANCED",
              "CALLER_DESIGNATED"
            ]
          },
          "channels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChannelOption"
            }
          }
        }
      },
      "ChannelOption": {
        "type": "object",
        "required": [
          "channelOptionId",
          "name",
          "displayOrder",
          "ruleType",
          "requiredFields"
        ],
        "description": "商户授权的匿名通道。不传金额时为配置资料，传金额时按当前可用性筛选；均不保证下单成功。不返回 PG 代码、内部账号或凭据。",
        "properties": {
          "channelOptionId": {
            "type": "string",
            "maxLength": 40
          },
          "name": {
            "type": "string",
            "maxLength": 64
          },
          "iconUrl": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "pattern": "^https://.+$",
            "description": "当前默认 PG 图标 HTTPS URL；未上传或删除时明确返回 null。旧版本可能省略。"
          },
          "displayOrder": {
            "type": "integer",
            "minimum": 1
          },
          "cashierVisible": {
            "type": "boolean",
            "description": "是否向存款玩家展示为可选通道。自动路由字段查询仍包含 false 的通道，不能因不展示漏掉其字段；指定存款通道不可选择隐藏项。旧版本省略时按 true 处理。"
          },
          "ruleType": {
            "type": "string",
            "enum": [
              "RANGE",
              "FIXED_DENOMINATIONS",
              "MIXED"
            ]
          },
          "minAmount": {
            "$ref": "#/components/schemas/Amount"
          },
          "maxAmount": {
            "$ref": "#/components/schemas/Amount"
          },
          "denominations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Amount"
            }
          },
          "requiredFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "fieldDefinitions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentFieldDefinition"
            },
            "description": "通道字段目录；无金额时为各金额规则的选项汇总，精确约束见 amountRules。传金额后使用实际匹配规则。"
          },
          "amountRanges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DepositAmountRange"
            },
            "description": "区间规则的完整并集，保留空档；minAmount/maxAmount 仅为第一段兼容值。"
          },
          "amountRules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChannelAmountRule"
            },
            "description": "无金额时逐条保留金额规则及其必填字段、有限选项；通道 requiredFields 为汇总，不代表每个金额都要求全部字段。传金额后只返回实际匹配规则。"
          },
          "bankSupport": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MerchantSupportChannelBanks"
            },
            "description": "Returned inside keyed support blocks only. Empty lists are not permission to use arbitrary banks. Legacy responses omit this field."
          }
        }
      },
      "ChannelAmountRule": {
        "type": "object",
        "required": [
          "ruleType",
          "denominations",
          "amountRanges",
          "requiredFields",
          "fieldDefinitions"
        ],
        "properties": {
          "restrictions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AmountRestriction"
            },
            "description": "全部限制同时生效。"
          },
          "ruleType": {
            "type": "string",
            "enum": [
              "RANGE",
              "FIXED_DENOMINATIONS"
            ]
          },
          "minAmount": {
            "$ref": "#/components/schemas/Amount"
          },
          "maxAmount": {
            "$ref": "#/components/schemas/Amount"
          },
          "denominations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Amount"
            }
          },
          "amountRanges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DepositAmountRange"
            }
          },
          "requiredFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "fieldDefinitions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentFieldDefinition"
            }
          }
        }
      },
      "AmountRule": {
        "type": "object",
        "required": [
          "ruleType",
          "denominations",
          "restrictions"
        ],
        "properties": {
          "ruleType": {
            "type": "string",
            "enum": [
              "RANGE",
              "FIXED_DENOMINATIONS"
            ]
          },
          "minAmount": {
            "$ref": "#/components/schemas/Amount"
          },
          "maxAmount": {
            "$ref": "#/components/schemas/Amount"
          },
          "denominations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Amount"
            }
          },
          "restrictions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AmountRestriction"
            }
          }
        }
      },
      "AmountRestriction": {
        "type": "object",
        "description": "Amounts and step use minor units. PA supplies decimalPlaces from the currency directory. Restrictions within one rule apply together; account restrictions never replace PG restrictions.",
        "properties": {
          "integerOnly": {
            "type": "boolean"
          },
          "step": {
            "type": "string",
            "nullable": true,
            "pattern": "^[1-9][0-9]{0,999}$",
            "description": "Positive minor-unit step; amount must be a multiple starting at zero."
          },
          "suffixDigits": {
            "type": "integer",
            "nullable": true,
            "minimum": 1,
            "maximum": 6
          },
          "suffixBasis": {
            "type": "string",
            "enum": [
              "MINOR_UNIT",
              "INTEGER_PART"
            ]
          },
          "allowedSuffixes": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Empty means no additional whitelist."
          },
          "forbiddenSuffixes": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0
            }
          },
          "decimalPlaces": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18
          }
        }
      },
      "DepositAmountRange": {
        "type": "object",
        "required": [
          "minAmount"
        ],
        "properties": {
          "minAmount": {
            "$ref": "#/components/schemas/Amount"
          },
          "maxAmount": {
            "$ref": "#/components/schemas/Amount"
          }
        }
      },
      "Trade": {
        "type": "object",
        "required": [
          "orderNo",
          "merchantOrderNo",
          "tradeType",
          "amount",
          "currency",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "decimalPlaces": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18,
            "description": "币种最小单位精度（0～18）；适用于本 data 内所有金额、区间、面额和步长。金额单位及原签名算法不变；旧服务可缺失。"
          },
          "orderNo": {
            "type": "string",
            "maxLength": 64
          },
          "merchantOrderNo": {
            "type": "string",
            "maxLength": 64
          },
          "tradeType": {
            "type": "string",
            "enum": [
              "DEPOSIT",
              "WITHDRAWAL"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/TradeStatus"
          },
          "amount": {
            "$ref": "#/components/schemas/Amount"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "paymentMedium": {
            "$ref": "#/components/schemas/PaymentMedium"
          },
          "failureCode": {
            "type": "string",
            "description": "稳定且不泄露 PG 的业务失败码"
          },
          "failureReason": {
            "type": "string",
            "maxLength": 512,
            "description": "确认失败或尚未确认结果时的商户可读诊断，不返回 PG 原始报文或敏感配置；不改变交易状态或重试语义"
          },
          "retryable": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ResponseBase": {
        "type": "object",
        "required": [
          "code",
          "msg",
          "retryable",
          "reqId",
          "resTime",
          "sign"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0,
              1001,
              1002,
              1003,
              2001,
              2002,
              3001,
              3002,
              3003,
              3004,
              3005,
              3006,
              3007,
              4001,
              5001
            ],
            "x-error-codes": {
              "0": "SUCCESS",
              "1001": "INVALID_PARAMETER",
              "1002": "SIGNATURE_INVALID",
              "1003": "REPLAY_REJECTED",
              "2001": "IDEMPOTENCY_CONFLICT",
              "2002": "MERCHANT_ORDER_CONFLICT",
              "3001": "NO_AVAILABLE_ROUTE",
              "3002": "RISK_REJECTED",
              "3003": "INSUFFICIENT_BALANCE",
              "3004": "FEE_POLICY_UNAVAILABLE",
              "3005": "CHANNEL_SELECTION_REQUIRED",
              "3006": "CHANNEL_OPTION_UNAVAILABLE",
              "3007": "CHANNEL_EXECUTION_FAILED",
              "4001": "ORDER_NOT_FOUND",
              "5001": "SYSTEM_BUSY"
            }
          },
          "msg": {
            "type": "string",
            "description": "错误说明。请求字段约束或手写业务参数校验失败时，code=1001，msg 包含字段路径及原因；多个错误以分号分隔。不包含被拒绝的字段值。按 code/reasonCode 处理业务，不解析或匹配 msg 文案。",
            "example": "payer.bankCode: 请使用PA统一银行bankId"
          },
          "reasonCode": {
            "type": "string",
            "description": "可选拒绝原因，不改变主错误码和 retryable。未知或缺失时按 code 处理；验签须覆盖此字段。",
            "x-known-values": {
              "SCOPE_DENIED": "code=1001；已验签应用缺少接口权限，联系 PA 调整授权。",
              "SOURCE_IP_DENIED": "code=1001；已验签请求来源不允许，核对服务端出口白名单。",
              "RATE_LIMITED": "code=5001；应用当前接口权限组的分钟额度耗尽，退避后重试。"
            }
          },
          "retryable": {
            "type": "boolean",
            "description": "是否允许按原业务参数、商户订单号和幂等键重试；每次重新生成 reqId、nonceStr、reqTime 和 sign。不表示交易失败或允许另建订单；未返回 status 时查询或同步原单，不换号重发同一交易。"
          },
          "reqId": {
            "type": "string"
          },
          "resTime": {
            "type": "string",
            "format": "date-time"
          },
          "sign": {
            "type": "string"
          }
        }
      },
      "DepositOptionsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseBase"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/DepositOptions"
              }
            }
          }
        ]
      },
      "PaymentMethodsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseBase"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/PaymentMethods"
              }
            }
          }
        ]
      },
      "DepositResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseBase"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/Trade"
              }
            }
          }
        ]
      },
      "WithdrawalResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseBase"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/Trade"
              }
            }
          }
        ]
      },
      "TradeResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseBase"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/Trade"
              }
            }
          }
        ]
      },
      "WebhookEvent": {
        "type": "object",
        "required": [
          "eventId",
          "eventVersion",
          "eventType",
          "occurredAt",
          "mchNo",
          "orderNo",
          "merchantOrderNo",
          "sequence",
          "status",
          "amount",
          "currency"
        ],
        "description": "两种模式均仅发送已确认终态。内部中间态及金额差异观察不发送；sequence 保留原始序号，允许跳号。",
        "properties": {
          "decimalPlaces": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18,
            "description": "本事件保存的币种精度（0～18）；金额仍为最小单位整数。历史回调可缺失；已有正文和签名不改写。"
          },
          "eventId": {
            "type": "string",
            "maxLength": 64
          },
          "eventVersion": {
            "type": "string",
            "const": "v1"
          },
          "eventType": {
            "type": "string",
            "enum": [
              "deposit.succeeded",
              "deposit.failed",
              "withdrawal.succeeded",
              "withdrawal.failed"
            ]
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "mchNo": {
            "type": "string",
            "maxLength": 32
          },
          "orderNo": {
            "type": "string",
            "maxLength": 64
          },
          "merchantOrderNo": {
            "type": "string",
            "maxLength": 64
          },
          "sequence": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "description": "同一订单从 1 递增的事件序号，包含状态及金额差异观察。"
          },
          "status": {
            "$ref": "#/components/schemas/TradeStatus"
          },
          "amount": {
            "$ref": "#/components/schemas/Amount"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "failureCode": {
            "type": "string"
          },
          "extend": {
            "type": "string",
            "maxLength": 1024,
            "description": "下单时传入则原样回传；参与原始字节签名。"
          }
        }
      },
      "WebhookAck": {
        "type": "object",
        "required": [
          "code",
          "message",
          "eventId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "const": 0
          },
          "message": {
            "type": "string",
            "const": "OK"
          },
          "eventId": {
            "type": "string",
            "maxLength": 64
          }
        }
      },
      "FieldWebhookEvent": {
        "type": "object",
        "description": "FIELDS_RSA_V1 保留原 13 字段 sign 和 v1-fields-rsa 请求头。新版另发 requestAmount、decimalPlaces、signV2；三者成组出现。signV2 在原字段顺序后追加 requestAmount、decimalPlaces，覆盖 15 字段，不包含 sign 或 signV2。使用新字段前必须验 signV2 及金额等式；失败不回退旧签名。历史回调允许三者均缺失。",
        "dependentRequired": {
          "requestAmount": [
            "decimalPlaces",
            "signV2"
          ],
          "decimalPlaces": [
            "requestAmount",
            "signV2"
          ],
          "signV2": [
            "requestAmount",
            "decimalPlaces"
          ]
        },
        "required": [
          "callbackMode",
          "mchNo",
          "eventId",
          "merchantOrderNo",
          "orderNo",
          "tradeType",
          "sequence",
          "status",
          "amount",
          "currency",
          "finishTime",
          "failReason",
          "extend",
          "sign"
        ],
        "properties": {
          "callbackMode": {
            "type": "string",
            "const": "FIELDS_RSA_V1"
          },
          "mchNo": {
            "type": "string"
          },
          "eventId": {
            "type": "string"
          },
          "merchantOrderNo": {
            "type": "string"
          },
          "orderNo": {
            "type": "string"
          },
          "tradeType": {
            "type": "string",
            "enum": [
              "DEPOSIT",
              "WITHDRAWAL"
            ]
          },
          "sequence": {
            "type": "integer",
            "minimum": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "SUCCEEDED",
              "FAILED"
            ]
          },
          "amount": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]+)?$",
            "description": "按事件币种精度 0～18 位固定小数文本；成功为已确认等额金额，失败为原订单金额；不是最小单位整数。签名与正文格式完全一致。"
          },
          "requestAmount": {
            "$ref": "#/components/schemas/Amount",
            "description": "原下单最小单位整数金额，不做除以 10^n 的处理。与 amount、decimalPlaces 满足精确等式 amount × 10^decimalPlaces = requestAmount；失败不代表已付款。仅字段签名测试探测使用 0，不属于交易事件。 超出 JavaScript 安全整数时为十进制字符串，扩展签名按精确整数文本计算。"
          },
          "decimalPlaces": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "maximum": 18,
            "description": "本事件转换 amount 使用的已保存精度快照，重试和重发不读取当前配置。"
          },
          "signV2": {
            "type": "string",
            "description": "扩展的 RSA-SHA256 标准 Base64 签名：原 13 字段规范串后依次追加 &requestAmount=<十进制整数>&decimalPlaces=<十进制整数>。编码及平台公钥与 sign 相同。"
          },
          "currency": {
            "type": "string"
          },
          "finishTime": {
            "type": "string",
            "format": "date-time",
            "description": "UTC，yyyy-MM-dd'T'HH:mm:ss'Z'，不含毫秒。"
          },
          "failReason": {
            "type": "string",
            "description": "成功为空字符串；失败为已固化原因，缺失则回退 failureCode 或空字符串。"
          },
          "extend": {
            "type": "string",
            "maxLength": 1024,
            "description": "未传或 null 输出空字符串；已传字符串原样回传。"
          },
          "sign": {
            "type": "string",
            "description": "对固定字段拼接执行 RSA-SHA256，标准 Base64。固定字段顺序及编码规则保持。"
          }
        }
      },
      "MerchantSupportRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MerchantCapabilitiesRequest"
          },
          {
            "type": "object",
            "properties": {
              "locale": {
                "type": "string",
                "maxLength": 16
              },
              "keys": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "items": {
                  "$ref": "#/components/schemas/MerchantSupportKey"
                },
                "description": "Optional batch of complete market blocks. Sign the original order, including duplicates. Results are deduplicated and sorted; omission preserves the legacy full response."
              }
            }
          }
        ]
      },
      "MerchantSupport": {
        "type": "object",
        "required": [
          "version",
          "environment",
          "markets"
        ],
        "description": "同一商户和路径环境的完整配置支持快照，不承诺余额、剩余额度、实时健康或交易成功。",
        "properties": {
          "version": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$",
            "description": "公开支持内容及全部配置语言的稳定版本；请求语言不改变版本。只能比较同一商户和同一路径环境的版本。"
          },
          "environment": {
            "type": "string",
            "enum": [
              "PRODUCTION",
              "SANDBOX",
              "ALL"
            ]
          },
          "markets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MerchantSupportMarket"
            }
          }
        }
      },
      "MerchantSupportMarket": {
        "type": "object",
        "required": [
          "countryCode",
          "name",
          "currency",
          "decimalPlaces",
          "directions"
        ],
        "properties": {
          "countryCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "法币为国家代码；数字资产为 null。"
          },
          "name": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "decimalPlaces": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18
          },
          "directions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MerchantSupportDirection"
            }
          }
        }
      },
      "MerchantSupportDirection": {
        "type": "object",
        "required": [
          "paymentMethods",
          "banks"
        ],
        "properties": {
          "paymentMethods": {
            "$ref": "#/components/schemas/PaymentMethods"
          },
          "banks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MerchantSupportBankDirectory"
            }
          }
        }
      },
      "MerchantSupportBankDirectory": {
        "type": "object",
        "required": [
          "paymentMethod",
          "bankRole",
          "banks"
        ],
        "properties": {
          "paymentMethod": {
            "type": "string"
          },
          "bankRole": {
            "type": "string",
            "enum": [
              "PAYER",
              "TARGET",
              "RECIPIENT"
            ]
          },
          "banks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WithdrawalBank"
            }
          }
        }
      },
      "MerchantSupportResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseBase"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/MerchantSupport"
                  },
                  {
                    "$ref": "#/components/schemas/MerchantSupportPartial"
                  }
                ]
              }
            }
          }
        ]
      },
      "MerchantSupportKey": {
        "type": "string",
        "pattern": "^(?:[A-Z]{2}|_)/[A-Z][A-Z0-9]{1,15}$",
        "description": "Country/currency key, e.g. TH/THB; countryless assets use _/USDT. Direction and environment are not key segments."
      },
      "MerchantSupportPartial": {
        "type": "object",
        "required": [
          "environment",
          "parts"
        ],
        "properties": {
          "environment": {
            "type": "string",
            "enum": [
              "PRODUCTION",
              "SANDBOX",
              "ALL"
            ]
          },
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MerchantSupportPart"
            }
          }
        },
        "description": "Authenticated merchant and path environment only. One repeatable-read snapshot per batch; no full version/markets fields."
      },
      "MerchantSupportPart": {
        "type": "object",
        "required": [
          "key",
          "version",
          "deleted",
          "data"
        ],
        "properties": {
          "key": {
            "$ref": "#/components/schemas/MerchantSupportKey"
          },
          "version": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$",
            "description": "Per-key content hash, scoped by environment and independent of requested locale. Unordered; not the notification/full version."
          },
          "deleted": {
            "type": "boolean"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MerchantSupportContent"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "oneOf": [
          {
            "properties": {
              "deleted": {
                "const": false
              },
              "data": {
                "$ref": "#/components/schemas/MerchantSupportContent"
              }
            }
          },
          {
            "properties": {
              "deleted": {
                "const": true
              },
              "data": {
                "type": "null"
              }
            }
          }
        ],
        "description": "Valid but nonexistent, unauthorized or revoked keys have deleted=true and explicit null data. A read failure fails the batch; it never becomes a deletion."
      },
      "MerchantSupportBankIdentity": {
        "type": "object",
        "required": [
          "bankId",
          "code",
          "name"
        ],
        "properties": {
          "bankId": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Unified PA bank ID; submit payer.bankId, targetBankId or recipient.bankId according to bankRole."
          },
          "code": {
            "type": "string",
            "description": "PA 统一编码，供展示及缓存识别；不作为 PG 编码发送。"
          },
          "ssCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "已核实的 SS 原始编码；未绑定时为空。按国家区分，不代表 PG 原始编码。"
          },
          "name": {
            "type": "string",
            "description": "优先显示当前商户展示别名，否则显示 PA 本地化名称，缺指定语言时回退 en-US；下单仍传 bankId，不接受名称或别名。"
          }
        },
        "description": "One shared bank identity per country/currency. Channel-specific restrictions belong to bankSupport references."
      },
      "MerchantSupportContent": {
        "type": "object",
        "required": [
          "countryCode",
          "name",
          "currency",
          "decimalPlaces",
          "directions",
          "banks"
        ],
        "properties": {
          "countryCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "法币为国家代码；数字资产为 null。"
          },
          "name": {
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "decimalPlaces": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18
          },
          "directions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MerchantSupportPartialDirection"
            }
          },
          "banks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MerchantSupportBankIdentity"
            }
          }
        }
      },
      "MerchantSupportPartialDirection": {
        "type": "object",
        "required": [
          "paymentMethods"
        ],
        "properties": {
          "paymentMethods": {
            "$ref": "#/components/schemas/PaymentMethods"
          }
        },
        "description": "Both supported directions are part of one market key. Missing directions must not retain old cached data."
      },
      "MerchantSupportChannelBanks": {
        "type": "object",
        "required": [
          "bankRole",
          "banks"
        ],
        "properties": {
          "bankRole": {
            "type": "string",
            "enum": [
              "PAYER",
              "TARGET",
              "RECIPIENT"
            ]
          },
          "banks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MerchantSupportSupportedBank"
            }
          }
        }
      },
      "MerchantSupportSupportedBank": {
        "type": "object",
        "required": [
          "bankId",
          "ruleType"
        ],
        "properties": {
          "bankId": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,18}$",
            "description": "Unified PA bank ID; submit payer.bankId, targetBankId or recipient.bankId according to bankRole."
          },
          "ruleType": {
            "type": "string",
            "enum": [
              "RANGE",
              "FIXED_DENOMINATIONS",
              "MIXED"
            ]
          },
          "minAmount": {
            "$ref": "#/components/schemas/Amount"
          },
          "maxAmount": {
            "$ref": "#/components/schemas/Amount"
          },
          "denominations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Amount"
            }
          },
          "amountRules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AmountRule"
            }
          }
        },
        "description": "Effective bank/channel amount rules. Several channels may reference the same bankId with different constraints; check complete rules, not only aggregate min/max."
      }
    }
  }
}
