Common¶
余额、交易费率与流水。Read only、Spot trade、Wallet Key 均可调用。
Pepperstone Crypto Public OpenAPI — Common 1.0.0¶
Pepperstone Crypto 公开 REST API。
需鉴权的接口使用 HMAC。签名规则见开发者文档「鉴权」章节。WebSocket 行情与私有流另见 WebSocket 文档。除另行说明外,时间均为 UTC 毫秒。
Servers¶
| Description | URL |
|---|---|
| Production | https://api.pcrypto.com |
Common¶
GET /openapi/v1/account¶
获取现货账户
Description
所需类型:通用(Read only / 现货交易 / 钱包均可)
输入参数
| 参数 | 位置 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|---|
x-ptrader-apikey |
header | string | 是 | API Key。 | |
recvWindow |
query | integer | 否 | 5000 |
请求有效时间窗(毫秒),范围 1–60000。 |
signature |
query | string | 是 | HMAC-SHA256 签名(十六进制)。见「鉴权 → HMAC 签名」。 | |
timestamp |
query | integer | 是 | 请求时间戳(Unix 毫秒)。 |
GET /openapi/v1/accountcurl -sS -X GET 'https://api.pcrypto.com/openapi/v1/account?recvWindow=5000&signature={signature}×tamp={ts}' \
-H 'x-ptrader-apikey: {apiKey}'{
"canTrade": true,
"canDeposit": true,
"canWithdraw": true,
"accountType": "SPOT",
"updateTime": 1713100000000,
"balances": [
{
"asset": "BTC",
"free": "1.5",
"locked": "0.1"
},
{
"asset": "USDT",
"free": "10000",
"locked": "0"
}
],
"token": "USDT",
"daily": {
"cashInLimit": "100000",
"cashInRemaining": "90000",
"cashOutLimit": "100000",
"cashOutRemaining": "90000",
"totalWithdrawLimit": "100000",
"totalWithdrawRemaining": "90000"
},
"monthly": {
"cashInLimit": "1000000",
"cashInRemaining": "900000",
"cashOutLimit": "1000000",
"cashOutRemaining": "900000",
"totalWithdrawLimit": "1000000",
"totalWithdrawRemaining": "900000"
},
"annually": {
"cashInLimit": "10000000",
"cashInRemaining": "9000000",
"cashOutLimit": "10000000",
"cashOutRemaining": "9000000",
"totalWithdrawLimit": "10000000",
"totalWithdrawRemaining": "9000000"
}
}Responses
Success
Response fields
| Name | Type | Description |
|---|---|---|
accountType |
string | |
annually |
KycRemainingDetail | |
balances |
Array<BalanceSim> | |
canDeposit |
boolean | |
canTrade |
boolean | |
canWithdraw |
boolean | |
daily |
KycRemainingDetail | |
monthly |
KycRemainingDetail | |
token |
string | |
updateTime |
integer(int64) |
rate_limited
Response fields
Error payload. Most API errors (including auth failures such as -1002) return HTTP 200 — see Error codes → HTTP status mapping. HTTP 400 for missing or invalid request parameters. HTTP 429 when rate limited.
| Name | Type | Description |
|---|---|---|
code |
integer | |
msg |
string |
GET /openapi/v1/asset/tradeFee¶
获取交易手续费
Description
所需类型:通用(Read only / 现货交易 / 钱包均可)
输入参数
| 参数 | 位置 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|---|
x-ptrader-apikey |
header | string | 是 | API Key。 | |
recvWindow |
query | integer | 否 | 5000 |
请求有效时间窗(毫秒),范围 1–60000。 |
signature |
query | string | 是 | HMAC-SHA256 签名(十六进制)。见「鉴权 → HMAC 签名」。 | |
symbol |
query | string | 否 | 交易对(如 BTCUSDT)。大小写不敏感,建议大写。 |
|
timestamp |
query | integer | 是 | 请求时间戳(Unix 毫秒)。 |
备注
- 此接口的
timestamp必须作为 query 参数发送,不接受timestamp请求头。
GET /openapi/v1/asset/tradeFeecurl -sS -X GET 'https://api.pcrypto.com/openapi/v1/asset/tradeFee?recvWindow=5000&signature={signature}×tamp={ts}' \
-H 'x-ptrader-apikey: {apiKey}'[
{
"symbol": "BTCUSDT",
"makerCommission": "0.001",
"takerCommission": "0.001"
}
]Responses
Success
Response fields
Array of TradeFee:
| Name | Type | Description |
|---|---|---|
makerCommission |
string | |
symbol |
string | |
takerCommission |
string |
rate_limited
Response fields
Error payload. Most API errors (including auth failures such as -1002) return HTTP 200 — see Error codes → HTTP status mapping. HTTP 400 for missing or invalid request parameters. HTTP 429 when rate limited.
| Name | Type | Description |
|---|---|---|
code |
integer | |
msg |
string |
GET /openapi/v1/asset/transaction/history¶
查询资金流水
Description
所需类型:通用(Read only / 现货交易 / 钱包均可)
输入参数
| 参数 | 位置 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|---|
x-ptrader-apikey |
header | string | 是 | API Key。 | |
pageNum |
query | integer | 否 | 1 |
|
pageSize |
query | integer | 否 | 20 |
|
recvWindow |
query | integer | 否 | 5000 |
请求有效时间窗(毫秒),范围 1–60000。 |
signature |
query | string | 是 | HMAC-SHA256 签名(十六进制)。见「鉴权 → HMAC 签名」。 | |
timestamp |
query | integer | 是 | 请求时间戳(Unix 毫秒)。 | |
tokenId |
query | string | 是 |
备注
- 此接口的
timestamp必须作为 query 参数发送,不接受timestamp请求头。
GET /openapi/v1/asset/transaction/historycurl -sS -X GET 'https://api.pcrypto.com/openapi/v1/asset/transaction/history?pageNum=1&pageSize=20&recvWindow=5000&signature={signature}×tamp={ts}&tokenId=USDT' \
-H 'x-ptrader-apikey: {apiKey}'{
"transactions": [
{
"txId": "tx-1001",
"bizSubject": "DEPOSIT",
"tokenId": "USDT",
"status": "SUCCESS",
"changed": "100",
"time": "1713100000000"
}
],
"meta": {
"has_next": false,
"next_page": 0,
"previous_page": 0
}
}Responses
Success
Response fields
| Name | Type | Description |
|---|---|---|
meta |
PageMeta | |
transactions |
Array<TransactionHistoryItem> |
missing_parameter
Response fields
Error payload. Most API errors (including auth failures such as -1002) return HTTP 200 — see Error codes → HTTP status mapping. HTTP 400 for missing or invalid request parameters. HTTP 429 when rate limited.
| Name | Type | Description |
|---|---|---|
code |
integer | |
msg |
string |
rate_limited
Response fields
Error payload. Most API errors (including auth failures such as -1002) return HTTP 200 — see Error codes → HTTP status mapping. HTTP 400 for missing or invalid request parameters. HTTP 429 when rate limited.
| Name | Type | Description |
|---|---|---|
code |
integer | |
msg |
string |
GET /openapi/account/v3/crypto-accounts¶
获取加密账户
Description
所需类型:通用(Read only / 现货交易 / 钱包均可)
输入参数
| 参数 | 位置 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|---|
x-ptrader-apikey |
header | string | 是 | API Key。 | |
currency |
query | string | 否 | ||
recvWindow |
query | integer | 否 | 5000 |
请求有效时间窗(毫秒),范围 1–60000。 |
signature |
query | string | 是 | HMAC-SHA256 签名(十六进制)。见「鉴权 → HMAC 签名」。 | |
timestamp |
query | integer | 是 | 请求时间戳(Unix 毫秒)。 |
GET /openapi/account/v3/crypto-accountscurl -sS -X GET 'https://api.pcrypto.com/openapi/account/v3/crypto-accounts?currency=USDT&recvWindow=5000&signature={signature}×tamp={ts}' \
-H 'x-ptrader-apikey: {apiKey}'{
"crypto-accounts": [
{
"id": "acc-1",
"name": "USDT",
"currency": "USDT",
"balance": "1000.50",
"pending_balance": "0"
}
]
}Responses
rate_limited
Response fields
Error payload. Most API errors (including auth failures such as -1002) return HTTP 200 — see Error codes → HTTP status mapping. HTTP 400 for missing or invalid request parameters. HTTP 429 when rate limited.
| Name | Type | Description |
|---|---|---|
code |
integer | |
msg |
string |
Schemas¶
AccountInfo¶
| Name | Type | Description |
|---|---|---|
accountType |
string | |
annually |
KycRemainingDetail | |
balances |
Array<BalanceSim> | |
canDeposit |
boolean | |
canTrade |
boolean | |
canWithdraw |
boolean | |
daily |
KycRemainingDetail | |
monthly |
KycRemainingDetail | |
token |
string | |
updateTime |
integer(int64) |
BalanceApi¶
| Name | Type | Description |
|---|---|---|
balance |
string | |
currency |
string | |
id |
string | |
name |
string | |
pending_balance |
string |
BalanceSim¶
| Name | Type | Description |
|---|---|---|
asset |
string | |
free |
number | 可用余额。 |
locked |
number | 挂单占用,加上提现和转账冻结的资金。与 outboundAccountPosition 推送一致。 |
CryptoAccounts¶
| Name | Type | Description |
|---|---|---|
crypto-accounts |
Array<BalanceApi> |
ErrorBody¶
| Name | Type | Description |
|---|---|---|
code |
integer | |
msg |
string |
KycRemainingDetail¶
| Name | Type | Description |
|---|---|---|
cashInLimit |
number | Decimal amount as a JSON number (`BigDecimal` on the wire). |
cashInRemaining |
number | Decimal amount as a JSON number (`BigDecimal` on the wire). |
cashOutLimit |
number | Decimal amount as a JSON number (`BigDecimal` on the wire). |
cashOutRemaining |
number | Decimal amount as a JSON number (`BigDecimal` on the wire). |
totalWithdrawLimit |
number | Decimal amount as a JSON number (`BigDecimal` on the wire). |
totalWithdrawRemaining |
number | Decimal amount as a JSON number (`BigDecimal` on the wire). |
PageMeta¶
| Name | Type | Description |
|---|---|---|
has_next |
boolean | |
next_page |
integer | |
previous_page |
integer |
TradeFee¶
| Name | Type | Description |
|---|---|---|
makerCommission |
string | |
symbol |
string | |
takerCommission |
string |
TransactionHistory¶
| Name | Type | Description |
|---|---|---|
meta |
PageMeta | |
transactions |
Array<TransactionHistoryItem> |
TransactionHistoryItem¶
| Name | Type | Description |
|---|---|---|
bizSubject |
string | |
changed |
number | Decimal amount as a JSON number (`BigDecimal` on the wire). |
status |
string | |
time |
string | Epoch millis as a string. |
tokenId |
string | |
txId |
string |
Security schemes¶
| Name | Type | Scheme | Description |
|---|---|---|---|
| ApiKeyHmac | apiKey | 需要请求头 `x-ptrader-apikey`,以及 `timestamp` 与 `signature`。签名规则见「鉴权」文档。 | |
| ApiKeyOnly | apiKey | 仅需 API Key 请求头(无需 HMAC)。用于 listenKey 的创建、续期与关闭。 |
Tags¶
| Name | Description |
|---|---|
| Common |