@@ -452,7 +452,7 @@ async def place_buy_order(
452452 price : int ,
453453 quantity = 1 ,
454454 fetch = False ,
455- confirmation_id : int | None = None ,
455+ confirmation : int = 0 ,
456456 payload : T_PAYLOAD = {},
457457 headers : T_HEADERS = {},
458458 _item_descriptions_map : T_SHARED_DESCRIPTIONS = None ,
@@ -465,7 +465,7 @@ async def place_buy_order(
465465 :param price: price of single item
466466 :param quantity: just quantity
467467 :param fetch: make request and return buy order
468- :param confirmation_id : id of market purchase confirmation
468+ :param confirmation : id of market purchase confirmation
469469 :param payload: extra payload data
470470 :param headers: extra headers to send with request
471471 :return: buy order id or `BuyOrder`
@@ -485,24 +485,28 @@ async def place_buy_order(
485485 "market_hash_name" : name ,
486486 "price_total" : price * quantity ,
487487 "quantity" : quantity ,
488+ "confirmation" : confirmation ,
488489 ** payload ,
489490 }
490- if confirmation_id is not None :
491- data ["confirmation_id" ] = confirmation_id
492491
493492 headers = {"Referer" : str (STEAM_URL .MARKET / f"listings/{ app .value } /{ name } " ), ** headers }
494- r = await self .session .post (STEAM_URL .MARKET / "createbuyorder/" , data = data , headers = headers )
493+ r = await self .session .post (
494+ STEAM_URL .MARKET / "createbuyorder/" ,
495+ data = data ,
496+ headers = headers ,
497+ raise_for_status = False ,
498+ )
495499 rj : dict = await r .json ()
496500 if rj .get ("need_confirmation" ):
497- confirmation_id = int (rj ["confirmation" ]["confirmation_id" ])
498- await self .confirm_market_purchase (confirmation_id )
501+ confirmation = int (rj ["confirmation" ]["confirmation_id" ])
502+ await self .confirm_market_purchase (confirmation )
499503 return await self .place_buy_order (
500504 obj ,
501505 app ,
502506 price = price ,
503507 quantity = quantity ,
504508 fetch = fetch ,
505- confirmation_id = confirmation_id ,
509+ confirmation = confirmation ,
506510 payload = payload ,
507511 headers = headers ,
508512 )
0 commit comments