Buy Contract without proposal

edited April 2016 in General

I'm trying to buy a contract without calling proposal first to avoid additional call.

Here's my request:

{
  "buy": "1",
  "price": 0,
  "parameters": {
    "amount": "1",
    "basis": "stake",
    "contract_type": "PUT",
    "currency": "USD",
    "date_expiry": "1461110100",
    "symbol": "frxEURUSD"
  }
}

And here's what I get:

{
  "echo_req": {
    "parameters": {
      "currency": "USD",
      "symbol": "frxEURUSD",
      "amount": "1",
      "basis": "stake",
      "date_expiry": "1461110100",
      "contract_type": "PUT"
    },
    "req_id": 2,
    "price": 0,
    "buy": "1",
    "error": {
      "details": {
        "buy": "does not match the regex pattern ^[\\w-]{32,128}$"
      },
      "message": "Input validation failed: buy, The property parameters is not defined in the schema and the schema does not allow additional properties",
      "code": "InputValidationFailed"
    },
    "msg_type": "buy"
  }
}

From API playground:

buy string /^(?:[\w-]{32,128}|1)$/

The id received from a Price Proposal call or 1 if contract buy parameters are passed in parameters field

What am I doing wrong?
I don't care about price movements between proposal and buying contract, always the maket.

Error messages suggests that "buy" format is not as stated in API playground as it doesn't allow "1".

Any help?

Comments

  • @lukaszkn this has been fixed, you can pass 1 now as buy value

    I was able to successfully purchase

    Request

    {
      "parameters": {
        "currency": "USD",
        "symbol": "R_50",
        "amount": "1",
        "basis": "stake",
        "date_expiry": "1461130680",
        "contract_type": "PUT"
      },
      "req_id": 2,
      "price": 1,
      "buy": "1"
    }
    

    Response

    {
      "echo_req": {
        "parameters": {
          "currency": "USD",
          "amount": "1",
          "symbol": "R_50",
          "basis": "stake",
          "contract_type": "PUT",
          "date_expiry": "1461130680"
        },
        "req_id": 2,
        "price": 1,
        "buy": "1"
      },
      "req_id": 2,
      "buy": {
        "balance_after": "9999.0000",
        "shortcode": "PUT_R_50_1.94_1461130620_1461130680F_S0P_0",
        "contract_id": "19",
        "start_time": 1461130620,
        "longcode": "USD 1.94 payout if Random 50 Index is strictly lower than entry spot at 2016-04-20 05:38:00.",
        "transaction_id": "419",
        "purchase_time": 1461130620,
        "buy_price": 1,
        "payout": 1.94
      },
      "msg_type": "buy"
    }
    

    Please note that you can not pass price as 0 as you need to specify price at which you want to buy

  • edited April 2016

    I have the same problem.

    I tried:

    {
      "parameters": {
        "currency": "USD",
        "symbol": "R_50",
        "amount": "1",
        "basis": "stake",
        "date_expiry": "1461130680",
        "contract_type": "PUT"
      },
      "req_id": 2,
      "price": 1,
      "buy": "1"
    }
    

    and got:

    {
      "echo_req": {
        "parameters": {
          "currency": "USD",
          "amount": "1",
          "symbol": "R_50",
          "basis": "stake",
          "contract_type": "PUT",
          "date_expiry": "1461130680"
        },
        "req_id": 2,
        "price": 1,
        "buy": "1"
      },
      "req_id": 2,
      "error": {
        "details": {
          "buy": "does not match the regex pattern ^[\w-]{32,128}$"
        },
        "message": "Input validation failed: buy, The property parameters is not defined in the schema and the schema does not allow additional properties",
        "code": "InputValidationFailed"
      },
      "msg_type": "buy"
    }
    

    Please Help!!!!

  • A fix has been released to our testing environment, it will go live on Monday.

Sign In or Register to comment.