In the documentation https://api.backpack.tf/api/index.html#/classifieds/post_v2_classifieds_listings_batch,
Models > listingResolvable specifies that if id is set, listing is assumed to be sell and if item is set, it is assumed to be a buy:
The code currently sets item for both intents (and specify id only when selling), and may lead to conflicts in resolving the item if both inputs are sent.
def construct_listing(
sku: str, intent: str, currencies: dict, details: str, asset_id: int = 0
) -> dict:
if intent not in ["buy", "sell"]:
raise InvalidIntent(f"{intent} must be buy or sell")
listing = {
"item": construct_listing_item(sku),
"buyout": True,
"offers": True,
"promoted": False,
"details": details,
"currencies": Currencies(**currencies).__dict__,
}
if intent == "sell":
listing["id"] = asset_id
return listing
I think we may need to consider setting listing["item"] only for buy listings. While it only happens for Strange items, I also do not consistently face it and has succeeded few times. Strange indeed
In the documentation https://api.backpack.tf/api/index.html#/classifieds/post_v2_classifieds_listings_batch,
Models > listingResolvable specifies that if
idis set, listing is assumed to be sell and ifitemis set, it is assumed to be a buy:The code currently sets
itemfor both intents (and specifyidonly when selling), and may lead to conflicts in resolving the item if both inputs are sent.I think we may need to consider setting listing["item"] only for buy listings. While it only happens for Strange items, I also do not consistently face it and has succeeded few times. Strange indeed