Orders

Get open orders

Get current user all open orders

GEThttps://api.testnet.paradex.trade/v1/orders
Authorization
Query parameters
Response

OK

Body
resultsarray of responses.OrderResp (object)

Orders list

Request
const response = await fetch('https://api.testnet.paradex.trade/v1/orders', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "results": [
    {
      "account": "0x4638e3041366aa71720be63e32e53e1223316c7f0d56f7aa617542ed1e7512x",
      "avg_fill_price": "26000",
      "cancel_reason": "NOT_ENOUGH_MARGIN",
      "client_id": "x1234",
      "created_at": 1681493746016,
      "flags": [
        "REDUCE_ONLY"
      ],
      "id": "123456",
      "instruction": "GTC",
      "last_updated_at": 1681493746016,
      "market": "BTC-USD-PERP",
      "price": "26000",
      "published_at": 1681493746016,
      "received_at": 1681493746016,
      "remaining_size": "0",
      "seq_no": 1681471234972000000,
      "side": {},
      "size": "0.05",
      "status": {},
      "stp": "EXPIRE_MAKER",
      "timestamp": 1681493746016,
      "trigger_price": "26000",
      "type": {}
    }
  ]
}

Create order

Open a new order

POSThttps://api.testnet.paradex.trade/v1/orders
Authorization
Body

Order content

client_idstring

Unique client assigned ID for the order

Example: "123454321"
flagsarray of responses.OrderFlag (enum)

Order flags, allow flag: REDUCE_ONLY

instruction*string

Order Instruction, GTC, IOC or POST_ONLY if empty GTC

market*string

Market for which order is created

Example: "BTC-USD-PERP"
price*string

Order price

Example: "29500.12"
recv_windowinteger

Order will be created if it is received by API within RecvWindow milliseconds from signature timestamp, minimum is 10 milliseconds

side*all of

Order side

signature*string

Order Payload signed with STARK Private Key

signature_timestamp*integer

Timestamp of order creation, used for signature verification

size*string

Size of the order

Example: "1.213"
stpstring

Self Trade Prevention, EXPIRE_MAKER, EXPIRE_TAKER or EXPIRE_BOTH, if empty EXPIRE_TAKER

trigger_pricestring

Trigger price for stop order

type*all of

Order type

Response

Created

Body
accountstring

Account identifier (user's account address)

Example: "0x4638e3041366aa71720be63e32e53e1223316c7f0d56f7aa617542ed1e7512x"
avg_fill_pricestring

Average fill price of the order

Example: "26000"
cancel_reasonstring

Reason for order cancellation if it was closed by cancel

Example: "NOT_ENOUGH_MARGIN"
client_idstring

Client id passed on order creation

Example: "x1234"
created_atinteger

Order creation time

Example: 1681493746016
flagsarray of responses.OrderFlag (enum)

Order flags, allow flag: REDUCE_ONLY

idstring

Unique order identifier

Example: "123456"
instructionall of

OrderInstruction (GTC, IOC, POST_ONLY)

Example: "GTC"
last_updated_atinteger

Order last update time. No changes once status=CLOSED

Example: 1681493746016
marketstring

Market to which order belongs

Example: "BTC-USD-PERP"
pricestring

Order price. 0 for MARKET orders

Example: "26000"
published_atinteger

Order published to the client time

Example: 1681493746016
received_atinteger

Order received from the client time

Example: 1681493746016
remaining_sizestring

Remaining size of the order

Example: "0"
seq_nointeger

Unique increasing number (non-sequential) that is assigned to this order update and changes on every order update. Can be used to deduplicate multiple feeds. WebSocket and REST responses use independently generated seq_no per event.

Example: 1681471234972000000
sideall of

Order side

sizestring

Order size

Example: "0.05"
statusall of

Order status

stpall of

Self Trade Prevention mode (EXEPIRE_MAKER, EXPIRE_TAKER, EXPIRE_BOTH)

Example: "EXPIRE_MAKER"
timestampinteger

Order signature timestamp

Example: 1681493746016
trigger_pricestring

Trigger price for stop order

Example: "26000"
typeall of

Order type

Request
const response = await fetch('https://api.testnet.paradex.trade/v1/orders', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "instruction": "text",
      "market": "BTC-USD-PERP",
      "price": "29500.12",
      "side": {},
      "signature": "text",
      "size": "1.213",
      "type": {}
    }),
});
const data = await response.json();
Response
{
  "account": "0x4638e3041366aa71720be63e32e53e1223316c7f0d56f7aa617542ed1e7512x",
  "avg_fill_price": "26000",
  "cancel_reason": "NOT_ENOUGH_MARGIN",
  "client_id": "x1234",
  "created_at": 1681493746016,
  "flags": [
    "REDUCE_ONLY"
  ],
  "id": "123456",
  "instruction": "GTC",
  "last_updated_at": 1681493746016,
  "market": "BTC-USD-PERP",
  "price": "26000",
  "published_at": 1681493746016,
  "received_at": 1681493746016,
  "remaining_size": "0",
  "seq_no": 1681471234972000000,
  "side": {},
  "size": "0.05",
  "status": {},
  "stp": "EXPIRE_MAKER",
  "timestamp": 1681493746016,
  "trigger_price": "26000",
  "type": {}
}

