Jump to content

Create listings API cannot create a buy order for fabricators


Not_a_good_sniper

Recommended Posts

Hello again, everyone. Decided to mess around again with some coding a little bit deeper. But there is one issue I encountered with and can't find a solution for it.

 

The problem is whenever I send a request to create a buy order for a fabricator (turns out to be kits are also an issue), server responses with Item is invalid. Here I quickly made a script for testing:

const axios = require('axios');
const api = 'https://backpack.tf/api/classifieds/list/v1';
const userToken = 'token';

axios({
    url: api,
    method: 'POST',
    params: {
        token: userToken
    },
    data: {
        listings: [{
            intent: 0,
            item: {
                quality: 'Unique',
                item_name: "Specialized Killstreak Rocket Launcher Kit"
            },
            offers: 1,
            buyout: 1,
            details: 'I want to buy this crap',
            currencies: { keys: 0, metal: 0.05 }
        }]
    }
}).then(({data}) => {
    for (const i in data.listings){
        const listing = data.listings[i];
        if (listing.error){
            console.log('Failed to create a listing:', listing.error);
        } else {
            console.log('Success');
        }
    }
}).catch((err) => {
    console.log('Request error:', err);
});

// Output: Failed to create a listing: Item is invalid.

 

This should work, and in fact, it works, as long as you change item_name to something else. For example I changed it to Specialized Killstreak Rocket Launcher. See? (Output is also Success)

image.png.4beab19d9b0d9bf85338c2f6c6d03d95.png

 

Is there anything that I am doing wrong? The only solution that I have come up with is using defindexes, but I really, really want to touch that.

 

Edit: I found out that you can create buy orders for *empty* fabs and kits if you for example type Specialized Killstreak Kit

image.png.30d25bcd13b6f9e7266b8f868d1fe7b4.png

But I have no clue what to do with it. I guess you need to set an item attribute or something, just like with paints and spells and stuff, and I have no idea what should I do next.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...