@Override
  public String placeLimitOrder(LimitOrder limitOrder) throws IOException {

    String pair;

    if (limitOrder.getCurrencyPair().equals(CurrencyPair.BTC_BRL)) {
      pair = "btc_brl";
    } else if (limitOrder.getCurrencyPair().equals(new CurrencyPair(Currency.LTC, Currency.BRL))) {
      pair = "ltc_brl";
    } else {
      throw new NotAvailableFromExchangeException();
    }

    String type;

    if (limitOrder.getType() == Order.OrderType.BID) {
      type = "buy";
    } else {
      type = "sell";
    }

    MercadoBitcoinBaseTradeApiResult<MercadoBitcoinPlaceLimitOrderResult> newOrderResult =
        mercadoBitcoinPlaceLimitOrder(
            pair, type, limitOrder.getOriginalAmount(), limitOrder.getLimitPrice());

    return MercadoBitcoinUtils.makeMercadoBitcoinOrderId(
        limitOrder.getCurrencyPair(), newOrderResult.getTheReturn().keySet().iterator().next());
  }
@ Override public String placeLimitOrder ( LimitOrder limitOrder ) throws IOException { String pair ; if ( limitOrder . getCurrencyPair ( ) . equals ( CurrencyPair . BTC_BRL ) ) { pair = "btc_brl" ; } else if ( limitOrder . getCurrencyPair ( ) . equals ( new CurrencyPair ( Currency . LTC , Currency . BRL ) ) ) { pair = "ltc_brl" ; } else { throw new NotAvailableFromExchangeException ( ) ; } String type ; if ( limitOrder . getType ( ) == Order . OrderType . BID ) { type = "buy" ; } else { type = "sell" ; } MercadoBitcoinBaseTradeApiResult < MercadoBitcoinPlaceLimitOrderResult > newOrderResult = mercadoBitcoinPlaceLimitOrder ( pair , type , limitOrder . getOriginalAmount ( ) , limitOrder . getLimitPrice ( ) ) ; return MercadoBitcoinUtils . makeMercadoBitcoinOrderId ( limitOrder . getCurrencyPair ( ) , newOrderResult . getTheReturn ( ) . keySet ( ) . iterator ( ) . next ( ) ) ; }
The result is not the pure order id. It is a composition with the currency pair and the order
id (the same format used as parameter of {@link #cancelOrder}). Please see {@link
org.knowm.xchange.mercadobitcoin.MercadoBitcoinUtils#makeMercadoBitcoinOrderId} .