Cancel all open orders

DELETEhttps://api.testnet.paradex.trade/v1/orders
Authorization
Query parameters
Response

OK

Request
const response = await fetch('https://api.testnet.paradex.trade/v1/orders', {
    method: 'DELETE',
    headers: {},
});
const data = await response.json();
Response
{
  "error": "NOT_ONBOARDED",
  "message": "User has never called /onboarding endpoint"
}

Get orders

Get current user orders filtered on attributes

GEThttps://api.testnet.paradex.trade/v1/orders-history
Authorization
Query parameters
Response

OK

Body
nextstring

The pointer to fetch next set of records (null if there are no records left)

Example: "eyJmaWx0ZXIiMsIm1hcmtlciI6eyJtYXJrZXIiOiIxNjc1NjUwMDE3NDMxMTAxNjk5N="
prevstring

The pointer to fetch previous set of records (null if there are no records left)

Example: "eyJmaWx0ZXIiOnsiTGltaXQiOjkwfSwidGltZSI6MTY4MTY3OTgzNzk3MTMwOTk1MywibWFya2VyIjp7Im1zMjExMD=="
resultsarray of responses.OrderResp (object)

List of Orders

Request
const response = await fetch('https://api.testnet.paradex.trade/v1/orders-history', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "next": "eyJmaWx0ZXIiMsIm1hcmtlciI6eyJtYXJrZXIiOiIxNjc1NjUwMDE3NDMxMTAxNjk5N=",
  "prev": "eyJmaWx0ZXIiOnsiTGltaXQiOjkwfSwidGltZSI6MTY4MTY3OTgzNzk3MTMwOTk1MywibWFya2VyIjp7Im1zMjExMD==",
  "results": [
    {
      "account": "0x4638e3041366aa71720be63e32e53e1223316c7f0d56f7aa617542ed1e7512x",
      "avg_fill_price": "26000",
      "cancel_reason": "NOT_ENOUGH_MARGIN",
      "client_id": "x1234",
      "created_at": 1681493746016,
      "flags": [
        "REDUCE_ONLY"
      ],
      "id": "123456",
      "instruction": "GTC",
      "last_updated_at": 1681493746016,
      "market": "BTC-USD-PERP",
      "price": "26000",
      "published_at": 1681493746016,
      "received_at": 1681493746016,
      "remaining_size": "0",
      "seq_no": 1681471234972000000,
      "side": {},
      "size": "0.05",
      "status": {},
      "stp": "EXPIRE_MAKER",
      "timestamp": 1681493746016,
      "trigger_price": "26000",
      "type": {}
    }
  ]
}

Create batch of orders

[Experimental] Place a batch of orders

  • Valid batch size is between 1-10 order(s)
  • If basic validation(including signature) fails - all orders will be rejected.
  • Orders are queued for risk checking independently and failure of one order doesn't affect processing of another order.
POSThttps://api.testnet.paradex.trade/v1/orders/batch
Authorization
Body

