openapi: 3.2.0 info: title: Exchange API version: 1.0.0 servers: - url: https://{region}-api.upbit.com tags: - name: Exchange paths: /v1/accounts: get: operationId: get-balance summary: Get Account Balances description: Retrieves the list of assets and balances owned by the account. tags: - Exchange x-readme: code-samples: - language: curl code: 'curl --request GET \ --url ''https://sg-api.upbit.com/v1/accounts'' \ --header ''Authorization: Bearer {JWT_TOKEN}'' \ --header ''accept: application/json'' ' - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport jwt\nimport requests\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/accounts\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers)\nprint(res.json())\n" - language: node name: Axios install: 'npm install axios jsonwebtoken uuid ' code: "const axios = require(\"axios\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/accounts\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.Objects;\nimport java.util.UUID;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class GetBalance {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/accounts\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" responses: '200': description: List of account balances content: application/json: schema: type: array items: $ref: '#/components/schemas/Account' examples: Successful Example: value: - currency: SGD balance: '1000000.0' locked: '0.0' avg_buy_price: '0' avg_buy_price_modified: false unit_currency: SGD - currency: BTC balance: '2.0' locked: '0.0' avg_buy_price: '101000' avg_buy_price_modified: false unit_currency: SGD '401': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: no authorization ip error: value: error: name: no_authorization_ip message: This is not a verified IP. /v1/deposit: get: operationId: get-deposit summary: Get Deposit description: Retrieves the latest deposit history. To query specific deposit information, you can specify the deposit’s UUID, transaction ID (TXID), or currency code. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/deposit?uuid=94332e99-3a87-4a35-ad98-28b0c969f830' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/deposit\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"uuid\": \"94332e99-3a87-4a35-ad98-28b0c969f830\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/deposit\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n uuid: \"94332e99-3a87-4a35-ad98-28b0c969f830\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}?${queryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class GetDeposit {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/deposit\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"uuid\", \"94332e99-3a87-4a35-ad98-28b0c969f830\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: currency in: query required: false schema: type: string description: Currency code filter. example: BTC allowReserved: true - name: uuid in: query required: false schema: type: string description: 'UUID of the deposit to query. If neither uuid nor txid is provided, the latest deposit is returned. ' example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae allowReserved: true examples: default: value: 94332e99-3a87-4a35-ad98-28b0c969f830 - name: txid in: query required: false schema: type: string description: 'Transaction ID of the deposit to query. If neither uuid nor txid is provided, the latest deposit is returned. ' example: 98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc allowReserved: true responses: '200': description: Object of deposit content: application/json: schema: $ref: '#/components/schemas/Deposit' examples: Successful Example: value: type: deposit uuid: 94332e99-3a87-4a35-ad98-28b0c969f830 currency: SGD txid: BKD-2000-12-29-aeked29c05eadac293b4214994 state: ACCEPTED created_at: '2025-07-04T15:00:00' done_at: '2025-07-04T15:00:10' amount: '100000.0' fee: '0.0' transaction_type: default '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid enum error: value: error: name: validation_error message: '"field name" does not have a valid value' '401': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid query payload error: value: error: name: invalid_query_payload message: Failed to validate query in JWT. '404': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: not found deposit error: value: error: name: deposit_not_found message: Deposit information not found. /v1/deposits: get: operationId: list-deposits summary: List Deposits description: Retrieves the latest deposit list. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/deposits?currency=SGD' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/deposits\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"currency\": \"SGD\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/deposits\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n currency: \"SGD\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}?${queryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class ListDeposits {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/deposits\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"currency\", \"SGD\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: currency in: query required: false schema: type: string description: 'Currency code filter. If not specified, the latest deposits are returned. ' example: SGD allowReserved: true examples: default: value: SGD - name: state in: query required: false schema: type: string enum: - PROCESSING - ACCEPTED - CANCELLED - REJECTED - TRAVEL_RULE_SUSPECTED - REFUNDING - REFUNDED description: 'Deposit state filter. * `PROCESSING`: Processing * `ACCEPTED`: Completed * `CANCELLED`: Cancelled * `REJECTED`: Rejected * `TRAVEL_RULE_SUSPECTED`: Pending Travel Rule verification * `REFUNDING`: Refund in progress * `REFUNDED`: Refunded ' allowReserved: true - name: uuids[] in: query required: false schema: type: array description: 'List of UUIDs to query. [Example] uuids[]=uuid1&uuids[]=uuid2 ' items: type: string example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae allowReserved: true - name: txids[] in: query required: false schema: type: array description: 'List of transaction IDs to query. [Example] txids[]=txid1&txids[]=txid2 ' items: type: string example: 98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc allowReserved: true - name: limit in: query required: false schema: type: integer description: 'Number of results per request (default: 100, max: 100).' example: 100 default: 100 allowReserved: true - name: page in: query required: false schema: type: integer description: Page number for pagination. Default is 1. example: 1 default: 1 allowReserved: true - name: order_by in: query required: false schema: type: string enum: - asc - desc description: Sort order. "desc" (newest first) or "asc" (oldest first). Default is "desc". example: desc default: desc allowReserved: true - name: from in: query required: false schema: type: string description: 'Cursor for pagination. Enter a "uuid" from the response to retrieve "limit" deposits after that timestamp. ' - name: to in: query required: false schema: type: string description: 'Cursor for pagination. Enter a "uuid" from the response to retrieve "limit" deposits before that timestamp. ' responses: '200': description: List of deposits content: application/json: schema: type: array items: $ref: '#/components/schemas/Deposit' examples: Successful Example: value: - type: deposit uuid: 94332e99-3a87-4a35-ad98-28b0c969f830 currency: SGD txid: BKD-2000-12-29-aeked29c05eadac293b4214994 state: ACCEPTED created_at: '2025-07-04T15:00:00' done_at: '2025-07-04T15:00:10' amount: '100000.0' fee: '0.0' transaction_type: default '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid enum error: value: error: name: validation_error message: '"field name" does not have a valid value' '401': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid query payload error: value: error: name: invalid_query_payload message: Failed to validate query in JWT. /v1/deposits/chance/coin: get: operationId: available-deposit-information summary: Get Available Deposit Information description: Deposits availability information for the specified currency is retrieved. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/deposits/chance/coin?currency=BTC&net_type=BTC' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/deposits/chance/coin\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"currency\": \"BTC\",\n \"net_type\": \"BTC\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/deposits/chance/coin\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n currency: \"BTC\",\n net_type: \"BTC\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}?${queryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class AvailableDeposit {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/deposits/chance/coin\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"currency\", \"BTC\");\n params.put(\"net_type\", \"BTC\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: currency in: query required: true schema: type: string description: Currency code to query deposit availability for. example: BTC allowReserved: true examples: default: value: BTC - name: net_type in: query required: true schema: type: string description: 'Blockchain network identifier for digital asset deposit. Used to filter by network. ' example: BTC examples: default: value: BTC responses: '200': description: Object of deposit availability content: application/json: schema: $ref: '#/components/schemas/DepositChance' examples: Successful Example: value: currency: BTC net_type: BTC is_deposit_possible: false deposit_impossible_reason: Deposits and withdrawals are temporarily suspended due to a network upgrade minimum_deposit_amount: '0' minimum_deposit_confirmations: 1 decimal_precision: 8 '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid enum error: value: error: name: validation_error message: '"field name" does not have a valid value' missing field error: value: error: name: validation_error message: net_type is missing, net_type does not have a valid value, net_type is empty /v1/deposits/coin_address: get: operationId: get-deposit-address summary: Get Deposit Address description: Retrieves deposit address information for the specified currency. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/deposits/coin_address?currency=BTC&net_type=BTC' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/deposits/coin_address\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"currency\": \"BTC\",\n \"net_type\": \"BTC\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/deposits/coin_address\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n currency: \"BTC\",\n net_type: \"BTC\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}?${queryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class GetDepositAddress {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/deposits/coin_address\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"currency\", \"BTC\");\n params.put(\"net_type\", \"BTC\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: currency in: query required: true schema: type: string description: Currency code to query. example: BTC allowReserved: true examples: default: value: BTC - name: net_type in: query required: true schema: type: string description: 'Blockchain network identifier. Used to filter by network. ' example: BTC examples: default: value: BTC responses: '200': description: Object of deposit address content: application/json: schema: $ref: '#/components/schemas/DepositAddress' examples: Successful Example: value: currency: BTC net_type: BTC deposit_address: 3EusRwybuZUhVDeHL7gh3HSLmbhLcy7NqD '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid enum error: value: error: name: validation_error message: '"field name" does not have a valid value' missing parameter error: value: error: name: validation_error message: '"field name" is missing' '401': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid query payload error: value: error: name: invalid_query_payload message: Failed to validate query in JWT. /v1/deposits/coin_addresses: get: operationId: list-deposit-addresses summary: List Deposit Addresses description: Retrieves deposit address information for the specified currency. Return all successfully generated deposit addresses. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/deposits/coin_addresses' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport jwt\nimport requests\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/deposits/coin_addresses\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/deposits/coin_addresses\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.Objects;\nimport java.util.UUID;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class ListDepositAddresses {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/deposits/coin_addresses\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" responses: '200': description: List of deposit addresses content: application/json: schema: type: array items: $ref: '#/components/schemas/DepositAddress' examples: Successful Example: value: - currency: BTC net_type: BTC deposit_address: 3EusRwybuZUhVDeHL7gh3HSLmbhLcy7NqD - currency: ETH net_type: ETH deposit_address: '0x0d73e0a482b8cf568976d2e8688f4a899d29301c' - currency: XRP net_type: XRP deposit_address: rN9qNpgnBaZwqCg8CvUZRPqCcPPY7wfWep secondary_address: '3057887915' /v1/deposits/generate_coin_address: post: operationId: create-deposit-address summary: Create Deposit Address description: Requests the creation of a deposit address for depositing assets from a personal wallet or another exchange into Upbit. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request POST \\\n --url 'https://sg-api.upbit.com/v1/deposits/generate_coin_address' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Content-Type: application/json' \\\n --data '\n{\n\"currency\": \"BTC\",\n\"net_type\": \"BTC\"\n}\n'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/deposits/generate_coin_address\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"currency\": \"BTC\",\n \"net_type\": \"BTC\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.post(f\"{BASE_URL}{PATH}\", headers=headers, json=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/deposits/generate_coin_address\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n currency: \"BTC\",\n net_type: \"BTC\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"POST\",\n url: `${baseURL}${path}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n data: params,\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\nimport com.google.gson.Gson;\n\npublic class CreateDepositAddress {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/deposits/generate_coin_address\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"currency\", \"BTC\");\n params.put(\"net_type\", \"BTC\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n String jsonBody = new Gson().toJson(params);\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH)\n .post(RequestBody.create(jsonBody, okhttp3.MediaType.parse(\"application/json; charset=utf-8\")))\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" requestBody: description: Deposit address creation request. content: application/json: examples: default: value: currency: BTC net_type: BTC schema: type: object required: - currency - net_type properties: currency: type: string description: Currency code for which to create a deposit address. example: BTC net_type: type: string description: Network type. example: BTC responses: '201': description: Deposit address (existing or creation in progress) content: application/json: schema: $ref: '#/components/schemas/CreateDepositAddressResponse' examples: Address ready: value: currency: BTC net_type: BTC deposit_address: 3EusRwybuZUhVDeHL7gh3HSLmbhLcy7NqD Address generating: value: success: true message: Generating a BTC deposit address. '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid enum error: value: error: name: validation_error message: '"field name" does not have a valid value' invalid parameter error: value: error: name: invalid_parameter message: Invalid parameter missing parameter error: value: error: name: validation_error message: '"field name" is missing' /v1/order: get: operationId: get-order summary: Get Order description: Retrieves an order information by order UUID or Identifier. tags: - Exchange x-readme: code-samples: - language: curl code: 'curl --request GET \ --url ''https://sg-api.upbit.com/v1/order?uuid=3b67e543-8ad3-48d0-8451-0dad315cae73'' \ --header ''Authorization: Bearer {JWT_TOKEN}'' \ --header ''accept: application/json'' ' - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/order\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"uuid\": \"3b67e543-8ad3-48d0-8451-0dad315cae73\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/order\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n uuid: \"3b67e543-8ad3-48d0-8451-0dad315cae73\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}?${queryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class GetOrder {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/order\";\n\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"uuid\", \"3b67e543-8ad3-48d0-8451-0dad315cae73\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: uuid in: query required: false schema: type: string description: UUID of the order to query. example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae allowReserved: true examples: default: value: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae - name: identifier in: query required: false schema: type: string description: 'Client-assigned identifier of the order to query. Used when querying by the identifier assigned at order creation. ' example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae allowReserved: true examples: by_identifier: value: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae responses: '200': description: Object of order content: application/json: schema: $ref: '#/components/schemas/Order' examples: Successful Example: value: market: SGD-BTC uuid: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae side: ask ord_type: limit price: '153559.00' state: done created_at: '2025-07-04T15:00:00' volume: '1.0' remaining_volume: '0' executed_volume: '1.0' reserved_fee: '0' remaining_fee: '0' paid_fee: '383.8975' locked: '0' prevented_volume: '0' prevented_locked: '0' trades_count: 1 trades: - market: SGD-BTC uuid: 9e8f8eba-7050-4837-8969-cfc272cbe083 price: '153559.00' volume: '1.0' funds: '153559.00' trend: down created_at: '2025-07-04T15:00:00' side: ask '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid parameter error: value: error: name: invalid_parameter message: Invalid parameter '404': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: not found error: value: error: name: 404 message: Code not found delete: operationId: cancel-order summary: Cancel Order description: Cancel an order by UUID or Identifier. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request DELETE \\\n --url 'https://sg-api.upbit.com/v1/order?uuid=cdd92199-2897-4e14-9448-f923320408ad' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/order\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"uuid\": \"cdd92199-2897-4e14-9448-f923320408ad\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\nprint(jwt_token)\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.delete(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/order\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n uuid: \"cdd92199-2897-4e14-9448-f923320408ad\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"DELETE\",\n url: `${baseURL}${path}?${queryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class DeleteOrder {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/order\";\n\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"uuid\", \"cdd92199-2897-4e14-9448-f923320408ad\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .delete()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: uuid in: query required: false schema: type: string description: UUID of the order to cancel. example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae allowReserved: true examples: default: value: cdd92199-2897-4e14-9448-f923320408ad - name: identifier in: query required: false schema: type: string description: 'Client-assigned identifier of the order to cancel. Used when cancelling by the identifier assigned at order creation. ' example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae allowReserved: true responses: '200': description: Object of canceled order content: application/json: schema: $ref: '#/components/schemas/Order' examples: Successful Example: value: - uuid: cdd92199-2897-4e14-9448-f923320408ad side: bid ord_type: limit price: '153559.00' state: wait market: SGD-BTC created_at: '2025-07-04T15:00:00' volume: '1.0' remaining_volume: '1.0' executed_volume: '0' reserved_fee: '383.8975' remaining_fee: '383.8975' paid_fee: '0' locked: '153942.8975' prevented_volume: '0' prevented_locked: '0' trades_count: 0 '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: body parameter not supported error: value: error: name: QUERY_PARAMETER_NOT_SUPPORTED message: This API only supports query parameters. Request body is not allowed. bad request error: value: error: name: bad_request message: Bad request '404': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: not found order error: value: error: name: order_not_found message: Order not found /v1/orders: post: operationId: new-order summary: Create Order description: Creates an order to buy or sell a specific trading pair. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request POST \\\n--url 'https://sg-api.upbit.com/v1/orders' \\\n--header 'Authorization: Bearer {JWT_TOKEN}' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '\n {\n \"market\":\"SGD-BTC\",\n \"side\":\"bid\",\n \"volume\":\"1\",\n \"price\":\"140000000\",\n \"ord_type\":\"limit\"\n }\n'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/orders\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"market\": \"SGD-BTC\",\n \"side\": \"bid\",\n \"volume\": \"1\",\n \"price\": \"140000000\",\n \"ord_type\": \"limit\",\n}\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.post(f\"{BASE_URL}{PATH}\", headers=headers, json=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/orders\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n market: \"SGD-BTC\",\n side: \"bid\",\n volume: \"1\",\n price: \"140000000\",\n ord_type: \"limit\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"POST\",\n url: `${baseURL}${path}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n data: params,\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\nimport com.google.gson.Gson;\n\npublic class CreateOrder {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/orders\";\n\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"market\", \"SGD-BTC\");\n params.put(\"side\", \"bid\");\n params.put(\"volume\", \"1\");\n params.put(\"price\", \"140000000\");\n params.put(\"ord_type\", \"limit\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n String jsonBody = new Gson().toJson(params);\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH)\n .post(RequestBody.create(jsonBody, okhttp3.MediaType.parse(\"application/json; charset=utf-8\")))\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" requestBody: required: true content: application/json: examples: default: value: market: SGD-BTC side: bid volume: '1' price: '153559' ord_type: limit market_sell: value: market: SGD-BTC side: ask volume: '0.001' ord_type: market market_buy: value: market: SGD-BTC side: bid price: '100' ord_type: price best_buy: value: market: SGD-BTC side: bid price: '100' ord_type: best time_in_force: ioc best_sell: value: market: SGD-BTC side: ask volume: '0.001' ord_type: best time_in_force: ioc limit_ioc: value: market: SGD-BTC side: bid volume: '0.001' price: '153559' ord_type: limit time_in_force: ioc limit_smp_reduce: value: market: SGD-BTC side: bid volume: '0.001' price: '153559' ord_type: limit smp_type: reduce schema: type: object required: - market - side - ord_type properties: market: type: string description: Target trading pair for the order. (required) example: SGD-BTC side: allOf: - $ref: '#/components/schemas/SideEnum' description: Order direction (ask=sell, bid=buy). (required) volume: type: string format: decimal description: Order volume. example: '0.01' price: type: string format: decimal description: Order price or total amount. example: '1000' ord_type: allOf: - $ref: '#/components/schemas/OrdTypeEnum' description: 'Order type. (required) * `limit`: Limit order * `price`: Market buy order (by total price) * `market`: Market sell order (by volume) * `best`: Best available price order ' identifier: type: string description: Client-assigned order identifier. example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae time_in_force: allOf: - $ref: '#/components/schemas/TimeInForceEnum' description: 'Time in force condition. * `fok`: Fill or Kill * `ioc`: Immediate or Cancel * `post_only`: Post only (maker only) ' smp_type: allOf: - $ref: '#/components/schemas/SmpTypeEnum' description: 'Self-Match Prevention (SMP) mode. * `cancel_maker`: Cancel maker order * `cancel_taker`: Cancel taker order * `reduce`: Reduce order quantity ' responses: '201': description: Object of created order content: application/json: schema: $ref: '#/components/schemas/Order' examples: Successful Example: value: uuid: d098ceaf-6811-4df8-97f2-b7e01aefc03f side: bid ord_type: limit price: '153559.00' state: wait market: SGD-BTC created_at: '2025-07-04T15:00:00' volume: '1.0' remaining_volume: '1.0' executed_volume: '0.0' reserved_fee: '383.8975' remaining_fee: '383.8975' paid_fee: '0' locked: '153942.8975' prevented_volume: '0' prevented_locked: '0' trades_count: 0 '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid parameter error: value: error: name: invalid_parameter message: Invalid parameter invalid time in force error: value: error: name: invalid_time_in_force message: Please check the time-in-force option. If the issue persists, contact customer support. invalid price bid error: value: error: name: invalid_price_bid message: Invalid bid price unit. Please check and try again. invalid price ask error: value: error: name: invalid_price_ask message: Invalid ask price unit. Please check and try again. insufficient funds bid error: value: error: name: insufficient_funds_bid message: Insufficient available SGD to place the bid. insufficient funds ask error: value: error: name: insufficient_funds_ask message: Insufficient quantity available to place the ask. not found market error: value: error: name: notfoundmarket message: 'The market does not contain the specified asset: SGD-BTCs' '403': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: market offline error (Singapore): value: error: name: market_offline message: System under maintenance. \nPlease wait until maintenance schedule ends. market offline error (Indonesia): value: error: name: market_offline message: Sistem dalam pemeliharaan. \nHarap tunggu sampai jadwal pemeliharaan selesai. market offline error (Thailand): value: error: name: market_offline message: กำลังปิดปรับปรุงระบบ \nโปรดรอจนกว่าการปิดปรับปรุงระบบจะเสร็จสิ้น. /v1/orders/cancel_and_new: post: operationId: cancel-and-new-order summary: Cancel and New Order description: Cancel existing order and create new order in a single request. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request POST \\\n --url 'https://sg-api.upbit.com/v1/orders/cancel_and_new' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json' \\\n --header 'Content-Type: application/json' \\\n --data '\n{\n\"prev_order_uuid\": \"ad217e24-ed02-469c-9b30-c08dbbda6908\",\n\"new_ord_type\": \"limit\",\n\"new_price\": \"100000000\",\n\"new_volume\": \"1\"\n}\n'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/orders/cancel_and_new\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"prev_order_uuid\": \"ad217e24-ed02-469c-9b30-c08dbbda6908\",\n \"new_ord_type\": \"limit\",\n \"new_price\": \"100000000\",\n \"new_volume\": \"1\",\n}\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.post(f\"{BASE_URL}{PATH}\", headers=headers, json=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/orders/cancel_and_new\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n prev_order_uuid: \"ad217e24-ed02-469c-9b30-c08dbbda6908\",\n new_ord_type: \"limit\",\n new_price: \"100000000\",\n new_volume: \"1\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"POST\",\n url: `${baseURL}${path}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n data: params,\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\nimport com.google.gson.Gson;\n\npublic class CancelAndNew {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/orders/cancel_and_new\";\n\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"prev_order_uuid\", \"ad217e24-ed02-469c-9b30-c08dbbda6908\");\n params.put(\"new_ord_type\", \"limit\");\n params.put(\"new_price\", \"100000000\");\n params.put(\"new_volume\", \"1\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n String jsonBody = new Gson().toJson(params);\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH)\n .post(RequestBody.create(jsonBody, okhttp3.MediaType.parse(\"application/json; charset=utf-8\")))\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" requestBody: required: true content: application/json: examples: default: value: prev_order_uuid: ad217e24-ed02-469c-9b30-c08dbbda6908 new_ord_type: limit new_price: '100000000' new_volume": '1' schema: type: object required: - new_ord_type properties: prev_order_uuid: type: string description: UUID of the order to cancel. example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae prev_order_identifier: type: string description: Client-assigned identifier of the order to cancel. example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae new_ord_type: allOf: - $ref: '#/components/schemas/OrdTypeEnum' description: 'Order type for the new order. * `limit`: Limit order * `price`: Market buy order (by total price) * `market`: Market sell order (by volume) * `best`: Best available price order ' new_volume: type: string format: decimal description: Volume for the new order. example: remain_only new_price: type: string format: decimal description: Price or total amount for the new order. example: '1000' new_identifier: type: string description: Client-assigned identifier for the new order. example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae new_time_in_force: allOf: - $ref: '#/components/schemas/TimeInForceEnum' description: 'Time in force condition for the new order. * `fok`: Fill or Kill * `ioc`: Immediate or Cancel * `post_only`: Post only (maker only) ' new_smp_type: allOf: - $ref: '#/components/schemas/SmpTypeEnum' description: 'SMP mode for the new order. * `cancel_maker`: Cancel maker order * `cancel_taker`: Cancel taker order * `reduce`: Reduce order quantity ' responses: '201': description: Object of cancel-and-new order result content: application/json: schema: allOf: - $ref: '#/components/schemas/Order' - type: object required: - new_order_uuid properties: new_order_uuid: type: string description: Unique identifier of the newly created order. example: 4b07aa31-4747-485c-8bce-ac5495e4a639 new_order_identifier: type: string description: Client-assigned identifier of the newly created order. example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae examples: Successful Example: value: uuid: d098ceaf-6811-4df8-97f2-b7e01aefc03f side: bid ord_type: limit price: '153559.00' state: wait market: SGD-BTC created_at: '2025-07-04T15:00:00' volume: '1.0' remaining_volume: '1.0' executed_volume: '0' reserved_fee: '383.8975' remaining_fee: '383.8975' paid_fee: '0' locked: '153942.8975' prevented_volume: '0' prevented_locked: '0' trades_count: 0 new_order_uuid: 4b07aa31-4747-485c-8bce-ac5495e4a639 '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid parameter error: value: error: name: invalid_parameter message: Invalid parameter '401': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: unauthorized jwt error: value: error: name: invalid_query_payload message: Failed to verify the query of Jwt. '500': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: internal server error: value: error: name: internal_server_error message: Internal Server Error /v1/orders/chance: get: operationId: available-order-information summary: Get Available Order Info description: Retrieves the order availability information for the specified pair. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/orders/chance?market=SGD-BTC' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nfrom dotenv import load_dotenv\nimport uuid\nimport hashlib\nimport jwt\nimport requests\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/orders/chance\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\"market\": \"SGD-BTC\"}\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string.encode(\"utf-8\"))\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}?{query_string}\", headers=headers)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/orders/chance\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst queryParams = {\n market: \"SGD-BTC\",\n};\n\nconst queryString = new URLSearchParams(queryParams).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}?${queryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class AvailableOrderInformation {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/orders/chance\";\n\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"market\", \"SGD-BTC\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: market in: query required: true schema: type: string description: Trading pair to query. example: SGD-BTC allowReserved: true examples: default: value: SGD-BTC responses: '200': description: Object of order policy content: application/json: schema: $ref: '#/components/schemas/OrderChance' examples: Successful Example: value: - bid_fee: '0.0025' ask_fee: '0.0025' maker_bid_fee: '0.0025' maker_ask_fee: '0.0025' market: id: SGD-BTC name: BTC/SGD order_types: - limit order_sides: - ask - bid bid_types: - best_fok - best_ioc - limit - limit_fok - limit_ioc - price ask_types: - best_fok - best_ioc - limit - limit_fok - limit_ioc - market bid: currency: SGD min_total: '1' ask: currency: BTC min_total: '1' max_total: '1000000' state: active bid_account: currency: SGD balance: '0' locked: '0' avg_buy_price: '0' avg_buy_price_modified: true unit_currency: SGD ask_account: currency: BTC balance: '0' locked: '0' avg_buy_price: '0' avg_buy_price_modified: false unit_currency: SGD '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid parameter error: value: error: name: invalid_parameter message: Invalid parameter not found market error: value: error: name: notfoundmarket message: 'The market does not contain the specified asset: SGD-BTCs' /v1/orders/closed: get: operationId: list-closed-orders summary: List Closed Orders description: Retrieves the list of closed orders. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/orders/closed?market=SGD-BTC&states[]=done&states[]=cancel' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/orders/closed\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\"market\": \"SGD-BTC\", \"states[]\": [\"done\", \"cancel\"]}\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst BASE_URL = \"https://sg-api.upbit.com\";\nconst PATH = \"/v1/orders/closed\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n market: \"SGD-BTC\",\n \"states[]\": [\"done\", \"cancel\"],\n};\n\nconst encodedQueryString = new URLSearchParams(\n Object.entries(params).flatMap(([key, value]) =>\n Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]]\n )\n).toString();\n\nconst queryString = decodeURIComponent(encodedQueryString);\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\nconsole.log(jwtToken);\n\nconst options = {\n method: \"GET\",\n url: `${BASE_URL}${PATH}?${encodedQueryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class ClosedOrders {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/orders/closed\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map> params = new HashMap<>();\n params.put(\"market\", \"SGD-BTC\");\n params.put(\"states[]\", List.of(\"done\", \"cancel\"));\n String queryString = params.entrySet().stream()\n .flatMap(e -> e.getValue().stream().map(v -> e.getKey() + \"=\" + v))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: market in: query required: false schema: type: string description: Trading pair to filter by. example: SGD-BTC allowReserved: true examples: default: value: SGD-BTC - name: state in: query required: false schema: allOf: - $ref: '#/components/schemas/ClosedOrderState' description: 'Order state filter. Market buy orders can result in either `cancel` or `done`. ' allowReserved: true - name: states[] in: query required: false schema: type: array description: 'Order state filter (array form). "done" or "cancel". Default returns all states. [Example] states[]=done&states[]=cancel ' items: allOf: - $ref: '#/components/schemas/ClosedOrderState' default: - done - cancel allowReserved: true examples: default: value: - done - cancel - name: start_time in: query required: false schema: type: string description: 'Start time of the query range. Max range is 7 days. * If only "start_time" is given, the range is 7 days after it. * If neither is given, the default is the past 7 days. Format: ISO 8601 (2025-06-24T13:56:53+09:00) or millisecond timestamp (1750741013000) ' example: '2024-12-09T13:56:53+09:00' - name: end_time in: query required: false schema: type: string description: 'End time of the query range. Max range is 7 days. * If only "end_time" is given, the range is 7 days before it. Format: ISO 8601 (2025-06-24T13:56:53+09:00) or millisecond timestamp (1750741013000) ' example: '2024-12-09T13:56:53+09:00' - name: limit in: query required: false schema: type: integer description: 'Number of results per request (default: 100, max: 1,000).' example: 1000 default: 100 allowReserved: true - name: order_by in: query required: false schema: type: string enum: - asc - desc description: Sort order. "desc" (newest first) or "asc" (oldest first). Default is "desc". example: desc default: desc allowReserved: true responses: '200': description: List of closed orders content: application/json: schema: type: array items: $ref: '#/components/schemas/Order' examples: Successful Example: value: - uuid: d098ceaf-6811-4df8-97f2-b7e01aefc03f side: bid ord_type: limit price: '153559.00' state: done market: SGD-BTC created_at: '2025-07-04T15:00:00' volume: '1.0' remaining_volume: '0' executed_volume: '1.0' executed_funds: '153942.8975' reserved_fee: '0' remaining_fee: '0' paid_fee: '383.8975' locked: '0' prevented_volume: '0' prevented_locked: '0' trades_count: 1 '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid parameter error: value: error: name: invalid_parameter message: Invalid parameter /v1/orders/open: get: operationId: list-open-orders summary: List Open Orders description: Retrieves the list of open orders that are currently pending execution. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/orders/open?market=SGD-BTC&states[]=wait&states[]=watch' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/orders/open\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"market\": \"SGD-BTC\",\n \"states[]\": [\"wait\", \"watch\"],\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst BASE_URL = \"https://sg-api.upbit.com\";\nconst PATH = \"/v1/orders/open\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n market: \"SGD-BTC\",\n \"states[]\": [\"wait\", \"watch\"],\n};\n\nconst encodedQueryString = new URLSearchParams(\n Object.entries(params).flatMap(([key, value]) =>\n Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]]\n )\n).toString();\n\nconst queryString = decodeURIComponent(encodedQueryString);\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\nconsole.log(jwtToken);\n\nconst options = {\n method: \"GET\",\n url: `${BASE_URL}${PATH}?${encodedQueryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class OpenOrders {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/orders/open\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map> params = new HashMap<>();\n params.put(\"market\", \"SGD-BTC\");\n params.put(\"states[]\", List.of(\"wait\", \"watch\"));\n String queryString = params.entrySet().stream()\n .flatMap(e -> e.getValue().stream().map(v -> e.getKey() + \"=\" + v))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: market in: query required: false schema: type: string description: Trading pair to filter by. example: SGD-BTC allowReserved: true examples: default: value: SGD-BTC - name: state in: query required: false schema: allOf: - $ref: '#/components/schemas/OpenOrderState' description: 'Order state filter. "wait" (pending) or "watch" (reservation). Default is "wait". ' default: wait allowReserved: true - name: states[] in: query required: false schema: type: array description: 'Order state filter (array form). "wait" or "watch". Default is ["wait"]. [Example] states[]=wait&states[]=watch ' items: allOf: - $ref: '#/components/schemas/OpenOrderState' default: - wait allowReserved: true examples: default: value: - wait - watch - name: page in: query required: false schema: type: integer description: Page number for pagination. Default is 1. example: 1 default: 1 allowReserved: true - name: limit in: query required: false schema: type: integer description: 'Number of results per request (default: 100, max: 100).' example: 100 default: 100 allowReserved: true - name: order_by in: query required: false schema: type: string enum: - asc - desc description: Sort order. "desc" (newest first) or "asc" (oldest first). Default is "desc". example: desc default: desc allowReserved: true responses: '200': description: List of open orders content: application/json: schema: type: array items: $ref: '#/components/schemas/Order' examples: Successful Example: value: - uuid: d098ceaf-6811-4df8-97f2-b7e01aefc03f side: bid ord_type: limit price: '153559.00' state: wait market: SGD-BTC created_at: '2025-07-04T15:00:00' volume: '1.0' remaining_volume: '1.0' executed_volume: '0' executed_funds: '153559.00' reserved_fee: '383.8975' remaining_fee: '383.8975' paid_fee: '0' locked: '153942.8975' prevented_volume: '0' prevented_locked: '0' trades_count: 0 '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid parameter error: value: error: name: invalid_parameter message: Invalid parameter delete: operationId: batch-cancel-orders summary: Batch Cancel Orders description: Batch cancel up to 300 orders that satisfy the specified conditions. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request DELETE \\\n --url 'https://sg-api.upbit.com/v1/orders/open?cancel_side=all&excluded_pairs=SGD-ETH,BTC-XRP"e_currencies=SGD,BTC' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/orders/open\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"cancel_side\": \"all\",\n \"excluded_pairs\": \"SGD-ETH,BTC-XRP\",\n \"quote_currencies\": \"SGD,BTC\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.delete(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/orders/open\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n cancel_side: \"all\",\n excluded_pairs: \"SGD-ETH,BTC-XRP\",\n quote_currencies: \"SGD,BTC\",\n};\n\nconst queryString = decodeURIComponent(new URLSearchParams(params).toString());\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"DELETE\",\n url: `${baseURL}${path}?${queryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.net.URLEncoder;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class DeleteOrders {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/orders/open\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"cancel_side\", \"all\");\n params.put(\"excluded_pairs\", \"SGD-ETH,BTC-XRP\");\n params.put(\"quote_currencies\", \"SGD,BTC\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .delete()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: quote_currencies in: query required: false schema: type: string description: 'Quote currency filter (SGD, BTC, USDT). Cancels all open orders in markets with the specified quote currency. [Example] "SGD" cancels all open orders in the SGD market. ' example: SGD allowReserved: true examples: default: value: SGD,BTC - name: cancel_side in: query required: false schema: type: string description: 'Side filter. "all" (both), "ask" (sell only), "bid" (buy only). ' enum: - bid - ask - all default: all allowReserved: true examples: default: value: all - name: count in: query required: false schema: type: integer description: 'Maximum number of orders to cancel. Max 300, default 20. ' example: 300 default: 20 allowReserved: true - name: order_by in: query required: false schema: type: string enum: - asc - desc description: Sort order for determining which orders to cancel. "desc" (newest first) or "asc" (oldest first). Default is "desc". example: desc default: desc allowReserved: true - name: pairs in: query required: false schema: type: string description: 'Trading pair filter. Cancels open orders only for the specified pairs. Up to 20 pairs, comma-separated. [Example] pairs=SGD-BTC,SGD-ETH ' example: SGD-BTC,SGD-ETH allowReserved: true - name: excluded_pairs in: query required: false schema: type: string description: 'Trading pair exclusion filter. Cancels all open orders except those for the specified pairs. Up to 20 pairs, comma-separated. [Example] excluded_pairs=SGD-BTC,SGD-ETH ' example: SGD-BTC,SGD-ETH allowReserved: true examples: default: value: SGD-ETH,BTC-XRP responses: '200': description: Object of batch cancellation result content: application/json: schema: $ref: '#/components/schemas/BatchCancelResult' examples: Successful Example: value: success: count: 2 orders: - uuid: bbbb8e07-1689-4769-af3e-a117016623f8 market: SGD-ETH - uuid: 4312ba49-5f1a-4a01-9f3b-2d2bce17267e market: SGD-ETH failed: count: 1 orders: - uuid: bdb49a54-de36-4eb4-a963-9c8d4337a9da market: SGD-BTC '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: body parameter not supported error: value: error: name: QUERY_PARAMETER_NOT_SUPPORTED message: This API only supports query parameters. Request body is not allowed. invalid parameter error: value: error: name: invalid_parameter message: Invalid parameter '401': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: unauthorized jwt error: value: error: name: invalid_query_payload message: Failed to verify the query of Jwt. '404': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: not found order error: value: error: name: order_not_found message: Order not found /v1/orders/test: post: operationId: order-test summary: Test Order description: Validates an order request without creating an actual order. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request POST \\\n--url 'https://sg-api.upbit.com/v1/orders/test' \\\n--header 'Authorization: Bearer {JWT_TOKEN}' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '\n {\n \"market\":\"SGD-BTC\",\n \"side\":\"bid\",\n \"volume\":\"1\",\n \"price\":\"140000000\",\n \"ord_type\":\"limit\"\n }\n'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/orders/test\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"market\": \"SGD-BTC\",\n \"side\": \"bid\",\n \"volume\": \"1\",\n \"price\": \"140000000\",\n \"ord_type\": \"limit\",\n}\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.post(f\"{BASE_URL}{PATH}\", headers=headers, json=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/orders/test\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n market: \"SGD-BTC\",\n side: \"bid\",\n volume: \"1\",\n price: \"140000000\",\n ord_type: \"limit\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"POST\",\n url: `${baseURL}${path}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n data: params,\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\nimport com.google.gson.Gson;\n\npublic class CreateOrder {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/orders/test\";\n\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"market\", \"SGD-BTC\");\n params.put(\"side\", \"bid\");\n params.put(\"volume\", \"1\");\n params.put(\"price\", \"140000000\");\n params.put(\"ord_type\", \"limit\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n String jsonBody = new Gson().toJson(params);\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH)\n .post(RequestBody.create(jsonBody, okhttp3.MediaType.parse(\"application/json; charset=utf-8\")))\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" requestBody: required: true content: application/json: examples: default: value: market: SGD-BTC side: bid volume: '1' price: '153559' ord_type: limit schema: type: object required: - market - side - ord_type properties: market: type: string description: Target trading pair for the order. (required) example: SGD-BTC side: allOf: - $ref: '#/components/schemas/SideEnum' description: Order direction (ask=sell, bid=buy). (required) volume: type: string format: decimal description: Order volume. example: '0.01' price: type: string format: decimal description: Order price or total amount. example: '1000' ord_type: allOf: - $ref: '#/components/schemas/OrdTypeEnum' description: 'Order type. (required) * `limit`: Limit order * `price`: Market buy order (by total price) * `market`: Market sell order (by volume) * `best`: Best available price order ' identifier: type: string description: Client-assigned order identifier. example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae time_in_force: allOf: - $ref: '#/components/schemas/TimeInForceEnum' description: 'Time in force condition. * `fok`: Fill or Kill * `ioc`: Immediate or Cancel * `post_only`: Post only (maker only) ' smp_type: allOf: - $ref: '#/components/schemas/SmpTypeEnum' description: 'Self-Match Prevention (SMP) mode. * `cancel_maker`: Cancel maker order * `cancel_taker`: Cancel taker order * `reduce`: Reduce order quantity ' responses: '201': description: Object of created order (dry-run) content: application/json: schema: $ref: '#/components/schemas/Order' examples: Successful Example: value: uuid: d098ceaf-6811-4df8-97f2-b7e01aefc03f side: bid ord_type: limit price: '153559.00' state: wait market: SGD-BTC created_at: '2025-07-04T15:00:00' volume: '1.0' remaining_volume: '1.0' executed_volume: '0.0' reserved_fee: '383.8975' remaining_fee: '383.8975' paid_fee: '0' locked: '153942.8975' prevented_volume: '0' prevented_locked: '0' trades_count: 0 '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid parameter error: value: error: name: invalid_parameter message: Invalid parameter invalid time in force error: value: error: name: invalid_time_in_force message: Please check the time-in-force option. If the issue persists, contact customer support. invalid price bid error: value: error: name: invalid_price_bid message: Invalid bid price unit. Please check and try again. invalid price ask error: value: error: name: invalid_price_ask message: Invalid ask price unit. Please check and try again. insufficient funds bid error: value: error: name: insufficient_funds_bid message: Insufficient available SGD to place the bid. insufficient funds ask error: value: error: name: insufficient_funds_ask message: Insufficient quantity available to place the ask. not found market error: value: error: name: notfoundmarket message: 'The market does not contain the specified asset: SGD-BTCs' '403': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: market offline error (Singapore): value: error: name: market_offline message: System under maintenance. \nPlease wait until maintenance schedule ends. market offline error (Indonesia): value: error: name: market_offline message: Sistem dalam pemeliharaan. \nHarap tunggu sampai jadwal pemeliharaan selesai. market offline error (Thailand): value: error: name: market_offline message: กำลังปิดปรับปรุงระบบ \nโปรดรอจนกว่าการปิดปรับปรุงระบบจะเสร็จสิ้น. /v1/orders/uuids: get: operationId: list-orders-by-ids summary: List Orders by IDs description: Retrieves orders by a list of UUIDs or Identifiers. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/orders/uuids?uuids[]=5d303952-8be9-41e6-915b-121a90026248&uuids[]=3944c2c1-bd8c-441a-aa25-2370d08217a9&uuids[]=3b67e543-8ad3-48d0-8451-0dad315cae73' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/orders/uuids\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"uuids[]\": [\"5d303952-8be9-41e6-915b-121a90026248\",\"3944c2c1-bd8c-441a-aa25-2370d08217a9\",\"5b95451b-971e-4e76-8f61-5ff441f078d5\",\"3b67e543-8ad3-48d0-8451-0dad315cae73\"],\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/orders/uuids\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst arrayParams = {\n \"uuids[]\": [\n \"5d303952-8be9-41e6-915b-121a90026248\",\n \"3944c2c1-bd8c-441a-aa25-2370d08217a9\",\n \"5b95451b-971e-4e76-8f61-5ff441f078d5\",\n \"3b67e543-8ad3-48d0-8451-0dad315cae73\",\n ],\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}?${queryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class ListOrders {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/orders/uuids\";\n\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map> params = new HashMap<>();\n params.put(\"uuids[]\", List.of(\"5d303952-8be9-41e6-915b-121a90026248\",\"3944c2c1-bd8c-441a-aa25-2370d08217a9\",\"5b95451b-971e-4e76-8f61-5ff441f078d5\",\"3b67e543-8ad3-48d0-8451-0dad315cae73\"));\n\n String queryString = params.entrySet().stream()\n .flatMap(e -> e.getValue().stream().map(v -> e.getKey() + \"=\" + v))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: market in: query required: false schema: type: string description: Trading pair to filter by. example: SGD-BTC allowReserved: true - name: uuids[] in: query required: false schema: type: array description: 'List of UUIDs of orders to query. Maximum 100 orders. [Example] uuids[]=uuid1&uuids[]=uuid2… ' items: type: string example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae allowReserved: true examples: default: value: - 5d303952-8be9-41e6-915b-121a90026248 - 3944c2c1-bd8c-441a-aa25-2370d08217a9 - 5b95451b-971e-4e76-8f61-5ff441f078d5 - 3b67e543-8ad3-48d0-8451-0dad315cae73 - name: identifiers[] in: query required: false schema: type: array description: 'List of client-assigned identifiers of orders to query. Maximum 100 orders. [Example] identifiers[]=id1&identifiers[]=id2… ' items: type: string example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae allowReserved: true - name: order_by in: query required: false schema: type: string enum: - asc - desc description: 'Sort order. "desc" (newest first) or "asc" (oldest first). Default is "desc". ' example: desc default: desc allowReserved: true responses: '200': description: List of orders content: application/json: schema: type: array items: $ref: '#/components/schemas/Order' examples: Successful Example: value: - uuid: d098ceaf-6811-4df8-97f2-b7e01aefc03f side: bid ord_type: limit price: '153559.00' state: wait market: SGD-BTC created_at: '2025-07-04T15:00:00' volume: '1.0' remaining_volume: '1.0' executed_volume: '0' executed_funds: '153559.00' reserved_fee: '383.8975' remaining_fee: '383.8975' paid_fee: '0' locked: '153942.8975' prevented_volume: '0' prevented_locked: '0' trades_count: 0 '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid parameter error: value: error: name: invalid_parameter message: Invalid parameter delete: operationId: cancel-orders-by-ids summary: Cancel Orders by IDs description: Cancel specified orders by providing a list of UUIDs or Identifiers. You can cancel up to 20 orders in a single request. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request DELETE \\\n --url 'https://sg-api.upbit.com/v1/orders/uuids?uuids[]=bbbb8e07-1689-4769-af3e-a117016623f8&uuids[]=4312ba49-5f1a-4a01-9f3b-2d2bce17267e&uuids[]=bdb49a54-de36-4eb4-a963-9c8d4337a9da' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/orders/uuids\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"uuids[]\": [\"bbbb8e07-1689-4769-af3e-a117016623f8\", \"4312ba49-5f1a-4a01-9f3b-2d2bce17267e\", \"bdb49a54-de36-4eb4-a963-9c8d4337a9da\"],\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.delete(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/orders/uuids\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst arrayParams = {\n \"uuids[]\": [\n \"bbbb8e07-1689-4769-af3e-a117016623f8\",\n \"4312ba49-5f1a-4a01-9f3b-2d2bce17267e\",\n \"bdb49a54-de36-4eb4-a963-9c8d4337a9da\",\n ],\n};\n\nconst arrayParamsString = Object.entries(arrayParams)\n .flatMap(([key, values]) => values.map((value) => `${key}=${value}`))\n .join(\"&\");\n\nconst queryString = arrayParamsString;\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"DELETE\",\n url: `${baseURL}${path}?${queryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class DeleteOrdersById {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/orders/uuids\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map> params = new HashMap<>();\n params.put(\"uuids[]\", List.of(\"bbbb8e07-1689-4769-af3e-a117016623f8\", \"4312ba49-5f1a-4a01-9f3b-2d2bce17267e\", \"bdb49a54-de36-4eb4-a963-9c8d4337a9da\"));\n\n String queryString = params.entrySet().stream()\n .flatMap(e -> e.getValue().stream().map(v -> e.getKey() + \"=\" + v))\n .collect(Collectors.joining(\"&\"));\n\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: uuids[] in: query required: false schema: type: array description: 'List of UUIDs of orders to cancel. Maximum 20 orders. [Example] uuids[]=uuid1&uuids[]=uuid2… ' items: type: string example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae allowReserved: true examples: default: value: - bbbb8e07-1689-4769-af3e-a117016623f8 - 4312ba49-5f1a-4a01-9f3b-2d2bce17267e - bdb49a54-de36-4eb4-a963-9c8d4337a9da - name: identifiers[] in: query required: false schema: type: array description: 'List of client-assigned identifiers of orders to cancel. Maximum 20 orders. [Example] identifiers[]=id1&identifiers[]=id2… ' items: type: string example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae allowReserved: true responses: '200': description: Object of batch cancel result content: application/json: schema: $ref: '#/components/schemas/BatchCancelResult' examples: Successful Example: value: success: count: 2 orders: - uuid: bbbb8e07-1689-4769-af3e-a117016623f8 market: SGD-ETH - uuid: 4312ba49-5f1a-4a01-9f3b-2d2bce17267e market: SGD-ETH failed: count: 1 orders: - uuid: bdb49a54-de36-4eb4-a963-9c8d4337a9da market: SGD-BTC '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: body parameter not supported error: value: error: name: QUERY_PARAMETER_NOT_SUPPORTED message: This API only supports query parameters. Request body is not allowed. bad request error: value: error: name: bad_request message: Bad request /v1/status/wallet: get: operationId: get-service-status summary: Get Deposit/Withdrawal Service Status description: Retrieves deposit and withdrawal service status for all currencies. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/status/wallet' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport jwt\nimport requests\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/status/wallet\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers={\"Authorization\": f\"Bearer {jwt_token}\", \"Accept\": \"application/json\"})\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/status/wallet\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => console.log(response.data))\n .catch((error) => console.error(error));\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class StatusService {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/status/wallet\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"access_key\", accessKey);\n params.put(\"nonce\", UUID.randomUUID().toString());\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" responses: '200': description: List of deposit/withdrawal service status content: application/json: schema: type: array items: $ref: '#/components/schemas/WalletStatus' examples: Successful Example: value: - currency: BTC wallet_state: working block_state: normal block_height: 907974 block_updated_at: '2025-07-31T16:12:40.584+00:00' block_elapsed_minutes: 15 net_type: BTC network_name: Bitcoin - currency: ETH wallet_state: working block_state: normal block_height: 23040230 block_updated_at: '2025-07-31T16:19:28.010+00:00' block_elapsed_minutes: 2 net_type: ETH network_name: Ethereum - currency: XRP wallet_state: working block_state: normal block_height: 97847580 block_updated_at: '2025-07-31T16:21:01.018+00:00' block_elapsed_minutes: 2 net_type: XRP network_name: XRP Ledger - currency: USDT wallet_state: working block_state: normal block_height: 23040230 block_updated_at: '2025-07-31T16:19:28.010+00:00' block_elapsed_minutes: 2 net_type: ETH network_name: Ethereum - currency: SOL wallet_state: working block_state: normal block_height: 356978700 block_updated_at: '2025-07-31T16:20:59.957+00:00' block_elapsed_minutes: 2 net_type: SOL network_name: Solana /v1/travel_rule/deposit/txid: post: operationId: verify-travelrule-by-txid summary: Verify Travel Rule by Deposit TxID description: Retrieves travel rule verification using the deposit TxID. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request POST \\\n --url 'https://sg-api.upbit.com/v1/travel_rule/deposit/txid' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Content-Type: application/json' \\\n --data '\n{\n\"txid\": \"5b871d34-fe38-4025-8f5c-9b22028f85d3\",\n\"vasp_uuid\": \"8d4fe968-82b2-42e5-822f-3840a245f802\",\n\"currency\": \"ETH\",\n\"net_type\": \"ETH\"\n}\n'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/travel_rule/deposit/txid\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"txid\": \"5b871d34-fe38-4025-8f5c-9b22028f85d3\",\n \"vasp_uuid\": \"8d4fe968-82b2-42e5-822f-3840a245f802\",\n \"currency\": \"ETH\",\n \"net_type\": \"ETH\"\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.post(f\"{BASE_URL}{PATH}\", headers=headers, json=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/travel_rule/deposit/txid\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n txid: \"5b871d34-fe38-4025-8f5c-9b22028f85d3\",\n vasp_uuid: \"8d4fe968-82b2-42e5-822f-3840a245f802\",\n currency: \"ETH\",\n net_type: \"ETH\"\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"POST\",\n url: `${baseURL}${path}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n data: params,\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\nimport com.google.gson.Gson;\n\npublic class CreateDepositAddress {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/travel_rule/deposit/txid\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"txid\", \"5b871d34-fe38-4025-8f5c-9b22028f85d3\");\n params.put(\"vasp_uuid\", \"8d4fe968-82b2-42e5-822f-3840a245f802\");\n params.put(\"currency\", \"ETH\");\n params.put(\"net_type\", \"ETH\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n String jsonBody = new Gson().toJson(params);\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH)\n .post(RequestBody.create(jsonBody, okhttp3.MediaType.parse(\"application/json; charset=utf-8\")))\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" requestBody: description: Travel Rule verification for deposit transaction by TxID content: application/json: examples: default: value: txid: 5b871d34-fe38-4025-8f5c-9b22028f85d3 vasp_uuid: 8d4fe968-82b2-42e5-822f-3840a245f802 currency: ETH net_type: ETH schema: type: object required: - vasp_uuid - txid - currency - net_type properties: vasp_uuid: type: string description: Unique identifier (UUID) of the counterparty exchange from which the asset was withdrawn. example: 8d4fe968-82b2-42e5-822f-3840a245f802 txid: type: string description: Transaction ID of the deposit to be verified. example: 1234567890 currency: type: string description: Currency code to be queried. example: BTC net_type: type: string description: 'Blockchain network identifier for deposit/withdrawal of digital assets. Used as a filter parameter to specify the network. ' example: BTC responses: '201': description: Object of verification result content: application/json: schema: $ref: '#/components/schemas/TravelRuleVerificationResult' examples: Successful Example: value: deposit_uuid: 9f432943-54e0-40b7-825f-b6fec8b42b79 verification_result: verified deposit_state: PROCESSING '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: empty parameter error: value: error: name: validation_error message: deposit_uuid is empty invalid value error: value: error: name: validation_error message: '"field name" does not have a valid value' missing required parameter error: value: error: name: validation_error message: currency is missing, currency does not have a valid value, currency is empty, net_type is missing, net_type does not have a valid value, net_type is empty already have deposit transaction error: value: error: name: already_have_deposit_transaction message: Already have deposit transaction '404': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: not found deposit error: value: error: name: deposit_not_found message: Deposit information not found. /v1/travel_rule/deposit/uuid: post: operationId: verify-travelrule-by-uuid summary: Verify Travel Rule by Deposit UUID description: Retrieves travel rule verification using the deposit UUID. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request POST \\\n --url 'https://sg-api.upbit.com/v1/travel_rule/deposit/uuid' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Content-Type: application/json' \\\n --data '\n{\n\"deposit_uuid\": \"5b871d34-fe38-4025-8f5c-9b22028f85d3\",\n\"vasp_uuid\": \"8d4fe968-82b2-42e5-822f-3840a245f802\"\n}\n'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/travel_rule/deposit/uuid\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"deposit_uuid\": \"5b871d34-fe38-4025-8f5c-9b22028f85d3\",\n \"vasp_uuid\": \"8d4fe968-82b2-42e5-822f-3840a245f802\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.post(f\"{BASE_URL}{PATH}\", headers=headers, json=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/travel_rule/deposit/uuid\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n deposit_uuid: \"5b871d34-fe38-4025-8f5c-9b22028f85d3\",\n vasp_uuid: \"8d4fe968-82b2-42e5-822f-3840a245f802\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"POST\",\n url: `${baseURL}${path}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n data: params,\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\nimport com.google.gson.Gson;\n\npublic class CreateDepositAddress {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/travel_rule/deposit/uuid\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"deposit_uuid\", \"5b871d34-fe38-4025-8f5c-9b22028f85d3\");\n params.put(\"vasp_uuid\", \"8d4fe968-82b2-42e5-822f-3840a245f802\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n String jsonBody = new Gson().toJson(params);\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH)\n .post(RequestBody.create(jsonBody, okhttp3.MediaType.parse(\"application/json; charset=utf-8\")))\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" requestBody: description: Travel Rule verification for deposit transaction by UUID content: application/json: examples: default: value: deposit_uuid: 5b871d34-fe38-4025-8f5c-9b22028f85d3 vasp_uuid: 8d4fe968-82b2-42e5-822f-3840a245f802 schema: type: object required: - deposit_uuid - vasp_uuid properties: deposit_uuid: type: string description: Unique identifier (UUID) for the deposit to verify. example: 5b871d34-fe38-4025-8f5c-9b22028f85d3 vasp_uuid: type: string description: Unique identifier (UUID) of the counterparty exchange from which the asset was withdrawn. example: 8d4fe968-82b2-42e5-822f-3840a245f802 responses: '201': description: Object of verification result content: application/json: schema: $ref: '#/components/schemas/TravelRuleVerificationResult' examples: Successful Example: value: deposit_uuid: 9f432943-54e0-40b7-825f-b6fec8b42b79 verification_result: verified deposit_state: PROCESSING '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: empty parameter error: value: error: name: validation_error message: deposit_uuid is empty invalid value error: value: error: name: validation_error message: '"field name" does not have a valid value' missing required parameter error: value: error: name: validation_error message: currency is missing, currency does not have a valid value, currency is empty, net_type is missing, net_type does not have a valid value, net_type is empty already have deposit transaction error: value: error: name: already_have_deposit_transaction message: Already have deposit transaction '404': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: not found deposit error: value: error: name: deposit_not_found message: Deposit information not found. /v1/travel_rule/vasps: get: operationId: list-travelrule-vasps summary: List Travel Rule Supporting VASPs description: Retrieves the list of exchanges supporting Travel Rule. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/travel_rule/vasps' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport jwt\nimport requests\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/travel_rule/vasps\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers={\"Authorization\": f\"Bearer {jwt_token}\", \"Accept\": \"application/json\"})\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/travel_rule/vasps\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => console.log(response.data))\n .catch((error) => console.error(error));\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class StatusService {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/travel_rule/vasps\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"access_key\", accessKey);\n params.put(\"nonce\", UUID.randomUUID().toString());\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" responses: '200': description: List of VASPs content: application/json: schema: type: array items: $ref: '#/components/schemas/TravelRuleVasp' examples: Successful Example: value: - vasp_name: Upbit Korea vasp_uuid: 00000000-0000-0000-0000-000000000000 depositable: true withdrawable: true /v1/withdraw: get: operationId: get-withdrawal summary: Get Withdrawal description: Retrieves the latest single withdrawal information. To query a specific withdrawal, you can specify the withdrawal’s UUID or transaction ID (TXID). tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/withdraw?currency=BTC' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/withdraw\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"currency\": \"BTC\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\nprint(jwt_token)\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/withdraw\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n currency: \"BTC\",\n};\n\nqueryString = new URLSearchParams(params).toString();\n\nqueryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\npayload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}?${queryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class GetWithdraw {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/withdraw\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"currency\", \"BTC\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: uuid in: query required: false schema: type: string description: 'UUID of the withdrawal to query. If neither uuid nor txid is provided, the latest withdrawal is returned. ' example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae allowReserved: true - name: txid in: query required: false schema: type: string description: 'Transaction ID of the withdrawal to query. If neither uuid nor txid is provided, the latest withdrawal is returned. ' example: 98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc allowReserved: true - name: currency in: query required: false schema: type: string description: 'Currency code filter. If not specified, the latest withdrawal is returned. ' example: SGD allowReserved: true examples: default: value: BTC responses: '200': description: Object of withdrawal content: application/json: schema: $ref: '#/components/schemas/Withdraw' examples: Successful Example: value: type: withdraw uuid: 9f432943-54e0-40b7-825f-b6fec8b42b79 currency: BTC state: PROCESSING created_at: '2025-07-04T15:00:00' amount: '0.01' fee: '0.0' transaction_type: default is_cancelable: false '404': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: not found withdraw error: value: error: name: withdraw_not_found message: Withdrawal information not found. /v1/withdraws: get: operationId: list-withdrawals summary: List Withdrawals description: Retrieves latest withdrawal list. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/withdraws?currency=XRP&state=DONE' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/withdraws\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"currency\": \"XRP\",\n \"state\": \"DONE\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/withdraws\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nparams = {\ncurrency: \"XRP\",\nstate: \"DONE\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n.createHash(\"sha512\")\n.update(queryString, \"utf-8\")\n.digest(\"hex\");\n\nconst payload = {\naccess_key: ACCESS_KEY,\nnonce: uuidv4(),\nquery_hash: queryHash,\nquery_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\nmethod: \"GET\",\nurl: `${baseURL}${path}?${queryString}`,\nheaders: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n},\n};\n\naxios\n.request(options)\n.then((response) => {\n console.log(response.data);\n})\n.catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n});\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class ListWithdraws {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/withdraws\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"currency\", \"XRP\");\n params.put(\"state\", \"DONE\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: currency in: query required: false schema: type: string description: 'Currency code filter. If not specified, all currencies are returned. ' example: SGD allowReserved: true examples: default: value: XRP - name: state in: query required: false schema: type: string enum: - WAITING - PROCESSING - DONE - FAILED - CANCELLED - REJECTED description: 'Withdrawal state filter. * `WAITING`: Waiting * `PROCESSING`: Processing * `DONE`: Completed * `FAILED`: Failed * `CANCELLED`: Cancelled * `REJECTED`: Rejected ' allowReserved: true examples: default: value: DONE - name: uuids[] in: query required: false schema: type: array description: 'List of UUIDs to query. Maximum 100. Cannot be used together with txids. [Example] uuids[]=uuid1&uuids[]=uuid2 ' items: type: string example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae allowReserved: true - name: txids[] in: query required: false schema: type: array description: 'List of transaction IDs to query. Maximum 100. Cannot be used together with uuids. [Example] txids[]=txid1&txids[]=txid2 ' items: type: string example: 98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc allowReserved: true - name: limit in: query required: false schema: type: integer description: 'Number of results per request (default: 100, max: 100).' example: 100 default: 100 allowReserved: true - name: page in: query required: false schema: type: integer description: Page number for pagination. Default is 1. example: 1 default: 1 allowReserved: true - name: order_by in: query required: false schema: type: string enum: - asc - desc description: Sort order. "desc" (newest first) or "asc" (oldest first). Default is "desc". example: desc default: desc allowReserved: true - name: from in: query required: false schema: type: string description: 'Cursor for pagination. Enter a "uuid" from the response to retrieve "limit" withdrawals after that timestamp. ' - name: to in: query required: false schema: type: string description: 'Cursor for pagination. Enter a "uuid" from the response to retrieve "limit" withdrawals before that timestamp. ' responses: '200': description: List of withdrawals content: application/json: schema: type: array items: $ref: '#/components/schemas/Withdraw' examples: Successful Example: value: - type: withdraw uuid: 9f432943-54e0-40b7-825f-b6fec8b42b79 currency: XRP net_type: XRP txid: 98c15999f0bdc4ae0e8a-ed35868bb0c204fe6ec29e4058a3451e-88636d1040f4baddf943274ce37cf9cc state: DONE created_at: '2025-07-04T15:00:00' done_at: '2025-07-04T15:00:20' amount: '10.00' fee: '0.0' transaction_type: default is_cancelable: false '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid enum error: value: error: name: validation_error message: '"field name" does not have a valid value' '401': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid query payload error: value: error: name: invalid_query_payload message: Failed to validate query in JWT. /v1/withdraws/chance: get: operationId: available-withdrawal-information summary: Get Available Withdrawal Information description: Retrieves withdrawal availability information for the specified currency, including its withdrawal policy and user balance. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request GET \\\n --url 'https://sg-api.upbit.com/v1/withdraws/chance?currency=BTC&net_type=BTC' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/withdraws/chance\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"currency\": \"BTC\",\n \"net_type\": \"BTC\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/withdraws/chance\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n currency: \"BTC\",\n net_type: \"BTC\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}?${queryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class AvailableWithdraw {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/withdraws/chance\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"currency\", \"BTC\");\n params.put(\"net_type\", \"BTC\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: currency in: query required: true schema: type: string description: Currency code to query withdrawal availability for. example: BTC allowReserved: true examples: default: value: BTC - name: net_type in: query required: true schema: type: string description: 'Blockchain network identifier for digital asset withdrawal. Required for digital assets. ' example: BTC allowReserved: true examples: default: value: BTC responses: '200': description: Object of withdrawal policy content: application/json: schema: $ref: '#/components/schemas/WithdrawChance' examples: Successful Example: value: member_level: security_level: 4 fee_level: 0 email_verified: true identity_auth_verified: true bank_account_verified: true locked: false wallet_locked: false currency: code: BTC withdraw_fee: '0.0008' is_coin: true wallet_state: working wallet_support: - deposit - withdraw account: currency: BTC balance: '0.0' locked: '0.0' avg_buy_price: '145115000' avg_buy_price_modified: false unit_currency: SGD withdraw_limit: currency: BTC onetime: '50.0' remaining_daily: '0.0' remaining_daily_fiat: '1000000.0' fiat_currency: SGD minimum: '0.00001' fixed: 8 withdraw_delayed_fiat: '227.0' can_withdraw: true remaining_daily_sgd: '1000000.0' '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid enum error: value: error: name: validation_error message: '"field name" does not have a valid value' invalid parameter error: value: error: name: invalid_parameter message: Invalid parameter /v1/withdraws/coin: post: operationId: withdraw summary: Withdraw Digital Asset description: Requests a withdrawal of digital asset. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request POST \\\n --url 'https://sg-api.upbit.com/v1/withdraws/coin' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json' \\\n --header 'Content-Type: application/json' \\\n --data '\n{\n\"currency\": \"BTC\",\n\"net_type\": \"BTC\",\n\"amount\": \"0.01\",\n\"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\"\n}\n'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/withdraws/coin\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"currency\": \"BTC\",\n \"net_type\": \"BTC\",\n \"amount\": \"0.01\",\n \"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n}\n\nres = requests.post(f\"{BASE_URL}{PATH}\", headers=headers, json=params)\nprint(res.json())\n" - language: node code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/withdraws/coin\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n currency: \"BTC\",\n net_type: \"BTC\",\n amount: \"0.01\",\n address: \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"POST\",\n url: `${baseURL}${path}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n data: params,\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\nimport com.google.gson.Gson;\n\npublic class WithdrawCoin {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/withdraws/coin\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"currency\", \"BTC\");\n params.put(\"net_type\", \"BTC\");\n params.put(\"amount\", \"0.01\");\n params.put(\"address\", \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n String jsonBody = new Gson().toJson(params);\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH)\n .post(RequestBody.create(jsonBody, okhttp3.MediaType.parse(\"application/json; charset=utf-8\")))\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" requestBody: description: Digital asset withdrawal request. content: application/json: examples: default: value: currency: BTC net_type: BTC amount: '0.01' address: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa schema: type: object required: - currency - net_type - amount - address properties: currency: type: string description: Currency code of the digital asset to withdraw. example: BTC net_type: type: string description: 'Check the allowed withdrawal addresses API response to find the available "net_type" value for each address. ' example: BTC amount: type: string format: decimal description: 'Amount of the asset to withdraw. Must be a numeric string. ' example: '0.01' address: type: string description: 'Recipient address for digital asset withdrawal. Only addresses registered in the allowed withdrawal address list can be used. ' example: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa secondary_address: type: - string - 'null' description: 'Secondary withdrawal address (Destination Tag, Memo, or Message). If the recipient address includes a secondary address, this field must be included. ' transaction_type: type: string enum: - default - internal description: 'Withdrawal transaction type. * `default`: Standard withdrawal * `internal`: Internal (instant) withdrawal ' example: default default: default responses: '201': description: Object of digital asset withdrawal content: application/json: schema: $ref: '#/components/schemas/Withdraw' examples: Successful Example: value: type: withdraw uuid: 9f432943-54e0-40b7-825f-b6fec8b42b79 currency: BTC net_type: BTC txid: ebe6937b-130e-4066-8ac6-4b0e67f28adc state: PROCESSING created_at: '2018-04-13T11:24:01' amount: '0.01' fee: '0.0' sgd_amount: '80000.0' transaction_type: default is_cancelable: false '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalid enum error: value: error: name: validation_error message: '"field name" does not have a valid value' invalid parameter error: value: error: name: invalid_parameter message: Invalid parameter wrong address error: value: error: name: withdraw_address_not_registered message: The withdrawal address is not registered. delete: operationId: cancel-withdrawal summary: Cancel Withdrawal description: Cancel a completed digital asset withdrawal request by specifying the withdrawal UUID. tags: - Exchange x-readme: code-samples: - language: curl code: "curl --request DELETE \\\n --url 'https://sg-api.upbit.com/v1/withdraws/coin?uuid=9f432943-54e0-40b7-825f-b6fec8b42b79' \\\n --header 'Authorization: Bearer {JWT_TOKEN}' \\\n --header 'Accept: application/json'\n" - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport hashlib\nimport jwt\nimport requests\nfrom urllib.parse import unquote, urlencode\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/withdraws/coin\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\nparams = {\n \"uuid\": \"9f432943-54e0-40b7-825f-b6fec8b42b79\",\n}\n\nquery_string = unquote(urlencode(params, doseq=True)).encode(\"utf-8\")\n\nm = hashlib.sha512()\nm.update(query_string)\nquery_hash = m.hexdigest()\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n \"query_hash\": query_hash,\n \"query_hash_alg\": \"SHA512\",\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nprint(jwt_token)\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.delete(f\"{BASE_URL}{PATH}\", headers=headers, params=params)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst crypto = require(\"crypto\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/withdraws/coin\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst params = {\n uuid: \"9f432943-54e0-40b7-825f-b6fec8b42b79\",\n};\n\nconst queryString = new URLSearchParams(params).toString();\n\nconst queryHash = crypto\n .createHash(\"sha512\")\n .update(queryString, \"utf-8\")\n .digest(\"hex\");\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n query_hash: queryHash,\n query_hash_alg: \"SHA512\",\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"DELETE\",\n url: `${baseURL}${path}?${queryString}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class CancelWithdraw {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/withdraws/coin\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Map params = new HashMap<>();\n params.put(\"uuid\", \"9f432943-54e0-40b7-825f-b6fec8b42b79\");\n String queryString = params.entrySet().stream()\n .map(e -> e.getKey() + \"=\" + String.valueOf(e.getValue()))\n .collect(Collectors.joining(\"&\"));\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(queryString.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (byte b : md.digest()) {\n sb.append(String.format(\"%02x\", b));\n }\n String queryHash = sb.toString();\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .withClaim(\"query_hash\", queryHash)\n .withClaim(\"query_hash_alg\", \"SHA512\")\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH + \"?\" + queryString)\n .delete()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" parameters: - name: uuid in: query required: true schema: type: string description: UUID of the withdrawal to cancel. example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae allowReserved: true examples: default: value: 9f432943-54e0-40b7-825f-b6fec8b42b79 responses: '200': description: Object of canceled withdrawal content: application/json: schema: $ref: '#/components/schemas/Withdraw' examples: Successful Example: value: type: withdraw uuid: 9f432943-54e0-40b7-825f-b6fec8b42b79 currency: BTC net_type: BTC state: CANCELLED created_at: '2025-07-01T15:00:00' amount: '0.01' fee: '0.0' transaction_type: default is_cancelable: true '400': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: missing uuid error: value: error: name: validation_error message: '"field name" is missing' '404': description: error object content: application/json: schema: $ref: '#/components/schemas/Error' examples: not found withdraw error: value: error: name: withdraw_not_found message: Withdrawal information not found. /v1/withdraws/coin_addresses: get: operationId: list-withdrawal-addresses summary: List Withdrawal Allowed Addresses description: Retrieves the list of withdrawal whitelist addresses registered to the account. tags: - Exchange x-readme: code-samples: - language: curl code: 'curl --request GET \ --url ''https://sg-api.upbit.com/v1/withdraws/coin_addresses'' \ --header ''Authorization: Bearer {JWT_TOKEN}'' \ --header ''Accept: application/json'' ' - language: python install: pip install requests pyjwt python-dotenv code: "import os\nimport uuid\nimport jwt\nimport requests\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBASE_URL = \"https://sg-api.upbit.com\"\nPATH = \"/v1/withdraws/coin_addresses\"\n\nACCESS_KEY = os.environ[\"UPBIT_OPEN_API_ACCESS_KEY\"]\nSECRET_KEY = os.environ[\"UPBIT_OPEN_API_SECRET_KEY\"]\n\npayload = {\n \"access_key\": ACCESS_KEY,\n \"nonce\": str(uuid.uuid4()),\n}\n\njwt_token = jwt.encode(payload, SECRET_KEY, algorithm=\"HS256\")\n\nheaders = {\n \"Authorization\": f\"Bearer {jwt_token}\",\n \"Accept\": \"application/json\",\n}\n\nres = requests.get(f\"{BASE_URL}{PATH}\", headers=headers)\nprint(res.json())\n" - language: node name: Axios install: npm install axios jsonwebtoken uuid code: "const axios = require(\"axios\");\nconst { sign } = require(\"jsonwebtoken\");\nconst { v4: uuidv4 } = require(\"uuid\");\nrequire(\"dotenv\").config();\n\nconst baseURL = \"https://sg-api.upbit.com\";\nconst path = \"/v1/withdraws/coin_addresses\";\n\nconst ACCESS_KEY = process.env.UPBIT_OPEN_API_ACCESS_KEY;\nconst SECRET_KEY = process.env.UPBIT_OPEN_API_SECRET_KEY;\n\nconst payload = {\n access_key: ACCESS_KEY,\n nonce: uuidv4(),\n};\n\nconst jwtToken = sign(payload, SECRET_KEY);\n\nconst options = {\n method: \"GET\",\n url: `${baseURL}${path}`,\n headers: {\n Authorization: `Bearer ${jwtToken}`,\n Accept: \"application/json\",\n },\n};\n\naxios\n .request(options)\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.error(error.response ? error.response.data : error.message);\n });\n" - language: java code: "package main;\n\nimport com.auth0.jwt.JWT;\nimport com.auth0.jwt.algorithms.Algorithm;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.Objects;\nimport java.util.UUID;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.Response;\n\npublic class ListCoinAddresses {\n private static final String BASE_URL = \"https://sg-api.upbit.com\";\n private static final String PATH = \"/v1/withdraws/coin_addresses\";\n\n public static void main(String[] args) throws NoSuchAlgorithmException, IOException {\n String accessKey = System.getenv(\"UPBIT_OPEN_API_ACCESS_KEY\");\n String secretKey = System.getenv(\"UPBIT_OPEN_API_SECRET_KEY\");\n\n Algorithm algorithm = Algorithm.HMAC512(secretKey.getBytes(StandardCharsets.UTF_8));\n String jwtToken = JWT.create()\n .withClaim(\"access_key\", accessKey)\n .withClaim(\"nonce\", UUID.randomUUID().toString())\n .sign(algorithm);\n\n String authHeader = \"Bearer \" + jwtToken;\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(BASE_URL + PATH)\n .get()\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Authorization\", authHeader)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n System.out.println(response.code());\n System.out.println(Objects.requireNonNull(response.body()).string());\n }\n }\n}\n" responses: '200': description: List of withdrawal allowed addresses content: application/json: schema: type: array items: $ref: '#/components/schemas/WithdrawAddress' examples: 200 Successful Example: value: - currency: BTC net_type: BTC network_name: Bitcoin withdraw_address: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa beneficiary_name: John beneficiary_type: individual exchange_name: Binance - currency: ETH net_type: ETH network_name: Ethereum withdraw_address: '0x1234615148db0926d76bde31d420abcd5439484fd' beneficiary_name: John wallet_type: MetaMask components: schemas: BatchCancelResult: type: object required: - success - failed properties: success: description: Information about successfully cancelled orders. type: object required: - count - orders properties: count: type: integer description: Number of successfully cancelled orders. example: 5 orders: description: List of successfully cancelled orders. type: array items: type: object required: - uuid - market properties: uuid: type: string description: Unique identifier of the order. example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae market: type: string description: 'Trading pair code. ' example: SGD-BTC identifier: type: string description: 'Client-assigned order identifier. * Only available for orders created after October 18, 2024. ' example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae failed: description: Information about orders that failed to cancel. type: object required: - count - orders properties: count: type: integer description: Number of orders that failed to cancel. example: 5 orders: description: List of orders that failed to cancel. type: array items: type: object required: - uuid - market properties: uuid: type: string description: Unique identifier of the order. example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae market: type: string description: 'Trading pair code. ' example: SGD-BTC identifier: type: string description: 'Client-assigned order identifier. * Only available for orders created after October 18, 2024. ' example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae ClosedOrderState: type: string enum: - done - cancel description: 'Closed order state. * `done`: Fully executed * `cancel`: Cancelled ' OrderChance: type: object required: - bid_fee - ask_fee - maker_bid_fee - maker_ask_fee - market - bid_account - ask_account properties: bid_fee: type: string format: decimal description: Fee rate applied when placing a buy order. example: 0.0005 ask_fee: type: string format: decimal description: Fee rate applied when placing a sell order. example: 0.0005 maker_bid_fee: type: string format: decimal description: Maker fee rate for buy orders. example: 0.0005 maker_ask_fee: type: string format: decimal description: Maker fee rate for sell orders. example: 0.0005 market: type: object required: - id - name - order_types - order_sides - bid_types - ask_types - bid - ask - max_total - state properties: id: type: string description: 'Trading pair code. ' example: SGD-BTC name: type: string description: 'Trading pair name (base asset / quote currency). ' example: BTC/SGD order_types: type: array deprecated: true description: Supported order types (deprecated). enum: - limit - price - market - best items: type: string example: - limit - market order_sides: type: array description: Supported order sides. enum: - ask - bid items: type: string example: - ask - bid bid_types: type: array description: 'Supported buy order types. [Example] ["limit", "price", "best_fok", ...] ' enum: - best_fok - best_ioc - limit - limit_fok - limit_ioc - price items: type: string example: - best_fok - limit ask_types: type: array description: 'Supported sell order types. [Example] ["market", "limit", "best_fok", ...] ' enum: - best_fok - best_ioc - limit - limit_fok - limit_ioc - market items: type: string example: - market - limit_ioc bid: description: Buy order constraints. type: object required: - currency - min_total properties: currency: type: string description: Quote currency used to purchase digital assets (SGD, BTC, USDT). example: SGD price_unit: type: number format: double deprecated: true description: Order price unit. This field is deprecated and should not be referenced. example: 1.0e-08 min_total: type: string format: decimal description: 'Minimum order amount for buy orders (in quote currency). ' example: '5000' ask: description: Sell order constraints. type: object required: - currency - min_total properties: currency: type: string description: 'Currency of the asset being sold. [Example] "BTC", "ETH" ' example: BTC price_unit: type: number format: double deprecated: true description: Order price unit. This field is deprecated and should not be referenced. example: 1.0e-08 min_total: type: string format: decimal description: 'Minimum order amount for sell orders (in quote currency). ' example: '5000' max_total: type: string description: Maximum order amount. example: '1000000000' state: type: string enum: - active description: Market operation state. example: active default: active bid_account: description: Quote asset account information. type: object required: - currency - balance - locked - avg_buy_price - avg_buy_price_modified properties: currency: type: string description: Currency code to be queried. example: SGD balance: type: string format: decimal description: 'Available amount or volume for orders. ' example: 1000000 locked: type: string format: decimal description: Amount or quantity locked by pending orders or withdrawals. example: 0 avg_buy_price: type: string format: decimal description: Average buy price of the asset. example: 0 avg_buy_price_modified: type: boolean description: Indicates whether the average buy price has been modified. example: false unit_currency: type: string description: 'Currency unit used as the basis for avg_buy_price. ' example: SGD ask_account: description: Base asset account information. type: object required: - currency - balance - locked - avg_buy_price - avg_buy_price_modified properties: currency: type: string description: Currency code to be queried. example: BTC balance: type: string format: decimal description: 'Available amount or volume for orders. ' example: 1000000 locked: type: string format: decimal description: Amount or quantity locked by pending orders or withdrawals. example: 0 avg_buy_price: type: string format: decimal description: Average buy price of the asset. example: 0 avg_buy_price_modified: type: boolean description: Indicates whether the average buy price has been modified. example: false unit_currency: type: string description: 'Currency unit used as the basis for avg_buy_price. ' example: SGD Withdraw: type: object required: - type - uuid - currency - net_type - txid - state - created_at - amount - fee - transaction_type - is_cancelable properties: type: type: string description: Transaction type. example: withdraw default: withdraw uuid: type: string description: Unique identifier of the withdrawal. example: 9f432943-54e0-40b7-825f-b6fec8b42b79 currency: type: string description: Currency code to be queried. example: BTC net_type: type: - string - 'null' description: 'Withdrawal network type. Blockchain network identifier used by Upbit. [Example] "ETH", "TRX", "SOL" ' example: BTC txid: type: - string - 'null' description: Transaction ID. example: 1234567890 state: type: string enum: - WAITING - PROCESSING - DONE - FAILED - CANCELLED - REJECTED description: "Withdrawal processing state.\n - `WAITING`: Waiting\n - `PROCESSING`: Processing\n - `DONE`: Completed\n - `FAILED`: Failed\n - `CANCELLED`: Cancelled\n - `REJECTED`: Rejected\n" example: WAITING created_at: type: string description: Timestamp when the withdrawal was created. example: '2024-01-01T00:00:00' done_at: type: - string - 'null' description: Timestamp when the withdrawal was completed. Returns null if not yet completed. example: '2024-01-01T00:00:00' amount: type: string format: decimal description: Amount of the asset to withdraw. example: '0.01' fee: type: string format: decimal description: Withdrawal fee. example: 0 transaction_type: type: string enum: - default - internal description: 'Withdrawal transaction type. * `default`: Standard withdrawal * `internal`: Internal (instant) withdrawal ' example: default default: default is_cancelable: type: - boolean - 'null' description: Whether the withdrawal can be cancelled. example: false TravelRuleVerificationResult: type: object required: - deposit_uuid - verification_result - deposit_state properties: deposit_uuid: type: string description: Unique identifier (UUID) for the deposit to verify. example: 5b871d34-fe38-4025-8f5c-9b22028f85d3 deposit_state: type: string enum: - PROCESSING - ACCEPTED - CANCELLED - REJECTED - TRAVEL_RULE_SUSPECTED - REFUNDING - REFUNDED description: "Deposit status.\n - `PROCESSING`: Deposit in progress (digital asset only)\n - `ACCEPTED`: Completed\n - `CANCELLED`: Cancelled\n - `REJECTED`: Rejected\n - `TRAVEL_RULE_SUSPECTED`: Awaiting additional Travel Rule verification (digital assets only)\n - `REFUNDING`: Refund in progress\n - `REFUNDED`: Refunded (digital asset only)\n" example: PROCESSING verification_result: type: string description: Result of the account verification process. example: verified OrdTypeEnum: type: string enum: - limit - price - market - best description: 'Order type. * `limit`: Limit order * `price`: Market buy order (by total price) * `market`: Market sell order (by volume) * `best`: Best available price order ' Account: type: object required: - currency - balance - locked - avg_buy_price - avg_buy_price_modified - unit_currency properties: currency: type: string description: Currency code to be queried. example: BTC balance: type: string format: decimal description: 'Available amount or volume for orders. For digital assets, this represents the available quantity. For fiat currency, this represents the available amount. ' example: 1000000 locked: type: string format: decimal description: Amount or quantity locked by pending orders or withdrawals. example: 0 avg_buy_price: type: string format: decimal description: Average buy price of the asset. example: 0 avg_buy_price_modified: type: boolean description: Indicates whether the average buy price has been modified. example: false unit_currency: type: string description: 'Currency unit used as the basis for avg_buy_price. ' example: SGD WithdrawChance: type: object required: - member_level - currency - account - withdraw_limit properties: member_level: description: User security level information. type: object required: - security_level - fee_level - email_verified - identity_auth_verified - bank_account_verified - two_factor_auth_verified - locked - wallet_locked properties: security_level: type: integer description: Security level. example: 4 fee_level: type: integer description: Fee level. example: 0 email_verified: type: boolean description: Whether email is verified. example: true identity_auth_verified: type: boolean description: Whether identity is verified. example: true bank_account_verified: type: boolean description: Whether bank account is verified. example: true two_factor_auth_verified: type: boolean description: Whether two-factor authentication is enabled. example: true locked: type: boolean description: Whether the account is locked. example: false wallet_locked: type: boolean description: Whether the wallet (withdrawal) is locked. example: false currency: description: Currency information. type: object required: - code - withdraw_fee - is_coin - wallet_state - wallet_support properties: code: type: string description: Currency code. example: BTC withdraw_fee: type: string format: decimal description: Withdrawal fee. example: 0 is_coin: type: boolean description: Whether this is a digital asset. example: true wallet_state: type: string enum: - working - unsupported description: "Whether deposit/withdrawal has been supported for this asset.\n - `working`: Has been supported\n - `unsupported`: Never supported\n" example: working wallet_support: description: Current deposit/withdrawal availability. 'deposit' if deposits are available, 'withdraw' if withdrawals are available. Empty list means neither is available. type: array enum: - deposit - withdraw items: type: string example: - deposit - withdraw account: description: Asset balance information. type: object required: - currency - balance - locked - avg_buy_price - avg_buy_price_modified - unit_currency properties: currency: type: string description: Currency code to be queried. example: BTC balance: type: string format: decimal description: Available amount or volume for orders. example: 1000000 locked: type: string format: decimal description: Amount or quantity locked by pending orders or withdrawals. example: 0 avg_buy_price: type: string format: decimal description: Average buy price of the asset. example: 0 avg_buy_price_modified: type: boolean description: Indicates whether the average buy price has been modified. example: false unit_currency: type: string description: Currency unit used as the basis for avg_buy_price. example: SGD withdraw_limit: description: Withdrawal limit information. type: object required: - currency - onetime - daily - remaining_daily - remaining_daily_fiat - fiat_currency properties: currency: type: string description: Currency code to be queried. example: BTC onetime: type: string deprecated: true format: decimal description: One-time withdrawal limit (deprecated). example: 0.4 daily: type: - string - 'null' deprecated: true format: decimal description: Daily withdrawal limit (deprecated). example: 500000000 remaining_daily: type: string deprecated: true format: decimal description: Remaining daily withdrawal limit (deprecated). example: 0 remaining_daily_fiat: type: string format: decimal description: Integrated remaining daily withdrawal limit (in fiat currency). example: 5000000000 fiat_currency: type: string description: Reference fiat currency. example: SGD minimum: type: string format: decimal description: Minimum withdrawal amount or volume. example: 300000 fixed: type: integer description: Decimal precision for withdrawal amount/volume. example: 6 withdraw_delayed_fiat: type: string format: decimal description: Amount restricted due to the withdrawal delay policy. example: 0 can_withdraw: type: boolean description: 'Whether withdrawal is currently supported. * To check current availability, refer to currency.wallet_support for the ''withdraw'' value. ' example: true SideEnum: type: string enum: - ask - bid description: Order direction (ask=sell, bid=buy) OpenOrderState: type: string enum: - wait - watch description: 'Open order state. * `wait`: Pending execution * `watch`: Pending reservation (stop order) ' GenerateCoinAddressResponse: type: object required: - success - message properties: success: type: boolean description: Whether the deposit address creation request was accepted. example: true default: true message: type: string description: Message about the deposit address creation request. example: BTC 입금 주소를 생성 중 입니다. WalletStatus: type: object required: - currency - wallet_state - block_elapsed_minutes - net_type - network_name properties: currency: type: string description: Currency code to be queried. example: BTC wallet_state: type: string enum: - working - withdraw_only - deposit_only - paused - unsupported description: "Deposit/withdrawal status.\n - `working`: Both available\n - `withdraw_only`: Withdrawal only\n - `deposit_only`: Deposit only\n - `paused`: Both suspended\n - `unsupported`: Not supported\n" example: working block_state: type: string enum: - normal - delayed - inactive description: "Blockchain network state. May return null depending on wallet or exchange status.\n - `normal`: Normal\n - `delayed`: Delayed\n - `inactive`: Inactive\n" example: normal block_height: type: integer description: Current confirmed block height. May return null. example: 902656 block_updated_at: type: string description: 'Timestamp when the block height was last updated (UTC). May return null. [Format] yyyy-MM-dd''T''HH:mm:sss+00:00 ' example: 2024-01-01T00:00:000+00:00 block_elapsed_minutes: type: integer description: 'Minutes elapsed since the last block update. May return null. ' example: 31 net_type: type: string description: 'Deposit/withdrawal network type. Blockchain network identifier used by Upbit. [Example] "ETH", "TRX", "SOL" ' example: BTC network_name: type: string description: 'Deposit/withdrawal network name displayed to users. [Example] "Ethereum", "Bitcoin", "Tron", "Solana" ' example: Bitcoin Order: type: object required: - market - uuid - side - ord_type - state - created_at - remaining_volume - executed_volume - reserved_fee - remaining_fee - paid_fee - locked - trades_count - prevented_volume - prevented_locked properties: market: type: string description: 'Trading pair code. ' example: SGD-BTC uuid: type: string description: Unique identifier of the order. example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae side: type: string enum: - ask - bid description: Order direction (ask=sell, bid=buy). example: ask ord_type: type: string enum: - limit - price - market - best description: Order type. example: limit price: type: string format: decimal description: 'Order price or total amount. For limit orders, this is the unit price. For market buy orders, this is the total buy amount. ' example: 1000 state: type: string enum: - wait - watch - done - cancel description: 'Order state. - `wait`: Pending execution - `watch`: Waiting for reservation order - `done`: Fully executed - `cancel`: Cancelled ' example: wait created_at: type: string description: 'Timestamp when the order was created. [Format] yyyy-MM-ddTHH:mm:ss+00:00 ' example: '2025-06-25T15:42:25+09:00' volume: type: string format: decimal description: Requested order volume. example: 10 remaining_volume: type: string format: decimal description: Remaining volume after execution. example: 8 executed_volume: type: string format: decimal description: Executed volume. example: 2 reserved_fee: type: string format: decimal description: Fee reserved for this order. example: 5 remaining_fee: type: string format: decimal description: Remaining fee. example: 5 paid_fee: type: string format: decimal description: Fee paid so far. example: 0 locked: type: string format: decimal description: Amount locked for this order. example: 0 trades_count: type: integer description: Number of trades executed for this order. example: 1 time_in_force: type: string enum: - fok - ioc - post_only description: Time in force condition. example: ioc identifier: type: string description: 'Client-assigned order identifier specified at order creation. * The identifier field is only available for orders created after October 18, 2024. ' example: 9ca023a5-851b-4fec-9f0a-48cd83c2eaae smp_type: type: string enum: - reduce - cancel_maker - cancel_taker description: Self-Match Prevention (SMP) mode. example: cancel_maker prevented_volume: type: string format: decimal description: 'Volume cancelled due to Self-Match Prevention. ' example: 2 prevented_locked: type: string format: decimal description: "Asset unlocked due to Self-Match Prevention cancellation.\n - For buy orders: cancelled amount\n - For sell orders: cancelled volume\n" example: 2000 trades: type: array description: List of trades executed for this order (returned in individual order query). items: type: object properties: market: type: string description: Trading pair code. example: SGD-BTC uuid: type: string description: Unique identifier of the trade. example: 795dff29-bba6-49b2-baab-63473ab7931c price: type: string format: decimal description: Trade price. example: '1375' volume: type: string format: decimal description: Trade volume. example: '5.377594' funds: type: string format: decimal description: Trade funds (price × volume). example: '7394.19175' trend: type: string description: Price trend of the trade. example: down created_at: type: string description: Timestamp of the trade. example: '2025-08-09T16:44:00.597751+09:00' side: type: string description: Order side of the trade. example: ask WithdrawAddress: type: object required: - currency - net_type - network_name - withdraw_address properties: currency: type: string description: Currency code of the digital asset to withdraw. example: BTC net_type: type: string description: 'Withdrawal network type. Blockchain network identifier used by Upbit. The `net_type` parameter in withdrawal requests must match this value. [Example] "ETH", "TRX", "SOL" ' example: BTC network_name: type: string description: 'Withdrawal network name displayed to users. [Example] "Ethereum", "Bitcoin", "Tron", "Solana" ' example: Bitcoin withdraw_address: type: string description: 'Recipient address for digital asset withdrawal. Only addresses registered in the allowed withdrawal address list can be used. ' example: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa secondary_address: type: - string - 'null' description: 'Secondary withdrawal address (Destination Tag, Memo, or Message). Some digital assets require a secondary address along with the primary address. ' beneficiary_name: type: string description: 'Name of the wallet owner. Name of the individual or corporate representative receiving the withdrawn assets. Returned only for exchange wallets; null for personal wallets. ' beneficiary_company_name: type: - string - 'null' description: Company name of the entity receiving the withdrawn assets. beneficiary_type: type: - string - 'null' description: "Account holder type.\n - `individual`: Personal wallet\n - `corporate`: Corporate wallet\n" exchange_name: type: - string - 'null' description: 'Name of the exchange where the withdrawal address is registered. [Example] "Binance", "Bybit" ' wallet_type: type: - string - 'null' description: 'Personal wallet type. [Example] "MetaMask" ' Deposit: type: object required: - type - uuid - currency - txid - state - created_at - done_at - amount - fee - transaction_type properties: type: type: string description: Transaction type. example: deposit default: deposit uuid: type: string description: Unique identifier (UUID) of the deposit. example: 5b871d34-fe38-4025-8f5c-9b22028f85d3 currency: type: string description: Currency code of the deposit. example: SGD net_type: type: - string - 'null' description: 'Deposit network type. Returns null for fiat currency deposits. [Example] ETH, TRX, SOL ' example: BTC txid: type: string description: Deposit transaction ID. example: 5BC9E3CD3EFCAB866060C5A61A98E6079B4A49BCCFCBF7D220F903F67D1C76C4 state: type: string enum: - PROCESSING - ACCEPTED - CANCELLED - REJECTED - TRAVEL_RULE_SUSPECTED - REFUNDING - REFUNDED description: "Deposit status.\n - `PROCESSING`: Deposit in progress (digital asset only)\n - `ACCEPTED`: Completed\n - `CANCELLED`: Cancelled\n - `REJECTED`: Rejected\n - `TRAVEL_RULE_SUSPECTED`: Awaiting additional Travel Rule verification (digital assets only)\n - `REFUNDING`: Refund in progress\n - `REFUNDED`: Refunded (digital asset only)\n" example: ACCEPTED created_at: type: string description: 'Timestamp when the deposit was requested. [Format] yyyy-MM-ddTHH:mm:ss+00:00 ' example: '2024-01-01T00:00:00' done_at: type: - string - 'null' description: 'Timestamp when the deposit was completed. [Format] yyyy-MM-ddTHH:mm:ss+00:00 ' example: '2024-01-01T00:00:00' amount: type: string format: decimal description: Deposit amount. example: '10000' fee: type: string format: decimal description: Deposit fee. example: 0 transaction_type: type: string enum: - default - internal description: "Deposit transaction type.\n - `default`: Standard deposit\n - `internal`: Internal deposit (between Upbit accounts)\n" example: default default: default TimeInForceEnum: type: string enum: - fok - ioc - post_only description: 'Time in force condition. * `fok`: Fill or Kill * `ioc`: Immediate or Cancel * `post_only`: Post only (maker only) ' DepositChance: type: object required: - currency - net_type - is_deposit_possible - deposit_impossible_reason - minimum_deposit_amount - minimum_deposit_confirmations - decimal_precision properties: currency: type: string description: Currency code to be queried. example: BTC net_type: type: - string - 'null' description: 'Deposit network type. Blockchain network identifier used by Upbit. [Example] ETH, TRX, SOL ' example: BTC is_deposit_possible: type: boolean description: Whether deposits are currently possible. example: true deposit_impossible_reason: type: string description: 'Reason why deposits are not possible. ※ Provided when "is_deposit_possible" is "false". ' example: Network upgrade in progress minimum_deposit_amount: type: string format: decimal description: Minimum deposit amount. example: 0 minimum_deposit_confirmations: type: integer description: 'Minimum number of blockchain confirmations required for the deposit to be credited. ' example: 1 decimal_precision: type: integer description: Decimal precision applied to deposits. example: 6 TravelRuleVasp: type: object required: - vasp_name - vasp_uuid - depositable - withdrawable properties: vasp_name: type: string description: 'Exchange name. Name of the VASP (Virtual Asset Service Provider). ' example: Upbit vasp_uuid: type: string description: 'Unique identifier (UUID) of the exchange. Uniquely assigned VASP identifier for the transfer. ' example: 8d4fe968-82b2-42e5-822f-3840a245f802 depositable: type: boolean description: Indicates whether deposits are available from the VASP. example: true withdrawable: type: boolean description: Indicates whether withdrawals are available to the VASP. example: true DepositAddress: type: object required: - currency - net_type - deposit_address properties: currency: type: string description: Currency code for which the deposit address was created. example: BTC net_type: type: - string - 'null' description: 'Deposit network type. Blockchain network identifier used by Upbit. [Example] ETH, TRX, SOL ' example: BTC deposit_address: type: string description: Deposit address. example: 3GXAGnqLWpZWiChDU2AsJBaVxpnPiLBaxU secondary_address: type: - string - 'null' description: 'Secondary deposit address (Destination Tag, Memo, or Message). ' CreateDepositAddressResponse: oneOf: - $ref: '#/components/schemas/DepositAddress' - $ref: '#/components/schemas/GenerateCoinAddressResponse' SmpTypeEnum: type: string enum: - cancel_maker - cancel_taker - reduce description: 'Self-Match Prevention (SMP) mode. * `cancel_maker`: Cancel maker order * `cancel_taker`: Cancel taker order * `reduce`: Reduce order quantity ' Error: type: object properties: error: type: object required: - name - message properties: name: type: string description: Error name. message: type: string description: Error message. x-provenance: method: searched source: https://global-docs.upbit.com/reference harvested: '2026-10-14' tool: harvest-readme-openapi.py note: Assembled verbatim from the OpenAPI definition ReadMe embeds in each operation page of the provider's developer portal; paths and components merged by API title, nothing authored. assembled_from: - https://global-docs.upbit.com/reference/available-deposit-information.md - https://global-docs.upbit.com/reference/available-order-information.md - https://global-docs.upbit.com/reference/available-withdrawal-information.md - https://global-docs.upbit.com/reference/batch-cancel-orders.md - https://global-docs.upbit.com/reference/cancel-and-new-order.md - https://global-docs.upbit.com/reference/cancel-order.md - https://global-docs.upbit.com/reference/cancel-orders-by-ids.md - https://global-docs.upbit.com/reference/cancel-withdrawal.md - https://global-docs.upbit.com/reference/create-deposit-address.md - https://global-docs.upbit.com/reference/get-balance.md - https://global-docs.upbit.com/reference/get-deposit-address.md - https://global-docs.upbit.com/reference/get-deposit.md - https://global-docs.upbit.com/reference/get-order.md - https://global-docs.upbit.com/reference/get-service-status.md - https://global-docs.upbit.com/reference/get-withdrawal.md - https://global-docs.upbit.com/reference/list-closed-orders.md - https://global-docs.upbit.com/reference/list-deposit-addresses.md - https://global-docs.upbit.com/reference/list-deposits.md - https://global-docs.upbit.com/reference/list-open-orders.md - https://global-docs.upbit.com/reference/list-orders-by-ids.md - https://global-docs.upbit.com/reference/list-travelrule-vasps.md - https://global-docs.upbit.com/reference/list-withdrawal-addresses.md - https://global-docs.upbit.com/reference/list-withdrawals.md - https://global-docs.upbit.com/reference/new-order.md - https://global-docs.upbit.com/reference/order-test.md - https://global-docs.upbit.com/reference/verify-travelrule-by-txid.md - https://global-docs.upbit.com/reference/verify-travelrule-by-uuid.md - https://global-docs.upbit.com/reference/withdraw.md merge: pages: 28 deduped: 45 conflicts_kept_first: 0