nodejs-ebay-api icon indicating copy to clipboard operation
nodejs-ebay-api copied to clipboard

AddFixedPriceItem Call... No <Item.Country> exists?

Open fccardiff opened this issue 9 years ago • 11 comments

Hi, I'm trying to make an AddFixedPriceItemCall. I'm using the ebayApiPostXmlRequest method, and my params are seen below:

params: {
            authToken: myAuthTokenIsHere,
            Item: {
                Country: 'US',
                Currency: 'USD',
                Description: description,
                ListingType: 'FixedPriceItem',
                PictureDetails: picturesArray,
                Quantity: '5',
                StartPrice: price
            },
}

I have auth tokens, etc. and all application tokens, I've simply omitted that code from here. Unfortunately, it's giving errors that the country doesn't exist, although it's obviously shown in my Item{} object. Is this a bug, or am I doing something wrong?

Thank you!

fccardiff avatar May 28 '15 19:05 fccardiff

Try looking at this page: http://developer.ebay.com/DevZone/finding/Concepts/SiteIDToGlobalID.html

It might be that you need to pass a different ID value.

On Thu, May 28, 2015 at 12:32 PM, fccardiff [email protected] wrote:

Hi, I'm trying to make an AddFixedPriceItemCall and my params are seen below: params: { Item: { Country: 'US', Currency: 'USD', Description: description, ListingType: 'FixedPriceItem', PictureDetails: picturesArray, Quantity: '5', StartPrice: price }, }

I have auth tokens, etc. and all application tokens, I've simply omitted that code from here. Unfortunately, it's giving errors that the country doesn't exist, although it's obviously shown in my Item{} object. Is this a bug, or am I doing something wrong?

Thank you!

— Reply to this email directly or view it on GitHub https://github.com/benbuckman/nodejs-ebay-api/issues/18.

thehuey avatar May 29 '15 00:05 thehuey

Thanks for the help! Unfortunately, I tried with Country: '0', Country: 'US', and Country: 'EBAY-US', and none have worked.

fccardiff avatar May 29 '15 15:05 fccardiff

Here's my full call in NodeJS - maybe I placed it in the wrong area?

var ebay = require('ebay-api');
ebay.ebayApiPostXmlRequest({
    serviceName: 'Trading',
    opType: 'AddFixedPriceItem',
    devName: myDevId,
    cert: myCertId,
    appName: myAppId,
    sandbox: true,
    title: title,
    params: {
        'authToken': myClientAuthToken,
        version: EBAY_API_VERSION,
        Item: {
            Country: 'EBAY-US', 
            Currency: 'USD',
            Description: description,
            ListingType: 'FixedPriceItem',
            PictureDetails: picturesArray,
            Quantity: '5',
            StartPrice: price
        },
    }
}, function (error, results) {
    if (error) {
        console.dir(error);
        process.exit(1);
    }
    console.dir(results);
});

fccardiff avatar May 29 '15 15:05 fccardiff

Your header might not have the right entries.

X-EBAY-SOA-GLOBAL-ID is passed as part of the auth. I'll look at this code later this evening and see if I can get a working example for you.

On Fri, May 29, 2015 at 8:51 AM, fccardiff [email protected] wrote:

Here's my full call in NodeJS - maybe I placed it in the wrong area? var ebay = require('ebay-api'); ebay.ebayApiPostXmlRequest({ serviceName: 'Trading', opType: 'AddFixedPriceItem', devName: myDevId, cert: myCertId, appName: myAppId, sandbox: true, title: title, params: { 'authToken': myClientAuthToken, version: EBAY_API_VERSION, // TODO No Item.Currency, Item.Country exists, etc. Should be a quick fix Item: { Country: 'EBAY-US', Currency: 'USD', Description: description, ListingType: 'FixedPriceItem', PictureDetails: picturesArray, Quantity: '5', StartPrice: price }, } }, function (error, results) { if (error) { console.dir(error); process.exit(1); } console.dir(results); });

— Reply to this email directly or view it on GitHub https://github.com/benbuckman/nodejs-ebay-api/issues/18#issuecomment-106854549 .

thehuey avatar May 30 '15 01:05 thehuey

OK, thanks! It would really help if I could get this working :)

fccardiff avatar May 30 '15 17:05 fccardiff

Looking thru my code, I think you'll need a GlobalID = 'EBAY-US' as part of your request. I haven't used AddFixedPriceItemCall using the node api yet.

On Sat, May 30, 2015 at 10:49 AM, fccardiff [email protected] wrote:

OK, thanks! It would really help if I could get this working :)

— Reply to this email directly or view it on GitHub https://github.com/benbuckman/nodejs-ebay-api/issues/18#issuecomment-107070734 .

thehuey avatar May 30 '15 19:05 thehuey

Hm, unfortunately this is not seeming to fix it, either. I'm thinking that I'm missing something in the Item object, as I've also been getting issues such as No <Item.Currency> exists, No <Item.ListingDuration> exists, etc. Although ListingDuration isn't mentioned in my example above, even if I add it into my Item object, the API is acting as if it's missing. Is there something wrong with my Item object implementation possibly?

fccardiff avatar May 30 '15 19:05 fccardiff

Hm, I still can't manage to do it. Any clue why this wouldn't work?

Thanks!

fccardiff avatar Jun 02 '15 00:06 fccardiff

I haven't had a chance to play with this in detail yet. Busy weekend. I'll try to take another look tonight.

On Mon, Jun 1, 2015 at 5:38 PM, fccardiff [email protected] wrote:

Hm, I still can't manage to do it. Any clue why this wouldn't work?

Thanks!

— Reply to this email directly or view it on GitHub https://github.com/benbuckman/nodejs-ebay-api/issues/18#issuecomment-107753625 .

thehuey avatar Jun 02 '15 01:06 thehuey

No worries, thanks!

On a side note, if this API doesn't end up working, should I just switch to XML?

fccardiff avatar Jun 04 '15 14:06 fccardiff

Did you find a solution to this? I have the same issue using the "AddItem" call.

jimmyfio avatar Aug 24 '18 14:08 jimmyfio