Skip to content

Commit

Permalink
Merge pull request #6 from bhushankumarl/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Bhushankumar L authored Oct 2, 2018
2 parents 663f3c1 + 35a3575 commit 7d5bfcc
Show file tree
Hide file tree
Showing 33 changed files with 691 additions and 27 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.0.5 October 3, 2018
- Add Support for Offer API : createOffer, updateOffer,getOffer, getOffers, publishOffer, deleteOffer, getListingFees, withdrawOffer
- Add Support for Seller Location API : createInventoryLocation, updateInventoryLocation, enableInventoryLocation, disableInventoryLocation, getInventoryLocation, deleteInventoryLocation, getInventoryLocations
- Add Offer & Seller Location support types

0.0.4 September 20, 2018
- Add Support for catalog API : search, getProduct, getProductMetadata, getProductMetadataForCategories, getChangeRequest, getChangeRequests, createChangeRequest
- Add Support for account API : getSalesTaxes, getSalesTax, deleteSalesTax, createOrReplaceSalesTax
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# eBay-node-client (eBay Node Client)
[![Version](https://img.shields.io/npm/v/ebay-node-client.svg)](https://www.npmjs.org/package/ebay-node-client)
[![Build Status](https://travis-ci.org/bhushankumarl/eBay-node-client.svg?branch=master)](https://travis-ci.org/bhushankumarl/eBay-node-client)

This API supported eBay's standard REST-style API that accepts/returns JSON requests and Here is the [API reference] (https://developer.ebay.com/api-docs/commerce/static/commerce-landing.html)
Expand Down
29 changes: 29 additions & 0 deletions examples/javaScript/commerce/catalog/searchByCategory.js
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();
8 changes: 3 additions & 5 deletions examples/javaScript/sell/account/createOrReplaceSalesTax.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret);

var utils = require('../../../javaScript/utils');

var catalogRequest = async function () {

var accountRequest = async function () {
var userToken = utils.USER_TOKEN;
eBay.setUserToken(userToken);



var countryCode = 'US';
var jurisdictionId = 'IN';
var data = {
Expand All @@ -28,4 +26,4 @@ var catalogRequest = async function () {
}
};

catalogRequest();
accountRequest();
6 changes: 2 additions & 4 deletions examples/javaScript/sell/account/deleteSalesTax.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ 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 accountRequest = async function () {
var userToken = utils.USER_TOKEN;
eBay.setUserToken(userToken);

Expand All @@ -24,4 +22,4 @@ var catalogRequest = async function () {
}
};

catalogRequest();
accountRequest();
5 changes: 2 additions & 3 deletions examples/javaScript/sell/account/getSalesTax.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ 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 accountRequest = async function () {
var userToken = utils.USER_TOKEN;
eBay.setUserToken(userToken);

Expand All @@ -22,4 +21,4 @@ var catalogRequest = async function () {
}
};

catalogRequest();
accountRequest();
6 changes: 2 additions & 4 deletions examples/javaScript/sell/account/getSalesTaxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ 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 accountRequest = async function () {
var userToken = utils.USER_TOKEN;
eBay.setUserToken(userToken);

Expand All @@ -24,4 +22,4 @@ var catalogRequest = async function () {
}
};

catalogRequest();
accountRequest();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret);
var utils = require('../../../javaScript/utils');

var inventoryRequest = function () {

var userToken = utils.USER_TOKEN;
eBay.setUserToken(userToken);

Expand Down Expand Up @@ -39,7 +39,7 @@ var inventoryRequest = function () {
}
};

var sku = '32984729384729';
var sku = '32984729384730';
eBay.inventory.createOrReplaceInventoryItem(sku, data, function (error, response) {
if (error) {
console.log('error ', error);
Expand Down
1 change: 0 additions & 1 deletion examples/javaScript/sell/inventory/getInventoryItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret);
var utils = require('../../../javaScript/utils');

var inventoryRequest = async function () {

var userToken = utils.USER_TOKEN;
eBay.setUserToken(userToken);

Expand Down
1 change: 0 additions & 1 deletion examples/javaScript/sell/inventory/getInventoryItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ var eBay = require('../../../../lib/eBay-node-client')(clientId, clientSecret);
var utils = require('../../../javaScript/utils');

var inventoryRequest = async function () {

var userToken = utils.USER_TOKEN;
eBay.setUserToken(userToken);

Expand Down
77 changes: 77 additions & 0 deletions examples/javaScript/sell/location/createInventoryLocation.js
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 examples/javaScript/sell/location/deleteInventoryLocation.js
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 examples/javaScript/sell/location/disableInventoryLocation.js
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 examples/javaScript/sell/location/enableInventoryLocation.js
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();
23 changes: 23 additions & 0 deletions examples/javaScript/sell/location/getInventoryLocation.js
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 examples/javaScript/sell/location/getInventoryLocations.js
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 examples/javaScript/sell/location/updateInventoryLocation.js
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();
Loading

0 comments on commit 7d5bfcc

Please sign in to comment.