ebay-api 7.1.3 → 8.0.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 +59 -53
- package/dist/api/apiFactory.d.ts +27 -0
- package/dist/api/apiFactory.js +94 -0
- package/dist/api/base.d.ts +10 -0
- package/dist/api/base.js +10 -0
- package/dist/api/index.d.ts +11 -0
- package/dist/api/index.js +11 -0
- package/dist/api/restful/buy/browse/index.d.ts +84 -0
- package/dist/api/restful/buy/browse/index.js +135 -0
- package/dist/api/restful/buy/deal/index.d.ts +55 -0
- package/dist/api/restful/buy/deal/index.js +73 -0
- package/dist/api/restful/buy/feed/index.d.ts +43 -0
- package/dist/api/restful/buy/feed/index.js +78 -0
- package/dist/api/restful/buy/index.d.ts +17 -0
- package/dist/api/restful/buy/index.js +8 -0
- package/dist/api/restful/buy/marketing/index.d.ts +27 -0
- package/dist/api/restful/buy/marketing/index.js +44 -0
- package/dist/api/restful/buy/marketplaceInsights/index.d.ts +28 -0
- package/dist/api/restful/buy/marketplaceInsights/index.js +44 -0
- package/dist/api/restful/buy/offer/index.d.ts +23 -0
- package/dist/api/restful/buy/offer/index.js +30 -0
- package/dist/api/restful/buy/order/index.d.ts +264 -0
- package/dist/api/restful/buy/order/index.js +362 -0
- package/dist/api/restful/commerce/catalog/index.d.ts +73 -0
- package/dist/api/restful/commerce/catalog/index.js +101 -0
- package/dist/api/restful/commerce/charity/index.d.ts +34 -0
- package/dist/api/restful/commerce/charity/index.js +49 -0
- package/dist/api/restful/commerce/identity/index.d.ts +14 -0
- package/dist/api/restful/commerce/identity/index.js +20 -0
- package/dist/api/restful/commerce/index.d.ts +15 -0
- package/dist/api/restful/commerce/index.js +7 -0
- package/dist/api/restful/commerce/notification/index.d.ts +117 -0
- package/dist/api/restful/commerce/notification/index.js +180 -0
- package/dist/api/restful/commerce/taxonomy/index.d.ts +78 -0
- package/dist/api/restful/commerce/taxonomy/index.js +128 -0
- package/dist/api/restful/commerce/translation/index.d.ts +15 -0
- package/dist/api/restful/commerce/translation/index.js +18 -0
- package/dist/api/restful/developer/analytics/index.d.ts +22 -0
- package/dist/api/restful/developer/analytics/index.js +38 -0
- package/dist/api/restful/developer/index.d.ts +7 -0
- package/dist/api/restful/developer/index.js +3 -0
- package/dist/api/restful/developer/keyManagement/index.d.ts +26 -0
- package/dist/api/restful/developer/keyManagement/index.js +34 -0
- package/dist/api/restful/index.d.ts +62 -0
- package/dist/api/restful/index.js +164 -0
- package/dist/api/restful/postOrder/cancellation/index.d.ts +57 -0
- package/dist/api/restful/postOrder/cancellation/index.js +88 -0
- package/dist/api/restful/postOrder/case/index.d.ts +63 -0
- package/dist/api/restful/postOrder/case/index.js +88 -0
- package/dist/api/restful/postOrder/index.d.ts +11 -0
- package/dist/api/restful/postOrder/index.js +5 -0
- package/dist/api/restful/postOrder/inquiry/index.d.ts +82 -0
- package/dist/api/restful/postOrder/inquiry/index.js +124 -0
- package/dist/api/restful/postOrder/return/index.d.ts +231 -0
- package/dist/api/restful/postOrder/return/index.js +354 -0
- package/dist/api/restful/sell/account/index.d.ts +217 -0
- package/dist/api/restful/sell/account/index.js +330 -0
- package/dist/api/restful/sell/analytics/index.d.ts +41 -0
- package/dist/api/restful/sell/analytics/index.js +54 -0
- package/dist/api/restful/sell/compliance/index.d.ts +37 -0
- package/dist/api/restful/sell/compliance/index.js +50 -0
- package/dist/api/restful/sell/feed/index.d.ts +151 -0
- package/dist/api/restful/sell/feed/index.js +248 -0
- package/dist/api/restful/sell/finances/index.d.ts +78 -0
- package/dist/api/restful/sell/finances/index.js +102 -0
- package/dist/api/restful/sell/fulfillment/index.d.ts +137 -0
- package/dist/api/restful/sell/fulfillment/index.js +192 -0
- package/dist/api/restful/sell/index.d.ts +29 -0
- package/dist/api/restful/sell/index.js +14 -0
- package/dist/api/restful/sell/inventory/index.d.ts +248 -0
- package/dist/api/restful/sell/inventory/index.js +339 -0
- package/dist/api/restful/sell/listing/index.d.ts +14 -0
- package/dist/api/restful/sell/listing/index.js +18 -0
- package/dist/api/restful/sell/logistics/index.d.ts +44 -0
- package/dist/api/restful/sell/logistics/index.js +59 -0
- package/dist/api/restful/sell/marketing/index.d.ts +443 -0
- package/dist/api/restful/sell/marketing/index.js +602 -0
- package/dist/api/restful/sell/metadata/index.d.ts +77 -0
- package/dist/api/restful/sell/metadata/index.js +124 -0
- package/dist/api/restful/sell/negotiation/index.d.ts +24 -0
- package/dist/api/restful/sell/negotiation/index.js +32 -0
- package/dist/api/restful/sell/recommendation/index.d.ts +26 -0
- package/dist/api/restful/sell/recommendation/index.js +32 -0
- package/dist/api/traditional/XMLRequest.d.ts +107 -0
- package/dist/api/traditional/XMLRequest.js +173 -0
- package/dist/api/traditional/clientAlerts/index.d.ts +9 -0
- package/dist/api/traditional/clientAlerts/index.js +11 -0
- package/dist/api/traditional/clientAlerts/types.d.ts +31 -0
- package/dist/api/traditional/clientAlerts/types.js +32 -0
- package/dist/api/traditional/fields.d.ts +1948 -0
- package/dist/api/traditional/fields.js +1946 -0
- package/dist/api/traditional/finding/index.d.ts +12 -0
- package/dist/api/traditional/finding/index.js +13 -0
- package/dist/api/traditional/index.d.ts +17 -0
- package/dist/api/traditional/index.js +181 -0
- package/dist/api/traditional/merchandising/index.d.ts +7 -0
- package/dist/api/traditional/merchandising/index.js +8 -0
- package/dist/api/traditional/shopping/index.d.ts +11 -0
- package/dist/api/traditional/shopping/index.js +13 -0
- package/dist/api/traditional/trading/index.d.ts +142 -0
- package/dist/api/traditional/trading/index.js +143 -0
- package/dist/auth/authNAuth.d.ts +49 -0
- package/dist/auth/authNAuth.js +116 -0
- package/dist/auth/index.d.ts +17 -0
- package/dist/auth/index.js +25 -0
- package/dist/auth/oAuth2.d.ts +95 -0
- package/dist/auth/oAuth2.js +259 -0
- package/dist/eBayApi.d.ts +58 -0
- package/dist/eBayApi.js +93 -0
- package/dist/ebay-api.min.mjs +1 -0
- package/dist/enums/apiEnums.d.ts +49 -0
- package/dist/enums/apiEnums.js +51 -0
- package/dist/enums/index.d.ts +2 -0
- package/dist/enums/index.js +2 -0
- package/dist/enums/restfulEnums.d.ts +970 -0
- package/dist/enums/restfulEnums.js +1013 -0
- package/dist/errors/index.d.ts +66 -0
- package/dist/errors/index.js +184 -0
- package/dist/nanoevents.d.ts +6 -0
- package/dist/nanoevents.js +20 -0
- package/dist/request.d.ts +26 -0
- package/dist/request.js +43 -0
- package/dist/types/apiTypes.d.ts +33 -0
- package/dist/types/apiTypes.js +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +3 -0
- package/dist/types/restfulTypes.d.ts +1082 -0
- package/dist/types/restfulTypes.js +1 -0
- package/dist/types/traditonalTypes.d.ts +34 -0
- package/dist/types/traditonalTypes.js +1 -0
- package/lib/api/apiFactory.d.ts +8 -8
- package/lib/api/apiFactory.js +41 -42
- package/lib/api/base.d.ts +3 -6
- package/lib/api/base.js +3 -15
- package/lib/api/index.d.ts +4 -4
- package/lib/api/index.js +4 -5
- package/lib/api/restful/buy/browse/index.d.ts +2 -2
- package/lib/api/restful/buy/browse/index.js +2 -3
- package/lib/api/restful/buy/deal/index.d.ts +1 -1
- package/lib/api/restful/buy/deal/index.js +2 -3
- package/lib/api/restful/buy/feed/index.d.ts +2 -2
- package/lib/api/restful/buy/feed/index.js +2 -3
- package/lib/api/restful/buy/index.d.ts +8 -8
- package/lib/api/restful/buy/index.js +14 -15
- package/lib/api/restful/buy/marketing/index.d.ts +2 -2
- package/lib/api/restful/buy/marketing/index.js +2 -3
- package/lib/api/restful/buy/marketplaceInsights/index.d.ts +2 -2
- package/lib/api/restful/buy/marketplaceInsights/index.js +2 -3
- package/lib/api/restful/buy/offer/index.d.ts +2 -2
- package/lib/api/restful/buy/offer/index.js +2 -3
- package/lib/api/restful/buy/order/index.d.ts +3 -3
- package/lib/api/restful/buy/order/index.js +3 -4
- package/lib/api/restful/commerce/catalog/index.d.ts +2 -2
- package/lib/api/restful/commerce/catalog/index.js +2 -3
- package/lib/api/restful/commerce/charity/index.d.ts +1 -1
- package/lib/api/restful/commerce/charity/index.js +2 -3
- package/lib/api/restful/commerce/identity/index.d.ts +1 -1
- package/lib/api/restful/commerce/identity/index.js +2 -3
- package/lib/api/restful/commerce/index.d.ts +7 -7
- package/lib/api/restful/commerce/index.js +12 -13
- package/lib/api/restful/commerce/notification/index.d.ts +2 -2
- package/lib/api/restful/commerce/notification/index.js +2 -3
- package/lib/api/restful/commerce/taxonomy/index.d.ts +1 -1
- package/lib/api/restful/commerce/taxonomy/index.js +2 -3
- package/lib/api/restful/commerce/translation/index.d.ts +2 -2
- package/lib/api/restful/commerce/translation/index.js +2 -3
- package/lib/api/restful/developer/analytics/index.d.ts +1 -1
- package/lib/api/restful/developer/analytics/index.js +2 -3
- package/lib/api/restful/developer/index.d.ts +3 -3
- package/lib/api/restful/developer/index.js +4 -5
- package/lib/api/restful/developer/keyManagement/index.d.ts +1 -1
- package/lib/api/restful/developer/keyManagement/index.js +2 -3
- package/lib/api/restful/index.d.ts +6 -6
- package/lib/api/restful/index.js +5 -6
- package/lib/api/restful/postOrder/cancellation/index.d.ts +2 -2
- package/lib/api/restful/postOrder/cancellation/index.js +2 -3
- package/lib/api/restful/postOrder/case/index.d.ts +2 -2
- package/lib/api/restful/postOrder/case/index.js +2 -3
- package/lib/api/restful/postOrder/index.d.ts +5 -5
- package/lib/api/restful/postOrder/index.js +8 -9
- package/lib/api/restful/postOrder/inquiry/index.d.ts +2 -2
- package/lib/api/restful/postOrder/inquiry/index.js +2 -3
- package/lib/api/restful/postOrder/return/index.d.ts +3 -3
- package/lib/api/restful/postOrder/return/index.js +2 -3
- package/lib/api/restful/sell/account/index.d.ts +3 -3
- package/lib/api/restful/sell/account/index.js +2 -3
- package/lib/api/restful/sell/analytics/index.d.ts +2 -2
- package/lib/api/restful/sell/analytics/index.js +2 -3
- package/lib/api/restful/sell/compliance/index.d.ts +2 -2
- package/lib/api/restful/sell/compliance/index.js +2 -3
- package/lib/api/restful/sell/feed/index.d.ts +2 -2
- package/lib/api/restful/sell/feed/index.js +4 -5
- package/lib/api/restful/sell/finances/index.d.ts +1 -1
- package/lib/api/restful/sell/finances/index.js +2 -3
- package/lib/api/restful/sell/fulfillment/index.d.ts +2 -2
- package/lib/api/restful/sell/fulfillment/index.js +4 -5
- package/lib/api/restful/sell/index.d.ts +14 -14
- package/lib/api/restful/sell/index.js +26 -27
- package/lib/api/restful/sell/inventory/index.d.ts +2 -2
- package/lib/api/restful/sell/inventory/index.js +2 -3
- package/lib/api/restful/sell/listing/index.d.ts +1 -1
- package/lib/api/restful/sell/listing/index.js +2 -3
- package/lib/api/restful/sell/logistics/index.d.ts +1 -1
- package/lib/api/restful/sell/logistics/index.js +2 -3
- package/lib/api/restful/sell/marketing/index.d.ts +2 -2
- package/lib/api/restful/sell/marketing/index.js +2 -3
- package/lib/api/restful/sell/metadata/index.d.ts +1 -1
- package/lib/api/restful/sell/metadata/index.js +2 -3
- package/lib/api/restful/sell/negotiation/index.d.ts +1 -1
- package/lib/api/restful/sell/negotiation/index.js +2 -3
- package/lib/api/restful/sell/recommendation/index.d.ts +2 -2
- package/lib/api/restful/sell/recommendation/index.js +2 -3
- package/lib/api/traditional/XMLRequest.d.ts +15 -11
- package/lib/api/traditional/XMLRequest.js +17 -33
- package/lib/api/traditional/clientAlerts/index.d.ts +1 -1
- package/lib/api/traditional/clientAlerts/index.js +2 -3
- package/lib/api/traditional/clientAlerts/types.js +0 -1
- package/lib/api/traditional/fields.d.ts +1 -1
- package/lib/api/traditional/fields.js +0 -1
- package/lib/api/traditional/finding/index.js +0 -1
- package/lib/api/traditional/index.d.ts +2 -2
- package/lib/api/traditional/index.js +26 -21
- package/lib/api/traditional/merchandising/index.js +0 -1
- package/lib/api/traditional/shopping/index.js +0 -1
- package/lib/api/traditional/trading/index.js +0 -1
- package/lib/auth/authNAuth.d.ts +4 -4
- package/lib/auth/authNAuth.js +12 -13
- package/lib/auth/index.d.ts +5 -5
- package/lib/auth/index.js +6 -7
- package/lib/auth/oAuth2.d.ts +11 -6
- package/lib/auth/oAuth2.js +11 -7
- package/lib/eBayApi.d.ts +58 -0
- package/lib/eBayApi.js +130 -0
- package/lib/ebay-api.min.js +1 -2
- package/lib/enums/apiEnums.js +0 -1
- package/lib/enums/index.d.ts +2 -2
- package/lib/enums/index.js +7 -4
- package/lib/enums/restfulEnums.js +0 -1
- package/lib/errors/index.js +0 -1
- package/lib/index.d.ts +1 -55
- package/lib/index.js +2 -92
- package/lib/nanoevents.d.ts +6 -0
- package/lib/nanoevents.js +24 -0
- package/lib/package.json +3 -0
- package/lib/request.d.ts +6 -6
- package/lib/request.js +2 -3
- package/lib/types/apiTypes.d.ts +10 -10
- package/lib/types/apiTypes.js +0 -1
- package/lib/types/index.d.ts +3 -3
- package/lib/types/index.js +8 -5
- package/lib/types/restfulTypes.d.ts +191 -191
- package/lib/types/restfulTypes.js +0 -1
- package/lib/types/traditonalTypes.d.ts +15 -15
- package/lib/types/traditonalTypes.js +0 -1
- package/package.json +98 -33
- package/lib/api/apiFactory.js.map +0 -1
- package/lib/api/base.js.map +0 -1
- package/lib/api/index.js.map +0 -1
- package/lib/api/restful/buy/browse/index.js.map +0 -1
- package/lib/api/restful/buy/deal/index.js.map +0 -1
- package/lib/api/restful/buy/feed/index.js.map +0 -1
- package/lib/api/restful/buy/index.js.map +0 -1
- package/lib/api/restful/buy/marketing/index.js.map +0 -1
- package/lib/api/restful/buy/marketplaceInsights/index.js.map +0 -1
- package/lib/api/restful/buy/offer/index.js.map +0 -1
- package/lib/api/restful/buy/order/index.js.map +0 -1
- package/lib/api/restful/commerce/catalog/index.js.map +0 -1
- package/lib/api/restful/commerce/charity/index.js.map +0 -1
- package/lib/api/restful/commerce/identity/index.js.map +0 -1
- package/lib/api/restful/commerce/index.js.map +0 -1
- package/lib/api/restful/commerce/notification/index.js.map +0 -1
- package/lib/api/restful/commerce/taxonomy/index.js.map +0 -1
- package/lib/api/restful/commerce/translation/index.js.map +0 -1
- package/lib/api/restful/developer/analytics/index.js.map +0 -1
- package/lib/api/restful/developer/index.js.map +0 -1
- package/lib/api/restful/developer/keyManagement/index.js.map +0 -1
- package/lib/api/restful/index.js.map +0 -1
- package/lib/api/restful/postOrder/cancellation/index.js.map +0 -1
- package/lib/api/restful/postOrder/case/index.js.map +0 -1
- package/lib/api/restful/postOrder/index.js.map +0 -1
- package/lib/api/restful/postOrder/inquiry/index.js.map +0 -1
- package/lib/api/restful/postOrder/return/index.js.map +0 -1
- package/lib/api/restful/sell/account/index.js.map +0 -1
- package/lib/api/restful/sell/analytics/index.js.map +0 -1
- package/lib/api/restful/sell/compliance/index.js.map +0 -1
- package/lib/api/restful/sell/feed/index.js.map +0 -1
- package/lib/api/restful/sell/finances/index.js.map +0 -1
- package/lib/api/restful/sell/fulfillment/index.js.map +0 -1
- package/lib/api/restful/sell/index.js.map +0 -1
- package/lib/api/restful/sell/inventory/index.js.map +0 -1
- package/lib/api/restful/sell/listing/index.js.map +0 -1
- package/lib/api/restful/sell/logistics/index.js.map +0 -1
- package/lib/api/restful/sell/marketing/index.js.map +0 -1
- package/lib/api/restful/sell/metadata/index.js.map +0 -1
- package/lib/api/restful/sell/negotiation/index.js.map +0 -1
- package/lib/api/restful/sell/recommendation/index.js.map +0 -1
- package/lib/api/traditional/XMLRequest.js.map +0 -1
- package/lib/api/traditional/clientAlerts/index.js.map +0 -1
- package/lib/api/traditional/clientAlerts/types.js.map +0 -1
- package/lib/api/traditional/fields.js.map +0 -1
- package/lib/api/traditional/finding/index.js.map +0 -1
- package/lib/api/traditional/index.js.map +0 -1
- package/lib/api/traditional/merchandising/index.js.map +0 -1
- package/lib/api/traditional/shopping/index.js.map +0 -1
- package/lib/api/traditional/trading/index.js.map +0 -1
- package/lib/auth/authNAuth.js.map +0 -1
- package/lib/auth/index.js.map +0 -1
- package/lib/auth/oAuth2.js.map +0 -1
- package/lib/ebay-api.min.js.map +0 -1
- package/lib/enums/apiEnums.js.map +0 -1
- package/lib/enums/index.js.map +0 -1
- package/lib/enums/restfulEnums.js.map +0 -1
- package/lib/errors/index.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/request.js.map +0 -1
- package/lib/types/apiTypes.js.map +0 -1
- package/lib/types/index.js.map +0 -1
- package/lib/types/restfulTypes.js.map +0 -1
- package/lib/types/traditonalTypes.js.map +0 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ It supports `client credentials grant` and `authorization code grant` \(Auth'N'A
|
|
|
20
20
|
|
|
21
21
|
## Changelog
|
|
22
22
|
|
|
23
|
-
* `
|
|
23
|
+
* `v8.0.0-RC.0` is the latest release.
|
|
24
24
|
* See [here](https://github.com/hendt/ebay-api/blob/master/CHANGELOG.md) for the full changelog.
|
|
25
25
|
|
|
26
26
|
## Implementation status
|
|
@@ -76,6 +76,7 @@ console.log(JSON.stringify(item, null, 2));
|
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
#### Detailed configuration example
|
|
79
|
+
|
|
79
80
|
```javascript
|
|
80
81
|
import eBayApi from 'ebay-api';
|
|
81
82
|
|
|
@@ -85,15 +86,15 @@ const eBay = new eBayApi({
|
|
|
85
86
|
sandbox: false,
|
|
86
87
|
|
|
87
88
|
siteId: eBayApi.SiteId.EBAY_US, // required for traditional APIs, see https://developer.ebay.com/DevZone/merchandising/docs/Concepts/SiteIDToGlobalID.html
|
|
88
|
-
|
|
89
|
-
marketplaceId:
|
|
89
|
+
|
|
90
|
+
marketplaceId: eBayApi.MarketplaceId.EBAY_US, // defautl. required for RESTful APIs
|
|
90
91
|
acceptLanguage: eBayApi.Locale.en_US, // defautl
|
|
91
92
|
contentLanguage: eBayApi.ContentLanguage.en_US, // defautl.
|
|
92
93
|
|
|
93
94
|
// optional parameters, should be omitted if not used
|
|
94
95
|
devId: '-- devId --', // required for traditional Trading API
|
|
95
96
|
ruName: '-- eBay Redirect URL name --', // 'RuName' (eBay Redirect URL name) required for authorization code grant
|
|
96
|
-
|
|
97
|
+
|
|
97
98
|
authToken: '-- Auth\'n\'Auth for traditional API (used by trading) --', // can be set to use traditional API without code grant
|
|
98
99
|
});
|
|
99
100
|
```
|
|
@@ -106,28 +107,28 @@ For testing purpose you can use `https://ebay.hendt.workers.dev/` url as proxy.
|
|
|
106
107
|
|
|
107
108
|
Or use [https://github.com/Rob--W/cors-anywhere](CORS Anywhere is a NodeJS proxy) (works very well with heroku.com).
|
|
108
109
|
|
|
109
|
-
|
|
110
110
|
```html
|
|
111
|
+
|
|
111
112
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ebay-api@latest/lib/ebay-api.min.js"></script>
|
|
112
113
|
<script>
|
|
113
114
|
const eBay = new eBayApi({
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
appId: 'appId',
|
|
116
|
+
certId: 'certId',
|
|
117
|
+
sandbox: false
|
|
118
|
+
});
|
|
118
119
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
// eBay.req.instance is AxiosInstance per default
|
|
121
|
+
eBay.req.instance.interceptors.request.use((request) => {
|
|
122
|
+
// Add Proxy
|
|
123
|
+
request.url = 'https://ebay.hendt.workers.dev/' + request.url;
|
|
124
|
+
return request;
|
|
125
|
+
});
|
|
125
126
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
eBay.buy.browse.getItem('v1|254188828753|0').then(item => {
|
|
128
|
+
console.log(JSON.stringify(item, null, 2));
|
|
129
|
+
}).catch(e => {
|
|
130
|
+
console.error(e);
|
|
131
|
+
});
|
|
131
132
|
</script>
|
|
132
133
|
```
|
|
133
134
|
|
|
@@ -237,7 +238,7 @@ app.get('/success', async function(req, res) {
|
|
|
237
238
|
// 5. Start using the API
|
|
238
239
|
const orders = await eBay.sell.fulfillment.getOrders()
|
|
239
240
|
res.send(orders);
|
|
240
|
-
} catch(e) {
|
|
241
|
+
} catch (e) {
|
|
241
242
|
console.error(e)
|
|
242
243
|
res.sendStatus(400)
|
|
243
244
|
}
|
|
@@ -258,17 +259,17 @@ app.get('/orders/:id', async function(req, res) {
|
|
|
258
259
|
}
|
|
259
260
|
|
|
260
261
|
eBay.OAuth2.setCredentials(token);
|
|
261
|
-
|
|
262
|
+
|
|
262
263
|
// If token get's refreshed
|
|
263
264
|
eBay.OAuth2.on('refreshAuthToken', (token) => {
|
|
264
265
|
req.session.token = token;
|
|
265
266
|
});
|
|
266
|
-
|
|
267
|
+
|
|
267
268
|
try {
|
|
268
269
|
// 5. Start using the API
|
|
269
270
|
const order = await eBay.sell.fulfillment.getOrder(id);
|
|
270
271
|
res.send(order);
|
|
271
|
-
} catch(e) {
|
|
272
|
+
} catch (e) {
|
|
272
273
|
console.error(e)
|
|
273
274
|
res.sendStatus(400)
|
|
274
275
|
}
|
|
@@ -342,14 +343,17 @@ You have multiple options to do this.
|
|
|
342
343
|
|
|
343
344
|
|
|
344
345
|
### RESTful API headers
|
|
346
|
+
|
|
345
347
|
```javascript
|
|
346
348
|
const eBay = new eBayApi();
|
|
347
349
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
350
|
+
eBay.buy.browse.api({
|
|
351
|
+
headers: {
|
|
352
|
+
'X-EBAY-SOA-GLOBAL-ID': 'EBAY-DE'
|
|
353
|
+
}
|
|
354
|
+
}).getItem('v1|382282567190|651094235351').then((item) => {
|
|
355
|
+
console.log(item)
|
|
356
|
+
})
|
|
353
357
|
```
|
|
354
358
|
|
|
355
359
|
### Traditional API headers
|
|
@@ -370,15 +374,17 @@ eBay.trading.AddFixedPriceItem({
|
|
|
370
374
|
```
|
|
371
375
|
|
|
372
376
|
### Low level: use the Axios interceptor to manipulate the request
|
|
377
|
+
|
|
373
378
|
```javascript
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
379
|
+
import eBayApi from 'ebay-api';
|
|
380
|
+
|
|
381
|
+
const eBay = new eBayApi(/* { your config here } */);
|
|
382
|
+
|
|
383
|
+
eBay.req.instance.interceptors.request.use((request) => {
|
|
384
|
+
// Add Header
|
|
385
|
+
request.headers['X-EBAY-SOA-GLOBAL-ID'] = 'EBAY-DE';
|
|
386
|
+
return request;
|
|
387
|
+
})
|
|
382
388
|
```
|
|
383
389
|
|
|
384
390
|
### Handle JSON GZIP response e.g fetchItemAspects
|
|
@@ -389,26 +395,26 @@ npm install zlib # or yarn add zlib
|
|
|
389
395
|
```
|
|
390
396
|
|
|
391
397
|
```javascript
|
|
392
|
-
|
|
393
|
-
|
|
398
|
+
import eBayApi from 'ebay-api';
|
|
399
|
+
import zlib from 'zlib';
|
|
394
400
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
});
|
|
401
|
+
const toString = (data) => new Promise((resolve) => {
|
|
402
|
+
zlib.gunzip(data, (err, output) => {
|
|
403
|
+
if (err) throw err;
|
|
404
|
+
resolve(output.toString());
|
|
400
405
|
});
|
|
406
|
+
});
|
|
401
407
|
|
|
402
|
-
|
|
408
|
+
const eBay = new eBayApi(/* { your config here } */);
|
|
403
409
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
410
|
+
try {
|
|
411
|
+
const data = await eBay.commerce.taxonomy.fetchItemAspects(/* categoryTreeId */);
|
|
412
|
+
const result = await toString(data);
|
|
413
|
+
|
|
414
|
+
console.log(result)
|
|
415
|
+
} catch (e) {
|
|
416
|
+
console.error(e);
|
|
417
|
+
}
|
|
412
418
|
```
|
|
413
419
|
|
|
414
420
|
## Controlling Traditional XML request and response
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ClientAlerts, Finding, Shopping, Trading, Merchandising } from '../types/index.js';
|
|
2
|
+
import Api from './index.js';
|
|
3
|
+
import { Buy } from './restful/buy/index.js';
|
|
4
|
+
import { Commerce } from './restful/commerce/index.js';
|
|
5
|
+
import { Developer } from './restful/developer/index.js';
|
|
6
|
+
import { PostOrder } from './restful/postOrder/index.js';
|
|
7
|
+
import { Sell } from './restful/sell/index.js';
|
|
8
|
+
import Traditional from './traditional/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Factory class to create RESTFul API or Traditional API.
|
|
11
|
+
*/
|
|
12
|
+
export default class ApiFactory extends Api {
|
|
13
|
+
private _traditional?;
|
|
14
|
+
private _restful;
|
|
15
|
+
createBuyApi(): Buy;
|
|
16
|
+
createCommerceApi(): Commerce;
|
|
17
|
+
createDeveloperApi(): Developer;
|
|
18
|
+
createPostOrderApi(): PostOrder;
|
|
19
|
+
createSellApi(): Sell;
|
|
20
|
+
get traditional(): Traditional;
|
|
21
|
+
createTradingApi(): Trading;
|
|
22
|
+
createShoppingApi(): Shopping;
|
|
23
|
+
createFindingApi(): Finding;
|
|
24
|
+
createClientAlertsApi(): ClientAlerts;
|
|
25
|
+
createMerchandisingApi(): Merchandising;
|
|
26
|
+
private createRestfulApi;
|
|
27
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import Api from './index.js';
|
|
2
|
+
import { Browse, Deal, Feed, Marketing as BuyMarketing, MarketplaceInsights, Offer, Order } from './restful/buy/index.js';
|
|
3
|
+
import { Catalog, Charity, Identity, Notification, Taxonomy, Translation } from './restful/commerce/index.js';
|
|
4
|
+
import { Analytics as DeveloperAnalytics, KeyManagement } from './restful/developer/index.js';
|
|
5
|
+
import { Cancellation, Case, Inquiry, Return, } from './restful/postOrder/index.js';
|
|
6
|
+
import { Account, Analytics as SellAnalytics, Compliance, Feed as SellFeed, Finances, Fulfillment, Inventory, Listing, Logistics, Marketing as SellMarketing, Metadata, Negotiation, Recommendation } from './restful/sell/index.js';
|
|
7
|
+
import Traditional from './traditional/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Factory class to create RESTFul API or Traditional API.
|
|
10
|
+
*/
|
|
11
|
+
export default class ApiFactory extends Api {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this._restful = {};
|
|
15
|
+
}
|
|
16
|
+
createBuyApi() {
|
|
17
|
+
return {
|
|
18
|
+
browse: this.createRestfulApi(Browse),
|
|
19
|
+
feed: this.createRestfulApi(Feed),
|
|
20
|
+
marketing: this.createRestfulApi(BuyMarketing),
|
|
21
|
+
offer: this.createRestfulApi(Offer),
|
|
22
|
+
order: this.createRestfulApi(Order),
|
|
23
|
+
deal: this.createRestfulApi(Deal),
|
|
24
|
+
marketplaceInsights: this.createRestfulApi(MarketplaceInsights),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
createCommerceApi() {
|
|
28
|
+
return {
|
|
29
|
+
catalog: this.createRestfulApi(Catalog),
|
|
30
|
+
identity: this.createRestfulApi(Identity),
|
|
31
|
+
taxonomy: this.createRestfulApi(Taxonomy),
|
|
32
|
+
translation: this.createRestfulApi(Translation),
|
|
33
|
+
charity: this.createRestfulApi(Charity),
|
|
34
|
+
notification: this.createRestfulApi(Notification),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
createDeveloperApi() {
|
|
38
|
+
return {
|
|
39
|
+
analytics: this.createRestfulApi(DeveloperAnalytics),
|
|
40
|
+
keyManagement: this.createRestfulApi(KeyManagement),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
createPostOrderApi() {
|
|
44
|
+
return {
|
|
45
|
+
cancellation: this.createRestfulApi(Cancellation),
|
|
46
|
+
case: this.createRestfulApi(Case),
|
|
47
|
+
inquiry: this.createRestfulApi(Inquiry),
|
|
48
|
+
return: this.createRestfulApi(Return),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
createSellApi() {
|
|
52
|
+
return {
|
|
53
|
+
account: this.createRestfulApi(Account),
|
|
54
|
+
analytics: this.createRestfulApi(SellAnalytics),
|
|
55
|
+
compliance: this.createRestfulApi(Compliance),
|
|
56
|
+
fulfillment: this.createRestfulApi(Fulfillment),
|
|
57
|
+
inventory: this.createRestfulApi(Inventory),
|
|
58
|
+
marketing: this.createRestfulApi(SellMarketing),
|
|
59
|
+
metadata: this.createRestfulApi(Metadata),
|
|
60
|
+
recommendation: this.createRestfulApi(Recommendation),
|
|
61
|
+
finances: this.createRestfulApi(Finances),
|
|
62
|
+
feed: this.createRestfulApi(SellFeed),
|
|
63
|
+
logistics: this.createRestfulApi(Logistics),
|
|
64
|
+
negotiation: this.createRestfulApi(Negotiation),
|
|
65
|
+
listing: this.createRestfulApi(Listing),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
get traditional() {
|
|
69
|
+
if (this._traditional) {
|
|
70
|
+
return this._traditional;
|
|
71
|
+
}
|
|
72
|
+
return (this._traditional = new Traditional(this.config, this.req, this.auth));
|
|
73
|
+
}
|
|
74
|
+
createTradingApi() {
|
|
75
|
+
return this.traditional.createTradingApi();
|
|
76
|
+
}
|
|
77
|
+
createShoppingApi() {
|
|
78
|
+
return this.traditional.createShoppingApi();
|
|
79
|
+
}
|
|
80
|
+
createFindingApi() {
|
|
81
|
+
return this.traditional.createFindingApi();
|
|
82
|
+
}
|
|
83
|
+
createClientAlertsApi() {
|
|
84
|
+
return this.traditional.createClientAlertsApi();
|
|
85
|
+
}
|
|
86
|
+
createMerchandisingApi() {
|
|
87
|
+
return this.traditional.createMerchandisingApi();
|
|
88
|
+
}
|
|
89
|
+
// tslint:disable-next-line:variable-name
|
|
90
|
+
createRestfulApi(RestfulApiClass) {
|
|
91
|
+
const id = RestfulApiClass.id;
|
|
92
|
+
return (this._restful[id] || (this._restful[id] = new RestfulApiClass(this.config, this.req, this.auth)));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IEBayApiRequest } from '../request.js';
|
|
2
|
+
import { AppConfig } from '../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Abstract superclass.
|
|
5
|
+
*/
|
|
6
|
+
export default abstract class Base {
|
|
7
|
+
readonly config: AppConfig;
|
|
8
|
+
readonly req: IEBayApiRequest;
|
|
9
|
+
protected constructor(config: AppConfig, req?: IEBayApiRequest);
|
|
10
|
+
}
|
package/dist/api/base.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Auth from '../auth/index.js';
|
|
2
|
+
import { IEBayApiRequest } from '../request.js';
|
|
3
|
+
import { AppConfig } from '../types/index.js';
|
|
4
|
+
import Base from './base.js';
|
|
5
|
+
/**
|
|
6
|
+
* Superclass with Auth container.
|
|
7
|
+
*/
|
|
8
|
+
export default abstract class Api extends Base {
|
|
9
|
+
readonly auth: Auth;
|
|
10
|
+
constructor(config: AppConfig, req?: IEBayApiRequest, auth?: Auth);
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Auth from '../auth/index.js';
|
|
2
|
+
import Base from './base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Superclass with Auth container.
|
|
5
|
+
*/
|
|
6
|
+
export default class Api extends Base {
|
|
7
|
+
constructor(config, req, auth) {
|
|
8
|
+
super(config, req);
|
|
9
|
+
this.auth = auth || new Auth(this.config, this.req);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import Restful from '../../index.js';
|
|
2
|
+
import { AddCartItemInput, BrowseSearchParams, CompatibilityPayload, ItemsParams, LegacyItemParams, RemoveCartItemInput, SearchByImageParams, UpdateCartItemInput } from '../../../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* The Browse API has the following resources: item_summary: Lets shoppers search for specific items by keyword, GTIN,
|
|
5
|
+
* category, charity, product, or item aspects and refine the results by using filters, such as aspects, compatibility,
|
|
6
|
+
* and fields values.
|
|
7
|
+
*/
|
|
8
|
+
export default class Browse extends Restful {
|
|
9
|
+
static id: string;
|
|
10
|
+
get basePath(): string;
|
|
11
|
+
/**
|
|
12
|
+
* This method searches for eBay items by various query parameters and retrieves summaries of the items.
|
|
13
|
+
*
|
|
14
|
+
* @param {BrowseSearchParams} params
|
|
15
|
+
*/
|
|
16
|
+
search(params: BrowseSearchParams): Promise<any>;
|
|
17
|
+
/**
|
|
18
|
+
* This is an Experimental method. This method searches for eBay items based on a image and retrieves summaries of
|
|
19
|
+
* the items.
|
|
20
|
+
*
|
|
21
|
+
* @param {BrowseSearchParams} params
|
|
22
|
+
* @param {Object} body The container for the image information fields.
|
|
23
|
+
*/
|
|
24
|
+
searchByImage(params: SearchByImageParams, body?: {}): Promise<any>;
|
|
25
|
+
/**
|
|
26
|
+
* This method retrieves the details of specific items that the buyer needs to make a purchasing decision.
|
|
27
|
+
*
|
|
28
|
+
* @param itemIds A list of item IDs. Item IDs are the eBay RESTful identifier of items.
|
|
29
|
+
* @param itemGroupIds A list of item group IDs.
|
|
30
|
+
*/
|
|
31
|
+
getItems({ itemIds: item_ids, itemGroupIds: item_group_ids }: ItemsParams): Promise<any>;
|
|
32
|
+
/**
|
|
33
|
+
* This method retrieves the details of a specific item, such as description, price, category, all item aspects,
|
|
34
|
+
* condition, return policies, seller feedback and score, shipping options, shipping costs, estimated delivery,
|
|
35
|
+
* and other information the buyer needs to make a purchasing decision.
|
|
36
|
+
*
|
|
37
|
+
* @param {String} itemId The eBay RESTful identifier of an item.
|
|
38
|
+
* @param {String} fieldgroups
|
|
39
|
+
*/
|
|
40
|
+
getItem(itemId: string, fieldgroups?: string): Promise<any>;
|
|
41
|
+
/**
|
|
42
|
+
* This method is a bridge between the eBay legacy APIs, such as Shopping, and Finding and the eBay Api APIs.
|
|
43
|
+
*
|
|
44
|
+
* @param {LegacyItemParams} params
|
|
45
|
+
*/
|
|
46
|
+
getItemByLegacyId(params: LegacyItemParams): Promise<any>;
|
|
47
|
+
/**
|
|
48
|
+
* This method retrieves the details of the individual items in an item group.
|
|
49
|
+
*
|
|
50
|
+
* @param itemGroupId
|
|
51
|
+
*/
|
|
52
|
+
getItemsByItemGroup(itemGroupId: string): Promise<any>;
|
|
53
|
+
/**
|
|
54
|
+
* This method checks if a product is compatible with the specified item.
|
|
55
|
+
* @param {String} itemId The eBay RESTful identifier of an item (such as a part you want to check).
|
|
56
|
+
* @param {Object} body CompatibilityPayload
|
|
57
|
+
*/
|
|
58
|
+
checkCompatibility(itemId: string, body?: CompatibilityPayload): Promise<any>;
|
|
59
|
+
/**
|
|
60
|
+
* This is an Experimental method. This method creates an eBay cart for the eBay member, if one does not exist, and
|
|
61
|
+
* adds items to that cart.
|
|
62
|
+
*
|
|
63
|
+
* @param {Object} item AddCartItemInput
|
|
64
|
+
*/
|
|
65
|
+
addItem(item: AddCartItemInput): Promise<any>;
|
|
66
|
+
/**
|
|
67
|
+
* This is an experimental method. This method retrieves all the items in the eBay member's cart;
|
|
68
|
+
* items added to the cart while on ebay.com as well as items added to the cart using the Browse API.
|
|
69
|
+
*/
|
|
70
|
+
getShoppingCart(): Promise<any>;
|
|
71
|
+
/**
|
|
72
|
+
* This is an experimental method. This method removes a specific item from the eBay member's cart.
|
|
73
|
+
*
|
|
74
|
+
* @param {Object} item RemoveCartItemInput
|
|
75
|
+
*/
|
|
76
|
+
removeItem(item: RemoveCartItemInput): Promise<any>;
|
|
77
|
+
/**
|
|
78
|
+
* This is an experimental method. This method updates the quantity value of a specific item in the eBay member's
|
|
79
|
+
* cart.
|
|
80
|
+
*
|
|
81
|
+
* @param {UpdateCartItemInput} item UpdateCartItemInput
|
|
82
|
+
*/
|
|
83
|
+
updateQuantity(item: UpdateCartItemInput): Promise<any>;
|
|
84
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import Restful from '../../index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The Browse API has the following resources: item_summary: Lets shoppers search for specific items by keyword, GTIN,
|
|
4
|
+
* category, charity, product, or item aspects and refine the results by using filters, such as aspects, compatibility,
|
|
5
|
+
* and fields values.
|
|
6
|
+
*/
|
|
7
|
+
export default class Browse extends Restful {
|
|
8
|
+
get basePath() {
|
|
9
|
+
return '/buy/browse/v1';
|
|
10
|
+
}
|
|
11
|
+
//
|
|
12
|
+
// Item
|
|
13
|
+
// Client Credentials: https://api.ebay.com/oauth/api_scope
|
|
14
|
+
//
|
|
15
|
+
/**
|
|
16
|
+
* This method searches for eBay items by various query parameters and retrieves summaries of the items.
|
|
17
|
+
*
|
|
18
|
+
* @param {BrowseSearchParams} params
|
|
19
|
+
*/
|
|
20
|
+
search(params) {
|
|
21
|
+
return this.get(`/item_summary/search`, {
|
|
22
|
+
params
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* This is an Experimental method. This method searches for eBay items based on a image and retrieves summaries of
|
|
27
|
+
* the items.
|
|
28
|
+
*
|
|
29
|
+
* @param {BrowseSearchParams} params
|
|
30
|
+
* @param {Object} body The container for the image information fields.
|
|
31
|
+
*/
|
|
32
|
+
searchByImage(params, body = {}) {
|
|
33
|
+
return this.post(`/item_summary/search_by_image`, body, {
|
|
34
|
+
params
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* This method retrieves the details of specific items that the buyer needs to make a purchasing decision.
|
|
39
|
+
*
|
|
40
|
+
* @param itemIds A list of item IDs. Item IDs are the eBay RESTful identifier of items.
|
|
41
|
+
* @param itemGroupIds A list of item group IDs.
|
|
42
|
+
*/
|
|
43
|
+
getItems({ itemIds: item_ids, itemGroupIds: item_group_ids }) {
|
|
44
|
+
return this.get(`/item/`, {
|
|
45
|
+
params: {
|
|
46
|
+
item_ids,
|
|
47
|
+
item_group_ids
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* This method retrieves the details of a specific item, such as description, price, category, all item aspects,
|
|
53
|
+
* condition, return policies, seller feedback and score, shipping options, shipping costs, estimated delivery,
|
|
54
|
+
* and other information the buyer needs to make a purchasing decision.
|
|
55
|
+
*
|
|
56
|
+
* @param {String} itemId The eBay RESTful identifier of an item.
|
|
57
|
+
* @param {String} fieldgroups
|
|
58
|
+
*/
|
|
59
|
+
getItem(itemId, fieldgroups) {
|
|
60
|
+
const id = encodeURIComponent(itemId);
|
|
61
|
+
return this.get(`/item/${id}`, {
|
|
62
|
+
params: {
|
|
63
|
+
fieldgroups
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* This method is a bridge between the eBay legacy APIs, such as Shopping, and Finding and the eBay Api APIs.
|
|
69
|
+
*
|
|
70
|
+
* @param {LegacyItemParams} params
|
|
71
|
+
*/
|
|
72
|
+
getItemByLegacyId(params) {
|
|
73
|
+
return this.get(`/item/get_item_by_legacy_id`, {
|
|
74
|
+
params
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* This method retrieves the details of the individual items in an item group.
|
|
79
|
+
*
|
|
80
|
+
* @param itemGroupId
|
|
81
|
+
*/
|
|
82
|
+
getItemsByItemGroup(itemGroupId) {
|
|
83
|
+
return this.get(`/item/get_items_by_item_group`, {
|
|
84
|
+
params: {
|
|
85
|
+
item_group_id: itemGroupId
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* This method checks if a product is compatible with the specified item.
|
|
91
|
+
* @param {String} itemId The eBay RESTful identifier of an item (such as a part you want to check).
|
|
92
|
+
* @param {Object} body CompatibilityPayload
|
|
93
|
+
*/
|
|
94
|
+
checkCompatibility(itemId, body) {
|
|
95
|
+
const id = encodeURIComponent(itemId);
|
|
96
|
+
return this.post(`/item/${id}/check_compatibility`, body);
|
|
97
|
+
}
|
|
98
|
+
//
|
|
99
|
+
// Shopping Cart
|
|
100
|
+
//
|
|
101
|
+
/**
|
|
102
|
+
* This is an Experimental method. This method creates an eBay cart for the eBay member, if one does not exist, and
|
|
103
|
+
* adds items to that cart.
|
|
104
|
+
*
|
|
105
|
+
* @param {Object} item AddCartItemInput
|
|
106
|
+
*/
|
|
107
|
+
addItem(item) {
|
|
108
|
+
return this.post(`/shopping_cart/add_item`, item);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* This is an experimental method. This method retrieves all the items in the eBay member's cart;
|
|
112
|
+
* items added to the cart while on ebay.com as well as items added to the cart using the Browse API.
|
|
113
|
+
*/
|
|
114
|
+
getShoppingCart() {
|
|
115
|
+
return this.get(`/shopping_cart/`);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* This is an experimental method. This method removes a specific item from the eBay member's cart.
|
|
119
|
+
*
|
|
120
|
+
* @param {Object} item RemoveCartItemInput
|
|
121
|
+
*/
|
|
122
|
+
removeItem(item) {
|
|
123
|
+
return this.post(`/shopping_cart/remove_item`, item);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* This is an experimental method. This method updates the quantity value of a specific item in the eBay member's
|
|
127
|
+
* cart.
|
|
128
|
+
*
|
|
129
|
+
* @param {UpdateCartItemInput} item UpdateCartItemInput
|
|
130
|
+
*/
|
|
131
|
+
updateQuantity(item) {
|
|
132
|
+
return this.post(`/shopping_cart/update_quantity`, item);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
Browse.id = 'Browse';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import Restful from '../../index.js';
|
|
2
|
+
/**
|
|
3
|
+
* This API allows third-party developers to search for and retrieve details about eBay deals and events, as well as the items associated with those deals and events.
|
|
4
|
+
*/
|
|
5
|
+
export default class Deal extends Restful {
|
|
6
|
+
static id: string;
|
|
7
|
+
get basePath(): string;
|
|
8
|
+
/**
|
|
9
|
+
* This method retrieves a paginated set of deal items.
|
|
10
|
+
*
|
|
11
|
+
* @param categoryIds The unique identifier of the eBay category for the search.
|
|
12
|
+
* @param commissionable A filter for commissionable deals. Restriction: This filter is currently only supported for the US marketplace.
|
|
13
|
+
* @param deliveryCountry A filter for items that can be shipped to the specified country.
|
|
14
|
+
* @param limit The maximum number of items, from the current result set, returned on a single page.
|
|
15
|
+
* @param offset The number of items that will be skipped in the result set.
|
|
16
|
+
*/
|
|
17
|
+
getDealItems({ categoryIds, commissionable, deliveryCountry, limit, offset }: {
|
|
18
|
+
categoryIds?: string;
|
|
19
|
+
commissionable?: string;
|
|
20
|
+
deliveryCountry?: string;
|
|
21
|
+
limit?: string;
|
|
22
|
+
offset?: string;
|
|
23
|
+
}): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* This method retrieves the details for an eBay event.
|
|
26
|
+
*
|
|
27
|
+
* @param eventId The unique identifier for the eBay event.
|
|
28
|
+
*/
|
|
29
|
+
getEvent(eventId: string): Promise<any>;
|
|
30
|
+
/**
|
|
31
|
+
* This method returns paginated results containing all eBay events for the specified marketplace.
|
|
32
|
+
*
|
|
33
|
+
* @param limit The maximum number of items, from the current result set, returned on a single page. Default: 20 Maximum Value: 100
|
|
34
|
+
* @param offset The number of items that will be skipped in the result set.
|
|
35
|
+
*/
|
|
36
|
+
getEvents({ limit, offset }: {
|
|
37
|
+
limit?: string;
|
|
38
|
+
offset?: string;
|
|
39
|
+
}): Promise<any>;
|
|
40
|
+
/**
|
|
41
|
+
* This method returns paginated results containing all eBay events for the specified marketplace.
|
|
42
|
+
*
|
|
43
|
+
* @param eventIds The unique identifiers for the eBay events. Maximum Value: 1
|
|
44
|
+
* @param categoryIds The unique identifier of the eBay category for the search. Maximum Value: 1
|
|
45
|
+
* @param deliveryCountry A filter for items that can be shipped to the specified country.
|
|
46
|
+
* @param limit The maximum number of items, from the current result set, returned on a single page. Default: 20 Maximum Value: 100
|
|
47
|
+
* @param offset The number of items that will be skipped in the result set.
|
|
48
|
+
*/
|
|
49
|
+
getEventItems(eventIds: string, { categoryIds, deliveryCountry, limit, offset }?: {
|
|
50
|
+
categoryIds?: string;
|
|
51
|
+
deliveryCountry?: string;
|
|
52
|
+
limit?: string;
|
|
53
|
+
offset?: string;
|
|
54
|
+
}): Promise<any>;
|
|
55
|
+
}
|