Skip to content

Latest commit

 

History

History
487 lines (326 loc) · 15 KB

File metadata and controls

487 lines (326 loc) · 15 KB

OTCApi

All URIs are relative to https://api.gateio.ws/api/v4

Method HTTP request Description
createOtcQuote POST /otc/quote Fiat and stablecoin quote
createOtcOrder POST /otc/order/create Create fiat order
createStableCoinOrder POST /otc/stable_coin/order/create Create stablecoin order
getUserDefaultBank GET /otc/get_user_def_bank Get user's default bank account information
getBankList GET /otc/bank_list Get user bank card list
markOtcOrderPaid POST /otc/order/paid Mark fiat order as paid
cancelOtcOrder POST /otc/order/cancel Fiat order cancellation
listOtcOrders GET /otc/order/list Fiat order list
listStableCoinOrders GET /otc/stable_coin/order/list Stablecoin order list
getOtcOrderDetail GET /otc/order/detail Fiat order details

createOtcQuote

Promise<{ response: http.IncomingMessage; body: OtcQuoteResponse; }> createOtcQuote(otcQuoteRequest)

Fiat and stablecoin quote

Create fiat and stablecoin quotes, supporting both PAY and GET directions

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.OTCApi(client);
const otcQuoteRequest = new OtcQuoteRequest(); // OtcQuoteRequest | 
api.createOtcQuote(otcQuoteRequest)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
otcQuoteRequest OtcQuoteRequest

Return type

Promise<{ response: AxiosResponse; body: OtcQuoteResponse; }> OtcQuoteResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createOtcOrder

Promise<{ response: http.IncomingMessage; body: OtcActionResponse; }> createOtcOrder(otcOrderRequest)

Create fiat order

Create a fiat order, supporting BUY for on-ramp and SELL for off-ramp

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.OTCApi(client);
const otcOrderRequest = new OtcOrderRequest(); // OtcOrderRequest | 
api.createOtcOrder(otcOrderRequest)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
otcOrderRequest OtcOrderRequest

Return type

Promise<{ response: AxiosResponse; body: OtcActionResponse; }> OtcActionResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createStableCoinOrder

Promise<{ response: http.IncomingMessage; body: OtcStableCoinOrderCreateResponse; }> createStableCoinOrder(otcStableCoinOrderRequest)

Create stablecoin order

Create stablecoin order

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.OTCApi(client);
const otcStableCoinOrderRequest = new OtcStableCoinOrderRequest(); // OtcStableCoinOrderRequest | 
api.createStableCoinOrder(otcStableCoinOrderRequest)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
otcStableCoinOrderRequest OtcStableCoinOrderRequest

Return type

Promise<{ response: AxiosResponse; body: OtcStableCoinOrderCreateResponse; }> OtcStableCoinOrderCreateResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getUserDefaultBank

Promise<{ response: http.IncomingMessage; body: OtcUserDefaultBankResponse; }> getUserDefaultBank()

Get user&#39;s default bank account information

Get user&#39;s default bank account information for order placement

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.OTCApi(client);
api.getUserDefaultBank()
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

This endpoint does not need any parameter.

Return type

Promise<{ response: AxiosResponse; body: OtcUserDefaultBankResponse; }> OtcUserDefaultBankResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getBankList

Promise<{ response: http.IncomingMessage; body: OtcBankListResponse; }> getBankList()

Get user bank card list

Get user bank card list for selecting bank card when placing orders

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.OTCApi(client);
api.getBankList()
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

This endpoint does not need any parameter.

Return type

Promise<{ response: AxiosResponse; body: OtcBankListResponse; }> OtcBankListResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

markOtcOrderPaid

Promise<{ response: http.IncomingMessage; body: OtcActionResponse; }> markOtcOrderPaid(otcMarkOrderPaidRequest)

Mark fiat order as paid

Mark fiat order as paid

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.OTCApi(client);
const otcMarkOrderPaidRequest = new OtcMarkOrderPaidRequest(); // OtcMarkOrderPaidRequest | 
api.markOtcOrderPaid(otcMarkOrderPaidRequest)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
otcMarkOrderPaidRequest OtcMarkOrderPaidRequest

Return type

Promise<{ response: AxiosResponse; body: OtcActionResponse; }> OtcActionResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

cancelOtcOrder

Promise<{ response: http.IncomingMessage; body: OtcActionResponse; }> cancelOtcOrder(orderId)

Fiat order cancellation

Cancel fiat order

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.OTCApi(client);
const orderId = "orderId_example"; // string | Order ID
api.cancelOtcOrder(orderId)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
orderId string Order ID [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: OtcActionResponse; }> OtcActionResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listOtcOrders

Promise<{ response: http.IncomingMessage; body: OtcOrderListResponse; }> listOtcOrders(opts)

Fiat order list

Query the fiat order list with filters such as type, currency, time range, and status

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.OTCApi(client);
const opts = {
  'type': "type_example", // string | BUY for on-ramp, SELL for off-ramp
  'fiatCurrency': "fiatCurrency_example", // string | Fiat currency
  'cryptoCurrency': "cryptoCurrency_example", // string | Digital currency
  'startTime': "startTime_example", // string | starttime   for example : 2025-09-09
  'endTime': "endTime_example", // string | endtime  for example :2025-09-09
  'status': "status_example", // string | DONE: Completed CANCEL: Canceled PROCESSING: In Progress
  'pn': "pn_example", // string | Page number
  'ps': "ps_example" // string | Number of items per page
};
api.listOtcOrders(opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
type string BUY for on-ramp, SELL for off-ramp [optional] [default to undefined]
fiatCurrency string Fiat currency [optional] [default to undefined]
cryptoCurrency string Digital currency [optional] [default to undefined]
startTime string starttime for example : 2025-09-09 [optional] [default to undefined]
endTime string endtime for example :2025-09-09 [optional] [default to undefined]
status string DONE: Completed CANCEL: Canceled PROCESSING: In Progress [optional] [default to undefined]
pn string Page number [optional] [default to undefined]
ps string Number of items per page [optional] [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: OtcOrderListResponse; }> OtcOrderListResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listStableCoinOrders

Promise<{ response: http.IncomingMessage; body: OtcStableCoinOrderListResponse; }> listStableCoinOrders(opts)

Stablecoin order list

Query stablecoin order list with filtering by currency, time range, status, etc.

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.OTCApi(client);
const opts = {
  'pageSize': "10", // string | Number of records per page
  'pageNumber': "1", // string | Page number
  'coinName': "USDT", // string | ordercurrency
  'startTime': "startTime_example", // string | Start Time
  'endTime': "endTime_example", // string | End time
  'status': "status_example" // string | Status: PROCESSING: in progress / DONE:completed / FAILED: failed
};
api.listStableCoinOrders(opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
pageSize string Number of records per page [optional] [default to undefined]
pageNumber string Page number [optional] [default to undefined]
coinName string ordercurrency [optional] [default to undefined]
startTime string Start Time [optional] [default to undefined]
endTime string End time [optional] [default to undefined]
status string Status: PROCESSING: in progress / DONE:completed / FAILED: failed [optional] [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: OtcStableCoinOrderListResponse; }> OtcStableCoinOrderListResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getOtcOrderDetail

Promise<{ response: http.IncomingMessage; body: OtcOrderDetailResponse; }> getOtcOrderDetail(orderId)

Fiat order details

Query fiat order details

Example

const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");

const api = new GateApi.OTCApi(client);
const orderId = "orderId_example"; // string | Order ID
api.getOtcOrderDetail(orderId)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
orderId string Order ID [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: OtcOrderDetailResponse; }> OtcOrderDetailResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json