Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Switching country code per request #19

Open
taitems opened this issue Sep 22, 2015 · 2 comments
Open

Switching country code per request #19

taitems opened this issue Sep 22, 2015 · 2 comments

Comments

@taitems
Copy link

taitems commented Sep 22, 2015

I'm a wee bit stuck and getting a bit tired of trying this and that, so I thought I'd ask the community.

If I'm building something that would change the country being searched per request, can I do something like the following?

  var filters = {};

  filters.ItemFilter = [
    new ebay.ItemFilter("ListingType", "FixedPrice"),
    new ebay.ItemFilter("AvailableTo", "AU")
  ];

  var reqOptions = {};

  reqOptions["X-EBAY-SOA-GLOBAL-ID"] = "EBAY-AU";

  ebay.ebayApiGetRequest({
      serviceName: 'FindingService',
      opType: 'findItemsByProduct',
      appId: credentials.prod.ebay.appId,
      params: params,
      filters: filters,
      reqOptions: reqOptions,
      parser: ebay.parseItemsFromResponse
    },
    // gets all the items together in a merged array
    function itemsCallback(error, items) {
      // handle it
    }
  );
@thar0x29a
Copy link

dont know if you still need to know: options.globalId is what you're looking for

@kiskinvlad
Copy link

kiskinvlad commented Jan 30, 2017

My solution:

var globalId = 'EBAY-PL';
ebay.xmlRequest({
    serviceName: 'Finding',
        opType: 'findItemsAdvanced',
            appId: '.........',      // FILL IN YOUR OWN APP KEY, GET ONE HERE:
            params: params,
            globalId: globalId,
            parser: ebay.parseResponseJson    // (default)
        },```

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants