SellBack - Saba-sports/OddsDirectAPI_CN GitHub Wiki

该API用于来兑现注单。

Request

POST  /cashout/{version}/SellBack?transId=123456&cashoutPrice=10
Accept: application/json
X-Forwarded-For: client ip (如果通过代理使用API需要额外带入)
Authorization: Bearer {JWT token}
Parameter Format Mandatory Description
transId long Yes 注单号码
cashoutPrice decimal Yes 实时兑现价格,从 /GetCashoutPrice 获取

Response

{    
    "transId": long,
    "sellingStatus":  int,
    "soldStake": decimal,
    "paid":decimal,
    "newCashoutPriceInfo":PriceInfo
} 
Parameter Format Description
transId long 注单号码
sellingStatus int 兑现票据的状态1:Waiting2:Accept3:Reject5:New Offer
soldStake decimal 兑现的注额
paid decimal 兑现的金额
newCashoutPriceInfo PriceInfo 当 sellingStatus 为 5 (NewOffer) 时,提供新的兑现资讯

PriceInfo

{
    "transId": long,
    "cashoutStatus": int,
    "cashoutStake": decimal,
    "cashoutPrice": decimal
}
Parameter Format Description
transId long 注单号码
cashoutStatus int 兑现状态1:CanCashout2:CannotCashout (目前不支持兑现)3:NoCashoutTicket (这张注单不能兑现)4:TicketNotFound
cashoutStake decimal 兑现的注额
cashoutPrice decimal 兑现的价格

ErrorCode Enumeration

Error Code Message Description
E001 Internal Server Error 服务器发生非预期错误
E002 Invalid parameter input 参数输入无效或不支援
B019 Transaction Id Not Found 找不到对应注单编号
B025 Cannot Cashout 这张注单不能兑现