{
  "openapi": "3.1.0",
  "info": {
    "title": "GatePay Institutional API",
    "description": "Gate Pay Institution API documentation. Create and manage sub-accounts, finance, orders, payout, transfer, and more.",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://openplatform.gateapi.io"
    }
  ],
  "paths": {
    "/merchant/open/institution/v1/accounts/create": {
      "post": {
        "summary": "Create Sub-Account",
        "description": "Create a new sub-account for a customer under the institution account and register the account holder information.",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-GatePay-Certificate-ClientId"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Nonce"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Signature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubAccountRequest"
              },
              "examples": {
                "businessExample": {
                  "summary": "Business",
                  "value": {
                    "request_id": "35778162074976257",
                    "customer_id": "1234",
                    "display_name": "my test",
                    "account_holder": {
                      "entity_country": "AF",
                      "entity_type": "BUSINESS",
                      "entity_name": "My Business Ltd",
                      "entity_id_type": "BUSINESS_LICENSE",
                      "entity_id_number": "abcd1234",
                      "entity_id_expiry": {
                        "valid_from": 1763538010509
                      },
                      "address": {
                        "line1": "123 Main Street",
                        "country": "AF"
                      },
                      "merchant_category": "GENERAL_RETAIL",
                      "user_agreement": true,
                      "ubo_list": [
                        {
                          "country": "AF",
                          "full_name": "testName778",
                          "dob": {
                            "year": 2026,
                            "month": 3,
                            "day": 3
                          },
                          "id_type": "DRIVING_LICENSE",
                          "id_number": "130",
                          "id_expiry": {
                            "valid_from": 1773135745000,
                            "valid_to": 1873135745000
                          },
                          "relationship": {
                            "is_representative": false,
                            "is_owner": false,
                            "percent_ownership": "30"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSubAccountResponseWrapper"
                },
                "examples": {
                  "success": {
                    "summary": "Success Response",
                    "value": {
                      "status": "SUCCESS",
                      "code": "000000",
                      "errorMessage": "",
                      "data": {
                        "request_id": "35778162074976257",
                        "status": "INIT",
                        "created": "1764139242707",
                        "display_name": "my test",
                        "customer_id": "1234",
                        "account_holder": {
                          "entity_country": "AF",
                          "entity_type": "BUSINESS",
                          "entity_name": "My Business Ltd",
                          "entity_id_type": "BUSINESS_LICENSE",
                          "entity_id_number": "abcd1234",
                          "entity_id_expiry": {
                            "valid_from": 1763538010509,
                            "valid_to": null
                          },
                          "dob": null,
                          "business_registration": null,
                          "address": {
                            "line1": "123 Main Street",
                            "country": "AF"
                          },
                          "merchant_category": "GENERAL_RETAIL",
                          "website": null,
                          "user_agreement": true
                        },
                        "metadata": null
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/merchant/open/institution/v1/accounts/update": {
      "post": {
        "summary": "Update Sub-Account",
        "description": "Update sub-account details and account holder information.",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-GatePay-Certificate-ClientId"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Nonce"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Signature"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-On-Behalf-Of"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSubAccountRequest"
              },
              "examples": {
                "updateExample": {
                  "summary": "Update example",
                  "value": {
                    "display_name": "new name",
                    "account_holder": {
                      "entity_country": "AF",
                      "entity_type": "BUSINESS",
                      "entity_id_type": "BUSINESS_LICENSE",
                      "entity_id_number": "abcd1234",
                      "entity_id_expiry": {
                        "valid_from": 1763538010509
                      },
                      "merchant_category": "GENERAL_RETAIL",
                      "user_agreement": true,
                      "ubo_list": [
                        {
                          "country": "AF",
                          "full_name": "testName778",
                          "dob": {
                            "year": 2026,
                            "month": 3,
                            "day": 3
                          },
                          "id_type": "DRIVING_LICENSE",
                          "id_number": "130",
                          "id_expiry": {
                            "valid_from": 1773135745000,
                            "valid_to": 1873135745000
                          },
                          "relationship": {
                            "is_representative": false,
                            "is_owner": false,
                            "percent_ownership": "30"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateSubAccountResponseWrapper"
                },
                "examples": {
                  "success": {
                    "summary": "Response example",
                    "value": {
                      "status": "SUCCESS",
                      "code": "000000",
                      "errorMessage": "",
                      "data": {
                        "status": "ACTIVE",
                        "updated": "1764141615061",
                        "display_name": "new name",
                        "customer_id": "1234",
                        "account_id": "2124538349",
                        "account_holder": {
                          "entity_country": "AF",
                          "entity_type": "BUSINESS",
                          "entity_name": null,
                          "entity_id_type": "BUSINESS_LICENSE",
                          "entity_id_number": "abcd1234",
                          "entity_id_expiry": {
                            "valid_from": 1763538010509,
                            "valid_to": null
                          },
                          "dob": null,
                          "business_registration": null,
                          "address": null,
                          "merchant_category": "GENERAL_RETAIL",
                          "website": null,
                          "user_agreement": true
                        },
                        "metadata": null
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/merchant/open/institution/v1/accounts/query": {
      "get": {
        "summary": "Query Sub-Account",
        "description": "Query sub-account details.",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-GatePay-Certificate-ClientId"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Nonce"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Signature"
          },
          {
            "name": "request_id",
            "in": "query",
            "required": false,
            "description": "Creation request ID.",
            "schema": {
              "type": "string",
              "example": "35778162074976257"
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "required": false,
            "description": "Sub-account ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuerySubAccountResponseWrapper"
                },
                "examples": {
                  "success": {
                    "summary": "Response example",
                    "value": {
                      "status": "SUCCESS",
                      "code": "000000",
                      "errorMessage": "",
                      "data": {
                        "request_id": "35778162074976257",
                        "account_id": "2124538349",
                        "customer_id": "1234",
                        "display_name": "new name",
                        "status": "ACTIVE",
                        "created": 1763469689743,
                        "updated": 1764141615061,
                        "account_holder": {
                          "entity_country": "AF",
                          "entity_type": "BUSINESS",
                          "entity_name": null,
                          "entity_id_type": "BUSINESS_LICENSE",
                          "entity_id_number": "abcd1234",
                          "entity_id_expiry": {
                            "valid_from": 1763538010509,
                            "valid_to": null
                          },
                          "dob": null,
                          "business_registration": null,
                          "address": null,
                          "merchant_category": "GENERAL_RETAIL",
                          "website": null,
                          "user_agreement": true
                        },
                        "metadata": null
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/merchant/open/institution/v1/accounts/list": {
      "get": {
        "summary": "List Sub-Accounts",
        "description": "Paginated list of sub-accounts.",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-GatePay-Certificate-ClientId"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Nonce"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Signature"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Status: created - ACTIVE.",
            "schema": {
              "type": "string",
              "enum": [
                "ACTIVE"
              ]
            }
          },
          {
            "name": "request_id",
            "in": "query",
            "required": false,
            "description": "Creation request ID.",
            "schema": {
              "type": "string",
              "example": "35778162074976257"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Customer ID on the platform side.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_gte",
            "in": "query",
            "required": false,
            "description": "Creation time (ms) ≥.",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "created_lte",
            "in": "query",
            "required": false,
            "description": "Creation time (ms) ≤.",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 20, max 200.",
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 200,
              "example": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Cursor (page number), starting from 1.",
            "schema": {
              "type": "integer",
              "example": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSubAccountsResponseWrapper"
                },
                "examples": {
                  "success": {
                    "summary": "Response example",
                    "value": {
                      "status": "SUCCESS",
                      "code": "000000",
                      "errorMessage": "",
                      "data": {
                        "accounts": [
                          {
                            "request_id": "35778162074976257",
                            "account_id": "2124543768",
                            "customer_id": "1234",
                            "display_name": "my test",
                            "status": "ACTIVE",
                            "created": 1764139266551
                          }
                        ],
                        "has_more": false
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/transfer/open/institution/v1/pay/transfer": {
      "post": {
        "summary": "Create Transfer",
        "description": "Initiate an account-to-account transfer. `X-GatePay-On-Behalf-Of` specifies the initiating account ID for this transaction, and `accountId` specifies the recipient account ID. In the current version, this is a synchronous API and returns the final execution result directly.",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-GatePay-Certificate-ClientId"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Nonce"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Signature"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-On-Behalf-Of"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferRequest"
              },
              "examples": {
                "default": {
                  "summary": "Transfer example",
                  "value": {
                    "merchantBatchNo": "1234565454511231",
                    "accountId": "1979044675",
                    "currency": "USDT",
                    "amount": "1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferResponseWrapper"
                },
                "examples": {
                  "success": {
                    "summary": "Success response",
                    "value": {
                      "status": "SUCCESS",
                      "code": "000000",
                      "errorMessage": "",
                      "data": {
                        "merchantBatchNo": "1234565454511231",
                        "status": "PAID",
                        "fromAccountId": "2124267192",
                        "toAccountId": "1979044675",
                        "currency": "USDT",
                        "amount": "1",
                        "createTime": 1763455435851
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/transfer/open/institution/v1/pay/transfer/detail": {
      "get": {
        "summary": "Transfer Record Query",
        "description": "Query historical transfer records by merchant batch number for result backfill or reconciliation checks. In the current version, it is no longer used as an asynchronous polling endpoint.",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-GatePay-Certificate-ClientId"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Nonce"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Signature"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-On-Behalf-Of"
          },
          {
            "name": "merchantBatchNo",
            "in": "query",
            "required": true,
            "description": "Unique batch ID from the merchant.",
            "schema": {
              "type": "string",
              "example": "12345654545"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferDetailResponseWrapper"
                },
                "examples": {
                  "success": {
                    "summary": "Success response",
                    "value": {
                      "status": "SUCCESS",
                      "code": "000000",
                      "errorMessage": "",
                      "data": {
                        "merchantBatchNo": "1234565454511231",
                        "status": "PAID",
                        "fromAccountId": "2124267192",
                        "toAccountId": "1979044675",
                        "currency": "USDT",
                        "amount": "1",
                        "createTime": 1763455435851
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/merchant/open/institution/v1/wealth/action": {
      "post": {
        "summary": "Update wealth service status",
        "description": "Enable or disable wealth management for a sub-account. `X-GatePay-On-Behalf-Of` identifies the delegated institution account ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-GatePay-Certificate-ClientId"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Nonce"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Signature"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-On-Behalf-Of"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WealthActionRequest"
              },
              "examples": {
                "default": {
                  "summary": "Enable wealth service",
                  "value": {
                    "action": "SIGN"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WealthActionResponseWrapper"
                },
                "examples": {
                  "success": {
                    "summary": "Success response",
                    "value": {
                      "status": "SUCCESS",
                      "code": "000000",
                      "errorMessage": "",
                      "data": {
                        "status": "SIGN",
                        "account_id": "2124766106"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/merchant/open/institution/v1/wealth/query": {
      "get": {
        "summary": "Query wealth service status",
        "description": "Query the wealth management status of a sub-account. `X-GatePay-On-Behalf-Of` identifies the delegated institution account ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-GatePay-Certificate-ClientId"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Nonce"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Signature"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-On-Behalf-Of"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WealthQueryResponseWrapper"
                },
                "examples": {
                  "success": {
                    "summary": "Success response",
                    "value": {
                      "status": "SUCCESS",
                      "code": "000000",
                      "errorMessage": "",
                      "data": {
                        "status": "SIGN",
                        "enabled": 1772516898675,
                        "updated": 1772519811822,
                        "account_id": "2124766106"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/transfer/open/institution/v1/pay/charge": {
      "post": {
        "summary": "Create Charge",
        "description": "Initiate an account-to-account charge. `X-GatePay-On-Behalf-Of` specifies the initiating account ID for this transaction, and `accountId` specifies the payer account ID (the debited account). In the current version, this is a synchronous API and returns the final execution result directly.",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-GatePay-Certificate-ClientId"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Nonce"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Signature"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-On-Behalf-Of"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChargeRequest"
              },
              "examples": {
                "default": {
                  "summary": "Charge example",
                  "value": {
                    "merchantBatchNo": "1234565454511231",
                    "accountId": "1979044675",
                    "currency": "USDT",
                    "amount": "1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeResponseWrapper"
                },
                "examples": {
                  "success": {
                    "summary": "Success response",
                    "value": {
                      "status": "SUCCESS",
                      "code": "000000",
                      "errorMessage": "",
                      "data": {
                        "merchantBatchNo": "1234565454511231",
                        "status": "PAID",
                        "fromAccountId": "2124267192",
                        "toAccountId": "1979044675",
                        "currency": "USDT",
                        "amount": "1",
                        "createTime": 1763455435851
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/transfer/open/institution/v1/pay/charges/detail": {
      "get": {
        "summary": "Charge Record Query",
        "description": "Query historical charge records by merchant batch number for result backfill or reconciliation checks. In the current version, it is no longer used as an asynchronous polling endpoint.",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-GatePay-Certificate-ClientId"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Nonce"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Signature"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-On-Behalf-Of"
          },
          {
            "name": "merchantBatchNo",
            "in": "query",
            "required": true,
            "description": "Unique batch ID from the merchant.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeDetailResponseWrapper"
                },
                "examples": {
                  "success": {
                    "summary": "Success response",
                    "value": {
                      "status": "SUCCESS",
                      "code": "000000",
                      "errorMessage": "",
                      "data": {
                        "merchantBatchNo": "1234565454511231",
                        "status": "PAID",
                        "fromAccountId": "2124267192",
                        "toAccountId": "1979044675",
                        "currency": "USDT",
                        "amount": "1",
                        "createTime": 1763455435851
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/pay-cashier/open/v1/certification/url": {
      "post": {
        "summary": "获取认证 URL",
        "operationId": "getCertificationUrl",
        "tags": [
          "Institutional"
        ],
        "parameters": [
          {
            "name": "X-GatePay-On-Behalf-Of",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "机构子账户 ID"
          },
          {
            "name": "X-GatePay-Merchant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "商户 ID"
          },
          {
            "name": "X-GatePay-Certificate-ClientId",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "客户端 ID（证书专用）"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "expireSeconds"
                ],
                "properties": {
                  "expireSeconds": {
                    "type": "integer",
                    "description": "认证URL过期时间（秒）",
                    "example": 86400
                  },
                  "requestId": {
                    "type": "string",
                    "description": "请求 ID，用于追踪请求来源（可选参数）"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "0"
                    },
                    "message": {
                      "type": "string",
                      "example": "success"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "authUrl": {
                          "type": "string",
                          "description": "认证 URL"
                        },
                        "subAccountId": {
                          "type": "integer",
                          "format": "int64",
                          "description": "子账户 ID"
                        },
                        "expireTime": {
                          "type": "integer",
                          "format": "int64",
                          "description": "认证URL过期时间戳(毫秒)"
                        },
                        "requestId": {
                          "type": "string",
                          "description": "请求 ID"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/pay-cashier/open/v1/certification/verify/query": {
      "get": {
        "summary": "Query Verification Status",
        "description": "Query the current KYB verification status of an institutional sub-account.",
        "operationId": "queryVerify",
        "tags": [
          "Institutional"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-GatePay-Certificate-ClientId"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Timestamp"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Nonce"
          },
          {
            "$ref": "#/components/parameters/X-GatePay-Signature"
          },
          {
            "name": "subAccountId",
            "in": "query",
            "required": true,
            "description": "Institutional sub-account ID",
            "schema": {
              "type": "integer",
              "format": "int64",
              "example": 53695180
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryVerifyResponseWrapper"
                },
                "examples": {
                  "success": {
                    "summary": "Verification passed",
                    "value": {
                      "code": "2",
                      "message": "success",
                      "data": {
                        "merchantNo": "12345678",
                        "subAccountId": "53695180",
                        "currentAuthStatus": "succeeded",
                        "accountType": "KYB",
                        "submitTime": 1780036614339,
                        "auditTime": 1780036714339
                      }
                    }
                  },
                  "rejected": {
                    "summary": "Verification rejected",
                    "value": {
                      "code": "2",
                      "message": "success",
                      "data": {
                        "merchantNo": "12345678",
                        "subAccountId": "53695180",
                        "currentAuthStatus": "rejected",
                        "accountType": "KYB",
                        "submitTime": 1780036614339,
                        "auditTime": 1780036714339,
                        "rejectReason": "ID photo is unclear"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "institutionAccountWebhook": {
      "post": {
        "summary": "Sub-account Creation Result Notification",
        "description": "When sub-account creation succeeds or fails, GatePay sends an asynchronous POST notification to the callback URL configured by the merchant.\n\nThe callback payload includes `bizType`, `bizId`, `bizStatus`, `clientId`, and `data`, where `data` is a JSON string of the sub-account creation result object. The merchant must accept and parse the notification at that URL and return HTTP 200 to acknowledge receipt.",
        "operationId": "institutionAccountCallbackNotify",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubAccountCallbackNotification"
              },
              "examples": {
                "success": {
                  "summary": "Creation success notification",
                  "value": {
                    "bizType": "INSTITUTION",
                    "bizId": "2060249001916727296",
                    "bizStatus": "INSTITUTION_ACCOUNT_SUCCESS",
                    "clientId": "caoLHPyfvjtnJPJe",
                    "data": "{\"request_id\":\"2060249001916727296\",\"account_id\":\"53695180\",\"customer_id\":\"2060249001845424128\",\"display_name\":\"ABC\",\"status\":\"ACTIVE\",\"created\":1780036614339}"
                  }
                },
                "fail": {
                  "summary": "Creation failure notification",
                  "value": {
                    "bizType": "INSTITUTION",
                    "bizId": "35778162074976257",
                    "bizStatus": "INSTITUTION_ACCOUNT_FAIL",
                    "clientId": "ktBVqBBHrEHJmfZH",
                    "data": "{\"request_id\":\"35778162074976257\",\"account_id\":\"\",\"customer_id\":\"1234\",\"display_name\":\"my test\",\"status\":\"FAIL\",\"created\":1764139242707}"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return HTTP 200 to indicate the callback notification has been received.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSubAccountCallbackAck"
                },
                "examples": {
                  "success": {
                    "summary": "Successful callback acknowledgement",
                    "value": {
                      "returnCode": "SUCCESS",
                      "returnMessage": null
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "institutionVerifyResultWebhook": {
      "post": {
        "summary": "Sub-account Verification Result Notification",
        "description": "When sub-account KYB verification completes (passed or rejected), GatePay sends an asynchronous POST notification to the callback URL configured by the merchant.\n\nThe callback payload includes `bizType`, `bizId`, `bizStatus`, `clientId`, and `data`, where `data` is a JSON string of the verification result object. The merchant must accept and parse the notification at that URL and return HTTP 200 to acknowledge receipt.",
        "operationId": "institutionVerifyResultCallbackNotify",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstitutionVerifyResultCallbackNotification"
              },
              "examples": {
                "passed": {
                  "summary": "Verification passed",
                  "value": {
                    "bizType": "INSTITUTION",
                    "bizId": "2060249001916727298",
                    "bizStatus": "PASSED",
                    "clientId": "caoLHPyfvjtnJPJe",
                    "data": "{\"subAccountId\":\"53695180\",\"authStatus\":\"PASSED\",\"accountType\":\"KYB\",\"auditTime\":1780036714339,\"rejectReason\":null}"
                  }
                },
                "failed": {
                  "summary": "Verification rejected",
                  "value": {
                    "bizType": "INSTITUTION",
                    "bizId": "2060249001916727299",
                    "bizStatus": "FAILED",
                    "clientId": "caoLHPyfvjtnJPJe",
                    "data": "{\"subAccountId\":\"53695180\",\"authStatus\":\"FAILED\",\"accountType\":\"KYB\",\"auditTime\":1780036714339,\"rejectReason\":\"ID photo is unclear\"}"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return HTTP 200 to acknowledge receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSubAccountCallbackAck"
                },
                "examples": {
                  "success": {
                    "summary": "Acknowledgement",
                    "value": {
                      "returnCode": "SUCCESS",
                      "returnMessage": null
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "X-GatePay-Certificate-ClientId": {
        "name": "X-GatePay-Certificate-ClientId",
        "in": "header",
        "required": true,
        "description": "The clientId assigned when the merchant registers an application in the Gate merchant console.",
        "schema": {
          "type": "string",
          "example": "4186d0c6-6a35-55a9-8dc6-5312769dbff8"
        }
      },
      "X-GatePay-Signature": {
        "name": "X-GatePay-Signature",
        "in": "header",
        "required": true,
        "description": "Request signature. GatePay uses this signature to verify whether the request is valid.",
        "schema": {
          "type": "string"
        }
      },
      "X-GatePay-Timestamp": {
        "name": "X-GatePay-Timestamp",
        "in": "header",
        "required": true,
        "description": "Millisecond timestamp; the difference from server time must not exceed 30 seconds.",
        "schema": {
          "type": "string",
          "example": "1672905655498"
        }
      },
      "X-GatePay-Nonce": {
        "name": "X-GatePay-Nonce",
        "in": "header",
        "required": true,
        "description": "Random string. Must comply with HTTP header rules; recommended length is within 32 characters, composed of digits and letters.",
        "schema": {
          "type": "string",
          "example": "9578"
        }
      },
      "X-GatePay-On-Behalf-Of": {
        "name": "X-GatePay-On-Behalf-Of",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "Required delegated subject header. Provide the initiating account ID for this transaction. It can be an institution account ID or a sub-account ID."
      }
    },
    "schemas": {
      "CreateSubAccountRequest": {
        "type": "object",
        "required": [
          "request_id",
          "customer_id",
          "display_name",
          "account_holder"
        ],
        "properties": {
          "request_id": {
            "type": "string",
            "description": "Unique request ID from caller."
          },
          "customer_id": {
            "type": "string",
            "description": "Customer ID on the platform side."
          },
          "display_name": {
            "type": "string",
            "description": "Display name of the sub-account."
          },
          "account_holder": {
            "$ref": "#/components/schemas/AccountHolder"
          },
          "metadata": {
            "type": "object",
            "description": "Additional key–value metadata."
          }
        }
      },
      "AccountHolder": {
        "type": "object",
        "required": [
          "entity_country",
          "entity_type",
          "entity_name",
          "entity_id_type",
          "entity_id_number",
          "entity_id_expiry",
          "address",
          "merchant_category",
          "user_agreement"
        ],
        "properties": {
          "entity_country": {
            "type": "string",
            "description": "Entity's country ISO code. For the full list, refer to the official ISO online browsing platform or public ISO 3166-1 alpha-2 tables (e.g. https://www.iban.com/country-codes)."
          },
          "entity_type": {
            "type": "string",
            "enum": [
              "INDIVIDUAL",
              "BUSINESS"
            ],
            "description": "Entity type: individual - INDIVIDUAL, business - BUSINESS."
          },
          "entity_name": {
            "type": "string",
            "description": "Entity name (person's full name / legal business name)."
          },
          "entity_id_type": {
            "type": "string",
            "enum": [
              "PASSPORT",
              "NATIONAL_ID",
              "DRIVING_LICENSE",
              "BUSINESS_LICENSE",
              "CERTIFICATE_OF_INCORPORATION"
            ],
            "description": "ID document type. See Document Type Enumeration (PASSPORT, NATIONAL_ID, DRIVING_LICENSE for individual; BUSINESS_LICENSE, CERTIFICATE_OF_INCORPORATION for business)."
          },
          "entity_id_number": {
            "type": "string",
            "description": "ID document number."
          },
          "entity_id_expiry": {
            "$ref": "#/components/schemas/EntityIdExpiry"
          },
          "dob": {
            "$ref": "#/components/schemas/Dob",
            "description": "Date of birth; required when entity_type is INDIVIDUAL."
          },
          "business_registration": {
            "$ref": "#/components/schemas/BusinessRegistration",
            "description": "Business registration information; can be provided when entity_type is BUSINESS."
          },
          "address": {
            "$ref": "#/components/schemas/Address",
            "description": "Entity address."
          },
          "merchant_category": {
            "type": "string",
            "description": "Merchant category. See Merchant Category Enumeration.",
            "enum": [
              "GENERAL_RETAIL",
              "SUPERMARKET_CONVENIENCE",
              "FASHION_AND_ACCESSORIES",
              "FOOD_AND_BEVERAGE",
              "DIGITAL_CONTENT_AND_SAAS",
              "GAMING_AND_ENTERTAINMENT",
              "TRAVEL_AND_TICKETING",
              "RIDE_HAILING_AND_TRANSPORT",
              "HOSPITALITY_AND_LEISURE",
              "EDUCATION",
              "HEALTHCARE_AND_WELLNESS",
              "FINANCIAL_SERVICES",
              "CRYPTO_AND_WEB3",
              "UTILITIES_AND_BILLS",
              "CHARITY_AND_NONPROFIT",
              "OTHER"
            ]
          },
          "website": {
            "type": "string",
            "description": "Business website."
          },
          "user_agreement": {
            "type": "boolean",
            "description": "Whether the user has signed the agreement."
          },
          "ubo_list": {
            "type": "array",
            "description": "List of legal representative(s) and/or ultimate beneficial owner(s) (UBO). Required when entity_type is BUSINESS.",
            "items": {
              "$ref": "#/components/schemas/Ubo"
            }
          }
        }
      },
      "EntityIdExpiry": {
        "type": "object",
        "required": [
          "valid_from"
        ],
        "properties": {
          "valid_from": {
            "type": "integer",
            "format": "int64",
            "description": "Effective date, in milliseconds."
          },
          "valid_to": {
            "type": "integer",
            "format": "int64",
            "description": "Expiry date, in milliseconds."
          }
        }
      },
      "Dob": {
        "type": "object",
        "required": [
          "year",
          "month",
          "day"
        ],
        "properties": {
          "year": {
            "type": "integer",
            "description": "4-digit year."
          },
          "month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "description": "Month, 1–12."
          },
          "day": {
            "type": "integer",
            "minimum": 1,
            "maximum": 31,
            "description": "Day of month, 1–31."
          }
        }
      },
      "BusinessRegistration": {
        "type": "object",
        "properties": {
          "reg_number": {
            "type": "string",
            "description": "Registration number."
          },
          "reg_country": {
            "type": "string",
            "description": "Country of registration."
          },
          "established_at": {
            "type": "integer",
            "format": "int64",
            "description": "Date of establishment."
          }
        }
      },
      "Address": {
        "type": "object",
        "required": [
          "line1",
          "country"
        ],
        "properties": {
          "line1": {
            "type": "string",
            "description": "Address line 1."
          },
          "line2": {
            "type": "string",
            "description": "Address line 2."
          },
          "line3": {
            "type": "string",
            "description": "Address line 3."
          },
          "country": {
            "type": "string",
            "description": "Country code."
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "state": {
            "type": "string",
            "description": "State / province."
          },
          "postal_code": {
            "type": "string",
            "description": "Postal code."
          }
        }
      },
      "CreateSubAccountResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "SUCCESS"
          },
          "code": {
            "type": "string",
            "example": "000000"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/CreateSubAccountResponse"
          }
        }
      },
      "CreateSubAccountResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "Request ID."
          },
          "status": {
            "type": "string",
            "description": "Account status: initial - INIT, processing - PENDING, created - ACTIVE, creation failed - FAIL."
          },
          "created": {
            "type": "string",
            "description": "Creation time (milliseconds)."
          },
          "customer_id": {
            "type": "string",
            "description": "Customer ID on the platform side."
          },
          "display_name": {
            "type": "string",
            "description": "Display name."
          },
          "account_holder": {
            "$ref": "#/components/schemas/AccountHolder"
          },
          "metadata": {
            "type": "object",
            "description": "Additional key–value metadata."
          }
        }
      },
      "CreateSubAccountCallbackNotification": {
        "type": "object",
        "description": "Callback notification body for sub-account creation result",
        "properties": {
          "bizType": {
            "type": "string",
            "description": "Notification type; INSTITUTION = sub-account creation"
          },
          "bizId": {
            "type": "string",
            "description": "Creation request ID"
          },
          "bizStatus": {
            "type": "string",
            "description": "Business status: INSTITUTION_ACCOUNT_SUCCESS = created, INSTITUTION_ACCOUNT_FAIL = creation failed"
          },
          "clientId": {
            "type": "string",
            "description": "Merchant client_id that created the sub-account"
          },
          "data": {
            "type": "string",
            "description": "Message body as a JSON string; parsed structure see `CreateSubAccountCallbackData`."
          }
        },
        "required": [
          "bizType",
          "bizId",
          "bizStatus",
          "clientId",
          "data"
        ]
      },
      "CreateSubAccountCallbackData": {
        "type": "object",
        "description": "Parsed content of the data field",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "Creation request ID"
          },
          "account_id": {
            "type": "string",
            "description": "Sub-account ID"
          },
          "customer_id": {
            "type": "string",
            "description": "Customer ID on the platform side"
          },
          "display_name": {
            "type": "string",
            "description": "Display name"
          },
          "status": {
            "type": "string",
            "description": "Account status: ACTIVE = created, FAIL = creation failed"
          },
          "created": {
            "type": "integer",
            "format": "int64",
            "description": "Creation time (milliseconds)"
          }
        }
      },
      "CreateSubAccountCallbackAck": {
        "type": "object",
        "description": "Merchant acknowledgement returned after receiving the callback.",
        "properties": {
          "returnCode": {
            "type": "string",
            "description": "Return status code, for example `SUCCESS`."
          },
          "returnMessage": {
            "type": "string",
            "description": "Return message.",
            "nullable": true
          }
        },
        "required": [
          "returnCode"
        ]
      },
      "QueryVerifyResponseWrapper": {
        "type": "object",
        "description": "Query verification status response",
        "properties": {
          "code": {
            "type": "string",
            "description": "Response code",
            "example": "2"
          },
          "message": {
            "type": "string",
            "description": "Response message",
            "example": "success"
          },
          "data": {
            "$ref": "#/components/schemas/GatePayVerifyQueryData"
          }
        }
      },
      "GatePayVerifyQueryData": {
        "type": "object",
        "description": "Verification status query result",
        "properties": {
          "merchantNo": {
            "type": "string",
            "description": "Institution main merchant ID"
          },
          "subAccountId": {
            "type": "string",
            "description": "Institutional sub-account ID"
          },
          "currentAuthStatus": {
            "type": "string",
            "description": "Latest overall verification status of the sub-account",
            "enum": [
              "un_open",
              "submitted",
              "succeeded",
              "rejected"
            ]
          },
          "accountType": {
            "type": "string",
            "description": "Verification type; always KYB",
            "enum": [
              "KYB"
            ]
          },
          "submitTime": {
            "type": "integer",
            "format": "int64",
            "description": "Submission time (milliseconds)"
          },
          "auditTime": {
            "type": "integer",
            "format": "int64",
            "description": "Audit completion time (milliseconds); returned only when status is `succeeded` or `rejected`"
          },
          "rejectReason": {
            "type": "string",
            "description": "Rejection reason; returned only when status is `rejected`"
          }
        }
      },
      "InstitutionVerifyResultCallbackNotification": {
        "type": "object",
        "description": "Sub-account verification result callback notification body",
        "properties": {
          "bizType": {
            "type": "string",
            "description": "Notification type; INSTITUTION = institution notification"
          },
          "bizId": {
            "type": "string",
            "description": "Notification business ID"
          },
          "bizStatus": {
            "type": "string",
            "description": "Business status: PASSED = verification passed, FAILED = verification rejected"
          },
          "clientId": {
            "type": "string",
            "description": "Institution merchant client_id"
          },
          "data": {
            "type": "string",
            "description": "Message content as a JSON string; see `InstitutionVerifyResultCallbackData` after parsing."
          }
        },
        "required": [
          "bizType",
          "bizId",
          "bizStatus",
          "clientId",
          "data"
        ]
      },
      "InstitutionVerifyResultCallbackData": {
        "type": "object",
        "description": "Parsed content of the `data` field",
        "properties": {
          "subAccountId": {
            "type": "string",
            "description": "Sub-account ID"
          },
          "authStatus": {
            "type": "string",
            "description": "Verification result: PASSED = passed, FAILED = rejected"
          },
          "accountType": {
            "type": "string",
            "description": "Verification type; always KYB"
          },
          "auditTime": {
            "type": "integer",
            "format": "int64",
            "description": "Audit completion time (milliseconds)"
          },
          "rejectReason": {
            "type": "string",
            "description": "Rejection reason",
            "nullable": true
          }
        }
      },
      "UpdateSubAccountRequest": {
        "type": "object",
        "properties": {
          "display_name": {
            "type": "string",
            "description": "Display name of the sub-account."
          },
          "account_holder": {
            "$ref": "#/components/schemas/AccountHolder",
            "description": "Account holder (entity) information (overwrite update)."
          },
          "metadata": {
            "type": "object",
            "description": "Additional key–value metadata."
          }
        }
      },
      "UpdateSubAccountResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/UpdateSubAccountResponse"
          }
        }
      },
      "UpdateSubAccountResponse": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Sub-account ID."
          },
          "status": {
            "type": "string",
            "description": "Account status: initial - INIT, processing - PENDING, created - ACTIVE, creation failed - FAIL."
          },
          "updated": {
            "type": "string",
            "description": "Last updated time (milliseconds)."
          },
          "customer_id": {
            "type": "string",
            "description": "Customer ID on the platform side."
          },
          "display_name": {
            "type": "string",
            "description": "Display name."
          },
          "account_holder": {
            "$ref": "#/components/schemas/AccountHolder",
            "description": "Account holder (entity) information."
          },
          "metadata": {
            "type": "object",
            "description": "Additional key–value metadata."
          }
        }
      },
      "QuerySubAccountResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/QuerySubAccountResponse"
          }
        }
      },
      "QuerySubAccountResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "Creation request ID."
          },
          "account_id": {
            "type": "string",
            "description": "Sub-account ID."
          },
          "customer_id": {
            "type": "string",
            "description": "Customer ID on the platform side."
          },
          "display_name": {
            "type": "string",
            "description": "Display name."
          },
          "status": {
            "type": "string",
            "description": "Account status: initial - INIT, processing - PENDING, created - ACTIVE, creation failed - FAIL."
          },
          "created": {
            "type": "integer",
            "format": "int64",
            "description": "Creation time (milliseconds)."
          },
          "updated": {
            "type": "integer",
            "format": "int64",
            "description": "Last updated time (milliseconds)."
          },
          "account_holder": {
            "$ref": "#/components/schemas/AccountHolder",
            "description": "Account holder (entity) information."
          },
          "metadata": {
            "type": "object",
            "description": "Additional key–value metadata."
          }
        }
      },
      "ListSubAccountsResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ListSubAccountsResponse"
          }
        }
      },
      "ListSubAccountsResponse": {
        "type": "object",
        "properties": {
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountInfo"
            },
            "description": "List of sub-accounts."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are more pages."
          }
        }
      },
      "AccountInfo": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "Creation request ID."
          },
          "account_id": {
            "type": "string",
            "description": "Sub-account ID."
          },
          "customer_id": {
            "type": "string",
            "description": "Customer ID on the platform side."
          },
          "display_name": {
            "type": "string",
            "description": "Display name."
          },
          "status": {
            "type": "string",
            "description": "Account status: initial - INIT, processing - PENDING, created - ACTIVE, creation failed - FAIL."
          },
          "created": {
            "type": "integer",
            "format": "int64",
            "description": "Creation time (milliseconds)."
          }
        }
      },
      "BalanceResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "balanceList": {
                "type": "array",
                "description": "List of balances for the requested currencies.",
                "items": {
                  "$ref": "#/components/schemas/BalanceItem"
                }
              }
            }
          }
        }
      },
      "BalanceItem": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "description": "Currency."
          },
          "available": {
            "type": "string",
            "description": "Available balance."
          }
        }
      },
      "BillOrderListResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/BillOrderListResponse"
          }
        }
      },
      "BillOrderListResponse": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total record count."
          },
          "hasNext": {
            "type": "boolean",
            "description": "Whether there is a next page; true = yes, false = no."
          },
          "nextPage": {
            "type": "integer",
            "description": "Next page number; valid only when hasNext is true."
          },
          "balance_history_item_list": {
            "type": "array",
            "description": "List of balance/fund flow items.",
            "items": {
              "$ref": "#/components/schemas/BalanceHistoryItem"
            }
          },
          "merchant_id": {
            "type": "integer",
            "description": "Merchant/supplier ID."
          }
        }
      },
      "BalanceHistoryItem": {
        "type": "object",
        "properties": {
          "transactId": {
            "type": "string",
            "description": "Payment transaction ID."
          },
          "transactTime": {
            "type": "integer",
            "format": "int64",
            "description": "Booking time, milliseconds."
          },
          "orderId": {
            "type": "string",
            "description": "GatePay order ID."
          },
          "merchantTradeNo": {
            "type": "string",
            "description": "Merchant order number."
          },
          "financialType": {
            "type": "string",
            "description": "Financial type."
          },
          "payAmount": {
            "type": "string",
            "description": "Payment/receipt amount."
          },
          "currency": {
            "type": "string",
            "description": "Currency."
          },
          "balance": {
            "type": "string",
            "description": "Account balance."
          },
          "balanceCurrency": {
            "type": "string",
            "description": "Balance currency."
          },
          "status": {
            "type": "string",
            "description": "PAID means success."
          },
          "payer": {
            "type": "integer",
            "description": "Gate pay payer user UID."
          },
          "buyer": {
            "type": "string",
            "description": "For Web3: payer address; for non-Web3: payer UID."
          },
          "refund_gate_id": {
            "type": "string",
            "description": "Refund order ID."
          },
          "payChannel": {
            "type": "string",
            "description": "Payment channel: Web3 or Gate."
          },
          "fullChain": {
            "type": "string",
            "description": "Payment network full name."
          },
          "address": {
            "type": "string",
            "description": "Merchant receipt address."
          },
          "hash": {
            "type": "string",
            "description": "Transaction hash."
          }
        }
      },
      "CreatePayoutsRequest": {
        "type": "object",
        "required": [
          "batch_id",
          "withdraw_list"
        ],
        "properties": {
          "batch_id": {
            "type": "string",
            "maxLength": 32,
            "description": "Unique batch ID generated by the merchant; only letters, digits, and underscores; max 32 characters."
          },
          "withdraw_list": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WithdrawItem"
            },
            "description": "List of withdraw sub-orders."
          },
          "channel_id": {
            "type": "string",
            "description": "Channel / customer name."
          }
        }
      },
      "WithdrawItem": {
        "type": "object",
        "required": [
          "merchant_withdraw_id",
          "amount",
          "currency",
          "chain",
          "address",
          "memo",
          "fee_type"
        ],
        "properties": {
          "merchant_withdraw_id": {
            "type": "string",
            "maxLength": 32,
            "description": "Unique sub-order ID from merchant; letters, digits, underscores only; max 32 characters."
          },
          "amount": {
            "type": "string",
            "description": "Withdraw amount per order; max 6 decimal places, values beyond 8 digits are truncated."
          },
          "currency": {
            "type": "string",
            "description": "Withdraw currency."
          },
          "chain": {
            "type": "string",
            "description": "Chain network."
          },
          "address": {
            "type": "string",
            "description": "Withdraw address."
          },
          "memo": {
            "type": "string",
            "maxLength": 128,
            "description": "Memo for transfer; required for TON; use empty string if not needed; max 128 characters."
          },
          "fee_type": {
            "type": "integer",
            "enum": [
              0,
              1,
              2
            ],
            "description": "Fee mode: 0 - deduct from amount (received = amount - fee); 1 - charge separately - sub-account bears fee (received = amount); 2 - charge separately - main account bears fee (received = amount). Default 0 if omitted."
          }
        }
      },
      "CreatePayoutsResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "SUCCESS"
          },
          "code": {
            "type": "string",
            "example": "000000"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/CreatePayoutsResponse"
          }
        }
      },
      "CreatePayoutsResponse": {
        "type": "object",
        "properties": {
          "batch_id": {
            "type": "string",
            "description": "Unique batch ID returned for the payout."
          }
        }
      },
      "PayoutsDetailRequest": {
        "type": "object",
        "required": [
          "batch_id",
          "detail_status"
        ],
        "properties": {
          "batch_id": {
            "type": "string",
            "description": "Batch ID from create payouts."
          },
          "detail_status": {
            "type": "string",
            "enum": [
              "ALL",
              "INIT",
              "PENDING",
              "PROCESSING",
              "CHECK",
              "FAIL",
              "DONE"
            ],
            "description": "Filter: ALL, INIT, PENDING, PROCESSING, CHECK, FAIL, DONE."
          }
        }
      },
      "PayoutsDetailResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/PayoutsDetailResponse"
          }
        }
      },
      "PayoutsDetailResponse": {
        "type": "object",
        "properties": {
          "batch_id": {
            "type": "string",
            "description": "Batch ID."
          },
          "merchant_id": {
            "type": "integer",
            "format": "int64",
            "description": "Merchant ID."
          },
          "client_id": {
            "type": "string",
            "description": "Client ID that created the order."
          },
          "status": {
            "type": "string",
            "description": "Batch status: INIT, PROCESSING, PARTIAL, FAIL, SUCCESS."
          },
          "create_time": {
            "type": "integer",
            "format": "int64",
            "description": "Creation time (ms)."
          },
          "withdraw_list": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WithdrawDetailItem"
            },
            "description": "Sub-orders."
          },
          "channel_id": {
            "type": "string",
            "description": "Channel name."
          }
        }
      },
      "WithdrawDetailItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Record ID."
          },
          "batch_id": {
            "type": "string",
            "description": "Batch withdraw ID."
          },
          "merchant_id": {
            "type": "integer",
            "format": "int64",
            "description": "Merchant ID."
          },
          "channel_id": {
            "type": "string",
            "description": "Channel name."
          },
          "suborder_id": {
            "type": "string",
            "description": "GatePay sub-order ID."
          },
          "withdraw_id": {
            "type": "string",
            "description": "Withdraw transaction ID."
          },
          "chain": {
            "type": "string",
            "description": "Chain."
          },
          "address": {
            "type": "string",
            "description": "Withdraw address."
          },
          "currency": {
            "type": "string",
            "description": "Currency."
          },
          "amount": {
            "type": "string",
            "description": "Withdraw amount."
          },
          "fee": {
            "type": "string",
            "description": "Fee."
          },
          "tx_id": {
            "type": "string",
            "description": "Transaction hash."
          },
          "timestamp": {
            "type": "integer",
            "format": "int64",
            "description": "Operation timestamp."
          },
          "memo": {
            "type": "string",
            "description": "Memo."
          },
          "status": {
            "type": "string",
            "description": "Sub-order status."
          },
          "merchant_withdraw_id": {
            "type": "string",
            "description": "Merchant withdraw ID."
          },
          "err_msg": {
            "type": "string",
            "description": "Error message if failed."
          },
          "create_time": {
            "type": "integer",
            "format": "int64",
            "description": "Create time."
          },
          "update_time": {
            "type": "integer",
            "format": "int64",
            "description": "Update time."
          },
          "fee_type": {
            "type": "integer",
            "description": "0 - deduct from amount (internal charge), 1 - received amount (external charge - sub-account bears fee), 2 - received amount (external charge - main account bears fee)."
          },
          "desc": {
            "type": "string",
            "description": "Channel note."
          },
          "reconciliation_status": {
            "type": "integer",
            "description": "Reconciliation: 0-3."
          },
          "is_placed": {
            "type": "integer",
            "description": "0 - not placed, 1 - placed."
          },
          "finish_time": {
            "type": "integer",
            "format": "int64",
            "description": "Finish time."
          },
          "sub_amount": {
            "type": "string",
            "description": "Total deduction (fee + received)."
          },
          "done_amount": {
            "type": "string",
            "description": "Received amount."
          }
        }
      },
      "TransferRequest": {
        "type": "object",
        "required": [
          "merchantBatchNo",
          "accountId",
          "currency",
          "amount"
        ],
        "properties": {
          "merchantBatchNo": {
            "type": "string",
            "description": "Unique batch ID from the merchant."
          },
          "accountId": {
            "type": "string",
            "description": "Recipient account ID."
          },
          "currency": {
            "type": "string",
            "description": "Transfer currency."
          },
          "amount": {
            "type": "string",
            "description": "Transfer amount."
          }
        }
      },
      "TransferResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "SUCCESS"
          },
          "code": {
            "type": "string",
            "example": "000000"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/TransferResponse"
          }
        }
      },
      "TransferResponse": {
        "type": "object",
        "description": "Synchronous execution result. Returns the final status and core result fields directly after successful submission.",
        "properties": {
          "merchantBatchNo": {
            "type": "string",
            "description": "Batch ID; same as request merchantBatchNo."
          },
          "status": {
            "type": "string",
            "description": "Status: PENDING (pending payment), PROCESS (processing), ERROR (failed), EXPIRED (expired), PAID (successful), CANCELLED (cancelled)."
          },
          "toAccountId": {
            "type": "string",
            "description": "Recipient account ID."
          },
          "fromAccountId": {
            "type": "string",
            "description": "Payer account ID."
          },
          "createTime": {
            "type": "integer",
            "format": "int64",
            "description": "Order creation time, milliseconds."
          },
          "currency": {
            "type": "string",
            "description": "Currency."
          },
          "amount": {
            "type": "string",
            "description": "Transfer amount."
          }
        }
      },
      "TransferDetailResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/TransferDetailResponse"
          }
        }
      },
      "TransferDetailResponse": {
        "type": "object",
        "properties": {
          "merchantBatchNo": {
            "type": "string",
            "description": "Batch ID; same as request merchantBatchNo."
          },
          "status": {
            "type": "string",
            "description": "Status: PENDING (pending payment), PROCESS (processing), ERROR (failed), EXPIRED (expired), PAID (successful), CANCELLED (cancelled)."
          },
          "toAccountId": {
            "type": "string",
            "description": "Recipient account ID."
          },
          "fromAccountId": {
            "type": "string",
            "description": "Payer account ID."
          },
          "createTime": {
            "type": "integer",
            "format": "int64",
            "description": "Order creation time, milliseconds."
          },
          "currency": {
            "type": "string",
            "description": "Currency."
          },
          "amount": {
            "type": "string",
            "description": "Transfer amount."
          }
        },
        "description": "Historical record query result for result backfill or reconciliation checks."
      },
      "WealthActionRequest": {
        "type": "object",
        "required": [
          "action"
        ],
        "properties": {
          "action": {
            "type": "string",
            "description": "Action type: CANCEL to disable; SIGN to enable",
            "enum": [
              "CANCEL",
              "SIGN"
            ],
            "example": "SIGN"
          }
        }
      },
      "WealthActionResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "SUCCESS"
          },
          "code": {
            "type": "string",
            "example": "000000"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WealthActionResponse"
          }
        }
      },
      "WealthActionResponse": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Sub-account ID"
          },
          "status": {
            "type": "string",
            "description": "Wealth status: CANCEL disabled; SIGN enabled",
            "enum": [
              "CANCEL",
              "SIGN"
            ]
          }
        }
      },
      "WealthQueryResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "SUCCESS"
          },
          "code": {
            "type": "string",
            "example": "000000"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WealthQueryResponse"
          }
        }
      },
      "WealthQueryResponse": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Sub-account ID"
          },
          "status": {
            "type": "string",
            "description": "Wealth status: CANCEL disabled; SIGN enabled",
            "enum": [
              "CANCEL",
              "SIGN"
            ]
          },
          "enabled": {
            "type": "integer",
            "format": "int64",
            "description": "Enable time (milliseconds)"
          },
          "updated": {
            "type": "integer",
            "format": "int64",
            "description": "Last update time (milliseconds)"
          }
        }
      },
      "CreateRefundRequest": {
        "type": "object",
        "required": [
          "refundRequestId",
          "prepayId",
          "refundAmount",
          "refundReason"
        ],
        "properties": {
          "refundRequestId": {
            "type": "string",
            "maxLength": 32,
            "description": "Merchant refund ID; unique, max 32 bytes."
          },
          "prepayId": {
            "type": "string",
            "description": "Order ID; order must be in paid status to refund."
          },
          "refundAmount": {
            "type": "string",
            "description": "Refund amount."
          },
          "refundReason": {
            "type": "string",
            "description": "Refund reason."
          },
          "refundStyle": {
            "type": "integer",
            "format": "int64",
            "description": "Refund style: 1 same channel, 2 specified."
          },
          "refundPayChannel": {
            "type": "integer",
            "format": "int64",
            "description": "Refund pay channel: 1 Gate 2 Web3."
          },
          "refundToGateUid": {
            "type": "integer",
            "format": "int64",
            "description": "Refund to user id; required for Gate."
          },
          "refundChain": {
            "type": "string",
            "description": "Refund chain; required for Web3."
          },
          "refundBearType": {
            "type": "string",
            "description": "Who bears refund: 1 merchant 2 user."
          },
          "memo": {
            "type": "string",
            "description": "Refund memo."
          },
          "refundAmountTypeFull": {
            "type": "string",
            "description": "Refund amount type: 1 full 2 partial."
          },
          "needNotify": {
            "type": "boolean",
            "description": "Whether to notify."
          },
          "refundLimit": {
            "type": "boolean",
            "description": "Whether refund is limited."
          },
          "refundCurrency": {
            "type": "string",
            "description": "Refund currency."
          },
          "refundFundStatementId": {
            "type": "integer",
            "format": "int64",
            "description": "Fund statement ID for refund."
          },
          "refundSource": {
            "type": "integer",
            "format": "int64",
            "description": "Refund source: 0 order 1 flow."
          }
        }
      },
      "CreateRefundResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/CreateRefundResponse"
          }
        }
      },
      "CreateRefundResponse": {
        "type": "object",
        "properties": {
          "refundRequestId": {
            "type": "string",
            "description": "Merchant refund request ID."
          },
          "prepayId": {
            "type": "string",
            "description": "Order ID."
          },
          "refundGateId": {
            "type": "string",
            "description": "GatePay refund ID."
          },
          "orderAmount": {
            "type": "string",
            "description": "Order amount."
          },
          "refundAmount": {
            "type": "string",
            "description": "Refund amount."
          },
          "errMsg": {
            "type": "string",
            "description": "Error message."
          },
          "orderCurrency": {
            "type": "string",
            "description": "Order currency."
          },
          "payCurrency": {
            "type": "string",
            "description": "Refund currency."
          },
          "payAmount": {
            "type": "string",
            "description": "Merchant pay amount."
          }
        }
      },
      "RefundDetailResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RefundDetailResponse"
          }
        }
      },
      "RefundDetailResponse": {
        "type": "object",
        "properties": {
          "refundRequestId": {
            "type": "string",
            "description": "Merchant refund order no."
          },
          "gateRefundId": {
            "type": "string",
            "description": "GatePay refund ID."
          },
          "refundId": {
            "type": "string",
            "description": "Merchant refund order no."
          },
          "orderId": {
            "type": "string",
            "description": "GatePay order ID."
          },
          "merchantTradeNo": {
            "type": "string",
            "description": "Merchant order no."
          },
          "createTime": {
            "type": "integer",
            "format": "int64",
            "description": "Refund create time."
          },
          "transactTime": {
            "type": "integer",
            "format": "int64",
            "description": "Payment time."
          },
          "transactionId": {
            "type": "string",
            "description": "Payment flow order no."
          },
          "txHash": {
            "type": "string",
            "description": "Tx hash; Web3 only."
          },
          "orderAmount": {
            "type": "string",
            "description": "Order amount."
          },
          "orderCurrency": {
            "type": "string",
            "description": "Order currency."
          },
          "requestAmount": {
            "type": "string",
            "description": "Requested refund amount."
          },
          "requestCurrency": {
            "type": "string",
            "description": "Requested refund currency."
          },
          "amount": {
            "type": "string",
            "description": "Refund amount."
          },
          "currency": {
            "type": "string",
            "description": "Refund currency."
          },
          "status": {
            "type": "string",
            "description": "Refund status: PENDING, PROCESSING, SUCCESS, FAIL."
          },
          "remark": {
            "type": "string",
            "description": "Refund remark."
          },
          "refund_style": {
            "type": "string",
            "description": "Refund style 1 same 2 specified."
          },
          "refund_pay_channel": {
            "type": "string",
            "description": "Refund pay channel 1 gate 2 web3."
          },
          "refund_address": {
            "type": "string",
            "description": "Refund address."
          },
          "refund_chain": {
            "type": "string",
            "description": "Refund chain."
          },
          "refund_bear_type": {
            "type": "string",
            "description": "Refund bear type."
          },
          "refund_fail_reason": {
            "type": "string",
            "description": "Refund fail reason."
          },
          "refund_to_gate_uid": {
            "type": "string",
            "description": "Refund to Gate user uid."
          },
          "refundDetails": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RefundDetailItem"
            },
            "description": "Refund detail list."
          }
        }
      },
      "RefundDetailItem": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string",
            "description": "Payment flow order no."
          },
          "transactTime": {
            "type": "integer",
            "format": "int64",
            "description": "Payment time."
          },
          "payChannel": {
            "type": "string",
            "description": "Pay channel."
          },
          "status": {
            "type": "string",
            "description": "Payment status."
          },
          "amount": {
            "type": "string",
            "description": "Refund amount."
          },
          "currency": {
            "type": "string",
            "description": "Refund currency."
          },
          "chain": {
            "type": "string",
            "description": "Chain."
          },
          "address": {
            "type": "string",
            "description": "Merchant receive address."
          }
        }
      },
      "ConvertCurrencyResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "List of available convert currencies"
              }
            }
          }
        }
      },
      "ConvertPairResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConvertPairItem"
            }
          }
        }
      },
      "ConvertPairItem": {
        "type": "object",
        "properties": {
          "pair": {
            "type": "string",
            "description": "Currency pair"
          },
          "sellCurrency": {
            "type": "string",
            "description": "Sell currency"
          },
          "buyCurrency": {
            "type": "string",
            "description": "Buy currency"
          },
          "sellCurrencyMax": {
            "type": "string",
            "description": "Max sell amount"
          },
          "buyCurrencyMax": {
            "type": "string",
            "description": "Max buy amount"
          },
          "buyCurrencyMin": {
            "type": "string",
            "description": "Min buy amount"
          },
          "sellCurrencyMin": {
            "type": "string",
            "description": "Min sell amount"
          }
        }
      },
      "ConvertPreviewRequest": {
        "type": "object",
        "required": [
          "buyCurrency",
          "sellCurrency"
        ],
        "properties": {
          "buyCurrency": {
            "type": "string",
            "description": "Buy currency"
          },
          "buyAmount": {
            "type": "string",
            "description": "Buy amount; use one of buyAmount or sellAmount"
          },
          "sellCurrency": {
            "type": "string",
            "description": "Sell currency"
          },
          "sellAmount": {
            "type": "string",
            "description": "Sell amount; use one of buyAmount or sellAmount"
          }
        }
      },
      "ConvertPreviewResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ConvertPreviewResponse"
          }
        }
      },
      "ConvertPreviewResponse": {
        "type": "object",
        "properties": {
          "sellCurrency": {
            "type": "string",
            "description": "Sell currency"
          },
          "buyCurrency": {
            "type": "string",
            "description": "Buy currency"
          },
          "sellAmount": {
            "type": "string",
            "description": "Sell amount"
          },
          "buyAmount": {
            "type": "string",
            "description": "Buy amount"
          },
          "rate": {
            "type": "string",
            "description": "Rate"
          },
          "quoteId": {
            "type": "string",
            "description": "Quote ID; required when creating convert"
          }
        }
      },
      "ConvertCreateRequest": {
        "type": "object",
        "required": [
          "clientReqId",
          "quoteId",
          "buyAmount",
          "buyCurrency",
          "sellAmount",
          "sellCurrency"
        ],
        "properties": {
          "clientReqId": {
            "type": "string",
            "description": "Client request ID for idempotency"
          },
          "quoteId": {
            "type": "string",
            "description": "Quote ID from preview"
          },
          "buyAmount": {
            "type": "string",
            "description": "Buy amount; must match preview"
          },
          "buyCurrency": {
            "type": "string",
            "description": "Buy currency; must match preview"
          },
          "sellAmount": {
            "type": "string",
            "description": "Sell amount; must match preview"
          },
          "sellCurrency": {
            "type": "string",
            "description": "Sell currency; must match preview"
          }
        }
      },
      "ConvertCreateResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ConvertOrderItem"
          }
        }
      },
      "ConvertOrderResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ConvertOrderItem"
          }
        }
      },
      "ConvertOrderItem": {
        "type": "object",
        "properties": {
          "order_id": {
            "type": "string",
            "description": "Order ID"
          },
          "userId": {
            "type": "string",
            "description": "User ID"
          },
          "sellCurrency": {
            "type": "string",
            "description": "Sell currency"
          },
          "buyCurrency": {
            "type": "string",
            "description": "Buy currency"
          },
          "sellAmount": {
            "type": "string",
            "description": "Sell amount"
          },
          "buyAmount": {
            "type": "string",
            "description": "Buy amount"
          },
          "status": {
            "type": "string",
            "description": "Status: 1 created 3 success 6 fail"
          },
          "rate": {
            "type": "string",
            "description": "Rate"
          },
          "quoteId": {
            "type": "string",
            "description": "Quote ID"
          },
          "createTime": {
            "type": "string",
            "description": "Create time"
          }
        }
      },
      "InstitutionCheckoutOrderRequest": {
        "type": "object",
        "required": [
          "merchantTradeNo",
          "currency",
          "orderAmount",
          "env",
          "goods",
          "merchantUserId",
          "chain",
          "fullCurrType"
        ],
        "properties": {
          "merchantTradeNo": {
            "type": "string",
            "description": "Merchant order number."
          },
          "currency": {
            "type": "string",
            "description": "Order currency, uppercase (e.g. USDT, BTC)."
          },
          "orderAmount": {
            "type": "string",
            "description": "Order amount; min 0.000001, up to 6 decimal places."
          },
          "surchargeAmount": {
            "type": "string",
            "description": "Surcharge borne by the consumer."
          },
          "toleranceAmount": {
            "type": "string",
            "description": "Tolerance: when remaining amount ≤ this value, payment is considered complete."
          },
          "fiatCurrency": {
            "type": "string",
            "description": "Fiat currency, uppercase (e.g. EUR, GBP, USD, CNY, JPY, AUD, CAD, CHF)."
          },
          "fiatAmount": {
            "type": "string",
            "description": "Fiat order amount; min 0.01, up to 2 decimal places."
          },
          "payCurrency": {
            "type": "string",
            "description": "Payment currency for address payment; defaults to currency if omitted."
          },
          "env": {
            "$ref": "#/components/schemas/InstitutionEnvType",
            "description": "Transaction source."
          },
          "goods": {
            "$ref": "#/components/schemas/InstitutionGoodsType",
            "description": "Goods description."
          },
          "orderExpireTime": {
            "type": "integer",
            "format": "int64",
            "description": "Order expiry time, milliseconds. Default 1 hour, max 1 hour."
          },
          "returnUrl": {
            "type": "string",
            "description": "Redirect URL after successful payment, max 256 chars."
          },
          "cancelUrl": {
            "type": "string",
            "description": "Redirect URL after failed/cancelled payment, max 256 chars."
          },
          "merchantUserId": {
            "type": "integer",
            "format": "int64",
            "description": "Payer's unique ID on the merchant platform."
          },
          "chain": {
            "type": "string",
            "description": "Chain name; obtain from /v1/pay/address/chains."
          },
          "fullCurrType": {
            "type": "string",
            "description": "Currency field including chain name, mapping to specific chain/currency."
          },
          "channelId": {
            "type": "string",
            "description": "Client/channel name."
          }
        }
      },
      "InstitutionEnvType": {
        "type": "object",
        "required": [
          "terminalType"
        ],
        "properties": {
          "terminalType": {
            "type": "string",
            "description": "Transaction source: APP, WEB, WAP, MINIAPP, OTHERS."
          }
        }
      },
      "InstitutionEnvRequest": {
        "type": "object",
        "required": [
          "terminalType"
        ],
        "properties": {
          "terminalType": {
            "type": "string",
            "description": "Terminal type for order creation."
          }
        }
      },
      "InstitutionGoodsType": {
        "type": "object",
        "required": [
          "goodsName"
        ],
        "properties": {
          "goodsName": {
            "type": "string",
            "description": "Goods name, max 160 chars."
          },
          "goodsDetail": {
            "type": "string",
            "description": "Goods description, max 256 chars."
          },
          "goodsType": {
            "type": "string",
            "description": "Goods category."
          }
        }
      },
      "InstitutionCheckoutOrderResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "SUCCESS or FAIL."
          },
          "code": {
            "type": "string",
            "description": "Error code."
          },
          "errorMessage": {
            "type": "string",
            "description": "Error message."
          },
          "data": {
            "$ref": "#/components/schemas/InstitutionCheckoutOrderData"
          }
        }
      },
      "InstitutionCheckoutOrderData": {
        "type": "object",
        "properties": {
          "prepayId": {
            "type": "string",
            "description": "Pre-order ID."
          },
          "currency": {
            "type": "string",
            "description": "Order crypto currency."
          },
          "orderAmount": {
            "type": "string",
            "description": "Order amount."
          },
          "surchargeAmount": {
            "type": "string",
            "description": "Surcharge."
          },
          "toleranceAmount": {
            "type": "string",
            "description": "Tolerance amount."
          },
          "fiatCurrency": {
            "type": "string",
            "description": "Order fiat currency."
          },
          "fiatAmount": {
            "type": "string",
            "description": "Fiat order amount."
          },
          "terminalType": {
            "type": "string",
            "description": "Transaction source: APP, WEB, WAP, MINIAPP, OTHERS."
          },
          "expireTime": {
            "type": "integer",
            "format": "int64",
            "description": "Order expiry, UTC milliseconds."
          },
          "qrContent": {
            "type": "string",
            "description": "QR code content URL; generate QR image from this."
          },
          "location": {
            "type": "string",
            "description": "Cashier redirect URL."
          },
          "payCurrency": {
            "type": "string",
            "description": "Address payment currency."
          },
          "payAmount": {
            "type": "string",
            "description": "Address payment amount."
          },
          "chain": {
            "$ref": "#/components/schemas/InstitutionChainStructure",
            "description": "Chain info for address payment."
          },
          "goodsName": {
            "type": "string",
            "description": "Goods name."
          },
          "inUsdt": {
            "type": "string",
            "description": "Equivalent amount in USDT."
          },
          "channelId": {
            "type": "string",
            "description": "Client/channel name."
          }
        }
      },
      "InstitutionChainStructure": {
        "type": "object",
        "properties": {
          "chain_type": {
            "type": "string",
            "description": "Chain name."
          },
          "address": {
            "type": "string",
            "description": "Deposit address for the order."
          },
          "fullCurrType": {
            "type": "string",
            "description": "Currency field including chain name."
          }
        }
      },
      "InstitutionAddressCreateRequest": {
        "type": "object",
        "required": [
          "merchantTradeNo",
          "env",
          "goods",
          "orderExpireTime",
          "merchantUserId",
          "chain",
          "fullCurrType"
        ],
        "properties": {
          "merchantTradeNo": {
            "type": "string",
            "description": "Merchant transaction ID."
          },
          "currency": {
            "type": "string",
            "description": "Order currency."
          },
          "orderAmount": {
            "type": "string",
            "description": "Order amount."
          },
          "surchargeAmount": {
            "type": "string",
            "description": "Surcharge borne by the consumer."
          },
          "toleranceAmount": {
            "type": "string",
            "description": "Tolerance amount for auto-complete."
          },
          "fiatCurrency": {
            "type": "string",
            "description": "Fiat currency."
          },
          "fiatAmount": {
            "type": "string",
            "description": "Fiat order amount."
          },
          "payCurrency": {
            "type": "string",
            "description": "User-selected payment currency; omit for non-convert orders."
          },
          "env": {
            "$ref": "#/components/schemas/InstitutionEnvRequest",
            "description": "Transaction source: APP, WEB, WAP, MINIAPP, OTHERS."
          },
          "goods": {
            "$ref": "#/components/schemas/InstitutionGoodsRequest",
            "description": "Goods."
          },
          "orderExpireTime": {
            "type": "integer",
            "format": "int64",
            "description": "Order expiry timestamp, milliseconds."
          },
          "returnUrl": {
            "type": "string",
            "description": "Callback URL after payment."
          },
          "cancelUrl": {
            "type": "string",
            "description": "Callback URL after cancel."
          },
          "merchantUserId": {
            "type": "integer",
            "format": "int64",
            "description": "Payer's unique ID on the merchant platform."
          },
          "chain": {
            "type": "string",
            "description": "Chain name."
          },
          "fullCurrType": {
            "type": "string",
            "description": "Currency field including chain name."
          },
          "channelId": {
            "type": "string",
            "description": "Client/channel name."
          }
        }
      },
      "InstitutionGoodsRequest": {
        "type": "object",
        "properties": {
          "goodsName": {
            "type": "string",
            "description": "Goods name."
          },
          "goodsDetail": {
            "type": "string",
            "description": "Goods detail."
          }
        }
      },
      "InstitutionAddressCreateResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/InstitutionAddressCreateData"
          }
        }
      },
      "InstitutionAddressCreateData": {
        "type": "object",
        "properties": {
          "prepayId": {
            "type": "string",
            "description": "Payment order ID."
          },
          "terminalType": {
            "type": "string",
            "description": "Terminal type."
          },
          "expireTime": {
            "type": "string",
            "description": "Expiry timestamp, milliseconds."
          },
          "chain": {
            "$ref": "#/components/schemas/InstitutionChainAddress",
            "description": "Chain and deposit address for the order."
          }
        }
      },
      "InstitutionChainAddress": {
        "type": "object",
        "properties": {
          "chain_type": {
            "type": "string",
            "description": "Chain name."
          },
          "address": {
            "type": "string",
            "description": "Deposit address for the order."
          },
          "fullCurrType": {
            "type": "string",
            "description": "Currency field including chain name."
          }
        }
      },
      "InstitutionNativeOrderRequest": {
        "type": "object",
        "required": [
          "merchantTradeNo",
          "env",
          "goods"
        ],
        "properties": {
          "merchantTradeNo": {
            "type": "string",
            "description": "Merchant order number, max 32 bytes."
          },
          "currency": {
            "type": "string",
            "description": "Crypto currency, uppercase (e.g. USDT, BTC)."
          },
          "orderAmount": {
            "type": "string",
            "description": "Crypto order amount; min 0.000001, 6 decimals; range [0.0001, 500000]."
          },
          "fiatCurrency": {
            "type": "string",
            "description": "Fiat currency."
          },
          "fiatAmount": {
            "type": "string",
            "description": "Fiat order amount."
          },
          "actualCurrency": {
            "type": "string",
            "description": "Settlement currency if different from order currency."
          },
          "env": {
            "$ref": "#/components/schemas/InstitutionEnvType",
            "description": "Transaction source: APP, WEB, WAP, MINIAPP, OTHERS."
          },
          "goods": {
            "$ref": "#/components/schemas/InstitutionGoodsType",
            "description": "Goods description."
          },
          "orderExpireTime": {
            "type": "integer",
            "format": "int64",
            "description": "Order expiry, UTC milliseconds; default 1 hour, max 1 hour."
          },
          "returnUrl": {
            "type": "string",
            "description": "Redirect URL after success, max 256 chars."
          },
          "cancelUrl": {
            "type": "string",
            "description": "Redirect URL after cancel, max 256 chars."
          },
          "channelId": {
            "type": "string",
            "description": "Client/channel name."
          }
        }
      },
      "InstitutionNativeOrderResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "SUCCESS or FAIL."
          },
          "code": {
            "type": "string",
            "description": "Error code."
          },
          "errorMessage": {
            "type": "string",
            "description": "Error message."
          },
          "data": {
            "$ref": "#/components/schemas/InstitutionNativeOrderData"
          }
        }
      },
      "InstitutionNativeOrderData": {
        "type": "object",
        "properties": {
          "prepayId": {
            "type": "string",
            "description": "Pre-order ID."
          },
          "terminalType": {
            "type": "string",
            "description": "Transaction source: APP, WEB, WAP, MINIAPP, OTHERS."
          },
          "expireTime": {
            "type": "integer",
            "format": "int64",
            "description": "Order expiry, milliseconds."
          },
          "qrContent": {
            "type": "string",
            "description": "QR code content URL."
          },
          "location": {
            "type": "string",
            "description": "Web payment redirect URL."
          }
        }
      },
      "InstitutionOrderQueryRequest": {
        "type": "object",
        "properties": {
          "prepayId": {
            "type": "string",
            "description": "Prepay ID."
          },
          "merchantTradeNo": {
            "type": "string",
            "description": "Merchant order number. Provide either this or prepayId."
          }
        }
      },
      "InstitutionOrderQueryResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "SUCCESS or FAIL."
          },
          "code": {
            "type": "string",
            "description": "Error code."
          },
          "errorMessage": {
            "type": "string",
            "description": "Error message."
          },
          "data": {
            "$ref": "#/components/schemas/InstitutionOrderQueryData"
          }
        }
      },
      "InstitutionOrderQueryData": {
        "type": "object",
        "properties": {
          "prepayId": {
            "type": "string",
            "description": "Prepay ID."
          },
          "merchantId": {
            "type": "integer",
            "format": "int64",
            "description": "Gate UID used for merchant account."
          },
          "merchantTradeNo": {
            "type": "string",
            "description": "Merchant order number."
          },
          "transactionId": {
            "type": "string",
            "description": "Transaction ID."
          },
          "goodsName": {
            "type": "string",
            "description": "Goods name."
          },
          "currency": {
            "type": "string",
            "description": "Order currency."
          },
          "orderAmount": {
            "type": "string",
            "description": "Order amount."
          },
          "surchargeAmount": {
            "type": "string",
            "description": "Surcharge."
          },
          "toleranceAmount": {
            "type": "string",
            "description": "Tolerance amount."
          },
          "underpaidAmount": {
            "type": "string",
            "description": "Unpaid amount after payment."
          },
          "fiatCurrency": {
            "type": "string",
            "description": "Fiat currency."
          },
          "fiatAmount": {
            "type": "string",
            "description": "Fiat amount."
          },
          "fiatRate": {
            "type": "string",
            "description": "Fiat–crypto rate."
          },
          "status": {
            "type": "string",
            "description": "Order status."
          },
          "createTime": {
            "type": "integer",
            "format": "int64",
            "description": "Create time, ms."
          },
          "expireTime": {
            "type": "integer",
            "format": "int64",
            "description": "Expire time, ms."
          },
          "transactTime": {
            "type": "integer",
            "format": "int64",
            "description": "Payment completion time, ms."
          },
          "order_name": {
            "type": "string",
            "description": "Order name."
          },
          "pay_currency": {
            "type": "string",
            "description": "Actual pay currency."
          },
          "pay_amount": {
            "type": "string",
            "description": "Actual pay amount."
          },
          "expectCurrency": {
            "type": "string",
            "description": "Expected settlement currency."
          },
          "actualCurrency": {
            "type": "string",
            "description": "Actual settlement currency."
          },
          "actualAmount": {
            "type": "string",
            "description": "Actual settlement amount."
          },
          "rate": {
            "type": "string",
            "description": "Rate for convert payment."
          },
          "channelId": {
            "type": "string",
            "description": "Channel ID."
          },
          "appName": {
            "type": "string",
            "description": "App name."
          },
          "appLogo": {
            "type": "string",
            "description": "App logo."
          },
          "inUsdt": {
            "type": "string",
            "description": "Amount in USDT."
          },
          "channel_type": {
            "type": "string",
            "description": "Channel type."
          },
          "totalFeeAmount": {
            "type": "string",
            "description": "Cumulative fees charged. May be empty or `0` when payment flows are not settled, unpaid, or in centralized-payment-only scenarios, etc."
          },
          "totalSettleAmount": {
            "type": "string",
            "description": "Cumulative settled amount. May be empty when payment flows are not settled, etc."
          },
          "payDetails": {
            "type": "array",
            "description": "Payment information",
            "items": {
              "$ref": "#/components/schemas/OrderQueryPayDetail"
            }
          }
        }
      },
      "OrderQueryPayDetail": {
        "type": "object",
        "description": "Fee and settlement information for a single payment in the flow (payDetail).",
        "properties": {
          "transactionId": {
            "type": "string",
            "description": "Payment flow / transaction ID."
          },
          "payType": {
            "type": "string",
            "description": "Payment type: `GatePay` for Gate Pay, `Web3Pay` for Web3 payment."
          },
          "payTime": {
            "type": "string",
            "description": "Payment time."
          },
          "payAmount": {
            "type": "string",
            "description": "Payment amount."
          },
          "payCurrency": {
            "type": "string",
            "description": "Payment currency"
          },
          "feeAmount": {
            "type": "string",
            "description": "Fee amount."
          },
          "settleAmount": {
            "type": "string",
            "description": "Settled amount."
          },
          "settlementStatus": {
            "type": "string",
            "description": "Settlement status: `pending` not settled, `done` settled."
          }
        }
      },
      "InstitutionOrderCloseRequest": {
        "type": "object",
        "properties": {
          "merchantTradeNo": {
            "type": "string",
            "description": "Merchant order number, max 32 bytes."
          },
          "prepayId": {
            "type": "string",
            "description": "Prepay ID. Provide either this or merchantTradeNo."
          }
        }
      },
      "InstitutionOrderCloseResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "SUCCESS or FAIL."
          },
          "code": {
            "type": "string",
            "description": "Error code."
          },
          "errorMessage": {
            "type": "string",
            "description": "Error message."
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "string",
                "description": "SUCCESS or FAIL."
              }
            }
          }
        }
      },
      "InstitutionFixedAddressChainsResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "SUCCESS or FAIL."
          },
          "code": {
            "type": "string",
            "description": "Error code."
          },
          "errorMessage": {
            "type": "string",
            "description": "Error message."
          },
          "data": {
            "type": "object",
            "properties": {
              "Chains": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FixedChainItem"
                },
                "description": "List of supported networks and currencies."
              }
            }
          }
        }
      },
      "FixedChainItem": {
        "type": "object",
        "properties": {
          "chain": {
            "type": "string",
            "description": "Network."
          },
          "showChainNameEn": {
            "type": "string",
            "description": "Network name (English)."
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Supported currencies on this network."
          }
        }
      },
      "InstitutionFixedAddressSaveRequest": {
        "type": "object",
        "required": [
          "channelId",
          "chain",
          "currencies",
          "callbackUrl"
        ],
        "properties": {
          "channelId": {
            "type": "string",
            "description": "Channel/client name; letters, digits, underscore and hyphen only; max 50 bytes."
          },
          "chain": {
            "type": "string",
            "description": "Network name."
          },
          "currencies": {
            "type": "string",
            "description": "Currencies to receive on this address, comma-separated (e.g. USDT,BTC)."
          },
          "callbackUrl": {
            "type": "string",
            "description": "Callback URL for incoming payments; max 128 bytes."
          }
        }
      },
      "InstitutionFixedAddressSaveResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "SUCCESS or FAIL."
          },
          "code": {
            "type": "string",
            "description": "Error code."
          },
          "errorMessage": {
            "type": "string",
            "description": "Error message."
          },
          "data": {
            "type": "object",
            "properties": {
              "channelId": {
                "type": "string",
                "description": "Channel name."
              },
              "chain": {
                "type": "string",
                "description": "Network."
              },
              "address": {
                "type": "string",
                "description": "Collection address."
              },
              "currencies": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Currencies on this address."
              },
              "callbackUrl": {
                "type": "string",
                "description": "Callback URL."
              },
              "desc": {
                "type": "string",
                "description": "Description."
              },
              "ChainShowEn": {
                "type": "string",
                "description": "Chain name (English)."
              }
            }
          }
        }
      },
      "FixedAddressItem": {
        "type": "object",
        "properties": {
          "channelId": {
            "type": "string",
            "description": "Channel name."
          },
          "chain": {
            "type": "string",
            "description": "Network."
          },
          "address": {
            "type": "string",
            "description": "Collection address."
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Currencies on this address."
          },
          "callbackUrl": {
            "type": "string",
            "description": "Callback URL."
          },
          "createTime": {
            "type": "integer",
            "description": "Create time."
          },
          "updateTime": {
            "type": "integer",
            "description": "Last update time."
          },
          "desc": {
            "type": "string",
            "description": "Description."
          },
          "ChainShowEn": {
            "type": "string",
            "description": "Chain name (English)."
          },
          "is_risk": {
            "type": "integer",
            "description": "Risk flag: 0-normal, 1-risk."
          }
        }
      },
      "FixedAddressDetailItem": {
        "type": "object",
        "properties": {
          "channelId": {
            "type": "string",
            "description": "Channel name specified when the merchant bound the static address for collection."
          },
          "chain": {
            "type": "string",
            "description": "Network."
          },
          "address": {
            "type": "string",
            "description": "Collection address."
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Currencies on this address."
          },
          "callbackUrl": {
            "type": "string",
            "description": "Callback URL."
          },
          "createTime": {
            "type": "integer",
            "description": "Create time."
          },
          "updateTime": {
            "type": "integer",
            "description": "Last update time."
          },
          "desc": {
            "type": "string",
            "description": "Description."
          },
          "ChainShowEn": {
            "type": "string",
            "description": "Chain name (English)."
          },
          "is_risk": {
            "type": "integer",
            "description": "Risk flag: 0-normal, 1-risk."
          }
        }
      },
      "InstitutionFixedAddressListResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "SUCCESS or FAIL."
          },
          "code": {
            "type": "string",
            "description": "Error code."
          },
          "errorMessage": {
            "type": "string",
            "description": "Error message."
          },
          "data": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "description": "Total count."
              },
              "list": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FixedAddressItem"
                },
                "description": "List of static addresses."
              }
            }
          }
        }
      },
      "InstitutionFixedAddressDetailResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "SUCCESS or FAIL."
          },
          "code": {
            "type": "string",
            "description": "Error code."
          },
          "errorMessage": {
            "type": "string",
            "description": "Error message."
          },
          "data": {
            "$ref": "#/components/schemas/FixedAddressDetailItem",
            "description": "Static address detail."
          }
        }
      },
      "FixedAddressDeleteResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "string",
                "description": "ok for success, otherwise failure"
              }
            }
          }
        }
      },
      "FixedAddressOrderQueryResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "description": "Total count"
              },
              "details": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FixedAddressPaymentDetailItem"
                },
                "description": "Static collection bill list"
              }
            }
          }
        }
      },
      "FixedAddressPaymentDetailItem": {
        "type": "object",
        "properties": {
          "chain": {
            "type": "string",
            "description": "Network"
          },
          "channelId": {
            "type": "string",
            "description": "Channel name"
          },
          "currency": {
            "type": "string",
            "description": "Currency"
          },
          "address": {
            "type": "string",
            "description": "Recipient Web3 address"
          },
          "amount": {
            "type": "string",
            "description": "Received amount"
          },
          "status": {
            "type": "string",
            "description": "Order status"
          },
          "txTime": {
            "type": "integer",
            "format": "int64",
            "description": "Order create time (ms)"
          },
          "fromAddress": {
            "type": "string",
            "description": "Payer Web3 address"
          },
          "txHash": {
            "type": "string",
            "description": "Transaction hash"
          },
          "transactionId": {
            "type": "string",
            "description": "Transaction flow ID"
          }
        }
      },
      "FixedAddressEvmSaveRequest": {
        "type": "object",
        "required": [
          "channelId",
          "callbackUrl",
          "chianCurrencyInfos"
        ],
        "properties": {
          "channelId": {
            "type": "string",
            "maxLength": 50,
            "description": "Channel name; letters, digits, underscore, hyphen only; max 50 bytes"
          },
          "callbackUrl": {
            "type": "string",
            "maxLength": 128,
            "description": "Callback URL for this channel; max 128 bytes"
          },
          "chianCurrencyInfos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChainCurrencyInfo"
            },
            "description": "Network and currency info"
          }
        }
      },
      "ChainCurrencyInfo": {
        "type": "object",
        "required": [
          "chain"
        ],
        "properties": {
          "chain": {
            "type": "string",
            "description": "Network; EVM only: ETH, MATIC, ARBEVM, BSC"
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Currencies on this network; omit for all"
          }
        }
      },
      "FixedAddressEvmSaveResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/FixedAddressEvmSaveResponse"
          }
        }
      },
      "FixedAddressEvmSaveResponse": {
        "type": "object",
        "properties": {
          "channelId": {
            "type": "string",
            "description": "Channel name"
          },
          "address": {
            "type": "string",
            "description": "Collection address"
          },
          "callbackUrl": {
            "type": "string",
            "description": "Callback URL"
          },
          "chainInfos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FixedAddressChainInfo"
            },
            "description": "Networks and supported currencies"
          }
        }
      },
      "FixedAddressChainInfo": {
        "type": "object",
        "properties": {
          "chainShowEn": {
            "type": "string",
            "description": "Network name (English)"
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Currencies on this network"
          }
        }
      },
      "ChargeRequest": {
        "type": "object",
        "required": [
          "merchantBatchNo",
          "accountId",
          "currency",
          "amount"
        ],
        "properties": {
          "merchantBatchNo": {
            "type": "string",
            "description": "Unique batch ID from the merchant."
          },
          "accountId": {
            "type": "string",
            "description": "Payer account ID."
          },
          "currency": {
            "type": "string",
            "description": "Transfer currency."
          },
          "amount": {
            "type": "string",
            "description": "Transfer amount."
          }
        }
      },
      "Ubo": {
        "type": "object",
        "required": [
          "country",
          "full_name",
          "dob",
          "id_type",
          "id_number",
          "id_expiry",
          "relationship"
        ],
        "properties": {
          "country": {
            "type": "string",
            "description": "Country ISO code."
          },
          "full_name": {
            "type": "string",
            "description": "Full name of the individual."
          },
          "dob": {
            "$ref": "#/components/schemas/Dob",
            "description": "Date of birth."
          },
          "id_type": {
            "type": "string",
            "enum": [
              "PASSPORT",
              "NATIONAL_ID",
              "DRIVING_LICENSE"
            ],
            "description": "Type of identification document for the individual."
          },
          "id_number": {
            "type": "string",
            "description": "Identification document number."
          },
          "id_expiry": {
            "$ref": "#/components/schemas/EntityIdExpiry",
            "description": "Identification document expiry details."
          },
          "relationship": {
            "$ref": "#/components/schemas/Relationship",
            "description": "Relationship attributes between the individual and the sub-merchant."
          }
        }
      },
      "Relationship": {
        "type": "object",
        "properties": {
          "is_representative": {
            "type": "boolean",
            "description": "Whether the individual is a legal representative."
          },
          "is_owner": {
            "type": "boolean",
            "description": "Whether the individual is a beneficial owner."
          },
          "percent_ownership": {
            "type": "string",
            "description": "Required when is_owner is true; represents the ownership percentage, for example 30.01."
          }
        }
      },
      "ChargeResponse": {
        "type": "object",
        "description": "Charge execution result.",
        "properties": {
          "merchantBatchNo": {
            "type": "string",
            "description": "Batch ID; same as request merchantBatchNo."
          },
          "status": {
            "type": "string",
            "description": "Status: PENDING (pending payment), PROCESS (processing), ERROR (failed), EXPIRED (expired), PAID (successful), CANCELLED (cancelled)."
          },
          "toAccountId": {
            "type": "string",
            "description": "Recipient account ID."
          },
          "fromAccountId": {
            "type": "string",
            "description": "Payer account ID."
          },
          "createTime": {
            "type": "integer",
            "format": "int64",
            "description": "Order creation time, milliseconds."
          },
          "currency": {
            "type": "string",
            "description": "Currency."
          },
          "amount": {
            "type": "string",
            "description": "Transfer amount."
          }
        }
      },
      "ChargeResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "SUCCESS"
          },
          "code": {
            "type": "string",
            "example": "000000"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ChargeResponse"
          }
        }
      },
      "ChargeDetailResponse": {
        "type": "object",
        "properties": {
          "merchantBatchNo": {
            "type": "string",
            "description": "Batch ID; same as request merchantBatchNo."
          },
          "status": {
            "type": "string",
            "description": "Status: PENDING (pending payment), PROCESS (processing), ERROR (failed), EXPIRED (expired), PAID (successful), CANCELLED (cancelled)."
          },
          "toAccountId": {
            "type": "string",
            "description": "Recipient account ID."
          },
          "fromAccountId": {
            "type": "string",
            "description": "Payer account ID."
          },
          "createTime": {
            "type": "integer",
            "format": "int64",
            "description": "Order creation time, milliseconds."
          },
          "currency": {
            "type": "string",
            "description": "Currency."
          },
          "amount": {
            "type": "string",
            "description": "Transfer amount."
          }
        },
        "description": "Historical charge record query result for result backfill or reconciliation checks."
      },
      "ChargeDetailResponseWrapper": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/ChargeDetailResponse"
          }
        }
      }
    }
  }
}
