Pacifica
  • Getting Started
    • Closed Alpha Guide
      • Link To Guide PDF
    • Closed Alpha Trading Competition
  • Trading on Pacifica
    • Overview
    • Contract Specifications
      • Oracle Price & Mark Price
      • Settlement Mechanism
    • Order Types
      • Market Order
      • Limit Order
      • Order Rules & Constraints
    • Margin & Leverage
    • Funding Rates
    • Liquidations
  • API Documentation
    • API
      • REST
        • Account
        • Agent
        • Funding
        • Info
        • Kline
        • Orders
        • Portfolio
        • Positions
        • Models
      • Websocket
        • Orderbook
        • Trades
        • Orders
        • Positions
        • User Order History
        • User Trade History
        • Candle
        • Account Data
    • Specification
  • Other
    • Brand Assets
    • Contact Us
    • Glossary of Terms
Powered by GitBook
On this page
  1. API Documentation
  2. API
  3. REST

Orders

PreviousKlineNextPortfolio

Get Order History

get

This endpoint allows users to get order history.

Query parameters
accountstringRequired

User account address to filter orders

limitinteger · int64 | nullableOptional

Maximum number of records to return (optional, defaults to system defined limit)

offsetinteger · int64 | nullableOptional

Number of records to skip (optional, defaults to 0)

Responses
200
Successfully retrieved order history
application/json
400
Invalid request parameters
401
Unauthorized access
500
Internal server error
get
GET /api/v1/orders/history?account=text HTTP/1.1
Host: 
Accept: */*
[
  {
    "amount": "0.0053",
    "createdAt": "2025-03-25T15:13:44.820568Z",
    "eventType": "make",
    "historyId": 26698518,
    "orderId": 13753364,
    "orderType": "limit",
    "price": "87500",
    "reduceOnly": false,
    "side": "bid",
    "stopParentOrderId": null,
    "stopTickLevel": null,
    "symbol": "BTC"
  }
]

Get Order History By Id

get

This endpoint allows users to get order history by id.

Query parameters
order_idinteger · int64Required

Order ID to retrieve history for

Responses
200
Successfully retrieved order history for the specified order ID
application/json
400
Invalid request parameters
401
Unauthorized access
500
Internal server error
get
GET /api/v1/orders/history_by_id?order_id=1 HTTP/1.1
Host: 
Accept: */*
[
  [
    {
      "amount": "0.1",
      "createdAt": "2025-03-26T18:05:41.152521Z",
      "eventType": "fulfill_limit",
      "historyId": 2,
      "orderId": 13753364,
      "orderType": "limit",
      "price": "50000.00",
      "reduceOnly": false,
      "side": "bid",
      "stopParentOrderId": null,
      "stopTickLevel": null,
      "symbol": "BTC"
    },
    {
      "amount": "0.1",
      "createdAt": "2025-03-26T18:04:41.152521Z",
      "eventType": "make",
      "historyId": 1,
      "orderId": 13753364,
      "orderType": "limit",
      "price": "50000.00",
      "reduceOnly": false,
      "side": "bid",
      "stopParentOrderId": null,
      "stopTickLevel": null,
      "symbol": "BTC"
    }
  ]
]
  • GETGet Open Orders
  • POSTProcess Batch Orders
  • POSTCancel an existing order
  • POSTCancel all orders for a given symbol
  • POSTCreate a new order
  • GETGet Order History
  • GETGet Order History By Id
  • POSTCancel an existing stop order
  • POSTCreate Stop Order

Get Open Orders

get

This endpoint allows users to get open orders.

Query parameters
accountstringRequired

User account address to filter orders

