REST API Reference
OpenAPI: all APIs · Order · Lambda · Account · Metadata · Money · Compatibility
SubmitOrder
Place a limit order.
Request
orderobjectThe order to place.
ShowHide 6 properties
sideenumSide to place on.
ASKSell the base asset.BIDBuy the base asset.market_idstringuint64Market to place on.
qtystringint64Quantity to place, a multiple of the market's step size. Must be positive except on a cancel lambda.
ticksintegerint32Limit price in ticks, from 1 to the market's max_ticks.
tifenumHow long the order stays live.
IOCImmediate or cancel.GTCGood until canceled.ALOAdd liquidity only: rests if it would not cross, else canceled.is_leveragebooleanTrade on margin. Currently disabled.
client_order_idstringOptionalClient-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_idstringExchange-assigned order id.
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"
}
}CancelLiquidityOrder
Cancel a quantity of the account's resting liquidity at one price level.
Request
market_idstringuint64Market to cancel on.
qtystringint64Quantity to cancel. Must be positive.
sideenumSide to cancel on.
ASKSell the base asset.BIDBuy the base asset.ticksintegerint32Price level to cancel at, in ticks.
client_order_idstringOptionalClient-assigned id for the cancel, at most 36 bytes. Omit or leave empty for none.
Response
A successful response.
order_idstringExchange-assigned id of the cancel order.
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"
}
}CancelAllOrders
Cancel every resting order for the account, optionally limited to one market.
Request
market_idstringuint64OptionalCancel 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.
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"
}
}BatchSubmitOmniOrders
Place orders and cancel liquidity in one request.
Request
omni_ordersobject[]OptionalList of entries to apply, in the order given. At most 40 per request.
ShowHide 2 properties
message.SubmitOrderobjectOne ofPlace an order.
ShowHide 2 properties
orderobjectThe order to place.
ShowHide 6 properties
sideenumSide to place on.
ASKSell the base asset.BIDBuy the base asset.market_idstringuint64Market to place on.
qtystringint64Quantity to place, a multiple of the market's step size. Must be positive except on a cancel lambda.
ticksintegerint32Limit price in ticks, from 1 to the market's max_ticks.
tifenumHow long the order stays live.
IOCImmediate or cancel.GTCGood until canceled.ALOAdd liquidity only: rests if it would not cross, else canceled.is_leveragebooleanTrade on margin. Currently disabled.
client_order_idstringOptionalClient-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 ofCancel resting liquidity at a price level.
ShowHide 5 properties
market_idstringuint64Market to cancel on.
qtystringint64Quantity to cancel. Must be positive.
sideenumSide to cancel on.
ASKSell the base asset.BIDBuy the base asset.ticksintegerint32Price level to cancel at, in ticks.
client_order_idstringOptionalClient-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_idstringExchange-assigned order id. Empty if refused.
client_order_idstringThe entry's client_order_id. Empty if none was sent.
acceptedbooleanTrue if the exchange took the order.
reasonenumWhy the entry was refused. OSU_REASON_UNSPECIFIED if accepted.
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.messagestringError message for a refused entry.
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"
}
}GetActiveOrders
List the account's open orders, whether pending or resting.
Request
market_idstringuint64OptionalReturn 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_idstringExchange-assigned order id.
client_order_idstringThe order's client_order_id. Empty if none was sent.
orderobjectThe order as placed.
ShowHide 7 properties
sideenumSide the order was placed on.
ASKSell the base asset.BIDBuy the base asset.market_idstringuint64Market the order was placed on.
qtystringint64Quantity submitted. Negative for a cancel order.
ticksintegerint32Limit price in ticks.
tifenumTime in force the order was placed with.
IOCImmediate or cancel.GTCGood until canceled.ALOAdd liquidity only: rests if it would not cross, else canceled.originenumWhat placed the order.
EXOGENOUSPlaced directly through the API.LAMBDAPlaced by a lambda program.ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.lambda_idstringExchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.
qty_filled_makestringint64Quantity filled as maker so far.
qty_filled_takestringint64Quantity filled as taker so far.
qty_canceledstringint64Quantity canceled so far.
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"
}
}GetOrder
Fetch one order by order_id.
Path Parameters
order_idstringId of the order to fetch.
Response
A successful response.
order_idstringExchange-assigned order id.
market_idstringuint64Market the order was placed on.
sideenumSide the order was placed on.
ASKSell the base asset.BIDBuy the base asset.qtystringint64Quantity submitted. Negative for a cancel order.
ticksintegerint32Limit price in ticks.
tifenumTime in force the order was placed with.
IOCImmediate or cancel.GTCGood until canceled.ALOAdd liquidity only: rests if it would not cross, else canceled.order_statusenumCurrent status.
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.originenumWhat placed the order.
EXOGENOUSPlaced directly through the API.LAMBDAPlaced by a lambda program.ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.qty_filled_makestringint64Quantity filled as maker.
qty_filled_takestringint64Quantity filled as taker.
qty_canceledstringint64Quantity canceled.
fill_valuestringint64Total value filled, in the quote asset's native units.
client_order_idstringClient-assigned id from the submit request. Empty if none was sent.
created_time_msstringint64When the order was accepted, in Unix milliseconds.
updated_time_msstringint64When the order last changed, in Unix milliseconds.
lambda_idstringExchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.
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"
}
}GetOrders
List the account's orders, newest first, optionally narrowed to one market and one status.
Request
limitintegerint32OptionalMaximum orders to return, from 1 to 1000. Defaults to 1000.
cursorstringOptionalCursor from the previous response's next_cursor. Omit for the first page.
order_statusenumOptionalReturn only orders in this status.
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_idstringuint64OptionalReturn only orders on this market. Omit for every market.
Response
A successful response.
ordersobject[]List of orders on this page.
ShowHide 16 properties
order_idstringExchange-assigned order id.
market_idstringuint64Market the order was placed on.
sideenumSide the order was placed on.
ASKSell the base asset.BIDBuy the base asset.qtystringint64Quantity submitted. Negative for a cancel order.
ticksintegerint32Limit price in ticks.
tifenumTime in force the order was placed with.
IOCImmediate or cancel.GTCGood until canceled.ALOAdd liquidity only: rests if it would not cross, else canceled.order_statusenumCurrent status.
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.originenumWhat placed the order.
EXOGENOUSPlaced directly through the API.LAMBDAPlaced by a lambda program.ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.qty_filled_makestringint64Quantity filled as maker.
qty_filled_takestringint64Quantity filled as taker.
qty_canceledstringint64Quantity canceled.
fill_valuestringint64Total value filled, in the quote asset's native units.
client_order_idstringClient-assigned id from the submit request. Empty if none was sent.
created_time_msstringint64When the order was accepted, in Unix milliseconds.
updated_time_msstringint64When the order last changed, in Unix milliseconds.
lambda_idstringExchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.
next_cursorstringPass as cursor to fetch the next page. Absent on the last page.
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"
}
}GetOrderStatusUpdates
Read the full status update history of one order. Updates can take up to 15 minutes to appear here.
Request
order_idstringOrder whose history to read.
limitintegerint32OptionalMaximum updates to return, from 1 to 1000. Defaults to 1000.
cursorstringOptionalCursor 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
osuobjectThe status update, as streamed.
ShowHide 12 properties
osu_idstringExchange-assigned id of this status update.
order_idstringExchange-assigned id of the order this update belongs to.
client_order_idstringThe order's client_order_id. Empty if none was sent.
qty_filled_makestringint64Quantity filled as maker in this update.
qty_filled_takestringint64Quantity filled as taker in this update.
qty_canceledstringint64Quantity canceled in this update.
fill_valuestringint64Value filled in this update, in the quote asset's native units.
fee_rebatestringint64Rebate paid, or fee charged when negative, in the quote asset's native units.
orderobjectThe order as placed.
ShowHide 7 properties
sideenumSide the order was placed on.
ASKSell the base asset.BIDBuy the base asset.market_idstringuint64Market the order was placed on.
qtystringint64Quantity submitted. Negative for a cancel order.
ticksintegerint32Limit price in ticks.
tifenumTime in force the order was placed with.
IOCImmediate or cancel.GTCGood until canceled.ALOAdd liquidity only: rests if it would not cross, else canceled.originenumWhat placed the order.
EXOGENOUSPlaced directly through the API.LAMBDAPlaced by a lambda program.ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.lambda_idstringExchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.
order_statusenumOrder status after this update.
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.reasonenumWhy the system refused or canceled the order, if it did.
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_infoobjectTimestamps of this update.
ShowHide 1 property
hw_ser_time_nsstringuint64When 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_msstringint64When this update happened, in Unix milliseconds.
next_cursorstringPass as cursor to fetch the next page. Absent on the last page.
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"
}
}GetRecentFillOrderStatusUpdates
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_idstringuint64OptionalReturn only updates for orders on this market.
limitintegerint32OptionalMaximum updates to return, from 1 to 1000. Defaults to 1000.
cursorstringOptionalCursor 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
osuobjectThe status update, as streamed.
ShowHide 12 properties
osu_idstringExchange-assigned id of this status update.
order_idstringExchange-assigned id of the order this update belongs to.
client_order_idstringThe order's client_order_id. Empty if none was sent.
qty_filled_makestringint64Quantity filled as maker in this update.
qty_filled_takestringint64Quantity filled as taker in this update.
qty_canceledstringint64Quantity canceled in this update.
fill_valuestringint64Value filled in this update, in the quote asset's native units.
fee_rebatestringint64Rebate paid, or fee charged when negative, in the quote asset's native units.
orderobjectThe order as placed.
ShowHide 7 properties
sideenumSide the order was placed on.
ASKSell the base asset.BIDBuy the base asset.market_idstringuint64Market the order was placed on.
qtystringint64Quantity submitted. Negative for a cancel order.
ticksintegerint32Limit price in ticks.
tifenumTime in force the order was placed with.
IOCImmediate or cancel.GTCGood until canceled.ALOAdd liquidity only: rests if it would not cross, else canceled.originenumWhat placed the order.
EXOGENOUSPlaced directly through the API.LAMBDAPlaced by a lambda program.ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.lambda_idstringExchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.
order_statusenumOrder status after this update.
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.reasonenumWhy the system refused or canceled the order, if it did.
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_infoobjectTimestamps of this update.
ShowHide 1 property
hw_ser_time_nsstringuint64When 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_msstringint64When this update happened, in Unix milliseconds.
next_cursorstringPass as cursor to page further back. Absent on the last page.
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"
}
}GetFillOrderStatusUpdatesSince
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_msstringint64Return updates at or after this time, in Unix milliseconds.
market_idstringuint64OptionalReturn only updates for orders on this market.
limitintegerint32OptionalMaximum updates to return, from 1 to 1000. Defaults to 1000.
cursorstringOptionalCursor 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
osuobjectThe status update, as streamed.
ShowHide 12 properties
osu_idstringExchange-assigned id of this status update.
order_idstringExchange-assigned id of the order this update belongs to.
client_order_idstringThe order's client_order_id. Empty if none was sent.
qty_filled_makestringint64Quantity filled as maker in this update.
qty_filled_takestringint64Quantity filled as taker in this update.
qty_canceledstringint64Quantity canceled in this update.
fill_valuestringint64Value filled in this update, in the quote asset's native units.
fee_rebatestringint64Rebate paid, or fee charged when negative, in the quote asset's native units.
orderobjectThe order as placed.
ShowHide 7 properties
sideenumSide the order was placed on.
ASKSell the base asset.BIDBuy the base asset.market_idstringuint64Market the order was placed on.
qtystringint64Quantity submitted. Negative for a cancel order.
ticksintegerint32Limit price in ticks.
tifenumTime in force the order was placed with.
IOCImmediate or cancel.GTCGood until canceled.ALOAdd liquidity only: rests if it would not cross, else canceled.originenumWhat placed the order.
EXOGENOUSPlaced directly through the API.LAMBDAPlaced by a lambda program.ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.lambda_idstringExchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.
order_statusenumOrder status after this update.
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.reasonenumWhy the system refused or canceled the order, if it did.
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_infoobjectTimestamps of this update.
ShowHide 1 property
hw_ser_time_nsstringuint64When 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_msstringint64When this update happened, in Unix milliseconds.
next_cursorstringPass as cursor to fetch the next page. Absent on the last page.
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"
}
}GetOrderStatusUpdatesByTime
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_msstringint64Return updates at or after this time, in Unix milliseconds.
end_time_msstringint64Return updates before this time, in Unix milliseconds. At most 7 days after start_time_ms.
market_idstringuint64OptionalReturn only updates for orders on this market.
limitintegerint32OptionalMaximum updates to return, from 1 to 10000. Defaults to 10000.
cursorstringOptionalCursor 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
osuobjectThe status update, as streamed.
ShowHide 12 properties
osu_idstringExchange-assigned id of this status update.
order_idstringExchange-assigned id of the order this update belongs to.
client_order_idstringThe order's client_order_id. Empty if none was sent.
qty_filled_makestringint64Quantity filled as maker in this update.
qty_filled_takestringint64Quantity filled as taker in this update.
qty_canceledstringint64Quantity canceled in this update.
fill_valuestringint64Value filled in this update, in the quote asset's native units.
fee_rebatestringint64Rebate paid, or fee charged when negative, in the quote asset's native units.
orderobjectThe order as placed.
ShowHide 7 properties
sideenumSide the order was placed on.
ASKSell the base asset.BIDBuy the base asset.market_idstringuint64Market the order was placed on.
qtystringint64Quantity submitted. Negative for a cancel order.
ticksintegerint32Limit price in ticks.
tifenumTime in force the order was placed with.
IOCImmediate or cancel.GTCGood until canceled.ALOAdd liquidity only: rests if it would not cross, else canceled.originenumWhat placed the order.
EXOGENOUSPlaced directly through the API.LAMBDAPlaced by a lambda program.ADMINSystem-initiated, such as cancels ahead of maintenance or shutdown.lambda_idstringExchange-assigned id of the lambda program that placed the order. Empty unless origin is LAMBDA.
order_statusenumOrder status after this update.
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.reasonenumWhy the system refused or canceled the order, if it did.
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_infoobjectTimestamps of this update.
ShowHide 1 property
hw_ser_time_nsstringuint64When 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_msstringint64When this update happened, in Unix milliseconds.
next_cursorstringPass as cursor to fetch the next page. Absent on the last page.
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"
}
}SubmitLambda
Arm a lambda program. Requires a LAMBDA account.
Request
programobjectA lambda program.
ShowHide 1 kind
kindlocalWatches a local order book on PAX.
predicateobjectShowHide 5 properties
market_iduint64 | stringMarket whose order book is watched.
sideenumSide of the book the event happens on.
bidBuy the base asset.askSell the base asset.eventenumrestedLiquidity 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.pxobjectWhich event prices qualify.
ShowHide 3 kinds
kindanyAny price.
kindevent_pxThe event's price is in [min, max] ticks.
minint64 | stringOptionalA price, in units of the market's tick size.
maxint64 | stringOptionalA price, in units of the market's tick size.
kindtob_depthThe 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 | stringOptionalA price, in units of the market's tick size.
maxint64 | stringOptionalA price, in units of the market's tick size.
qtyobjectWhich event quantities qualify.
ShowHide 3 kinds
kindanyAny quantity.
kindevent_qtyThe quantity the event added or removed is in [min, max].
minuint64 | stringOptionalA base-asset quantity in native units, a multiple of the market's qty step size.
maxuint64 | stringOptionalA base-asset quantity in native units, a multiple of the market's qty step size.
kindfinal_level_qtyThe quantity resting at the event's price after the event is in [min, max].
minuint64 | stringOptionalA base-asset quantity in native units, a multiple of the market's qty step size.
maxuint64 | stringOptionalA base-asset quantity in native units, a multiple of the market's qty step size.
orderobjectThe underlying order placed on every fire.
ShowHide 2 kinds
Every kind has:
market_iduint64 | stringMarket the order is placed on.
sideenumSide of the order.
bidBuy the base asset.askSell the base asset.kindlimitA limit order.
tifenumgtcGood 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.pxobjectLimit price.
ShowHide 1 kind
kindfixedA fixed price, in ticks.
ticksint64 | stringA price, in units of the market's tick size.
qtyobjectQuantity.
ShowHide 1 kind
kindfixedA fixed quantity, in the base asset's native units.
qtyuint64 | stringA base-asset quantity in native units, a multiple of the market's qty step size.
kindcancelCancel up to qty of the account's own resting liquidity at one price.
pxobjectPrice of the resting liquidity.
ShowHide 1 kind
kindfixedA fixed price, in ticks.
ticksint64 | stringA price, in units of the market's tick size.
qtyobjectQuantity to cancel.
ShowHide 1 kind
kindfixedA fixed quantity, in the base asset's native units.
qtyuint64 | stringA base-asset quantity in native units, a multiple of the market's qty step size.
lifetimeobjectWhen a lambda program stops firing.
ShowHide 1 kind
kindonceFire once.
client_lambda_idstringOptionalClient-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_idstringuuidExchange-assigned lambda id.
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"
}
}CancelLambda
Cancel a lambda program, named by its exchange-assigned id or its client-assigned id, releasing its untriggered quantity.
Request
keyobjectThe lambda program to cancel.
ShowHide 2 kinds
kindexchangeThe exchange-assigned id.
idstringuuidkindclientThe client-assigned id, at most 36 bytes. Only matches a live lambda program.
idstringResponse
A successful response.
lambda_idstringuuidExchange-assigned id of the lambda program being canceled.
cancel_idstringuuidExchange-assigned id of this 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"
}
}GetLambdas
List the account's lambda programs, newest first, optionally narrowed to one market and one status.
Request
statusenumOptionalReturn only lambda programs in this status.
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_idintegeruint64OptionalReturn only lambda programs on this market. Omit for every market.
limitintegeruint32OptionalMaximum lambda programs to return, from 1 to 1000. Defaults to 1000.
cursorstringOptionalCursor from the previous response's next_cursor. Omit for the first page.
Response
A successful response.
lambdasobject[]ShowHide 7 properties
lambda_idstringuuidExchange-assigned lambda id.
client_lambda_idstringNullableClient-assigned id from the submit request.
statusenumpendingSubmitted, 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.programobjectNullableThe program as it was submitted.
ShowHide 1 kind
kindlocalWatches a local order book on PAX.
predicateobjectShowHide 5 properties
market_iduint64 | stringMarket whose order book is watched.
sideenumSide of the book the event happens on.
bidBuy the base asset.askSell the base asset.eventenumrestedLiquidity 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.pxobjectWhich event prices qualify.
ShowHide 3 kinds
kindanyAny price.
kindevent_pxThe event's price is in [min, max] ticks.
minint64 | stringNullableA price, in units of the market's tick size.
maxint64 | stringNullableA price, in units of the market's tick size.
kindtob_depthThe 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 | stringNullableA price, in units of the market's tick size.
maxint64 | stringNullableA price, in units of the market's tick size.
qtyobjectWhich event quantities qualify.
ShowHide 3 kinds
kindanyAny quantity.
kindevent_qtyThe quantity the event added or removed is in [min, max].
minuint64 | stringNullableA base-asset quantity in native units, a multiple of the market's qty step size.
maxuint64 | stringNullableA base-asset quantity in native units, a multiple of the market's qty step size.
kindfinal_level_qtyThe quantity resting at the event's price after the event is in [min, max].
minuint64 | stringNullableA base-asset quantity in native units, a multiple of the market's qty step size.
maxuint64 | stringNullableA base-asset quantity in native units, a multiple of the market's qty step size.
orderobjectThe underlying order placed on every fire.
ShowHide 2 kinds
Every kind has:
market_iduint64 | stringMarket the order is placed on.
sideenumSide of the order.
bidBuy the base asset.askSell the base asset.kindlimitA limit order.
tifenumgtcGood 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.pxobjectLimit price.
ShowHide 1 kind
kindfixedA fixed price, in ticks.
ticksint64 | stringA price, in units of the market's tick size.
qtyobjectQuantity.
ShowHide 1 kind
kindfixedA fixed quantity, in the base asset's native units.
qtyuint64 | stringA base-asset quantity in native units, a multiple of the market's qty step size.
kindcancelCancel up to qty of the account's own resting liquidity at one price.
pxobjectPrice of the resting liquidity.
ShowHide 1 kind
kindfixedA fixed price, in ticks.
ticksint64 | stringA price, in units of the market's tick size.
qtyobjectQuantity to cancel.
ShowHide 1 kind
kindfixedA fixed quantity, in the base asset's native units.
qtyuint64 | stringA base-asset quantity in native units, a multiple of the market's qty step size.
lifetimeobjectWhen a lambda program stops firing.
ShowHide 1 kind
kindonceFire once.
qty_triggeredstringuint64Quantity the lambda program has placed so far.
created_time_msstringint64When the lambda program was submitted, in Unix milliseconds.
updated_time_msstringint64When the lambda program last changed, in Unix milliseconds.
next_cursorstringNullablePass as cursor to fetch the next page. Null on the last page.
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"
}
}GetLambda
Fetch one lambda program by lambda_id.
Path Parameters
lambda_idstringuuidExchange-assigned id of the lambda program to fetch.
Response
A successful response.
lambda_idstringuuidExchange-assigned lambda id.
client_lambda_idstringNullableClient-assigned id from the submit request.
statusenumpendingSubmitted, 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.programobjectNullableThe program as it was submitted.
ShowHide 1 kind
kindlocalWatches a local order book on PAX.
predicateobjectShowHide 5 properties
market_iduint64 | stringMarket whose order book is watched.
sideenumSide of the book the event happens on.
bidBuy the base asset.askSell the base asset.eventenumrestedLiquidity 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.pxobjectWhich event prices qualify.
ShowHide 3 kinds
kindanyAny price.
kindevent_pxThe event's price is in [min, max] ticks.
minint64 | stringNullableA price, in units of the market's tick size.
maxint64 | stringNullableA price, in units of the market's tick size.
kindtob_depthThe 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 | stringNullableA price, in units of the market's tick size.
maxint64 | stringNullableA price, in units of the market's tick size.
qtyobjectWhich event quantities qualify.
ShowHide 3 kinds
kindanyAny quantity.
kindevent_qtyThe quantity the event added or removed is in [min, max].
minuint64 | stringNullableA base-asset quantity in native units, a multiple of the market's qty step size.
maxuint64 | stringNullableA base-asset quantity in native units, a multiple of the market's qty step size.
kindfinal_level_qtyThe quantity resting at the event's price after the event is in [min, max].
minuint64 | stringNullableA base-asset quantity in native units, a multiple of the market's qty step size.
maxuint64 | stringNullableA base-asset quantity in native units, a multiple of the market's qty step size.
orderobjectThe underlying order placed on every fire.
ShowHide 2 kinds
Every kind has:
market_iduint64 | stringMarket the order is placed on.
sideenumSide of the order.
bidBuy the base asset.askSell the base asset.kindlimitA limit order.
tifenumgtcGood 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.pxobjectLimit price.
ShowHide 1 kind
kindfixedA fixed price, in ticks.
ticksint64 | stringA price, in units of the market's tick size.
qtyobjectQuantity.
ShowHide 1 kind
kindfixedA fixed quantity, in the base asset's native units.
qtyuint64 | stringA base-asset quantity in native units, a multiple of the market's qty step size.
kindcancelCancel up to qty of the account's own resting liquidity at one price.
pxobjectPrice of the resting liquidity.
ShowHide 1 kind
kindfixedA fixed price, in ticks.
ticksint64 | stringA price, in units of the market's tick size.
qtyobjectQuantity to cancel.
ShowHide 1 kind
kindfixedA fixed quantity, in the base asset's native units.
qtyuint64 | stringA base-asset quantity in native units, a multiple of the market's qty step size.
lifetimeobjectWhen a lambda program stops firing.
ShowHide 1 kind
kindonceFire once.
qty_triggeredstringuint64Quantity the lambda program has placed so far.
created_time_msstringint64When the lambda program was submitted, in Unix milliseconds.
updated_time_msstringint64When the lambda program last changed, in Unix milliseconds.
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"
}
}GetActiveLambdas
List the account's lambda programs currently in force. The user-data WebSocket's snapshot carries the same list.
Request
market_idintegeruint64OptionalReturn 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_idstringuuidExchange-assigned lambda id.
client_lambda_idstringNullableClient-assigned id from the submit request.
statusenumpendingSubmitted, 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.programobjectNullableThe program as it was submitted.
ShowHide 1 kind
kindlocalWatches a local order book on PAX.
predicateobjectShowHide 5 properties
market_iduint64 | stringMarket whose order book is watched.
sideenumSide of the book the event happens on.
bidBuy the base asset.askSell the base asset.eventenumrestedLiquidity 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.pxobjectWhich event prices qualify.
ShowHide 3 kinds
kindanyAny price.
kindevent_pxThe event's price is in [min, max] ticks.
minint64 | stringNullableA price, in units of the market's tick size.
maxint64 | stringNullableA price, in units of the market's tick size.
kindtob_depthThe 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 | stringNullableA price, in units of the market's tick size.
maxint64 | stringNullableA price, in units of the market's tick size.
qtyobjectWhich event quantities qualify.
ShowHide 3 kinds
kindanyAny quantity.
kindevent_qtyThe quantity the event added or removed is in [min, max].
minuint64 | stringNullableA base-asset quantity in native units, a multiple of the market's qty step size.
maxuint64 | stringNullableA base-asset quantity in native units, a multiple of the market's qty step size.
kindfinal_level_qtyThe quantity resting at the event's price after the event is in [min, max].
minuint64 | stringNullableA base-asset quantity in native units, a multiple of the market's qty step size.
maxuint64 | stringNullableA base-asset quantity in native units, a multiple of the market's qty step size.
orderobjectThe underlying order placed on every fire.
ShowHide 2 kinds
Every kind has:
market_iduint64 | stringMarket the order is placed on.
sideenumSide of the order.
bidBuy the base asset.askSell the base asset.kindlimitA limit order.
tifenumgtcGood 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.pxobjectLimit price.
ShowHide 1 kind
kindfixedA fixed price, in ticks.
ticksint64 | stringA price, in units of the market's tick size.
qtyobjectQuantity.
ShowHide 1 kind
kindfixedA fixed quantity, in the base asset's native units.
qtyuint64 | stringA base-asset quantity in native units, a multiple of the market's qty step size.
kindcancelCancel up to qty of the account's own resting liquidity at one price.
pxobjectPrice of the resting liquidity.
ShowHide 1 kind
kindfixedA fixed price, in ticks.
ticksint64 | stringA price, in units of the market's tick size.
qtyobjectQuantity to cancel.
ShowHide 1 kind
kindfixedA fixed quantity, in the base asset's native units.
qtyuint64 | stringA base-asset quantity in native units, a multiple of the market's qty step size.
lifetimeobjectWhen a lambda program stops firing.
ShowHide 1 kind
kindonceFire once.
qty_triggeredstringuint64Quantity the lambda program has placed so far.
created_time_msstringint64When the lambda program was submitted, in Unix milliseconds.
updated_time_msstringint64When the lambda program last changed, in Unix milliseconds.
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"
}
}GetPendingLambdaCancels
List the account's lambda cancels that are not yet confirmed.
Response
A successful response.
pending_cancelsobject[]ShowHide 3 properties
lambda_idstringuuidLambda program being canceled.
client_lambda_idstringNullableClient-assigned lambda id, if one was sent.
cancel_idstringuuidExchange-assigned id of this lambda cancel request.
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"
}
}GetLambdaStatusUpdates
Read the full status update history of one lambda program. Updates can take up to 15 minutes to appear here.
Request
lambda_idstringuuidExchange-assigned id of the lambda program whose history to read.
limitintegeruint32OptionalMaximum updates to return, from 1 to 1000. Defaults to 1000.
cursorstringOptionalCursor from the previous response's next_cursor. Omit for the first page.
Response
A successful response.
lambda_status_updatesobject[]ShowHide 8 properties
lsu_idstringuuidNullableId of this status update.
lambda_idstringuuidNullableExchange-assigned id of the lambda program this update belongs to. Null for older updates that did not record it.
client_lambda_idstringNullableClient-assigned lambda id, if one was sent.
delta_qtystringint64Change 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.
statusenumNew status of the lambda program.
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.reasonenumprogrammedAccepted 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_msstringint64When this update happened, in Unix milliseconds.
cancel_idstringuuidNullableExchange-assigned id of the lambda cancel request. Null unless reason is canceled or cancel_missed.
next_cursorstringNullablePass as cursor to fetch the next page. Null on the last page.
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"
}
}GetRecentLambdaStatusUpdates
Read the account's most recent lambda status updates, newest first. Covers the last 10,000 updates per account.
Request
limitintegeruint32OptionalMaximum updates to return, from 1 to 1000. Defaults to 1000.
cursorstringOptionalCursor 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_idstringuuidNullableId of this status update.
lambda_idstringuuidNullableExchange-assigned id of the lambda program this update belongs to. Null for older updates that did not record it.
client_lambda_idstringNullableClient-assigned lambda id, if one was sent.
delta_qtystringint64Change 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.
statusenumNew status of the lambda program.
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.reasonenumprogrammedAccepted 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_msstringint64When this update happened, in Unix milliseconds.
cancel_idstringuuidNullableExchange-assigned id of the lambda cancel request. Null unless reason is canceled or cancel_missed.
next_cursorstringNullablePass as cursor to fetch the next page. Null on the last page.
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"
}
}GetLambdaStatusUpdatesSince
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_msintegerint64Return updates at or after this time, in Unix milliseconds.
limitintegeruint32OptionalMaximum updates to return, from 1 to 1000. Defaults to 1000.
cursorstringOptionalCursor 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_idstringuuidNullableId of this status update.
lambda_idstringuuidNullableExchange-assigned id of the lambda program this update belongs to. Null for older updates that did not record it.
client_lambda_idstringNullableClient-assigned lambda id, if one was sent.
delta_qtystringint64Change 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.
statusenumNew status of the lambda program.
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.reasonenumprogrammedAccepted 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_msstringint64When this update happened, in Unix milliseconds.
cancel_idstringuuidNullableExchange-assigned id of the lambda cancel request. Null unless reason is canceled or cancel_missed.
next_cursorstringNullablePass as cursor to fetch the next page. Null on the last page.
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"
}
}GetLambdaStatusUpdatesByTime
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_msintegerint64Return updates at or after this time, in Unix milliseconds.
end_time_msintegerint64Return updates before this time, in Unix milliseconds. At most 7 days after start_time_ms.
limitintegeruint32OptionalMaximum updates to return, from 1 to 10000. Defaults to 10000.
cursorstringOptionalCursor from the previous response's next_cursor, with the same time range.
Response
A successful response.
lambda_status_updatesobject[]ShowHide 8 properties
lsu_idstringuuidNullableId of this status update.
lambda_idstringuuidNullableExchange-assigned id of the lambda program this update belongs to. Null for older updates that did not record it.
client_lambda_idstringNullableClient-assigned lambda id, if one was sent.
delta_qtystringint64Change 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.
statusenumNew status of the lambda program.
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.reasonenumprogrammedAccepted 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_msstringint64When this update happened, in Unix milliseconds.
cancel_idstringuuidNullableExchange-assigned id of the lambda cancel request. Null unless reason is canceled or cancel_missed.
next_cursorstringNullablePass as cursor to fetch the next page. Null on the last page.
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"
}
}RevokeApiKey
Request
key_idstringResponse
A successful response.
successbooleancurl -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"
}
}GetBalance
Request
assetenumOptionalResponse
A successful response.
asset_balancesobject[]ShowHide 3 properties
assetenumbalance_qtystringint64frozen_qtystringint64curl -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"
}
}GetBalancesForMarket
Path Parameters
market_idstringuint64Response
A successful response.
asset_balancesobject[]ShowHide 3 properties
assetenumbalance_qtystringint64frozen_qtystringint64curl -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"
}
}GetAccountStatus
Response
A successful response.
emailstringkyc_statusenumkyc_completed_at_unix_secondsstringint64curl -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"
}
}ListApiKeys
Response
A successful response.
keysobject[]ShowHide 11 properties
key_idstringdescriptionstringcreated_at_unix_secondsstringint64expires_at_unix_secondsstringint64revokedbooleanpublic_keystringcan_tradebooleancan_withdrawbooleanaccount_typeenumip_whiteliststring[]created_by_emailstringEmail of the team member who created the key, when known. Only returned to signed-in sessions.
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"
}
}ListAccounts
Response
A successful response.
accountsobject[]ShowHide 2 properties
external_account_idstringaccount_typeenumcurl -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"
}
}GetExchangeInfo
List the exchange's markets, assets and fee rates.
Response
A successful response.
assetsobject[]List of all traded assets.
ShowHide 4 properties
asset_idstringuint64Asset id.
asset_namestringAsset name.
native_unit_namestringName of the asset's smallest unit.
num_native_unitsstringint64Native units in one whole asset.
marketsobject[]List of all traded markets.
ShowHide 13 properties
market_idstringuint64Market id.
market_namestringMarket name.
market_typeenumKind of market.
SPOTBuy or sell the base asset outright.base_asset_idstringuint64Asset bought or sold.
quote_asset_idstringuint64Asset paid or received.
qty_unit_namestringName of the base asset's native unit.
tick_unit_namestringName of the quote asset's native unit.
tick_sizestringuint64Quote native units per tick.
qty_step_sizestringint64Base native units per step.
max_qtystringint64Largest order quantity, in base native units.
notesstringAdditional notes.
max_ticksintegerint32Highest order price, in ticks.
min_notionalstringint64Smallest order value at its limit price, in quote native units.
feesobjectFee and rebate rates, settled per fill in the quote asset.
ShowHide 5 properties
lambda_taker_fee_bpsstringLambda taker fee, in bps of fill value. Rounded up.
lambda_maker_spread_multiplierstringLambda maker fee, as a share of its spread. Rounded up.
lambda_maker_fee_cap_bpsstringLambda maker fee cap, in bps of fill value. Rounded up.
free_tier_rebate_multiplierstringFree-tier rebate, as a share of the lambda counterparty's fee. Rounded down.
free_tier_rebate_cap_bpsstringFree-tier rebate cap, in bps of fill value. Rounded down.
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"
}
}AttributeCryptoDeposit
Request
crypto_deposit_idstringoriginator_countrystringoriginator_namestringorigin_wallet_typeenumResponse
A successful response.
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"
}
}SubmitCryptoWithdrawal
Request
chainstringassetenumamountstringint64withdraw_wallet_addressstringidempotency_keystringResponse
A successful response.
statusenumcurl -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"
}
}SubmitFiatWithdrawal
Request
idempotency_keystringcurrencystringamountstringint64withdraw_bank_account_idstringmemostringResponse
A successful response.
statusenumcurl -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"
}
}CreateConversionQuote
Request
from_assetenumto_assetenumfrom_amountstringint64Response
A successful response.
from_assetenumfrom_amountstringint64to_assetenumto_amountstringint64valid_until_time_msstringint64quote_idstringcurl -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"
}
}SubmitConversion
Request
idempotency_keystringfrom_assetenumto_assetenumfrom_amountstringint64min_to_amountstringint64quote_idstringResponse
A successful response.
statusenumidstringcurl -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"
}
}GetSupportedChainsForAsset
Path Parameters
assetenumResponse
A successful response.
chainsstring[]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"
}
}GetDepositAddresses
Response
A successful response.
deposit_addressesobject[]ShowHide 4 properties
chainstringassetenumaddressstringcreated_time_msstringint64curl -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"
}
}GetDepositAddress
Path Parameters
assetenumRequest
chainstringResponse
A successful response.
deposit_addressobjectShowHide 4 properties
chainstringassetenumaddressstringcreated_time_msstringint64curl -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"
}
}GetCryptoDeposits
Response
A successful response.
depositsobject[]ShowHide 9 properties
idstringstatusenumchainstringassetenumamountstringint64source_wallet_addressstringdeposit_wallet_addressstringtransaction_hashstringcreated_time_msstringint64curl -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"
}
}GetFiatDepositInstructions
Response
A successful response.
instructionsobject[]ShowHide 12 properties
idstringbank_networkenumcurrencystringaccount_holder_namestringaccount_numberstringbank_namestringbank_routing_numberstringbank_swift_codestringreference_codestringconvert_to_assetenumdeposit_feestringint64instruction_typeenumcurl -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"
}
}GetFiatDeposits
Response
A successful response.
depositsobject[]ShowHide 9 properties
idstringstatusenumcurrencystringamountstringint64feestringint64credited_assetenumcredited_amountstringint64created_time_msstringint64bank_networkenumcurl -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"
}
}GetWithdrawWallets
Request
include_archivedbooleanOptionalResponse
A successful response.
walletsobject[]ShowHide 7 properties
idstringchainstringaddressstringcreated_time_msstringint64archived_time_msstringint64statusenumdescriptionstringcurl -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"
}
}GetWithdrawWallet
Path Parameters
withdraw_wallet_idstringResponse
A successful response.
walletobjectShowHide 7 properties
idstringchainstringaddressstringcreated_time_msstringint64archived_time_msstringint64statusenumdescriptionstringcurl -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"
}
}GetWithdrawWalletByAddress
Path Parameters
wallet_addressstringRequest
chainstringResponse
A successful response.
walletobjectShowHide 7 properties
idstringchainstringaddressstringcreated_time_msstringint64archived_time_msstringint64statusenumdescriptionstringcurl -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"
}
}GetCryptoWithdrawals
Response
A successful response.
withdrawalsobject[]ShowHide 13 properties
idstringidempotency_keystringwithdraw_wallet_addressstringchainstringassetenumamountstringint64fee_tokenstringfeestringint64statusenumtransaction_hashstringcreated_time_msstringint64updated_time_msstringint64received_amountstringint64curl -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"
}
}GetCryptoWithdrawal
Path Parameters
withdrawal_idstringResponse
A successful response.
withdrawalobjectShowHide 13 properties
idstringidempotency_keystringwithdraw_wallet_addressstringchainstringassetenumamountstringint64fee_tokenstringfeestringint64statusenumtransaction_hashstringcreated_time_msstringint64updated_time_msstringint64received_amountstringint64curl -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"
}
}GetCryptoWithdrawalByIdempotencyKey
Path Parameters
idempotency_keystringResponse
A successful response.
withdrawalobjectShowHide 13 properties
idstringidempotency_keystringwithdraw_wallet_addressstringchainstringassetenumamountstringint64fee_tokenstringfeestringint64statusenumtransaction_hashstringcreated_time_msstringint64updated_time_msstringint64received_amountstringint64curl -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"
}
}GetWithdrawBankAccounts
Request
include_archivedbooleanOptionalResponse
A successful response.
bank_accountsobject[]ShowHide 5 properties
bank_account_typeenumus_bank_accountobjectShowHide 7 properties
idstringnicknamestringtransfer_typeenumaccount_holder_namestringaccount_numberstringbank_namestringbank_routing_numberstringstatusenumcreated_time_msstringint64archived_time_msstringint64curl -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"
}
}GetWithdrawBankAccount
Path Parameters
withdraw_bank_account_idstringResponse
A successful response.
bank_accountobjectShowHide 5 properties
bank_account_typeenumus_bank_accountobjectShowHide 7 properties
idstringnicknamestringtransfer_typeenumaccount_holder_namestringaccount_numberstringbank_namestringbank_routing_numberstringstatusenumcreated_time_msstringint64archived_time_msstringint64curl -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"
}
}GetFiatWithdrawals
Response
A successful response.
withdrawalsobject[]ShowHide 13 properties
idstringidempotency_keystringbank_account_idstringtransfer_methodenumcurrencystringamountstringint64fee_currencystringfeestringint64memostringstatusenumreferencestringcreated_time_msstringint64updated_time_msstringint64curl -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"
}
}GetFiatWithdrawal
Path Parameters
withdrawal_idstringResponse
A successful response.
withdrawalobjectShowHide 13 properties
idstringidempotency_keystringbank_account_idstringtransfer_methodenumcurrencystringamountstringint64fee_currencystringfeestringint64memostringstatusenumreferencestringcreated_time_msstringint64updated_time_msstringint64curl -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"
}
}GetFiatWithdrawalByIdempotencyKey
Path Parameters
idempotency_keystringResponse
A successful response.
withdrawalobjectShowHide 13 properties
idstringidempotency_keystringbank_account_idstringtransfer_methodenumcurrencystringamountstringint64fee_currencystringfeestringint64memostringstatusenumreferencestringcreated_time_msstringint64updated_time_msstringint64curl -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"
}
}GetCryptoTransfers
Response
A successful response.
transfersobject[]ShowHide 14 properties
idstringtypeenumchainstringassetenumamountstringint64fee_tokenstringfeestringint64sender_wallet_addressstringreceiver_wallet_addressstringdeposit_statusenumwithdrawal_statusenumtransaction_hashstringcreated_time_msstringint64updated_time_msstringint64curl -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"
}
}GetConversions
Response
A successful response.
conversionsobject[]ShowHide 10 properties
idstringstatusenumfrom_assetenumfrom_amountstringint64to_assetenumto_amountstringint64created_time_msstringint64updated_time_msstringint64fee_assetenumfee_amountstringint64curl -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"
}
}GetConversion
Path Parameters
conversion_idstringResponse
A successful response.
conversionobjectShowHide 10 properties
idstringstatusenumfrom_assetenumfrom_amountstringint64to_assetenumto_amountstringint64created_time_msstringint64updated_time_msstringint64fee_assetenumfee_amountstringint64curl -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"
}
}ArchiveWithdrawWallet
Path Parameters
withdraw_wallet_idstringResponse
A successful response.
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"
}
}ArchiveWithdrawBankAccount
Path Parameters
withdraw_bank_account_idstringResponse
A successful response.
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"
}
}CancelOrder
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_idstringOrder whose unfilled quantity, side and price level set the cancel.
client_order_idstringOptionalClient-assigned id for the cancel, at most 36 bytes. Omit or leave empty for none.
Response
A successful response.
order_idstringExchange-assigned id of the cancel order, not of the order named in the request.
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"
}
}BatchSubmitOrders
Place several orders in one request.
Request
ordersobject[]OptionalList of orders to place, in the order given. At most 10 per request.
ShowHide 2 properties
orderobjectThe order to place.
ShowHide 6 properties
sideenumSide to place on.
ASKSell the base asset.BIDBuy the base asset.market_idstringuint64Market to place on.
qtystringint64Quantity to place, a multiple of the market's step size. Must be positive except on a cancel lambda.
ticksintegerint32Limit price in ticks, from 1 to the market's max_ticks.
tifenumHow long the order stays live.
IOCImmediate or cancel.GTCGood until canceled.ALOAdd liquidity only: rests if it would not cross, else canceled.is_leveragebooleanTrade on margin. Currently disabled.
client_order_idstringOptionalClient-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_idstringExchange-assigned order id. Empty if refused.
client_order_idstringThe entry's client_order_id. Empty if none was sent.
acceptedbooleanTrue if the exchange took the order.
reasonenumWhy the entry was refused. OSU_REASON_UNSPECIFIED if accepted.
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.messagestringError message for a refused entry.
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"
}
}BatchCancelOrders
Run several CancelOrder liquidity cancels in one request.
Request
ordersobject[]OptionalList of cancels to apply, in the order given. At most 10 per request.
ShowHide 2 properties
order_idstringOrder whose unfilled quantity, side and price level set the cancel.
client_order_idstringOptionalClient-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_idstringExchange-assigned order id. Empty if refused.
client_order_idstringThe entry's client_order_id. Empty if none was sent.
acceptedbooleanTrue if the exchange took the order.
reasonenumWhy the entry was refused. OSU_REASON_UNSPECIFIED if accepted.
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.messagestringError message for a refused entry.
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"
}
}Regulated services provided by 1Money USA, Inc., a licensed money transmitter, NMLS ID 2628653 · Licenses