API changes: removing number_of_contracts field
Dear developers,
We are going to remove the number_of_contracts (numeric type) field, which is being returned from our Price Proposal and Price Proposal: Open Contracts API calls for Vanilla contracts. We already have added another field named: dispaly_number_of_contracts (string type) to these API calls as a replacement. This will be released in the week starting July 10.
API response for Price Proposal before the change:
{ "echo_req": { "amount": 100, "barrier": "-27.30", "basis": "stake", "contract_type": "VANILLALONGPUT", "currency": "USD", "duration": 3, "duration_unit": "m", "product_type": "basic", "proposal": 1, "symbol": "R_100" }, "msg_type": "proposal", "proposal": { "ask_price": 100, "barrier_choices": [ "-27.30", "-11.20", "+0.00", "+11.20", "+27.50" ], "contract_details": { "barrier": "8958.35" }, "date_expiry": 1688281722, "date_start": 1688281542, "display_number_of_contracts": "90.38734", "display_value": "100.00", "id": "c2b61fad-f8fb-4b2a-358e-6a31e3ccb1c9", "longcode": "For a 'Put' contract, you receive a payout on 2-Jul-23 07:08:42GMT if the final price of Volatility 100 Index is below entry spot minus 27.30. The payout is equal to 90.38734 multiplied by the difference between the final price and entry spot minus 27.30. You may choose to sell the contract up until 60 seconds before 2-Jul-23 07:08:42GMT, and receive a contract value. ", "max_stake": 2000, "min_stake": 0.4, "number_of_contracts": 90.38734, "payout": 0, "spot": 8985.65, "spot_time": 1688281540 } }
API response for Price Proposal after the change:
{ "echo_req": { "amount": 100, "barrier": "-27.30", "basis": "stake", "contract_type": "VANILLALONGPUT", "currency": "USD", "duration": 3, "duration_unit": "m", "product_type": "basic", "proposal": 1, "symbol": "R_100" }, "msg_type": "proposal", "proposal": { "ask_price": 100, "barrier_choices": [ "-27.30", "-11.20", "+0.00", "+11.20", "+27.50" ], "contract_details": { "barrier": "8958.35" }, "date_expiry": 1688281722, "date_start": 1688281542, "display_number_of_contracts": "90.38734", "display_value": "100.00", "id": "c2b61fad-f8fb-4b2a-358e-6a31e3ccb1c9", "longcode": "For a 'Put' contract, you receive a payout on 2-Jul-23 07:08:42GMT if the final price of Volatility 100 Index is below entry spot minus 27.30. The payout is equal to 90.38734 multiplied by the difference between the final price and entry spot minus 27.30. You may choose to sell the contract up until 60 seconds before 2-Jul-23 07:08:42GMT, and receive a contract value. ", "max_stake": 2000, "min_stake": 0.4, "payout": 0, "spot": 8985.65, "spot_time": 1688281540 } }
API response for Price Proposal: Open Contracts before the change:
{ "echo_req": { "contract_id": 299, "proposal_open_contract": 1 }, "msg_type": "proposal_open_contract", "proposal_open_contract": { "account_id": 228, "barrier": "8985.91", "barrier_count": 1, "bid_price": 119.33, "buy_price": 100, "contract_id": 299, "contract_type": "VANILLALONGPUT", "currency": "USD", "current_spot": 9007.6, "current_spot_display_value": "9007.60", "current_spot_time": 1688282050, "date_expiry": 1688282210, "date_settlement": 1688282210, "date_start": 1688282030, "display_name": "Volatility 100 Index", "display_number_of_contracts": "89.39390", "entry_spot": 9013.21, "entry_spot_display_value": "9013.21", "entry_tick": 9013.21, "entry_tick_display_value": "9013.21", "entry_tick_time": 1688282030, "expiry_time": 1688282210, "is_expired": 0, "is_forward_starting": 0, "is_intraday": 1, "is_path_dependent": 0, "is_settleable": 0, "is_sold": 0, "is_valid_to_cancel": 0, "is_valid_to_sell": 1, "longcode": "For a 'Put' contract, you receive a payout on 2-Jul-23 07:16:50GMT if the final price of Volatility 100 Index is below entry spot minus 27.30. The payout is equal to 89.39390 multiplied by the difference between the final price and entry spot minus 27.30. You may choose to sell the contract up until 60 seconds before 2-Jul-23 07:16:50GMT, and receive a contract value. ", ** "number_of_contracts": 89.3939,** "profit": 19.33, "profit_percentage": 19.33, "purchase_time": 1688282030, "shortcode": "VANILLALONGPUT_R_100_100.00_1688282030_1688282210_S-2730P_89.39390_1688282030", "status": "open", "transaction_ids": { "buy": 619 }, "underlying": "R_100" } }
API response for Price Proposal: Open Contracts after the change:
{ "echo_req": { "contract_id": 299, "proposal_open_contract": 1 }, "msg_type": "proposal_open_contract", "proposal_open_contract": { "account_id": 228, "barrier": "8985.91", "barrier_count": 1, "bid_price": 119.33, "buy_price": 100, "contract_id": 299, "contract_type": "VANILLALONGPUT", "currency": "USD", "current_spot": 9007.6, "current_spot_display_value": "9007.60", "current_spot_time": 1688282050, "date_expiry": 1688282210, "date_settlement": 1688282210, "date_start": 1688282030, "display_name": "Volatility 100 Index", "display_number_of_contracts": "89.39390", "entry_spot": 9013.21, "entry_spot_display_value": "9013.21", "entry_tick": 9013.21, "entry_tick_display_value": "9013.21", "entry_tick_time": 1688282030, "expiry_time": 1688282210, "is_expired": 0, "is_forward_starting": 0, "is_intraday": 1, "is_path_dependent": 0, "is_settleable": 0, "is_sold": 0, "is_valid_to_cancel": 0, "is_valid_to_sell": 1, "longcode": "For a 'Put' contract, you receive a payout on 2-Jul-23 07:16:50GMT if the final price of Volatility 100 Index is below entry spot minus 27.30. The payout is equal to 89.39390 multiplied by the difference between the final price and entry spot minus 27.30. You may choose to sell the contract up until 60 seconds before 2-Jul-23 07:16:50GMT, and receive a contract value. ", "profit": 19.33, "profit_percentage": 19.33, "purchase_time": 1688282030, "shortcode": "VANILLALONGPUT_R_100_100.00_1688282030_1688282210_S-2730P_89.39390_1688282030", "status": "open", "transaction_ids": { "buy": 619 }, "underlying": "R_100" } }
The only change in the API response for the two API calls is the removal of the number_of_contracts field in the response.
Please make the necessary changes to your app(s).
If you have any questions, write to us at api-support@deriv.com.