@thorprovider/medusa-extended 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md ADDED
@@ -0,0 +1 @@
1
+ <!-- MEDUSA-EXTENDED-AGENTS-MD-START -->[@thorprovider/medusa-extended Docs]|root: ./medusa-extended|Documentation for @thorprovider/medusa-extended. Always read package docs before making changes.|To regenerate: yarn workspace @thorprovider/medusa-extended generate:agent-index|.:{README.md}<!-- MEDUSA-EXTENDED-AGENTS-MD-END -->
package/README.md ADDED
@@ -0,0 +1,206 @@
1
+ ---
2
+ title: "@thorprovider/medusa-extended"
3
+ purpose: "HTTP clients for custom Thor Commerce admin endpoints (dropshipper, multi-tenant) that extend the standard Medusa v2 API"
4
+ lastReviewed: "2026-05-23"
5
+ ---
6
+
7
+ # @thorprovider/medusa-extended
8
+
9
+ **Thor Commerce multi-tenant admin extensions for Medusa v2**
10
+
11
+ HTTP clients for custom Thor endpoints that are not part of the Medusa standard API.
12
+
13
+ ---
14
+
15
+ ## Packages exported
16
+
17
+ | Export | Description |
18
+ |---|---|
19
+ | `MedusaAdminClient` | Thin wrapper around the Medusa Admin REST API (`/admin/*`). Uses `x-medusa-access-token`. |
20
+ | `DropshipperClient` | Client for all dropshipping endpoints (`/admin/thor/dropshipper/*`). Uses `Authorization: Bearer <jwt>`. |
21
+
22
+ ---
23
+
24
+ ## MedusaAdminClient
25
+
26
+ ```typescript
27
+ import { MedusaAdminClient } from '@thorprovider/medusa-extended';
28
+
29
+ const admin = new MedusaAdminClient({
30
+ baseUrl: process.env.MEDUSA_BACKEND_URL!,
31
+ apiKey: process.env.MEDUSA_API_KEY!,
32
+ });
33
+ ```
34
+
35
+ ---
36
+
37
+ ## DropshipperClient
38
+
39
+ Covers **all 43 methods** across the dropshipping feature set. Both the ThorProvider admin (X) and the dropshipper panel (Y) use this same client — access control is enforced server-side.
40
+
41
+ ### Configuration
42
+
43
+ ```typescript
44
+ import { DropshipperClient } from '@thorprovider/medusa-extended';
45
+
46
+ const client = new DropshipperClient({
47
+ baseUrl: process.env.MEDUSA_BACKEND_URL!,
48
+ // JWT obtained from POST /auth/user/emailpass
49
+ token: jwtFromLogin,
50
+ debug: false, // optional — logs every request
51
+ });
52
+ ```
53
+
54
+ ### Authentication
55
+
56
+ Every request sends `Authorization: Bearer <token>`. The JWT is obtained from Medusa's native auth endpoint:
57
+
58
+ ```
59
+ POST /auth/user/emailpass
60
+ { "email": "...", "password": "..." }
61
+ → { "token": "eyJ..." }
62
+ ```
63
+
64
+ ### Methods
65
+
66
+ #### Onboarding (Solo X — Admin role required)
67
+
68
+ | Method | Endpoint |
69
+ |---|---|
70
+ | `onboardDropshipper(body)` | `POST /admin/thor/dropshipper/onboard` |
71
+
72
+ #### Variant Costs (Solo X)
73
+
74
+ | Method | Endpoint |
75
+ |---|---|
76
+ | `getVariantCosts(options?)` | `GET /admin/thor/dropshipper/variant-costs` |
77
+ | `createVariantCost(body)` | `POST /admin/thor/dropshipper/variant-costs` |
78
+ | `batchVariantCosts(body)` | `POST /admin/thor/dropshipper/variant-costs/batch` |
79
+ | `deleteVariantCost(id)` | `DELETE /admin/thor/dropshipper/variant-costs/:id` |
80
+
81
+ #### Products & Prices (Solo Y)
82
+
83
+ | Method | Endpoint |
84
+ |---|---|
85
+ | `getProducts(options?)` | `GET /admin/thor/dropshipper/products` |
86
+ | `updatePrices(body)` | `PUT /admin/thor/dropshipper/prices` |
87
+
88
+ #### Orders (Y + X for set-payment-collector)
89
+
90
+ | Method | Endpoint |
91
+ |---|---|
92
+ | `getOrders(options?)` | `GET /admin/thor/dropshipper/orders` |
93
+ | `getOrder(id)` | `GET /admin/thor/dropshipper/orders/:id` |
94
+ | `createOrder(body)` | `POST /admin/thor/dropshipper/orders` |
95
+ | `setPaymentCollector(id, body)` | `POST /admin/thor/dropshipper/orders/:id/set-payment-collector` |
96
+ | `cancelOrder(id)` | `POST /admin/thor/dropshipper/orders/:id/cancel` |
97
+ | `createOrderEdit(id, body?)` | `POST /admin/thor/dropshipper/orders/:id/edit` |
98
+ | `addOrderEditItem(id, body)` | `POST /admin/thor/dropshipper/orders/:id/edit/items` |
99
+ | `confirmOrderEdit(id)` | `POST /admin/thor/dropshipper/orders/:id/edit/confirm` |
100
+
101
+ #### Order Notes (Y)
102
+
103
+ | Method | Endpoint |
104
+ |---|---|
105
+ | `getOrderNotes(orderId)` | `GET /admin/thor/dropshipper/orders/:id/notes` |
106
+ | `createOrderNote(orderId, body)` | `POST /admin/thor/dropshipper/orders/:id/notes` |
107
+ | `deleteOrderNote(orderId, noteId)` | `DELETE /admin/thor/dropshipper/orders/:id/notes/:noteId` |
108
+
109
+ #### Custom Categories (Solo Y)
110
+
111
+ | Method | Endpoint |
112
+ |---|---|
113
+ | `getCategories(options?)` | `GET /admin/thor/dropshipper/categories` |
114
+ | `createCategory(body)` | `POST /admin/thor/dropshipper/categories` |
115
+ | `updateCategory(id, body)` | `PUT /admin/thor/dropshipper/categories/:id` |
116
+ | `deleteCategory(id)` | `DELETE /admin/thor/dropshipper/categories/:id` |
117
+ | `createCategoryMapping(body)` | `POST /admin/thor/dropshipper/category-mappings` |
118
+ | `deleteCategoryMapping(id)` | `DELETE /admin/thor/dropshipper/category-mappings/:id` |
119
+
120
+ #### Customers (Solo Y)
121
+
122
+ | Method | Endpoint |
123
+ |---|---|
124
+ | `getCustomers(options?)` | `GET /admin/thor/dropshipper/customers` |
125
+ | `getCustomer(id)` | `GET /admin/thor/dropshipper/customers/:id` |
126
+ | `createCustomer(body)` | `POST /admin/thor/dropshipper/customers` |
127
+ | `getCustomerAddresses(customerId)` | `GET /admin/thor/dropshipper/customers/:id/addresses` |
128
+ | `createCustomerAddress(customerId, body)` | `POST /admin/thor/dropshipper/customers/:id/addresses` |
129
+ | `updateCustomerAddress(customerId, addressId, body)` | `PUT /admin/thor/dropshipper/customers/:id/addresses/:addr_id` |
130
+ | `deleteCustomerAddress(customerId, addressId)` | `DELETE /admin/thor/dropshipper/customers/:id/addresses/:addr_id` |
131
+
132
+ #### Account & Settlements (Solo Y — read-only)
133
+
134
+ | Method | Endpoint |
135
+ |---|---|
136
+ | `getAccount()` | `GET /admin/thor/dropshipper/account` |
137
+ | `getPayable()` | `GET /admin/thor/dropshipper/account/payable` |
138
+ | `getReceivable()` | `GET /admin/thor/dropshipper/account/receivable` |
139
+ | `getSettlements(options?)` | `GET /admin/thor/dropshipper/settlements` |
140
+ | `getSettlement(id)` | `GET /admin/thor/dropshipper/settlements/:id` |
141
+
142
+ #### Admin Settlements (Solo X)
143
+
144
+ | Method | Endpoint |
145
+ |---|---|
146
+ | `getAdminSettlements(options?)` | `GET /admin/thor/dropshipper/admin/settlements` |
147
+ | `createSettlement(body)` | `POST /admin/thor/dropshipper/admin/settlements` |
148
+ | `confirmSettlement(id, body?)` | `POST /admin/thor/dropshipper/admin/settlements/:id/confirm` |
149
+ | `cancelSettlement(id, body?)` | `POST /admin/thor/dropshipper/admin/settlements/:id/cancel` |
150
+
151
+ #### Admin Account Management (Solo X)
152
+
153
+ | Method | Endpoint |
154
+ |---|---|
155
+ | `getAdminAccounts()` | `GET /admin/thor/dropshipper/admin/accounts` |
156
+ | `getAdminAccountBalance(id)` | `GET /admin/thor/dropshipper/admin/accounts/:id/balance` |
157
+ | `getAdminPriceLists()` | `GET /admin/thor/dropshipper/admin/price-lists` |
158
+ | `getUserChannel()` | `GET /admin/thor/dropshipper/admin/user-channel` |
159
+
160
+ #### Promotions (Solo Y)
161
+
162
+ | Method | Endpoint |
163
+ |---|---|
164
+ | `getPromotions(options?)` | `GET /admin/thor/dropshipper/promotions` |
165
+ | `createPromotion(body)` | `POST /admin/thor/dropshipper/promotions` |
166
+ | `getPromotion(id)` | `GET /admin/thor/dropshipper/promotions/:id` |
167
+ | `updatePromotion(id, body)` | `PUT /admin/thor/dropshipper/promotions/:id` |
168
+ | `deletePromotion(id)` | `DELETE /admin/thor/dropshipper/promotions/:id` |
169
+
170
+ #### Dashboard (Solo Y)
171
+
172
+ | Method | Endpoint |
173
+ |---|---|
174
+ | `getDashboardStats(options?)` | `GET /admin/thor/dropshipper/dashboard/stats` |
175
+
176
+ #### Storefront (public — uses publishable API key)
177
+
178
+ | Method | Endpoint |
179
+ |---|---|
180
+ | `getStorefrontCategories()` | `GET /store/thor/dropshipper-categories` |
181
+
182
+ > The storefront endpoint resolves the channel from the `x-publishable-api-key` header, not from the JWT. When calling this method directly from a server context, pass the publishable key via a separate fetch or configure an HTTP proxy. The client itself always sends `Authorization: Bearer` — this method is included for completeness.
183
+
184
+ ### Error handling
185
+
186
+ All methods throw `ProviderAPIError` on non-2xx responses:
187
+
188
+ ```typescript
189
+ import { ProviderAPIError } from '@thorprovider/adapters';
190
+
191
+ try {
192
+ const result = await client.getProducts();
193
+ } catch (err) {
194
+ if (err instanceof ProviderAPIError) {
195
+ console.error(err.code); // e.g. "DROPSHIPPER_API_403"
196
+ }
197
+ }
198
+ ```
199
+
200
+ ---
201
+
202
+ ## Endpoint reference
203
+
204
+ Full request/response contracts: `docs/multitenant/dropshipping-api-contract.md`
205
+
206
+ Operational detail and middleware breakdown: `docs/multitenant/dropshipping-feature-reference.md`
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { GetChannelCustomersOptions, GetChannelCustomersResponse, GetChannelApiKeysResponse, GetChannelCategoriesOptions, GetChannelCategoriesResponse, GetCategorySalesChannelsResponse, AssignCategoriesToChannelsBody, AssignCategoriesToChannelsResponse, UnassignCategoriesFromChannelsBody, UnassignCategoriesFromChannelsResponse, GetCollectionSalesChannelsResponse, AssignCollectionsToChannelsBody, AssignCollectionsToChannelsResponse, UnassignCollectionsFromChannelsBody, UnassignCollectionsFromChannelsResponse, GetAdminStorefrontConfigResponse, UpdateStorefrontConfigBody, UpdateStorefrontConfigResponse, GetAdminSiteConfigResponse, UpdateSiteConfigBody, UpdateSiteConfigResponse, GetAdminSiteConfigHistoryOptions, GetAdminSiteConfigHistoryResponse, RestoreSiteConfigResponse } from '@thorprovider/types';
1
+ import { GetChannelCustomersOptions, GetChannelCustomersResponse, GetChannelApiKeysResponse, GetChannelCategoriesOptions, GetChannelCategoriesResponse, GetCategorySalesChannelsResponse, AssignCategoriesToChannelsBody, AssignCategoriesToChannelsResponse, UnassignCategoriesFromChannelsBody, UnassignCategoriesFromChannelsResponse, GetCollectionSalesChannelsResponse, AssignCollectionsToChannelsBody, AssignCollectionsToChannelsResponse, UnassignCollectionsFromChannelsBody, UnassignCollectionsFromChannelsResponse, GetAdminStorefrontConfigResponse, UpdateStorefrontConfigBody, UpdateStorefrontConfigResponse, GetAdminSiteConfigResponse, UpdateSiteConfigBody, UpdateSiteConfigResponse, GetAdminSiteConfigHistoryOptions, GetAdminSiteConfigHistoryResponse, RestoreSiteConfigResponse, OnboardDropshipperBody, OnboardDropshipperResponse, GetVariantCostsOptions, GetVariantCostsResponse, CreateVariantCostBody, CreateVariantCostResponse, BatchVariantCostsBody, BatchVariantCostsResponse, DeleteVariantCostResponse, GetDropshipperProductsOptions, GetDropshipperProductsResponse, UpdateDropshipperPricesBody, UpdateDropshipperPricesResponse, GetDropshipperOrdersOptions, GetDropshipperOrdersResponse, GetDropshipperOrderDetailResponse, CreateDropshipperOrderBody, CreateDropshipperOrderResponse, SetPaymentCollectorBody, SetPaymentCollectorResponse, CancelDropshipperOrderResponse, CreateOrderEditBody, CreateOrderEditResponse, AddOrderEditItemBody, AddOrderEditItemResponse, ConfirmOrderEditResponse, GetOrderNotesResponse, CreateOrderNoteBody, OrderNote, DeleteOrderNoteResponse, GetDropshipperCategoriesOptions, GetDropshipperCategoriesResponse, CreateDropshipperCategoryBody, DropshipperCategory, UpdateDropshipperCategoryBody, DeleteDropshipperCategoryResponse, CreateCategoryMappingBody, CreateCategoryMappingResponse, DeleteCategoryMappingResponse, GetDropshipperCustomersOptions, GetDropshipperCustomersResponse, GetDropshipperCustomerDetailResponse, CreateDropshipperCustomerBody, CreateDropshipperCustomerResponse, GetDropshipperAddressesResponse, DropshipperAddressBody, DropshipperAddressResponse, GetDropshipperAccountResponse, GetDropshipperPayableResponse, GetDropshipperReceivableResponse, GetSettlementsOptions, GetSettlementsResponse, GetSettlementDetailResponse, CreateSettlementBody, CreateSettlementResponse, ConfirmSettlementBody, UpdateSettlementStatusResponse, CancelSettlementBody, GetAdminDropshipperAccountsResponse, GetAdminAccountBalanceResponse, GetAdminPriceListsResponse, GetUserChannelResponse, GetDropshipperPromotionsOptions, GetDropshipperPromotionsResponse, CreateDropshipperPromotionBody, DropshipperPromotion, UpdateDropshipperPromotionBody, DeleteDropshipperPromotionResponse, GetDashboardStatsOptions, GetDashboardStatsResponse, GetStorefrontDropshipperCategoriesResponse } from '@thorprovider/types';
2
2
 
