ebay-api 8.4.0 → 8.4.1

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
@@ -9,7 +9,7 @@
9
9
  [![npm](https://img.shields.io/npm/dt/ebay-api.svg?style=flat-square)](https://www.npmjs.com/package/ebay-api)
10
10
 
11
11
  This eBay API implements both Traditional \(xml\) and the RESTful eBay API.
12
- It supports `client credentials grant` and `authorization code grant` \(Auth'N'Auth, OAuth2 and IAF\).
12
+ It supports `client credentials grant` and `authorization code grant` \(Auth'N'Auth, OAuth2 and IAF\). Digital Signature is supported too.
13
13
 
14
14
  * [API Browser Examples](https://hendt.github.io/ebay-api/)
15
15
  * [API Documentation](https://hendt.gitbook.io/ebay-api/)
@@ -21,7 +21,7 @@ It supports `client credentials grant` and `authorization code grant` \(Auth'N'A
21
21
 
22
22
  ## Changelog
23
23
 
24
- * `v8.4.0` is the latest release.
24
+ * `v8.4.1` is the latest release.
25
25
  * See [here](https://github.com/hendt/ebay-api/blob/master/CHANGELOG.md) for the full changelog.
26
26
 
27
27
  ## Implementation status
@@ -88,9 +88,9 @@ const eBay = new eBayApi({
88
88
 
89
89
  siteId: eBayApi.SiteId.EBAY_US, // required for traditional APIs, see https://developer.ebay.com/DevZone/merchandising/docs/Concepts/SiteIDToGlobalID.html
90
90
 
91
- marketplaceId: eBayApi.MarketplaceId.EBAY_US, // defautl. required for RESTful APIs
92
- acceptLanguage: eBayApi.Locale.en_US, // defautl
93
- contentLanguage: eBayApi.ContentLanguage.en_US, // defautl.
91
+ marketplaceId: eBayApi.MarketplaceId.EBAY_US, // default. required for RESTful APIs
92
+ acceptLanguage: eBayApi.Locale.en_US, // default
93
+ contentLanguage: eBayApi.ContentLanguage.en_US, // default.
94
94
 
95
95
  // optional parameters, should be omitted if not used
96
96
  devId: '-- devId --', // required for traditional Trading API
@@ -254,6 +254,8 @@ This is how it would look like if you use `express`:
254
254
  ```javascript
255
255
  import eBayApi from 'ebay-api';
256
256
 
257
+
258
+ // This is your RUName endpoint like https://your-ebay.app/success
257
259
  app.get('/success', async function (req, res) {
258
260
  // 3. Get the parameter code that is placed as query parameter in redirected page
259
261
  const code = req.query.code; // this is provided from eBay
@@ -309,16 +311,16 @@ app.get('/orders/:id', async function (req, res) {
309
311
  ## Digital Signature
310
312
  Signatures are required when the call is made for EU- or UK-domiciled sellers, and only for the following APIs/methods:
311
313
 
312
- * All methods in the Finances API
313
- * issueRefund in the Fulfillment API
314
- * GetAccount in the Trading API
314
+ * All methods in the Finances API -> (`eBay.finances.XXX.sign.YYY()`)
315
+ * issueRefund in the Fulfillment API -> (`eBay.sell.fulfillment.sign.issueRefund()`)
316
+ * GetAccount in the Trading API -> (`eBay.trading.GetAccount(null, { sign: true }))`)
315
317
  * The following methods in the Post-Order API:
316
- - Issue Inquiry Refund
317
- - Issue case refund
318
- - Issue return refund
319
- - Process Return Request
320
- - Create Cancellation Request
321
- - Approve Cancellation Request
318
+ - Issue Inquiry Refund -> (`eBay.postOrder.inquiry.sign.issueInquiryRefund()`)
319
+ - Issue case refund -> (`eBay.postOrder.inquiry.sign.issueCaseRefund()`)
320
+ - Issue return refund -> (`eBay.postOrder.inquiry.sign.issueReturnRefund()`)
321
+ - Process Return Request -> (`eBay.postOrder.inquiry.sign.processReturnRequest()`)
322
+ - Create Cancellation Request -> (`eBay.postOrder.inquiry.sign.createCancellation()`)
323
+ - Approve Cancellation Request -> (`eBay.postOrder.inquiry.sign.approveCancellationRequest()`)
322
324
 
323
325
  ### How to use Digital Signature
324
326
  ```js
@@ -375,7 +377,7 @@ In any case eBay adds a new subdomain, it's also possible to configure whatever
375
377
  eBay.buy.browse.api({subdomain: 'apiy'}).getItem() // now it will use https://apiy.ebay.com
376
378
  ```
377
379
 
378
- ### Change RESTful API call config
380
+ ### Return raw RESTful API response
379
381
 
380
382
  ```javascript
381
383
  eBay.buy.browse.api({
@@ -403,8 +405,8 @@ eBay.OAuth2.on('refreshClientToken', (token) => {
403
405
  });
404
406
  ```
405
407
 
406
- To manuel refresh the auth token use `eBay.OAuth2.refreshAuthToken()` and for the client
407
- token `eBay.OAuth2.refreshClientToken()`.
408
+ To manual refresh the auth token use `eBay.OAuth2.refreshAuthToken()` and for the client
409
+ token use `eBay.OAuth2.refreshClientToken()`.
408
410
  Keep in mind that you need the 'refresh_token' value set.
409
411
 
410
412
  ```javascript
@@ -149,6 +149,9 @@ export default class Restful extends Api {
149
149
  if (error.name === EBayInvalidAccessToken.name) {
150
150
  return true;
151
151
  }
152
+ else if (error?.meta?.res?.status === 403 && this.apiConfig.basePath === '/sell/inventory/v1') {
153
+ return true;
154
+ }
152
155
  return error?.meta?.res?.status === 401 && this.apiConfig.basePath === '/post-order/v2';
153
156
  }
154
157
  async request(apiRequest, apiConfig = this.apiConfig, refreshToken = false) {