-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from bhushankumarl/development
Development
- Loading branch information
Showing
33 changed files
with
691 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; | ||
var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; | ||
|
||
var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); | ||
|
||
var utils = require('../../../javaScript/utils'); | ||
|
||
var catalogRequest = async function () { | ||
var userToken = utils.USER_TOKEN; | ||
eBay.setUserToken(userToken); | ||
|
||
var data = { | ||
// Leaf Category Name | ||
q: 'Video Cables', | ||
// Leaf Category Id | ||
category_ids: '67859' | ||
}; | ||
try { | ||
var response = await eBay.catalog.search(data); | ||
console.log('response', response); | ||
} catch (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
}; | ||
|
||
catalogRequest(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
examples/javaScript/sell/location/createInventoryLocation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
'use strict'; | ||
|
||
var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; | ||
var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; | ||
|
||
var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); | ||
var utils = require('../../../javaScript/utils'); | ||
|
||
var offerRequest = async function () { | ||
var userToken = utils.USER_TOKEN; | ||
eBay.setUserToken(userToken); | ||
|
||
var data = { | ||
'location': { | ||
'address': { | ||
'addressLine1': '2055 Hamilton Ave', | ||
'addressLine2': 'Building 3', | ||
'city': 'San Jose', | ||
'stateOrProvince': 'CA', | ||
'postalCode': '95125', | ||
'country': 'US' | ||
} | ||
}, | ||
'locationInstructions': 'Open for drop-off only.', | ||
'name': 'Warehouse-1', | ||
'merchantLocationStatus': 'ENABLED', | ||
'locationTypes': [ | ||
'WAREHOUSE' | ||
], | ||
'operatingHours': [ | ||
{ | ||
'dayOfWeek': 'MONDAY', | ||
'intervals': [ | ||
{ | ||
'open': '09:00:00', | ||
'close': '12:00:00' | ||
}, | ||
{ | ||
'open': '13:00:00', | ||
'close': '18:00:00' | ||
} | ||
] | ||
}, | ||
{ | ||
'dayOfWeek': 'TUESDAY', | ||
'intervals': [ | ||
{ | ||
'open': '09:00:00', | ||
'close': '15:00:00' | ||
} | ||
] | ||
} | ||
], | ||
'specialHours': [ | ||
{ | ||
'date': '2016-10-19T00:09:00.000Z', | ||
'intervals': [ | ||
{ | ||
'open': '09:00:00', | ||
'close': '11:00:00' | ||
} | ||
] | ||
} | ||
] | ||
}; | ||
|
||
var customLocationIdentifier = 'LOC1014'; | ||
try { | ||
var response = await eBay.location.createInventoryLocation(customLocationIdentifier, data); | ||
console.log('response', response); | ||
} catch (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
}; | ||
|
||
offerRequest(); |
23 changes: 23 additions & 0 deletions
23
examples/javaScript/sell/location/deleteInventoryLocation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use strict'; | ||
|
||
var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; | ||
var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; | ||
|
||
var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); | ||
var utils = require('../../../javaScript/utils'); | ||
|
||
var offerRequest = async function () { | ||
var userToken = utils.USER_TOKEN; | ||
eBay.setUserToken(userToken); | ||
|
||
var customLocationIdentifier = 'LOC1014'; | ||
try { | ||
var response = await eBay.location.deleteInventoryLocation(customLocationIdentifier); | ||
console.log('response', response); | ||
} catch (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
}; | ||
|
||
offerRequest(); |
23 changes: 23 additions & 0 deletions
23
examples/javaScript/sell/location/disableInventoryLocation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use strict'; | ||
|
||
var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; | ||
var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; | ||
|
||
var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); | ||
var utils = require('../../../javaScript/utils'); | ||
|
||
var offerRequest = async function () { | ||
var userToken = utils.USER_TOKEN; | ||
eBay.setUserToken(userToken); | ||
|
||
var customLocationIdentifier = 'LOC1014'; | ||
try { | ||
var response = await eBay.location.disableInventoryLocation(customLocationIdentifier); | ||
console.log('response', response); | ||
} catch (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
}; | ||
|
||
offerRequest(); |
23 changes: 23 additions & 0 deletions
23
examples/javaScript/sell/location/enableInventoryLocation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use strict'; | ||
|
||
var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; | ||
var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; | ||
|
||
var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); | ||
var utils = require('../../../javaScript/utils'); | ||
|
||
var offerRequest = async function () { | ||
var userToken = utils.USER_TOKEN; | ||
eBay.setUserToken(userToken); | ||
|
||
var customLocationIdentifier = 'LOC1014'; | ||
try { | ||
var response = await eBay.location.enableInventoryLocation(customLocationIdentifier); | ||
console.log('response', response); | ||
} catch (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
}; | ||
|
||
offerRequest(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use strict'; | ||
|
||
var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; | ||
var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; | ||
|
||
var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); | ||
var utils = require('../../../javaScript/utils'); | ||
|
||
var offerRequest = async function () { | ||
var userToken = utils.USER_TOKEN; | ||
eBay.setUserToken(userToken); | ||
|
||
var customLocationIdentifier = 'LOC1014'; | ||
try { | ||
var response = await eBay.location.getInventoryLocation(customLocationIdentifier); | ||
console.log('response', response); | ||
} catch (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
}; | ||
|
||
offerRequest(); |
26 changes: 26 additions & 0 deletions
26
examples/javaScript/sell/location/getInventoryLocations.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
|
||
var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; | ||
var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; | ||
|
||
var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); | ||
var utils = require('../../../javaScript/utils'); | ||
|
||
var offerRequest = async function () { | ||
var userToken = utils.USER_TOKEN; | ||
eBay.setUserToken(userToken); | ||
|
||
var data = { | ||
limit: 10, | ||
offset: 0 | ||
}; | ||
try { | ||
var response = await eBay.location.getInventoryLocations(data); | ||
console.log('response', response); | ||
} catch (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
}; | ||
|
||
offerRequest(); |
42 changes: 42 additions & 0 deletions
42
examples/javaScript/sell/location/updateInventoryLocation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
'use strict'; | ||
|
||
var clientId = process.env.EBAY_CLIENT_ID || 'YOUR_KEY'; | ||
var clientSecret = process.env.EBAY_CLIENT_SECRET || 'YOUR_SECRET'; | ||
|
||
var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret); | ||
var utils = require('../../../javaScript/utils'); | ||
|
||
var offerRequest = async function () { | ||
var userToken = utils.USER_TOKEN; | ||
eBay.setUserToken(userToken); | ||
|
||
var data = { | ||
'name': 'My Store #1', | ||
'location': { | ||
'address': { | ||
'addressLine1': '2055 Hamilton Ave', | ||
'addressLine2': 'Building 3', | ||
'city': 'San Jose', | ||
'stateOrProvince': 'CA', | ||
'postalCode': '95008', | ||
'country': 'US' | ||
} | ||
}, | ||
'merchantLocationStatus': 'ENABLED', | ||
'locationTypes': [ | ||
'STORE' | ||
], | ||
'merchantLocationKey': 'store-1' | ||
}; | ||
|
||
var customLocationIdentifier = 'LOC1014'; | ||
try { | ||
var response = await eBay.location.updateInventoryLocation(customLocationIdentifier, data); | ||
console.log('response', response); | ||
} catch (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
}; | ||
|
||
offerRequest(); |
Oops, something went wrong.