Basic bittrex api question I read the api documentation but I could not find anythin related to market buy and sell commands. Where do I find this information?

Moreover, I read the following from the api site

https://bittrex.com/api/v1.1/market/selllimit?apikey=API_KEY&amp;market=BTC-LTC&amp;quantity=1.2&amp;rate=1.3  

My understand of this statement is that I use my 1.2 Bitcoin to buy 1.3X1.2 Litecoin. Is this correct?

If I want to use my Litecoin to buy Bitcoin, do I need to change the market from BTC-LTC to LTC-BTC??
My understand of this statement is that I use my 1.2 Bitcoin to buy
  1.3X1.2 Litecoin. Is this correct?


The quantity parameter refers to how many of the coin you want to buy, and the rate parameter as to the limit price you want to buy/sell those coins at.  

Example, buy 100 dogecoin at 0.00000400 BTC each.

https://bittrex.com/api/v1.1/market/buylimit?apikey=api_key&amp;market=BTC-DOGE&amp;quantity=100&amp;rate=0.000004&amp;nonce=nonce



  If I want to use my Litecoin to buy Bitcoin, do I need to change the
  market from BTC-LTC to LTC-BTC??


No, the market stays the same, just change part of the URI from /buylimit? to /selllimit? or vice-versa. Selling your litecoin for bitcion is the same as buying bitcoin with litecoin. 

You can make it act like a market order by checking the current bid/ask and making your rate equal to the side your trading. For example if you want to market buy you can query the best ask price and then make that the rate.

function fetchPairPrice($pair){
    $pair = strtoupper($pair);
    $uri = "https://bittrex.com/api/v1.1/public/getticker?market=BTC-".$pair;
    $ch = curl_init($uri);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $execResult = curl_exec($ch);
    $obj = json_decode($execResult, true);
    return $obj;
}


function bittrexbuy($apikey, $apisecret, $symbol, $quant, $rate){
    $nonce=time();
    $uri='https://bittrex.com/api/v1.1/market/buylimit?apikey='.$apikey.'&amp;market=BTC-'.$symbol.'&amp;quantity='.$quant.'&amp;rate='.$rate.'&amp;nonce='.$nonce;
    $sign=hash_hmac('sha512',$uri,$apisecret);
    $ch = curl_init($uri);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign:'.$sign));
    $execResult = curl_exec($ch);
    $obj = json_decode($execResult, true);
    return $obj;
}

    $symbolRate = fetchPairPrice("DOGE");
    $fetchPrice = $symbolRate["result"]["Ask"];
    $amountToBuy = 100;
    bittrexbuy($apikey, $apisecret, $symbol, $amountToBuy, $fetchPrice);

    //response
    //{"success":true,"message":"","result":{"uuid":"b5f891ab-a7b4-44aa-9488-94986d1d9551"}}