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.
Files changed (169) hide show
  1. package/README.de.md +3 -3
  2. package/README.es.md +3 -3
  3. package/README.fr.md +3 -3
  4. package/README.ja.md +3 -3
  5. package/README.ko.md +3 -3
  6. package/README.md +163 -41
  7. package/README.pt-BR.md +3 -3
  8. package/README.ru.md +3 -3
  9. package/README.zh-CN.md +3 -3
  10. package/build/api/account-management/account.js +633 -297
  11. package/build/api/analytics-and-report/analytics.js +111 -65
  12. package/build/api/client.js +199 -140
  13. package/build/api/clientRequestError.js +23 -0
  14. package/build/api/clientTrading.js +213 -0
  15. package/build/api/clientTradingError.js +4 -0
  16. package/build/api/communication/feedback.js +147 -59
  17. package/build/api/communication/message.js +134 -81
  18. package/build/api/communication/negotiation.js +65 -53
  19. package/build/api/communication/notification.js +458 -164
  20. package/build/api/developer/developer.js +99 -45
  21. package/build/api/index.js +23 -8
  22. package/build/api/listing-management/inventory.js +884 -338
  23. package/build/api/listing-metadata/metadata.js +416 -170
  24. package/build/api/listing-metadata/taxonomy.js +187 -42
  25. package/build/api/marketing-and-promotions/marketing.js +1392 -598
  26. package/build/api/marketing-and-promotions/recommendation.js +49 -24
  27. package/build/api/order-management/dispute.js +226 -45
  28. package/build/api/order-management/fulfillment.js +144 -71
  29. package/build/api/order-management/orderIssueHelpers.js +61 -0
  30. package/build/api/other/compliance.js +50 -38
  31. package/build/api/other/edelivery.js +603 -159
  32. package/build/api/other/finding.js +280 -0
  33. package/build/api/other/identity.js +30 -15
  34. package/build/api/other/translation.js +29 -14
  35. package/build/api/other/vero.js +113 -27
  36. package/build/api/rateLimitTracker.js +55 -0
  37. package/build/api/shared/request.js +189 -98
  38. package/build/api/trading/trading.js +154 -87
  39. package/build/auth/credentialSession.js +250 -0
  40. package/build/auth/oauth.js +298 -171
  41. package/build/auth/{oauth-metadata.js → oauthMetadata.js} +22 -6
  42. package/build/auth/oauthMiddleware.js +104 -0
  43. package/build/auth/{scope-utils.js → scopeUtils.js} +101 -28
  44. package/build/auth/tokenVerifier.js +243 -0
  45. package/build/auth/tokenVerifierError.js +21 -0
  46. package/build/config/environment.js +148 -113
  47. package/build/config/{tool-families.js → toolFamilies.js} +30 -14
  48. package/build/index.js +25 -19
  49. package/build/mcp/{http-transport.js → httpTransport.js} +102 -52
  50. package/build/mcp/readOnlyFilter.js +67 -0
  51. package/build/mcp/runtime.js +31 -13
  52. package/build/mcp/{tool-gating.js → toolGating.js} +77 -49
  53. package/build/mcp/{ui-bridge.js → uiBridge.js} +80 -23
  54. package/build/schemas/account-management/account.js +144 -6
  55. package/build/schemas/analytics/analytics.js +33 -19
  56. package/build/schemas/communication/messages.js +12 -42
  57. package/build/schemas/developer/developer.js +135 -0
  58. package/build/schemas/fulfillment/orders.js +183 -21
  59. package/build/schemas/index.js +27 -19
  60. package/build/schemas/inventory-management/inventory.js +17 -9
  61. package/build/schemas/marketing/marketing.js +480 -25
  62. package/build/schemas/metadata/metadata.js +11 -6
  63. package/build/schemas/other/finding.js +27 -0
  64. package/build/schemas/other/otherApis.js +424 -0
  65. package/build/schemas/taxonomy/taxonomy.js +11 -5
  66. package/build/scripts/{auto-setup.js → autoSetup.js} +87 -74
  67. package/build/scripts/{build-ui.js → buildUi.js} +6 -1
  68. package/build/scripts/{dev-sync.js → devSync.js} +169 -110
  69. package/build/scripts/diagnostics.js +52 -44
  70. package/build/scripts/{download-specs.js → downloadSpecs.js} +29 -21
  71. package/build/scripts/{interactive-setup.js → interactiveSetup.js} +84 -78
  72. package/build/scripts/setup.js +241 -178
  73. package/build/scripts/{setup-shared.js → setupShared.js} +29 -7
  74. package/build/scripts/skills.js +35 -27
  75. package/build/scripts/updateApiStatusDoc.js +71 -0
  76. package/build/serverHttp.js +90 -0
  77. package/build/skills/content.js +124 -118
  78. package/build/skills/index.js +22 -10
  79. package/build/skills/install.js +21 -10
  80. package/build/skills/markers.js +50 -15
  81. package/build/skills/{registry-snapshot.js → registrySnapshot.js} +8 -2
  82. package/build/skills/render.js +41 -14
  83. package/build/skills/targets.js +49 -17
  84. package/build/tools/categories/account.js +166 -264
  85. package/build/tools/categories/analytics.js +11 -22
  86. package/build/tools/categories/browse.js +17 -0
  87. package/build/tools/categories/communication.js +124 -399
  88. package/build/tools/categories/connector.js +23 -20
  89. package/build/tools/categories/developer.js +46 -159
  90. package/build/tools/categories/fulfillment.js +84 -215
  91. package/build/tools/categories/index.js +6 -14
  92. package/build/tools/categories/inventory.js +238 -293
  93. package/build/tools/categories/marketing.js +677 -39
  94. package/build/tools/categories/metadata.js +190 -117
  95. package/build/tools/categories/other.js +81 -208
  96. package/build/tools/categories/taxonomy.js +29 -20
  97. package/build/tools/categories/{token-management.js → tokenManagement.js} +187 -192
  98. package/build/tools/categories/trading.js +16 -47
  99. package/build/tools/contracts.js +34 -24
  100. package/build/tools/{define-tool.js → defineTool.js} +44 -29
  101. package/build/tools/registry.js +87 -29
  102. package/build/tools/schemas.js +3 -57
  103. package/build/tools/ui/archetypes.js +1 -0
  104. package/build/tools/ui/{map-helpers.js → mapHelpers.js} +69 -19
  105. package/build/tools/ui/maps.js +294 -80
  106. package/build/types/index.js +1 -1
  107. package/build/ui/card.html +14 -14
  108. package/build/ui/chart.html +14 -14
  109. package/build/ui/stat.html +87 -0
  110. package/build/ui/table.html +14 -14
  111. package/build/utils/apiStatusFeed.js +95 -0
  112. package/build/utils/cliOutput.js +15 -0
  113. package/build/utils/cliUi.js +108 -0
  114. package/build/utils/communication/feedback.js +57 -77
  115. package/build/utils/communication/message.js +69 -98
  116. package/build/utils/communication/negotiation.js +30 -57
  117. package/build/utils/communication/notification.js +112 -252
  118. package/build/utils/{date-converter.js → dateConverter.js} +62 -30
  119. package/build/utils/effectSchema.js +203 -0
  120. package/build/utils/effectSchemaAdapter.js +121 -0
  121. package/build/utils/effectSchemaChainMethods.js +146 -0
  122. package/build/utils/effectSchemaRefinements.js +104 -0
  123. package/build/utils/effectSchemaStringMethods.js +63 -0
  124. package/build/utils/effectSchemaTypes.js +47 -0
  125. package/build/utils/{env-parser.js → envParser.js} +10 -2
  126. package/build/utils/errors.js +7 -3
  127. package/build/utils/http.js +148 -89
  128. package/build/utils/{llm-client-detector.js → llmClientDetector.js} +295 -274
  129. package/build/utils/logger.js +127 -51
  130. package/build/utils/{oauth-helper.js → oauthHelper.js} +127 -90
  131. package/build/utils/other/compliance.js +18 -38
  132. package/build/utils/other/identity.js +2 -2
  133. package/build/utils/other/translation.js +4 -4
  134. package/build/utils/other/vero.js +36 -20
  135. package/build/utils/schemaHelpers.js +22 -0
  136. package/build/utils/scopeHelper.js +270 -0
  137. package/build/utils/securityChecker.js +316 -0
  138. package/build/utils/{setup-validator.js → setupValidator.js} +113 -94
  139. package/build/utils/{setup-wizard.js → setupWizard.js} +57 -46
  140. package/build/utils/{token-utils.js → tokenUtils.js} +2 -2
  141. package/build/utils/trading/trading.js +35 -0
  142. package/build/utils/typeGuards.js +12 -0
  143. package/build/utils/version.js +65 -29
  144. package/package.json +10 -8
  145. package/build/api/client-trading.js +0 -124
  146. package/build/api/communication/shared.js +0 -59
  147. package/build/api/shared/query-params.js +0 -16
  148. package/build/auth/credential-session.js +0 -166
  149. package/build/auth/oauth-middleware.js +0 -100
  150. package/build/auth/token-verifier.js +0 -186
  151. package/build/schemas/other/other-apis.js +0 -390
  152. package/build/scripts/update-api-status-doc.js +0 -44
  153. package/build/server-http.js +0 -85
  154. package/build/tools/definitions/marketing.js +0 -1381
  155. package/build/tools/tool-handlers/marketing.js +0 -312
  156. package/build/utils/account-management/account.js +0 -818
  157. package/build/utils/api-status-feed.js +0 -84
  158. package/build/utils/cli-ui.js +0 -47
  159. package/build/utils/order-management/dispute.js +0 -369
  160. package/build/utils/order-management/fulfillment.js +0 -205
  161. package/build/utils/other/edelivery.js +0 -235
  162. package/build/utils/schema-helpers.js +0 -13
  163. package/build/utils/scope-helper.js +0 -207
  164. package/build/utils/security-checker.js +0 -248
  165. package/build/utils/type-guards.js +0 -6
  166. /package/build/auth/{oauth-types.js → oauthTypes.js} +0 -0
  167. /package/build/{server-http.d.ts → serverHttp.d.ts} +0 -0
  168. /package/build/tools/ui/{view-models.js → viewModels.js} +0 -0
  169. /package/build/types/{ebay-enums.js → ebayEnums.js} +0 -0
