ebay-api 8.0.0 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # eBay Node API in TypeScript with Browser support
2
+
2
3
  [![Build Status](https://travis-ci.com/hendt/ebay-api.svg?branch=master)](https://travis-ci.com/hendt/ebay-api)
3
4
  [![codecov](https://codecov.io/gh/hendt/ebay-api/branch/master/graph/badge.svg?token=E67PSWIZFZ)](https://codecov.io/gh/hendt/ebay-api)
4
5
 
5
6
  [![GitHub](https://img.shields.io/npm/l/ebay-api?style=flat-square)](https://github.com/hendt/ebay-api/blob/master/LICENSE)
6
- [![GitHub release](https://img.shields.io/github/release/hendt/ebay-api.svg?style=flat-square)](https://github.com/hendt/ebay-api/releases)
7
7
  [![npm version](https://img.shields.io/npm/v/ebay-api.svg?style=flat-square)](https://www.npmjs.com/package/ebay-api)
8
8
  [![](https://data.jsdelivr.com/v1/package/npm/ebay-api/badge)](https://www.jsdelivr.com/package/npm/ebay-api)
9
9
  [![npm](https://img.shields.io/npm/dt/ebay-api.svg?style=flat-square)](https://www.npmjs.com/package/ebay-api)
@@ -15,36 +15,37 @@ It supports `client credentials grant` and `authorization code grant` \(Auth'N'A
15
15
  * [API Documentation](https://hendt.gitbook.io/ebay-api/)
16
16
 
17
17
  ## eBay Docs
18
+
18
19
  * [eBay API Explorer](https://developer.ebay.com/my/api_test_tool)
19
20
  * [eBay API Docs](https://developer.ebay.com/docs)
20
21
 
21
22
  ## Changelog
22
23
 
23
- * `v8.0.0-RC.0` is the latest release.
24
+ * `v8.1.0` is the latest release.
24
25
  * See [here](https://github.com/hendt/ebay-api/blob/master/CHANGELOG.md) for the full changelog.
25
26
 
26
27
  ## Implementation status
27
28
 
28
29
  ### RESTful API
29
30
 
30
- | API | Implemented |
31
- | :--- | :--- |
32
- | **Buy API** | ✔ Browse API `v1.10.0`<br>✔ Deal API `v1.3.0`<br>✔ Feed API<br>✔ Marketing API<br>✔ Offer API<br>✔ Order API<br>✔ Marketplace Insights API |
33
- | **Commerce API** | ✔ Catalog API<br>✔ Charity API `v1.2.0`<br>✔ Identity API<br>✔ Notification API `v1.2.0`<br>✔ Taxonomy API `v1.0.0`<br>✔ Translation API `v1_beta.1.4` |
34
- | **Developer API** | ✔ Analytics API|
35
- | **Post Order API** | ✔ Cancellation API<br>✔ Case Management API<br>✔ Inquiry API<br>✔ Return API |
36
- | **Sell API** | ✔ Account API `v1.6.3`<br>✔ Analytics API `v1.3.0`<br>✔ Compliance API `v1.4.1`<br>✔ Feed API<br>✔ Finance API `v1.9.0`<br>✔ Fulfillment API `v1.19.10`<br>✔ Inventory API `v1.14.0`<br>✔ Listing API<br>✔ Logistics API<br>✔ Marketing API `v1.10.0`<br>✔ Metadata API<br>✔ Negotiation API `v1.1.0`<br>✔ Recommendation API `v1.1.0`|
31
+ | API | Implemented |
32
+ |:-------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
33
+ | **Buy API** | ✔ Browse API `v1.10.0`<br>✔ Deal API `v1.3.0`<br>✔ Feed API `v1.3.1`<br>✔ Marketing API<br>✔ Offer API<br>✔ Order API<br>✔ Marketplace Insights API |
34
+ | **Commerce API** | ✔ Catalog API<br>✔ Charity API `v1.2.0`<br>✔ Identity API<br>✔ Notification API `v1.2.0`<br>✔ Taxonomy API `v1.0.0`<br>✔ Translation API `v1_beta.1.4` |
35
+ | **Developer API** | ✔ Analytics API |
36
+ | **Post Order API** | ✔ Cancellation API<br>✔ Case Management API<br>✔ Inquiry API<br>✔ Return API |
37
+ | **Sell API** | ✔ Account API `v1.6.3`<br>✔ Analytics API `v1.3.0`<br>✔ Compliance API `v1.4.1`<br>✔ Feed API<br>✔ Finance API `v1.9.0`<br>✔ Fulfillment API `v1.19.10`<br>✔ Inventory API `v1.14.0`<br>✔ Listing API<br>✔ Logistics API<br>✔ Marketing API `v1.10.0`<br>✔ Metadata API<br>✔ Negotiation API `v1.1.0`<br>✔ Recommendation API `v1.1.0` |
37
38
 
38
39
  ### Traditional API
39
40
 
40
- | API | Implemented |
41
- | :--- | :--- |
42
- | **Finding API** | ✔ |
43
- | **Shopping API** | ✔ |
44
- | **Merchandising API** | ✔ |
45
- | **Trading API** | ✔ |
46
- | **Client Alerts API** | ✔ |
47
- | **Feedback API** | ✔ |
41
+ | API | Implemented |
42
+ |:----------------------|:------------|
43
+ | **Finding API** | ✔ |
44
+ | **Shopping API** | ✔ |
45
+ | **Merchandising API** | ✔ |
46
+ | **Trading API** | ✔ |
47
+ | **Client Alerts API** | ✔ |
48
+ | **Feedback API** | ✔ |
48
49
 
49
50
  ## Install
50
51
 
@@ -100,18 +101,34 @@ const eBay = new eBayApi({
100
101
  ```
101
102
 
102
103
  ### Browser
104
+
103
105
  Check out live example: [https://hendt.github.io/ebay-api/](https://hendt.github.io/ebay-api/).
104
106
  Because of the eBay CORS problems a Proxy server is required to use the API in the Browser.
105
107
 
106
- For testing purpose you can use `https://ebay.hendt.workers.dev/` url as proxy. You can also set up your own Proxy server. We have added a example for cloudfront workers: [https://github.com/hendt/ebay-api/blob/master/proxy/worker.js](https://github.com/hendt/ebay-api/blob/master/proxy/worker.js)
108
+ For testing purpose you can use `https://ebay.hendt.workers.dev/` url as proxy. You can also set up your own Proxy
109
+ server. We have added a example for cloudfront
110
+ workers: [https://github.com/hendt/ebay-api/blob/master/proxy/worker.js](https://github.com/hendt/ebay-api/blob/master/proxy/worker.js)
107
111
 
108
112
  Or use [https://github.com/Rob--W/cors-anywhere](CORS Anywhere is a NodeJS proxy) (works very well with heroku.com).
109
113
 
114
+ #### ESM
115
+
116
+ ```html
117
+
118
+ <script type="module">
119
+ import eBayApi from 'https://cdn.jsdelivr.net/npm/ebay-api@latest/dist/ebay-api.min.mjs';
120
+ // or
121
+ import eBayApiEsm from 'https://esm.sh/ebay-api';
122
+ </script>
123
+ ```
124
+
125
+ #### UMD
126
+
110
127
  ```html
111
128
 
112
129
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ebay-api@latest/lib/ebay-api.min.js"></script>
113
130
  <script>
114
- const eBay = new eBayApi({
131
+ const eBay = new eBayApi({
115
132
  appId: 'appId',
116
133
  certId: 'certId',
117
134
  sandbox: false
@@ -133,63 +150,76 @@ Or use [https://github.com/Rob--W/cors-anywhere](CORS Anywhere is a NodeJS proxy
133
150
  ```
134
151
 
135
152
  ## 🔧 eBayApi Config
153
+
136
154
  The first (required) parameter in eBayApi instance takes an object with following properties:
137
155
 
138
- | Name | Occurrence | Description |
139
- | :--- |:-------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
140
- | appId | Required | App ID \(Client ID\) from [Application Keys](https://developer.ebay.com/my/keys). |
141
- | certId | Required | Cert ID \(Client Secret\) from [Application Keys](https://developer.ebay.com/my/keys). |
142
- | devId | Conditionally | The Dev Id from [Application Keys](https://developer.ebay.com/my/keys). |
143
- | sandbox | Required<br><pre>Default: `false`</pre> | If true, the [Sandbox Environment](https://developer.ebay.com/tools/sandbox) will be used. |
144
- | ruName | Conditionally | The redirect\_url value. [More info](https://developer.ebay.com/api-docs/static/oauth-redirect-uri.html). |
145
- | autoRefreshToken | Required<pre>Default: `true`</pre> | Auto refresh the token if it's expired. |
146
- | siteId<br><i>Traditional</i> | Required<br><pre>Default: `SiteId.EBAY_US`</pre> | eBay site to which you want to send the request (Trading API, Shopping API). |
147
- | authToken<br><i>Traditional</i> | Optional | The Auth'N'Auth token. The traditional authentication and authorization technology used by the eBay APIs. |
148
- | marketplaceId<br><i>RESTful</i> | Required<br><pre>Default: `MarketplaceId.EBAY_US`</pre> | [Docs](https://developer.ebay.com/api-docs/static/rest-request-components.html#marketpl) REST HTTP Header. X-EBAY-C-MARKETPLACE-ID identifies the user's business context and is specified using a marketplace ID value. Note that this header does not indicate a language preference or consumer location. |
149
- | scope<br><i>RESTful</i> | Conditionally<bre><pre>Default:<br>`['https://api.ebay.com/oauth/api_scope']` </pre> | The scopes assigned to your application allow access to different API resources and functionality. |
150
- | endUserCtx<br><i>RESTful</i> | Conditionally recommended<br><i>RESTful</i> | [Docs](https://developer.ebay.com/api-docs/static/rest-request-components.html#headers) X-EBAY\_C\_ENDUSERCTX provides various types of information associated with the request. |
156
+ | Name | Occurrence | Description |
157
+ |:----------------------------------|:-------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
158
+ | appId | Required | App ID \(Client ID\) from [Application Keys](https://developer.ebay.com/my/keys). |
159
+ | certId | Required | Cert ID \(Client Secret\) from [Application Keys](https://developer.ebay.com/my/keys). |
160
+ | devId | Conditionally | The Dev Id from [Application Keys](https://developer.ebay.com/my/keys). |
161
+ | sandbox | Required<br><pre>Default: `false`</pre> | If true, the [Sandbox Environment](https://developer.ebay.com/tools/sandbox) will be used. |
162
+ | ruName | Conditionally | The redirect\_url value. [More info](https://developer.ebay.com/api-docs/static/oauth-redirect-uri.html). |
163
+ | autoRefreshToken | Required<pre>Default: `true`</pre> | Auto refresh the token if it's expired. |
164
+ | siteId<br><i>Traditional</i> | Required<br><pre>Default: `SiteId.EBAY_US`</pre> | eBay site to which you want to send the request (Trading API, Shopping API). |
165
+ | authToken<br><i>Traditional</i> | Optional | The Auth'N'Auth token. The traditional authentication and authorization technology used by the eBay APIs. |
166
+ | marketplaceId<br><i>RESTful</i> | Required<br><pre>Default: `MarketplaceId.EBAY_US`</pre> | [Docs](https://developer.ebay.com/api-docs/static/rest-request-components.html#marketpl) REST HTTP Header. X-EBAY-C-MARKETPLACE-ID identifies the user's business context and is specified using a marketplace ID value. Note that this header does not indicate a language preference or consumer location. |
167
+ | scope<br><i>RESTful</i> | Conditionally<bre><pre>Default:<br>`['https://api.ebay.com/oauth/api_scope']` </pre> | The scopes assigned to your application allow access to different API resources and functionality. |
168
+ | endUserCtx<br><i>RESTful</i> | Conditionally recommended<br><i>RESTful</i> | [Docs](https://developer.ebay.com/api-docs/static/rest-request-components.html#headers) X-EBAY\_C\_ENDUSERCTX provides various types of information associated with the request. |
151
169
  | contentLanguage<br><i>RESTful</i> | Conditionally required<br><pre>Default: `ContentLanguage.en_US`</pre> | [Docs](https://developer.ebay.com/api-docs/static/rest-request-components.html#headers)Content-Language indicates the locale preferred by the client for the response. |
152
- | acceptLanguage<br><i>RESTful</i> | Optional<pre>Default: `Locale.en_US`</pre> | [Docs](https://developer.ebay.com/api-docs/static/rest-request-components.html#headers) Accept-Language indicates the natural language the client prefers for the response. This specifies the language the client wants to use when the field values provided in the request body are displayed to consumers. |
170
+ | acceptLanguage<br><i>RESTful</i> | Optional<pre>Default: `Locale.en_US`</pre> | [Docs](https://developer.ebay.com/api-docs/static/rest-request-components.html#headers) Accept-Language indicates the natural language the client prefers for the response. This specifies the language the client wants to use when the field values provided in the request body are displayed to consumers. |
153
171
 
154
172
  ## Load config from environment
173
+
155
174
  Use `eBayApi.fromEnv()` to load data from environment variables.
156
175
 
157
- | Name | Value |
158
- |:---------------|:--------------------------------------------|
159
- | appId | process.env.EBAY_APP_ID |
160
- | certId | process.env.EBAY_CERT_ID |
161
- | devId | process.env.EBAY_DEV_ID |
162
- | authToken | process.env.EBAY_AUTH_TOKEN |
163
- | siteId | process.env.EBAY_SITE_ID |
164
- | marketplaceId | process.env.EBAY_MARKETPLACE_ID |
165
- | ruName | process.env.EBAY_RU_NAME |
166
- | sandbox | process.env.EBAY_SANDBOX === 'true' |
176
+ | Name | Value |
177
+ |:--------------|:------------------------------------|
178
+ | appId | process.env.EBAY_APP_ID |
179
+ | certId | process.env.EBAY_CERT_ID |
180
+ | devId | process.env.EBAY_DEV_ID |
181
+ | authToken | process.env.EBAY_AUTH_TOKEN |
182
+ | siteId | process.env.EBAY_SITE_ID |
183
+ | marketplaceId | process.env.EBAY_MARKETPLACE_ID |
184
+ | ruName | process.env.EBAY_RU_NAME |
185
+ | sandbox | process.env.EBAY_SANDBOX === 'true' |
167
186
 
168
187
  ## 🐞 Debug
188
+
169
189
  To see node debug logs use `DEBUG=ebay:*` environment variable.
170
190
 
171
191
  ## 🔑 Access token types
192
+
172
193
  See the full Documentation [here](https://developer.ebay.com/api-docs/static/oauth-token-types.html).
173
194
 
174
195
  *Client credentials grant flow* mints a new Application access token.
175
196
  *Authorization code grant flow* mints a new User access token.
176
197
 
177
198
  ### User access token (authorization code grant flow)
199
+
178
200
  👉 Recommended for all API Calls.
179
201
 
180
- > You must employ a User token to call any interface that accesses or modifies data that is owned by the user (such as user information and account data).
181
- To get a User token, the users of your app must grant your application the permissions it needs to act upon their behalf. This process is called user consent. With the user consent flow, each User token contains the set of scopes for which the user has granted their permission [(eBay Token Types)](https://developer.ebay.com/api-docs/static/oauth-token-types.html).
202
+ > You must employ a User token to call any interface that accesses or modifies data that is owned by the user (such as
203
+ > user information and account data).
204
+ > To get a User token, the users of your app must grant your application the permissions it needs to act upon their
205
+ > behalf. This process is called user consent. With the user consent flow, each User token contains the set of scopes
206
+ > for
207
+ > which the user has granted their
208
+ > permission [(eBay Token Types)](https://developer.ebay.com/api-docs/static/oauth-token-types.html).
182
209
 
183
210
  ### Application access token (client credentials grant flow)
211
+
184
212
  👉 Recommended for API calls that will only request application data (`GET` method, and it's also restricted).
185
213
 
186
- > Application tokens are general-use tokens that give access to interfaces that return application data. For example, many GET requests require only an Application token for authorization.
214
+ > Application tokens are general-use tokens that give access to interfaces that return application data. For example,
215
+ > many GET requests require only an Application token for authorization.
187
216
  [(eBay Token Types)](https://developer.ebay.com/api-docs/static/oauth-token-types.html)
188
217
 
189
218
  If no other token is set, this token will be obtained *automatically* in the process of calling an RESTful API.
190
219
 
191
220
  ### Auth'N'Auth
192
- 👉 The "old" way. Only works with Traditional API.
221
+
222
+ 👉 The "old" way. Only works with Traditional API.
193
223
  Checkout the [Auth'N'Auth example](https://github.com/hendt/ebay-api/tree/master/examples/traditional/authNAuth.ts).
194
224
 
195
225
  You can also generate the token on eBay developer page and use it directly (see Detailed configuration example).
@@ -217,18 +247,18 @@ console.log('Open URL', url);
217
247
 
218
248
  After you granted success, eBay will redirect you to your 'Auth accepted URL' and add a query parameter `code`
219
249
 
220
-
221
250
  ### Express example
251
+
222
252
  This is how it would look like if you use `express`:
223
253
 
224
254
  ```javascript
225
255
  import eBayApi from 'ebay-api';
226
256
 
227
- app.get('/success', async function(req, res) {
257
+ app.get('/success', async function (req, res) {
228
258
  // 3. Get the parameter code that is placed as query parameter in redirected page
229
259
  const code = req.query.code; // this is provided from eBay
230
260
  const eBay = eBayApi.fromEnv(); // or use new eBayApi()
231
-
261
+
232
262
  try {
233
263
  const token = await eBay.OAuth2.getToken(code);
234
264
  eBay.OAuth2.setCredentials(token);
@@ -250,8 +280,8 @@ If token is already in session:
250
280
  ```js
251
281
  import eBayApi from 'ebay-api';
252
282
 
253
- app.get('/orders/:id', async function(req, res) {
254
- const id = req.params.id;
283
+ app.get('/orders/:id', async function (req, res) {
284
+ const id = req.params.id;
255
285
  const eBay = eBayApi.fromEnv(); // or use new eBayApi(...)
256
286
  const token = req.session.token;
257
287
  if (!token) {
@@ -295,28 +325,36 @@ eBay.OAuth2.setScope([
295
325
  ```
296
326
 
297
327
  ### Use apix.ebay.com or apiz.ebay.com (beta) endpoints
298
- For some APIs, eBay use a `apix`/`apiz` subdomain. To use these subdomains you can use `.apix`/`.apiz` before the api call like this:
328
+
329
+ For some APIs, eBay use a `apix`/`apiz` subdomain. To use these subdomains you can use `.apix`/`.apiz` before the api
330
+ call like this:
331
+
299
332
  ```javascript
300
333
  eBay.buy.browse.apix.getItem() // now it will use https://apix.ebay.com
301
- eBay.buy.browse.apiz.getItem() // now it will use https://apiz.ebay.com
334
+ eBay.buy.browse.apiz.getItem() // now it will use https://apiz.ebay.com
302
335
  ```
303
336
 
304
337
  In any case eBay adds a new subdomain, it's also possible to configure whatever you want:
338
+
305
339
  ```javascript
306
340
  eBay.buy.browse.api({subdomain: 'apiy'}).getItem() // now it will use https://apiy.ebay.com
307
341
  ```
308
342
 
309
343
  ### Change RESTful API call config
344
+
310
345
  ```javascript
311
346
  eBay.buy.browse.api({
312
- returnResponse: true, // return the response instead of data
313
- }).getItem();
347
+ returnResponse: true, // return the response instead of data
348
+ }).getItem();
314
349
  ```
315
350
 
316
351
  ### How to refresh the token
317
- If `autoRefreshToken` is set to true (default value) the token will be automatically refreshed when eBay response with `invalid access token` error.
352
+
353
+ If `autoRefreshToken` is set to true (default value) the token will be automatically refreshed when eBay response
354
+ with `invalid access token` error.
318
355
 
319
356
  Use Event Emitter to get the token when it gets successfully refreshed.
357
+
320
358
  ```javascript
321
359
  eBay.OAuth2.on('refreshAuthToken', (token) => {
322
360
  console.log(token)
@@ -329,7 +367,9 @@ eBay.OAuth2.on('refreshClientToken', (token) => {
329
367
  // Store this token in DB
330
368
  });
331
369
  ```
332
- To manuel refresh the auth token use `eBay.OAuth2.refreshAuthToken()` and for the client token `eBay.OAuth2.refreshClientToken()`.
370
+
371
+ To manuel refresh the auth token use `eBay.OAuth2.refreshAuthToken()` and for the client
372
+ token `eBay.OAuth2.refreshClientToken()`.
333
373
  Keep in mind that you need the 'refresh_token' value set.
334
374
 
335
375
  ```javascript
@@ -338,9 +378,9 @@ const token = await eBay.OAuth2.refreshToken();
338
378
  ```
339
379
 
340
380
  ## Additional request headers
341
- Sometimes you want to add additional headers to the request like a GLOBAL-ID `X-EBAY-SOA-GLOBAL-ID`.
342
- You have multiple options to do this.
343
381
 
382
+ Sometimes you want to add additional headers to the request like a GLOBAL-ID `X-EBAY-SOA-GLOBAL-ID`.
383
+ You have multiple options to do this.
344
384
 
345
385
  ### RESTful API headers
346
386
 
@@ -357,7 +397,9 @@ eBay.buy.browse.api({
357
397
  ```
358
398
 
359
399
  ### Traditional API headers
400
+
360
401
  You can pass headers directly in the method call in the second parameter:
402
+
361
403
  ```javascript
362
404
  eBay.trading.AddFixedPriceItem({
363
405
  Item: {
@@ -388,6 +430,7 @@ eBay.req.instance.interceptors.request.use((request) => {
388
430
  ```
389
431
 
390
432
  ### Handle JSON GZIP response e.g fetchItemAspects
433
+
391
434
  You need a decompress library installed like `zlib`.
392
435
 
393
436
  ```bash
@@ -418,6 +461,7 @@ try {
418
461
  ```
419
462
 
420
463
  ## Controlling Traditional XML request and response
464
+
421
465
  The second parameter in the traditional API has the following options:
422
466
 
423
467
  ```typescript
@@ -430,7 +474,8 @@ export type Options = {
430
474
  };
431
475
  ```
432
476
 
433
- [Fast XML](https://github.com/NaturalIntelligence/fast-xml-parser) is used to parse the XML. You can pass the parse option to `parseOptions` parameter.
477
+ [Fast XML](https://github.com/NaturalIntelligence/fast-xml-parser) is used to parse the XML. You can pass the parse
478
+ option to `parseOptions` parameter.
434
479
 
435
480
  ## Examples
436
481
 
@@ -464,9 +509,9 @@ eBay.trading.ReviseFixedPriceItem({
464
509
 
465
510
  ```javascript
466
511
  eBay.buy.browse.getItem('v1|382282567190|651094235351').then(a => {
467
- console.log(a);
512
+ console.log(a);
468
513
  }).catch(e => {
469
- console.log(e)
514
+ console.log(e)
470
515
  });
471
516
  ```
472
517
 
@@ -474,9 +519,9 @@ eBay.buy.browse.getItem('v1|382282567190|651094235351').then(a => {
474
519
 
475
520
  ```javascript
476
521
  eBay.postOrder.return.getReturn('5132021997').then(a => {
477
- console.log(a);
522
+ console.log(a);
478
523
  }).catch(e => {
479
- console.log(e)
524
+ console.log(e)
480
525
  });
481
526
  ```
482
527
 
@@ -498,10 +543,10 @@ eBay.finding.findItemsByProduct({
498
543
 
499
544
  ```javascript
500
545
  eBay.finding.findItemsIneBayStores({
501
- storeName: 'HENDT'
546
+ storeName: 'HENDT'
502
547
  }, {raw: true}).then(result => {
503
- // Return raw XML
504
- console.log(result);
548
+ // Return raw XML
549
+ console.log(result);
505
550
  });
506
551
  ```
507
552
 
@@ -509,13 +554,13 @@ eBay.finding.findItemsIneBayStores({
509
554
 
510
555
  ```javascript
511
556
  eBay.finding.findItemsAdvanced({
512
- itemFilter: [{
513
- name: 'Seller',
514
- value: 'hendt_de'
515
- }],
516
- keywords: 'katze'
557
+ itemFilter: [{
558
+ name: 'Seller',
559
+ value: 'hendt_de'
560
+ }],
561
+ keywords: 'katze'
517
562
  }).then(result => {
518
- console.log(result);
563
+ console.log(result);
519
564
  });
520
565
  ```
521
566
 
@@ -523,19 +568,20 @@ eBay.finding.findItemsAdvanced({
523
568
 
524
569
  ```javascript
525
570
  eBay.trading.GetMyeBaySelling({
526
- SoldList: {
527
- Include: true,
528
- Pagination: {
529
- EntriesPerPage: 20,
530
- PageNumber: 1
531
- }
571
+ SoldList: {
572
+ Include: true,
573
+ Pagination: {
574
+ EntriesPerPage: 20,
575
+ PageNumber: 1
532
576
  }
577
+ }
533
578
  }).then(data => {
534
- console.log(data.results)
579
+ console.log(data.results)
535
580
  });
536
581
  ```
537
582
 
538
583
  ## FAQ
584
+
539
585
  1. Do I need the [eBay OAuth Client](https://www.npmjs.com/package/ebay-oauth-nodejs-client) dependency?
540
586
 
541
587
  No. This library has already all authentication implemented and support also auto refreshing token.
@@ -547,7 +593,11 @@ The traditional API supports IAF. That means you can use the OAuth2 token with t
547
593
 
548
594
  3. Is it possible to Upload Pictures directly to EPS?
549
595
 
550
- Yes. Checkout the [Browser](https://hendt.github.io/ebay-api/) example and [Node Example here](https://github.com/hendt/ebay-api/blob/master/examples/traditional/trading.UploadSiteHostedPictures.ts).
596
+ Yes. Checkout the [Browser](https://hendt.github.io/ebay-api/) example
597
+ and [Node Example here](https://github.com/hendt/ebay-api/blob/master/examples/traditional/trading.UploadSiteHostedPictures.ts).
598
+
599
+ 4. itemAffiliateWebUrl is missing in eBay.buy.browse.search call
600
+ You have to set `endUserCtx`.
551
601
 
552
602
  ## Contribution
553
603
 
@@ -1,5 +1,5 @@
1
- import Restful from '../../index.js';
2
1
  import { SellFeedParams } from '../../../../types/index.js';
2
+ import Restful from '../../index.js';
3
3
  /**
4
4
  * The <strong>Feed API</strong> lets sellers upload input files, download reports and files including their status, filter reports using URI parameters, and retrieve customer service metrics task details.
5
5
  */
@@ -29,6 +29,26 @@ export default class Feed extends Restful {
29
29
  * @param taskId The ID of the task. This ID is generated when the task was created by the createOrderTask method.
30
30
  */
31
31
  getOrderTask(taskId: string): Promise<any>;
32
+ /**
33
+ * This method searches for multiple tasks of a specific feed type, and includes date filters and pagination.
34
+ */
35
+ getInventoryTasks({ feedType, scheduleId, lookBackDays, dateRange, limit, offset }?: {
36
+ feedType?: string;
37
+ scheduleId?: string;
38
+ lookBackDays?: number;
39
+ dateRange?: string;
40
+ limit?: number;
41
+ offset?: number;
42
+ }): Promise<any>;
43
+ /**
44
+ * This method creates an inventory-related download task for a specified feed type with optional filter criteria.
45
+ */
46
+ createInventoryTask(data: any): Promise<any>;
47
+ /**
48
+ * This method retrieves the task details and status of the specified inventory-related task.
49
+ * @param taskId The ID of the task.
50
+ */
51
+ getInventoryTask(taskId: string): Promise<any>;
32
52
  /**
33
53
  * This method retrieves an array containing the details and status of all schedules based on the specified feed_type.
34
54
  *
@@ -1,5 +1,5 @@
1
- import Restful from '../../index.js';
2
1
  import { multipartHeader } from '../../../../request.js';
2
+ import Restful from '../../index.js';
3
3
  /**
4
4
  * The <strong>Feed API</strong> lets sellers upload input files, download reports and files including their status, filter reports using URI parameters, and retrieve customer service metrics task details.
5
5
  */
@@ -46,6 +46,35 @@ export default class Feed extends Restful {
46
46
  taskId = encodeURIComponent(taskId);
47
47
  return this.get(`/order_task/${taskId}`);
48
48
  }
49
+ /**
50
+ * This method searches for multiple tasks of a specific feed type, and includes date filters and pagination.
51
+ */
52
+ getInventoryTasks({ feedType, scheduleId, lookBackDays, dateRange, limit, offset } = {}) {
53
+ return this.get('/inventory_task', {
54
+ params: {
55
+ feed_type: feedType,
56
+ schedule_id: scheduleId,
57
+ look_back_days: lookBackDays,
58
+ date_range: dateRange,
59
+ limit,
60
+ offset
61
+ }
62
+ });
63
+ }
64
+ /**
65
+ * This method creates an inventory-related download task for a specified feed type with optional filter criteria.
66
+ */
67
+ createInventoryTask(data) {
68
+ return this.post('/inventory_task', data);
69
+ }
70
+ /**
71
+ * This method retrieves the task details and status of the specified inventory-related task.
72
+ * @param taskId The ID of the task.
73
+ */
74
+ getInventoryTask(taskId) {
75
+ taskId = encodeURIComponent(taskId);
76
+ return this.get(`/inventory_task/${taskId}`);
77
+ }
49
78
  /**
50
79
  * This method retrieves an array containing the details and status of all schedules based on the specified feed_type.
51
80
  *