合约展期事件回调
POST
positionExtend,合约更改履约日期事件
请求参数
Body 参数application/json
event_type
enum<string>
事件类型
枚举值:
positionCreatepositionCancelpositionExtendpositionSettle
msg_id
string
消息id
payload
object
可选
oldPosition
object (合约变更事件回调VO)
必需
leftPosition
object (合约变更事件回调VO)
可选
newPosition
object (合约变更事件回调VO)
必需
示例
{
"event_type": "positionExtend",
"msg_id": "P24010816531715000058",
"payload": {
"leftPosition": {
"base_currency": "USD",
"base_currency2": "CNH",
"buy_amount": 3550.11,
"buy_currency": "CNH",
"c_order_id": "202403261705FW00003",
"open_time": 1711454778000,
"parent_position_id": "240326FW272838750",
"pay_way": "balance",
"position_id": "240326FW162799862",
"price": 7.20249,
"price2": 0.138841,
"root_position_id": "240326FW308504201",
"sell_amount": 492.9,
"sell_currency": "USD",
"source_type": "lock",
"status": "waitSettle",
"status_desc": "待履约",
"trade_channel": "api",
"value_date": "2024-03-27"
},
"newPosition": {
"base_currency": "USD",
"base_currency2": "CNH",
"buy_amount": 2172.32,
"buy_currency": "CNH",
"c_order_id": "202403261705FW00003-6",
"open_time": 1711454778000,
"parent_position_id": "240326FW272838750",
"pay_way": "balance",
"position_id": "240326FW481691497",
"price": 7.20266,
"price2": 0.138838,
"root_position_id": "240326FW308504201",
"sell_amount": 301.6,
"sell_currency": "USD",
"source_type": "lock",
"status": "waitSettle",
"status_desc": "待履约",
"trade_channel": "api",
"value_date": "2024-03-28"
},
"oldPosition": {
"base_currency": "USD",
"base_currency2": "CNH",
"buy_amount": 5722.38,
"buy_currency": "CNH",
"open_time": 1711446996000,
"parent_position_id": "240326FW733883458",
"pay_way": "balance",
"position_id": "240326FW272838750",
"price": 7.20249,
"price2": 0.138841,
"root_position_id": "240326FW308504201",
"sell_amount": 794.5,
"sell_currency": "USD",
"source_type": "lock",
"status": "extendClose",
"status_desc": "已展期关闭",
"trade_channel": "api",
"value_date": "2024-03-27"
}
}
}
示例代码
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": {
"leftPosition": {
"base_currency": "USD",
"base_currency2": "CNH",
"buy_amount": 3550.11,
"buy_currency": "CNH",
"c_order_id": "202403261705FW00003",
"open_time": 1711454778000,
"parent_position_id": "240326FW272838750",
"pay_way": "balance",
"position_id": "240326FW162799862",
"price": 7.20249,
"price2": 0.138841,
"root_position_id": "240326FW308504201",
"sell_amount": 492.9,
"sell_currency": "USD",
"source_type": "lock",
"status": "waitSettle",
"status_desc": "待履约",
"trade_channel": "api",
"value_date": "2024-03-27"
},
"newPosition": {
"base_currency": "USD",
"base_currency2": "CNH",
"buy_amount": 2172.32,
"buy_currency": "CNH",
"c_order_id": "202403261705FW00003-6",
"open_time": 1711454778000,
"parent_position_id": "240326FW272838750",
"pay_way": "balance",
"position_id": "240326FW481691497",
"price": 7.20266,
"price2": 0.138838,
"root_position_id": "240326FW308504201",
"sell_amount": 301.6,
"sell_currency": "USD",
"source_type": "lock",
"status": "waitSettle",
"status_desc": "待履约",
"trade_channel": "api",
"value_date": "2024-03-28"
},
"oldPosition": {
"base_currency": "USD",
"base_currency2": "CNH",
"buy_amount": 5722.38,
"buy_currency": "CNH",
"open_time": 1711446996000,
"parent_position_id": "240326FW733883458",
"pay_way": "balance",
"position_id": "240326FW272838750",
"price": 7.20249,
"price2": 0.138841,
"root_position_id": "240326FW308504201",
"sell_amount": 794.5,
"sell_currency": "USD",
"source_type": "lock",
"status": "extendClose",
"status_desc": "已展期关闭",
"trade_channel": "api",
"value_date": "2024-03-27"
}
}
}'
返回响应
🟢200成功
application/json
Body
string
可选
示例
{
"event_type": "positionExtend",
"msg_id": "P24010816531715000058",
"payload": {
"leftPosition": {
"base_currency": "USD",
"base_currency2": "CNH",
"buy_amount": 3550.11,
"buy_currency": "CNH",
"c_order_id": "202403261705FW00003",
"open_time": 1711454778000,
"parent_position_id": "240326FW272838750",
"pay_way": "balance",
"position_id": "240326FW162799862",
"price": 7.20249,
"price2": 0.138841,
"root_position_id": "240326FW308504201",
"sell_amount": 492.9,
"sell_currency": "USD",
"source_type": "lock",
"status": "waitSettle",
"status_desc": "待履约",
"trade_channel": "api",
"value_date": "2024-03-27"
},
"newPosition": {
"base_currency": "USD",
"base_currency2": "CNH",
"buy_amount": 2172.32,
"buy_currency": "CNH",
"c_order_id": "202403261705FW00003-6",
"open_time": 1711454778000,
"parent_position_id": "240326FW272838750",
"pay_way": "balance",
"position_id": "240326FW481691497",
"price": 7.20266,
"price2": 0.138838,
"root_position_id": "240326FW308504201",
"sell_amount": 301.6,
"sell_currency": "USD",
"source_type": "lock",
"status": "waitSettle",
"status_desc": "待履约",
"trade_channel": "api",
"value_date": "2024-03-28"
},
"oldPosition": {
"base_currency": "USD",
"base_currency2": "CNH",
"buy_amount": 5722.38,
"buy_currency": "CNH",
"open_time": 1711446996000,
"parent_position_id": "240326FW733883458",
"pay_way": "balance",
"position_id": "240326FW272838750",
"price": 7.20249,
"price2": 0.138841,
"root_position_id": "240326FW308504201",
"sell_amount": 794.5,
"sell_currency": "USD",
"source_type": "lock",
"status": "extendClose",
"status_desc": "已展期关闭",
"trade_channel": "api",
"value_date": "2024-03-27"
}
}
}
修改于 2024-04-16 06:27:00