@@ -1,306 +1,642 @@
1
- import { withApiError } from '../../api/shared/request.js';
2
- /**
3
- * Account API - Seller account configuration, policies, programs
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
- * Get custom policies for the seller
14
- */
15
- async getCustomPolicies(policyTypes) {
16
- const params = policyTypes ? { policy_types: policyTypes } : undefined;
17
- return await withApiError('Failed to get custom policies', () => this.client.get(`${this.basePath}/custom_policy`, params));
18
- }
19
- /**
20
- * Get a specific custom policy
21
- */
22
- async getCustomPolicy(customPolicyId) {
23
- return await withApiError('Failed to get custom policy', () => this.client.get(`${this.basePath}/custom_policy/${customPolicyId}`));
24
- }
25
- /**
26
- * Get fulfillment policies
27
- * @param marketplaceId - Required: The eBay marketplace ID
28
- */
29
- async getFulfillmentPolicies(marketplaceId) {
30
- return await withApiError('Failed to get fulfillment policies', () => this.client.get(`${this.basePath}/fulfillment_policy`, {
31
- marketplace_id: marketplaceId,
32
- }));
33
- }
34
- /**
35
- * Get payment policies
36
- * @param marketplaceId - Required: The eBay marketplace ID
37
- */
38
- async getPaymentPolicies(marketplaceId) {
39
- return await withApiError('Failed to get payment policies', () => this.client.get(`${this.basePath}/payment_policy`, {
40
- marketplace_id: marketplaceId,
41
- }));
42
- }
43
- /**
44
- * Get return policies
45
- * @param marketplaceId - Required: The eBay marketplace ID
46
- */
47
- async getReturnPolicies(marketplaceId) {
48
- return await withApiError('Failed to get return policies', () => this.client.get(`${this.basePath}/return_policy`, {
49
- marketplace_id: marketplaceId,
50
- }));
51
- }
52
- /**
53
- * Get seller account privileges
54
- */
55
- async getPrivileges() {
56
- return await withApiError('Failed to get privileges', () => this.client.get(`${this.basePath}/privilege`));
57
- }
58
- // ============================================================
59
- // Fulfillment Policy Methods
60
- // ============================================================
61
- /**
62
- * Create a new fulfillment policy
63
- */
64
- async createFulfillmentPolicy(policy) {
65
- return await withApiError('Failed to create fulfillment policy', () => this.client.post(`${this.basePath}/fulfillment_policy`, policy));
66
- }
67
- /**
68
- * Get a specific fulfillment policy by ID
69
- */
70
- async getFulfillmentPolicy(fulfillmentPolicyId) {
71
- return await withApiError('Failed to get fulfillment policy', () => this.client.get(`${this.basePath}/fulfillment_policy/${fulfillmentPolicyId}`));
72
- }
73
- /**
74
- * Get a fulfillment policy by name
75
- */
76
- async getFulfillmentPolicyByName(marketplaceId, name) {
77
- return await withApiError('Failed to get fulfillment policy by name', () => this.client.get(`${this.basePath}/fulfillment_policy_by_name`, {
78
- marketplace_id: marketplaceId,
79
- name,
80
- }));
81
- }
82
- /**
83
- * Update a fulfillment policy
84
- */
85
- async updateFulfillmentPolicy(fulfillmentPolicyId, policy) {
86
- return await withApiError('Failed to update fulfillment policy', () => this.client.put(`${this.basePath}/fulfillment_policy/${fulfillmentPolicyId}`, policy));
87
- }
88
- /**
89
- * Delete a fulfillment policy
90
- */
91
- async deleteFulfillmentPolicy(fulfillmentPolicyId) {
92
- return await withApiError('Failed to delete fulfillment policy', () => this.client.delete(`${this.basePath}/fulfillment_policy/${fulfillmentPolicyId}`));
93
- }
94
- // ============================================================
95
- // Payment Policy Methods
96
- // ============================================================
97
- /**
98
- * Create a new payment policy
99
- */
100
- async createPaymentPolicy(policy) {
101
- return await withApiError('Failed to create payment policy', () => this.client.post(`${this.basePath}/payment_policy`, policy));
102
- }
103
- /**
104
- * Get a specific payment policy by ID
105
- */
106
- async getPaymentPolicy(paymentPolicyId) {
107
- return await withApiError('Failed to get payment policy', () => this.client.get(`${this.basePath}/payment_policy/${paymentPolicyId}`));
108
- }
109
- /**
110
- * Get a payment policy by name
111
- */
112
- async getPaymentPolicyByName(marketplaceId, name) {
113
- return await withApiError('Failed to get payment policy by name', () => this.client.get(`${this.basePath}/payment_policy_by_name`, {
114
- marketplace_id: marketplaceId,
115
- name,
116
- }));
117
- }
118
- /**
119
- * Update a payment policy
120
- */
121
- async updatePaymentPolicy(paymentPolicyId, policy) {
122
- return await withApiError('Failed to update payment policy', () => this.client.put(`${this.basePath}/payment_policy/${paymentPolicyId}`, policy));
123
- }
124
- /**
125
- * Delete a payment policy
126
- */
127
- async deletePaymentPolicy(paymentPolicyId) {
128
- return await withApiError('Failed to delete payment policy', () => this.client.delete(`${this.basePath}/payment_policy/${paymentPolicyId}`));
129
- }
130
- // ============================================================
131
- // Return Policy Methods
132
- // ============================================================
133
- /**
134
- * Create a new return policy
135
- */
136
- async createReturnPolicy(policy) {
137
- return await withApiError('Failed to create return policy', () => this.client.post(`${this.basePath}/return_policy`, policy));
138
- }
139
- /**
140
- * Get a specific return policy by ID
141
- */
142
- async getReturnPolicy(returnPolicyId) {
143
- return await withApiError('Failed to get return policy', () => this.client.get(`${this.basePath}/return_policy/${returnPolicyId}`));
144
- }
145
- /**
146
- * Get a return policy by name
147
- */
148
- async getReturnPolicyByName(marketplaceId, name) {
149
- return await withApiError('Failed to get return policy by name', () => this.client.get(`${this.basePath}/return_policy_by_name`, {
150
- marketplace_id: marketplaceId,
151
- name,
152
- }));
153
- }
154
- /**
155
- * Update a return policy
156
- */
157
- async updateReturnPolicy(returnPolicyId, policy) {
158
- return await withApiError('Failed to update return policy', () => this.client.put(`${this.basePath}/return_policy/${returnPolicyId}`, policy));
159
- }
160
- /**
161
- * Delete a return policy
162
- */
163
- async deleteReturnPolicy(returnPolicyId) {
164
- return await withApiError('Failed to delete return policy', () => this.client.delete(`${this.basePath}/return_policy/${returnPolicyId}`));
165
- }
166
- // ============================================================
167
- // Custom Policy Methods
168
- // ============================================================
169
- /**
170
- * Create a new custom policy
171
- */
172
- async createCustomPolicy(policy) {
173
- return await withApiError('Failed to create custom policy', () => this.client.post(`${this.basePath}/custom_policy`, policy));
174
- }
175
- /**
176
- * Update a custom policy
177
- */
178
- async updateCustomPolicy(customPolicyId, policy) {
179
- return await withApiError('Failed to update custom policy', () => this.client.put(`${this.basePath}/custom_policy/${customPolicyId}`, policy));
180
- }
181
- /**
182
- * Delete a custom policy
183
- */
184
- async deleteCustomPolicy(customPolicyId) {
185
- return await withApiError('Failed to delete custom policy', () => this.client.delete(`${this.basePath}/custom_policy/${customPolicyId}`));
186
- }
187
- // ============================================================
188
- // KYC, Payments Program, Rate Tables, Sales Tax, Subscription, Programs
189
- // ============================================================
190
- /**
191
- * Get KYC status
192
- */
193
- async getKyc() {
194
- return await withApiError('Failed to get kyc', () => this.client.get(`${this.basePath}/kyc`));
195
- }
196
- /**
197
- * Opt-in to a payments program
198
- */
199
- async optInToPaymentsProgram(marketplaceId, paymentsProgramType) {
200
- return await withApiError('Failed to opt in to payments program', () => this.client.post(`${this.basePath}/payments_program/${marketplaceId}/${paymentsProgramType}`, {}));
201
- }
202
- /**
203
- * Get payments program status
204
- */
205
- async getPaymentsProgramStatus(marketplaceId, paymentsProgramType) {
206
- return await withApiError('Failed to get payments program status', () => this.client.get(`${this.basePath}/payments_program/${marketplaceId}/${paymentsProgramType}`));
207
- }
208
- /**
209
- * Get rate tables
210
- */
211
- async getRateTables() {
212
- return await withApiError('Failed to get rate tables', () => this.client.get(`${this.basePath}/rate_table`));
213
- }
214
- /**
215
- * Create or replace sales tax table
216
- */
217
- async createOrReplaceSalesTax(countryCode, jurisdictionId, salesTaxBase) {
218
- return await withApiError('Failed to create or replace sales tax', () => this.client.put(`${this.basePath}/sales_tax/${countryCode}/${jurisdictionId}`, salesTaxBase));
219
- }
220
- /**
221
- * Bulk create or replace sales tax tables
222
- */
223
- async bulkCreateOrReplaceSalesTax(requests) {
224
- return await withApiError('Failed to bulk create or replace sales tax', () => this.client.post(`${this.basePath}/sales_tax/bulk_create_or_replace`, {
225
- requests,
226
- }));
227
- }
228
- /**
229
- * Delete sales tax table
230
- */
231
- async deleteSalesTax(countryCode, jurisdictionId) {
232
- return await withApiError('Failed to delete sales tax', () => this.client.delete(`${this.basePath}/sales_tax/${countryCode}/${jurisdictionId}`));
233
- }
234
- /**
235
- * Get sales tax table
236
- */
237
- async getSalesTax(countryCode, jurisdictionId) {
238
- return await withApiError('Failed to get sales tax', () => this.client.get(`${this.basePath}/sales_tax/${countryCode}/${jurisdictionId}`));
239
- }
240
- /**
241
- * Get all sales tax tables
242
- * @param countryCode - Required: Two-letter ISO 3166-1 country code
243
- */
244
- async getSalesTaxes(countryCode) {
245
- return await withApiError('Failed to get sales taxes', () => this.client.get(`${this.basePath}/sales_tax`, {
246
- country_code: countryCode,
247
- }));
248
- }
249
- /**
250
- * Get subscription information
251
- */
252
- async getSubscription(limitType) {
253
- const params = limitType ? { limit: limitType } : undefined;
254
- return await withApiError('Failed to get subscription', () => this.client.get(`${this.basePath}/subscription`, params));
255
- }
256
- /**
257
- * Opt-in to a program
258
- */
259
- async optInToProgram(request) {
260
- return await withApiError('Failed to opt in to program', () => this.client.post(`${this.basePath}/program/opt_in`, request));
261
- }
262
- /**
263
- * Opt-out of a program
264
- */
265
- async optOutOfProgram(request) {
266
- return await withApiError('Failed to opt out of program', () => this.client.post(`${this.basePath}/program/opt_out`, request));
267
- }
268
- /**
269
- * Get opted-in programs
270
- */
271
- async getOptedInPrograms() {
272
- return await withApiError('Failed to get opted in programs', () => this.client.get(`${this.basePath}/program`));
273
- }
274
- /**
275
- * Get seller eligibility for advertising programs
276
- * This method allows developers to check the seller eligibility status for eBay advertising programs.
277
- * @param programTypes - Optional comma-separated list of program types to check
278
- * @param marketplaceId - Required eBay marketplace ID (passed in X-EBAY-C-MARKETPLACE-ID header)
279
- */
280
- async getAdvertisingEligibility(marketplaceId, programTypes) {
281
- const params = programTypes ? { program_types: programTypes } : undefined;
282
- return await withApiError('Failed to get advertising eligibility', () => this.client.get(`${this.basePath}/advertising_eligibility`, params, {
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
  }