跳转至

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 毫秒)。

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

{
    "code": -1003,
    "msg": "Too many requests; current request has 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 请求头。

Responses

Success

Response fields

Array of TradeFee:

Name Type Description
makerCommission string
symbol string
takerCommission string

rate_limited

{
    "code": -1003,
    "msg": "Too many requests; current request has 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 请求头。

Responses

Success

Response fields

Name Type Description
meta PageMeta
transactions Array<TransactionHistoryItem>

missing_parameter

{
    "code": -1010,
    "msg": "Missing required parameter 'tokenId'"
}

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

{
    "code": -1003,
    "msg": "Too many requests; current request has 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 毫秒)。

Responses

Success

Response fields

Name Type Description
crypto-accounts Array<BalanceApi>

rate_limited

{
    "code": -1003,
    "msg": "Too many requests; current request has 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