Skip to main content

New Order V1

Endpoint

POST /new-order

Parameters

ParameterTypeRequiredDescription
symbolstringYesSymbol name (e.g., BTC_USDT).
actionint32YesOrder Action.
order_typeint32YesOrder Type.
pricestringOptional (send "" if null)Price of the order. Required for LIMIT 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/new-order' \
--header 'session-token: xxx' \
--data '{
"symbol": "BTC_USDT",
"action": 0,
"order_type": 1,
"price": "",
"size": "0.1",
"budget": ""
}'

Response Example

{
"orderId": "3609592669673907047"
}