Options

pls help me with buy contracts parameters

edited August 2023 in General

hello,

pls what's the paramters to buy contract using Deriv API?

whats the buy_contract code to buy a contract ?

I used this :

{
"buy": "1",
"price": 1,
"parameters": {
"contract_type": "PUT",
"currency": "USD",
"symbol": "r_50",
"duration": 1,
"duration_unit": "m"
},
"req_id": 7
}

but I got this :

"root":{1 item
"error":{4 items
"echo_req":{4 items
"buy":string"1"
"parameters":{6 items
"app_markup_percentage":string"0"
"contract_type":string"PUT"
"currency":string"USD"
"duration":int1
"duration_unit":string"m"
"symbol":string"r_50"
}
"price":int1
"req_id":int7
}
"error":{2 items
"code":string"ContractCreationFailure"
"message":string"Please specify either payout or stake."
}
"msg_type":string"buy"
"req_id":int7
}
}

now when I added the parameter:
"basis": "stake", or "basis":"payout", to it,I got same response .

pls what's the correct way to do it ?

Comments

Sign In or Register to comment.