Skip to main content
POST
/
private
/
AddOrderBatch
Add Order Batch
curl --request POST \
  --url https://api.kraken.com/0/private/AddOrderBatch \
  --header 'API-Key: <api-key>' \
  --header 'API-Sign: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "nonce": 1695828490,
  "orders": [
    {
      "close": {
        "ordertype": "stop-loss-limit",
        "price": "37000",
        "price2": "36000"
      },
      "ordertype": "limit",
      "price": "40000",
      "price2": "string",
      "timeinforce": "GTC",
      "type": "buy",
      "cl_ord_id": "6d1b345e-2821-40e2-ad83-4ecb18a06876",
      "volume": "1.2"
    },
    {
      "ordertype": "limit",
      "price": "42000",
      "starttm": "string",
      "timeinforce": "GTC",
      "type": "sell",
      "cl_ord_id": "da8e4ad59b78481c93e589746b0cf91",
      "volume": "1.2"
    }
  ],
  "pair": "BTC/USD",
  "validate": false,
  "deadline": "2023-09-24T14:15:22Z"
}
'
{
  "error": [],
  "result": {
    "orders": [
      {
        "txid": "O5OR23-ADFAD-Y2G61C",
        "descr": {
          "order": "buy 0.80300000 XBTUSD @ limit 28300.0",
          "close": "close position @ stop loss 27000.0 -> limit 26000.0"
        }
      },
      {
        "txid": "9K6KFS-5H3PL-XBRC7A",
        "descr": {
          "order": "sell 0.10500000 XBTUSD @ limit 36000.0"
        }
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://kraken-sandbox.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

API-Key
string
header
required

The "API-Key" header should contain your API key.

API-Sign
string
header
required

Authenticated requests should be signed with the "API-Sign" header, using a signature generated with your private key, nonce, encoded payload, and URI path.

Body

application/json
nonce
integer<int64>
required

Nonce used in construction of API-Sign header

orders
object[]
required
pair
string
required

Asset pair id or altname

asset_class
enum<string>

This parameter is required on requests for non-crypto pairs, i.e. use tokenized_asset for xstocks.

Available options:
tokenized_asset
deadline
string

RFC3339 timestamp (e.g. 2021-04-01T00:18:45Z) after which the matching engine should reject the new order request, in presence of latency or order queueing. min now() + 2 seconds, max now() + 60 seconds.

validate
boolean
default:false

Validate inputs only. Do not submit order.

Response

200 - application/json

The order of returned orders in the response array is the same as the order of the order list sent in request.

result
Result · object
error
string[][]

Kraken API error