ebay-mcp 1.4.3
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/LICENSE +201 -0
- package/README.md +586 -0
- package/build/api/account-management/account.d.ts +216 -0
- package/build/api/account-management/account.js +305 -0
- package/build/api/analytics-and-report/analytics.d.ts +33 -0
- package/build/api/analytics-and-report/analytics.js +102 -0
- package/build/api/client.d.ts +89 -0
- package/build/api/client.js +343 -0
- package/build/api/communication/feedback.d.ts +45 -0
- package/build/api/communication/feedback.js +119 -0
- package/build/api/communication/message.d.ts +55 -0
- package/build/api/communication/message.js +131 -0
- package/build/api/communication/negotiation.d.ts +39 -0
- package/build/api/communication/negotiation.js +97 -0
- package/build/api/communication/notification.d.ts +128 -0
- package/build/api/communication/notification.js +373 -0
- package/build/api/index.d.ts +96 -0
- package/build/api/index.js +121 -0
- package/build/api/listing-management/inventory.d.ts +216 -0
- package/build/api/listing-management/inventory.js +633 -0
- package/build/api/listing-metadata/metadata.d.ts +154 -0
- package/build/api/listing-metadata/metadata.js +485 -0
- package/build/api/listing-metadata/taxonomy.d.ts +38 -0
- package/build/api/listing-metadata/taxonomy.js +58 -0
- package/build/api/marketing-and-promotions/marketing.d.ts +395 -0
- package/build/api/marketing-and-promotions/marketing.js +565 -0
- package/build/api/marketing-and-promotions/recommendation.d.ts +20 -0
- package/build/api/marketing-and-promotions/recommendation.js +32 -0
- package/build/api/order-management/dispute.d.ts +65 -0
- package/build/api/order-management/dispute.js +69 -0
- package/build/api/order-management/fulfillment.d.ts +80 -0
- package/build/api/order-management/fulfillment.js +89 -0
- package/build/api/other/compliance.d.ts +26 -0
- package/build/api/other/compliance.js +47 -0
- package/build/api/other/edelivery.d.ts +153 -0
- package/build/api/other/edelivery.js +219 -0
- package/build/api/other/identity.d.ts +17 -0
- package/build/api/other/identity.js +24 -0
- package/build/api/other/translation.d.ts +14 -0
- package/build/api/other/translation.js +22 -0
- package/build/api/other/vero.d.ts +30 -0
- package/build/api/other/vero.js +48 -0
- package/build/auth/oauth-metadata.d.ts +46 -0
- package/build/auth/oauth-metadata.js +59 -0
- package/build/auth/oauth-middleware.d.ts +35 -0
- package/build/auth/oauth-middleware.js +99 -0
- package/build/auth/oauth-types.d.ts +66 -0
- package/build/auth/oauth-types.js +4 -0
- package/build/auth/oauth.d.ts +93 -0
- package/build/auth/oauth.js +383 -0
- package/build/auth/scope-utils.d.ts +70 -0
- package/build/auth/scope-utils.js +304 -0
- package/build/auth/token-verifier.d.ts +57 -0
- package/build/auth/token-verifier.js +172 -0
- package/build/config/environment.d.ts +61 -0
- package/build/config/environment.js +260 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +98 -0
- package/build/schemas/account-management/account.d.ts +5324 -0
- package/build/schemas/account-management/account.js +366 -0
- package/build/schemas/analytics/analytics.d.ts +167 -0
- package/build/schemas/analytics/analytics.js +191 -0
- package/build/schemas/communication/messages.d.ts +1872 -0
- package/build/schemas/communication/messages.js +348 -0
- package/build/schemas/fulfillment/orders.d.ts +4655 -0
- package/build/schemas/fulfillment/orders.js +317 -0
- package/build/schemas/index.d.ts +2100 -0
- package/build/schemas/index.js +68 -0
- package/build/schemas/inventory-management/inventory.d.ts +6419 -0
- package/build/schemas/inventory-management/inventory.js +450 -0
- package/build/schemas/marketing/marketing.d.ts +14181 -0
- package/build/schemas/marketing/marketing.js +1088 -0
- package/build/schemas/metadata/metadata.d.ts +5259 -0
- package/build/schemas/metadata/metadata.js +614 -0
- package/build/schemas/other/other-apis.d.ts +257 -0
- package/build/schemas/other/other-apis.js +372 -0
- package/build/schemas/taxonomy/taxonomy.d.ts +215 -0
- package/build/schemas/taxonomy/taxonomy.js +571 -0
- package/build/scripts/auto-setup.d.ts +12 -0
- package/build/scripts/auto-setup.js +277 -0
- package/build/scripts/diagnostics.d.ts +8 -0
- package/build/scripts/diagnostics.js +299 -0
- package/build/scripts/download-specs.d.ts +1 -0
- package/build/scripts/download-specs.js +116 -0
- package/build/scripts/interactive-setup.d.ts +21 -0
- package/build/scripts/interactive-setup.js +723 -0
- package/build/server-http.d.ts +11 -0
- package/build/server-http.js +361 -0
- package/build/tools/definitions/account-with-schemas.d.ts +39 -0
- package/build/tools/definitions/account-with-schemas.js +170 -0
- package/build/tools/definitions/account.d.ts +12 -0
- package/build/tools/definitions/account.js +428 -0
- package/build/tools/definitions/analytics.d.ts +25 -0
- package/build/tools/definitions/analytics.js +66 -0
- package/build/tools/definitions/communication.d.ts +12 -0
- package/build/tools/definitions/communication.js +151 -0
- package/build/tools/definitions/fulfillment.d.ts +12 -0
- package/build/tools/definitions/fulfillment.js +326 -0
- package/build/tools/definitions/index.d.ts +25 -0
- package/build/tools/definitions/index.js +37 -0
- package/build/tools/definitions/inventory.d.ts +12 -0
- package/build/tools/definitions/inventory.js +429 -0
- package/build/tools/definitions/marketing.d.ts +12 -0
- package/build/tools/definitions/marketing.js +1095 -0
- package/build/tools/definitions/metadata.d.ts +12 -0
- package/build/tools/definitions/metadata.js +188 -0
- package/build/tools/definitions/other.d.ts +13 -0
- package/build/tools/definitions/other.js +309 -0
- package/build/tools/definitions/taxonomy.d.ts +25 -0
- package/build/tools/definitions/taxonomy.js +64 -0
- package/build/tools/definitions/token-management.d.ts +35 -0
- package/build/tools/definitions/token-management.js +103 -0
- package/build/tools/index.d.ts +11 -0
- package/build/tools/index.js +1003 -0
- package/build/tools/schemas.d.ts +14764 -0
- package/build/tools/schemas.js +667 -0
- package/build/tools/tool-definitions.d.ts +35 -0
- package/build/tools/tool-definitions.js +3534 -0
- package/build/types/application-settings/developerAnalyticsV1BetaOas3.d.ts +197 -0
- package/build/types/application-settings/developerAnalyticsV1BetaOas3.js +5 -0
- package/build/types/application-settings/developerClientRegistrationV1Oas3.d.ts +155 -0
- package/build/types/application-settings/developerClientRegistrationV1Oas3.js +5 -0
- package/build/types/application-settings/developerKeyManagementV1Oas3.d.ts +246 -0
- package/build/types/application-settings/developerKeyManagementV1Oas3.js +5 -0
- package/build/types/ebay-enums.d.ts +1204 -0
- package/build/types/ebay-enums.js +1330 -0
- package/build/types/ebay.d.ts +143 -0
- package/build/types/ebay.js +123 -0
- package/build/types/index.d.ts +6 -0
- package/build/types/index.js +10 -0
- package/build/types/sell-apps/account-management/sellAccountV1Oas3.d.ts +2579 -0
- package/build/types/sell-apps/account-management/sellAccountV1Oas3.js +5 -0
- package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.d.ts +446 -0
- package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.d.ts +705 -0
- package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.js +5 -0
- package/build/types/sell-apps/communication/commerceMessageV1Oas3.d.ts +590 -0
- package/build/types/sell-apps/communication/commerceMessageV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/commerceNotificationV1Oas3.d.ts +1276 -0
- package/build/types/sell-apps/communication/commerceNotificationV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/sellNegotiationV1Oas3.d.ts +277 -0
- package/build/types/sell-apps/communication/sellNegotiationV1Oas3.js +5 -0
- package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.d.ts +3133 -0
- package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.js +5 -0
- package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.d.ts +2289 -0
- package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.js +5 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.d.ts +6650 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.js +5 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.d.ts +172 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.js +5 -0
- package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.d.ts +1869 -0
- package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.d.ts +178 -0
- package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.d.ts +128 -0
- package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.d.ts +417 -0
- package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.d.ts +273 -0
- package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.d.ts +2537 -0
- package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.d.ts +6650 -0
- package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.d.ts +172 -0
- package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.js +5 -0
- package/build/utils/account-management/account.d.ts +1094 -0
- package/build/utils/account-management/account.js +831 -0
- package/build/utils/communication/feedback.d.ts +152 -0
- package/build/utils/communication/feedback.js +216 -0
- package/build/utils/communication/message.d.ts +174 -0
- package/build/utils/communication/message.js +242 -0
- package/build/utils/communication/negotiation.d.ts +123 -0
- package/build/utils/communication/negotiation.js +150 -0
- package/build/utils/communication/notification.d.ts +370 -0
- package/build/utils/communication/notification.js +369 -0
- package/build/utils/date-converter.d.ts +59 -0
- package/build/utils/date-converter.js +160 -0
- package/build/utils/llm-client-detector.d.ts +54 -0
- package/build/utils/llm-client-detector.js +318 -0
- package/build/utils/oauth-helper.d.ts +37 -0
- package/build/utils/oauth-helper.js +315 -0
- package/build/utils/order-management/dispute.d.ts +346 -0
- package/build/utils/order-management/dispute.js +369 -0
- package/build/utils/order-management/fulfillment.d.ts +200 -0
- package/build/utils/order-management/fulfillment.js +205 -0
- package/build/utils/other/compliance.d.ts +49 -0
- package/build/utils/other/compliance.js +76 -0
- package/build/utils/other/edelivery.d.ts +310 -0
- package/build/utils/other/edelivery.js +241 -0
- package/build/utils/other/identity.d.ts +13 -0
- package/build/utils/other/identity.js +13 -0
- package/build/utils/other/translation.d.ts +28 -0
- package/build/utils/other/translation.js +41 -0
- package/build/utils/other/vero.d.ts +61 -0
- package/build/utils/other/vero.js +90 -0
- package/build/utils/scope-helper.d.ts +49 -0
- package/build/utils/scope-helper.js +207 -0
- package/build/utils/security-checker.d.ts +46 -0
- package/build/utils/security-checker.js +248 -0
- package/build/utils/setup-validator.d.ts +25 -0
- package/build/utils/setup-validator.js +305 -0
- package/build/utils/token-utils.d.ts +40 -0
- package/build/utils/token-utils.js +40 -0
- package/package.json +115 -0
|
@@ -0,0 +1,831 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Zod schemas for Account API input validation
|
|
4
|
+
* Based on: src/api/account-management/account.ts
|
|
5
|
+
* OpenAPI spec: docs/sell-apps/account-management/sell_account_v1_oas3.json
|
|
6
|
+
* Types from: src/types/sell_account_v1_oas3.ts
|
|
7
|
+
*/
|
|
8
|
+
// Reusable schema for ID parameters
|
|
9
|
+
const idSchema = (name, description) => z.string({
|
|
10
|
+
message: `${name} is required`,
|
|
11
|
+
required_error: `${name.toLowerCase().replace(/\s+/g, '_')} is required`,
|
|
12
|
+
invalid_type_error: `${name.toLowerCase().replace(/\s+/g, '_')} must be a string`,
|
|
13
|
+
description,
|
|
14
|
+
});
|
|
15
|
+
// Reusable schema for optional marketplace_id parameter
|
|
16
|
+
const marketplaceIdSchema = z
|
|
17
|
+
.string({
|
|
18
|
+
invalid_type_error: 'marketplace_id must be a string',
|
|
19
|
+
description: 'The eBay marketplace ID',
|
|
20
|
+
})
|
|
21
|
+
.optional();
|
|
22
|
+
// Reusable schema for optional name parameter
|
|
23
|
+
const nameSchema = z
|
|
24
|
+
.string({
|
|
25
|
+
invalid_type_error: 'name must be a string',
|
|
26
|
+
description: 'The policy name',
|
|
27
|
+
})
|
|
28
|
+
.optional();
|
|
29
|
+
// ============================================================
|
|
30
|
+
// Custom Policy Schemas
|
|
31
|
+
// ============================================================
|
|
32
|
+
/**
|
|
33
|
+
* Schema for getCustomPolicies method
|
|
34
|
+
* Endpoint: GET /custom_policy/
|
|
35
|
+
* Query: GetCustomPoliciesParams - policy_types (optional)
|
|
36
|
+
*/
|
|
37
|
+
export const getCustomPoliciesSchema = z.object({
|
|
38
|
+
policy_types: z
|
|
39
|
+
.string({
|
|
40
|
+
invalid_type_error: 'policy_types must be a string',
|
|
41
|
+
description: 'Comma-delimited list of custom policy types (PRODUCT_COMPLIANCE, TAKE_BACK)',
|
|
42
|
+
})
|
|
43
|
+
.optional(),
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Schema for getCustomPolicy method
|
|
47
|
+
* Endpoint: GET /custom_policy/{custom_policy_id}
|
|
48
|
+
* Path: GetCustomPolicyParams - custom_policy_id (required)
|
|
49
|
+
*/
|
|
50
|
+
export const getCustomPolicySchema = z.object({
|
|
51
|
+
custom_policy_id: idSchema('Custom policy ID', 'The unique identifier of the custom policy'),
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Schema for createCustomPolicy method
|
|
55
|
+
* Endpoint: POST /custom_policy/
|
|
56
|
+
* Body: CreateCustomPolicyRequest - name, label, description, policyType
|
|
57
|
+
*/
|
|
58
|
+
export const createCustomPolicySchema = z.object({
|
|
59
|
+
name: z
|
|
60
|
+
.string({
|
|
61
|
+
invalid_type_error: 'name must be a string',
|
|
62
|
+
description: 'Seller-defined name for the custom policy (max 64 characters)',
|
|
63
|
+
})
|
|
64
|
+
.max(64, 'name must be 64 characters or less')
|
|
65
|
+
.optional(),
|
|
66
|
+
label: z
|
|
67
|
+
.string({
|
|
68
|
+
invalid_type_error: 'label must be a string',
|
|
69
|
+
description: 'Seller-defined label for the custom policy (max 250 characters)',
|
|
70
|
+
})
|
|
71
|
+
.max(250, 'label must be 250 characters or less')
|
|
72
|
+
.optional(),
|
|
73
|
+
description: z
|
|
74
|
+
.string({
|
|
75
|
+
invalid_type_error: 'description must be a string',
|
|
76
|
+
description: 'Seller-defined description of the custom policy (max 5000 characters)',
|
|
77
|
+
})
|
|
78
|
+
.max(5000, 'description must be 5000 characters or less')
|
|
79
|
+
.optional(),
|
|
80
|
+
policy_type: z
|
|
81
|
+
.string({
|
|
82
|
+
invalid_type_error: 'policy_type must be a string',
|
|
83
|
+
description: 'Type of custom policy: PRODUCT_COMPLIANCE or TAKE_BACK',
|
|
84
|
+
})
|
|
85
|
+
.optional(),
|
|
86
|
+
});
|
|
87
|
+
/**
|
|
88
|
+
* Schema for updateCustomPolicy method
|
|
89
|
+
* Endpoint: PUT /custom_policy/{custom_policy_id}
|
|
90
|
+
* Path: custom_policy_id (required)
|
|
91
|
+
* Body: UpdateCustomPolicyRequest - name, label, description
|
|
92
|
+
*/
|
|
93
|
+
export const updateCustomPolicySchema = z.object({
|
|
94
|
+
custom_policy_id: idSchema('Custom policy ID', 'The unique identifier of the custom policy to update'),
|
|
95
|
+
name: z
|
|
96
|
+
.string({
|
|
97
|
+
invalid_type_error: 'name must be a string',
|
|
98
|
+
description: 'Updated name for the custom policy (max 64 characters)',
|
|
99
|
+
})
|
|
100
|
+
.max(64, 'name must be 64 characters or less')
|
|
101
|
+
.optional(),
|
|
102
|
+
label: z
|
|
103
|
+
.string({
|
|
104
|
+
invalid_type_error: 'label must be a string',
|
|
105
|
+
description: 'Updated label for the custom policy (max 250 characters)',
|
|
106
|
+
})
|
|
107
|
+
.max(250, 'label must be 250 characters or less')
|
|
108
|
+
.optional(),
|
|
109
|
+
description: z
|
|
110
|
+
.string({
|
|
111
|
+
invalid_type_error: 'description must be a string',
|
|
112
|
+
description: 'Updated description of the custom policy (max 5000 characters)',
|
|
113
|
+
})
|
|
114
|
+
.max(5000, 'description must be 5000 characters or less')
|
|
115
|
+
.optional(),
|
|
116
|
+
});
|
|
117
|
+
/**
|
|
118
|
+
* Schema for deleteCustomPolicy method
|
|
119
|
+
* Endpoint: DELETE /custom_policy/{custom_policy_id}
|
|
120
|
+
* Path: custom_policy_id (required)
|
|
121
|
+
*/
|
|
122
|
+
export const deleteCustomPolicySchema = z.object({
|
|
123
|
+
custom_policy_id: idSchema('Custom policy ID', 'The unique identifier of the custom policy to delete'),
|
|
124
|
+
});
|
|
125
|
+
// ============================================================
|
|
126
|
+
// Fulfillment Policy Schemas
|
|
127
|
+
// ============================================================
|
|
128
|
+
/**
|
|
129
|
+
* Schema for getFulfillmentPolicies method
|
|
130
|
+
* Endpoint: GET /fulfillment_policy
|
|
131
|
+
* Query: GetFulfillmentPoliciesParams - marketplace_id (required)
|
|
132
|
+
*/
|
|
133
|
+
export const getFulfillmentPoliciesSchema = z.object({
|
|
134
|
+
marketplace_id: z.string({
|
|
135
|
+
message: 'Marketplace ID is required',
|
|
136
|
+
required_error: 'marketplace_id is required',
|
|
137
|
+
invalid_type_error: 'marketplace_id must be a string',
|
|
138
|
+
description: 'The eBay marketplace ID',
|
|
139
|
+
}),
|
|
140
|
+
});
|
|
141
|
+
/**
|
|
142
|
+
* Schema for getFulfillmentPolicy method
|
|
143
|
+
* Endpoint: GET /fulfillment_policy/{fulfillmentPolicyId}
|
|
144
|
+
* Path: GetFulfillmentPolicyParams - fulfillmentPolicyId (required)
|
|
145
|
+
*/
|
|
146
|
+
export const getFulfillmentPolicySchema = z.object({
|
|
147
|
+
fulfillment_policy_id: idSchema('Fulfillment policy ID', 'The unique identifier of the fulfillment policy'),
|
|
148
|
+
});
|
|
149
|
+
/**
|
|
150
|
+
* Schema for getFulfillmentPolicyByName method
|
|
151
|
+
* Endpoint: GET /fulfillment_policy/get_by_policy_name
|
|
152
|
+
* Query: GetFulfillmentPolicyByNameParams - marketplace_id (required), name (required)
|
|
153
|
+
*/
|
|
154
|
+
export const getFulfillmentPolicyByNameSchema = z.object({
|
|
155
|
+
marketplace_id: z.string({
|
|
156
|
+
message: 'Marketplace ID is required',
|
|
157
|
+
required_error: 'marketplace_id is required',
|
|
158
|
+
invalid_type_error: 'marketplace_id must be a string',
|
|
159
|
+
description: 'The eBay marketplace ID',
|
|
160
|
+
}),
|
|
161
|
+
name: z.string({
|
|
162
|
+
message: 'Policy name is required',
|
|
163
|
+
required_error: 'name is required',
|
|
164
|
+
invalid_type_error: 'name must be a string',
|
|
165
|
+
description: 'The fulfillment policy name',
|
|
166
|
+
}),
|
|
167
|
+
});
|
|
168
|
+
/**
|
|
169
|
+
* Schema for createFulfillmentPolicy method
|
|
170
|
+
* Endpoint: POST /fulfillment_policy/
|
|
171
|
+
* Body: FulfillmentPolicyRequest - complex object with many optional fields
|
|
172
|
+
*/
|
|
173
|
+
export const createFulfillmentPolicySchema = z.object({
|
|
174
|
+
category_types: z
|
|
175
|
+
.array(z.object({
|
|
176
|
+
name: z
|
|
177
|
+
.string({
|
|
178
|
+
invalid_type_error: 'category type name must be a string',
|
|
179
|
+
description: 'Category type: ALL_EXCLUDING_MOTORS_VEHICLES or MOTORS_VEHICLES',
|
|
180
|
+
})
|
|
181
|
+
.optional(),
|
|
182
|
+
}))
|
|
183
|
+
.optional(),
|
|
184
|
+
description: z
|
|
185
|
+
.string({
|
|
186
|
+
invalid_type_error: 'description must be a string',
|
|
187
|
+
description: 'Seller-defined description of the fulfillment policy (max 250 characters)',
|
|
188
|
+
})
|
|
189
|
+
.max(250, 'description must be 250 characters or less')
|
|
190
|
+
.optional(),
|
|
191
|
+
freight_shipping: z
|
|
192
|
+
.boolean({
|
|
193
|
+
invalid_type_error: 'freight_shipping must be a boolean',
|
|
194
|
+
description: 'Whether freight shipping is available for large items over 150 lbs',
|
|
195
|
+
})
|
|
196
|
+
.optional(),
|
|
197
|
+
global_shipping: z
|
|
198
|
+
.boolean({
|
|
199
|
+
invalid_type_error: 'global_shipping must be a boolean',
|
|
200
|
+
description: 'Whether to use Global Shipping Program (UK marketplace only)',
|
|
201
|
+
})
|
|
202
|
+
.optional(),
|
|
203
|
+
handling_time: z
|
|
204
|
+
.object({
|
|
205
|
+
unit: z
|
|
206
|
+
.string({
|
|
207
|
+
invalid_type_error: 'unit must be a string',
|
|
208
|
+
description: 'Time unit (typically DAY)',
|
|
209
|
+
})
|
|
210
|
+
.optional(),
|
|
211
|
+
value: z
|
|
212
|
+
.number({
|
|
213
|
+
invalid_type_error: 'value must be a number',
|
|
214
|
+
description: 'Number of handling time units (0-20 days)',
|
|
215
|
+
})
|
|
216
|
+
.int()
|
|
217
|
+
.optional(),
|
|
218
|
+
})
|
|
219
|
+
.optional(),
|
|
220
|
+
local_pickup: z
|
|
221
|
+
.boolean({
|
|
222
|
+
invalid_type_error: 'local_pickup must be a boolean',
|
|
223
|
+
description: 'Whether local pickup is available',
|
|
224
|
+
})
|
|
225
|
+
.optional(),
|
|
226
|
+
marketplace_id: marketplaceIdSchema,
|
|
227
|
+
name: z
|
|
228
|
+
.string({
|
|
229
|
+
invalid_type_error: 'name must be a string',
|
|
230
|
+
description: 'Seller-defined name for the fulfillment policy (max 64 characters)',
|
|
231
|
+
})
|
|
232
|
+
.max(64, 'name must be 64 characters or less')
|
|
233
|
+
.optional(),
|
|
234
|
+
pickup_drop_off: z
|
|
235
|
+
.boolean({
|
|
236
|
+
invalid_type_error: 'pickup_drop_off must be a boolean',
|
|
237
|
+
description: 'Whether Click and Collect is available',
|
|
238
|
+
})
|
|
239
|
+
.optional(),
|
|
240
|
+
shipping_options: z.array(z.record(z.unknown())).optional(),
|
|
241
|
+
ship_to_locations: z
|
|
242
|
+
.object({
|
|
243
|
+
region_included: z.array(z.record(z.unknown())).optional(),
|
|
244
|
+
region_excluded: z.array(z.record(z.unknown())).optional(),
|
|
245
|
+
})
|
|
246
|
+
.optional(),
|
|
247
|
+
});
|
|
248
|
+
/**
|
|
249
|
+
* Schema for updateFulfillmentPolicy method
|
|
250
|
+
* Endpoint: PUT /fulfillment_policy/{fulfillmentPolicyId}
|
|
251
|
+
* Path: fulfillmentPolicyId (required)
|
|
252
|
+
* Body: FulfillmentPolicyRequest
|
|
253
|
+
*/
|
|
254
|
+
export const updateFulfillmentPolicySchema = z.object({
|
|
255
|
+
fulfillment_policy_id: idSchema('Fulfillment policy ID', 'The unique identifier of the fulfillment policy to update'),
|
|
256
|
+
category_types: z
|
|
257
|
+
.array(z.object({
|
|
258
|
+
name: z.string().optional(),
|
|
259
|
+
}))
|
|
260
|
+
.optional(),
|
|
261
|
+
description: z.string().max(250).optional(),
|
|
262
|
+
freight_shipping: z.boolean().optional(),
|
|
263
|
+
global_shipping: z.boolean().optional(),
|
|
264
|
+
handling_time: z
|
|
265
|
+
.object({
|
|
266
|
+
unit: z.string().optional(),
|
|
267
|
+
value: z.number().int().optional(),
|
|
268
|
+
})
|
|
269
|
+
.optional(),
|
|
270
|
+
local_pickup: z.boolean().optional(),
|
|
271
|
+
marketplace_id: marketplaceIdSchema,
|
|
272
|
+
name: z.string().max(64).optional(),
|
|
273
|
+
pickup_drop_off: z.boolean().optional(),
|
|
274
|
+
shipping_options: z.array(z.record(z.unknown())).optional(),
|
|
275
|
+
ship_to_locations: z
|
|
276
|
+
.object({
|
|
277
|
+
region_included: z.array(z.record(z.unknown())).optional(),
|
|
278
|
+
region_excluded: z.array(z.record(z.unknown())).optional(),
|
|
279
|
+
})
|
|
280
|
+
.optional(),
|
|
281
|
+
});
|
|
282
|
+
/**
|
|
283
|
+
* Schema for deleteFulfillmentPolicy method
|
|
284
|
+
* Endpoint: DELETE /fulfillment_policy/{fulfillmentPolicyId}
|
|
285
|
+
* Path: fulfillmentPolicyId (required)
|
|
286
|
+
*/
|
|
287
|
+
export const deleteFulfillmentPolicySchema = z.object({
|
|
288
|
+
fulfillment_policy_id: idSchema('Fulfillment policy ID', 'The unique identifier of the fulfillment policy to delete'),
|
|
289
|
+
});
|
|
290
|
+
// ============================================================
|
|
291
|
+
// Payment Policy Schemas
|
|
292
|
+
// ============================================================
|
|
293
|
+
/**
|
|
294
|
+
* Schema for getPaymentPolicies method
|
|
295
|
+
* Endpoint: GET /payment_policy
|
|
296
|
+
* Query: GetPaymentPoliciesParams - marketplace_id (required)
|
|
297
|
+
*/
|
|
298
|
+
export const getPaymentPoliciesSchema = z.object({
|
|
299
|
+
marketplace_id: z.string({
|
|
300
|
+
message: 'Marketplace ID is required',
|
|
301
|
+
required_error: 'marketplace_id is required',
|
|
302
|
+
invalid_type_error: 'marketplace_id must be a string',
|
|
303
|
+
description: 'The eBay marketplace ID',
|
|
304
|
+
}),
|
|
305
|
+
});
|
|
306
|
+
/**
|
|
307
|
+
* Schema for getPaymentPolicy method
|
|
308
|
+
* Endpoint: GET /payment_policy/{paymentPolicyId}
|
|
309
|
+
* Path: GetPaymentPolicyParams - paymentPolicyId (required)
|
|
310
|
+
*/
|
|
311
|
+
export const getPaymentPolicySchema = z.object({
|
|
312
|
+
payment_policy_id: idSchema('Payment policy ID', 'The unique identifier of the payment policy'),
|
|
313
|
+
});
|
|
314
|
+
/**
|
|
315
|
+
* Schema for getPaymentPolicyByName method
|
|
316
|
+
* Endpoint: GET /payment_policy/get_by_policy_name
|
|
317
|
+
* Query: GetPaymentPolicyByNameParams - marketplace_id (required), name (required)
|
|
318
|
+
*/
|
|
319
|
+
export const getPaymentPolicyByNameSchema = z.object({
|
|
320
|
+
marketplace_id: z.string({
|
|
321
|
+
message: 'Marketplace ID is required',
|
|
322
|
+
required_error: 'marketplace_id is required',
|
|
323
|
+
invalid_type_error: 'marketplace_id must be a string',
|
|
324
|
+
description: 'The eBay marketplace ID',
|
|
325
|
+
}),
|
|
326
|
+
name: z.string({
|
|
327
|
+
message: 'Policy name is required',
|
|
328
|
+
required_error: 'name is required',
|
|
329
|
+
invalid_type_error: 'name must be a string',
|
|
330
|
+
description: 'The payment policy name',
|
|
331
|
+
}),
|
|
332
|
+
});
|
|
333
|
+
/**
|
|
334
|
+
* Schema for createPaymentPolicy method
|
|
335
|
+
* Endpoint: POST /payment_policy/
|
|
336
|
+
* Body: PaymentPolicyRequest - complex object with many optional fields
|
|
337
|
+
*/
|
|
338
|
+
export const createPaymentPolicySchema = z.object({
|
|
339
|
+
category_types: z
|
|
340
|
+
.array(z.object({
|
|
341
|
+
name: z.string().optional(),
|
|
342
|
+
}))
|
|
343
|
+
.optional(),
|
|
344
|
+
description: z
|
|
345
|
+
.string({
|
|
346
|
+
invalid_type_error: 'description must be a string',
|
|
347
|
+
description: 'Seller-defined description of the payment policy (max 250 characters)',
|
|
348
|
+
})
|
|
349
|
+
.max(250, 'description must be 250 characters or less')
|
|
350
|
+
.optional(),
|
|
351
|
+
deposit: z
|
|
352
|
+
.object({
|
|
353
|
+
amount: z
|
|
354
|
+
.object({
|
|
355
|
+
currency: z.string().optional(),
|
|
356
|
+
value: z.string().optional(),
|
|
357
|
+
})
|
|
358
|
+
.optional(),
|
|
359
|
+
due_in: z
|
|
360
|
+
.object({
|
|
361
|
+
unit: z.string().optional(),
|
|
362
|
+
value: z.number().int().optional(),
|
|
363
|
+
})
|
|
364
|
+
.optional(),
|
|
365
|
+
payment_methods: z.array(z.record(z.unknown())).optional(),
|
|
366
|
+
})
|
|
367
|
+
.optional(),
|
|
368
|
+
full_payment_due_in: z
|
|
369
|
+
.object({
|
|
370
|
+
unit: z.string().optional(),
|
|
371
|
+
value: z.number().int().optional(),
|
|
372
|
+
})
|
|
373
|
+
.optional(),
|
|
374
|
+
immediate_pay: z
|
|
375
|
+
.boolean({
|
|
376
|
+
invalid_type_error: 'immediate_pay must be a boolean',
|
|
377
|
+
description: 'Whether immediate payment is required',
|
|
378
|
+
})
|
|
379
|
+
.optional(),
|
|
380
|
+
marketplace_id: marketplaceIdSchema,
|
|
381
|
+
name: z
|
|
382
|
+
.string({
|
|
383
|
+
invalid_type_error: 'name must be a string',
|
|
384
|
+
description: 'Seller-defined name for the payment policy (max 64 characters)',
|
|
385
|
+
})
|
|
386
|
+
.max(64, 'name must be 64 characters or less')
|
|
387
|
+
.optional(),
|
|
388
|
+
payment_methods: z.array(z.record(z.unknown())).optional(),
|
|
389
|
+
});
|
|
390
|
+
/**
|
|
391
|
+
* Schema for updatePaymentPolicy method
|
|
392
|
+
* Endpoint: PUT /payment_policy/{paymentPolicyId}
|
|
393
|
+
* Path: paymentPolicyId (required)
|
|
394
|
+
* Body: PaymentPolicyRequest
|
|
395
|
+
*/
|
|
396
|
+
export const updatePaymentPolicySchema = z.object({
|
|
397
|
+
payment_policy_id: idSchema('Payment policy ID', 'The unique identifier of the payment policy to update'),
|
|
398
|
+
category_types: z
|
|
399
|
+
.array(z.object({
|
|
400
|
+
name: z.string().optional(),
|
|
401
|
+
}))
|
|
402
|
+
.optional(),
|
|
403
|
+
description: z.string().max(250).optional(),
|
|
404
|
+
deposit: z
|
|
405
|
+
.object({
|
|
406
|
+
amount: z
|
|
407
|
+
.object({
|
|
408
|
+
currency: z.string().optional(),
|
|
409
|
+
value: z.string().optional(),
|
|
410
|
+
})
|
|
411
|
+
.optional(),
|
|
412
|
+
due_in: z
|
|
413
|
+
.object({
|
|
414
|
+
unit: z.string().optional(),
|
|
415
|
+
value: z.number().int().optional(),
|
|
416
|
+
})
|
|
417
|
+
.optional(),
|
|
418
|
+
payment_methods: z.array(z.record(z.unknown())).optional(),
|
|
419
|
+
})
|
|
420
|
+
.optional(),
|
|
421
|
+
full_payment_due_in: z
|
|
422
|
+
.object({
|
|
423
|
+
unit: z.string().optional(),
|
|
424
|
+
value: z.number().int().optional(),
|
|
425
|
+
})
|
|
426
|
+
.optional(),
|
|
427
|
+
immediate_pay: z.boolean().optional(),
|
|
428
|
+
marketplace_id: marketplaceIdSchema,
|
|
429
|
+
name: z.string().max(64).optional(),
|
|
430
|
+
payment_methods: z.array(z.record(z.unknown())).optional(),
|
|
431
|
+
});
|
|
432
|
+
/**
|
|
433
|
+
* Schema for deletePaymentPolicy method
|
|
434
|
+
* Endpoint: DELETE /payment_policy/{paymentPolicyId}
|
|
435
|
+
* Path: paymentPolicyId (required)
|
|
436
|
+
*/
|
|
437
|
+
export const deletePaymentPolicySchema = z.object({
|
|
438
|
+
payment_policy_id: idSchema('Payment policy ID', 'The unique identifier of the payment policy to delete'),
|
|
439
|
+
});
|
|
440
|
+
// ============================================================
|
|
441
|
+
// Return Policy Schemas
|
|
442
|
+
// ============================================================
|
|
443
|
+
/**
|
|
444
|
+
* Schema for getReturnPolicies method
|
|
445
|
+
* Endpoint: GET /return_policy
|
|
446
|
+
* Query: GetReturnPoliciesParams - marketplace_id (required)
|
|
447
|
+
*/
|
|
448
|
+
export const getReturnPoliciesSchema = z.object({
|
|
449
|
+
marketplace_id: z.string({
|
|
450
|
+
message: 'Marketplace ID is required',
|
|
451
|
+
required_error: 'marketplace_id is required',
|
|
452
|
+
invalid_type_error: 'marketplace_id must be a string',
|
|
453
|
+
description: 'The eBay marketplace ID',
|
|
454
|
+
}),
|
|
455
|
+
});
|
|
456
|
+
/**
|
|
457
|
+
* Schema for getReturnPolicy method
|
|
458
|
+
* Endpoint: GET /return_policy/{returnPolicyId}
|
|
459
|
+
* Path: GetReturnPolicyParams - returnPolicyId (required)
|
|
460
|
+
*/
|
|
461
|
+
export const getReturnPolicySchema = z.object({
|
|
462
|
+
return_policy_id: idSchema('Return policy ID', 'The unique identifier of the return policy'),
|
|
463
|
+
});
|
|
464
|
+
/**
|
|
465
|
+
* Schema for getReturnPolicyByName method
|
|
466
|
+
* Endpoint: GET /return_policy/get_by_policy_name
|
|
467
|
+
* Query: GetReturnPolicyByNameParams - marketplace_id (required), name (required)
|
|
468
|
+
*/
|
|
469
|
+
export const getReturnPolicyByNameSchema = z.object({
|
|
470
|
+
marketplace_id: z.string({
|
|
471
|
+
message: 'Marketplace ID is required',
|
|
472
|
+
required_error: 'marketplace_id is required',
|
|
473
|
+
invalid_type_error: 'marketplace_id must be a string',
|
|
474
|
+
description: 'The eBay marketplace ID',
|
|
475
|
+
}),
|
|
476
|
+
name: z.string({
|
|
477
|
+
message: 'Policy name is required',
|
|
478
|
+
required_error: 'name is required',
|
|
479
|
+
invalid_type_error: 'name must be a string',
|
|
480
|
+
description: 'The return policy name',
|
|
481
|
+
}),
|
|
482
|
+
});
|
|
483
|
+
/**
|
|
484
|
+
* Schema for createReturnPolicy method
|
|
485
|
+
* Endpoint: POST /return_policy/
|
|
486
|
+
* Body: ReturnPolicyRequest - complex object with many optional fields
|
|
487
|
+
*/
|
|
488
|
+
export const createReturnPolicySchema = z.object({
|
|
489
|
+
category_types: z
|
|
490
|
+
.array(z.object({
|
|
491
|
+
name: z.string().optional(),
|
|
492
|
+
}))
|
|
493
|
+
.optional(),
|
|
494
|
+
description: z
|
|
495
|
+
.string({
|
|
496
|
+
invalid_type_error: 'description must be a string',
|
|
497
|
+
description: 'Seller-defined description of the return policy (max 250 characters)',
|
|
498
|
+
})
|
|
499
|
+
.max(250, 'description must be 250 characters or less')
|
|
500
|
+
.optional(),
|
|
501
|
+
extended_holiday_returns_offered: z
|
|
502
|
+
.boolean({
|
|
503
|
+
invalid_type_error: 'extended_holiday_returns_offered must be a boolean',
|
|
504
|
+
description: 'Whether extended holiday returns are offered',
|
|
505
|
+
})
|
|
506
|
+
.optional(),
|
|
507
|
+
international_override: z
|
|
508
|
+
.object({
|
|
509
|
+
return_method: z.string().optional(),
|
|
510
|
+
return_period: z
|
|
511
|
+
.object({
|
|
512
|
+
unit: z.string().optional(),
|
|
513
|
+
value: z.number().int().optional(),
|
|
514
|
+
})
|
|
515
|
+
.optional(),
|
|
516
|
+
returns_accepted: z.boolean().optional(),
|
|
517
|
+
return_shipping_cost_payer: z.string().optional(),
|
|
518
|
+
})
|
|
519
|
+
.optional(),
|
|
520
|
+
marketplace_id: marketplaceIdSchema,
|
|
521
|
+
name: z
|
|
522
|
+
.string({
|
|
523
|
+
invalid_type_error: 'name must be a string',
|
|
524
|
+
description: 'Seller-defined name for the return policy (max 64 characters)',
|
|
525
|
+
})
|
|
526
|
+
.max(64, 'name must be 64 characters or less')
|
|
527
|
+
.optional(),
|
|
528
|
+
refund_method: z
|
|
529
|
+
.string({
|
|
530
|
+
invalid_type_error: 'refund_method must be a string',
|
|
531
|
+
description: 'Refund method: MONEY_BACK or MERCHANDISE_CREDIT',
|
|
532
|
+
})
|
|
533
|
+
.optional(),
|
|
534
|
+
restocking_fee_percentage: z
|
|
535
|
+
.string({
|
|
536
|
+
invalid_type_error: 'restocking_fee_percentage must be a string',
|
|
537
|
+
description: 'Restocking fee percentage (10, 15, 20, or custom)',
|
|
538
|
+
})
|
|
539
|
+
.optional(),
|
|
540
|
+
return_instructions: z
|
|
541
|
+
.string({
|
|
542
|
+
invalid_type_error: 'return_instructions must be a string',
|
|
543
|
+
description: 'Return instructions for the buyer (max 5000 characters)',
|
|
544
|
+
})
|
|
545
|
+
.max(5000, 'return_instructions must be 5000 characters or less')
|
|
546
|
+
.optional(),
|
|
547
|
+
return_method: z
|
|
548
|
+
.string({
|
|
549
|
+
invalid_type_error: 'return_method must be a string',
|
|
550
|
+
description: 'Return method: REPLACEMENT or EXCHANGE',
|
|
551
|
+
})
|
|
552
|
+
.optional(),
|
|
553
|
+
return_period: z
|
|
554
|
+
.object({
|
|
555
|
+
unit: z.string().optional(),
|
|
556
|
+
value: z.number().int().optional(),
|
|
557
|
+
})
|
|
558
|
+
.optional(),
|
|
559
|
+
returns_accepted: z
|
|
560
|
+
.boolean({
|
|
561
|
+
invalid_type_error: 'returns_accepted must be a boolean',
|
|
562
|
+
description: 'Whether returns are accepted',
|
|
563
|
+
})
|
|
564
|
+
.optional(),
|
|
565
|
+
return_shipping_cost_payer: z
|
|
566
|
+
.string({
|
|
567
|
+
invalid_type_error: 'return_shipping_cost_payer must be a string',
|
|
568
|
+
description: 'Who pays return shipping: BUYER or SELLER',
|
|
569
|
+
})
|
|
570
|
+
.optional(),
|
|
571
|
+
});
|
|
572
|
+
/**
|
|
573
|
+
* Schema for updateReturnPolicy method
|
|
574
|
+
* Endpoint: PUT /return_policy/{returnPolicyId}
|
|
575
|
+
* Path: returnPolicyId (required)
|
|
576
|
+
* Body: ReturnPolicyRequest
|
|
577
|
+
*/
|
|
578
|
+
export const updateReturnPolicySchema = z.object({
|
|
579
|
+
return_policy_id: idSchema('Return policy ID', 'The unique identifier of the return policy to update'),
|
|
580
|
+
category_types: z
|
|
581
|
+
.array(z.object({
|
|
582
|
+
name: z.string().optional(),
|
|
583
|
+
}))
|
|
584
|
+
.optional(),
|
|
585
|
+
description: z.string().max(250).optional(),
|
|
586
|
+
extended_holiday_returns_offered: z.boolean().optional(),
|
|
587
|
+
international_override: z
|
|
588
|
+
.object({
|
|
589
|
+
return_method: z.string().optional(),
|
|
590
|
+
return_period: z
|
|
591
|
+
.object({
|
|
592
|
+
unit: z.string().optional(),
|
|
593
|
+
value: z.number().int().optional(),
|
|
594
|
+
})
|
|
595
|
+
.optional(),
|
|
596
|
+
returns_accepted: z.boolean().optional(),
|
|
597
|
+
return_shipping_cost_payer: z.string().optional(),
|
|
598
|
+
})
|
|
599
|
+
.optional(),
|
|
600
|
+
marketplace_id: marketplaceIdSchema,
|
|
601
|
+
name: z.string().max(64).optional(),
|
|
602
|
+
refund_method: z.string().optional(),
|
|
603
|
+
restocking_fee_percentage: z.string().optional(),
|
|
604
|
+
return_instructions: z.string().max(5000).optional(),
|
|
605
|
+
return_method: z.string().optional(),
|
|
606
|
+
return_period: z
|
|
607
|
+
.object({
|
|
608
|
+
unit: z.string().optional(),
|
|
609
|
+
value: z.number().int().optional(),
|
|
610
|
+
})
|
|
611
|
+
.optional(),
|
|
612
|
+
returns_accepted: z.boolean().optional(),
|
|
613
|
+
return_shipping_cost_payer: z.string().optional(),
|
|
614
|
+
});
|
|
615
|
+
/**
|
|
616
|
+
* Schema for deleteReturnPolicy method
|
|
617
|
+
* Endpoint: DELETE /return_policy/{returnPolicyId}
|
|
618
|
+
* Path: returnPolicyId (required)
|
|
619
|
+
*/
|
|
620
|
+
export const deleteReturnPolicySchema = z.object({
|
|
621
|
+
return_policy_id: idSchema('Return policy ID', 'The unique identifier of the return policy to delete'),
|
|
622
|
+
});
|
|
623
|
+
// ============================================================
|
|
624
|
+
// Privileges, KYC, and Other Account Schemas
|
|
625
|
+
// ============================================================
|
|
626
|
+
/**
|
|
627
|
+
* Schema for getPrivileges method
|
|
628
|
+
* Endpoint: GET /privilege
|
|
629
|
+
* No parameters required
|
|
630
|
+
*/
|
|
631
|
+
export const getPrivilegesSchema = z.object({});
|
|
632
|
+
/**
|
|
633
|
+
* Schema for getKyc method
|
|
634
|
+
* Endpoint: GET /kyc
|
|
635
|
+
* No parameters required
|
|
636
|
+
*/
|
|
637
|
+
export const getKycSchema = z.object({});
|
|
638
|
+
/**
|
|
639
|
+
* Schema for optInToPaymentsProgram method
|
|
640
|
+
* Endpoint: POST /payments_program/{marketplace_id}/{payments_program_type}
|
|
641
|
+
* Path: marketplace_id (required), payments_program_type (required)
|
|
642
|
+
*/
|
|
643
|
+
export const optInToPaymentsProgramSchema = z.object({
|
|
644
|
+
marketplace_id: z.string({
|
|
645
|
+
message: 'Marketplace ID is required',
|
|
646
|
+
required_error: 'marketplace_id is required',
|
|
647
|
+
invalid_type_error: 'marketplace_id must be a string',
|
|
648
|
+
description: 'The eBay marketplace ID',
|
|
649
|
+
}),
|
|
650
|
+
payments_program_type: z.string({
|
|
651
|
+
message: 'Payments program type is required',
|
|
652
|
+
required_error: 'payments_program_type is required',
|
|
653
|
+
invalid_type_error: 'payments_program_type must be a string',
|
|
654
|
+
description: 'The payments program type (e.g., EBAY_PAYMENTS)',
|
|
655
|
+
}),
|
|
656
|
+
});
|
|
657
|
+
/**
|
|
658
|
+
* Schema for getPaymentsProgramStatus method
|
|
659
|
+
* Endpoint: GET /payments_program/{marketplace_id}/{payments_program_type}
|
|
660
|
+
* Path: marketplace_id (required), payments_program_type (required)
|
|
661
|
+
*/
|
|
662
|
+
export const getPaymentsProgramStatusSchema = z.object({
|
|
663
|
+
marketplace_id: z.string({
|
|
664
|
+
message: 'Marketplace ID is required',
|
|
665
|
+
required_error: 'marketplace_id is required',
|
|
666
|
+
invalid_type_error: 'marketplace_id must be a string',
|
|
667
|
+
description: 'The eBay marketplace ID',
|
|
668
|
+
}),
|
|
669
|
+
payments_program_type: z.string({
|
|
670
|
+
message: 'Payments program type is required',
|
|
671
|
+
required_error: 'payments_program_type is required',
|
|
672
|
+
invalid_type_error: 'payments_program_type must be a string',
|
|
673
|
+
description: 'The payments program type',
|
|
674
|
+
}),
|
|
675
|
+
});
|
|
676
|
+
/**
|
|
677
|
+
* Schema for getRateTables method
|
|
678
|
+
* Endpoint: GET /rate_table
|
|
679
|
+
* No parameters required
|
|
680
|
+
*/
|
|
681
|
+
export const getRateTablesSchema = z.object({});
|
|
682
|
+
/**
|
|
683
|
+
* Schema for createOrReplaceSalesTax method
|
|
684
|
+
* Endpoint: PUT /sales_tax/{country_code}/{jurisdiction_id}
|
|
685
|
+
* Path: country_code (required), jurisdiction_id (required)
|
|
686
|
+
* Body: SalesTaxBase - sales_tax_percentage, shipping_and_handling_taxed
|
|
687
|
+
*/
|
|
688
|
+
export const createOrReplaceSalesTaxSchema = z.object({
|
|
689
|
+
country_code: z.string({
|
|
690
|
+
message: 'Country code is required',
|
|
691
|
+
required_error: 'country_code is required',
|
|
692
|
+
invalid_type_error: 'country_code must be a string',
|
|
693
|
+
description: 'Two-letter ISO 3166-1 country code',
|
|
694
|
+
}),
|
|
695
|
+
jurisdiction_id: z.string({
|
|
696
|
+
message: 'Jurisdiction ID is required',
|
|
697
|
+
required_error: 'jurisdiction_id is required',
|
|
698
|
+
invalid_type_error: 'jurisdiction_id must be a string',
|
|
699
|
+
description: 'State or province ID (e.g., US state abbreviation)',
|
|
700
|
+
}),
|
|
701
|
+
sales_tax_percentage: z
|
|
702
|
+
.string({
|
|
703
|
+
invalid_type_error: 'sales_tax_percentage must be a string',
|
|
704
|
+
description: 'Sales tax percentage (0-100)',
|
|
705
|
+
})
|
|
706
|
+
.optional(),
|
|
707
|
+
shipping_and_handling_taxed: z
|
|
708
|
+
.boolean({
|
|
709
|
+
invalid_type_error: 'shipping_and_handling_taxed must be a boolean',
|
|
710
|
+
description: 'Whether shipping and handling are taxed',
|
|
711
|
+
})
|
|
712
|
+
.optional(),
|
|
713
|
+
});
|
|
714
|
+
/**
|
|
715
|
+
* Schema for bulkCreateOrReplaceSalesTax method
|
|
716
|
+
* Endpoint: POST /sales_tax/bulk_create_or_replace
|
|
717
|
+
* Body: Array of sales tax requests
|
|
718
|
+
*/
|
|
719
|
+
export const bulkCreateOrReplaceSalesTaxSchema = z.object({
|
|
720
|
+
requests: z
|
|
721
|
+
.array(z.object({
|
|
722
|
+
country_code: z.string().optional(),
|
|
723
|
+
jurisdiction_id: z.string().optional(),
|
|
724
|
+
sales_tax_base: z
|
|
725
|
+
.object({
|
|
726
|
+
sales_tax_percentage: z.string().optional(),
|
|
727
|
+
shipping_and_handling_taxed: z.boolean().optional(),
|
|
728
|
+
})
|
|
729
|
+
.optional(),
|
|
730
|
+
}), {
|
|
731
|
+
invalid_type_error: 'requests must be an array',
|
|
732
|
+
description: 'Array of sales tax requests',
|
|
733
|
+
})
|
|
734
|
+
.optional(),
|
|
735
|
+
});
|
|
736
|
+
/**
|
|
737
|
+
* Schema for getSalesTax method
|
|
738
|
+
* Endpoint: GET /sales_tax/{country_code}/{jurisdiction_id}
|
|
739
|
+
* Path: country_code (required), jurisdiction_id (required)
|
|
740
|
+
*/
|
|
741
|
+
export const getSalesTaxSchema = z.object({
|
|
742
|
+
country_code: z.string({
|
|
743
|
+
message: 'Country code is required',
|
|
744
|
+
required_error: 'country_code is required',
|
|
745
|
+
invalid_type_error: 'country_code must be a string',
|
|
746
|
+
description: 'Two-letter ISO 3166-1 country code',
|
|
747
|
+
}),
|
|
748
|
+
jurisdiction_id: z.string({
|
|
749
|
+
message: 'Jurisdiction ID is required',
|
|
750
|
+
required_error: 'jurisdiction_id is required',
|
|
751
|
+
invalid_type_error: 'jurisdiction_id must be a string',
|
|
752
|
+
description: 'State or province ID',
|
|
753
|
+
}),
|
|
754
|
+
});
|
|
755
|
+
/**
|
|
756
|
+
* Schema for deleteSalesTax method
|
|
757
|
+
* Endpoint: DELETE /sales_tax/{country_code}/{jurisdiction_id}
|
|
758
|
+
* Path: country_code (required), jurisdiction_id (required)
|
|
759
|
+
*/
|
|
760
|
+
export const deleteSalesTaxSchema = z.object({
|
|
761
|
+
country_code: z.string({
|
|
762
|
+
message: 'Country code is required',
|
|
763
|
+
required_error: 'country_code is required',
|
|
764
|
+
invalid_type_error: 'country_code must be a string',
|
|
765
|
+
description: 'Two-letter ISO 3166-1 country code',
|
|
766
|
+
}),
|
|
767
|
+
jurisdiction_id: z.string({
|
|
768
|
+
message: 'Jurisdiction ID is required',
|
|
769
|
+
required_error: 'jurisdiction_id is required',
|
|
770
|
+
invalid_type_error: 'jurisdiction_id must be a string',
|
|
771
|
+
description: 'State or province ID',
|
|
772
|
+
}),
|
|
773
|
+
});
|
|
774
|
+
/**
|
|
775
|
+
* Schema for getSalesTaxes method
|
|
776
|
+
* Endpoint: GET /sales_tax
|
|
777
|
+
* Query: GetSalesTaxesParams - country_code (required)
|
|
778
|
+
*/
|
|
779
|
+
export const getSalesTaxesSchema = z.object({
|
|
780
|
+
country_code: z.string({
|
|
781
|
+
message: 'Country code is required',
|
|
782
|
+
required_error: 'country_code is required',
|
|
783
|
+
invalid_type_error: 'country_code must be a string',
|
|
784
|
+
description: 'Two-letter ISO 3166-1 country code',
|
|
785
|
+
}),
|
|
786
|
+
});
|
|
787
|
+
/**
|
|
788
|
+
* Schema for getSubscription method
|
|
789
|
+
* Endpoint: GET /subscription
|
|
790
|
+
* Query: GetSubscriptionParams - limit (optional)
|
|
791
|
+
*/
|
|
792
|
+
export const getSubscriptionSchema = z.object({
|
|
793
|
+
limit_type: z
|
|
794
|
+
.string({
|
|
795
|
+
invalid_type_error: 'limit_type must be a string',
|
|
796
|
+
description: 'Type of subscription limit to retrieve',
|
|
797
|
+
})
|
|
798
|
+
.optional(),
|
|
799
|
+
});
|
|
800
|
+
/**
|
|
801
|
+
* Schema for optInToProgram method
|
|
802
|
+
* Endpoint: POST /program/opt_in
|
|
803
|
+
* Body: OptInToProgramRequest - program_type
|
|
804
|
+
*/
|
|
805
|
+
export const optInToProgramSchema = z.object({
|
|
806
|
+
program_type: z
|
|
807
|
+
.string({
|
|
808
|
+
invalid_type_error: 'program_type must be a string',
|
|
809
|
+
description: 'The program type to opt into (e.g., OUT_OF_STOCK_CONTROL)',
|
|
810
|
+
})
|
|
811
|
+
.optional(),
|
|
812
|
+
});
|
|
813
|
+
/**
|
|
814
|
+
* Schema for optOutOfProgram method
|
|
815
|
+
* Endpoint: POST /program/opt_out
|
|
816
|
+
* Body: OptInToProgramRequest - program_type
|
|
817
|
+
*/
|
|
818
|
+
export const optOutOfProgramSchema = z.object({
|
|
819
|
+
program_type: z
|
|
820
|
+
.string({
|
|
821
|
+
invalid_type_error: 'program_type must be a string',
|
|
822
|
+
description: 'The program type to opt out of',
|
|
823
|
+
})
|
|
824
|
+
.optional(),
|
|
825
|
+
});
|
|
826
|
+
/**
|
|
827
|
+
* Schema for getOptedInPrograms method
|
|
828
|
+
* Endpoint: GET /program
|
|
829
|
+
* No parameters required
|
|
830
|
+
*/
|
|
831
|
+
export const getOptedInProgramsSchema = z.object({});
|