Order content

client_idstring

Unique client assigned ID for the order

Example: "123454321"
flagsarray of responses.OrderFlag (enum)

Order flags, allow flag: REDUCE_ONLY

instruction*string

Order Instruction, GTC, IOC or POST_ONLY if empty GTC

market*string

Market for which order is created

Example: "BTC-USD-PERP"
price*string

Order price

Example: "29500.12"
recv_windowinteger

Order will be created if it is received by API within RecvWindow milliseconds from signature timestamp, minimum is 10 milliseconds

side*all of

Order side

signature*string

Order Payload signed with STARK Private Key

signature_timestamp*integer

Timestamp of order creation, used for signature verification

size*string

Size of the order

Example: "1.213"
stpstring

Self Trade Prevention, EXPIRE_MAKER, EXPIRE_TAKER or EXPIRE_BOTH, if empty EXPIRE_TAKER

trigger_pricestring

Trigger price for stop order

type*all of

Order type

Response

Created

Body
errorsarray of responses.ErrorResponse (object)
ordersarray of responses.OrderResp (object)
Request
const response = await fetch('https://api.testnet.paradex.trade/v1/orders/batch', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify([
      {
        "instruction": "text",
        "market": "BTC-USD-PERP",
        "price": "29500.12",
        "side": {},
        "signature": "text",
        "size": "1.213",
        "type": {}
      }
    ]),
});
const data = await response.json();
Response
{
  "errors": [
    {
      "error": "VALIDATION_ERROR",
      "message": "text"
    }
  ],
  "orders": [
    {
      "account": "0x4638e3041366aa71720be63e32e53e1223316c7f0d56f7aa617542ed1e7512x",
      "avg_fill_price": "26000",
      "cancel_reason": "NOT_ENOUGH_MARGIN",
      "client_id": "x1234",
      "created_at": 1681493746016,
      "flags": [
        "REDUCE_ONLY"
      ],
      "id": "123456",
      "instruction": "GTC",
      "last_updated_at": 1681493746016,
      "market": "BTC-USD-PERP",
      "price": "26000",
      "published_at": 1681493746016,
      "received_at": 1681493746016,
      "remaining_size": "0",
      "seq_no": 1681471234972000000,
      "side": {},
      "size": "0.05",
      "status": {},
      "stp": "EXPIRE_MAKER",
      "timestamp": 1681493746016,
      "trigger_price": "26000",
      "type": {}
    }
  ]
}

Get order by client id

Get an order by client id. Only returns orders in OPEN status.

GEThttps://api.testnet.paradex.trade/v1/orders/by_client_id/{client_id}
Authorization
Path parameters
client_id*string

Client Order Id

Response

OK

Body
accountstring

