diff --git a/CHANGELOG.md b/CHANGELOG.md index 71236dc..2ae49df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/examples/javaScript/sell/inventory/deleteInventoryItem.js b/examples/javaScript/sell/inventory/deleteInventoryItem.js new file mode 100644 index 0000000..ab69220 --- /dev/null +++ b/examples/javaScript/sell/inventory/deleteInventoryItem.js @@ -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(); diff --git a/index.d.ts b/index.d.ts index 7ea027e..ad98654 100644 --- a/index.d.ts +++ b/index.d.ts @@ -64,6 +64,8 @@ declare class Inventory extends BaseClient { createOrReplaceInventoryItem(sku: string, params: any): Promise; + deleteInventoryItem(sku: string): Promise; + getInventoryItem(sku: string): Promise; getInventoryItems(params: any): Promise; diff --git a/lib/resources/sell/inventory.js b/lib/resources/sell/inventory.js index 7605331..4cc59b8 100644 --- a/lib/resources/sell/inventory.js +++ b/lib/resources/sell/inventory.js @@ -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', diff --git a/package.json b/package.json index 25cdf4c..7823feb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ebay-node-client", - "version": "0.0.6", + "version": "0.0.7", "description": "eBay API wrapper", "keywords": [ "eBay", @@ -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": {