BTCTrader / broker-api-docs

The documentation for BTCTrader's white label exchange platform API. Use this documentation to access the APIs of BTCTurk other BTCTrader partners.
110 stars 32 forks source link

Alış Satış emirlerinde hatalar alıyorum #578

Open enennnn13 opened 3 months ago

enennnn13 commented 3 months ago

Merhabalar, şöyleki bu koddan def place_order(order_type, pair_symbol, quantity, price=None): endpoint = "/v1/order" order_data = { 'pairSymbol': pair_symbol, 'quantity': quantity, 'price': price, 'orderType': order_type } headers = get_headers() response = requests.post("https://api.btcturk.com/" + endpoint, headers=headers, data=json.dumps(order_data))

if response.status_code == 200:
    response_data = get_response_json(response)
    if response_data is None:
        print(f"{order_type.capitalize()} emri sırasında JSON decode hatası: {response.text}")
        return None
    return response_data
else:
    print(f"API isteği başarısız oldu: {order_type.capitalize()} emri, Status Code: {response.status_code}")
    return None

def place_sell_order(pair_symbol, quantity, price=None): endpoint = "/v1/order" order_data = { 'pairSymbol': pair_symbol, 'quantity': quantity, 'price': price, 'orderType': 'sell' } headers = get_headers() response = requests.post("https://api.btcturk.com/" + endpoint, headers=headers, data=json.dumps(order_data)) bu hatayı alıyorum: API isteği başarısız oldu: Satış emri, Status Code: 404 ENJUSDT için satış emri verildi: None hesabımda yeteri kadar enjcoin bulunmasına rağmen.

catnug commented 3 months ago

merhaba,

orderMethod eksik body icinde. kolay gelsin,