合约变更事件回调
POST
positionCreate,合约创建事件
positionCancel,合约撤销事件
positionSettle,合约履约事件
请求参数
Body 参数application/json
event_type
enum<string>
事件类型
枚举值:
positionCreatepositionCancelpositionSettle
msg_id
string
消息id
payload
object (合约变更事件回调VO)
可选
position_id
string
合约id
parent_position_id
string
父合约id
root_position_id
string
根合约id
c_order_id
string
幂等订单id
buy_currency
string
买入币种
buy_amount
number
买入金额
sell_currency
string
卖出币种
sell_amount
number
卖出金额
price
number | null
成交价
base_currency
string
基础货币
price2
number
成交价2
base_currency2
string
基础货币2
status
string
合约状态
status_desc
string
状态描述
value_date
string
交割日
open_time
integer
开仓时间
pay_way
enum<string> | enum<null>
支付方式
枚举值:
creditbalance
violate_date
integer
违约日期
violate_money
number
违约押金
violate_currency
string
违约币种
trade_channel
string
必需
source_type
string
必需
cancel_way
string
可选
示例
{
"event_type": "positionExtend",
"msg_id": "P24010816531715000058",
"payload": {
"base_currency": "CNH",
"base_currency2": "MXN",
"buy_amount": 3645.95,
"buy_currency": "CNH",
"open_time": 1704440609000,
"pay_way": "balance",
"position_id": "240105SP051608727",
"price": 2.37729,
"price2": 0.420647,
"sell_amount": 8667.49,
"sell_currency": "MXN",
"source_type": "spot",
"status": "settle",
"status_desc": "已履约",
"trade_channel": "api",
"value_date": "2024-01-05"
}
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://sandbox-gateway.pingpongx.com' \
--header 'Content-Type: application/json' \
--data-raw '{
"event_type": "positionExtend",
"msg_id": "P24010816531715000058",
"payload": {
"base_currency": "CNH",
"base_currency2": "MXN",
"buy_amount": 3645.95,
"buy_currency": "CNH",
"open_time": 1704440609000,
"pay_way": "balance",
"position_id": "240105SP051608727",
"price": 2.37729,
"price2": 0.420647,
"sell_amount": 8667.49,
"sell_currency": "MXN",
"source_type": "spot",
"status": "settle",
"status_desc": "已履约",
"trade_channel": "api",
"value_date": "2024-01-05"
}
}'
返回响应
🟢200成功
application/json
Body
string
可选
示例
{
"event_type": "positionExtend",
"msg_id": "P24010816531715000058",
"payload": {
"base_currency": "CNH",
"base_currency2": "MXN",
"buy_amount": 3645.95,
"buy_currency": "CNH",
"open_time": 1704440609000,
"pay_way": "balance",
"position_id": "240105SP051608727",
"price": 2.37729,
"price2": 0.420647,
"sell_amount": 8667.49,
"sell_currency": "MXN",
"source_type": "spot",
"status": "settle",
"status_desc": "已履约",
"trade_channel": "api",
"value_date": "2024-01-05"
}
}
修改于 2024-03-20 02:11:38