3
3
  /**
4
4
  * @fileoverview Medusa Multi-Tenant Admin Client
@@ -147,4 +147,371 @@ declare class MedusaAdminClient {
147
147
  restoreSiteConfig(salesChannelId: string, version: string): Promise<RestoreSiteConfigResponse>;
148
148
  }
149
149
 
150
- export { MedusaAdminClient, type MedusaAdminClientConfig };
150
+ /**
151
+ * @fileoverview Dropshipper Client — Thor Commerce Extended
152
+ * @module @thorprovider/medusa-extended/dropshipper
153
+ *
154
+ * HTTP client for all `/admin/thor/dropshipper/` endpoints.
155
+ *
156
+ * Used by both:
157
+ * - X (ThorProvider admin) — authenticated via admin JWT, role "Admin"
158
+ * - Y (Dropshipper panel) — authenticated via dropshipper JWT, role "Dropshipper"
159
+ *
160
+ * Access control is enforced server-side via `withDropshipperScope` middleware.
161
+ * This client always sends `Authorization: Bearer <token>`.
162
+ *
163
+ * Endpoint reference: `dropshipping-api-contract.md`
164
+ */
165
+
166
+ /**
167
+ * Configuration required to instantiate the dropshipper client.
168
+ */
169
+ interface DropshipperClientConfig {
170
+ /** Medusa backend base URL */
171
+ baseUrl: string;
172
+ /**
173
+ * JWT token obtained from `POST /auth/user/emailpass`.
174
+ * Used as `Authorization: Bearer <token>`.
175
+ */
176
+ token: string;
177
+ /** Enable debug logging */
178
+ debug?: boolean;
179
+ }
180
+ /**
181
+ * HTTP client for Thor Commerce dropshipping endpoints (`/admin/thor/dropshipper/`).
182
+ *
183
+ * All methods throw `ProviderAPIError` on non-2xx responses.
184
+ *
185
+ * @example
186
+ * ```typescript
187
+ * const client = new DropshipperClient({
188
+ * baseUrl: process.env.MEDUSA_BACKEND_URL!,
189
+ * token: jwtFromLogin,
190
+ * });
191
+ *
192
+ * // Y: list own products
193
+ * const { products } = await client.getProducts();
194
+ *
195
+ * // X: onboard a new dropshipper
196
+ * const { dropshipper } = await client.onboardDropshipper({ ... });
197
+ * ```
198
+ */
199
+ declare class DropshipperClient {
200
+ private baseUrl;
201
+ private token;
202
+ private logger;
203
+ constructor(config: DropshipperClientConfig);
204
+ private request;
205
+ /**
206
+ * Create a new dropshipper account (sales channel + user + price list).
207
+ *
208
+ * `POST /admin/thor/dropshipper/onboard`
209
+ */
210
+ onboardDropshipper(body: OnboardDropshipperBody): Promise<OnboardDropshipperResponse>;
211
+ /**
212
+ * List variant cost records, optionally filtered by account/variant/currency.
213
+ *
214
+ * `GET /admin/thor/dropshipper/variant-costs`
215
+ */
216
+ getVariantCosts(options?: GetVariantCostsOptions): Promise<GetVariantCostsResponse>;
217
+ /**
218
+ * Upsert a single variant cost record.
219
+ *
220
+ * `POST /admin/thor/dropshipper/variant-costs`
221
+ */
222
+ createVariantCost(body: CreateVariantCostBody): Promise<CreateVariantCostResponse>;
223
+ /**
224
+ * Batch-upsert variant costs for a given account and currency.
225
+ *
226
+ * `POST /admin/thor/dropshipper/variant-costs/batch`
227
+ */
228
+ batchVariantCosts(body: BatchVariantCostsBody): Promise<BatchVariantCostsResponse>;
229
+ /**
230
+ * Delete a variant cost record by ID.
231
+ *
232
+ * `DELETE /admin/thor/dropshipper/variant-costs/:id`
233
+ */
234
+ deleteVariantCost(id: string): Promise<DeleteVariantCostResponse>;
235
+ /**
236
+ * List products available in Y's channel with cost/margin data.
237
+ *
238
+ * `GET /admin/thor/dropshipper/products`
239
+ */
240
+ getProducts(options?: GetDropshipperProductsOptions): Promise<GetDropshipperProductsResponse>;
241
+ /**
242
+ * Bulk-update sale prices on Y's channel price list.
243
+ *
244
+ * `PUT /admin/thor/dropshipper/prices`
245
+ */
246
+ updatePrices(body: UpdateDropshipperPricesBody): Promise<UpdateDropshipperPricesResponse>;
247
+ /**
248
+ * Paginated list of orders in Y's channel.
249
+ *
250
+ * `GET /admin/thor/dropshipper/orders`
251
+ */
252
+ getOrders(options?: GetDropshipperOrdersOptions): Promise<GetDropshipperOrdersResponse>;
253
+ /**
254
+ * Full detail for a single order with profit breakdown.
255
+ *
256
+ * `GET /admin/thor/dropshipper/orders/:id`
257
+ */
258
+ getOrder(orderId: string): Promise<GetDropshipperOrderDetailResponse>;
259
+ /**
260
+ * Manually create an order on behalf of a customer.
261
+ *
262
+ * `POST /admin/thor/dropshipper/orders`
263
+ */
264
+ createOrder(body: CreateDropshipperOrderBody): Promise<CreateDropshipperOrderResponse>;
265
+ /**
266
+ * Set who collects payment for an order (Solo X).
267
+ *
268
+ * `POST /admin/thor/dropshipper/orders/:id/set-payment-collector`
269
+ */
270
+ setPaymentCollector(orderId: string, body: SetPaymentCollectorBody): Promise<SetPaymentCollectorResponse>;
271
+ /**
272
+ * Cancel a dropshipper order.
273
+ *
274
+ * `POST /admin/thor/dropshipper/orders/:id/cancel`
275
+ */
276
+ cancelOrder(orderId: string): Promise<CancelDropshipperOrderResponse>;
277
+ /**
278
+ * Create an order edit for a dropshipper order.
279
+ *
280
+ * `POST /admin/thor/dropshipper/orders/:id/edit`
281
+ */
282
+ createOrderEdit(orderId: string, body?: CreateOrderEditBody): Promise<CreateOrderEditResponse>;
283
+ /**
284
+ * Add an item to the active order edit.
285
+ *
286
+ * `POST /admin/thor/dropshipper/orders/:id/edit/items`
287
+ */
288
+ addOrderEditItem(orderId: string, body: AddOrderEditItemBody): Promise<AddOrderEditItemResponse>;
289
+ /**
290
+ * Confirm the active order edit, applying changes to the order.
291
+ *
292
+ * `POST /admin/thor/dropshipper/orders/:id/edit/confirm`
293
+ */
294
+ confirmOrderEdit(orderId: string): Promise<ConfirmOrderEditResponse>;
295
+ /**
296
+ * Get all notes for an order.
297
+ *
298
+ * `GET /admin/thor/dropshipper/orders/:id/notes`
299
+ */
300
+ getOrderNotes(orderId: string): Promise<GetOrderNotesResponse>;
301
+ /**
302
+ * Create a new note for an order.
303
+ *
304
+ * `POST /admin/thor/dropshipper/orders/:id/notes`
305
+ */
306
+ createOrderNote(orderId: string, body: CreateOrderNoteBody): Promise<OrderNote>;
307
+ /**
308
+ * Delete a note from an order.
309
+ *
310
+ * `DELETE /admin/thor/dropshipper/orders/:id/notes/:noteId`
311
+ */
312
+ deleteOrderNote(orderId: string, noteId: string): Promise<DeleteOrderNoteResponse>;
313
+ /**
314
+ * List Y's custom product categories.
315
+ *
316
+ * `GET /admin/thor/dropshipper/categories`
317
+ */
318
+ getCategories(options?: GetDropshipperCategoriesOptions): Promise<GetDropshipperCategoriesResponse>;
319
+ /**
320
+ * Create a custom category in Y's channel.
321
+ *
322
+ * `POST /admin/thor/dropshipper/categories`
323
+ */
324
+ createCategory(body: CreateDropshipperCategoryBody): Promise<DropshipperCategory>;
325
+ /**
326
+ * Update a custom category.
327
+ *
328
+ * `PUT /admin/thor/dropshipper/categories/:id`
329
+ */
330
+ updateCategory(categoryId: string, body: UpdateDropshipperCategoryBody): Promise<DropshipperCategory>;
331
+ /**
332
+ * Delete a custom category.
333
+ *
334
+ * `DELETE /admin/thor/dropshipper/categories/:id`
335
+ */
336
+ deleteCategory(categoryId: string): Promise<DeleteDropshipperCategoryResponse>;
337
+ /**
338
+ * Map a product to a custom category.
339
+ *
340
+ * `POST /admin/thor/dropshipper/category-mappings`
341
+ */
342
+ createCategoryMapping(body: CreateCategoryMappingBody): Promise<CreateCategoryMappingResponse>;
343
+ /**
344
+ * Remove a product-to-category mapping.
345
+ *
346
+ * `DELETE /admin/thor/dropshipper/category-mappings/:id`
347
+ */
348
+ deleteCategoryMapping(mappingId: string): Promise<DeleteCategoryMappingResponse>;
349
+ /**
350
+ * Paginated list of customers in Y's channel.
351
+ *
352
+ * `GET /admin/thor/dropshipper/customers`
353
+ */
354
+ getCustomers(options?: GetDropshipperCustomersOptions): Promise<GetDropshipperCustomersResponse>;
355
+ /**
356
+ * Full detail for a single customer.
357
+ *
358
+ * `GET /admin/thor/dropshipper/customers/:id`
359
+ */
360
+ getCustomer(customerId: string): Promise<GetDropshipperCustomerDetailResponse>;
361
+ /**
362
+ * Create a customer scoped to Y's channel.
363
+ *
364
+ * `POST /admin/thor/dropshipper/customers`
365
+ */
366
+ createCustomer(body: CreateDropshipperCustomerBody): Promise<CreateDropshipperCustomerResponse>;
367
+ /**
368
+ * List addresses for a customer in Y's channel.
369
+ *
370
+ * `GET /admin/thor/dropshipper/customers/:id/addresses`
371
+ */
372
+ getCustomerAddresses(customerId: string): Promise<GetDropshipperAddressesResponse>;
373
+ /**
374
+ * Create a new address for a customer.
375
+ *
376
+ * `POST /admin/thor/dropshipper/customers/:id/addresses`
377
+ */
378
+ createCustomerAddress(customerId: string, body: DropshipperAddressBody): Promise<DropshipperAddressResponse>;
379
+ /**
380
+ * Update an existing customer address.
381
+ *
382
+ * `PUT /admin/thor/dropshipper/customers/:id/addresses/:addressId`
383
+ */
384
+ updateCustomerAddress(customerId: string, addressId: string, body: Partial<DropshipperAddressBody>): Promise<DropshipperAddressResponse>;
385
+ /**
386
+ * Delete a customer address.
387
+ *
388
+ * `DELETE /admin/thor/dropshipper/customers/:id/addresses/:addressId`
389
+ */
390
+ deleteCustomerAddress(customerId: string, addressId: string): Promise<{
391
+ deleted: true;
392
+ id: string;
393
+ }>;
394
+ /**
395
+ * Y's account info with current balance.
396
+ *
397
+ * `GET /admin/thor/dropshipper/account`
398
+ */
399
+ getAccount(): Promise<GetDropshipperAccountResponse>;
400
+ /**
401
+ * Orders where Y owes money to X (Y collected payment, needs to pay costs).
402
+ *
403
+ * `GET /admin/thor/dropshipper/account/payable`
404
+ */
405
+ getPayable(): Promise<GetDropshipperPayableResponse>;
406
+ /**
407
+ * Orders where X owes money to Y (X collected COD, needs to transfer profit).
408
+ *
409
+ * `GET /admin/thor/dropshipper/account/receivable`
410
+ */
411
+ getReceivable(): Promise<GetDropshipperReceivableResponse>;
412
+ /**
413
+ * List settlements (Y sees own; X can filter by account_id).
414
+ *
415
+ * `GET /admin/thor/dropshipper/settlements`
416
+ */
417
+ getSettlements(options?: GetSettlementsOptions): Promise<GetSettlementsResponse>;
418
+ /**
419
+ * Full detail for a single settlement record.
420
+ *
421
+ * `GET /admin/thor/dropshipper/settlements/:id`
422
+ */
423
+ getSettlement(settlementId: string): Promise<GetSettlementDetailResponse>;
424
+ /**
425
+ * Create a settlement record for a dropshipper account.
426
+ *
427
+ * `POST /admin/thor/dropshipper/admin/settlements`
428
+ */
429
+ createSettlement(body: CreateSettlementBody): Promise<CreateSettlementResponse>;
430
+ /**
431
+ * Confirm a pending settlement (marks it as paid/received).
432
+ *
433
+ * `POST /admin/thor/dropshipper/admin/settlements/:id/confirm`
434
+ */
435
+ confirmSettlement(settlementId: string, body?: ConfirmSettlementBody): Promise<UpdateSettlementStatusResponse>;
436
+ /**
437
+ * Cancel a pending settlement.
438
+ *
439
+ * `POST /admin/thor/dropshipper/admin/settlements/:id/cancel`
440
+ */
441
+ cancelSettlement(settlementId: string, body?: CancelSettlementBody): Promise<UpdateSettlementStatusResponse>;
442
+ /**
443
+ * X views all settlement records across all dropshipper accounts.
444
+ *
445
+ * `GET /admin/thor/dropshipper/admin/settlements`
446
+ */
447
+ getAdminSettlements(options?: GetSettlementsOptions): Promise<GetSettlementsResponse>;
448
+ /**
449
+ * List all dropshipper accounts.
450
+ *
451
+ * `GET /admin/thor/dropshipper/admin/accounts`
452
+ */
453
+ getAdminAccounts(): Promise<GetAdminDropshipperAccountsResponse>;
454
+ /**
455
+ * Full balance detail for a specific dropshipper account.
456
+ *
457
+ * `GET /admin/thor/dropshipper/admin/accounts/:id/balance`
458
+ */
459
+ getAdminAccountBalance(accountId: string): Promise<GetAdminAccountBalanceResponse>;
460
+ /**
461
+ * List all dropshipper price lists.
462
+ *
463
+ * `GET /admin/thor/dropshipper/admin/price-lists`
464
+ */
465
+ getAdminPriceLists(): Promise<GetAdminPriceListsResponse>;
466
+ /**
467
+ * Utility: look up which sales channel a user belongs to.
468
+ *
469
+ * `GET /admin/thor/dropshipper/admin/user-channel`
470
+ */
471
+ getUserChannel(): Promise<GetUserChannelResponse>;
472
+ /**
473
+ * List Y's promotions (discount codes).
474
+ *
475
+ * `GET /admin/thor/dropshipper/promotions`
476
+ */
477
+ getPromotions(options?: GetDropshipperPromotionsOptions): Promise<GetDropshipperPromotionsResponse>;
478
+ /**
479
+ * Create a promotion for Y's channel.
480
+ *
481
+ * `POST /admin/thor/dropshipper/promotions`
482
+ */
483
+ createPromotion(body: CreateDropshipperPromotionBody): Promise<DropshipperPromotion>;
484
+ /**
485
+ * Get a single promotion by ID.
486
+ *
487
+ * `GET /admin/thor/dropshipper/promotions/:id`
488
+ */
489
+ getPromotion(promotionId: string): Promise<DropshipperPromotion>;
490
+ /**
491
+ * Update an existing promotion.
492
+ *
493
+ * `PUT /admin/thor/dropshipper/promotions/:id`
494
+ */
495
+ updatePromotion(promotionId: string, body: UpdateDropshipperPromotionBody): Promise<DropshipperPromotion>;
496
+ /**
497
+ * Delete a promotion.
498
+ *
499
+ * `DELETE /admin/thor/dropshipper/promotions/:id`
500
+ */
501
+ deletePromotion(promotionId: string): Promise<DeleteDropshipperPromotionResponse>;
502
+ /**
503
+ * Aggregate stats for Y's dashboard (revenue, profit, top products).
504
+ *
505
+ * `GET /admin/thor/dropshipper/dashboard/stats`
506
+ */
507
+ getDashboardStats(options?: GetDashboardStatsOptions): Promise<GetDashboardStatsResponse>;
508
+ /**
509
+ * Public endpoint: dropshipper-scoped categories for the storefront.
510
+ * Typically called with a publishable API key rather than a JWT.
511
+ *
512
+ * `GET /store/thor/dropshipper-categories`
513
+ */
514
+ getStorefrontCategories(): Promise<GetStorefrontDropshipperCategoriesResponse>;
515
+ }
516
+
517
+ export { DropshipperClient, type DropshipperClientConfig, MedusaAdminClient, type MedusaAdminClientConfig };