ebay-mcp 1.13.2 → 1.14.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.de.md +3 -3
- package/README.es.md +3 -3
- package/README.fr.md +3 -3
- package/README.ja.md +3 -3
- package/README.ko.md +3 -3
- package/README.md +163 -41
- package/README.pt-BR.md +3 -3
- package/README.ru.md +3 -3
- package/README.zh-CN.md +3 -3
- package/build/api/account-management/account.js +633 -297
- package/build/api/analytics-and-report/analytics.js +111 -65
- package/build/api/client.js +199 -140
- package/build/api/clientRequestError.js +23 -0
- package/build/api/clientTrading.js +213 -0
- package/build/api/clientTradingError.js +4 -0
- package/build/api/communication/feedback.js +147 -59
- package/build/api/communication/message.js +134 -81
- package/build/api/communication/negotiation.js +65 -53
- package/build/api/communication/notification.js +458 -164
- package/build/api/developer/developer.js +99 -45
- package/build/api/index.js +23 -8
- package/build/api/listing-management/inventory.js +884 -338
- package/build/api/listing-metadata/metadata.js +416 -170
- package/build/api/listing-metadata/taxonomy.js +187 -42
- package/build/api/marketing-and-promotions/marketing.js +1392 -598
- package/build/api/marketing-and-promotions/recommendation.js +49 -24
- package/build/api/order-management/dispute.js +226 -45
- package/build/api/order-management/fulfillment.js +144 -71
- package/build/api/order-management/orderIssueHelpers.js +61 -0
- package/build/api/other/compliance.js +50 -38
- package/build/api/other/edelivery.js +603 -159
- package/build/api/other/finding.js +280 -0
- package/build/api/other/identity.js +30 -15
- package/build/api/other/translation.js +29 -14
- package/build/api/other/vero.js +113 -27
- package/build/api/rateLimitTracker.js +55 -0
- package/build/api/shared/request.js +189 -98
- package/build/api/trading/trading.js +154 -87
- package/build/auth/credentialSession.js +250 -0
- package/build/auth/oauth.js +298 -171
- package/build/auth/{oauth-metadata.js → oauthMetadata.js} +22 -6
- package/build/auth/oauthMiddleware.js +104 -0
- package/build/auth/{scope-utils.js → scopeUtils.js} +101 -28
- package/build/auth/tokenVerifier.js +243 -0
- package/build/auth/tokenVerifierError.js +21 -0
- package/build/config/environment.js +148 -113
- package/build/config/{tool-families.js → toolFamilies.js} +30 -14
- package/build/index.js +25 -19
- package/build/mcp/{http-transport.js → httpTransport.js} +102 -52
- package/build/mcp/readOnlyFilter.js +67 -0
- package/build/mcp/runtime.js +31 -13
- package/build/mcp/{tool-gating.js → toolGating.js} +77 -49
- package/build/mcp/{ui-bridge.js → uiBridge.js} +80 -23
- package/build/schemas/account-management/account.js +144 -6
- package/build/schemas/analytics/analytics.js +33 -19
- package/build/schemas/communication/messages.js +12 -42
- package/build/schemas/developer/developer.js +135 -0
- package/build/schemas/fulfillment/orders.js +183 -21
- package/build/schemas/index.js +27 -19
- package/build/schemas/inventory-management/inventory.js +17 -9
- package/build/schemas/marketing/marketing.js +480 -25
- package/build/schemas/metadata/metadata.js +11 -6
- package/build/schemas/other/finding.js +27 -0
- package/build/schemas/other/otherApis.js +424 -0
- package/build/schemas/taxonomy/taxonomy.js +11 -5
- package/build/scripts/{auto-setup.js → autoSetup.js} +87 -74
- package/build/scripts/{build-ui.js → buildUi.js} +6 -1
- package/build/scripts/{dev-sync.js → devSync.js} +169 -110
- package/build/scripts/diagnostics.js +52 -44
- package/build/scripts/{download-specs.js → downloadSpecs.js} +29 -21
- package/build/scripts/{interactive-setup.js → interactiveSetup.js} +84 -78
- package/build/scripts/setup.js +241 -178
- package/build/scripts/{setup-shared.js → setupShared.js} +29 -7
- package/build/scripts/skills.js +35 -27
- package/build/scripts/updateApiStatusDoc.js +71 -0
- package/build/serverHttp.js +90 -0
- package/build/skills/content.js +124 -118
- package/build/skills/index.js +22 -10
- package/build/skills/install.js +21 -10
- package/build/skills/markers.js +50 -15
- package/build/skills/{registry-snapshot.js → registrySnapshot.js} +8 -2
- package/build/skills/render.js +41 -14
- package/build/skills/targets.js +49 -17
- package/build/tools/categories/account.js +166 -264
- package/build/tools/categories/analytics.js +11 -22
- package/build/tools/categories/browse.js +17 -0
- package/build/tools/categories/communication.js +124 -399
- package/build/tools/categories/connector.js +23 -20
- package/build/tools/categories/developer.js +46 -159
- package/build/tools/categories/fulfillment.js +84 -215
- package/build/tools/categories/index.js +6 -14
- package/build/tools/categories/inventory.js +238 -293
- package/build/tools/categories/marketing.js +677 -39
- package/build/tools/categories/metadata.js +190 -117
- package/build/tools/categories/other.js +81 -208
- package/build/tools/categories/taxonomy.js +29 -20
- package/build/tools/categories/{token-management.js → tokenManagement.js} +187 -192
- package/build/tools/categories/trading.js +16 -47
- package/build/tools/contracts.js +34 -24
- package/build/tools/{define-tool.js → defineTool.js} +44 -29
- package/build/tools/registry.js +87 -29
- package/build/tools/schemas.js +3 -57
- package/build/tools/ui/archetypes.js +1 -0
- package/build/tools/ui/{map-helpers.js → mapHelpers.js} +69 -19
- package/build/tools/ui/maps.js +294 -80
- package/build/types/index.js +1 -1
- package/build/ui/card.html +14 -14
- package/build/ui/chart.html +14 -14
- package/build/ui/stat.html +87 -0
- package/build/ui/table.html +14 -14
- package/build/utils/apiStatusFeed.js +95 -0
- package/build/utils/cliOutput.js +15 -0
- package/build/utils/cliUi.js +108 -0
- package/build/utils/communication/feedback.js +57 -77
- package/build/utils/communication/message.js +69 -98
- package/build/utils/communication/negotiation.js +30 -57
- package/build/utils/communication/notification.js +112 -252
- package/build/utils/{date-converter.js → dateConverter.js} +62 -30
- package/build/utils/effectSchema.js +203 -0
- package/build/utils/effectSchemaAdapter.js +121 -0
- package/build/utils/effectSchemaChainMethods.js +146 -0
- package/build/utils/effectSchemaRefinements.js +104 -0
- package/build/utils/effectSchemaStringMethods.js +63 -0
- package/build/utils/effectSchemaTypes.js +47 -0
- package/build/utils/{env-parser.js → envParser.js} +10 -2
- package/build/utils/errors.js +7 -3
- package/build/utils/http.js +148 -89
- package/build/utils/{llm-client-detector.js → llmClientDetector.js} +295 -274
- package/build/utils/logger.js +127 -51
- package/build/utils/{oauth-helper.js → oauthHelper.js} +127 -90
- package/build/utils/other/compliance.js +18 -38
- package/build/utils/other/identity.js +2 -2
- package/build/utils/other/translation.js +4 -4
- package/build/utils/other/vero.js +36 -20
- package/build/utils/schemaHelpers.js +22 -0
- package/build/utils/scopeHelper.js +270 -0
- package/build/utils/securityChecker.js +316 -0
- package/build/utils/{setup-validator.js → setupValidator.js} +113 -94
- package/build/utils/{setup-wizard.js → setupWizard.js} +57 -46
- package/build/utils/{token-utils.js → tokenUtils.js} +2 -2
- package/build/utils/trading/trading.js +35 -0
- package/build/utils/typeGuards.js +12 -0
- package/build/utils/version.js +65 -29
- package/package.json +10 -8
- package/build/api/client-trading.js +0 -124
- package/build/api/communication/shared.js +0 -59
- package/build/api/shared/query-params.js +0 -16
- package/build/auth/credential-session.js +0 -166
- package/build/auth/oauth-middleware.js +0 -100
- package/build/auth/token-verifier.js +0 -186
- package/build/schemas/other/other-apis.js +0 -390
- package/build/scripts/update-api-status-doc.js +0 -44
- package/build/server-http.js +0 -85
- package/build/tools/definitions/marketing.js +0 -1381
- package/build/tools/tool-handlers/marketing.js +0 -312
- package/build/utils/account-management/account.js +0 -818
- package/build/utils/api-status-feed.js +0 -84
- package/build/utils/cli-ui.js +0 -47
- package/build/utils/order-management/dispute.js +0 -369
- package/build/utils/order-management/fulfillment.js +0 -205
- package/build/utils/other/edelivery.js +0 -235
- package/build/utils/schema-helpers.js +0 -13
- package/build/utils/scope-helper.js +0 -207
- package/build/utils/security-checker.js +0 -248
- package/build/utils/type-guards.js +0 -6
- /package/build/auth/{oauth-types.js → oauthTypes.js} +0 -0
- /package/build/{server-http.d.ts → serverHttp.d.ts} +0 -0
- /package/build/tools/ui/{view-models.js → viewModels.js} +0 -0
- /package/build/types/{ebay-enums.js → ebayEnums.js} +0 -0
|
@@ -1,306 +1,642 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Based on: docs/sell-apps/account-management/sell_account_v1_oas3.json
|
|
5
|
-
*/
|
|
1
|
+
import { buildEndpointParams, requestDeleteEffect, requestGetEffect, requestPostEffect, requestPutEffect, } from '../../api/shared/request.js';
|
|
2
|
+
const ACCOUNT_BASE_PATH = '/sell/account/v1';
|
|
3
|
+
/** Account API client for seller account policies, programs, tax, and eligibility. */
|
|
6
4
|
export class AccountApi {
|
|
7
5
|
client;
|
|
8
|
-
basePath = '/sell/account/v1';
|
|
9
6
|
constructor(client) {
|
|
10
7
|
this.client = client;
|
|
11
8
|
}
|
|
12
9
|
/**
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*
|
|
36
|
-
* @param
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*
|
|
63
|
-
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
*
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
*
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
*
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
*
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
*
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
*
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
*
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
*
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
*
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
*
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
*
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
*
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
*
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
*
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
*
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
*
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
*
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
*
|
|
242
|
-
* @param
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
*
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
*
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
*
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
*
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
10
|
+
* Retrieves custom policies defined for the seller account.
|
|
11
|
+
*
|
|
12
|
+
* @param input - Optional custom policy type filter.
|
|
13
|
+
* @returns An Effect that succeeds with eBay's generated CustomPolicyResponse.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const policies = await Effect.runPromise(
|
|
18
|
+
* accountApi.getCustomPolicies({ policyTypes: 'TAKE_BACK' }),
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/custom_policy/methods/getCustomPolicies
|
|
23
|
+
*/
|
|
24
|
+
getCustomPolicies = (input = {}) => {
|
|
25
|
+
const params = buildEndpointParams({
|
|
26
|
+
policyTypes: { wireName: 'policy_types', value: input.policyTypes },
|
|
27
|
+
});
|
|
28
|
+
return requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/custom_policy/`, params);
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves one custom policy by ID.
|
|
32
|
+
*
|
|
33
|
+
* @param input - Custom policy identifier.
|
|
34
|
+
* @returns An Effect that succeeds with eBay's generated CustomPolicy.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const policy = await Effect.runPromise(
|
|
39
|
+
* accountApi.getCustomPolicy({ customPolicyId: '1234567890' }),
|
|
40
|
+
* );
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/custom_policy/methods/getCustomPolicy
|
|
44
|
+
*/
|
|
45
|
+
getCustomPolicy = (input) => requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/custom_policy/${input.customPolicyId}`);
|
|
46
|
+
/**
|
|
47
|
+
* Creates a custom policy.
|
|
48
|
+
*
|
|
49
|
+
* @param input - Custom policy request body.
|
|
50
|
+
* @returns An Effect that succeeds with eBay's generated CustomPolicy.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const policy = await Effect.runPromise(
|
|
55
|
+
* accountApi.createCustomPolicy({ policy: { name: 'Compliance', policyType: 'PRODUCT_COMPLIANCE' } }),
|
|
56
|
+
* );
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/custom_policy/methods/createCustomPolicy
|
|
60
|
+
*/
|
|
61
|
+
createCustomPolicy = (input) => requestPostEffect(this.client, `${ACCOUNT_BASE_PATH}/custom_policy/`, input.policy);
|
|
62
|
+
/**
|
|
63
|
+
* Updates a custom policy by ID.
|
|
64
|
+
*
|
|
65
|
+
* @param input - Custom policy ID and full replacement policy payload.
|
|
66
|
+
* @returns An Effect that succeeds when eBay accepts the update.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* await Effect.runPromise(
|
|
71
|
+
* accountApi.updateCustomPolicy({ customPolicyId: '1234567890', policy }),
|
|
72
|
+
* );
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/custom_policy/methods/updateCustomPolicy
|
|
76
|
+
*/
|
|
77
|
+
updateCustomPolicy = (input) => requestPutEffect(this.client, `${ACCOUNT_BASE_PATH}/custom_policy/${input.customPolicyId}`, input.policy);
|
|
78
|
+
/**
|
|
79
|
+
* Retrieves fulfillment policies for one marketplace.
|
|
80
|
+
*
|
|
81
|
+
* @param input - Marketplace ID used as the `marketplace_id` query parameter.
|
|
82
|
+
* @returns An Effect that succeeds with eBay's generated FulfillmentPolicyResponse.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const policies = await Effect.runPromise(
|
|
87
|
+
* accountApi.getFulfillmentPolicies({ marketplaceId: 'EBAY_US' }),
|
|
88
|
+
* );
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/fulfillment_policy/methods/getFulfillmentPolicies
|
|
92
|
+
*/
|
|
93
|
+
getFulfillmentPolicies = (input) => {
|
|
94
|
+
const params = buildEndpointParams({
|
|
95
|
+
marketplaceId: { wireName: 'marketplace_id', value: input.marketplaceId },
|
|
96
|
+
});
|
|
97
|
+
return requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/fulfillment_policy`, params);
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Creates a fulfillment policy.
|
|
101
|
+
*
|
|
102
|
+
* @param input - Fulfillment policy request body.
|
|
103
|
+
* @returns An Effect that succeeds with eBay's generated SetFulfillmentPolicyResponse.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* const created = await Effect.runPromise(
|
|
108
|
+
* accountApi.createFulfillmentPolicy({ policy }),
|
|
109
|
+
* );
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/fulfillment_policy/methods/createFulfillmentPolicy
|
|
113
|
+
*/
|
|
114
|
+
createFulfillmentPolicy = (input) => requestPostEffect(this.client, `${ACCOUNT_BASE_PATH}/fulfillment_policy/`, input.policy);
|
|
115
|
+
/**
|
|
116
|
+
* Retrieves one fulfillment policy by ID.
|
|
117
|
+
*
|
|
118
|
+
* @param input - Fulfillment policy identifier.
|
|
119
|
+
* @returns An Effect that succeeds with eBay's generated FulfillmentPolicy.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const policy = await Effect.runPromise(
|
|
124
|
+
* accountApi.getFulfillmentPolicy({ fulfillmentPolicyId: 'FP123' }),
|
|
125
|
+
* );
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/fulfillment_policy/methods/getFulfillmentPolicy
|
|
129
|
+
*/
|
|
130
|
+
getFulfillmentPolicy = (input) => requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/fulfillment_policy/${input.fulfillmentPolicyId}`);
|
|
131
|
+
/**
|
|
132
|
+
* Retrieves one fulfillment policy by marketplace and policy name.
|
|
133
|
+
*
|
|
134
|
+
* @param input - Marketplace ID and seller-defined policy name.
|
|
135
|
+
* @returns An Effect that succeeds with eBay's generated FulfillmentPolicy.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* const policy = await Effect.runPromise(
|
|
140
|
+
* accountApi.getFulfillmentPolicyByName({ marketplaceId: 'EBAY_US', name: 'Standard Shipping' }),
|
|
141
|
+
* );
|
|
142
|
+
* ```
|
|
143
|
+
*
|
|
144
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/fulfillment_policy/methods/getFulfillmentPolicyByName
|
|
145
|
+
*/
|
|
146
|
+
getFulfillmentPolicyByName = (input) => {
|
|
147
|
+
const params = buildEndpointParams({
|
|
148
|
+
marketplaceId: { wireName: 'marketplace_id', value: input.marketplaceId },
|
|
149
|
+
name: { wireName: 'name', value: input.name },
|
|
150
|
+
});
|
|
151
|
+
return requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/fulfillment_policy/get_by_policy_name`, params);
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Updates a fulfillment policy by ID.
|
|
155
|
+
*
|
|
156
|
+
* @param input - Fulfillment policy ID and full replacement policy payload.
|
|
157
|
+
* @returns An Effect that succeeds with eBay's generated SetFulfillmentPolicyResponse.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```ts
|
|
161
|
+
* const updated = await Effect.runPromise(
|
|
162
|
+
* accountApi.updateFulfillmentPolicy({ fulfillmentPolicyId: 'FP123', policy }),
|
|
163
|
+
* );
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/fulfillment_policy/methods/updateFulfillmentPolicy
|
|
167
|
+
*/
|
|
168
|
+
updateFulfillmentPolicy = (input) => requestPutEffect(this.client, `${ACCOUNT_BASE_PATH}/fulfillment_policy/${input.fulfillmentPolicyId}`, input.policy);
|
|
169
|
+
/**
|
|
170
|
+
* Deletes a fulfillment policy by ID.
|
|
171
|
+
*
|
|
172
|
+
* @param input - Fulfillment policy identifier.
|
|
173
|
+
* @returns An Effect that succeeds when eBay deletes the policy.
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```ts
|
|
177
|
+
* await Effect.runPromise(
|
|
178
|
+
* accountApi.deleteFulfillmentPolicy({ fulfillmentPolicyId: 'FP123' }),
|
|
179
|
+
* );
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/fulfillment_policy/methods/deleteFulfillmentPolicy
|
|
183
|
+
*/
|
|
184
|
+
deleteFulfillmentPolicy = (input) => requestDeleteEffect(this.client, `${ACCOUNT_BASE_PATH}/fulfillment_policy/${input.fulfillmentPolicyId}`);
|
|
185
|
+
/**
|
|
186
|
+
* Retrieves payment policies for one marketplace.
|
|
187
|
+
*
|
|
188
|
+
* @param input - Marketplace ID used as the `marketplace_id` query parameter.
|
|
189
|
+
* @returns An Effect that succeeds with eBay's generated PaymentPolicyResponse.
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* ```ts
|
|
193
|
+
* const policies = await Effect.runPromise(
|
|
194
|
+
* accountApi.getPaymentPolicies({ marketplaceId: 'EBAY_US' }),
|
|
195
|
+
* );
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
198
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/payment_policy/methods/getPaymentPolicies
|
|
199
|
+
*/
|
|
200
|
+
getPaymentPolicies = (input) => {
|
|
201
|
+
const params = buildEndpointParams({
|
|
202
|
+
marketplaceId: { wireName: 'marketplace_id', value: input.marketplaceId },
|
|
203
|
+
});
|
|
204
|
+
return requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/payment_policy`, params);
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Creates a payment policy.
|
|
208
|
+
*
|
|
209
|
+
* @param input - Payment policy request body.
|
|
210
|
+
* @returns An Effect that succeeds with eBay's generated SetPaymentPolicyResponse.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* const created = await Effect.runPromise(accountApi.createPaymentPolicy({ policy }));
|
|
215
|
+
* ```
|
|
216
|
+
*
|
|
217
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/payment_policy/methods/createPaymentPolicy
|
|
218
|
+
*/
|
|
219
|
+
createPaymentPolicy = (input) => requestPostEffect(this.client, `${ACCOUNT_BASE_PATH}/payment_policy`, input.policy);
|
|
220
|
+
/**
|
|
221
|
+
* Retrieves one payment policy by ID.
|
|
222
|
+
*
|
|
223
|
+
* @param input - Payment policy identifier.
|
|
224
|
+
* @returns An Effect that succeeds with eBay's generated PaymentPolicy.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```ts
|
|
228
|
+
* const policy = await Effect.runPromise(
|
|
229
|
+
* accountApi.getPaymentPolicy({ paymentPolicyId: 'PP123' }),
|
|
230
|
+
* );
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/payment_policy/methods/getPaymentPolicy
|
|
234
|
+
*/
|
|
235
|
+
getPaymentPolicy = (input) => requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/payment_policy/${input.paymentPolicyId}`);
|
|
236
|
+
/**
|
|
237
|
+
* Retrieves one payment policy by marketplace and policy name.
|
|
238
|
+
*
|
|
239
|
+
* @param input - Marketplace ID and seller-defined policy name.
|
|
240
|
+
* @returns An Effect that succeeds with eBay's generated PaymentPolicy.
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```ts
|
|
244
|
+
* const policy = await Effect.runPromise(
|
|
245
|
+
* accountApi.getPaymentPolicyByName({ marketplaceId: 'EBAY_US', name: 'Immediate Payment' }),
|
|
246
|
+
* );
|
|
247
|
+
* ```
|
|
248
|
+
*
|
|
249
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/payment_policy/methods/getPaymentPolicyByName
|
|
250
|
+
*/
|
|
251
|
+
getPaymentPolicyByName = (input) => {
|
|
252
|
+
const params = buildEndpointParams({
|
|
253
|
+
marketplaceId: { wireName: 'marketplace_id', value: input.marketplaceId },
|
|
254
|
+
name: { wireName: 'name', value: input.name },
|
|
255
|
+
});
|
|
256
|
+
return requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/payment_policy/get_by_policy_name`, params);
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* Updates a payment policy by ID.
|
|
260
|
+
*
|
|
261
|
+
* @param input - Payment policy ID and full replacement policy payload.
|
|
262
|
+
* @returns An Effect that succeeds with eBay's generated SetPaymentPolicyResponse.
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* ```ts
|
|
266
|
+
* const updated = await Effect.runPromise(
|
|
267
|
+
* accountApi.updatePaymentPolicy({ paymentPolicyId: 'PP123', policy }),
|
|
268
|
+
* );
|
|
269
|
+
* ```
|
|
270
|
+
*
|
|
271
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/payment_policy/methods/updatePaymentPolicy
|
|
272
|
+
*/
|
|
273
|
+
updatePaymentPolicy = (input) => requestPutEffect(this.client, `${ACCOUNT_BASE_PATH}/payment_policy/${input.paymentPolicyId}`, input.policy);
|
|
274
|
+
/**
|
|
275
|
+
* Deletes a payment policy by ID.
|
|
276
|
+
*
|
|
277
|
+
* @param input - Payment policy identifier.
|
|
278
|
+
* @returns An Effect that succeeds when eBay deletes the policy.
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* ```ts
|
|
282
|
+
* await Effect.runPromise(accountApi.deletePaymentPolicy({ paymentPolicyId: 'PP123' }));
|
|
283
|
+
* ```
|
|
284
|
+
*
|
|
285
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/payment_policy/methods/deletePaymentPolicy
|
|
286
|
+
*/
|
|
287
|
+
deletePaymentPolicy = (input) => requestDeleteEffect(this.client, `${ACCOUNT_BASE_PATH}/payment_policy/${input.paymentPolicyId}`);
|
|
288
|
+
/**
|
|
289
|
+
* Retrieves return policies for one marketplace.
|
|
290
|
+
*
|
|
291
|
+
* @param input - Marketplace ID used as the `marketplace_id` query parameter.
|
|
292
|
+
* @returns An Effect that succeeds with eBay's generated ReturnPolicyResponse.
|
|
293
|
+
*
|
|
294
|
+
* @example
|
|
295
|
+
* ```ts
|
|
296
|
+
* const policies = await Effect.runPromise(
|
|
297
|
+
* accountApi.getReturnPolicies({ marketplaceId: 'EBAY_US' }),
|
|
298
|
+
* );
|
|
299
|
+
* ```
|
|
300
|
+
*
|
|
301
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/return_policy/methods/getReturnPolicies
|
|
302
|
+
*/
|
|
303
|
+
getReturnPolicies = (input) => {
|
|
304
|
+
const params = buildEndpointParams({
|
|
305
|
+
marketplaceId: { wireName: 'marketplace_id', value: input.marketplaceId },
|
|
306
|
+
});
|
|
307
|
+
return requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/return_policy`, params);
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* Creates a return policy.
|
|
311
|
+
*
|
|
312
|
+
* @param input - Return policy request body.
|
|
313
|
+
* @returns An Effect that succeeds with eBay's generated SetReturnPolicyResponse.
|
|
314
|
+
*
|
|
315
|
+
* @example
|
|
316
|
+
* ```ts
|
|
317
|
+
* const created = await Effect.runPromise(accountApi.createReturnPolicy({ policy }));
|
|
318
|
+
* ```
|
|
319
|
+
*
|
|
320
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/return_policy/methods/createReturnPolicy
|
|
321
|
+
*/
|
|
322
|
+
createReturnPolicy = (input) => requestPostEffect(this.client, `${ACCOUNT_BASE_PATH}/return_policy`, input.policy);
|
|
323
|
+
/**
|
|
324
|
+
* Retrieves one return policy by ID.
|
|
325
|
+
*
|
|
326
|
+
* @param input - Return policy identifier.
|
|
327
|
+
* @returns An Effect that succeeds with eBay's generated ReturnPolicy.
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* ```ts
|
|
331
|
+
* const policy = await Effect.runPromise(accountApi.getReturnPolicy({ returnPolicyId: 'RP123' }));
|
|
332
|
+
* ```
|
|
333
|
+
*
|
|
334
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/return_policy/methods/getReturnPolicy
|
|
335
|
+
*/
|
|
336
|
+
getReturnPolicy = (input) => requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/return_policy/${input.returnPolicyId}`);
|
|
337
|
+
/**
|
|
338
|
+
* Retrieves one return policy by marketplace and policy name.
|
|
339
|
+
*
|
|
340
|
+
* @param input - Marketplace ID and seller-defined policy name.
|
|
341
|
+
* @returns An Effect that succeeds with eBay's generated ReturnPolicy.
|
|
342
|
+
*
|
|
343
|
+
* @example
|
|
344
|
+
* ```ts
|
|
345
|
+
* const policy = await Effect.runPromise(
|
|
346
|
+
* accountApi.getReturnPolicyByName({ marketplaceId: 'EBAY_US', name: '30 Day Returns' }),
|
|
347
|
+
* );
|
|
348
|
+
* ```
|
|
349
|
+
*
|
|
350
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/return_policy/methods/getReturnPolicyByName
|
|
351
|
+
*/
|
|
352
|
+
getReturnPolicyByName = (input) => {
|
|
353
|
+
const params = buildEndpointParams({
|
|
354
|
+
marketplaceId: { wireName: 'marketplace_id', value: input.marketplaceId },
|
|
355
|
+
name: { wireName: 'name', value: input.name },
|
|
356
|
+
});
|
|
357
|
+
return requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/return_policy/get_by_policy_name`, params);
|
|
358
|
+
};
|
|
359
|
+
/**
|
|
360
|
+
* Updates a return policy by ID.
|
|
361
|
+
*
|
|
362
|
+
* @param input - Return policy ID and full replacement policy payload.
|
|
363
|
+
* @returns An Effect that succeeds with eBay's generated SetReturnPolicyResponse.
|
|
364
|
+
*
|
|
365
|
+
* @example
|
|
366
|
+
* ```ts
|
|
367
|
+
* const updated = await Effect.runPromise(
|
|
368
|
+
* accountApi.updateReturnPolicy({ returnPolicyId: 'RP123', policy }),
|
|
369
|
+
* );
|
|
370
|
+
* ```
|
|
371
|
+
*
|
|
372
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/return_policy/methods/updateReturnPolicy
|
|
373
|
+
*/
|
|
374
|
+
updateReturnPolicy = (input) => requestPutEffect(this.client, `${ACCOUNT_BASE_PATH}/return_policy/${input.returnPolicyId}`, input.policy);
|
|
375
|
+
/**
|
|
376
|
+
* Deletes a return policy by ID.
|
|
377
|
+
*
|
|
378
|
+
* @param input - Return policy identifier.
|
|
379
|
+
* @returns An Effect that succeeds when eBay deletes the policy.
|
|
380
|
+
*
|
|
381
|
+
* @example
|
|
382
|
+
* ```ts
|
|
383
|
+
* await Effect.runPromise(accountApi.deleteReturnPolicy({ returnPolicyId: 'RP123' }));
|
|
384
|
+
* ```
|
|
385
|
+
*
|
|
386
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/return_policy/methods/deleteReturnPolicy
|
|
387
|
+
*/
|
|
388
|
+
deleteReturnPolicy = (input) => requestDeleteEffect(this.client, `${ACCOUNT_BASE_PATH}/return_policy/${input.returnPolicyId}`);
|
|
389
|
+
/**
|
|
390
|
+
* Retrieves seller payments program status.
|
|
391
|
+
*
|
|
392
|
+
* @param input - Marketplace ID and payments program type.
|
|
393
|
+
* @returns An Effect that succeeds with eBay's generated PaymentsProgramResponse.
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* ```ts
|
|
397
|
+
* const status = await Effect.runPromise(
|
|
398
|
+
* accountApi.getPaymentsProgram({ marketplaceId: 'EBAY_US', paymentsProgramType: 'EBAY_PAYMENTS' }),
|
|
399
|
+
* );
|
|
400
|
+
* ```
|
|
401
|
+
*
|
|
402
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/payments_program/methods/getPaymentsProgram
|
|
403
|
+
*/
|
|
404
|
+
getPaymentsProgram = (input) => requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/payments_program/${input.marketplaceId}/${input.paymentsProgramType}`);
|
|
405
|
+
/**
|
|
406
|
+
* Retrieves seller payments program onboarding status.
|
|
407
|
+
*
|
|
408
|
+
* @param input - Marketplace ID and payments program type.
|
|
409
|
+
* @returns An Effect that succeeds with eBay's generated PaymentsProgramOnboardingResponse.
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* ```ts
|
|
413
|
+
* const onboarding = await Effect.runPromise(
|
|
414
|
+
* accountApi.getPaymentsProgramOnboarding({
|
|
415
|
+
* marketplaceId: 'EBAY_US',
|
|
416
|
+
* paymentsProgramType: 'EBAY_PAYMENTS',
|
|
417
|
+
* }),
|
|
418
|
+
* );
|
|
419
|
+
* ```
|
|
420
|
+
*
|
|
421
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/program/methods/payments_program/onboarding/methods/getPaymentsProgramOnboarding
|
|
422
|
+
*/
|
|
423
|
+
getPaymentsProgramOnboarding = (input) => requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/payments_program/${input.marketplaceId}/${input.paymentsProgramType}/onboarding`);
|
|
424
|
+
/**
|
|
425
|
+
* Retrieves the seller account privileges.
|
|
426
|
+
*
|
|
427
|
+
* @param _input - Empty object accepted for tool/API shape consistency.
|
|
428
|
+
* @returns An Effect that succeeds with eBay's generated SellingPrivileges.
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* ```ts
|
|
432
|
+
* const privileges = await Effect.runPromise(accountApi.getPrivileges({}));
|
|
433
|
+
* ```
|
|
434
|
+
*
|
|
435
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/privilege/methods/getPrivileges
|
|
436
|
+
*/
|
|
437
|
+
getPrivileges = (_input = {}) => requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/privilege`);
|
|
438
|
+
/**
|
|
439
|
+
* Retrieves seller programs the account has opted into.
|
|
440
|
+
*
|
|
441
|
+
* @param _input - Empty object accepted for tool/API shape consistency.
|
|
442
|
+
* @returns An Effect that succeeds with eBay's generated Programs response.
|
|
443
|
+
*
|
|
444
|
+
* @example
|
|
445
|
+
* ```ts
|
|
446
|
+
* const programs = await Effect.runPromise(accountApi.getOptedInPrograms({}));
|
|
447
|
+
* ```
|
|
448
|
+
*
|
|
449
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/program/methods/getOptedInPrograms
|
|
450
|
+
*/
|
|
451
|
+
getOptedInPrograms = (_input = {}) => requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/program/get_opted_in_programs`);
|
|
452
|
+
/**
|
|
453
|
+
* Opts the seller into an Account API program.
|
|
454
|
+
*
|
|
455
|
+
* @param input - Program opt-in request body.
|
|
456
|
+
* @returns An Effect that succeeds when eBay accepts the opt-in request.
|
|
457
|
+
*
|
|
458
|
+
* @example
|
|
459
|
+
* ```ts
|
|
460
|
+
* await Effect.runPromise(
|
|
461
|
+
* accountApi.optInToProgram({ request: { programType: 'OUT_OF_STOCK_CONTROL' } }),
|
|
462
|
+
* );
|
|
463
|
+
* ```
|
|
464
|
+
*
|
|
465
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/program/methods/optInToProgram
|
|
466
|
+
*/
|
|
467
|
+
optInToProgram = (input) => requestPostEffect(this.client, `${ACCOUNT_BASE_PATH}/program/opt_in`, input.request);
|
|
468
|
+
/**
|
|
469
|
+
* Opts the seller out of an Account API program.
|
|
470
|
+
*
|
|
471
|
+
* @param input - Program opt-out request body.
|
|
472
|
+
* @returns An Effect that succeeds when eBay accepts the opt-out request.
|
|
473
|
+
*
|
|
474
|
+
* @example
|
|
475
|
+
* ```ts
|
|
476
|
+
* await Effect.runPromise(
|
|
477
|
+
* accountApi.optOutOfProgram({ request: { programType: 'OUT_OF_STOCK_CONTROL' } }),
|
|
478
|
+
* );
|
|
479
|
+
* ```
|
|
480
|
+
*
|
|
481
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/program/methods/optOutOfProgram
|
|
482
|
+
*/
|
|
483
|
+
optOutOfProgram = (input) => requestPostEffect(this.client, `${ACCOUNT_BASE_PATH}/program/opt_out`, input.request);
|
|
484
|
+
/**
|
|
485
|
+
* Retrieves seller rate tables.
|
|
486
|
+
*
|
|
487
|
+
* @param _input - Empty object accepted for tool/API shape consistency.
|
|
488
|
+
* @returns An Effect that succeeds with eBay's generated RateTableResponse.
|
|
489
|
+
*
|
|
490
|
+
* @example
|
|
491
|
+
* ```ts
|
|
492
|
+
* const rateTables = await Effect.runPromise(accountApi.getRateTables({}));
|
|
493
|
+
* ```
|
|
494
|
+
*
|
|
495
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/rate_table/methods/getRateTables
|
|
496
|
+
*/
|
|
497
|
+
getRateTables = (_input = {}) => requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/rate_table`);
|
|
498
|
+
/**
|
|
499
|
+
* Creates or replaces one sales tax table entry.
|
|
500
|
+
*
|
|
501
|
+
* @param input - Country, jurisdiction, and sales tax payload.
|
|
502
|
+
* @returns An Effect that succeeds when eBay accepts the sales tax table entry.
|
|
503
|
+
*
|
|
504
|
+
* @example
|
|
505
|
+
* ```ts
|
|
506
|
+
* await Effect.runPromise(
|
|
507
|
+
* accountApi.createOrReplaceSalesTax({ countryCode: 'US', jurisdictionId: 'CA', salesTaxBase }),
|
|
508
|
+
* );
|
|
509
|
+
* ```
|
|
510
|
+
*
|
|
511
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/sales_tax/methods/createOrReplaceSalesTax
|
|
512
|
+
*/
|
|
513
|
+
createOrReplaceSalesTax = (input) => requestPutEffect(this.client, `${ACCOUNT_BASE_PATH}/sales_tax/${input.countryCode}/${input.jurisdictionId}`, input.salesTaxBase);
|
|
514
|
+
/**
|
|
515
|
+
* Creates or replaces multiple sales tax table entries.
|
|
516
|
+
*
|
|
517
|
+
* @param input - Bulk sales tax request rows.
|
|
518
|
+
* @returns An Effect that succeeds when eBay accepts the bulk sales tax request.
|
|
519
|
+
*
|
|
520
|
+
* @example
|
|
521
|
+
* ```ts
|
|
522
|
+
* await Effect.runPromise(
|
|
523
|
+
* accountApi.bulkCreateOrReplaceSalesTax({ requests }),
|
|
524
|
+
* );
|
|
525
|
+
* ```
|
|
526
|
+
*
|
|
527
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/sales_tax/methods/bulkCreateOrReplaceSalesTax
|
|
528
|
+
*/
|
|
529
|
+
bulkCreateOrReplaceSalesTax = (input) => requestPostEffect(this.client, `${ACCOUNT_BASE_PATH}/bulk_create_or_replace_sales_tax`, {
|
|
530
|
+
requests: input.requests,
|
|
531
|
+
});
|
|
532
|
+
/**
|
|
533
|
+
* Deletes one sales tax table entry.
|
|
534
|
+
*
|
|
535
|
+
* @param input - Country and jurisdiction identifiers.
|
|
536
|
+
* @returns An Effect that succeeds when eBay deletes the sales tax table entry.
|
|
537
|
+
*
|
|
538
|
+
* @example
|
|
539
|
+
* ```ts
|
|
540
|
+
* await Effect.runPromise(
|
|
541
|
+
* accountApi.deleteSalesTax({ countryCode: 'US', jurisdictionId: 'CA' }),
|
|
542
|
+
* );
|
|
543
|
+
* ```
|
|
544
|
+
*
|
|
545
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/sales_tax/methods/deleteSalesTax
|
|
546
|
+
*/
|
|
547
|
+
deleteSalesTax = (input) => requestDeleteEffect(this.client, `${ACCOUNT_BASE_PATH}/sales_tax/${input.countryCode}/${input.jurisdictionId}`);
|
|
548
|
+
/**
|
|
549
|
+
* Retrieves one sales tax table entry.
|
|
550
|
+
*
|
|
551
|
+
* @param input - Country and jurisdiction identifiers.
|
|
552
|
+
* @returns An Effect that succeeds with eBay's generated SalesTax.
|
|
553
|
+
*
|
|
554
|
+
* @example
|
|
555
|
+
* ```ts
|
|
556
|
+
* const tax = await Effect.runPromise(
|
|
557
|
+
* accountApi.getSalesTax({ countryCode: 'US', jurisdictionId: 'CA' }),
|
|
558
|
+
* );
|
|
559
|
+
* ```
|
|
560
|
+
*
|
|
561
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/sales_tax/methods/getSalesTax
|
|
562
|
+
*/
|
|
563
|
+
getSalesTax = (input) => requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/sales_tax/${input.countryCode}/${input.jurisdictionId}`);
|
|
564
|
+
/**
|
|
565
|
+
* Retrieves all sales tax table entries for one country.
|
|
566
|
+
*
|
|
567
|
+
* @param input - Country code used as the `country_code` query parameter.
|
|
568
|
+
* @returns An Effect that succeeds with eBay's generated SalesTaxes response.
|
|
569
|
+
*
|
|
570
|
+
* @example
|
|
571
|
+
* ```ts
|
|
572
|
+
* const taxes = await Effect.runPromise(accountApi.getSalesTaxes({ countryCode: 'US' }));
|
|
573
|
+
* ```
|
|
574
|
+
*
|
|
575
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/sales_tax/methods/getSalesTaxes
|
|
576
|
+
*/
|
|
577
|
+
getSalesTaxes = (input) => {
|
|
578
|
+
const params = buildEndpointParams({
|
|
579
|
+
countryCode: { wireName: 'country_code', value: input.countryCode },
|
|
580
|
+
});
|
|
581
|
+
return requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/sales_tax`, params);
|
|
582
|
+
};
|
|
583
|
+
/**
|
|
584
|
+
* Retrieves seller subscription information.
|
|
585
|
+
*
|
|
586
|
+
* @param input - Optional subscription limit and continuation token.
|
|
587
|
+
* @returns An Effect that succeeds with eBay's generated SubscriptionResponse.
|
|
588
|
+
*
|
|
589
|
+
* @example
|
|
590
|
+
* ```ts
|
|
591
|
+
* const subscription = await Effect.runPromise(accountApi.getSubscription({ limit: '10' }));
|
|
592
|
+
* ```
|
|
593
|
+
*
|
|
594
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/subscription/methods/getSubscription
|
|
595
|
+
*/
|
|
596
|
+
getSubscription = (input = {}) => {
|
|
597
|
+
const params = buildEndpointParams({
|
|
598
|
+
limit: { wireName: 'limit', value: input.limit },
|
|
599
|
+
continuationToken: { wireName: 'continuation_token', value: input.continuationToken },
|
|
600
|
+
});
|
|
601
|
+
return requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/subscription`, params);
|
|
602
|
+
};
|
|
603
|
+
/**
|
|
604
|
+
* Retrieves seller KYC status.
|
|
605
|
+
*
|
|
606
|
+
* @param _input - Empty object accepted for tool/API shape consistency.
|
|
607
|
+
* @returns An Effect that succeeds with eBay's generated KycResponse.
|
|
608
|
+
*
|
|
609
|
+
* @example
|
|
610
|
+
* ```ts
|
|
611
|
+
* const kyc = await Effect.runPromise(accountApi.getKyc({}));
|
|
612
|
+
* ```
|
|
613
|
+
*
|
|
614
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/kyc/methods/getKYC
|
|
615
|
+
*/
|
|
616
|
+
getKyc = (_input = {}) => requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/kyc`);
|
|
617
|
+
/**
|
|
618
|
+
* Retrieves seller advertising-program eligibility for one marketplace.
|
|
619
|
+
*
|
|
620
|
+
* @param input - Marketplace header and optional comma-separated program type filter.
|
|
621
|
+
* @returns An Effect that succeeds with eBay's generated SellerEligibilityMultiProgramResponse.
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* ```ts
|
|
625
|
+
* const eligibility = await Effect.runPromise(
|
|
626
|
+
* accountApi.getAdvertisingEligibility({ marketplaceId: 'EBAY_US', programTypes: 'PLA' }),
|
|
627
|
+
* );
|
|
628
|
+
* ```
|
|
629
|
+
*
|
|
630
|
+
* @see https://developer.ebay.com/api-docs/sell/account/resources/advertising_eligibility/methods/getAdvertisingEligibility
|
|
631
|
+
*/
|
|
632
|
+
getAdvertisingEligibility = (input) => {
|
|
633
|
+
const params = buildEndpointParams({
|
|
634
|
+
programTypes: { wireName: 'program_types', value: input.programTypes },
|
|
635
|
+
});
|
|
636
|
+
return requestGetEffect(this.client, `${ACCOUNT_BASE_PATH}/advertising_eligibility`, params, {
|
|
283
637
|
headers: {
|
|
284
|
-
'X-EBAY-C-MARKETPLACE-ID': marketplaceId,
|
|
638
|
+
'X-EBAY-C-MARKETPLACE-ID': input.marketplaceId,
|
|
285
639
|
},
|
|
286
|
-
})
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Get payments program status for a marketplace
|
|
290
|
-
* Note: This method is deprecated as all seller accounts globally have been enabled for the new eBay payment and checkout flow.
|
|
291
|
-
* @param marketplaceId - The eBay marketplace ID
|
|
292
|
-
* @param paymentsProgramType - The type of payments program
|
|
293
|
-
*/
|
|
294
|
-
async getPaymentsProgram(marketplaceId, paymentsProgramType) {
|
|
295
|
-
return await withApiError('Failed to get payments program', () => this.client.get(`${this.basePath}/payments_program/${marketplaceId}/${paymentsProgramType}`));
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* Get payments program onboarding information
|
|
299
|
-
* Note: This method is deprecated as all seller accounts globally have been enabled for the new eBay payment and checkout flow.
|
|
300
|
-
* @param marketplaceId - The eBay marketplace ID
|
|
301
|
-
* @param paymentsProgramType - The type of payments program
|
|
302
|
-
*/
|
|
303
|
-
async getPaymentsProgramOnboarding(marketplaceId, paymentsProgramType) {
|
|
304
|
-
return await withApiError('Failed to get payments program onboarding', () => this.client.get(`${this.basePath}/payments_program/${marketplaceId}/${paymentsProgramType}/onboarding`));
|
|
305
|
-
}
|
|
640
|
+
});
|
|
641
|
+
};
|
|
306
642
|
}
|