-
-
Notifications
You must be signed in to change notification settings - Fork 19
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 #2 from bhushankumarl/development
Development
- Loading branch information
Showing
19 changed files
with
307 additions
and
102 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
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 browseRequest = async function () { | ||
try { | ||
var token = await eBay.application.getOAuthToken({ | ||
grant_type: 'client_credentials', | ||
scope: 'https://api.ebay.com/oauth/api_scope' | ||
}); | ||
eBay.setToken(token.access_token); | ||
} catch (error) { | ||
|
||
} | ||
|
||
var itemId = 'v1|110329773707|410089528845'; | ||
eBay.browse.getItem(itemId, function (error, response) { | ||
if (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
console.log('response', response); | ||
}); | ||
}; | ||
|
||
browseRequest(); |
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,32 @@ | ||
'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 browseRequest = async function () { | ||
try { | ||
var token = await eBay.application.getOAuthToken({ | ||
grant_type: 'client_credentials', | ||
scope: 'https://api.ebay.com/oauth/api_scope' | ||
}); | ||
eBay.setToken(token.access_token); | ||
} catch (error) { | ||
|
||
} | ||
|
||
var data = { | ||
gtin: '010942122258', | ||
limit: '1' | ||
}; | ||
eBay.browse.search(data, function (error, response) { | ||
if (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
console.log('response', response); | ||
}); | ||
}; | ||
|
||
browseRequest(); |
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
50 changes: 50 additions & 0 deletions
50
examples/javaScript/sell/inventory/createOrReplaceInventoryItem.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,50 @@ | ||
'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 browseRequest = async function () { | ||
var userToken = 'USER_TOKEN'; | ||
eBay.setUserToken(userToken); | ||
|
||
var data = { | ||
'availability': { | ||
'shipToLocationAvailability': { | ||
'quantity': 50 | ||
} | ||
}, | ||
'condition': 'NEW', | ||
'product': { | ||
'title': 'GoPro Hero4 Helmet Cam', | ||
'description': 'New GoPro Hero4 Helmet Cam. Unopened box.', | ||
'aspects': { | ||
'Brand': ['GoPro'], | ||
'Type': ['Helmet/Action'], | ||
'Storage Type': ['Removable'], | ||
'Recording Definition': ['High Definition'], | ||
'Media Format': ['Flash Drive (SSD)'], | ||
'Optical Zoom': ['10x'] | ||
}, | ||
'brand': 'GoPro', | ||
'mpn': 'CHDHX-401', | ||
'imageUrls': [ | ||
'http://i.ebayimg.com/images/i/182196556219-0-1/s-l1000.jpg', | ||
'http://i.ebayimg.com/images/i/182196556219-0-1/s-l1001.jpg', | ||
'http://i.ebayimg.com/images/i/182196556219-0-1/s-l1002.jpg' | ||
] | ||
} | ||
}; | ||
|
||
var sku = '32984729384729'; | ||
eBay.inventory.createOrReplaceInventoryItem(sku, data, function (error, response) { | ||
if (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
console.log('response', response); | ||
}); | ||
}; | ||
|
||
browseRequest(); |
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 inventoryRequest = async function () { | ||
|
||
var userToken = 'USER_TOKEN'; | ||
eBay.setUserToken(userToken); | ||
|
||
var sku = '32984729384729'; | ||
eBay.inventory.getInventoryItem(sku, function (error, response) { | ||
if (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
console.log('response', response); | ||
}); | ||
}; | ||
|
||
inventoryRequest(); |
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,25 @@ | ||
'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 inventoryRequest = async function () { | ||
|
||
var userToken = 'USER_TOKEN'; | ||
eBay.setUserToken(userToken); | ||
|
||
var data = { | ||
limit: '10' | ||
}; | ||
eBay.inventory.getInventoryItems(data, function (error, response) { | ||
if (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
console.log('response', response); | ||
}); | ||
}; | ||
|
||
inventoryRequest(); |
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
Oops, something went wrong.