Account identifier (user's account address)

Example: "0x4638e3041366aa71720be63e32e53e1223316c7f0d56f7aa617542ed1e7512x"
avg_fill_pricestring

Average fill price of the order

Example: "26000"
cancel_reasonstring

Reason for order cancellation if it was closed by cancel

Example: "NOT_ENOUGH_MARGIN"
client_idstring

Client id passed on order creation

Example: "x1234"
created_atinteger

Order creation time

Example: 1681493746016
flagsarray of responses.OrderFlag (enum)

Order flags, allow flag: REDUCE_ONLY

idstring

Unique order identifier

Example: "123456"
instructionall of

OrderInstruction (GTC, IOC, POST_ONLY)

Example: "GTC"
last_updated_atinteger

Order last update time. No changes once status=CLOSED

Example: 1681493746016
marketstring

Market to which order belongs

Example: "BTC-USD-PERP"
pricestring

Order price. 0 for MARKET orders

Example: "26000"
published_atinteger

Order published to the client time

Example: 1681493746016
received_atinteger

Order received from the client time

Example: 1681493746016
remaining_sizestring

Remaining size of the order

Example: "0"
seq_nointeger

Unique increasing number (non-sequential) that is assigned to this order update and changes on every order update. Can be used to deduplicate multiple feeds. WebSocket and REST responses use independently generated seq_no per event.

Example: 1681471234972000000
sideall of

Order side

sizestring

Order size

Example: "0.05"
statusall of

Order status

stpall of

Self Trade Prevention mode (EXEPIRE_MAKER, EXPIRE_TAKER, EXPIRE_BOTH)

Example: "EXPIRE_MAKER"
timestampinteger

Order signature timestamp

Example: 1681493746016
trigger_pricestring

Trigger price for stop order

Example: "26000"
typeall of

Order type

Request
const response = await fetch('https://api.testnet.paradex.trade/v1/orders/by_client_id/{client_id}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "account": "0x4638e3041366aa71720be63e32e53e1223316c7f0d56f7aa617542ed1e7512x",
  "avg_fill_price": "26000",
  "cancel_reason": "NOT_ENOUGH_MARGIN",
  "client_id": "x1234",
  "created_at": 1681493746016,
  "flags": [
    "REDUCE_ONLY"
  ],
  "id": "123456",
  "instruction": "GTC",
  "last_updated_at": 1681493746016,
  "market": "BTC-USD-PERP",
  "price": "26000",
  "published_at": 1681493746016,
  "received_at": 1681493746016,
  "remaining_size": "0",
  "seq_no": 1681471234972000000,
  "side": {},
  "size": "0.05",
  "status": {},
  "stp": "EXPIRE_MAKER",
  "timestamp": 1681493746016,
  "trigger_price": "26000",
  "type": {}
}

Cancel open order by client order id

DELETEhttps://api.testnet.paradex.trade/v1/orders/by_client_id/{client_id}
Authorization
Path parameters
client_id*string

Client Order Id

Response

No Content

Request
const response = await fetch('https://api.testnet.paradex.trade/v1/orders/by_client_id/{client_id}', {
    method: 'DELETE',
    headers: {},
});
const data = await response.json();
Response
{
  "error": "NOT_ONBOARDED",
  "message": "User has never called /onboarding endpoint"
}

Get order

Get an order by id. Only return orders in OPEN or NEW status.

GEThttps://api.testnet.paradex.trade/v1/orders/{order_id}
Authorization
Path parameters
order_id*string

Order Id

Response

OK

Body
accountstring

Account identifier (user's account address)

Example: "0x4638e3041366aa71720be63e32e53e1223316c7f0d56f7aa617542ed1e7512x"
avg_fill_pricestring

Average fill price of the order

Example: "26000"
cancel_reasonstring

Reason for order cancellation if it was closed by cancel

Example: "NOT_ENOUGH_MARGIN"
client_idstring

Client id passed on order creation

Example: "x1234"
created_atinteger

Order creation time

Example: 1681493746016
flagsarray of responses.OrderFlag (enum)

Order flags, allow flag: REDUCE_ONLY

idstring

Unique order identifier

Example: "123456"
instructionall of

OrderInstruction (GTC, IOC, POST_ONLY)

Example: "GTC"
last_updated_atinteger

Order last update time. No changes once status=CLOSED

Example: 1681493746016
marketstring

Market to which order belongs

Example: "BTC-USD-PERP"
pricestring

Order price. 0 for MARKET orders

Example: "26000"
published_atinteger

Order published to the client time

Example: 1681493746016
received_atinteger

Order received from the client time

Example: 1681493746016
remaining_sizestring

Remaining size of the order

Example: "0"
seq_nointeger

Unique increasing number (non-sequential) that is assigned to this order update and changes on every order update. Can be used to deduplicate multiple feeds. WebSocket and REST responses use independently generated seq_no per event.

Example: 1681471234972000000
sideall of

Order side

sizestring

Order size

Example: "0.05"
statusall of

Order status

stpall of

Self Trade Prevention mode (EXEPIRE_MAKER, EXPIRE_TAKER, EXPIRE_BOTH)

Example: "EXPIRE_MAKER"
timestampinteger

Order signature timestamp

Example: 1681493746016
trigger_pricestring

Trigger price for stop order

Example: "26000"
typeall of

Order type

Request
const response = await fetch('https://api.testnet.paradex.trade/v1/orders/{order_id}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "account": "0x4638e3041366aa71720be63e32e53e1223316c7f0d56f7aa617542ed1e7512x",
  "avg_fill_price": "26000",
  "cancel_reason": "NOT_ENOUGH_MARGIN",
  "client_id": "x1234",
  "created_at": 1681493746016,
  "flags": [
    "REDUCE_ONLY"
  ],
  "id": "123456",
  "instruction": "GTC",
  "last_updated_at": 1681493746016,
  "market": "BTC-USD-PERP",
  "price": "26000",
  "published_at": 1681493746016,
  "received_at": 1681493746016,
  "remaining_size": "0",
  "seq_no": 1681471234972000000,
  "side": {},
  "size": "0.05",
  "status": {},
  "stp": "EXPIRE_MAKER",
  "timestamp": 1681493746016,
  "trigger_price": "26000",
  "type": {}
}

Cancel order

DELETEhttps://api.testnet.paradex.trade/v1/orders/{order_id}
Authorization
Path parameters
order_id*string

Order Id

Response

No Content

Request
const response = await fetch('https://api.testnet.paradex.trade/v1/orders/{order_id}', {
    method: 'DELETE',
    headers: {},
});
const data = await response.json();
Response
{
  "error": "NOT_ONBOARDED",
  "message": "User has never called /onboarding endpoint"
}

Create batch of orders

[Experimental] Place a batch of orders

  • Valid batch size is between 1-10 order(s)
  • If basic validation(including signature) fails - all orders will be rejected.
  • Orders are queued for risk checking independently and failure of one order doesn't affect processing of another order.
POSThttps://api.testnet.paradex.trade/v1/orders/batch
Authorization
Body

Order content

client_idstring

Unique client assigned ID for the order

Example: "123454321"
flagsarray of responses.OrderFlag (enum)

Order flags, allow flag: REDUCE_ONLY

instruction*string

Order Instruction, GTC, IOC or POST_ONLY if empty GTC

market*string

Market for which order is created

Example: "BTC-USD-PERP"
price*string

Order price

Example: "29500.12"
recv_windowinteger

Order will be created if it is received by API within RecvWindow milliseconds from signature timestamp, minimum is 10 milliseconds

side*all of

Order side

signature*string

Order Payload signed with STARK Private Key

signature_timestamp*integer

Timestamp of order creation, used for signature verification

size*string

Size of the order

Example: "1.213"
stpstring

Self Trade Prevention, EXPIRE_MAKER, EXPIRE_TAKER or EXPIRE_BOTH, if empty EXPIRE_TAKER

trigger_pricestring

Trigger price for stop order

type*all of

Order type

Response

Created

Body
errorsarray of responses.ErrorResponse (object)
ordersarray of responses.OrderResp (object)
Request
const response = await fetch('https://api.testnet.paradex.trade/v1/orders/batch', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify([
      {
        "instruction": "text",
        "market": "BTC-USD-PERP",
        "price": "29500.12",
        "side": {},
        "signature": "text",
        "size": "1.213",
        "type": {}
      }
    ]),
});
const data = await response.json();
Response
{
  "errors": [
    {
      "error": "VALIDATION_ERROR",
      "message": "text"
    }
  ],
  "orders": [
    {
      "account": "0x4638e3041366aa71720be63e32e53e1223316c7f0d56f7aa617542ed1e7512x",
      "avg_fill_price": "26000",
      "cancel_reason": "NOT_ENOUGH_MARGIN",
      "client_id": "x1234",
      "created_at": 1681493746016,
      "flags": [
        "REDUCE_ONLY"
      ],
      "id": "123456",
      "instruction": "GTC",
      "last_updated_at": 1681493746016,
      "market": "BTC-USD-PERP",
      "price": "26000",
      "published_at": 1681493746016,
      "received_at": 1681493746016,
      "remaining_size": "0",
      "seq_no": 1681471234972000000,
      "side": {},
      "size": "0.05",
      "status": {},
      "stp": "EXPIRE_MAKER",
      "timestamp": 1681493746016,
      "trigger_price": "26000",
      "type": {}
    }
  ]
}

Last updated