@mitumba/sdk 1.25.0 → 1.27.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/dist/index.d.mts CHANGED
@@ -178,9 +178,13 @@ interface AuthenticationResponseJSON {
178
178
  clientExtensionResults?: Record<string, unknown>;
179
179
  authenticatorAttachment?: string;
180
180
  }
181
+ type BusinessType = 'individual' | 'business';
182
+ type SellerType = 'retail' | 'bale';
181
183
  interface BecomeSellerInput {
182
- seller_type: 'individual' | 'business';
183
- sti_score: number;
184
+ business_type?: BusinessType;
185
+ /** @deprecated Use business_type instead */
186
+ seller_type?: 'individual' | 'business';
187
+ sti_score?: number;
184
188
  business_name?: string;
185
189
  id_number?: string;
186
190
  kra_pin?: string;
@@ -193,6 +197,14 @@ interface BecomeSellerInput {
193
197
  price_range_min?: number;
194
198
  price_range_max?: number;
195
199
  }
200
+ interface BecomeBaleSellerInput {
201
+ business_type?: BusinessType;
202
+ business_name?: string;
203
+ kra_pin?: string;
204
+ id_number?: string;
205
+ phone?: string;
206
+ county?: string;
207
+ }
196
208
  interface UserProfile {
197
209
  id: string;
198
210
  email: string | null;
@@ -1028,6 +1040,134 @@ interface DisputeListParams {
1028
1040
  page?: number;
1029
1041
  }
1030
1042
 
1043
+ type BaleGrade = 'Cream' | 'A' | 'B' | 'C';
1044
+ type BaleType = 'original' | 'sorted';
1045
+ interface WholesaleStore {
1046
+ id: string;
1047
+ name: string;
1048
+ slug: string;
1049
+ tagline: string | null;
1050
+ description: string | null;
1051
+ logo_url: string | null;
1052
+ origins: string[];
1053
+ verified: boolean;
1054
+ }
1055
+ interface WholesaleDepot {
1056
+ id: string;
1057
+ name: string;
1058
+ address: string | null;
1059
+ city_id: string | null;
1060
+ is_primary: boolean;
1061
+ }
1062
+ interface Bale {
1063
+ id: string;
1064
+ store_id: string;
1065
+ seller_id: string;
1066
+ title: string;
1067
+ category: string;
1068
+ grade: BaleGrade;
1069
+ bale_type: BaleType;
1070
+ weight_kg: number;
1071
+ origin: string | null;
1072
+ est_pieces: number | null;
1073
+ price_kes: number;
1074
+ moq: number;
1075
+ mix: string | null;
1076
+ description: string | null;
1077
+ city_id: string | null;
1078
+ status: 'draft' | 'active' | 'sold_out';
1079
+ created_at: string;
1080
+ }
1081
+ interface BaleDetail extends Bale {
1082
+ images: string[];
1083
+ store: {
1084
+ name: string;
1085
+ slug: string;
1086
+ verified: boolean;
1087
+ sti: number | null;
1088
+ };
1089
+ }
1090
+ interface CreateBaleInput {
1091
+ title: string;
1092
+ category: string;
1093
+ grade: BaleGrade;
1094
+ bale_type?: BaleType;
1095
+ weight_kg: number;
1096
+ origin?: string;
1097
+ est_pieces?: number;
1098
+ price_kes: number;
1099
+ moq?: number;
1100
+ mix?: string;
1101
+ description?: string;
1102
+ city_id?: string;
1103
+ status?: 'draft' | 'active' | 'sold_out';
1104
+ }
1105
+ interface WholesaleFeedParams {
1106
+ q?: string;
1107
+ category?: string;
1108
+ grade?: BaleGrade;
1109
+ origin?: string;
1110
+ city_id?: string;
1111
+ limit?: number;
1112
+ offset?: number;
1113
+ }
1114
+ interface BaleFeedItem extends Bale {
1115
+ image_url: string | null;
1116
+ store: {
1117
+ name: string;
1118
+ slug: string;
1119
+ verified: boolean;
1120
+ sti: number | null;
1121
+ };
1122
+ }
1123
+ interface SaveWholesaleStoreInput {
1124
+ name: string;
1125
+ tagline?: string;
1126
+ description?: string;
1127
+ logo_url?: string;
1128
+ origins?: string[];
1129
+ }
1130
+ interface AddDepotInput {
1131
+ name: string;
1132
+ address?: string;
1133
+ city_id?: string;
1134
+ is_primary?: boolean;
1135
+ }
1136
+ declare const BALE_ORDER_STATUSES: readonly ["pending_payment", "paid", "confirmed", "in_transit", "delivered", "completed", "cancelled"];
1137
+ type BaleOrderStatus = typeof BALE_ORDER_STATUSES[number];
1138
+ type BaleFulfillment = 'pickup' | 'courier';
1139
+ interface BaleOrder {
1140
+ id: string;
1141
+ bale_id: string;
1142
+ buyer_id: string;
1143
+ seller_id: string;
1144
+ store_id: string;
1145
+ title: string;
1146
+ grade: string;
1147
+ origin: string | null;
1148
+ image_url: string | null;
1149
+ qty: number;
1150
+ unit_kes: number;
1151
+ total_kes: number;
1152
+ fulfillment: BaleFulfillment;
1153
+ freight_kes: number | null;
1154
+ status: BaleOrderStatus;
1155
+ city_id: string | null;
1156
+ created_at: string;
1157
+ }
1158
+ interface BaleOrderEvent {
1159
+ actor: string;
1160
+ old_status: string | null;
1161
+ new_status: string;
1162
+ note: string | null;
1163
+ created_at: string;
1164
+ }
1165
+ interface CreateBaleOrderInput {
1166
+ bale_id: string;
1167
+ qty?: number;
1168
+ fulfillment: BaleFulfillment;
1169
+ }
1170
+
1031
1171
  interface MitumbaClientConfig {
1032
1172
  baseUrl: string;
1033
1173
  debug?: boolean;
@@ -1208,6 +1348,14 @@ declare class AuthModule {
1208
1348
  roles: string[];
1209
1349
  sti_score: number;
1210
1350
  }>;
1351
+ /**
1352
+ * Upgrade the current user to a bale (wholesale) seller role.
1353
+ * Mutually exclusive with retail seller — 409 if already a retail seller.
1354
+ */
1355
+ becomeBaleSeller(input: BecomeBaleSellerInput, options?: RequestOptions): Promise<{
1356
+ ok: true;
1357
+ roles: string[];
1358
+ }>;
1211
1359
  /**
1212
1360
  * Check if the account is eligible for deletion and what blockers exist.
1213
1361
  */
@@ -2127,6 +2275,75 @@ declare class ReportsModule {
2127
2275
  }>;
2128
2276
  }
2129
2277
 
2278
+ declare class WholesaleModule {
2279
+ private readonly client;
2280
+ constructor(client: APIClient);
2281
+ /** Get the current user's wholesale store and depots. */
2282
+ getWholesaleStore(options?: RequestOptions): Promise<{
2283
+ store: WholesaleStore | null;
2284
+ depots?: WholesaleDepot[];
2285
+ }>;
2286
+ /** Create or update the wholesale store (bale_seller only). */
2287
+ saveWholesaleStore(input: SaveWholesaleStoreInput, options?: RequestOptions): Promise<{
2288
+ id: string;
2289
+ verified?: boolean;
2290
+ }>;
2291
+ /** Add a depot to the wholesale store. */
2292
+ addDepot(input: AddDepotInput, options?: RequestOptions): Promise<{
2293
+ id: string;
2294
+ }>;
2295
+ /** Remove a depot. */
2296
+ removeDepot(id: string, options?: RequestOptions): Promise<{
2297
+ ok: true;
2298
+ }>;
2299
+ /** Create a bale listing (requires verified wholesale store). */
2300
+ createBale(input: CreateBaleInput, options?: RequestOptions): Promise<{
2301
+ id: string;
2302
+ }>;
2303
+ /** Get a bale by ID (public). */
2304
+ getBale(id: string, options?: RequestOptions): Promise<BaleDetail>;
2305
+ /** Update a bale. */
2306
+ updateBale(id: string, input: Partial<CreateBaleInput>, options?: RequestOptions): Promise<{
2307
+ ok: true;
2308
+ }>;
2309
+ /** Soft-delete a bale. */
2310
+ removeBale(id: string, options?: RequestOptions): Promise<{
2311
+ ok: true;
2312
+ }>;
2313
+ /** Get all bales for the current user's wholesale store. */
2314
+ myBales(options?: RequestOptions): Promise<{
2315
+ data: Bale[];
2316
+ }>;
2317
+ /** Browse the wholesale bale feed (public). */
2318
+ wholesaleFeed(params?: WholesaleFeedParams, options?: RequestOptions): Promise<{
2319
+ data: BaleFeedItem[];
2320
+ limit: number;
2321
+ offset: number;
2322
+ }>;
2323
+ /** Create a bale order (buyer). */
2324
+ createBaleOrder(input: CreateBaleOrderInput, options?: RequestOptions): Promise<{
2325
+ id: string;
2326
+ total_kes: number;
2327
+ }>;
2328
+ /** Get the buyer's bale orders. */
2329
+ myBaleOrders(options?: RequestOptions): Promise<{
2330
+ data: BaleOrder[];
2331
+ }>;
2332
+ /** Get incoming bale orders (seller). */
2333
+ incomingBaleOrders(options?: RequestOptions): Promise<{
2334
+ data: BaleOrder[];
2335
+ }>;
2336
+ /** Get a bale order by ID with event timeline. */
2337
+ getBaleOrder(id: string, options?: RequestOptions): Promise<BaleOrder & {
2338
+ events: BaleOrderEvent[];
2339
+ }>;
2340
+ /** Transition a bale order status. */
2341
+ transitionBaleOrder(id: string, action: 'confirm' | 'dispatch' | 'deliver' | 'receive', options?: RequestOptions): Promise<{
2342
+ ok: true;
2343
+ status: BaleOrderStatus;
2344
+ }>;
2345
+ }
2346
+
2130
2347
  declare class MitumbaClient {
2131
2348
  readonly api: APIClient;
2132
2349
  readonly auth: AuthModule;
@@ -2148,6 +2365,7 @@ declare class MitumbaClient {
2148
2365
  readonly disputes: DisputesModule;
2149
2366
  readonly uploads: UploadsModule;
2150
2367
  readonly reports: ReportsModule;
2368
+ readonly wholesale: WholesaleModule;
2151
2369
  constructor(config: MitumbaClientConfig);
2152
2370
  /**
2153
2371
  * Set the access token for authenticated requests.
@@ -2179,4 +2397,4 @@ declare class MitumbaClient {
2179
2397
  isAuthenticated(): Promise<boolean>;
2180
2398
  }
2181
2399
 
2182
- export { APIClient, APIError, type APIErrorResponse, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddPaymentMethodInput, type Address, type AdminListingItem, AdminModule, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminReport, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, AuthModule, type AuthTokens, type AuthenticationResponseJSON, type BecomeSellerInput, type BlockedIp, type Business, BusinessesModule, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type InboxRealtimeEvent, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type ResetPasswordInput, type ResolveDisputeInput, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendEmailInput, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreSettings, type StoreStats, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WishlistListing, WishlistsModule, createTokenStore };
2400
+ export { APIClient, APIError, type APIErrorResponse, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddPaymentMethodInput, type Address, type AdminListingItem, AdminModule, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminReport, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateBaleInput, type CreateBaleOrderInput, type CreateListingInput, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type InboxRealtimeEvent, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type ResetPasswordInput, type ResolveDisputeInput, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreSettings, type StoreStats, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleStore, type WishlistListing, WishlistsModule, createTokenStore };
package/dist/index.d.ts CHANGED
@@ -178,9 +178,13 @@ interface AuthenticationResponseJSON {
178
178
  clientExtensionResults?: Record<string, unknown>;
179
179
  authenticatorAttachment?: string;
180
180
  }
181
+ type BusinessType = 'individual' | 'business';
182
+ type SellerType = 'retail' | 'bale';
181
183
  interface BecomeSellerInput {
182
- seller_type: 'individual' | 'business';
183
- sti_score: number;
184
+ business_type?: BusinessType;
185
+ /** @deprecated Use business_type instead */
186
+ seller_type?: 'individual' | 'business';
187
+ sti_score?: number;
184
188
  business_name?: string;
185
189
  id_number?: string;
186
190
  kra_pin?: string;
@@ -193,6 +197,14 @@ interface BecomeSellerInput {
193
197
  price_range_min?: number;
194
198
  price_range_max?: number;
195
199
  }
200
+ interface BecomeBaleSellerInput {
201
+ business_type?: BusinessType;
202
+ business_name?: string;
203
+ kra_pin?: string;
204
+ id_number?: string;
205
+ phone?: string;
206
+ county?: string;
207
+ }
196
208
  interface UserProfile {
197
209
  id: string;
198
210
  email: string | null;
@@ -1028,6 +1040,134 @@ interface DisputeListParams {
1028
1040
  page?: number;
1029
1041
  }
1030
1042
 
1043
+ type BaleGrade = 'Cream' | 'A' | 'B' | 'C';
1044
+ type BaleType = 'original' | 'sorted';
1045
+ interface WholesaleStore {
1046
+ id: string;
1047
+ name: string;
1048
+ slug: string;
1049
+ tagline: string | null;
1050
+ description: string | null;
1051
+ logo_url: string | null;
1052
+ origins: string[];
1053
+ verified: boolean;
1054
+ }
1055
+ interface WholesaleDepot {
1056
+ id: string;
1057
+ name: string;
1058
+ address: string | null;
1059
+ city_id: string | null;
1060
+ is_primary: boolean;
1061
+ }
1062
+ interface Bale {
1063
+ id: string;
1064
+ store_id: string;
1065
+ seller_id: string;
1066
+ title: string;
1067
+ category: string;
1068
+ grade: BaleGrade;
1069
+ bale_type: BaleType;
1070
+ weight_kg: number;
1071
+ origin: string | null;
1072
+ est_pieces: number | null;
1073
+ price_kes: number;
1074
+ moq: number;
1075
+ mix: string | null;
1076
+ description: string | null;
1077
+ city_id: string | null;
1078
+ status: 'draft' | 'active' | 'sold_out';
1079
+ created_at: string;
1080
+ }
1081
+ interface BaleDetail extends Bale {
1082
+ images: string[];
1083
+ store: {
1084
+ name: string;
1085
+ slug: string;
1086
+ verified: boolean;
1087
+ sti: number | null;
1088
+ };
1089
+ }
1090
+ interface CreateBaleInput {
1091
+ title: string;
1092
+ category: string;
1093
+ grade: BaleGrade;
1094
+ bale_type?: BaleType;
1095
+ weight_kg: number;
1096
+ origin?: string;
1097
+ est_pieces?: number;
1098
+ price_kes: number;
1099
+ moq?: number;
1100
+ mix?: string;
1101
+ description?: string;
1102
+ city_id?: string;
1103
+ status?: 'draft' | 'active' | 'sold_out';
1104
+ }
1105
+ interface WholesaleFeedParams {
1106
+ q?: string;
1107
+ category?: string;
1108
+ grade?: BaleGrade;
1109
+ origin?: string;
1110
+ city_id?: string;
1111
+ limit?: number;
1112
+ offset?: number;
1113
+ }
1114
+ interface BaleFeedItem extends Bale {
1115
+ image_url: string | null;
1116
+ store: {
1117
+ name: string;
1118
+ slug: string;
1119
+ verified: boolean;
1120
+ sti: number | null;
1121
+ };
1122
+ }
1123
+ interface SaveWholesaleStoreInput {
1124
+ name: string;
1125
+ tagline?: string;
1126
+ description?: string;
1127
+ logo_url?: string;
1128
+ origins?: string[];
1129
+ }
1130
+ interface AddDepotInput {
1131
+ name: string;
1132
+ address?: string;
1133
+ city_id?: string;
1134
+ is_primary?: boolean;
1135
+ }
1136
+ declare const BALE_ORDER_STATUSES: readonly ["pending_payment", "paid", "confirmed", "in_transit", "delivered", "completed", "cancelled"];
1137
+ type BaleOrderStatus = typeof BALE_ORDER_STATUSES[number];
1138
+ type BaleFulfillment = 'pickup' | 'courier';
1139
+ interface BaleOrder {
1140
+ id: string;
1141
+ bale_id: string;
1142
+ buyer_id: string;
1143
+ seller_id: string;
1144
+ store_id: string;
1145
+ title: string;
1146
+ grade: string;
1147
+ origin: string | null;
1148
+ image_url: string | null;
1149
+ qty: number;
1150
+ unit_kes: number;
1151
+ total_kes: number;
1152
+ fulfillment: BaleFulfillment;
1153
+ freight_kes: number | null;
1154
+ status: BaleOrderStatus;
1155
+ city_id: string | null;
1156
+ created_at: string;
1157
+ }
1158
+ interface BaleOrderEvent {
1159
+ actor: string;
1160
+ old_status: string | null;
1161
+ new_status: string;
1162
+ note: string | null;
1163
+ created_at: string;
1164
+ }
1165
+ interface CreateBaleOrderInput {
1166
+ bale_id: string;
1167
+ qty?: number;
1168
+ fulfillment: BaleFulfillment;
1169
+ }
1170
+
1031
1171
  interface MitumbaClientConfig {
1032
1172
  baseUrl: string;
1033
1173
  debug?: boolean;
@@ -1208,6 +1348,14 @@ declare class AuthModule {
1208
1348
  roles: string[];
1209
1349
  sti_score: number;
1210
1350
  }>;
1351
+ /**
1352
+ * Upgrade the current user to a bale (wholesale) seller role.
1353
+ * Mutually exclusive with retail seller — 409 if already a retail seller.
1354
+ */
1355
+ becomeBaleSeller(input: BecomeBaleSellerInput, options?: RequestOptions): Promise<{
1356
+ ok: true;
1357
+ roles: string[];
1358
+ }>;
1211
1359
  /**
1212
1360
  * Check if the account is eligible for deletion and what blockers exist.
1213
1361
  */
@@ -2127,6 +2275,75 @@ declare class ReportsModule {
2127
2275
  }>;
2128
2276
  }
2129
2277
 
2278
+ declare class WholesaleModule {
2279
+ private readonly client;
2280
+ constructor(client: APIClient);
2281
+ /** Get the current user's wholesale store and depots. */
2282
+ getWholesaleStore(options?: RequestOptions): Promise<{
2283
+ store: WholesaleStore | null;
2284
+ depots?: WholesaleDepot[];
2285
+ }>;
2286
+ /** Create or update the wholesale store (bale_seller only). */
2287
+ saveWholesaleStore(input: SaveWholesaleStoreInput, options?: RequestOptions): Promise<{
2288
+ id: string;
2289
+ verified?: boolean;
2290
+ }>;
2291
+ /** Add a depot to the wholesale store. */
2292
+ addDepot(input: AddDepotInput, options?: RequestOptions): Promise<{
2293
+ id: string;
2294
+ }>;
2295
+ /** Remove a depot. */
2296
+ removeDepot(id: string, options?: RequestOptions): Promise<{
2297
+ ok: true;
2298
+ }>;
2299
+ /** Create a bale listing (requires verified wholesale store). */
2300
+ createBale(input: CreateBaleInput, options?: RequestOptions): Promise<{
2301
+ id: string;
2302
+ }>;
2303
+ /** Get a bale by ID (public). */
2304
+ getBale(id: string, options?: RequestOptions): Promise<BaleDetail>;
2305
+ /** Update a bale. */
2306
+ updateBale(id: string, input: Partial<CreateBaleInput>, options?: RequestOptions): Promise<{
2307
+ ok: true;
2308
+ }>;
2309
+ /** Soft-delete a bale. */
2310
+ removeBale(id: string, options?: RequestOptions): Promise<{
2311
+ ok: true;
2312
+ }>;
2313
+ /** Get all bales for the current user's wholesale store. */
2314
+ myBales(options?: RequestOptions): Promise<{
2315
+ data: Bale[];
2316
+ }>;
2317
+ /** Browse the wholesale bale feed (public). */
2318
+ wholesaleFeed(params?: WholesaleFeedParams, options?: RequestOptions): Promise<{
2319
+ data: BaleFeedItem[];
2320
+ limit: number;
2321
+ offset: number;
2322
+ }>;
2323
+ /** Create a bale order (buyer). */
2324
+ createBaleOrder(input: CreateBaleOrderInput, options?: RequestOptions): Promise<{
2325
+ id: string;
2326
+ total_kes: number;
2327
+ }>;
2328
+ /** Get the buyer's bale orders. */
2329
+ myBaleOrders(options?: RequestOptions): Promise<{
2330
+ data: BaleOrder[];
2331
+ }>;
2332
+ /** Get incoming bale orders (seller). */
2333
+ incomingBaleOrders(options?: RequestOptions): Promise<{
2334
+ data: BaleOrder[];
2335
+ }>;
2336
+ /** Get a bale order by ID with event timeline. */
2337
+ getBaleOrder(id: string, options?: RequestOptions): Promise<BaleOrder & {
2338
+ events: BaleOrderEvent[];
2339
+ }>;
2340
+ /** Transition a bale order status. */
2341
+ transitionBaleOrder(id: string, action: 'confirm' | 'dispatch' | 'deliver' | 'receive', options?: RequestOptions): Promise<{
2342
+ ok: true;
2343
+ status: BaleOrderStatus;
2344
+ }>;
2345
+ }
2346
+
2130
2347
  declare class MitumbaClient {
2131
2348
  readonly api: APIClient;
2132
2349
  readonly auth: AuthModule;
@@ -2148,6 +2365,7 @@ declare class MitumbaClient {
2148
2365
  readonly disputes: DisputesModule;
2149
2366
  readonly uploads: UploadsModule;
2150
2367
  readonly reports: ReportsModule;
2368
+ readonly wholesale: WholesaleModule;
2151
2369
  constructor(config: MitumbaClientConfig);
2152
2370
  /**
2153
2371
  * Set the access token for authenticated requests.
@@ -2179,4 +2397,4 @@ declare class MitumbaClient {
2179
2397
  isAuthenticated(): Promise<boolean>;
2180
2398
  }
2181
2399
 
2182
- export { APIClient, APIError, type APIErrorResponse, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddPaymentMethodInput, type Address, type AdminListingItem, AdminModule, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminReport, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, AuthModule, type AuthTokens, type AuthenticationResponseJSON, type BecomeSellerInput, type BlockedIp, type Business, BusinessesModule, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateListingInput, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type InboxRealtimeEvent, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type ResetPasswordInput, type ResolveDisputeInput, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type SaveSearchInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SendEmailInput, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreSettings, type StoreStats, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WishlistListing, WishlistsModule, createTokenStore };
2400
+ export { APIClient, APIError, type APIErrorResponse, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddPaymentMethodInput, type Address, type AdminListingItem, AdminModule, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminReport, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type City, type CompleteOnboardingInput, type Condition, type Conversation, type CreateBaleInput, type CreateBaleOrderInput, type CreateListingInput, type CreateOrderInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type InboxRealtimeEvent, LISTING_STATUSES, type LinkedAccount, type LinkedAccountProvider, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, MemoryTokenStore, type Message, type MessageResponse, MessagesModule, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, ORDER_STATUSES, type Order, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type RegisterInput, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type ResetPasswordInput, type ResolveDisputeInput, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type Session, SettingsModule, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreSettings, type StoreStats, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateListingInput, type UpdateProfileInput, type UpdateStoreInput, UploadsModule, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyOtpInput, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleStore, type WishlistListing, WishlistsModule, createTokenStore };
package/dist/index.js CHANGED
@@ -436,6 +436,13 @@ var AuthModule = class {
436
436
  async becomeSeller(input, options) {
437
437
  return this.client.post("/auth/become-seller", input, options);
438
438
  }
439
+ /**
440
+ * Upgrade the current user to a bale (wholesale) seller role.
441
+ * Mutually exclusive with retail seller — 409 if already a retail seller.
442
+ */
443
+ async becomeBaleSeller(input, options) {
444
+ return this.client.post("/auth/become-bale-seller", input, options);
445
+ }
439
446
  /**
440
447
  * Check if the account is eligible for deletion and what blockers exist.
441
448
  */
@@ -1416,6 +1423,82 @@ var ReportsModule = class {
1416
1423
  }
1417
1424
  };
1418
1425
 
1426
+ // src/modules/wholesale.ts
1427
+ var WholesaleModule = class {
1428
+ constructor(client) {
1429
+ this.client = client;
1430
+ }
1431
+ client;
1432
+ // ── Wholesale Store ──
1433
+ /** Get the current user's wholesale store and depots. */
1434
+ async getWholesaleStore(options) {
1435
+ return this.client.get("/listings/wholesale/store", void 0, options);
1436
+ }
1437
+ /** Create or update the wholesale store (bale_seller only). */
1438
+ async saveWholesaleStore(input, options) {
1439
+ return this.client.post("/listings/wholesale/store", input, options);
1440
+ }
1441
+ /** Add a depot to the wholesale store. */
1442
+ async addDepot(input, options) {
1443
+ return this.client.post("/listings/wholesale/store/depots", input, options);
1444
+ }
1445
+ /** Remove a depot. */
1446
+ async removeDepot(id, options) {
1447
+ return this.client.delete(`/listings/wholesale/store/depots/${id}`, void 0, options);
1448
+ }
1449
+ // ── Bales ──
1450
+ /** Create a bale listing (requires verified wholesale store). */
1451
+ async createBale(input, options) {
1452
+ return this.client.post("/listings/bales", input, options);
1453
+ }
1454
+ /** Get a bale by ID (public). */
1455
+ async getBale(id, options) {
1456
+ return this.client.get(`/listings/bales/${id}`, void 0, options);
1457
+ }
1458
+ /** Update a bale. */
1459
+ async updateBale(id, input, options) {
1460
+ return this.client.patch(`/listings/bales/${id}`, input, options);
1461
+ }
1462
+ /** Soft-delete a bale. */
1463
+ async removeBale(id, options) {
1464
+ return this.client.delete(`/listings/bales/${id}`, void 0, options);
1465
+ }
1466
+ /** Get all bales for the current user's wholesale store. */
1467
+ async myBales(options) {
1468
+ return this.client.get("/listings/wholesale/mine/bales", void 0, options);
1469
+ }
1470
+ // ── Feed ──
1471
+ /** Browse the wholesale bale feed (public). */
1472
+ async wholesaleFeed(params, options) {
1473
+ return this.client.get(
1474
+ "/listings/wholesale/feed",
1475
+ params,
1476
+ options
1477
+ );
1478
+ }
1479
+ // ── Bale Orders ──
1480
+ /** Create a bale order (buyer). */
1481
+ async createBaleOrder(input, options) {
1482
+ return this.client.post("/listings/bale-orders", input, options);
1483
+ }
1484
+ /** Get the buyer's bale orders. */
1485
+ async myBaleOrders(options) {
1486
+ return this.client.get("/listings/bale-orders/mine", void 0, options);
1487
+ }
1488
+ /** Get incoming bale orders (seller). */
1489
+ async incomingBaleOrders(options) {
1490
+ return this.client.get("/listings/wholesale/orders", void 0, options);
1491
+ }
1492
+ /** Get a bale order by ID with event timeline. */
1493
+ async getBaleOrder(id, options) {
1494
+ return this.client.get(`/listings/bale-orders/${id}`, void 0, options);
1495
+ }
1496
+ /** Transition a bale order status. */
1497
+ async transitionBaleOrder(id, action, options) {
1498
+ return this.client.post(`/listings/bale-orders/${id}/transition`, { action }, options);
1499
+ }
1500
+ };
1501
+
1419
1502
  // src/types/auth.ts
1420
1503
  var TWO_FACTOR_METHOD_TYPES = ["totp", "sms", "email", "passkey"];
1421
1504
 
@@ -1444,6 +1527,9 @@ var DISPUTE_REASONS = ["not_received", "not_as_described", "damaged", "counterfe
1444
1527
  var DESIRED_RESOLUTIONS = ["refund", "replacement", "partial_refund"];
1445
1528
  var DISPUTE_STATUSES = ["open", "seller_responded", "under_review", "resolved_refund", "resolved_release", "resolved_partial", "withdrawn"];
1446
1529
 
1530
+ // src/types/wholesale.ts
1531
+ var BALE_ORDER_STATUSES = ["pending_payment", "paid", "confirmed", "in_transit", "delivered", "completed", "cancelled"];
1532
+
1447
1533
  // src/index.ts
1448
1534
  var MitumbaClient = class {
1449
1535
  api;
@@ -1466,6 +1552,7 @@ var MitumbaClient = class {
1466
1552
  disputes;
1467
1553
  uploads;
1468
1554
  reports;
1555
+ wholesale;
1469
1556
  constructor(config) {
1470
1557
  this.api = new APIClient(config);
1471
1558
  this.auth = new AuthModule(this.api);
@@ -1487,6 +1574,7 @@ var MitumbaClient = class {
1487
1574
  this.disputes = new DisputesModule(this.api);
1488
1575
  this.uploads = new UploadsModule(this.api);
1489
1576
  this.reports = new ReportsModule(this.api);
1577
+ this.wholesale = new WholesaleModule(this.api);
1490
1578
  }
1491
1579
  /**
1492
1580
  * Set the access token for authenticated requests.
@@ -1531,6 +1619,7 @@ exports.APIClient = APIClient;
1531
1619
  exports.APIError = APIError;
1532
1620
  exports.AdminModule = AdminModule;
1533
1621
  exports.AuthModule = AuthModule;
1622
+ exports.BALE_ORDER_STATUSES = BALE_ORDER_STATUSES;
1534
1623
  exports.BusinessesModule = BusinessesModule;
1535
1624
  exports.CONDITIONS = CONDITIONS;
1536
1625
  exports.CartModule = CartModule;
@@ -1558,6 +1647,7 @@ exports.StoresModule = StoresModule;
1558
1647
  exports.TWO_FACTOR_METHOD_TYPES = TWO_FACTOR_METHOD_TYPES;
1559
1648
  exports.UploadsModule = UploadsModule;
1560
1649
  exports.VaziModule = VaziModule;
1650
+ exports.WholesaleModule = WholesaleModule;
1561
1651
  exports.WishlistsModule = WishlistsModule;
1562
1652
  exports.createTokenStore = createTokenStore;
1563
1653
  //# sourceMappingURL=index.js.map