Skip to content

Commit

Permalink
- Add Support for Inventory API : deleteInventoryItem
Browse files Browse the repository at this point in the history
- Add examples for deleteInventoryItem
  • Loading branch information
BL committed Oct 27, 2018
1 parent 0f32bd0 commit 8793d71
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
0.0.6 October 11, 2018
- Add Support for Inventory API : getBulkInventoryItem
- Add examples in README.md
0.0.7 October 27, 2018
- Add Support for Inventory API : deleteInventoryItem
- Add examples for deleteInventoryItem

0.0.5 October 3, 2018
- Add Support for Offer API : createOffer, updateOffer,getOffer, getOffers, publishOffer, deleteOffer, getListingFees, withdrawOffer
Expand Down
23 changes: 23 additions & 0 deletions examples/javaScript/sell/inventory/deleteInventoryItem.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 inventoryRequest = async function () {
var userToken = utils.USER_TOKEN;
eBay.setUserToken(userToken);

var sku = '32984729384730';
try {
var response = await eBay.inventory.deleteInventoryItem(sku);
console.log('response', response);
} catch (error) {
console.log('error ', error);
return;
}
};

inventoryRequest();
2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ declare class Inventory extends BaseClient {

createOrReplaceInventoryItem(sku: string, params: any): Promise<any>;

deleteInventoryItem(sku: string): Promise<any>;

getInventoryItem(sku: string): Promise<any>;

getInventoryItems(params: any): Promise<any>;
Expand Down
7 changes: 7 additions & 0 deletions lib/resources/sell/inventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ module.exports = eBayResource.extend({
urlParams: ['sku'],
required: ['sku']
}),
deleteInventoryItem: eBayMethod({
authorization: 'User',
method: 'DELETE',
path: 'sell/inventory/v1/inventory_item/{sku}',
urlParams: ['sku'],
required: ['sku']
}),
getInventoryItem: eBayMethod({
authorization: 'User',
method: 'GET',
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ebay-node-client",
"version": "0.0.6",
"version": "0.0.7",
"description": "eBay API wrapper",
"keywords": [
"eBay",
Expand Down Expand Up @@ -71,7 +71,8 @@
"lodash": "^4.17.4",
"mocha": "^5.2.0",
"object-assign": "^4.1.0",
"qs": "^6.5.1"
"qs": "^6.5.1",
"xml2js": "^0.4.19"
},
"license": "MIT",
"scripts": {
Expand Down

0 comments on commit 8793d71

Please sign in to comment.