Responses
200
Successfully retrieved open orders
application/json
400
Invalid request parameters
401
Unauthorized access
500
Internal server error
get
GET /api/v1/orders?account=text HTTP/1.1
Host: 
Accept: */*
[
  {
    "createdAt": "2025-03-25T15:13:44.820568Z",
    "initialAmount": "0.0053",
    "orderId": 13753364,
    "orderType": "limit",
    "reduceOnly": false,
    "remainingAmount": "0.0053",
    "side": "bid",
    "stopParentOrderId": null,
    "stopTickLevel": null,
    "symbol": "BTC",
    "tickLevel": 86500,
    "updatedAt": "2025-03-25T15:13:44.820568Z"
  }
]

Process Batch Orders

post

This endpoint allows users to process batch orders.

Body
Responses
200
Success
400
Invalid request
401
Unauthorized
500
Internal server error
post
POST /api/v1/orders/batch HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 476

{
  "actions": [
    {
      "data": {
        "agent_wallet": "AgentWalletAddress123",
        "amount": "0.5",
        "reduce_only": false,
        "side": "bid",
        "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GgbPkGEQKpW3UZmKXr4UMrHMJ5xHQFMJk2wE8J5Vyc",
        "stop_loss": {
          "amount": "0.3",
          "limit_tick_level": 125,
          "stop_tick_level": 120
        },
        "symbol": "BTC",
        "take_profit": {
          "amount": "0.3",
          "limit_tick_level": 125,
          "stop_tick_level": 120
        },
        "tick_level": 100,
        "tif": "GTC",
        "user": "Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6"
      },
      "type": "Create"
    }
  ]
}

No content

Cancel an existing order

post
Body
agent_walletstring | nullableOptionalExample: AgentWalletAddress123
order_idinteger · int64RequiredExample: 12345
signaturestringRequiredExample: 5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GgbPkGEQKpW3UZmKXr4UMrHMJ5xHQFMJk2wE8J5Vyc
symbolstringRequiredExample: BTC
userstringRequiredExample: Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6
Responses
200
Order cancelled successfully
application/json
400
Bad request
application/json
500
Internal server error
application/json
post
POST /api/v1/orders/cancel HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 227

{
  "agent_wallet": "AgentWalletAddress123",
  "order_id": 12345,
  "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GgbPkGEQKpW3UZmKXr4UMrHMJ5xHQFMJk2wE8J5Vyc",
  "symbol": "BTC",
  "user": "Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6"
}
{
  "success": true
}

Cancel all orders for a given symbol

post
Body
agent_walletstring | nullableOptionalExample: AgentWalletAddress123
all_symbolsbooleanRequiredExample: true
signaturestringRequiredExample: 5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GgbPkGEQKpW3UZmKXr4UMrHMJ5xHQFMJk2wE8J5Vyc
symbolstring | nullableOptionalExample: BTC
userstringRequiredExample: Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6
Responses
200
All orders cancelled successfully
application/json
400
Bad request
application/json
500
Internal server error
application/json
post
POST /api/v1/orders/cancel_all HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 229

{
  "agent_wallet": "AgentWalletAddress123",
  "all_symbols": true,
  "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GgbPkGEQKpW3UZmKXr4UMrHMJ5xHQFMJk2wE8J5Vyc",
  "symbol": "BTC",
  "user": "Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6"
}
{
  "cancelled_count": 5
}

Create a new order

post

This endpoint allows users to create a new order with optional take profit and stop loss levels.

Body
agent_walletstring | nullableOptionalExample: AgentWalletAddress123
amountstringRequiredExample: 0.5
reduce_onlybooleanRequiredExample: false
sidestringRequiredExample: bid
signaturestringRequiredExample: 5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GgbPkGEQKpW3UZmKXr4UMrHMJ5xHQFMJk2wE8J5Vyc
stop_lossall of | nullableOptional
symbolstringRequiredExample: BTC
take_profitall of | nullableOptional
tick_levelinteger · int32RequiredExample: 100
tifstringRequiredExample: GTC
userstringRequiredExample: Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6
Responses
200
Order created successfully
application/json
400
Bad request
application/json
500
Internal server error
application/json
post
POST /api/v1/orders/create HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 437

{
  "agent_wallet": "AgentWalletAddress123",
  "amount": "0.5",
  "reduce_only": false,
  "side": "bid",
  "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GgbPkGEQKpW3UZmKXr4UMrHMJ5xHQFMJk2wE8J5Vyc",
  "stop_loss": {
    "amount": "0.3",
    "limit_tick_level": 125,
    "stop_tick_level": 120
  },
  "symbol": "BTC",
  "take_profit": {
    "amount": "0.3",
    "limit_tick_level": 125,
    "stop_tick_level": 120
  },
  "tick_level": 100,
  "tif": "GTC",
  "user": "Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6"
}
{
  "order_id": 12345
}

Cancel an existing stop order

post

This endpoint allows users to cancel a stop order by its ID.

Body
agent_walletstring | nullableOptionalExample: AgentWalletAddress123
order_idinteger · int64RequiredExample: 12345
signaturestringRequiredExample: 5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GgbPkGEQKpW3UZmKXr4UMrHMJ5xHQFMJk2wE8J5Vyc
symbolstringRequiredExample: BTC
userstringRequiredExample: Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6
Responses
200
Stop order cancelled successfully
application/json
400
Bad request
application/json
500
Internal server error
application/json
post
POST /api/v1/orders/stop/cancel HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 227

{
  "agent_wallet": "AgentWalletAddress123",
  "order_id": 12345,
  "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GgbPkGEQKpW3UZmKXr4UMrHMJ5xHQFMJk2wE8J5Vyc",
  "symbol": "BTC",
  "user": "Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6"
}
{
  "success": true
}

Create Stop Order

post

This endpoint allows users to create stop order.

Body
agent_walletstring | nullableOptionalExample: AgentWalletAddress123
reduce_onlybooleanRequiredExample: true
sidestringRequiredExample: long
signaturestringRequiredExample: 5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GgbPkGEQKpW3UZmKXr4UMrHMJ5xHQFMJk2wE8J5Vyc
symbolstringRequiredExample: BTC
userstringRequiredExample: Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6
Responses
200
Stop order created successfully
application/json
400
Bad request
application/json
500
Internal server error
application/json
post
POST /api/v1/orders/stop/create HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 318

{
  "agent_wallet": "AgentWalletAddress123",
  "reduce_only": true,
  "side": "long",
  "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GgbPkGEQKpW3UZmKXr4UMrHMJ5xHQFMJk2wE8J5Vyc",
  "stop_order": {
    "amount": "0.3",
    "limit_tick_level": 125,
    "stop_tick_level": 120
  },
  "symbol": "BTC",
  "user": "Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6"
}
{
  "order_id": 12345
}