Skip to content

REST API Reference

Order API›Order Service

SubmitOrder

POSThttps://api.pax.markets/v1/order/submit
Permission: trade

Place a limit order.

Request

orderobject

The order to place.

ShowHide 6 properties
sideenum

Side to place on.

1 = ASK2 = BID
ASKSell the base asset.
BIDBuy the base asset.
market_idstringuint64

Market to place on.

qtystringint64

Quantity to place, a multiple of the market's step size. Must be positive except on a cancel lambda.

ticksintegerint32

Limit price in ticks, from 1 to the market's max_ticks.

tifenum

How long the order stays live.

1 = IOC2 = GTC3 = ALO
IOCImmediate or cancel.
GTCGood until canceled.
ALOAdd liquidity only: rests if it would not cross, else canceled.
is_leverageboolean

Trade on margin. Currently disabled.

client_order_idstringOptional

Client-assigned id, at most 36 bytes. Omit or leave empty for none. Rejected if it matches another of the account's live orders.

Response

A successful response.

order_idstring

Exchange-assigned order id.

POST/v1/order/submit
curl -X POST 'https://api.pax.markets/v1/order/submit' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "order": {
    "side": 2,
    "market_id": "1",
    "qty": "100000",
    "ticks": 99990,
    "tif": 2,
    "is_leverage": false
  },
  "client_order_id": "my-order-1"
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/order/submit"
body = json.dumps({
      "order": {
        "side": 2,
        "market_id": "1",
        "qty": "100000",
        "ticks": 99990,
        "tif": 2,
        "is_leverage": False
      },
      "client_order_id": "my-order-1"
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/order/submit";
let body = serde_json::to_string(&serde_json::json!({
  "order": {
    "side": 2,
    "market_id": "1",
    "qty": "100000",
    "ticks": 99990,
    "tif": 2,
    "is_leverage": false
  },
  "client_order_id": "my-order-1"
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/order/submit";
const body = JSON.stringify({
  "order": {
    "side": 2,
    "market_id": "1",
    "qty": "100000",
    "ticks": 99990,
    "tif": 2,
    "is_leverage": false
  },
  "client_order_id": "my-order-1"
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71"
}
{
  "error": "A client-assigned id cannot exceed 36 bytes."
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Order API›Order Service

CancelLiquidityOrder

POSThttps://api.pax.markets/v1/order/cancel-liquidity
Permission: trade

Cancel a quantity of the account's resting liquidity at one price level.

Request

market_idstringuint64

Market to cancel on.

qtystringint64

Quantity to cancel. Must be positive.

sideenum

Side to cancel on.

1 = ASK2 = BID
ASKSell the base asset.
BIDBuy the base asset.
ticksintegerint32

Price level to cancel at, in ticks.

client_order_idstringOptional

Client-assigned id for the cancel, at most 36 bytes. Omit or leave empty for none.

Response

A successful response.

order_idstring

Exchange-assigned id of the cancel order.

POST/v1/order/cancel-liquidity
curl -X POST 'https://api.pax.markets/v1/order/cancel-liquidity' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "market_id": "1",
  "qty": "100000",
  "side": 2,
  "ticks": 99990,
  "client_order_id": "my-cancel-1"
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/order/cancel-liquidity"
body = json.dumps({
      "market_id": "1",
      "qty": "100000",
      "side": 2,
      "ticks": 99990,
      "client_order_id": "my-cancel-1"
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/order/cancel-liquidity";
let body = serde_json::to_string(&serde_json::json!({
  "market_id": "1",
  "qty": "100000",
  "side": 2,
  "ticks": 99990,
  "client_order_id": "my-cancel-1"
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/order/cancel-liquidity";
const body = JSON.stringify({
  "market_id": "1",
  "qty": "100000",
  "side": 2,
  "ticks": 99990,
  "client_order_id": "my-cancel-1"
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "order_id": "01a1bbc7-dd3c-7b2d-9f30-4c6e0d5b7f82"
}
{
  "error": "A client-assigned id cannot exceed 36 bytes."
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Order API›Order Service

CancelAllOrders

POSThttps://api.pax.markets/v1/order/cancel-all
Permission: trade

Cancel every resting order for the account, optionally limited to one market.

Request

market_idstringuint64Optional

Cancel only this market's orders. Omit for every market.

Response

A successful response.

order_idsstring[]

List of exchange-assigned cancel order ids, one per price level canceled.

POST/v1/order/cancel-all
curl -X POST 'https://api.pax.markets/v1/order/cancel-all' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "market_id": "1"
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/order/cancel-all"
body = json.dumps({
      "market_id": "1"
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/order/cancel-all";
let body = serde_json::to_string(&serde_json::json!({
  "market_id": "1"
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/order/cancel-all";
const body = JSON.stringify({
  "market_id": "1"
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "order_ids": [
    "01a1bbc7-dd3c-7b2d-9f30-4c6e0d5b7f82"
  ]
}
{
  "error": "Failed to parse the request body as JSON: expected value at line 1 column 1"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Order API›Order Service

BatchSubmitOmniOrders

POSThttps://api.pax.markets/v1/order/submit-batch-omni
Permission: trade

Place orders and cancel liquidity in one request.

Request

omni_ordersobject[]Optional

List of entries to apply, in the order given. At most 40 per request.

ShowHide 2 properties
message.SubmitOrderobjectOne of

Place an order.

ShowHide 2 properties
orderobject

The order to place.

ShowHide 6 properties
sideenum

Side to place on.

1 = ASK2 = BID
ASKSell the base asset.
BIDBuy the base asset.
market_idstringuint64

Market to place on.

qtystringint64

Quantity to place, a multiple of the market's step size. Must be positive except on a cancel lambda.

ticksintegerint32

Limit price in ticks, from 1 to the market's max_ticks.

tifenum

How long the order stays live.

1 = IOC2 = GTC3 = ALO
IOCImmediate or cancel.
GTCGood until canceled.
ALOAdd liquidity only: rests if it would not cross, else canceled.
is_leverageboolean

Trade on margin. Currently disabled.

client_order_idstringOptional

Client-assigned id, at most 36 bytes. Omit or leave empty for none. Rejected if it matches another of the account's live orders.

message.CancelLiquidityOrderobjectOne of

Cancel resting liquidity at a price level.

ShowHide 5 properties
market_idstringuint64

Market to cancel on.

qtystringint64

Quantity to cancel. Must be positive.

sideenum

Side to cancel on.

1 = ASK2 = BID
ASKSell the base asset.
BIDBuy the base asset.
ticksintegerint32

Price level to cancel at, in ticks.

client_order_idstringOptional

Client-assigned id for the cancel, at most 36 bytes. Omit or leave empty for none.

Response

A successful response.

resultsobject[]

One result per entry, in request order.

ShowHide 5 properties
order_idstring

Exchange-assigned order id. Empty if refused.

client_order_idstring

The entry's client_order_id. Empty if none was sent.

acceptedboolean

True if the exchange took the order.

reasonenum

Why the entry was refused. OSU_REASON_UNSPECIFIED if accepted.

0 = OSU_REASON_UNSPECIFIED1 = OSU_REASON_ADMIN_CANCELED2 = OSU_REASON_INSUFFICIENT_BALANCE3 = OSU_REASON_DUPLICATE_CLIENT_ID4 = OSU_REASON_EXCHANGE_ERROR5 = OSU_REASON_ALO_WOULD_CROSS6 = OSU_REASON_EXCHANGE_UNAVAILABLE7 = OSU_REASON_CAPACITY_REACHED8 = OSU_REASON_INVALID_ORDER
OSU_REASON_UNSPECIFIEDNone.
OSU_REASON_ADMIN_CANCELEDCanceled by the system, such as ahead of maintenance or shutdown.
OSU_REASON_INSUFFICIENT_BALANCERefused because the account cannot fund the order.
OSU_REASON_DUPLICATE_CLIENT_IDRefused because client_order_id is already in use by a live order.
OSU_REASON_EXCHANGE_ERRORRefused because of an internal exchange error. The order was not placed.
OSU_REASON_ALO_WOULD_CROSSCanceled because the ALO order would have crossed the book.
OSU_REASON_EXCHANGE_UNAVAILABLERefused because the exchange is not accepting orders right now.
OSU_REASON_CAPACITY_REACHEDRefused because the exchange has no capacity for another active lambda account right now.
OSU_REASON_INVALID_ORDERRefused because the order failed validation.
messagestring

Error message for a refused entry.

POST/v1/order/submit-batch-omni
curl -X POST 'https://api.pax.markets/v1/order/submit-batch-omni' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "omni_orders": [
    {
      "message": {
        "SubmitOrder": {
          "order": {
            "side": 2,
            "market_id": "1",
            "qty": "100000",
            "ticks": 99990,
            "tif": 2,
            "is_leverage": false
          },
          "client_order_id": "my-order-1"
        }
      }
    },
    {
      "message": {
        "CancelLiquidityOrder": {
          "market_id": "1",
          "qty": "100000",
          "side": 2,
          "ticks": 99990,
          "client_order_id": "my-cancel-1"
        }
      }
    }
  ]
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/order/submit-batch-omni"
body = json.dumps({
      "omni_orders": [
        {
          "message": {
            "SubmitOrder": {
              "order": {
                "side": 2,
                "market_id": "1",
                "qty": "100000",
                "ticks": 99990,
                "tif": 2,
                "is_leverage": False
              },
              "client_order_id": "my-order-1"
            }
          }
        },
        {
          "message": {
            "CancelLiquidityOrder": {
              "market_id": "1",
              "qty": "100000",
              "side": 2,
              "ticks": 99990,
              "client_order_id": "my-cancel-1"
            }
          }
        }
      ]
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/order/submit-batch-omni";
let body = serde_json::to_string(&serde_json::json!({
  "omni_orders": [
    {
      "message": {
        "SubmitOrder": {
          "order": {
            "side": 2,
            "market_id": "1",
            "qty": "100000",
            "ticks": 99990,
            "tif": 2,
            "is_leverage": false
          },
          "client_order_id": "my-order-1"
        }
      }
    },
    {
      "message": {
        "CancelLiquidityOrder": {
          "market_id": "1",
          "qty": "100000",
          "side": 2,
          "ticks": 99990,
          "client_order_id": "my-cancel-1"
        }
      }
    }
  ]
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/order/submit-batch-omni";
const body = JSON.stringify({
  "omni_orders": [
    {
      "message": {
        "SubmitOrder": {
          "order": {
            "side": 2,
            "market_id": "1",
            "qty": "100000",
            "ticks": 99990,
            "tif": 2,
            "is_leverage": false
          },
          "client_order_id": "my-order-1"
        }
      }
    },
    {
      "message": {
        "CancelLiquidityOrder": {
          "market_id": "1",
          "qty": "100000",
          "side": 2,
          "ticks": 99990,
          "client_order_id": "my-cancel-1"
        }
      }
    }
  ]
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "results": [
    {
      "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
      "client_order_id": "my-order-1",
      "accepted": true,
      "reason": 0,
      "message": ""
    }
  ]
}
{
  "error": "Failed to parse the request body as JSON: expected value at line 1 column 1"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Order API›Order Service

GetActiveOrders

GEThttps://api.pax.markets/v1/order/active

List the account's open orders, whether pending or resting.

Request

market_idstringuint64Optional

Return only orders on this market. Omit for every market.

Response

A successful response.

ordersobject[]

List of the account's open orders.

ShowHide 6 properties
order_idstring

Exchange-assigned order id.

client_order_idstring

The order's client_order_id. Empty if none was sent.

orderobject

The order as placed.

ShowHide 7 properties
sideenum

Side the order was placed on.

1 = ASK2 = BID
ASKSell the base asset.
BIDBuy the base asset.
market_idstringuint64

Market the order was placed on.

qtystringint64

Quantity submitted. Negative for a cancel order.

ticksintegerint32

Limit price in ticks.

tifenum

Time in force the order was placed with.

1 = IOC2 = GTC3 = ALO
IOCImmediate or cancel.
GTCGood until canceled.
ALOAdd liquidity only: rests if it would not cross, else canceled.
originenum

What placed the order.

1 = EXOGENOUS2 = LAMBDA3 = ADMIN
EXOGENOUSPlaced directly through the API.
LAMBDAPlaced by a lambda program.
ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.
lambda_idstring

Exchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.

qty_filled_makestringint64

Quantity filled as maker so far.

qty_filled_takestringint64

Quantity filled as taker so far.

qty_canceledstringint64

Quantity canceled so far.

GET/v1/order/active
curl -X GET 'https://api.pax.markets/v1/order/active' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/order/active"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/order/active";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/order/active";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "orders": [
    {
      "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
      "client_order_id": "my-order-1",
      "order": {
        "side": 2,
        "market_id": "1",
        "qty": "100000",
        "ticks": 99990,
        "tif": 2,
        "origin": 1,
        "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093"
      },
      "qty_filled_make": "0",
      "qty_filled_take": "100000",
      "qty_canceled": "0"
    }
  ]
}
{
  "error": "Invalid query parameter 'market_id': must be u64"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Order API›Order Service

GetOrder

GEThttps://api.pax.markets/v1/order/{order_id}

Fetch one order by order_id.

Path Parameters

order_idstring

Id of the order to fetch.

Response

A successful response.

order_idstring

Exchange-assigned order id.

market_idstringuint64

Market the order was placed on.

sideenum

Side the order was placed on.

1 = ASK2 = BID
ASKSell the base asset.
BIDBuy the base asset.
qtystringint64

Quantity submitted. Negative for a cancel order.

ticksintegerint32

Limit price in ticks.

tifenum

Time in force the order was placed with.

1 = IOC2 = GTC3 = ALO
IOCImmediate or cancel.
GTCGood until canceled.
ALOAdd liquidity only: rests if it would not cross, else canceled.
order_statusenum

Current status.

1 = ORDER_STATUS_PENDING2 = ORDER_STATUS_RESTING3 = ORDER_STATUS_FILLED4 = ORDER_STATUS_CANCELED5 = ORDER_STATUS_PARTIAL6 = ORDER_STATUS_REJECTED
ORDER_STATUS_PENDINGAccepted, not yet acknowledged by the matching engine.
ORDER_STATUS_RESTINGOn the book with quantity left to fill.
ORDER_STATUS_FILLEDFully filled.
ORDER_STATUS_CANCELEDCanceled with nothing filled.
ORDER_STATUS_PARTIALPartly filled, with the rest canceled.
ORDER_STATUS_REJECTEDRejected.
originenum

What placed the order.

1 = EXOGENOUS2 = LAMBDA3 = ADMIN
EXOGENOUSPlaced directly through the API.
LAMBDAPlaced by a lambda program.
ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.
qty_filled_makestringint64

Quantity filled as maker.

qty_filled_takestringint64

Quantity filled as taker.

qty_canceledstringint64

Quantity canceled.

fill_valuestringint64

Total value filled, in the quote asset's native units.

client_order_idstring

Client-assigned id from the submit request. Empty if none was sent.

created_time_msstringint64

When the order was accepted, in Unix milliseconds.

updated_time_msstringint64

When the order last changed, in Unix milliseconds.

lambda_idstring

Exchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.

GET/v1/order/{order_id}
curl -X GET 'https://api.pax.markets/v1/order/01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/order/01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/order/01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/order/01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
  "market_id": "1",
  "side": 2,
  "qty": "100000",
  "ticks": 99990,
  "tif": 2,
  "order_status": 3,
  "origin": 1,
  "qty_filled_make": "0",
  "qty_filled_take": "100000",
  "qty_canceled": "0",
  "fill_value": "99990000",
  "client_order_id": "my-order-1",
  "created_time_ms": "1794151800123",
  "updated_time_ms": "1794151800125",
  "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Order API›Order Service

GetOrders

GEThttps://api.pax.markets/v1/order/list

List the account's orders, newest first, optionally narrowed to one market and one status.

Request

limitintegerint32Optional

Maximum orders to return, from 1 to 1000. Defaults to 1000.

cursorstringOptional

Cursor from the previous response's next_cursor. Omit for the first page.

order_statusenumOptional

Return only orders in this status.

1 = ORDER_STATUS_PENDING2 = ORDER_STATUS_RESTING3 = ORDER_STATUS_FILLED4 = ORDER_STATUS_CANCELED5 = ORDER_STATUS_PARTIAL6 = ORDER_STATUS_REJECTED
ORDER_STATUS_PENDINGAccepted, not yet acknowledged by the matching engine.
ORDER_STATUS_RESTINGOn the book with quantity left to fill.
ORDER_STATUS_FILLEDFully filled.
ORDER_STATUS_CANCELEDCanceled with nothing filled.
ORDER_STATUS_PARTIALPartly filled, with the rest canceled.
ORDER_STATUS_REJECTEDRejected.
market_idstringuint64Optional

Return only orders on this market. Omit for every market.

Response

A successful response.

ordersobject[]

List of orders on this page.

ShowHide 16 properties
order_idstring

Exchange-assigned order id.

market_idstringuint64

Market the order was placed on.

sideenum

Side the order was placed on.

1 = ASK2 = BID
ASKSell the base asset.
BIDBuy the base asset.
qtystringint64

Quantity submitted. Negative for a cancel order.

ticksintegerint32

Limit price in ticks.

tifenum

Time in force the order was placed with.

1 = IOC2 = GTC3 = ALO
IOCImmediate or cancel.
GTCGood until canceled.
ALOAdd liquidity only: rests if it would not cross, else canceled.
order_statusenum

Current status.

1 = ORDER_STATUS_PENDING2 = ORDER_STATUS_RESTING3 = ORDER_STATUS_FILLED4 = ORDER_STATUS_CANCELED5 = ORDER_STATUS_PARTIAL6 = ORDER_STATUS_REJECTED
ORDER_STATUS_PENDINGAccepted, not yet acknowledged by the matching engine.
ORDER_STATUS_RESTINGOn the book with quantity left to fill.
ORDER_STATUS_FILLEDFully filled.
ORDER_STATUS_CANCELEDCanceled with nothing filled.
ORDER_STATUS_PARTIALPartly filled, with the rest canceled.
ORDER_STATUS_REJECTEDRejected.
originenum

What placed the order.

1 = EXOGENOUS2 = LAMBDA3 = ADMIN
EXOGENOUSPlaced directly through the API.
LAMBDAPlaced by a lambda program.
ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.
qty_filled_makestringint64

Quantity filled as maker.

qty_filled_takestringint64

Quantity filled as taker.

qty_canceledstringint64

Quantity canceled.

fill_valuestringint64

Total value filled, in the quote asset's native units.

client_order_idstring

Client-assigned id from the submit request. Empty if none was sent.

created_time_msstringint64

When the order was accepted, in Unix milliseconds.

updated_time_msstringint64

When the order last changed, in Unix milliseconds.

lambda_idstring

Exchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.

next_cursorstring

Pass as cursor to fetch the next page. Absent on the last page.

GET/v1/order/list
curl -X GET 'https://api.pax.markets/v1/order/list' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/order/list"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/order/list";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/order/list";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "orders": [
    {
      "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
      "market_id": "1",
      "side": 2,
      "qty": "100000",
      "ticks": 99990,
      "tif": 2,
      "order_status": 3,
      "origin": 1,
      "qty_filled_make": "0",
      "qty_filled_take": "100000",
      "qty_canceled": "0",
      "fill_value": "99990000",
      "client_order_id": "my-order-1",
      "created_time_ms": "1794151800123",
      "updated_time_ms": "1794151800125",
      "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093"
    }
  ],
  "next_cursor": "eyJ0IjoxNzk0MTQ4MjAwMTIzfQ"
}
{
  "error": "Invalid query parameter 'limit': must be u32"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Order API›Order Service

GetOrderStatusUpdates

GEThttps://api.pax.markets/v1/order/status-updates

Read the full status update history of one order. Updates can take up to 15 minutes to appear here.

Request

order_idstring

Order whose history to read.

limitintegerint32Optional

Maximum updates to return, from 1 to 1000. Defaults to 1000.

cursorstringOptional

Cursor from the previous response's next_cursor. Omit for the first page.

Response

A successful response.

order_status_updatesobject[]

List of status updates on this page.

ShowHide 2 properties
osuobject

The status update, as streamed.

ShowHide 12 properties
osu_idstring

Exchange-assigned id of this status update.

order_idstring

Exchange-assigned id of the order this update belongs to.

client_order_idstring

The order's client_order_id. Empty if none was sent.

qty_filled_makestringint64

Quantity filled as maker in this update.

qty_filled_takestringint64

Quantity filled as taker in this update.

qty_canceledstringint64

Quantity canceled in this update.

fill_valuestringint64

Value filled in this update, in the quote asset's native units.

fee_rebatestringint64

Rebate paid, or fee charged when negative, in the quote asset's native units.

orderobject

The order as placed.

ShowHide 7 properties
sideenum

Side the order was placed on.

1 = ASK2 = BID
ASKSell the base asset.
BIDBuy the base asset.
market_idstringuint64

Market the order was placed on.

qtystringint64

Quantity submitted. Negative for a cancel order.

ticksintegerint32

Limit price in ticks.

tifenum

Time in force the order was placed with.

1 = IOC2 = GTC3 = ALO
IOCImmediate or cancel.
GTCGood until canceled.
ALOAdd liquidity only: rests if it would not cross, else canceled.
originenum

What placed the order.

1 = EXOGENOUS2 = LAMBDA3 = ADMIN
EXOGENOUSPlaced directly through the API.
LAMBDAPlaced by a lambda program.
ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.
lambda_idstring

Exchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.

order_statusenum

Order status after this update.

1 = ORDER_STATUS_PENDING2 = ORDER_STATUS_RESTING3 = ORDER_STATUS_FILLED4 = ORDER_STATUS_CANCELED5 = ORDER_STATUS_PARTIAL6 = ORDER_STATUS_REJECTED
ORDER_STATUS_PENDINGAccepted, not yet acknowledged by the matching engine.
ORDER_STATUS_RESTINGOn the book with quantity left to fill.
ORDER_STATUS_FILLEDFully filled.
ORDER_STATUS_CANCELEDCanceled with nothing filled.
ORDER_STATUS_PARTIALPartly filled, with the rest canceled.
ORDER_STATUS_REJECTEDRejected.
reasonenum

Why the system refused or canceled the order, if it did.

0 = OSU_REASON_UNSPECIFIED1 = OSU_REASON_ADMIN_CANCELED2 = OSU_REASON_INSUFFICIENT_BALANCE3 = OSU_REASON_DUPLICATE_CLIENT_ID4 = OSU_REASON_EXCHANGE_ERROR5 = OSU_REASON_ALO_WOULD_CROSS6 = OSU_REASON_EXCHANGE_UNAVAILABLE7 = OSU_REASON_CAPACITY_REACHED8 = OSU_REASON_INVALID_ORDER
OSU_REASON_UNSPECIFIEDNone.
OSU_REASON_ADMIN_CANCELEDCanceled by the system, such as ahead of maintenance or shutdown.
OSU_REASON_INSUFFICIENT_BALANCERefused because the account cannot fund the order.
OSU_REASON_DUPLICATE_CLIENT_IDRefused because client_order_id is already in use by a live order.
OSU_REASON_EXCHANGE_ERRORRefused because of an internal exchange error. The order was not placed.
OSU_REASON_ALO_WOULD_CROSSCanceled because the ALO order would have crossed the book.
OSU_REASON_EXCHANGE_UNAVAILABLERefused because the exchange is not accepting orders right now.
OSU_REASON_CAPACITY_REACHEDRefused because the exchange has no capacity for another active lambda account right now.
OSU_REASON_INVALID_ORDERRefused because the order failed validation.
tm_infoobject

Timestamps of this update.

ShowHide 1 property
hw_ser_time_nsstringuint64

When the event was sequenced by the exchange, in Unix nanoseconds. A maker fill carries the taking order's time. 0 for a rejected order, or for an order the system canceled when the exchange restarted.

updated_time_msstringint64

When this update happened, in Unix milliseconds.

next_cursorstring

Pass as cursor to fetch the next page. Absent on the last page.

GET/v1/order/status-updates
curl -X GET 'https://api.pax.markets/v1/order/status-updates?order_id=01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/order/status-updates?order_id=01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/order/status-updates?order_id=01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/order/status-updates?order_id=01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "order_status_updates": [
    {
      "osu": {
        "osu_id": "01a1bbc7-dd3e-7d4f-b152-6e802f7d91a4",
        "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
        "client_order_id": "my-order-1",
        "qty_filled_make": "0",
        "qty_filled_take": "100000",
        "qty_canceled": "0",
        "fill_value": "99990000",
        "fee_rebate": "2499",
        "order": {
          "side": 2,
          "market_id": "1",
          "qty": "100000",
          "ticks": 99990,
          "tif": 2,
          "origin": 1,
          "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093"
        },
        "order_status": 3,
        "reason": 0,
        "tm_info": {
          "hw_ser_time_ns": "1794151800124000417"
        }
      },
      "updated_time_ms": "1794151800125"
    }
  ],
  "next_cursor": "eyJ0IjoxNzk0MTQ4MjAwMTIzfQ"
}
{
  "error": "Invalid query parameter 'limit': must be u32"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Order API›Order Service

GetRecentFillOrderStatusUpdates

GEThttps://api.pax.markets/v1/order/status-updates/fills/recent

Read the account's most recent fills, newest first. A fill is a status update where the order traded. Covers the last 10,000 fills per account.

Request

market_idstringuint64Optional

Return only updates for orders on this market.

limitintegerint32Optional

Maximum updates to return, from 1 to 1000. Defaults to 1000.

cursorstringOptional

Cursor from the previous response's next_cursor. Omit to start at the newest update.

Response

A successful response.

order_status_updatesobject[]

List of status updates on this page.

ShowHide 2 properties
osuobject

The status update, as streamed.

ShowHide 12 properties
osu_idstring

Exchange-assigned id of this status update.

order_idstring

Exchange-assigned id of the order this update belongs to.

client_order_idstring

The order's client_order_id. Empty if none was sent.

qty_filled_makestringint64

Quantity filled as maker in this update.

qty_filled_takestringint64

Quantity filled as taker in this update.

qty_canceledstringint64

Quantity canceled in this update.

fill_valuestringint64

Value filled in this update, in the quote asset's native units.

fee_rebatestringint64

Rebate paid, or fee charged when negative, in the quote asset's native units.

orderobject

The order as placed.

ShowHide 7 properties
sideenum

Side the order was placed on.

1 = ASK2 = BID
ASKSell the base asset.
BIDBuy the base asset.
market_idstringuint64

Market the order was placed on.

qtystringint64

Quantity submitted. Negative for a cancel order.

ticksintegerint32

Limit price in ticks.

tifenum

Time in force the order was placed with.

1 = IOC2 = GTC3 = ALO
IOCImmediate or cancel.
GTCGood until canceled.
ALOAdd liquidity only: rests if it would not cross, else canceled.
originenum

What placed the order.

1 = EXOGENOUS2 = LAMBDA3 = ADMIN
EXOGENOUSPlaced directly through the API.
LAMBDAPlaced by a lambda program.
ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.
lambda_idstring

Exchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.

order_statusenum

Order status after this update.

1 = ORDER_STATUS_PENDING2 = ORDER_STATUS_RESTING3 = ORDER_STATUS_FILLED4 = ORDER_STATUS_CANCELED5 = ORDER_STATUS_PARTIAL6 = ORDER_STATUS_REJECTED
ORDER_STATUS_PENDINGAccepted, not yet acknowledged by the matching engine.
ORDER_STATUS_RESTINGOn the book with quantity left to fill.
ORDER_STATUS_FILLEDFully filled.
ORDER_STATUS_CANCELEDCanceled with nothing filled.
ORDER_STATUS_PARTIALPartly filled, with the rest canceled.
ORDER_STATUS_REJECTEDRejected.
reasonenum

Why the system refused or canceled the order, if it did.

0 = OSU_REASON_UNSPECIFIED1 = OSU_REASON_ADMIN_CANCELED2 = OSU_REASON_INSUFFICIENT_BALANCE3 = OSU_REASON_DUPLICATE_CLIENT_ID4 = OSU_REASON_EXCHANGE_ERROR5 = OSU_REASON_ALO_WOULD_CROSS6 = OSU_REASON_EXCHANGE_UNAVAILABLE7 = OSU_REASON_CAPACITY_REACHED8 = OSU_REASON_INVALID_ORDER
OSU_REASON_UNSPECIFIEDNone.
OSU_REASON_ADMIN_CANCELEDCanceled by the system, such as ahead of maintenance or shutdown.
OSU_REASON_INSUFFICIENT_BALANCERefused because the account cannot fund the order.
OSU_REASON_DUPLICATE_CLIENT_IDRefused because client_order_id is already in use by a live order.
OSU_REASON_EXCHANGE_ERRORRefused because of an internal exchange error. The order was not placed.
OSU_REASON_ALO_WOULD_CROSSCanceled because the ALO order would have crossed the book.
OSU_REASON_EXCHANGE_UNAVAILABLERefused because the exchange is not accepting orders right now.
OSU_REASON_CAPACITY_REACHEDRefused because the exchange has no capacity for another active lambda account right now.
OSU_REASON_INVALID_ORDERRefused because the order failed validation.
tm_infoobject

Timestamps of this update.

ShowHide 1 property
hw_ser_time_nsstringuint64

When the event was sequenced by the exchange, in Unix nanoseconds. A maker fill carries the taking order's time. 0 for a rejected order, or for an order the system canceled when the exchange restarted.

updated_time_msstringint64

When this update happened, in Unix milliseconds.

next_cursorstring

Pass as cursor to page further back. Absent on the last page.

GET/v1/order/status-updates/fills/recent
curl -X GET 'https://api.pax.markets/v1/order/status-updates/fills/recent' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/order/status-updates/fills/recent"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/order/status-updates/fills/recent";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/order/status-updates/fills/recent";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "order_status_updates": [
    {
      "osu": {
        "osu_id": "01a1bbc7-dd3e-7d4f-b152-6e802f7d91a4",
        "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
        "client_order_id": "my-order-1",
        "qty_filled_make": "0",
        "qty_filled_take": "100000",
        "qty_canceled": "0",
        "fill_value": "99990000",
        "fee_rebate": "2499",
        "order": {
          "side": 2,
          "market_id": "1",
          "qty": "100000",
          "ticks": 99990,
          "tif": 2,
          "origin": 1,
          "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093"
        },
        "order_status": 3,
        "reason": 0,
        "tm_info": {
          "hw_ser_time_ns": "1794151800124000417"
        }
      },
      "updated_time_ms": "1794151800125"
    }
  ],
  "next_cursor": "eyJ0IjoxNzk0MTQ4MjAwMTIzfQ"
}
{
  "error": "Invalid query parameter 'limit': must be u32"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Order API›Order Service

GetFillOrderStatusUpdatesSince

GEThttps://api.pax.markets/v1/order/status-updates/fills/since

Read the account's fills from a point in time onward, oldest first. A fill is a status update where the order traded. Covers the last 10,000 fills per account.

Request

since_time_msstringint64

Return updates at or after this time, in Unix milliseconds.

market_idstringuint64Optional

Return only updates for orders on this market.

limitintegerint32Optional

Maximum updates to return, from 1 to 1000. Defaults to 1000.

cursorstringOptional

Cursor from the previous response's next_cursor. Omit to start at since_time_ms.

Response

A successful response.

order_status_updatesobject[]

List of status updates on this page.

ShowHide 2 properties
osuobject

The status update, as streamed.

ShowHide 12 properties
osu_idstring

Exchange-assigned id of this status update.

order_idstring

Exchange-assigned id of the order this update belongs to.

client_order_idstring

The order's client_order_id. Empty if none was sent.

qty_filled_makestringint64

Quantity filled as maker in this update.

qty_filled_takestringint64

Quantity filled as taker in this update.

qty_canceledstringint64

Quantity canceled in this update.

fill_valuestringint64

Value filled in this update, in the quote asset's native units.

fee_rebatestringint64

Rebate paid, or fee charged when negative, in the quote asset's native units.

orderobject

The order as placed.

ShowHide 7 properties
sideenum

Side the order was placed on.

1 = ASK2 = BID
ASKSell the base asset.
BIDBuy the base asset.
market_idstringuint64

Market the order was placed on.

qtystringint64

Quantity submitted. Negative for a cancel order.

ticksintegerint32

Limit price in ticks.

tifenum

Time in force the order was placed with.

1 = IOC2 = GTC3 = ALO
IOCImmediate or cancel.
GTCGood until canceled.
ALOAdd liquidity only: rests if it would not cross, else canceled.
originenum

What placed the order.

1 = EXOGENOUS2 = LAMBDA3 = ADMIN
EXOGENOUSPlaced directly through the API.
LAMBDAPlaced by a lambda program.
ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.
lambda_idstring

Exchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.

order_statusenum

Order status after this update.

1 = ORDER_STATUS_PENDING2 = ORDER_STATUS_RESTING3 = ORDER_STATUS_FILLED4 = ORDER_STATUS_CANCELED5 = ORDER_STATUS_PARTIAL6 = ORDER_STATUS_REJECTED
ORDER_STATUS_PENDINGAccepted, not yet acknowledged by the matching engine.
ORDER_STATUS_RESTINGOn the book with quantity left to fill.
ORDER_STATUS_FILLEDFully filled.
ORDER_STATUS_CANCELEDCanceled with nothing filled.
ORDER_STATUS_PARTIALPartly filled, with the rest canceled.
ORDER_STATUS_REJECTEDRejected.
reasonenum

Why the system refused or canceled the order, if it did.

0 = OSU_REASON_UNSPECIFIED1 = OSU_REASON_ADMIN_CANCELED2 = OSU_REASON_INSUFFICIENT_BALANCE3 = OSU_REASON_DUPLICATE_CLIENT_ID4 = OSU_REASON_EXCHANGE_ERROR5 = OSU_REASON_ALO_WOULD_CROSS6 = OSU_REASON_EXCHANGE_UNAVAILABLE7 = OSU_REASON_CAPACITY_REACHED8 = OSU_REASON_INVALID_ORDER
OSU_REASON_UNSPECIFIEDNone.
OSU_REASON_ADMIN_CANCELEDCanceled by the system, such as ahead of maintenance or shutdown.
OSU_REASON_INSUFFICIENT_BALANCERefused because the account cannot fund the order.
OSU_REASON_DUPLICATE_CLIENT_IDRefused because client_order_id is already in use by a live order.
OSU_REASON_EXCHANGE_ERRORRefused because of an internal exchange error. The order was not placed.
OSU_REASON_ALO_WOULD_CROSSCanceled because the ALO order would have crossed the book.
OSU_REASON_EXCHANGE_UNAVAILABLERefused because the exchange is not accepting orders right now.
OSU_REASON_CAPACITY_REACHEDRefused because the exchange has no capacity for another active lambda account right now.
OSU_REASON_INVALID_ORDERRefused because the order failed validation.
tm_infoobject

Timestamps of this update.

ShowHide 1 property
hw_ser_time_nsstringuint64

When the event was sequenced by the exchange, in Unix nanoseconds. A maker fill carries the taking order's time. 0 for a rejected order, or for an order the system canceled when the exchange restarted.

updated_time_msstringint64

When this update happened, in Unix milliseconds.

next_cursorstring

Pass as cursor to fetch the next page. Absent on the last page.

GET/v1/order/status-updates/fills/since
curl -X GET 'https://api.pax.markets/v1/order/status-updates/fills/since?since_time_ms=1794148200123' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/order/status-updates/fills/since?since_time_ms=1794148200123"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/order/status-updates/fills/since?since_time_ms=1794148200123";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/order/status-updates/fills/since?since_time_ms=1794148200123";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "order_status_updates": [
    {
      "osu": {
        "osu_id": "01a1bbc7-dd3e-7d4f-b152-6e802f7d91a4",
        "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
        "client_order_id": "my-order-1",
        "qty_filled_make": "0",
        "qty_filled_take": "100000",
        "qty_canceled": "0",
        "fill_value": "99990000",
        "fee_rebate": "2499",
        "order": {
          "side": 2,
          "market_id": "1",
          "qty": "100000",
          "ticks": 99990,
          "tif": 2,
          "origin": 1,
          "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093"
        },
        "order_status": 3,
        "reason": 0,
        "tm_info": {
          "hw_ser_time_ns": "1794151800124000417"
        }
      },
      "updated_time_ms": "1794151800125"
    }
  ],
  "next_cursor": "eyJ0IjoxNzk0MTQ4MjAwMTIzfQ"
}
{
  "error": "Invalid query parameter 'limit': must be u32"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Order API›Order Service

GetOrderStatusUpdatesByTime

GEThttps://api.pax.markets/v1/order/status-updates/by-time

Fetch order status updates in a time range of up to 7 days, ordered oldest to newest. Updates appear up to 30 minutes after they happen.

Request

start_time_msstringint64

Return updates at or after this time, in Unix milliseconds.

end_time_msstringint64

Return updates before this time, in Unix milliseconds. At most 7 days after start_time_ms.

market_idstringuint64Optional

Return only updates for orders on this market.

limitintegerint32Optional

Maximum updates to return, from 1 to 10000. Defaults to 10000.

cursorstringOptional

Cursor from the previous response's next_cursor, with the same time range and market_id.

Response

A successful response.

order_status_updatesobject[]

List of status updates on this page.

ShowHide 2 properties
osuobject

The status update, as streamed.

ShowHide 12 properties
osu_idstring

Exchange-assigned id of this status update.

order_idstring

Exchange-assigned id of the order this update belongs to.

client_order_idstring

The order's client_order_id. Empty if none was sent.

qty_filled_makestringint64

Quantity filled as maker in this update.

qty_filled_takestringint64

Quantity filled as taker in this update.

qty_canceledstringint64

Quantity canceled in this update.

fill_valuestringint64

Value filled in this update, in the quote asset's native units.

fee_rebatestringint64

Rebate paid, or fee charged when negative, in the quote asset's native units.

orderobject

The order as placed.

ShowHide 7 properties
sideenum

Side the order was placed on.

1 = ASK2 = BID
ASKSell the base asset.
BIDBuy the base asset.
market_idstringuint64

Market the order was placed on.

qtystringint64

Quantity submitted. Negative for a cancel order.

ticksintegerint32

Limit price in ticks.

tifenum

Time in force the order was placed with.

1 = IOC2 = GTC3 = ALO
IOCImmediate or cancel.
GTCGood until canceled.
ALOAdd liquidity only: rests if it would not cross, else canceled.
originenum

What placed the order.

1 = EXOGENOUS2 = LAMBDA3 = ADMIN
EXOGENOUSPlaced directly through the API.
LAMBDAPlaced by a lambda program.
ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.
lambda_idstring

Exchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.

order_statusenum

Order status after this update.

1 = ORDER_STATUS_PENDING2 = ORDER_STATUS_RESTING3 = ORDER_STATUS_FILLED4 = ORDER_STATUS_CANCELED5 = ORDER_STATUS_PARTIAL6 = ORDER_STATUS_REJECTED
ORDER_STATUS_PENDINGAccepted, not yet acknowledged by the matching engine.
ORDER_STATUS_RESTINGOn the book with quantity left to fill.
ORDER_STATUS_FILLEDFully filled.
ORDER_STATUS_CANCELEDCanceled with nothing filled.
ORDER_STATUS_PARTIALPartly filled, with the rest canceled.
ORDER_STATUS_REJECTEDRejected.
reasonenum

Why the system refused or canceled the order, if it did.

0 = OSU_REASON_UNSPECIFIED1 = OSU_REASON_ADMIN_CANCELED2 = OSU_REASON_INSUFFICIENT_BALANCE3 = OSU_REASON_DUPLICATE_CLIENT_ID4 = OSU_REASON_EXCHANGE_ERROR5 = OSU_REASON_ALO_WOULD_CROSS6 = OSU_REASON_EXCHANGE_UNAVAILABLE7 = OSU_REASON_CAPACITY_REACHED8 = OSU_REASON_INVALID_ORDER
OSU_REASON_UNSPECIFIEDNone.
OSU_REASON_ADMIN_CANCELEDCanceled by the system, such as ahead of maintenance or shutdown.
OSU_REASON_INSUFFICIENT_BALANCERefused because the account cannot fund the order.
OSU_REASON_DUPLICATE_CLIENT_IDRefused because client_order_id is already in use by a live order.
OSU_REASON_EXCHANGE_ERRORRefused because of an internal exchange error. The order was not placed.
OSU_REASON_ALO_WOULD_CROSSCanceled because the ALO order would have crossed the book.
OSU_REASON_EXCHANGE_UNAVAILABLERefused because the exchange is not accepting orders right now.
OSU_REASON_CAPACITY_REACHEDRefused because the exchange has no capacity for another active lambda account right now.
OSU_REASON_INVALID_ORDERRefused because the order failed validation.
tm_infoobject

Timestamps of this update.

ShowHide 1 property
hw_ser_time_nsstringuint64

When the event was sequenced by the exchange, in Unix nanoseconds. A maker fill carries the taking order's time. 0 for a rejected order, or for an order the system canceled when the exchange restarted.

updated_time_msstringint64

When this update happened, in Unix milliseconds.

next_cursorstring

Pass as cursor to fetch the next page. Absent on the last page.

GET/v1/order/status-updates/by-time
curl -X GET 'https://api.pax.markets/v1/order/status-updates/by-time?start_time_ms=1794148200123&end_time_ms=1794151800123' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/order/status-updates/by-time?start_time_ms=1794148200123&end_time_ms=1794151800123"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/order/status-updates/by-time?start_time_ms=1794148200123&end_time_ms=1794151800123";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/order/status-updates/by-time?start_time_ms=1794148200123&end_time_ms=1794151800123";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "order_status_updates": [
    {
      "osu": {
        "osu_id": "01a1bbc7-dd3e-7d4f-b152-6e802f7d91a4",
        "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
        "client_order_id": "my-order-1",
        "qty_filled_make": "0",
        "qty_filled_take": "100000",
        "qty_canceled": "0",
        "fill_value": "99990000",
        "fee_rebate": "2499",
        "order": {
          "side": 2,
          "market_id": "1",
          "qty": "100000",
          "ticks": 99990,
          "tif": 2,
          "origin": 1,
          "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093"
        },
        "order_status": 3,
        "reason": 0,
        "tm_info": {
          "hw_ser_time_ns": "1794151800124000417"
        }
      },
      "updated_time_ms": "1794151800125"
    }
  ],
  "next_cursor": "eyJ0IjoxNzk0MTQ4MjAwMTIzfQ"
}
{
  "error": "Invalid query parameter 'limit': must be u32"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Lambda API›lambda

SubmitLambda

POSThttps://api.pax.markets/v1/lambda/submit
Permission: trade

Arm a lambda program. Requires a LAMBDA account.

Request

programobject

A lambda program.

ShowHide 1 kind
kindlocal

Watches a local order book on PAX.

predicateobject
ShowHide 5 properties
market_iduint64 | string

Market whose order book is watched.

sideenum

Side of the book the event happens on.

bidask
bidBuy the base asset.
askSell the base asset.
eventenum
restedremovedcanceledcrossed
restedLiquidity was added to the book from a GTC/ALO order.
removedLiquidity was removed from the book for any reason.
canceledLiquidity was removed from the book by a cancel.
crossedLiquidity was removed from the book by a trade.
pxobject

Which event prices qualify.

ShowHide 3 kinds
kindany

Any price.

kindevent_px

The event's price is in [min, max] ticks.

minint64 | stringOptional

A price, in units of the market's tick size.

maxint64 | stringOptional

A price, in units of the market's tick size.

kindtob_depth

The event’s price is in [min, max] ticks within the top-of-book as it was before the event. An event at or inside the best price, or on an empty side, is within 0 ticks.

minint64 | stringOptional

A price, in units of the market's tick size.

maxint64 | stringOptional

A price, in units of the market's tick size.

qtyobject

Which event quantities qualify.

ShowHide 3 kinds
kindany

Any quantity.

kindevent_qty

The quantity the event added or removed is in [min, max].

minuint64 | stringOptional

A base-asset quantity in native units, a multiple of the market's qty step size.

maxuint64 | stringOptional

A base-asset quantity in native units, a multiple of the market's qty step size.

kindfinal_level_qty

The quantity resting at the event's price after the event is in [min, max].

minuint64 | stringOptional

A base-asset quantity in native units, a multiple of the market's qty step size.

maxuint64 | stringOptional

A base-asset quantity in native units, a multiple of the market's qty step size.

orderobject

The underlying order placed on every fire.

ShowHide 2 kinds

Every kind has:

market_iduint64 | string

Market the order is placed on.

sideenum

Side of the order.

bidask
bidBuy the base asset.
askSell the base asset.
kindlimit

A limit order.

tifenum
gtciocalo
gtcGood until canceled: the unfilled quantity rests on the book.
iocImmediate or cancel: the unfilled quantity is canceled.
aloAdd liquidity only: rests like gtc, but the whole order is canceled if it would cross.
pxobject

Limit price.

ShowHide 1 kind
kindfixed

A fixed price, in ticks.

ticksint64 | string

A price, in units of the market's tick size.

qtyobject

Quantity.

ShowHide 1 kind
kindfixed

A fixed quantity, in the base asset's native units.

qtyuint64 | string

A base-asset quantity in native units, a multiple of the market's qty step size.

kindcancel

Cancel up to qty of the account's own resting liquidity at one price.

pxobject

Price of the resting liquidity.

ShowHide 1 kind
kindfixed

A fixed price, in ticks.

ticksint64 | string

A price, in units of the market's tick size.

qtyobject

Quantity to cancel.

ShowHide 1 kind
kindfixed

A fixed quantity, in the base asset's native units.

qtyuint64 | string

A base-asset quantity in native units, a multiple of the market's qty step size.

lifetimeobject

When a lambda program stops firing.

ShowHide 1 kind
kindonce

Fire once.

client_lambda_idstringOptional

Client-assigned id, at most 36 bytes. Omit or leave empty for none. Rejected if it matches another of the account's live lambda programs.

Response

A successful response.

lambda_idstringuuid

Exchange-assigned lambda id.

POST/v1/lambda/submit
curl -X POST 'https://api.pax.markets/v1/lambda/submit' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "program": {
    "kind": "local",
    "predicate": {
      "market_id": 1,
      "side": "ask",
      "event": "crossed",
      "px": {
        "kind": "tob_depth",
        "max": 2
      },
      "qty": {
        "kind": "event_qty",
        "min": 5000000
      }
    },
    "order": {
      "kind": "limit",
      "market_id": 1,
      "side": "ask",
      "tif": "gtc",
      "px": {
        "kind": "fixed",
        "ticks": 10105
      },
      "qty": {
        "kind": "fixed",
        "qty": 50000000
      }
    },
    "lifetime": {
      "kind": "once"
    }
  },
  "client_lambda_id": "my-lambda-1"
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/lambda/submit"
body = json.dumps({
      "program": {
        "kind": "local",
        "predicate": {
          "market_id": 1,
          "side": "ask",
          "event": "crossed",
          "px": {
            "kind": "tob_depth",
            "max": 2
          },
          "qty": {
            "kind": "event_qty",
            "min": 5000000
          }
        },
        "order": {
          "kind": "limit",
          "market_id": 1,
          "side": "ask",
          "tif": "gtc",
          "px": {
            "kind": "fixed",
            "ticks": 10105
          },
          "qty": {
            "kind": "fixed",
            "qty": 50000000
          }
        },
        "lifetime": {
          "kind": "once"
        }
      },
      "client_lambda_id": "my-lambda-1"
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/lambda/submit";
let body = serde_json::to_string(&serde_json::json!({
  "program": {
    "kind": "local",
    "predicate": {
      "market_id": 1,
      "side": "ask",
      "event": "crossed",
      "px": {
        "kind": "tob_depth",
        "max": 2
      },
      "qty": {
        "kind": "event_qty",
        "min": 5000000
      }
    },
    "order": {
      "kind": "limit",
      "market_id": 1,
      "side": "ask",
      "tif": "gtc",
      "px": {
        "kind": "fixed",
        "ticks": 10105
      },
      "qty": {
        "kind": "fixed",
        "qty": 50000000
      }
    },
    "lifetime": {
      "kind": "once"
    }
  },
  "client_lambda_id": "my-lambda-1"
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/lambda/submit";
const body = JSON.stringify({
  "program": {
    "kind": "local",
    "predicate": {
      "market_id": 1,
      "side": "ask",
      "event": "crossed",
      "px": {
        "kind": "tob_depth",
        "max": 2
      },
      "qty": {
        "kind": "event_qty",
        "min": 5000000
      }
    },
    "order": {
      "kind": "limit",
      "market_id": 1,
      "side": "ask",
      "tif": "gtc",
      "px": {
        "kind": "fixed",
        "ticks": 10105
      },
      "qty": {
        "kind": "fixed",
        "qty": 50000000
      }
    },
    "lifetime": {
      "kind": "once"
    }
  },
  "client_lambda_id": "my-lambda-1"
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093"
}
{
  "error": {
    "code": "invalid_request",
    "message": "A client-assigned id cannot exceed 36 bytes."
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Lambda API›lambda

CancelLambda

POSThttps://api.pax.markets/v1/lambda/cancel
Permission: trade

Cancel a lambda program, named by its exchange-assigned id or its client-assigned id, releasing its untriggered quantity.

Request

keyobject

The lambda program to cancel.

ShowHide 2 kinds
kindexchange

The exchange-assigned id.

idstringuuid
kindclient

The client-assigned id, at most 36 bytes. Only matches a live lambda program.

idstring

Response

A successful response.

lambda_idstringuuid

Exchange-assigned id of the lambda program being canceled.

cancel_idstringuuid

Exchange-assigned id of this cancel.

POST/v1/lambda/cancel
curl -X POST 'https://api.pax.markets/v1/lambda/cancel' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "key": {
    "kind": "exchange",
    "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
  }
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/lambda/cancel"
body = json.dumps({
      "key": {
        "kind": "exchange",
        "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
      }
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/lambda/cancel";
let body = serde_json::to_string(&serde_json::json!({
  "key": {
    "kind": "exchange",
    "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
  }
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/lambda/cancel";
const body = JSON.stringify({
  "key": {
    "kind": "exchange",
    "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
  }
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093",
  "cancel_id": "01a1bbc7-dd40-7f61-9374-80a24b9fb3c6"
}
{
  "error": {
    "code": "invalid_request",
    "message": "Failed to parse the request body as JSON: expected value at line 1 column 1"
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Lambda API›lambda

GetLambdas

GEThttps://api.pax.markets/v1/lambda/list

List the account's lambda programs, newest first, optionally narrowed to one market and one status.

Request

statusenumOptional

Return only lambda programs in this status.

pendingin_forceout_of_forcerejected
pendingSubmitted, not yet accepted.
in_forceIn force: evaluated on every matching event.
out_of_forceNo longer in force: exhausted, canceled, or reset by a system restart.
rejectedRejected.
market_idintegeruint64Optional

Return only lambda programs on this market. Omit for every market.

limitintegeruint32Optional

Maximum lambda programs to return, from 1 to 1000. Defaults to 1000.

cursorstringOptional

Cursor from the previous response's next_cursor. Omit for the first page.

Response

A successful response.

lambdasobject[]
ShowHide 7 properties
lambda_idstringuuid

Exchange-assigned lambda id.

client_lambda_idstringNullable

Client-assigned id from the submit request.

statusenum
pendingin_forceout_of_forcerejected
pendingSubmitted, not yet accepted.
in_forceIn force: evaluated on every matching event.
out_of_forceNo longer in force: exhausted, canceled, or reset by a system restart.
rejectedRejected.
programobjectNullable

The program as it was submitted.

ShowHide 1 kind
kindlocal

Watches a local order book on PAX.

predicateobject
ShowHide 5 properties
market_iduint64 | string

Market whose order book is watched.

sideenum

Side of the book the event happens on.

bidask
bidBuy the base asset.
askSell the base asset.
eventenum
restedremovedcanceledcrossed
restedLiquidity was added to the book from a GTC/ALO order.
removedLiquidity was removed from the book for any reason.
canceledLiquidity was removed from the book by a cancel.
crossedLiquidity was removed from the book by a trade.
pxobject

Which event prices qualify.

ShowHide 3 kinds
kindany

Any price.

kindevent_px

The event's price is in [min, max] ticks.

minint64 | stringNullable

A price, in units of the market's tick size.

maxint64 | stringNullable

A price, in units of the market's tick size.

kindtob_depth

The event’s price is in [min, max] ticks within the top-of-book as it was before the event. An event at or inside the best price, or on an empty side, is within 0 ticks.

minint64 | stringNullable

A price, in units of the market's tick size.

maxint64 | stringNullable

A price, in units of the market's tick size.

qtyobject

Which event quantities qualify.

ShowHide 3 kinds
kindany

Any quantity.

kindevent_qty

The quantity the event added or removed is in [min, max].

minuint64 | stringNullable

A base-asset quantity in native units, a multiple of the market's qty step size.

maxuint64 | stringNullable

A base-asset quantity in native units, a multiple of the market's qty step size.

kindfinal_level_qty

The quantity resting at the event's price after the event is in [min, max].

minuint64 | stringNullable

A base-asset quantity in native units, a multiple of the market's qty step size.

maxuint64 | stringNullable

A base-asset quantity in native units, a multiple of the market's qty step size.

orderobject

The underlying order placed on every fire.

ShowHide 2 kinds

Every kind has:

market_iduint64 | string

Market the order is placed on.

sideenum

Side of the order.

bidask
bidBuy the base asset.
askSell the base asset.
kindlimit

A limit order.

tifenum
gtciocalo
gtcGood until canceled: the unfilled quantity rests on the book.
iocImmediate or cancel: the unfilled quantity is canceled.
aloAdd liquidity only: rests like gtc, but the whole order is canceled if it would cross.
pxobject

Limit price.

ShowHide 1 kind
kindfixed

A fixed price, in ticks.

ticksint64 | string

A price, in units of the market's tick size.

qtyobject

Quantity.

ShowHide 1 kind
kindfixed

A fixed quantity, in the base asset's native units.

qtyuint64 | string

A base-asset quantity in native units, a multiple of the market's qty step size.

kindcancel

Cancel up to qty of the account's own resting liquidity at one price.

pxobject

Price of the resting liquidity.

ShowHide 1 kind
kindfixed

A fixed price, in ticks.

ticksint64 | string

A price, in units of the market's tick size.

qtyobject

Quantity to cancel.

ShowHide 1 kind
kindfixed

A fixed quantity, in the base asset's native units.

qtyuint64 | string

A base-asset quantity in native units, a multiple of the market's qty step size.

lifetimeobject

When a lambda program stops firing.

ShowHide 1 kind
kindonce

Fire once.

qty_triggeredstringuint64

Quantity the lambda program has placed so far.

created_time_msstringint64

When the lambda program was submitted, in Unix milliseconds.

updated_time_msstringint64

When the lambda program last changed, in Unix milliseconds.

next_cursorstringNullable

Pass as cursor to fetch the next page. Null on the last page.

GET/v1/lambda/list
curl -X GET 'https://api.pax.markets/v1/lambda/list' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/lambda/list"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/lambda/list";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/lambda/list";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "lambdas": [
    {
      "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093",
      "client_lambda_id": "my-lambda-1",
      "status": "in_force",
      "program": {
        "kind": "local",
        "predicate": {
          "market_id": "1",
          "side": "ask",
          "event": "crossed",
          "px": {
            "kind": "tob_depth",
            "max": "2"
          },
          "qty": {
            "kind": "event_qty",
            "min": "5000000"
          }
        },
        "order": {
          "kind": "limit",
          "market_id": "1",
          "side": "ask",
          "tif": "gtc",
          "px": {
            "kind": "fixed",
            "ticks": "10105"
          },
          "qty": {
            "kind": "fixed",
            "qty": "50000000"
          }
        },
        "lifetime": {
          "kind": "once"
        }
      },
      "qty_triggered": "0",
      "created_time_ms": "1794151800123",
      "updated_time_ms": "1794151800125"
    }
  ],
  "next_cursor": "eyJ0IjoxNzk0MTQ4MjAwMTIzfQ"
}
{
  "error": {
    "code": "invalid_request",
    "message": "Invalid query: invalid digit found in string"
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Lambda API›lambda

GetLambda

GEThttps://api.pax.markets/v1/lambda/{lambda_id}

Fetch one lambda program by lambda_id.

Path Parameters

lambda_idstringuuid

Exchange-assigned id of the lambda program to fetch.

Response

A successful response.

lambda_idstringuuid

Exchange-assigned lambda id.

client_lambda_idstringNullable

Client-assigned id from the submit request.

statusenum
pendingin_forceout_of_forcerejected
pendingSubmitted, not yet accepted.
in_forceIn force: evaluated on every matching event.
out_of_forceNo longer in force: exhausted, canceled, or reset by a system restart.
rejectedRejected.
programobjectNullable

The program as it was submitted.

ShowHide 1 kind
kindlocal

Watches a local order book on PAX.

predicateobject
ShowHide 5 properties
market_iduint64 | string

Market whose order book is watched.

sideenum

Side of the book the event happens on.

bidask
bidBuy the base asset.
askSell the base asset.
eventenum
restedremovedcanceledcrossed
restedLiquidity was added to the book from a GTC/ALO order.
removedLiquidity was removed from the book for any reason.
canceledLiquidity was removed from the book by a cancel.
crossedLiquidity was removed from the book by a trade.
pxobject

Which event prices qualify.

ShowHide 3 kinds
kindany

Any price.

kindevent_px

The event's price is in [min, max] ticks.

minint64 | stringNullable

A price, in units of the market's tick size.

maxint64 | stringNullable

A price, in units of the market's tick size.

kindtob_depth

The event’s price is in [min, max] ticks within the top-of-book as it was before the event. An event at or inside the best price, or on an empty side, is within 0 ticks.

minint64 | stringNullable

A price, in units of the market's tick size.

maxint64 | stringNullable

A price, in units of the market's tick size.

qtyobject

Which event quantities qualify.

ShowHide 3 kinds
kindany

Any quantity.

kindevent_qty

The quantity the event added or removed is in [min, max].

minuint64 | stringNullable

A base-asset quantity in native units, a multiple of the market's qty step size.

maxuint64 | stringNullable

A base-asset quantity in native units, a multiple of the market's qty step size.

kindfinal_level_qty

The quantity resting at the event's price after the event is in [min, max].

minuint64 | stringNullable

A base-asset quantity in native units, a multiple of the market's qty step size.

maxuint64 | stringNullable

A base-asset quantity in native units, a multiple of the market's qty step size.

orderobject

The underlying order placed on every fire.

ShowHide 2 kinds

Every kind has:

market_iduint64 | string

Market the order is placed on.

sideenum

Side of the order.

bidask
bidBuy the base asset.
askSell the base asset.
kindlimit

A limit order.

tifenum
gtciocalo
gtcGood until canceled: the unfilled quantity rests on the book.
iocImmediate or cancel: the unfilled quantity is canceled.
aloAdd liquidity only: rests like gtc, but the whole order is canceled if it would cross.
pxobject

Limit price.

ShowHide 1 kind
kindfixed

A fixed price, in ticks.

ticksint64 | string

A price, in units of the market's tick size.

qtyobject

Quantity.

ShowHide 1 kind
kindfixed

A fixed quantity, in the base asset's native units.

qtyuint64 | string

A base-asset quantity in native units, a multiple of the market's qty step size.

kindcancel

Cancel up to qty of the account's own resting liquidity at one price.

pxobject

Price of the resting liquidity.

ShowHide 1 kind
kindfixed

A fixed price, in ticks.

ticksint64 | string

A price, in units of the market's tick size.

qtyobject

Quantity to cancel.

ShowHide 1 kind
kindfixed

A fixed quantity, in the base asset's native units.

qtyuint64 | string

A base-asset quantity in native units, a multiple of the market's qty step size.

lifetimeobject

When a lambda program stops firing.

ShowHide 1 kind
kindonce

Fire once.

qty_triggeredstringuint64

Quantity the lambda program has placed so far.

created_time_msstringint64

When the lambda program was submitted, in Unix milliseconds.

updated_time_msstringint64

When the lambda program last changed, in Unix milliseconds.

GET/v1/lambda/{lambda_id}
curl -X GET 'https://api.pax.markets/v1/lambda/01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/lambda/01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/lambda/01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/lambda/01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093",
  "client_lambda_id": "my-lambda-1",
  "status": "in_force",
  "program": {
    "kind": "local",
    "predicate": {
      "market_id": "1",
      "side": "ask",
      "event": "crossed",
      "px": {
        "kind": "tob_depth",
        "max": "2"
      },
      "qty": {
        "kind": "event_qty",
        "min": "5000000"
      }
    },
    "order": {
      "kind": "limit",
      "market_id": "1",
      "side": "ask",
      "tif": "gtc",
      "px": {
        "kind": "fixed",
        "ticks": "10105"
      },
      "qty": {
        "kind": "fixed",
        "qty": "50000000"
      }
    },
    "lifetime": {
      "kind": "once"
    }
  },
  "qty_triggered": "0",
  "created_time_ms": "1794151800123",
  "updated_time_ms": "1794151800125"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Lambda API›lambda

GetActiveLambdas

GEThttps://api.pax.markets/v1/lambda/active

List the account's lambda programs currently in force. The user-data WebSocket's snapshot carries the same list.

Request

market_idintegeruint64Optional

Return only lambda programs on this market. Omit for every market.

Response

A successful response.

lambdasobject[]

The account's lambda programs in force.

ShowHide 7 properties
lambda_idstringuuid

Exchange-assigned lambda id.

client_lambda_idstringNullable

Client-assigned id from the submit request.

statusenum
pendingin_forceout_of_forcerejected
pendingSubmitted, not yet accepted.
in_forceIn force: evaluated on every matching event.
out_of_forceNo longer in force: exhausted, canceled, or reset by a system restart.
rejectedRejected.
programobjectNullable

The program as it was submitted.

ShowHide 1 kind
kindlocal

Watches a local order book on PAX.

predicateobject
ShowHide 5 properties
market_iduint64 | string

Market whose order book is watched.

sideenum

Side of the book the event happens on.

bidask
bidBuy the base asset.
askSell the base asset.
eventenum
restedremovedcanceledcrossed
restedLiquidity was added to the book from a GTC/ALO order.
removedLiquidity was removed from the book for any reason.
canceledLiquidity was removed from the book by a cancel.
crossedLiquidity was removed from the book by a trade.
pxobject

Which event prices qualify.

ShowHide 3 kinds
kindany

Any price.

kindevent_px

The event's price is in [min, max] ticks.

minint64 | stringNullable

A price, in units of the market's tick size.

maxint64 | stringNullable

A price, in units of the market's tick size.

kindtob_depth

The event’s price is in [min, max] ticks within the top-of-book as it was before the event. An event at or inside the best price, or on an empty side, is within 0 ticks.

minint64 | stringNullable

A price, in units of the market's tick size.

maxint64 | stringNullable

A price, in units of the market's tick size.

qtyobject

Which event quantities qualify.

ShowHide 3 kinds
kindany

Any quantity.

kindevent_qty

The quantity the event added or removed is in [min, max].

minuint64 | stringNullable

A base-asset quantity in native units, a multiple of the market's qty step size.

maxuint64 | stringNullable

A base-asset quantity in native units, a multiple of the market's qty step size.

kindfinal_level_qty

The quantity resting at the event's price after the event is in [min, max].

minuint64 | stringNullable

A base-asset quantity in native units, a multiple of the market's qty step size.

maxuint64 | stringNullable

A base-asset quantity in native units, a multiple of the market's qty step size.

orderobject

The underlying order placed on every fire.

ShowHide 2 kinds

Every kind has:

market_iduint64 | string

Market the order is placed on.

sideenum

Side of the order.

bidask
bidBuy the base asset.
askSell the base asset.
kindlimit

A limit order.

tifenum
gtciocalo
gtcGood until canceled: the unfilled quantity rests on the book.
iocImmediate or cancel: the unfilled quantity is canceled.
aloAdd liquidity only: rests like gtc, but the whole order is canceled if it would cross.
pxobject

Limit price.

ShowHide 1 kind
kindfixed

A fixed price, in ticks.

ticksint64 | string

A price, in units of the market's tick size.

qtyobject

Quantity.

ShowHide 1 kind
kindfixed

A fixed quantity, in the base asset's native units.

qtyuint64 | string

A base-asset quantity in native units, a multiple of the market's qty step size.

kindcancel

Cancel up to qty of the account's own resting liquidity at one price.

pxobject

Price of the resting liquidity.

ShowHide 1 kind
kindfixed

A fixed price, in ticks.

ticksint64 | string

A price, in units of the market's tick size.

qtyobject

Quantity to cancel.

ShowHide 1 kind
kindfixed

A fixed quantity, in the base asset's native units.

qtyuint64 | string

A base-asset quantity in native units, a multiple of the market's qty step size.

lifetimeobject

When a lambda program stops firing.

ShowHide 1 kind
kindonce

Fire once.

qty_triggeredstringuint64

Quantity the lambda program has placed so far.

created_time_msstringint64

When the lambda program was submitted, in Unix milliseconds.

updated_time_msstringint64

When the lambda program last changed, in Unix milliseconds.

GET/v1/lambda/active
curl -X GET 'https://api.pax.markets/v1/lambda/active' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/lambda/active"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/lambda/active";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/lambda/active";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "lambdas": [
    {
      "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093",
      "client_lambda_id": "my-lambda-1",
      "status": "in_force",
      "program": {
        "kind": "local",
        "predicate": {
          "market_id": "1",
          "side": "ask",
          "event": "crossed",
          "px": {
            "kind": "tob_depth",
            "max": "2"
          },
          "qty": {
            "kind": "event_qty",
            "min": "5000000"
          }
        },
        "order": {
          "kind": "limit",
          "market_id": "1",
          "side": "ask",
          "tif": "gtc",
          "px": {
            "kind": "fixed",
            "ticks": "10105"
          },
          "qty": {
            "kind": "fixed",
            "qty": "50000000"
          }
        },
        "lifetime": {
          "kind": "once"
        }
      },
      "qty_triggered": "0",
      "created_time_ms": "1794151800123",
      "updated_time_ms": "1794151800125"
    }
  ]
}
{
  "error": {
    "code": "invalid_request",
    "message": "Invalid query: invalid digit found in string"
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Lambda API›lambda

GetPendingLambdaCancels

GEThttps://api.pax.markets/v1/lambda/pending-cancels

List the account's lambda cancels that are not yet confirmed.

Response

A successful response.

pending_cancelsobject[]
ShowHide 3 properties
lambda_idstringuuid

Lambda program being canceled.

client_lambda_idstringNullable

Client-assigned lambda id, if one was sent.

cancel_idstringuuid

Exchange-assigned id of this lambda cancel request.

GET/v1/lambda/pending-cancels
curl -X GET 'https://api.pax.markets/v1/lambda/pending-cancels' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/lambda/pending-cancels"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/lambda/pending-cancels";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/lambda/pending-cancels";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "pending_cancels": [
    {
      "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093",
      "client_lambda_id": "my-lambda-1",
      "cancel_id": "01a1bbc7-dd40-7f61-9374-80a24b9fb3c6"
    }
  ]
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Lambda API›lambda

GetLambdaStatusUpdates

GEThttps://api.pax.markets/v1/lambda/status-updates

Read the full status update history of one lambda program. Updates can take up to 15 minutes to appear here.

Request

lambda_idstringuuid

Exchange-assigned id of the lambda program whose history to read.

limitintegeruint32Optional

Maximum updates to return, from 1 to 1000. Defaults to 1000.

cursorstringOptional

Cursor from the previous response's next_cursor. Omit for the first page.

Response

A successful response.

lambda_status_updatesobject[]
ShowHide 8 properties
lsu_idstringuuidNullable

Id of this status update.

lambda_idstringuuidNullable

Exchange-assigned id of the lambda program this update belongs to. Null for older updates that did not record it.

client_lambda_idstringNullable

Client-assigned lambda id, if one was sent.

delta_qtystringint64

Change in the lambda program's untriggered quantity: the full quantity when programmed, minus what was left when canceled or reset by a system restart, and 0 otherwise.

statusenum

New status of the lambda program.

pendingin_forceout_of_forcerejected
pendingSubmitted, not yet accepted.
in_forceIn force: evaluated on every matching event.
out_of_forceNo longer in force: exhausted, canceled, or reset by a system restart.
rejectedRejected.
reasonenum
programmedcanceledmodifiedexhaustedsystem_restartinsufficient_balanceduplicate_client_idinvalid_lambdaexchange_errorexchange_unavailablecapacity_reachedcancel_missed
programmedAccepted and now in force.
canceledThe lambda program was successfully canceled and its untriggered quantity released.
modifiedThe lambda program's quantity changed.
exhaustedAll quantity has triggered.
system_restartState reset by a system restart.
insufficient_balanceRefused because the account cannot fund the lambda program.
duplicate_client_idRefused because client_lambda_id is already in use by a live lambda program.
invalid_lambdaRefused because the lambda program failed validation.
exchange_errorRefused because of an internal exchange error. The lambda program was not placed.
exchange_unavailableRefused because the exchange is not accepting lambda programs right now.
capacity_reachedRefused because the exchange has no capacity for the lambda program right now.
cancel_missedThe cancel had nothing to cancel: the lambda program had already fully triggered or ended.
created_time_msstringint64

When this update happened, in Unix milliseconds.

cancel_idstringuuidNullable

Exchange-assigned id of the lambda cancel request. Null unless reason is canceled or cancel_missed.

next_cursorstringNullable

Pass as cursor to fetch the next page. Null on the last page.

GET/v1/lambda/status-updates
curl -X GET 'https://api.pax.markets/v1/lambda/status-updates?lambda_id=01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/lambda/status-updates?lambda_id=01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/lambda/status-updates?lambda_id=01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/lambda/status-updates?lambda_id=01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "lambda_status_updates": [
    {
      "lsu_id": "01a1bbc7-dd3f-7e50-8263-7f913a8ea2b5",
      "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093",
      "client_lambda_id": "my-lambda-1",
      "delta_qty": "100000",
      "status": "in_force",
      "reason": "programmed",
      "created_time_ms": "1794151800123",
      "cancel_id": null
    }
  ],
  "next_cursor": "eyJ0IjoxNzk0MTQ4MjAwMTIzfQ"
}
{
  "error": {
    "code": "invalid_request",
    "message": "Invalid query: invalid digit found in string"
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Lambda API›lambda

GetRecentLambdaStatusUpdates

GEThttps://api.pax.markets/v1/lambda/status-updates/recent

Read the account's most recent lambda status updates, newest first. Covers the last 10,000 updates per account.

Request

limitintegeruint32Optional

Maximum updates to return, from 1 to 1000. Defaults to 1000.

cursorstringOptional

Cursor from the previous response's next_cursor. Omit to start at the newest update.

Response

A successful response.

lambda_status_updatesobject[]
ShowHide 8 properties
lsu_idstringuuidNullable

Id of this status update.

lambda_idstringuuidNullable

Exchange-assigned id of the lambda program this update belongs to. Null for older updates that did not record it.

client_lambda_idstringNullable

Client-assigned lambda id, if one was sent.

delta_qtystringint64

Change in the lambda program's untriggered quantity: the full quantity when programmed, minus what was left when canceled or reset by a system restart, and 0 otherwise.

statusenum

New status of the lambda program.

pendingin_forceout_of_forcerejected
pendingSubmitted, not yet accepted.
in_forceIn force: evaluated on every matching event.
out_of_forceNo longer in force: exhausted, canceled, or reset by a system restart.
rejectedRejected.
reasonenum
programmedcanceledmodifiedexhaustedsystem_restartinsufficient_balanceduplicate_client_idinvalid_lambdaexchange_errorexchange_unavailablecapacity_reachedcancel_missed
programmedAccepted and now in force.
canceledThe lambda program was successfully canceled and its untriggered quantity released.
modifiedThe lambda program's quantity changed.
exhaustedAll quantity has triggered.
system_restartState reset by a system restart.
insufficient_balanceRefused because the account cannot fund the lambda program.
duplicate_client_idRefused because client_lambda_id is already in use by a live lambda program.
invalid_lambdaRefused because the lambda program failed validation.
exchange_errorRefused because of an internal exchange error. The lambda program was not placed.
exchange_unavailableRefused because the exchange is not accepting lambda programs right now.
capacity_reachedRefused because the exchange has no capacity for the lambda program right now.
cancel_missedThe cancel had nothing to cancel: the lambda program had already fully triggered or ended.
created_time_msstringint64

When this update happened, in Unix milliseconds.

cancel_idstringuuidNullable

Exchange-assigned id of the lambda cancel request. Null unless reason is canceled or cancel_missed.

next_cursorstringNullable

Pass as cursor to fetch the next page. Null on the last page.

GET/v1/lambda/status-updates/recent
curl -X GET 'https://api.pax.markets/v1/lambda/status-updates/recent' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/lambda/status-updates/recent"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/lambda/status-updates/recent";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/lambda/status-updates/recent";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "lambda_status_updates": [
    {
      "lsu_id": "01a1bbc7-dd3f-7e50-8263-7f913a8ea2b5",
      "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093",
      "client_lambda_id": "my-lambda-1",
      "delta_qty": "100000",
      "status": "in_force",
      "reason": "programmed",
      "created_time_ms": "1794151800123",
      "cancel_id": null
    }
  ],
  "next_cursor": "eyJ0IjoxNzk0MTQ4MjAwMTIzfQ"
}
{
  "error": {
    "code": "invalid_request",
    "message": "Invalid query: invalid digit found in string"
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Lambda API›lambda

GetLambdaStatusUpdatesSince

GEThttps://api.pax.markets/v1/lambda/status-updates/since

Read the account's lambda status updates from a point in time onward, oldest first. Covers the last 10,000 updates per account.

Request

since_time_msintegerint64

Return updates at or after this time, in Unix milliseconds.

limitintegeruint32Optional

Maximum updates to return, from 1 to 1000. Defaults to 1000.

cursorstringOptional

Cursor from the previous response's next_cursor. Omit to start at since_time_ms.

Response

A successful response.

lambda_status_updatesobject[]
ShowHide 8 properties
lsu_idstringuuidNullable

Id of this status update.

lambda_idstringuuidNullable

Exchange-assigned id of the lambda program this update belongs to. Null for older updates that did not record it.

client_lambda_idstringNullable

Client-assigned lambda id, if one was sent.

delta_qtystringint64

Change in the lambda program's untriggered quantity: the full quantity when programmed, minus what was left when canceled or reset by a system restart, and 0 otherwise.

statusenum

New status of the lambda program.

pendingin_forceout_of_forcerejected
pendingSubmitted, not yet accepted.
in_forceIn force: evaluated on every matching event.
out_of_forceNo longer in force: exhausted, canceled, or reset by a system restart.
rejectedRejected.
reasonenum
programmedcanceledmodifiedexhaustedsystem_restartinsufficient_balanceduplicate_client_idinvalid_lambdaexchange_errorexchange_unavailablecapacity_reachedcancel_missed
programmedAccepted and now in force.
canceledThe lambda program was successfully canceled and its untriggered quantity released.
modifiedThe lambda program's quantity changed.
exhaustedAll quantity has triggered.
system_restartState reset by a system restart.
insufficient_balanceRefused because the account cannot fund the lambda program.
duplicate_client_idRefused because client_lambda_id is already in use by a live lambda program.
invalid_lambdaRefused because the lambda program failed validation.
exchange_errorRefused because of an internal exchange error. The lambda program was not placed.
exchange_unavailableRefused because the exchange is not accepting lambda programs right now.
capacity_reachedRefused because the exchange has no capacity for the lambda program right now.
cancel_missedThe cancel had nothing to cancel: the lambda program had already fully triggered or ended.
created_time_msstringint64

When this update happened, in Unix milliseconds.

cancel_idstringuuidNullable

Exchange-assigned id of the lambda cancel request. Null unless reason is canceled or cancel_missed.

next_cursorstringNullable

Pass as cursor to fetch the next page. Null on the last page.

GET/v1/lambda/status-updates/since
curl -X GET 'https://api.pax.markets/v1/lambda/status-updates/since?since_time_ms=1794148200123' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/lambda/status-updates/since?since_time_ms=1794148200123"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/lambda/status-updates/since?since_time_ms=1794148200123";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/lambda/status-updates/since?since_time_ms=1794148200123";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "lambda_status_updates": [
    {
      "lsu_id": "01a1bbc7-dd3f-7e50-8263-7f913a8ea2b5",
      "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093",
      "client_lambda_id": "my-lambda-1",
      "delta_qty": "100000",
      "status": "in_force",
      "reason": "programmed",
      "created_time_ms": "1794151800123",
      "cancel_id": null
    }
  ],
  "next_cursor": "eyJ0IjoxNzk0MTQ4MjAwMTIzfQ"
}
{
  "error": {
    "code": "invalid_request",
    "message": "Invalid query: invalid digit found in string"
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Lambda API›lambda

GetLambdaStatusUpdatesByTime

GEThttps://api.pax.markets/v1/lambda/status-updates/by-time

Fetch lambda status updates in a time range of up to 7 days, oldest first. Updates appear up to 30 minutes after they happen.

Request

start_time_msintegerint64

Return updates at or after this time, in Unix milliseconds.

end_time_msintegerint64

Return updates before this time, in Unix milliseconds. At most 7 days after start_time_ms.

limitintegeruint32Optional

Maximum updates to return, from 1 to 10000. Defaults to 10000.

cursorstringOptional

Cursor from the previous response's next_cursor, with the same time range.

Response

A successful response.

lambda_status_updatesobject[]
ShowHide 8 properties
lsu_idstringuuidNullable

Id of this status update.

lambda_idstringuuidNullable

Exchange-assigned id of the lambda program this update belongs to. Null for older updates that did not record it.

client_lambda_idstringNullable

Client-assigned lambda id, if one was sent.

delta_qtystringint64

Change in the lambda program's untriggered quantity: the full quantity when programmed, minus what was left when canceled or reset by a system restart, and 0 otherwise.

statusenum

New status of the lambda program.

pendingin_forceout_of_forcerejected
pendingSubmitted, not yet accepted.
in_forceIn force: evaluated on every matching event.
out_of_forceNo longer in force: exhausted, canceled, or reset by a system restart.
rejectedRejected.
reasonenum
programmedcanceledmodifiedexhaustedsystem_restartinsufficient_balanceduplicate_client_idinvalid_lambdaexchange_errorexchange_unavailablecapacity_reachedcancel_missed
programmedAccepted and now in force.
canceledThe lambda program was successfully canceled and its untriggered quantity released.
modifiedThe lambda program's quantity changed.
exhaustedAll quantity has triggered.
system_restartState reset by a system restart.
insufficient_balanceRefused because the account cannot fund the lambda program.
duplicate_client_idRefused because client_lambda_id is already in use by a live lambda program.
invalid_lambdaRefused because the lambda program failed validation.
exchange_errorRefused because of an internal exchange error. The lambda program was not placed.
exchange_unavailableRefused because the exchange is not accepting lambda programs right now.
capacity_reachedRefused because the exchange has no capacity for the lambda program right now.
cancel_missedThe cancel had nothing to cancel: the lambda program had already fully triggered or ended.
created_time_msstringint64

When this update happened, in Unix milliseconds.

cancel_idstringuuidNullable

Exchange-assigned id of the lambda cancel request. Null unless reason is canceled or cancel_missed.

next_cursorstringNullable

Pass as cursor to fetch the next page. Null on the last page.

GET/v1/lambda/status-updates/by-time
curl -X GET 'https://api.pax.markets/v1/lambda/status-updates/by-time?start_time_ms=1794148200123&end_time_ms=1794151800123' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/lambda/status-updates/by-time?start_time_ms=1794148200123&end_time_ms=1794151800123"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/lambda/status-updates/by-time?start_time_ms=1794148200123&end_time_ms=1794151800123";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/lambda/status-updates/by-time?start_time_ms=1794148200123&end_time_ms=1794151800123";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "lambda_status_updates": [
    {
      "lsu_id": "01a1bbc7-dd3f-7e50-8263-7f913a8ea2b5",
      "lambda_id": "01a1bbc7-dd3d-7c3e-a041-5d7f1e6c8093",
      "client_lambda_id": "my-lambda-1",
      "delta_qty": "100000",
      "status": "in_force",
      "reason": "programmed",
      "created_time_ms": "1794151800123",
      "cancel_id": null
    }
  ],
  "next_cursor": "eyJ0IjoxNzk0MTQ4MjAwMTIzfQ"
}
{
  "error": {
    "code": "invalid_request",
    "message": "Invalid query: invalid digit found in string"
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Account API›Account Service

RevokeApiKey

POSThttps://api.pax.markets/v1/account/revoke-api-key
Permission: withdraw

Request

key_idstring

Response

A successful response.

successboolean
POST/v1/account/revoke-api-key
curl -X POST 'https://api.pax.markets/v1/account/revoke-api-key' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "key_id": "pax_live_a3b4c5d6e7f80912ab34cd56"
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/account/revoke-api-key"
body = json.dumps({
      "key_id": "pax_live_a3b4c5d6e7f80912ab34cd56"
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/account/revoke-api-key";
let body = serde_json::to_string(&serde_json::json!({
  "key_id": "pax_live_a3b4c5d6e7f80912ab34cd56"
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/account/revoke-api-key";
const body = JSON.stringify({
  "key_id": "pax_live_a3b4c5d6e7f80912ab34cd56"
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "success": true
}
{
  "error": "Failed to parse the request body as JSON: expected value at line 1 column 1"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Account API›Account Service

GetBalance

GEThttps://api.pax.markets/v1/account/get-balance

Request

assetenumOptional
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD

Response

A successful response.

asset_balancesobject[]
ShowHide 3 properties
assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
balance_qtystringint64
frozen_qtystringint64
GET/v1/account/get-balance
curl -X GET 'https://api.pax.markets/v1/account/get-balance' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/account/get-balance"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/account/get-balance";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/account/get-balance";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "asset_balances": [
    {
      "asset": 5,
      "balance_qty": "250000000",
      "frozen_qty": "0"
    }
  ]
}
{
  "error": "Invalid query parameter 'asset': must be valid enum"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Account API›Account Service

GetBalancesForMarket

GEThttps://api.pax.markets/v1/account/get-balances-for-market/{market_id}

Path Parameters

market_idstringuint64

Response

A successful response.

asset_balancesobject[]
ShowHide 3 properties
assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
balance_qtystringint64
frozen_qtystringint64
GET/v1/account/get-balances-for-market/{market_id}
curl -X GET 'https://api.pax.markets/v1/account/get-balances-for-market/1' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/account/get-balances-for-market/1"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/account/get-balances-for-market/1";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/account/get-balances-for-market/1";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "asset_balances": [
    {
      "asset": 5,
      "balance_qty": "250000000",
      "frozen_qty": "0"
    }
  ]
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Account API›Account Service

GetAccountStatus

GEThttps://api.pax.markets/v1/account/status

Response

A successful response.

emailstring
kyc_statusenum
0 = KYC_STATUS_UNSPECIFIED1 = KYC_STATUS_PENDING2 = KYC_STATUS_APPROVED3 = KYC_STATUS_REJECTED4 = KYC_STATUS_MANUAL_REVIEW
kyc_completed_at_unix_secondsstringint64
GET/v1/account/status
curl -X GET 'https://api.pax.markets/v1/account/status' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/account/status"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/account/status";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/account/status";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "email": "trader@example.com",
  "kyc_status": 2,
  "kyc_completed_at_unix_seconds": "1791559800"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Account API›Account Service

ListApiKeys

GEThttps://api.pax.markets/v1/account/api-keys

Response

A successful response.

keysobject[]
ShowHide 11 properties
key_idstring
descriptionstring
created_at_unix_secondsstringint64
expires_at_unix_secondsstringint64
revokedboolean
public_keystring
can_tradeboolean
can_withdrawboolean
account_typeenum
0 = ACCOUNT_TYPE_UNSPECIFIED1 = ACCOUNT_TYPE_FREE2 = ACCOUNT_TYPE_LAMBDA
ip_whiteliststring[]
created_by_emailstring

Email of the team member who created the key, when known. Only returned to signed-in sessions.

GET/v1/account/api-keys
curl -X GET 'https://api.pax.markets/v1/account/api-keys' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/account/api-keys"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/account/api-keys";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/account/api-keys";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "keys": [
    {
      "key_id": "pax_live_a3b4c5d6e7f80912ab34cd56",
      "description": "Market making bot",
      "created_at_unix_seconds": "1794151800",
      "expires_at_unix_seconds": "1825687800",
      "revoked": false,
      "public_key": "Gb9ECWmEzf6FQbrBZ9w7lshQhqowtrbLDFw4rXAxZuE=",
      "can_trade": true,
      "can_withdraw": false,
      "account_type": 1,
      "ip_whitelist": [
        "203.0.113.10"
      ],
      "created_by_email": "trader@example.com"
    }
  ]
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Account API›Account Service

ListAccounts

GEThttps://api.pax.markets/v1/account/list-accounts

Response

A successful response.

accountsobject[]
ShowHide 2 properties
external_account_idstring
account_typeenum
0 = ACCOUNT_TYPE_UNSPECIFIED1 = ACCOUNT_TYPE_FREE2 = ACCOUNT_TYPE_LAMBDA
GET/v1/account/list-accounts
curl -X GET 'https://api.pax.markets/v1/account/list-accounts' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/account/list-accounts"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/account/list-accounts";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/account/list-accounts";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "accounts": [
    {
      "external_account_id": "e3b0c442-98fc-4c14-9afb-f4c8996fb924",
      "account_type": 1
    }
  ]
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Metadata API›Metadata Service

GetExchangeInfo

GEThttps://api.pax.markets/v1/metadata/exchange-info
Public: no API key

List the exchange's markets, assets and fee rates.

Response

A successful response.

assetsobject[]

List of all traded assets.

ShowHide 4 properties
asset_idstringuint64

Asset id.

asset_namestring

Asset name.

native_unit_namestring

Name of the asset's smallest unit.

num_native_unitsstringint64

Native units in one whole asset.

marketsobject[]

List of all traded markets.

ShowHide 13 properties
market_idstringuint64

Market id.

market_namestring

Market name.

market_typeenum

Kind of market.

1 = SPOT
SPOTBuy or sell the base asset outright.
base_asset_idstringuint64

Asset bought or sold.

quote_asset_idstringuint64

Asset paid or received.

qty_unit_namestring

Name of the base asset's native unit.

tick_unit_namestring

Name of the quote asset's native unit.

tick_sizestringuint64

Quote native units per tick.

qty_step_sizestringint64

Base native units per step.

max_qtystringint64

Largest order quantity, in base native units.

notesstring

Additional notes.

max_ticksintegerint32

Highest order price, in ticks.

min_notionalstringint64

Smallest order value at its limit price, in quote native units.

feesobject

Fee and rebate rates, settled per fill in the quote asset.

ShowHide 5 properties
lambda_taker_fee_bpsstring

Lambda taker fee, in bps of fill value. Rounded up.

lambda_maker_spread_multiplierstring

Lambda maker fee, as a share of its spread. Rounded up.

lambda_maker_fee_cap_bpsstring

Lambda maker fee cap, in bps of fill value. Rounded up.

free_tier_rebate_multiplierstring

Free-tier rebate, as a share of the lambda counterparty's fee. Rounded down.

free_tier_rebate_cap_bpsstring

Free-tier rebate cap, in bps of fill value. Rounded down.

GET/v1/metadata/exchange-info
curl -X GET 'https://api.pax.markets/v1/metadata/exchange-info'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/metadata/exchange-info"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/metadata/exchange-info";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/metadata/exchange-info";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "assets": [
    {
      "asset_id": "1",
      "asset_name": "BTC",
      "native_unit_name": "satoshi",
      "num_native_units": "100000000"
    }
  ],
  "markets": [
    {
      "market_id": "1",
      "market_name": "BTC-USDC",
      "market_type": 1,
      "base_asset_id": "1",
      "quote_asset_id": "5",
      "qty_unit_name": "satoshi",
      "tick_unit_name": "micro USDC",
      "tick_size": "1000000",
      "qty_step_size": "100",
      "max_qty": "214748364700",
      "notes": "",
      "max_ticks": 2147483646,
      "min_notional": "1000000"
    }
  ],
  "fees": {
    "lambda_taker_fee_bps": "0.5",
    "lambda_maker_spread_multiplier": "0.25",
    "lambda_maker_fee_cap_bps": "2",
    "free_tier_rebate_multiplier": "0.5",
    "free_tier_rebate_cap_bps": "0.25"
  }
}

Money API›Money Service

AttributeCryptoDeposit

POSThttps://api.pax.markets/v1/money/crypto-deposits/attributes
Permission: trade

Request

crypto_deposit_idstring
originator_countrystring
originator_namestring
origin_wallet_typeenum
1 = CUSTODIAL2 = SELF_HOSTED

Response

A successful response.

POST/v1/money/crypto-deposits/attributes
curl -X POST 'https://api.pax.markets/v1/money/crypto-deposits/attributes' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "crypto_deposit_id": "3b241101-e2bb-4255-8caf-4136c566a962",
  "originator_country": "US",
  "originator_name": "Jane Doe",
  "origin_wallet_type": 2
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/money/crypto-deposits/attributes"
body = json.dumps({
      "crypto_deposit_id": "3b241101-e2bb-4255-8caf-4136c566a962",
      "originator_country": "US",
      "originator_name": "Jane Doe",
      "origin_wallet_type": 2
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/money/crypto-deposits/attributes";
let body = serde_json::to_string(&serde_json::json!({
  "crypto_deposit_id": "3b241101-e2bb-4255-8caf-4136c566a962",
  "originator_country": "US",
  "originator_name": "Jane Doe",
  "origin_wallet_type": 2
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/money/crypto-deposits/attributes";
const body = JSON.stringify({
  "crypto_deposit_id": "3b241101-e2bb-4255-8caf-4136c566a962",
  "originator_country": "US",
  "originator_name": "Jane Doe",
  "origin_wallet_type": 2
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{}
{
  "error": "Failed to parse the request body as JSON: expected value at line 1 column 1"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

SubmitCryptoWithdrawal

POSThttps://api.pax.markets/v1/money/crypto-withdrawals
Permission: withdraw

Request

chainstring
assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
amountstringint64
withdraw_wallet_addressstring
idempotency_keystring

Response

A successful response.

statusenum
1 = QUEUED2 = IN_PROGRESS3 = PENDING_ON_CHAIN4 = COMPLETION_NOTIFIED5 = COMPLETED6 = FAILURE_NOTIFIED7 = FAILED
POST/v1/money/crypto-withdrawals
curl -X POST 'https://api.pax.markets/v1/money/crypto-withdrawals' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "chain": "ETH",
  "asset": 5,
  "amount": "250000000",
  "withdraw_wallet_address": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
  "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/money/crypto-withdrawals"
body = json.dumps({
      "chain": "ETH",
      "asset": 5,
      "amount": "250000000",
      "withdraw_wallet_address": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
      "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/money/crypto-withdrawals";
let body = serde_json::to_string(&serde_json::json!({
  "chain": "ETH",
  "asset": 5,
  "amount": "250000000",
  "withdraw_wallet_address": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
  "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/money/crypto-withdrawals";
const body = JSON.stringify({
  "chain": "ETH",
  "asset": 5,
  "amount": "250000000",
  "withdraw_wallet_address": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
  "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "status": 5
}
{
  "error": "Failed to parse the request body as JSON: expected value at line 1 column 1"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

SubmitFiatWithdrawal

POSThttps://api.pax.markets/v1/money/fiat-withdrawals
Permission: withdraw

Request

idempotency_keystring
currencystring
amountstringint64
withdraw_bank_account_idstring
memostring

Response

A successful response.

statusenum
0 = QUEUED1 = PENDING4 = COMPLETED5 = FAILED6 = RETURNED
POST/v1/money/fiat-withdrawals
curl -X POST 'https://api.pax.markets/v1/money/fiat-withdrawals' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "currency": "USD",
  "amount": "25000",
  "withdraw_bank_account_id": "1b4e28ba-2fa1-41d2-883f-0016d3cca427",
  "memo": "Invoice 1042"
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/money/fiat-withdrawals"
body = json.dumps({
      "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
      "currency": "USD",
      "amount": "25000",
      "withdraw_bank_account_id": "1b4e28ba-2fa1-41d2-883f-0016d3cca427",
      "memo": "Invoice 1042"
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/money/fiat-withdrawals";
let body = serde_json::to_string(&serde_json::json!({
  "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "currency": "USD",
  "amount": "25000",
  "withdraw_bank_account_id": "1b4e28ba-2fa1-41d2-883f-0016d3cca427",
  "memo": "Invoice 1042"
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/money/fiat-withdrawals";
const body = JSON.stringify({
  "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "currency": "USD",
  "amount": "25000",
  "withdraw_bank_account_id": "1b4e28ba-2fa1-41d2-883f-0016d3cca427",
  "memo": "Invoice 1042"
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "status": 4
}
{
  "error": "Failed to parse the request body as JSON: expected value at line 1 column 1"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

CreateConversionQuote

POSThttps://api.pax.markets/v1/money/conversion-quotes
Permission: trade

Request

from_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
to_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
from_amountstringint64

Response

A successful response.

from_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
from_amountstringint64
to_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
to_amountstringint64
valid_until_time_msstringint64
quote_idstring
POST/v1/money/conversion-quotes
curl -X POST 'https://api.pax.markets/v1/money/conversion-quotes' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "from_asset": 6,
  "to_asset": 5,
  "from_amount": "10000"
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/money/conversion-quotes"
body = json.dumps({
      "from_asset": 6,
      "to_asset": 5,
      "from_amount": "10000"
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/money/conversion-quotes";
let body = serde_json::to_string(&serde_json::json!({
  "from_asset": 6,
  "to_asset": 5,
  "from_amount": "10000"
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/money/conversion-quotes";
const body = JSON.stringify({
  "from_asset": 6,
  "to_asset": 5,
  "from_amount": "10000"
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "from_asset": 6,
  "from_amount": "10000",
  "to_asset": 5,
  "to_amount": "100000000",
  "valid_until_time_ms": "1794151830123",
  "quote_id": "a8098c1a-f86e-41da-a7c8-c9a2f1e4b7d3"
}
{
  "error": "Failed to parse the request body as JSON: expected value at line 1 column 1"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

SubmitConversion

POSThttps://api.pax.markets/v1/money/conversions
Permission: trade

Request

idempotency_keystring
from_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
to_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
from_amountstringint64
min_to_amountstringint64
quote_idstring

Response

A successful response.

statusenum
1 = PENDING2 = COMPLETED3 = FAILED
idstring
POST/v1/money/conversions
curl -X POST 'https://api.pax.markets/v1/money/conversions' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "from_asset": 6,
  "to_asset": 5,
  "from_amount": "10000",
  "min_to_amount": "99900000",
  "quote_id": "a8098c1a-f86e-41da-a7c8-c9a2f1e4b7d3"
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/money/conversions"
body = json.dumps({
      "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
      "from_asset": 6,
      "to_asset": 5,
      "from_amount": "10000",
      "min_to_amount": "99900000",
      "quote_id": "a8098c1a-f86e-41da-a7c8-c9a2f1e4b7d3"
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/money/conversions";
let body = serde_json::to_string(&serde_json::json!({
  "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "from_asset": 6,
  "to_asset": 5,
  "from_amount": "10000",
  "min_to_amount": "99900000",
  "quote_id": "a8098c1a-f86e-41da-a7c8-c9a2f1e4b7d3"
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/money/conversions";
const body = JSON.stringify({
  "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
  "from_asset": 6,
  "to_asset": 5,
  "from_amount": "10000",
  "min_to_amount": "99900000",
  "quote_id": "a8098c1a-f86e-41da-a7c8-c9a2f1e4b7d3"
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "status": 2,
  "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
{
  "error": "Failed to parse the request body as JSON: expected value at line 1 column 1"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetSupportedChainsForAsset

GEThttps://api.pax.markets/v1/money/assets/{asset}/chains

Path Parameters

assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD

Response

A successful response.

chainsstring[]
GET/v1/money/assets/{asset}/chains
curl -X GET 'https://api.pax.markets/v1/money/assets/5/chains' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/assets/5/chains"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/assets/5/chains";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/assets/5/chains";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "chains": [
    "ETH",
    "SOL"
  ]
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetDepositAddresses

GEThttps://api.pax.markets/v1/money/deposit-addresses

Response

A successful response.

deposit_addressesobject[]
ShowHide 4 properties
chainstring
assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
addressstring
created_time_msstringint64
GET/v1/money/deposit-addresses
curl -X GET 'https://api.pax.markets/v1/money/deposit-addresses' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/deposit-addresses"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/deposit-addresses";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/deposit-addresses";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "deposit_addresses": [
    {
      "chain": "ETH",
      "asset": 5,
      "address": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
      "created_time_ms": "1794151800123"
    }
  ]
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetDepositAddress

GEThttps://api.pax.markets/v1/money/deposit-addresses/{asset}

Path Parameters

assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD

Request

chainstring

Response

A successful response.

deposit_addressobject
ShowHide 4 properties
chainstring
assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
addressstring
created_time_msstringint64
GET/v1/money/deposit-addresses/{asset}
curl -X GET 'https://api.pax.markets/v1/money/deposit-addresses/5?chain=ETH' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/deposit-addresses/5?chain=ETH"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/deposit-addresses/5?chain=ETH";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/deposit-addresses/5?chain=ETH";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "deposit_address": {
    "chain": "ETH",
    "asset": 5,
    "address": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
    "created_time_ms": "1794151800123"
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetCryptoDeposits

GEThttps://api.pax.markets/v1/money/crypto-deposits

Response

A successful response.

depositsobject[]
ShowHide 9 properties
idstring
statusenum
1 = INITIATED2 = PENDING_ATTRIBUTION3 = PENDING_REVIEW4 = COMPLETED5 = BLOCKED6 = FAILED
chainstring
assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
amountstringint64
source_wallet_addressstring
deposit_wallet_addressstring
transaction_hashstring
created_time_msstringint64
GET/v1/money/crypto-deposits
curl -X GET 'https://api.pax.markets/v1/money/crypto-deposits' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/crypto-deposits"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/crypto-deposits";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/crypto-deposits";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "deposits": [
    {
      "id": "3b241101-e2bb-4255-8caf-4136c566a962",
      "status": 4,
      "chain": "ETH",
      "asset": 5,
      "amount": "250000000",
      "source_wallet_address": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359",
      "deposit_wallet_address": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
      "transaction_hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b",
      "created_time_ms": "1794151800123"
    }
  ]
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetFiatDepositInstructions

GEThttps://api.pax.markets/v1/money/fiat-deposit-instructions

Response

A successful response.

instructionsobject[]
ShowHide 12 properties
idstring
bank_networkenum
1 = US_ACH2 = US_WIRE3 = SWIFT4 = US_RTP
currencystring
account_holder_namestring
account_numberstring
bank_namestring
bank_routing_numberstring
bank_swift_codestring
reference_codestring
convert_to_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
deposit_feestringint64
instruction_typeenum
0 = INSTRUCTION_TYPE_UNKNOWN1 = INSTRUCTION_TYPE_DEPOSIT2 = INSTRUCTION_TYPE_AUTO_CONVERSION
GET/v1/money/fiat-deposit-instructions
curl -X GET 'https://api.pax.markets/v1/money/fiat-deposit-instructions' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/fiat-deposit-instructions"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/fiat-deposit-instructions";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/fiat-deposit-instructions";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "instructions": [
    {
      "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "bank_network": 2,
      "currency": "USD",
      "account_holder_name": "Jane Doe",
      "account_number": "000123456789",
      "bank_name": "Example Bank",
      "bank_routing_number": "123456789",
      "bank_swift_code": "",
      "reference_code": "PAX7K2M9Q",
      "convert_to_asset": 5,
      "deposit_fee": "0",
      "instruction_type": 1
    }
  ]
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetFiatDeposits

GEThttps://api.pax.markets/v1/money/fiat-deposits

Response

A successful response.

depositsobject[]
ShowHide 9 properties
idstring
statusenum
1 = PENDING2 = COMPLETED3 = FAILED
currencystring
amountstringint64
feestringint64
credited_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
credited_amountstringint64
created_time_msstringint64
bank_networkenum
1 = US_ACH2 = US_WIRE3 = SWIFT4 = US_RTP
GET/v1/money/fiat-deposits
curl -X GET 'https://api.pax.markets/v1/money/fiat-deposits' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/fiat-deposits"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/fiat-deposits";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/fiat-deposits";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "deposits": [
    {
      "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "status": 2,
      "currency": "USD",
      "amount": "25000",
      "fee": "0",
      "credited_asset": 5,
      "credited_amount": "250000000",
      "created_time_ms": "1794151800123",
      "bank_network": 2
    }
  ]
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetWithdrawWallets

GEThttps://api.pax.markets/v1/money/withdraw-wallets

Request

include_archivedbooleanOptional

Response

A successful response.

walletsobject[]
ShowHide 7 properties
idstring
chainstring
addressstring
created_time_msstringint64
archived_time_msstringint64
statusenum
0 = PENDING1 = UNDER_REVIEW2 = VERIFIED
descriptionstring
GET/v1/money/withdraw-wallets
curl -X GET 'https://api.pax.markets/v1/money/withdraw-wallets' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/withdraw-wallets"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/withdraw-wallets";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/withdraw-wallets";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "wallets": [
    {
      "id": "6f9619ff-8b86-4011-b42d-00cf4fc964ff",
      "chain": "ETH",
      "address": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
      "created_time_ms": "1794151800123",
      "archived_time_ms": null,
      "status": 2,
      "description": null
    }
  ]
}
{
  "error": "Invalid query parameter 'include_archived': must be boolean"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetWithdrawWallet

GEThttps://api.pax.markets/v1/money/withdraw-wallets/{withdraw_wallet_id}

Path Parameters

withdraw_wallet_idstring

Response

A successful response.

walletobject
ShowHide 7 properties
idstring
chainstring
addressstring
created_time_msstringint64
archived_time_msstringint64
statusenum
0 = PENDING1 = UNDER_REVIEW2 = VERIFIED
descriptionstring
GET/v1/money/withdraw-wallets/{withdraw_wallet_id}
curl -X GET 'https://api.pax.markets/v1/money/withdraw-wallets/6f9619ff-8b86-4011-b42d-00cf4fc964ff' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/withdraw-wallets/6f9619ff-8b86-4011-b42d-00cf4fc964ff"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/withdraw-wallets/6f9619ff-8b86-4011-b42d-00cf4fc964ff";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/withdraw-wallets/6f9619ff-8b86-4011-b42d-00cf4fc964ff";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "wallet": {
    "id": "6f9619ff-8b86-4011-b42d-00cf4fc964ff",
    "chain": "ETH",
    "address": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
    "created_time_ms": "1794151800123",
    "archived_time_ms": null,
    "status": 2,
    "description": null
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetWithdrawWalletByAddress

GEThttps://api.pax.markets/v1/money/withdraw-wallets-by-address/{wallet_address}

Path Parameters

wallet_addressstring

Request

chainstring

Response

A successful response.

walletobject
ShowHide 7 properties
idstring
chainstring
addressstring
created_time_msstringint64
archived_time_msstringint64
statusenum
0 = PENDING1 = UNDER_REVIEW2 = VERIFIED
descriptionstring
GET/v1/money/withdraw-wallets-by-address/{wallet_address}
curl -X GET 'https://api.pax.markets/v1/money/withdraw-wallets-by-address/0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB?chain=ETH' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/withdraw-wallets-by-address/0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB?chain=ETH"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/withdraw-wallets-by-address/0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB?chain=ETH";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/withdraw-wallets-by-address/0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB?chain=ETH";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "wallet": {
    "id": "6f9619ff-8b86-4011-b42d-00cf4fc964ff",
    "chain": "ETH",
    "address": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
    "created_time_ms": "1794151800123",
    "archived_time_ms": null,
    "status": 2,
    "description": null
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetCryptoWithdrawals

GEThttps://api.pax.markets/v1/money/crypto-withdrawals

Response

A successful response.

withdrawalsobject[]
ShowHide 13 properties
idstring
idempotency_keystring
withdraw_wallet_addressstring
chainstring
assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
amountstringint64
fee_tokenstring
feestringint64
statusenum
1 = QUEUED2 = IN_PROGRESS3 = PENDING_ON_CHAIN4 = COMPLETION_NOTIFIED5 = COMPLETED6 = FAILURE_NOTIFIED7 = FAILED
transaction_hashstring
created_time_msstringint64
updated_time_msstringint64
received_amountstringint64
GET/v1/money/crypto-withdrawals
curl -X GET 'https://api.pax.markets/v1/money/crypto-withdrawals' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/crypto-withdrawals"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/crypto-withdrawals";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/crypto-withdrawals";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "withdrawals": [
    {
      "id": "9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e",
      "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
      "withdraw_wallet_address": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
      "chain": "ETH",
      "asset": 5,
      "amount": "250000000",
      "fee_token": "USDC",
      "fee": "1000000",
      "status": 5,
      "transaction_hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b",
      "created_time_ms": "1794151800123",
      "updated_time_ms": "1794151800125",
      "received_amount": "249000000"
    }
  ]
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetCryptoWithdrawal

GEThttps://api.pax.markets/v1/money/crypto-withdrawals/{withdrawal_id}

Path Parameters

withdrawal_idstring

Response

A successful response.

withdrawalobject
ShowHide 13 properties
idstring
idempotency_keystring
withdraw_wallet_addressstring
chainstring
assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
amountstringint64
fee_tokenstring
feestringint64
statusenum
1 = QUEUED2 = IN_PROGRESS3 = PENDING_ON_CHAIN4 = COMPLETION_NOTIFIED5 = COMPLETED6 = FAILURE_NOTIFIED7 = FAILED
transaction_hashstring
created_time_msstringint64
updated_time_msstringint64
received_amountstringint64
GET/v1/money/crypto-withdrawals/{withdrawal_id}
curl -X GET 'https://api.pax.markets/v1/money/crypto-withdrawals/9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/crypto-withdrawals/9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/crypto-withdrawals/9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/crypto-withdrawals/9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "withdrawal": {
    "id": "9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e",
    "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "withdraw_wallet_address": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
    "chain": "ETH",
    "asset": 5,
    "amount": "250000000",
    "fee_token": "USDC",
    "fee": "1000000",
    "status": 5,
    "transaction_hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b",
    "created_time_ms": "1794151800123",
    "updated_time_ms": "1794151800125",
    "received_amount": "249000000"
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetCryptoWithdrawalByIdempotencyKey

GEThttps://api.pax.markets/v1/money/crypto-withdrawals-by-idempotency-key/{idempotency_key}

Path Parameters

idempotency_keystring

Response

A successful response.

withdrawalobject
ShowHide 13 properties
idstring
idempotency_keystring
withdraw_wallet_addressstring
chainstring
assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
amountstringint64
fee_tokenstring
feestringint64
statusenum
1 = QUEUED2 = IN_PROGRESS3 = PENDING_ON_CHAIN4 = COMPLETION_NOTIFIED5 = COMPLETED6 = FAILURE_NOTIFIED7 = FAILED
transaction_hashstring
created_time_msstringint64
updated_time_msstringint64
received_amountstringint64
GET/v1/money/crypto-withdrawals-by-idempotency-key/{idempotency_key}
curl -X GET 'https://api.pax.markets/v1/money/crypto-withdrawals-by-idempotency-key/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/crypto-withdrawals-by-idempotency-key/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/crypto-withdrawals-by-idempotency-key/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/crypto-withdrawals-by-idempotency-key/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "withdrawal": {
    "id": "9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e",
    "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "withdraw_wallet_address": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
    "chain": "ETH",
    "asset": 5,
    "amount": "250000000",
    "fee_token": "USDC",
    "fee": "1000000",
    "status": 5,
    "transaction_hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b",
    "created_time_ms": "1794151800123",
    "updated_time_ms": "1794151800125",
    "received_amount": "249000000"
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetWithdrawBankAccounts

GEThttps://api.pax.markets/v1/money/withdraw-bank-accounts

Request

include_archivedbooleanOptional

Response

A successful response.

bank_accountsobject[]
ShowHide 5 properties
bank_account_typeenum
1 = US
us_bank_accountobject
ShowHide 7 properties
idstring
nicknamestring
transfer_typeenum
1 = ACH2 = WIRE3 = RTP
account_holder_namestring
account_numberstring
bank_namestring
bank_routing_numberstring
statusenum
0 = STATUS_UNKNOWN1 = PENDING2 = ACTIVE3 = FAILED4 = INACTIVE
created_time_msstringint64
archived_time_msstringint64
GET/v1/money/withdraw-bank-accounts
curl -X GET 'https://api.pax.markets/v1/money/withdraw-bank-accounts' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/withdraw-bank-accounts"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/withdraw-bank-accounts";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/withdraw-bank-accounts";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "bank_accounts": [
    {
      "bank_account_type": 1,
      "us_bank_account": {
        "id": "1b4e28ba-2fa1-41d2-883f-0016d3cca427",
        "nickname": "Operating account",
        "transfer_type": 2,
        "account_holder_name": "Jane Doe",
        "account_number": "000123456789",
        "bank_name": "Example Bank",
        "bank_routing_number": "123456789"
      },
      "status": 2,
      "created_time_ms": "1794151800123",
      "archived_time_ms": null
    }
  ]
}
{
  "error": "Invalid query parameter 'include_archived': must be boolean"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetWithdrawBankAccount

GEThttps://api.pax.markets/v1/money/withdraw-bank-accounts/{withdraw_bank_account_id}

Path Parameters

withdraw_bank_account_idstring

Response

A successful response.

bank_accountobject
ShowHide 5 properties
bank_account_typeenum
1 = US
us_bank_accountobject
ShowHide 7 properties
idstring
nicknamestring
transfer_typeenum
1 = ACH2 = WIRE3 = RTP
account_holder_namestring
account_numberstring
bank_namestring
bank_routing_numberstring
statusenum
0 = STATUS_UNKNOWN1 = PENDING2 = ACTIVE3 = FAILED4 = INACTIVE
created_time_msstringint64
archived_time_msstringint64
GET/v1/money/withdraw-bank-accounts/{withdraw_bank_account_id}
curl -X GET 'https://api.pax.markets/v1/money/withdraw-bank-accounts/1b4e28ba-2fa1-41d2-883f-0016d3cca427' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/withdraw-bank-accounts/1b4e28ba-2fa1-41d2-883f-0016d3cca427"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/withdraw-bank-accounts/1b4e28ba-2fa1-41d2-883f-0016d3cca427";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/withdraw-bank-accounts/1b4e28ba-2fa1-41d2-883f-0016d3cca427";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "bank_account": {
    "bank_account_type": 1,
    "us_bank_account": {
      "id": "1b4e28ba-2fa1-41d2-883f-0016d3cca427",
      "nickname": "Operating account",
      "transfer_type": 2,
      "account_holder_name": "Jane Doe",
      "account_number": "000123456789",
      "bank_name": "Example Bank",
      "bank_routing_number": "123456789"
    },
    "status": 2,
    "created_time_ms": "1794151800123",
    "archived_time_ms": null
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetFiatWithdrawals

GEThttps://api.pax.markets/v1/money/fiat-withdrawals

Response

A successful response.

withdrawalsobject[]
ShowHide 13 properties
idstring
idempotency_keystring
bank_account_idstring
transfer_methodenum
1 = US_ACH2 = US_WIRE3 = US_RTP
currencystring
amountstringint64
fee_currencystring
feestringint64
memostring
statusenum
0 = QUEUED1 = PENDING4 = COMPLETED5 = FAILED6 = RETURNED
referencestring
created_time_msstringint64
updated_time_msstringint64
GET/v1/money/fiat-withdrawals
curl -X GET 'https://api.pax.markets/v1/money/fiat-withdrawals' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/fiat-withdrawals"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/fiat-withdrawals";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/fiat-withdrawals";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "withdrawals": [
    {
      "id": "9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e",
      "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
      "bank_account_id": "1b4e28ba-2fa1-41d2-883f-0016d3cca427",
      "transfer_method": 2,
      "currency": "USD",
      "amount": "25000",
      "fee_currency": "USD",
      "fee": "0",
      "memo": "Invoice 1042",
      "status": 4,
      "reference": "PAX-1042",
      "created_time_ms": "1794151800123",
      "updated_time_ms": "1794151800125"
    }
  ]
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetFiatWithdrawal

GEThttps://api.pax.markets/v1/money/fiat-withdrawals/{withdrawal_id}

Path Parameters

withdrawal_idstring

Response

A successful response.

withdrawalobject
ShowHide 13 properties
idstring
idempotency_keystring
bank_account_idstring
transfer_methodenum
1 = US_ACH2 = US_WIRE3 = US_RTP
currencystring
amountstringint64
fee_currencystring
feestringint64
memostring
statusenum
0 = QUEUED1 = PENDING4 = COMPLETED5 = FAILED6 = RETURNED
referencestring
created_time_msstringint64
updated_time_msstringint64
GET/v1/money/fiat-withdrawals/{withdrawal_id}
curl -X GET 'https://api.pax.markets/v1/money/fiat-withdrawals/9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/fiat-withdrawals/9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/fiat-withdrawals/9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/fiat-withdrawals/9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "withdrawal": {
    "id": "9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e",
    "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "bank_account_id": "1b4e28ba-2fa1-41d2-883f-0016d3cca427",
    "transfer_method": 2,
    "currency": "USD",
    "amount": "25000",
    "fee_currency": "USD",
    "fee": "0",
    "memo": "Invoice 1042",
    "status": 4,
    "reference": "PAX-1042",
    "created_time_ms": "1794151800123",
    "updated_time_ms": "1794151800125"
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetFiatWithdrawalByIdempotencyKey

GEThttps://api.pax.markets/v1/money/fiat-withdrawals-by-idempotency-key/{idempotency_key}

Path Parameters

idempotency_keystring

Response

A successful response.

withdrawalobject
ShowHide 13 properties
idstring
idempotency_keystring
bank_account_idstring
transfer_methodenum
1 = US_ACH2 = US_WIRE3 = US_RTP
currencystring
amountstringint64
fee_currencystring
feestringint64
memostring
statusenum
0 = QUEUED1 = PENDING4 = COMPLETED5 = FAILED6 = RETURNED
referencestring
created_time_msstringint64
updated_time_msstringint64
GET/v1/money/fiat-withdrawals-by-idempotency-key/{idempotency_key}
curl -X GET 'https://api.pax.markets/v1/money/fiat-withdrawals-by-idempotency-key/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/fiat-withdrawals-by-idempotency-key/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/fiat-withdrawals-by-idempotency-key/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/fiat-withdrawals-by-idempotency-key/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "withdrawal": {
    "id": "9b2f7c1e-4d3a-4f8b-a6e5-2c1d0b9a8f7e",
    "idempotency_key": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
    "bank_account_id": "1b4e28ba-2fa1-41d2-883f-0016d3cca427",
    "transfer_method": 2,
    "currency": "USD",
    "amount": "25000",
    "fee_currency": "USD",
    "fee": "0",
    "memo": "Invoice 1042",
    "status": 4,
    "reference": "PAX-1042",
    "created_time_ms": "1794151800123",
    "updated_time_ms": "1794151800125"
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetCryptoTransfers

GEThttps://api.pax.markets/v1/money/crypto-transfers

Response

A successful response.

transfersobject[]
ShowHide 14 properties
idstring
typeenum
1 = DEPOSIT2 = WITHDRAWAL
chainstring
assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
amountstringint64
fee_tokenstring
feestringint64
sender_wallet_addressstring
receiver_wallet_addressstring
deposit_statusenum
1 = INITIATED2 = PENDING_ATTRIBUTION3 = PENDING_REVIEW4 = COMPLETED5 = BLOCKED6 = FAILED
withdrawal_statusenum
1 = QUEUED2 = IN_PROGRESS3 = PENDING_ON_CHAIN4 = COMPLETION_NOTIFIED5 = COMPLETED6 = FAILURE_NOTIFIED7 = FAILED
transaction_hashstring
created_time_msstringint64
updated_time_msstringint64
GET/v1/money/crypto-transfers
curl -X GET 'https://api.pax.markets/v1/money/crypto-transfers' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/crypto-transfers"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/crypto-transfers";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/crypto-transfers";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "transfers": [
    {
      "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "type": 1,
      "chain": "ETH",
      "asset": 5,
      "amount": "250000000",
      "fee_token": "USDC",
      "fee": "1000000",
      "sender_wallet_address": "",
      "receiver_wallet_address": "",
      "deposit_status": 4,
      "withdrawal_status": 0,
      "transaction_hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b",
      "created_time_ms": "1794151800123",
      "updated_time_ms": "1794151800125"
    }
  ]
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetConversions

GEThttps://api.pax.markets/v1/money/conversions

Response

A successful response.

conversionsobject[]
ShowHide 10 properties
idstring
statusenum
1 = PENDING2 = COMPLETED3 = FAILED
from_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
from_amountstringint64
to_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
to_amountstringint64
created_time_msstringint64
updated_time_msstringint64
fee_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
fee_amountstringint64
GET/v1/money/conversions
curl -X GET 'https://api.pax.markets/v1/money/conversions' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/conversions"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/conversions";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/conversions";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "conversions": [
    {
      "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "status": 2,
      "from_asset": 6,
      "from_amount": "10000",
      "to_asset": 5,
      "to_amount": "100000000",
      "created_time_ms": "1794151800123",
      "updated_time_ms": "1794151800125",
      "fee_asset": 5,
      "fee_amount": "0"
    }
  ]
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

GetConversion

GEThttps://api.pax.markets/v1/money/conversions/{conversion_id}

Path Parameters

conversion_idstring

Response

A successful response.

conversionobject
ShowHide 10 properties
idstring
statusenum
1 = PENDING2 = COMPLETED3 = FAILED
from_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
from_amountstringint64
to_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
to_amountstringint64
created_time_msstringint64
updated_time_msstringint64
fee_assetenum
1 = BTC2 = ETH3 = SOL4 = USDT5 = USDC6 = USD
fee_amountstringint64
GET/v1/money/conversions/{conversion_id}
curl -X GET 'https://api.pax.markets/v1/money/conversions/7c9e6679-7425-40de-944b-e07fc1f90ae7' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "GET"
path = "/v1/money/conversions/7c9e6679-7425-40de-944b-e07fc1f90ae7"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.get(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "GET";
let path = "/v1/money/conversions/7c9e6679-7425-40de-944b-e07fc1f90ae7";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .get(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "GET";
const path = "/v1/money/conversions/7c9e6679-7425-40de-944b-e07fc1f90ae7";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "GET",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
  },
});

console.log(await res.json());
{
  "conversion": {
    "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "status": 2,
    "from_asset": 6,
    "from_amount": "10000",
    "to_asset": 5,
    "to_amount": "100000000",
    "created_time_ms": "1794151800123",
    "updated_time_ms": "1794151800125",
    "fee_asset": 5,
    "fee_amount": "0"
  }
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

ArchiveWithdrawWallet

DELETEhttps://api.pax.markets/v1/money/withdraw-wallets/{withdraw_wallet_id}
Permission: withdraw

Path Parameters

withdraw_wallet_idstring

Response

A successful response.

DELETE/v1/money/withdraw-wallets/{withdraw_wallet_id}
curl -X DELETE 'https://api.pax.markets/v1/money/withdraw-wallets/6f9619ff-8b86-4011-b42d-00cf4fc964ff' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "DELETE"
path = "/v1/money/withdraw-wallets/6f9619ff-8b86-4011-b42d-00cf4fc964ff"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.delete(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "DELETE";
let path = "/v1/money/withdraw-wallets/6f9619ff-8b86-4011-b42d-00cf4fc964ff";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .delete(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "DELETE";
const path = "/v1/money/withdraw-wallets/6f9619ff-8b86-4011-b42d-00cf4fc964ff";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "DELETE",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
});

console.log(await res.json());
{}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Money API›Money Service

ArchiveWithdrawBankAccount

DELETEhttps://api.pax.markets/v1/money/withdraw-bank-accounts/{withdraw_bank_account_id}
Permission: withdraw

Path Parameters

withdraw_bank_account_idstring

Response

A successful response.

DELETE/v1/money/withdraw-bank-accounts/{withdraw_bank_account_id}
curl -X DELETE 'https://api.pax.markets/v1/money/withdraw-bank-accounts/1b4e28ba-2fa1-41d2-883f-0016d3cca427' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "DELETE"
path = "/v1/money/withdraw-bank-accounts/1b4e28ba-2fa1-41d2-883f-0016d3cca427"
body = ""
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.delete(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    }
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "DELETE";
let path = "/v1/money/withdraw-bank-accounts/1b4e28ba-2fa1-41d2-883f-0016d3cca427";
let body = "";

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .delete(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "DELETE";
const path = "/v1/money/withdraw-bank-accounts/1b4e28ba-2fa1-41d2-883f-0016d3cca427";
const body = "";

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "DELETE",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
});

console.log(await res.json());
{}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Compatibility API›CompatibilityOrder Service

CancelOrder

POSThttps://api.pax.markets/v1/compatibility/order/cancel
Permission: trade

Cancel the named order's unfilled quantity at its side and price level. This is a liquidity cancel, so the quantity may come off any of the account's orders at that level.

Request

order_idstring

Order whose unfilled quantity, side and price level set the cancel.

client_order_idstringOptional

Client-assigned id for the cancel, at most 36 bytes. Omit or leave empty for none.

Response

A successful response.

order_idstring

Exchange-assigned id of the cancel order, not of the order named in the request.

POST/v1/compatibility/order/cancel
curl -X POST 'https://api.pax.markets/v1/compatibility/order/cancel' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
  "client_order_id": "my-cancel-1"
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/compatibility/order/cancel"
body = json.dumps({
      "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
      "client_order_id": "my-cancel-1"
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/compatibility/order/cancel";
let body = serde_json::to_string(&serde_json::json!({
  "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
  "client_order_id": "my-cancel-1"
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/compatibility/order/cancel";
const body = JSON.stringify({
  "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
  "client_order_id": "my-cancel-1"
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "order_id": "01a1bbc7-dd3c-7b2d-9f30-4c6e0d5b7f82"
}
{
  "error": "A client-assigned id cannot exceed 36 bytes."
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Compatibility API›CompatibilityOrder Service

BatchSubmitOrders

POSThttps://api.pax.markets/v1/compatibility/order/submit-batch
Permission: trade

Place several orders in one request.

Request

ordersobject[]Optional

List of orders to place, in the order given. At most 10 per request.

ShowHide 2 properties
orderobject

The order to place.

ShowHide 6 properties
sideenum

Side to place on.

1 = ASK2 = BID
ASKSell the base asset.
BIDBuy the base asset.
market_idstringuint64

Market to place on.

qtystringint64

Quantity to place, a multiple of the market's step size. Must be positive except on a cancel lambda.

ticksintegerint32

Limit price in ticks, from 1 to the market's max_ticks.

tifenum

How long the order stays live.

1 = IOC2 = GTC3 = ALO
IOCImmediate or cancel.
GTCGood until canceled.
ALOAdd liquidity only: rests if it would not cross, else canceled.
is_leverageboolean

Trade on margin. Currently disabled.

client_order_idstringOptional

Client-assigned id, at most 36 bytes. Omit or leave empty for none. Rejected if it matches another of the account's live orders.

Response

A successful response.

resultsobject[]

One result per entry, in request order.

ShowHide 5 properties
order_idstring

Exchange-assigned order id. Empty if refused.

client_order_idstring

The entry's client_order_id. Empty if none was sent.

acceptedboolean

True if the exchange took the order.

reasonenum

Why the entry was refused. OSU_REASON_UNSPECIFIED if accepted.

0 = OSU_REASON_UNSPECIFIED1 = OSU_REASON_ADMIN_CANCELED2 = OSU_REASON_INSUFFICIENT_BALANCE3 = OSU_REASON_DUPLICATE_CLIENT_ID4 = OSU_REASON_EXCHANGE_ERROR5 = OSU_REASON_ALO_WOULD_CROSS6 = OSU_REASON_EXCHANGE_UNAVAILABLE7 = OSU_REASON_CAPACITY_REACHED8 = OSU_REASON_INVALID_ORDER
OSU_REASON_UNSPECIFIEDNone.
OSU_REASON_ADMIN_CANCELEDCanceled by the system, such as ahead of maintenance or shutdown.
OSU_REASON_INSUFFICIENT_BALANCERefused because the account cannot fund the order.
OSU_REASON_DUPLICATE_CLIENT_IDRefused because client_order_id is already in use by a live order.
OSU_REASON_EXCHANGE_ERRORRefused because of an internal exchange error. The order was not placed.
OSU_REASON_ALO_WOULD_CROSSCanceled because the ALO order would have crossed the book.
OSU_REASON_EXCHANGE_UNAVAILABLERefused because the exchange is not accepting orders right now.
OSU_REASON_CAPACITY_REACHEDRefused because the exchange has no capacity for another active lambda account right now.
OSU_REASON_INVALID_ORDERRefused because the order failed validation.
messagestring

Error message for a refused entry.

POST/v1/compatibility/order/submit-batch
curl -X POST 'https://api.pax.markets/v1/compatibility/order/submit-batch' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "orders": [
    {
      "order": {
        "side": 2,
        "market_id": "1",
        "qty": "100000",
        "ticks": 99990,
        "tif": 2,
        "is_leverage": false
      },
      "client_order_id": "my-order-1"
    }
  ]
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/compatibility/order/submit-batch"
body = json.dumps({
      "orders": [
        {
          "order": {
            "side": 2,
            "market_id": "1",
            "qty": "100000",
            "ticks": 99990,
            "tif": 2,
            "is_leverage": False
          },
          "client_order_id": "my-order-1"
        }
      ]
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/compatibility/order/submit-batch";
let body = serde_json::to_string(&serde_json::json!({
  "orders": [
    {
      "order": {
        "side": 2,
        "market_id": "1",
        "qty": "100000",
        "ticks": 99990,
        "tif": 2,
        "is_leverage": false
      },
      "client_order_id": "my-order-1"
    }
  ]
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/compatibility/order/submit-batch";
const body = JSON.stringify({
  "orders": [
    {
      "order": {
        "side": 2,
        "market_id": "1",
        "qty": "100000",
        "ticks": 99990,
        "tif": 2,
        "is_leverage": false
      },
      "client_order_id": "my-order-1"
    }
  ]
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "results": [
    {
      "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
      "client_order_id": "my-order-1",
      "accepted": true,
      "reason": 0,
      "message": ""
    }
  ]
}
{
  "error": "Failed to parse the request body as JSON: expected value at line 1 column 1"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

Compatibility API›CompatibilityOrder Service

BatchCancelOrders

POSThttps://api.pax.markets/v1/compatibility/order/cancel-batch
Permission: trade

Run several CancelOrder liquidity cancels in one request.

Request

ordersobject[]Optional

List of cancels to apply, in the order given. At most 10 per request.

ShowHide 2 properties
order_idstring

Order whose unfilled quantity, side and price level set the cancel.

client_order_idstringOptional

Client-assigned id for the cancel, at most 36 bytes. Omit or leave empty for none.

Response

A successful response.

resultsobject[]

One result per entry, in request order. order_id is the cancel order's id.

ShowHide 5 properties
order_idstring

Exchange-assigned order id. Empty if refused.

client_order_idstring

The entry's client_order_id. Empty if none was sent.

acceptedboolean

True if the exchange took the order.

reasonenum

Why the entry was refused. OSU_REASON_UNSPECIFIED if accepted.

0 = OSU_REASON_UNSPECIFIED1 = OSU_REASON_ADMIN_CANCELED2 = OSU_REASON_INSUFFICIENT_BALANCE3 = OSU_REASON_DUPLICATE_CLIENT_ID4 = OSU_REASON_EXCHANGE_ERROR5 = OSU_REASON_ALO_WOULD_CROSS6 = OSU_REASON_EXCHANGE_UNAVAILABLE7 = OSU_REASON_CAPACITY_REACHED8 = OSU_REASON_INVALID_ORDER
OSU_REASON_UNSPECIFIEDNone.
OSU_REASON_ADMIN_CANCELEDCanceled by the system, such as ahead of maintenance or shutdown.
OSU_REASON_INSUFFICIENT_BALANCERefused because the account cannot fund the order.
OSU_REASON_DUPLICATE_CLIENT_IDRefused because client_order_id is already in use by a live order.
OSU_REASON_EXCHANGE_ERRORRefused because of an internal exchange error. The order was not placed.
OSU_REASON_ALO_WOULD_CROSSCanceled because the ALO order would have crossed the book.
OSU_REASON_EXCHANGE_UNAVAILABLERefused because the exchange is not accepting orders right now.
OSU_REASON_CAPACITY_REACHEDRefused because the exchange has no capacity for another active lambda account right now.
OSU_REASON_INVALID_ORDERRefused because the order failed validation.
messagestring

Error message for a refused entry.

POST/v1/compatibility/order/cancel-batch
curl -X POST 'https://api.pax.markets/v1/compatibility/order/cancel-batch' \
  -H 'api-access-key: <your-key-id>' \
  -H 'api-timestamp: <timestamp-ms>' \
  -H 'api-signature: <signature>' \
  -H 'Content-Type: application/json' \
  -d '{
  "orders": [
    {
      "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
      "client_order_id": "my-cancel-1"
    }
  ]
}'
import time, json, base64, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key

KEY_ID = "<your-key-id>"
pk = load_pem_private_key(open("my-private-key.pem", "rb").read(), password=None)

ts = str(int(time.time() * 1000))
method = "POST"
path = "/v1/compatibility/order/cancel-batch"
body = json.dumps({
      "orders": [
        {
          "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
          "client_order_id": "my-cancel-1"
        }
      ]
    })
sig = base64.b64encode(pk.sign(f"{ts}{method}{path}{body}".encode())).decode()

response = requests.post(
    f"https://api.pax.markets{path}",
    headers={
        "api-access-key": KEY_ID,
        "api-timestamp": ts,
        "api-signature": sig,
        "Content-Type": "application/json",
    },
    data=body
)
print(response.json())
use ed25519_dalek::{SigningKey, Signer};
use base64::Engine;
use base64::engine::general_purpose::STANDARD;
use std::time::{SystemTime, UNIX_EPOCH};

let key_id = "<your-key-id>";
let signing_key: SigningKey = /* load your Ed25519 private key */;

let ts = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_millis()
    .to_string();
let method = "POST";
let path = "/v1/compatibility/order/cancel-batch";
let body = serde_json::to_string(&serde_json::json!({
  "orders": [
    {
      "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
      "client_order_id": "my-cancel-1"
    }
  ]
})).unwrap();

let message = format!("{}{}{}{}", ts, method, path, body);
let signature = STANDARD.encode(signing_key.sign(message.as_bytes()).to_bytes());

let client = reqwest::Client::new();
let res = client
    .post(format!("https://api.pax.markets{path}"))
    .header("api-access-key", key_id)
    .header("api-timestamp", &ts)
    .header("api-signature", &signature)
    .header("content-type", "application/json")
    .body(body)
    .send()
    .await?;

println!("{}", res.text().await?);
import { readFileSync } from "node:fs";
import { sign } from "node:crypto";

const KEY_ID = "<your-key-id>";
const PRIVATE_KEY = readFileSync("my-private-key.pem", "utf8");

const ts = Date.now().toString();
const method = "POST";
const path = "/v1/compatibility/order/cancel-batch";
const body = JSON.stringify({
  "orders": [
    {
      "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
      "client_order_id": "my-cancel-1"
    }
  ]
});

const sig = sign(null, Buffer.from(ts + method + path + body), PRIVATE_KEY).toString("base64");

const res = await fetch("https://api.pax.markets" + path, {
  method: "POST",
  headers: {
    "api-access-key": KEY_ID,
    "api-timestamp": ts,
    "api-signature": sig,
    "content-type": "application/json",
  },
  body,
});

console.log(await res.json());
{
  "results": [
    {
      "order_id": "01a1bbc7-dd3b-7a1c-8e2f-3b5d9c4a6e71",
      "client_order_id": "my-order-1",
      "accepted": true,
      "reason": 0,
      "message": ""
    }
  ]
}
{
  "error": "Failed to parse the request body as JSON: expected value at line 1 column 1"
}
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "Signature verification failed"
  }
}

llms.txt

Regulated services provided by 1Money USA, Inc., a licensed money transmitter, NMLS ID 2628653 · Licenses