Skip to main content

New Order V2

Endpoint

POST /v2/new-order

Parameters

ParameterTypeRequiredDescription
symbolstringYesSymbol name (e.g., BTC_USDT).
actionint32YesOrder Action.
order_typeint32YesOrder Type.
limit_pricestringOptional (send "" if null)Price of the order. Required for LIMIT, POST_ONLY, LIMIT_IOC, STOP_LIMIT, and the LIMIT leg of OCO orders. The number of decimal places must be less than or equal to the field k as defined in the API Symbol Configs.
stop_pricestringOptional (send "" if null)Stop trigger price. Required for STOP_MARKET, STOP_LIMIT, and the STOP_LIMIT leg of OCO orders . The number of decimal places must be less than or equal to the field k as defined in the API Symbol Configs.
stop_limit_pricestringOptional (send "" if null)Limit price of the STOP LIMIT leg in an OCO order. Only used in OCO orders. The number of decimal places must be less than or equal to the field k as defined in the API Symbol Configs.
sizestringOptional (send "" if null)Amount of the base currency (e.g., BTC in BTC/USDT). Required for SELL orders. The number of decimal places must be less than or equal to the field m as defined in the API Symbol Configs.
budgetstringOptional (send "" if null)Amount of the quote currency (e.g., USDT in BTC/USDT). Required for BUY orders. The number of decimal places must be less than or equal to the field c as defined in the API Symbol Configs.

Headers

HeaderTypeRequiredDescription
session-tokenstringYesAuthorization token.
api-keystringYesAPI key for user authentication.

Note: You must provide either session-token or api-key in the headers for authentication.

Request Rules

Market Order

  • BUY:
    • Required: budget
    • Optional: size
      • Without size: Match up to budget or until orderbook is exhausted.
      • With size: Match up to budget or size, or until orderbook is exhausted.
  • SELL:
    • Required: size
    • Optional: budget
      • Without budget: Match up to size or until orderbook is exhausted.
      • With budget: Match up to size or budget, or until orderbook is exhausted.

Other Orders

  • Required: price, size
  • Ignored: budget

Response

JSON Object


Response Fields

FieldTypeDescription
orderIdstringThe ID of the created order.

Example Usage

curl --location 'https://spot-markets.goonus.io/v2/new-order' \
--header 'session-token: xxx' \
--data '{
"symbol": "BTC_USDT",
"action": 1,
"order_type": 4,
"limit_price": "100",
"size": "1",
"budget": "",
"stop_price": "100",
"stop_limit_price": "100"
}'

Response Example

{
"orderId": "3609592669673907047"
}