Spot · Trading

Place a spot order

Changed on

Buy or sell, limit or market — isMarket decides, and a market order ignores price. Send a clientOrderId for anything automated: it makes a retry after a lost response adopt the order that already exists instead of placing a second one.

This version answers with the order id as PLAIN TEXT and reports a rejection as HTTP 400. The v200 route is the same operation wrapped in a JSON result envelope.

post/api/orders

Request

  • Base URL
    https://api.binibit.com
  • URL
    https://api.binibit.com/api/orders
  • Auth
    none declared

Headers

Your API key, verbatim. Create one at https://azbit.com/dashboard/settings/api-settings.

Signature of THIS request — lower-case hex of HMAC-SHA256 over publicKey + fullUrl + body, keyed with your private key. It changes with every request, so it cannot be set once and reused. Full algorithm and code samples are at the top of this page.

Request body

sidestring nullable

"buy" or "sell"

currencyPairCodestring required

Currency pair for order

amountnumber double

Amount in base currency

pricenumber double

Price specifies how much of QuoteCurrency you want to exchange for 1 unit of BaseCurrency

clientOrderIdstring nullable

Optional client-assigned order id, up to 36 characters of [A-Za-z0-9._-]. Echoed back on this order everywhere it appears, filterable on /api/user/orders, and — the point of it — reserved for 48 hours for your account.

Resending the same id inside that window SUCCEEDS and answers with the id of the order that already exists; a second order is never created. That is the contract a retry after a lost response is built on: repeat the request unchanged and you get back the order you may or may not have placed. The order id is derived deterministically from (your user id, clientOrderId), which is what makes the retry land on the same order. A repeat amends nothing: the price and amount you resend are ignored and the original order comes back untouched, fills included. Use a fresh id for a new order.

postOnlyboolean

Maker-only. An order that would take liquidity on arrival is rejected instead of executed, so a quote can never cross the book. Ignored for market orders.

selfTradePreventioninteger

What to do when this order would trade against another order of the same account: 0 = match (default, unchanged behaviour), 1 = cancel this order, 2 = cancel the resting order, 3 = cancel both.

Example request

{
  "side": "buy",
  "currencyPairCode": "BTC_USDT",
  "amount": 0.001,
  "price": 45000,
  "clientOrderId": "mm1-BTC_USDT-0001"
}

Response

Order GUID string. Example: "e2cd407c-28c8-4768-bd73-cd7357fbccde"

Changes

    • breaking

      the request property became not nullable (media type: application/json-patch+json)

    • breaking

      the request property became not nullable (media type: application/json)

    • breaking

      the request property became not nullable (media type: text/json)

    • breaking

      the request property became not nullable (media type: application/*+json)

    • breaking

      the request property became required (media type: application/json-patch+json)

    • breaking

      the request property became required (media type: application/json)

    • breaking

      the request property became required (media type: text/json)

    • breaking

      the request property became required (media type: application/*+json)

    • breaking

      the request property's minLength was increased from 0 to 1 (media type: application/json-patch+json)

    • breaking

      the request property's minLength was increased from 0 to 1 (media type: application/json)

    • breaking

      the request property's minLength was increased from 0 to 1 (media type: text/json)

    • breaking

      the request property's minLength was increased from 0 to 1 (media type: application/*+json)

    • warning

      removed the request property (media type: application/json-patch+json)

    • warning

      removed the request property (media type: application/json)

    • warning

      removed the request property (media type: text/json)

    • warning

      removed the request property (media type: application/*+json)

    • warning

      removed the request property (media type: application/json-patch+json)

    • warning

      removed the request property (media type: application/json)

    • warning

      removed the request property (media type: text/json)

    • warning

      removed the request property (media type: application/*+json)

    • warning

      removed the request property (media type: application/json-patch+json)

    • warning

      removed the request property (media type: application/json)

    • warning

      removed the request property (media type: text/json)

    • warning

      removed the request property (media type: application/*+json)

    • warning

      removed the request property (media type: application/json-patch+json)

    • warning

      removed the request property (media type: application/json)

    • warning

      removed the request property (media type: text/json)

    • warning

      removed the request property (media type: application/*+json)

    • warning

      removed the request property (media type: application/json-patch+json)

    • warning

      removed the request property (media type: application/json)

    • warning

      removed the request property (media type: text/json)

    • warning

      removed the request property (media type: application/*+json)

    • warning

      removed the request property (media type: application/json-patch+json)

    • warning

      removed the request property (media type: application/json)

    • warning

      removed the request property (media type: text/json)

    • warning

      removed the request property (media type: application/*+json)

    • warning

      removed the request property (media type: application/json-patch+json)

    • warning

      removed the request property (media type: application/json)

    • warning

      removed the request property (media type: text/json)

    • warning

      removed the request property (media type: application/*+json)

    • warning

      removed the request property (media type: application/json-patch+json)

    • warning

      removed the request property (media type: application/json)

    • warning

      removed the request property (media type: text/json)

    • warning

      removed the request property (media type: application/*+json)

    • info

      api tag Spot · Trading added

    • info

      api tag ApiOrders removed

    • info

      added the new optional header request parameter API-PublicKey

    • info

      added the new optional header request parameter API-Signature

    • info

      added the new optional request property (media type: application/json-patch+json)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: text/json)

    • info

      added the new optional request property (media type: application/*+json)

    • info

      added the new optional request property (media type: application/json-patch+json)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: text/json)

    • info

      added the new optional request property (media type: application/*+json)

    • info

      added the new optional request property (media type: application/json-patch+json)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: text/json)

    • info

      added the new optional request property (media type: application/*+json)

    • info

      added the new optional request property (media type: application/json-patch+json)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: text/json)

    • info

      added the new optional request property (media type: application/*+json)