@mitumba/sdk 5.30.0 → 5.32.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
@@ -1074,6 +1074,38 @@ interface AdminPayoutItem {
1074
1074
  */
1075
1075
  needs_correlation?: boolean;
1076
1076
  }
1077
+ type AdminRefundStatus = 'pending' | 'sent' | 'failed';
1078
+ type AdminRefundReason = 'shop_cancelled' | 'handover_missed' | 'dispute_refund' | 'dispute_partial_refund';
1079
+ /** What a buyer is owed back, sent to the number that paid once an operator sends it. */
1080
+ interface AdminRefundItem {
1081
+ id: string;
1082
+ order_id: string;
1083
+ /** Whole units of `currency_code`. */
1084
+ amount: number;
1085
+ currency_code: string;
1086
+ reason: AdminRefundReason;
1087
+ /** `sent` is submitted; it is confirmed once `provider_succeeded_at` is set. */
1088
+ status: AdminRefundStatus;
1089
+ created_at: string;
1090
+ approved_by: string | null;
1091
+ approved_at: string | null;
1092
+ /** The masked number it was sent to. */
1093
+ recipient_label: string | null;
1094
+ provider_ref: string | null;
1095
+ provider_succeeded_at: string | null;
1096
+ failure_reason: string | null;
1097
+ /** The rail the payment was made on. */
1098
+ payment_rail: string;
1099
+ /** For a pending refund: why it cannot be sent from the console, or null when it can. */
1100
+ blocked_by: 'sandbox_payment' | 'rail_unsupported' | 'number_not_kept' | null;
1101
+ }
1102
+ interface AdminRefundSendResult {
1103
+ ok: true;
1104
+ /** The provider reference once it accepted the transfer. */
1105
+ ref?: string;
1106
+ /** True when the outcome is not known yet; the provider's result settles it. */
1107
+ await_confirmation?: boolean;
1108
+ }
1077
1109
  type MessageReportStatus = 'open' | 'reviewed' | 'dismissed' | 'actioned';
1078
1110
  type MessageReportOutcome = 'upheld' | 'not_upheld';
1079
1111
  type MessagingSide = 'buyer' | 'store';
@@ -2928,9 +2960,13 @@ interface StoreSettings {
2928
2960
  bus_partners: string[];
2929
2961
  delivery_days_min: number;
2930
2962
  delivery_days_max: number;
2963
+ /** @deprecated Read only and no longer used for payouts. Use `stores.getPayoutDestinations`. Updates ignore it. */
2931
2964
  payout_method: 'mpesa' | 'bank';
2965
+ /** @deprecated Read only and no longer used for payouts. Use `stores.getPayoutDestinations`. Updates ignore it. */
2932
2966
  payout_mpesa_number: string | null;
2967
+ /** @deprecated Read only and no longer used for payouts. Use `stores.getPayoutDestinations`. Updates ignore it. */
2933
2968
  payout_bank_name: string | null;
2969
+ /** @deprecated Read only and no longer used for payouts. Use `stores.getPayoutDestinations`. Updates ignore it. */
2934
2970
  payout_account_number: string | null;
2935
2971
  payout_frequency: 'instant' | 'daily' | 'weekly';
2936
2972
  accept_returns: boolean;
@@ -2986,6 +3022,140 @@ interface StoreAnalytics {
2986
3022
  };
2987
3023
  }
2988
3024
 
3025
+ /**
3026
+ * Where an order's payout stands:
3027
+ * - `in_escrow`: paid, being fulfilled, or delivered with the buyer's window still open.
3028
+ * - `on_hold`: disputed, or held.
3029
+ * - `awaiting_approval`: completed; waits to be released.
3030
+ * - `approved`: released, not yet sent.
3031
+ * - `sending`: submitted, not yet confirmed.
3032
+ * - `sent`: confirmed.
3033
+ * - `failed`: refused by the provider.
3034
+ * - `test`: paid in a test environment; never paid out.
3035
+ */
3036
+ type PayoutState = 'in_escrow' | 'on_hold' | 'awaiting_approval' | 'approved' | 'sending' | 'sent' | 'failed' | 'test';
3037
+ /** Totals for one currency, per payout state, in minor units. */
3038
+ interface EarningsBalance {
3039
+ currency: string;
3040
+ totals: Record<PayoutState, {
3041
+ amount_minor: number;
3042
+ count: number;
3043
+ }>;
3044
+ /** Whether any amount is an estimate (an order with no payout yet). */
3045
+ includes_estimates: boolean;
3046
+ }
3047
+ /** `GET /orders/stores/:storeId/earnings`. */
3048
+ interface ShopEarnings {
3049
+ store_id: string;
3050
+ /** One per currency, sorted by currency code. */
3051
+ balances: EarningsBalance[];
3052
+ /** When the owner's payouts are frozen until, or null. */
3053
+ frozen_until: string | null;
3054
+ }
3055
+ /** A payout destination as everyone sees it: masked. */
3056
+ interface PayoutDestinationLabel {
3057
+ method: PayoutMethodType;
3058
+ label: string;
3059
+ }
3060
+ /** One order's entitlement: what the shop is owed or was paid for it. */
3061
+ interface ShopPayoutEntry {
3062
+ /** The payout's id, or null while the order has no payout yet. */
3063
+ id: string | null;
3064
+ order_id: string;
3065
+ invoice_number: string | null;
3066
+ state: PayoutState;
3067
+ amount_minor: number;
3068
+ currency: string;
3069
+ /** True when `amount_minor` is an estimate from the order's frozen fees. */
3070
+ estimated: boolean;
3071
+ created_at: string;
3072
+ /** When the provider confirmed it, for a sent payout. */
3073
+ sent_at: string | null;
3074
+ /** Where it was sent, for a payout that is sending, sent or failed. */
3075
+ destination: PayoutDestinationLabel | null;
3076
+ }
3077
+ /** `GET /orders/stores/:storeId/earnings/entries`. */
3078
+ interface ShopPayoutEntriesPage {
3079
+ data: ShopPayoutEntry[];
3080
+ page: number;
3081
+ page_size: number;
3082
+ total: number;
3083
+ }
3084
+ interface ShopPayoutEntriesParams {
3085
+ state?: PayoutState;
3086
+ page?: number;
3087
+ }
3088
+ /** `GET /orders/stores/:storeId/payouts/:payoutId`: one payout with its settlement lines. */
3089
+ interface ShopPayout extends ShopPayoutEntry {
3090
+ id: string;
3091
+ /** Signed lines in minor units that sum to the payout. */
3092
+ lines: SettlementLine[];
3093
+ }
3094
+ /** A payout method. A market lists the ones it offers. */
3095
+ type PayoutMethodType = 'mpesa_mobile' | 'mpesa_pochi' | 'mpesa_till' | 'mpesa_paybill' | 'bank_account';
3096
+ interface PayoutMethodOption {
3097
+ id: PayoutMethodType;
3098
+ name: string;
3099
+ /** Whether destinations of this method can be added now. */
3100
+ enabled: boolean;
3101
+ }
3102
+ interface PayoutBankOption {
3103
+ id: string;
3104
+ name: string;
3105
+ }
3106
+ /** One of the shop's destinations, masked. */
3107
+ interface PayoutDestination {
3108
+ id: string;
3109
+ method: PayoutMethodType;
3110
+ method_name: string;
3111
+ label: string;
3112
+ /** `cooling_off` until `effective_at`: it cannot receive payouts yet. */
3113
+ state: 'active' | 'cooling_off';
3114
+ effective_at: string;
3115
+ is_default: boolean;
3116
+ created_at: string;
3117
+ }
3118
+ /** The shop's destinations, as every change answers. */
3119
+ interface PayoutDestinationsState {
3120
+ destinations: PayoutDestination[];
3121
+ default_destination_id: string | null;
3122
+ /** A change of default waiting out its cooling-off, or null. */
3123
+ pending_default: {
3124
+ destination_id: string;
3125
+ from: string;
3126
+ } | null;
3127
+ }
3128
+ /** `GET /listings/stores/:storeId/payout-destinations`. */
3129
+ interface PayoutDestinations extends PayoutDestinationsState {
3130
+ market_code: string;
3131
+ methods: PayoutMethodOption[];
3132
+ banks: PayoutBankOption[];
3133
+ /** Whether the caller may change them (the owner). */
3134
+ can_manage: boolean;
3135
+ }
3136
+ /** What the owner gives for each method. */
3137
+ type AddPayoutDestinationInput = {
3138
+ method: 'mpesa_mobile' | 'mpesa_pochi';
3139
+ phone: string;
3140
+ make_default?: boolean;
3141
+ } | {
3142
+ method: 'mpesa_till';
3143
+ till_number: string;
3144
+ make_default?: boolean;
3145
+ } | {
3146
+ method: 'mpesa_paybill';
3147
+ paybill_number: string;
3148
+ account_number: string;
3149
+ make_default?: boolean;
3150
+ } | {
3151
+ method: 'bank_account';
3152
+ bank_id: string;
3153
+ account_number: string;
3154
+ make_default?: boolean;
3155
+ };
3156
+ /** Why a destination was refused on entry, with the field to fix. */
3157
+ type PayoutDestinationRejection = 'invalid_phone' | 'invalid_till' | 'invalid_paybill' | 'invalid_account' | 'unknown_bank' | 'method_not_offered';
3158
+
2989
3159
  interface Review {
2990
3160
  id: string;
2991
3161
  store_id: string;
@@ -4515,7 +4685,66 @@ declare class StoresModule {
4515
4685
  blocked: true;
4516
4686
  reasons: string[];
4517
4687
  }>;
4688
+ /**
4689
+ * A shop's earnings: per currency, what is in escrow, on hold, awaiting approval, approved,
4690
+ * sending, sent, failed or a test, in minor units. The owner, or a team member who may read
4691
+ * earnings.
4692
+ *
4693
+ * Errors: 403 forbidden (a member whose role does not include earnings); 404 not_found.
4694
+ */
4695
+ getEarnings(storeId: string, options?: RequestOptions): Promise<ShopEarnings>;
4696
+ /**
4697
+ * Each paid order's entitlement, newest first, 20 per page, optionally of one state.
4698
+ *
4699
+ * Errors: 400 invalid_input (unknown state); 403 forbidden; 404 not_found.
4700
+ */
4701
+ getEarningsEntries(storeId: string, params?: ShopPayoutEntriesParams, options?: RequestOptions): Promise<ShopPayoutEntriesPage>;
4702
+ /**
4703
+ * One payout of the shop, with the settlement lines that explain it.
4704
+ *
4705
+ * Errors: 403 forbidden; 404 not_found.
4706
+ */
4707
+ getPayout(storeId: string, payoutId: string, options?: RequestOptions): Promise<ShopPayout>;
4708
+ /**
4709
+ * Where the shop is paid: its destinations, masked, with the methods and banks on offer. The
4710
+ * owner, or a team member who may read earnings.
4711
+ *
4712
+ * Errors: 403 store_forbidden.
4713
+ */
4714
+ getPayoutDestinations(storeId: string, options?: RequestOptions): Promise<PayoutDestinations>;
4715
+ /**
4716
+ * Owner: add a payout destination. The shop's first applies at once; every later one, and a change
4717
+ * of default, 48 hours later. Needs a second factor used in the last 10 minutes.
4718
+ *
4719
+ * Errors: 400 invalid_input, or a `PayoutDestinationRejection` with `field`; 403 store_forbidden,
4720
+ * step_up_required; 409 method_unavailable, destination_exists, too_many_destinations.
4721
+ */
4722
+ addPayoutDestination(storeId: string, input: AddPayoutDestinationInput, options?: RequestOptions): Promise<PayoutDestinationsState>;
4723
+ /**
4724
+ * Owner: make a destination the default, 48 hours from now. Choosing the current default again
4725
+ * cancels any pending change. Needs a recent second factor.
4726
+ *
4727
+ * Errors: 403 store_forbidden, step_up_required; 404 not_found.
4728
+ */
4729
+ setDefaultPayoutDestination(storeId: string, destinationId: string, options?: RequestOptions): Promise<PayoutDestinationsState>;
4730
+ /**
4731
+ * Owner: cancel a pending change of default to this destination. Needs a recent second factor.
4732
+ *
4733
+ * Errors: 403 store_forbidden, step_up_required; 404 not_found; 409 no_pending_default.
4734
+ */
4735
+ cancelPendingDefault(storeId: string, destinationId: string, options?: RequestOptions): Promise<PayoutDestinationsState>;
4736
+ /**
4737
+ * Owner: remove a destination, or cancel one still cooling off. The current default cannot be
4738
+ * removed: make another destination the default first, and remove this one once that applies.
4739
+ * Needs a recent second factor.
4740
+ *
4741
+ * Errors: 403 store_forbidden, step_up_required; 404 not_found; 409 default_destination.
4742
+ */
4743
+ removePayoutDestination(storeId: string, destinationId: string, options?: RequestOptions): Promise<PayoutDestinationsState>;
4744
+ private destinationPath;
4518
4745
  }
4746
+ /** Whether an error asks the caller to sign in again with a second factor before retrying. */
4747
+ declare function stepUpRequired(error: unknown): boolean;
4519
4748
 
4520
4749
  declare class ReviewsModule {
4521
4750
  private readonly client;
@@ -4946,6 +5175,26 @@ declare class AdminModule {
4946
5175
  ok: true;
4947
5176
  result: unknown;
4948
5177
  }>;
5178
+ /**
5179
+ * Refunds owed to buyers, newest first, 25 per page. `admin:read`.
5180
+ *
5181
+ * Errors: 400 invalid_input (unknown status).
5182
+ */
5183
+ listRefunds(params?: {
5184
+ status?: AdminRefundStatus;
5185
+ page?: number;
5186
+ }, options?: RequestOptions): Promise<{
5187
+ data: AdminRefundItem[];
5188
+ page: number;
5189
+ page_size: number;
5190
+ }>;
5191
+ /**
5192
+ * Send a pending refund to the number that paid. `payouts:disburse` with a recent passkey.
5193
+ *
5194
+ * Errors: 403 forbidden; 404 refund_not_found; 409 refund_sandbox_payment, refund_number_unavailable;
5195
+ * 503 refund_disbursement_paused, refund_method_unsupported.
5196
+ */
5197
+ sendRefund(refundId: string, options?: RequestOptions): Promise<AdminRefundSendResult>;
4949
5198
  listReports(params?: {
4950
5199
  status?: 'open' | 'reviewed' | 'dismissed' | 'actioned';
4951
5200
  type?: 'listing' | 'review' | 'store' | 'user';
@@ -5653,4 +5902,4 @@ declare class MitumbaClient {
5653
5902
  isAuthenticated(): Promise<boolean>;
5654
5903
  }
5655
5904
 
5656
- export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, type AdminMessageReport, type AdminMessageReportDetail, type AdminMessageReportList, type AdminMessageReportThreadMessage, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CancelCheckoutRefusalCode, type CancelCheckoutResponse, type CancelOrderInput, type CancelOrderResult, type CartItem, type CartLineAvailability, CartModule, type CartPartition, type CategoriesBySection, type Category, type CategorySection, type ChangePasswordInput, type ChangePlatformSettingInput, type ChangePlatformSettingResult, type Checkout, type CheckoutMoney, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutRefusal, type CheckoutRefusalCode, type CheckoutShopOrder, type CheckoutState, type CheckoutStatus, type CheckoutStatusResponse, CheckoutsModule, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateCheckoutInput, type CreateCheckoutResponse, type CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CreatedBaleOrder, type CursorPage, DEFAULT_SHARE_ORIGIN, 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 FileResponse, type FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, type GetCheckoutResponse, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamSession, type IamSessionsResult, type IamSignIn, type IamSignInFailureReason, type IamSignInsResult, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, type KnownShopStep, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LibraryCadence, type LibraryCompleter, type LibraryDocument, type LibraryDocumentSummary, type LibraryKind, type LibraryListing, type LibraryOccurrence, type LibraryOccurrenceRecorded, type LibraryOccurrenceStatus, type LibraryRoutineState, type LibrarySchedule, type LibraryScheduleRule, type LibrarySeason, type LibraryWeekday, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LiveUnread, type LiveUnreadOptions, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportOutcome, type MessageReportReason, type MessageReportStatus, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, type MessagingSide, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationAction, type NotificationCategory, type NotificationFlash, type NotificationLink, type NotificationPref, type NotificationStream, type NotificationStreamFrame, type NotificationStreamItem, type NotificationStreamOptions, type NotificationStreamState, type NotificationStreamTicket, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthClient, type OAuthClientSummary, type OAuthClientTrustLevel, type OAuthClientType, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OidcSigningKey, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderDocument, type OrderDocumentKind, type OrderEvent, type OrderHistoryEntry, type OrderHistoryParams, type OrderItem, type OrderItemSummary, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PlatformSetting, type PlatformSettingChange, type PlatformSettingDetail, type PlatformSettingGroup, type PlatformSettingKind, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegenerateIamBackupCodesResult, type RegisterInput, type RegisterOAuthClientInput, type RegisteredOAuthClient, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveMessageReportInput, type ResolveMessageReportResult, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendTestNotificationResult, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type SettlementLine, type ShareUrlOptions, type ShopCancelReason, type ShopHolder, type ShopNextStep, type ShopOrderFields, type ShopSettlement, type ShopStep, type SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, cartLineAvailability, categoriesBySection, categorySection, checkoutRefusal, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isCartLineBuyable, isConditionAllowed, isConsentRequired, isMessagingAPIError, isNewOnlyCategory, isValidPhone, listingShareUrl, maskPhone, normalizePhone, partitionCart, regionById, storeShareUrl };
5905
+ export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type AddPayoutDestinationInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, type AdminMessageReport, type AdminMessageReportDetail, type AdminMessageReportList, type AdminMessageReportThreadMessage, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminRefundItem, type AdminRefundReason, type AdminRefundSendResult, type AdminRefundStatus, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CancelCheckoutRefusalCode, type CancelCheckoutResponse, type CancelOrderInput, type CancelOrderResult, type CartItem, type CartLineAvailability, CartModule, type CartPartition, type CategoriesBySection, type Category, type CategorySection, type ChangePasswordInput, type ChangePlatformSettingInput, type ChangePlatformSettingResult, type Checkout, type CheckoutMoney, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutRefusal, type CheckoutRefusalCode, type CheckoutShopOrder, type CheckoutState, type CheckoutStatus, type CheckoutStatusResponse, CheckoutsModule, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateCheckoutInput, type CreateCheckoutResponse, type CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CreatedBaleOrder, type CursorPage, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EarningsBalance, type EmailLoginInput, type EmailRegisterInput, type FileResponse, type FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, type GetCheckoutResponse, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamSession, type IamSessionsResult, type IamSignIn, type IamSignInFailureReason, type IamSignInsResult, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, type KnownShopStep, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LibraryCadence, type LibraryCompleter, type LibraryDocument, type LibraryDocumentSummary, type LibraryKind, type LibraryListing, type LibraryOccurrence, type LibraryOccurrenceRecorded, type LibraryOccurrenceStatus, type LibraryRoutineState, type LibrarySchedule, type LibraryScheduleRule, type LibrarySeason, type LibraryWeekday, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LiveUnread, type LiveUnreadOptions, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportOutcome, type MessageReportReason, type MessageReportStatus, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, type MessagingSide, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationAction, type NotificationCategory, type NotificationFlash, type NotificationLink, type NotificationPref, type NotificationStream, type NotificationStreamFrame, type NotificationStreamItem, type NotificationStreamOptions, type NotificationStreamState, type NotificationStreamTicket, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthClient, type OAuthClientSummary, type OAuthClientTrustLevel, type OAuthClientType, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OidcSigningKey, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderDocument, type OrderDocumentKind, type OrderEvent, type OrderHistoryEntry, type OrderHistoryParams, type OrderItem, type OrderItemSummary, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PayoutBankOption, type PayoutDestination, type PayoutDestinationLabel, type PayoutDestinationRejection, type PayoutDestinations, type PayoutDestinationsState, type PayoutMethodOption, type PayoutMethodType, type PayoutState, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PlatformSetting, type PlatformSettingChange, type PlatformSettingDetail, type PlatformSettingGroup, type PlatformSettingKind, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegenerateIamBackupCodesResult, type RegisterInput, type RegisterOAuthClientInput, type RegisteredOAuthClient, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveMessageReportInput, type ResolveMessageReportResult, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendTestNotificationResult, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type SettlementLine, type ShareUrlOptions, type ShopCancelReason, type ShopEarnings, type ShopHolder, type ShopNextStep, type ShopOrderFields, type ShopPayout, type ShopPayoutEntriesPage, type ShopPayoutEntriesParams, type ShopPayoutEntry, type ShopSettlement, type ShopStep, type SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, cartLineAvailability, categoriesBySection, categorySection, checkoutRefusal, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isCartLineBuyable, isConditionAllowed, isConsentRequired, isMessagingAPIError, isNewOnlyCategory, isValidPhone, listingShareUrl, maskPhone, normalizePhone, partitionCart, regionById, stepUpRequired, storeShareUrl };
package/dist/index.d.ts CHANGED
@@ -1074,6 +1074,38 @@ interface AdminPayoutItem {
1074
1074
  */
1075
1075
  needs_correlation?: boolean;
1076
1076
  }
1077
+ type AdminRefundStatus = 'pending' | 'sent' | 'failed';
1078
+ type AdminRefundReason = 'shop_cancelled' | 'handover_missed' | 'dispute_refund' | 'dispute_partial_refund';
1079
+ /** What a buyer is owed back, sent to the number that paid once an operator sends it. */
1080
+ interface AdminRefundItem {
1081
+ id: string;
1082
+ order_id: string;
1083
+ /** Whole units of `currency_code`. */
1084
+ amount: number;
1085
+ currency_code: string;
1086
+ reason: AdminRefundReason;
1087
+ /** `sent` is submitted; it is confirmed once `provider_succeeded_at` is set. */
1088
+ status: AdminRefundStatus;
1089
+ created_at: string;
1090
+ approved_by: string | null;
1091
+ approved_at: string | null;
1092
+ /** The masked number it was sent to. */
1093
+ recipient_label: string | null;
1094
+ provider_ref: string | null;
1095
+ provider_succeeded_at: string | null;
1096
+ failure_reason: string | null;
1097
+ /** The rail the payment was made on. */
1098
+ payment_rail: string;
1099
+ /** For a pending refund: why it cannot be sent from the console, or null when it can. */
1100
+ blocked_by: 'sandbox_payment' | 'rail_unsupported' | 'number_not_kept' | null;
1101
+ }
1102
+ interface AdminRefundSendResult {
1103
+ ok: true;
1104
+ /** The provider reference once it accepted the transfer. */
1105
+ ref?: string;
1106
+ /** True when the outcome is not known yet; the provider's result settles it. */
1107
+ await_confirmation?: boolean;
1108
+ }
1077
1109
  type MessageReportStatus = 'open' | 'reviewed' | 'dismissed' | 'actioned';
1078
1110
  type MessageReportOutcome = 'upheld' | 'not_upheld';
1079
1111
  type MessagingSide = 'buyer' | 'store';
@@ -2928,9 +2960,13 @@ interface StoreSettings {
2928
2960
  bus_partners: string[];
2929
2961
  delivery_days_min: number;
2930
2962
  delivery_days_max: number;
2963
+ /** @deprecated Read only and no longer used for payouts. Use `stores.getPayoutDestinations`. Updates ignore it. */
2931
2964
  payout_method: 'mpesa' | 'bank';
2965
+ /** @deprecated Read only and no longer used for payouts. Use `stores.getPayoutDestinations`. Updates ignore it. */
2932
2966
  payout_mpesa_number: string | null;
2967
+ /** @deprecated Read only and no longer used for payouts. Use `stores.getPayoutDestinations`. Updates ignore it. */
2933
2968
  payout_bank_name: string | null;
2969
+ /** @deprecated Read only and no longer used for payouts. Use `stores.getPayoutDestinations`. Updates ignore it. */
2934
2970
  payout_account_number: string | null;
2935
2971
  payout_frequency: 'instant' | 'daily' | 'weekly';
2936
2972
  accept_returns: boolean;
@@ -2986,6 +3022,140 @@ interface StoreAnalytics {
2986
3022
  };
2987
3023
  }
2988
3024
 
3025
+ /**
3026
+ * Where an order's payout stands:
3027
+ * - `in_escrow`: paid, being fulfilled, or delivered with the buyer's window still open.
3028
+ * - `on_hold`: disputed, or held.
3029
+ * - `awaiting_approval`: completed; waits to be released.
3030
+ * - `approved`: released, not yet sent.
3031
+ * - `sending`: submitted, not yet confirmed.
3032
+ * - `sent`: confirmed.
3033
+ * - `failed`: refused by the provider.
3034
+ * - `test`: paid in a test environment; never paid out.
3035
+ */
3036
+ type PayoutState = 'in_escrow' | 'on_hold' | 'awaiting_approval' | 'approved' | 'sending' | 'sent' | 'failed' | 'test';
3037
+ /** Totals for one currency, per payout state, in minor units. */
3038
+ interface EarningsBalance {
3039
+ currency: string;
3040
+ totals: Record<PayoutState, {
3041
+ amount_minor: number;
3042
+ count: number;
3043
+ }>;
3044
+ /** Whether any amount is an estimate (an order with no payout yet). */
3045
+ includes_estimates: boolean;
3046
+ }
3047
+ /** `GET /orders/stores/:storeId/earnings`. */
3048
+ interface ShopEarnings {
3049
+ store_id: string;
3050
+ /** One per currency, sorted by currency code. */
3051
+ balances: EarningsBalance[];
3052
+ /** When the owner's payouts are frozen until, or null. */
3053
+ frozen_until: string | null;
3054
+ }
3055
+ /** A payout destination as everyone sees it: masked. */
3056
+ interface PayoutDestinationLabel {
3057
+ method: PayoutMethodType;
3058
+ label: string;
3059
+ }
3060
+ /** One order's entitlement: what the shop is owed or was paid for it. */
3061
+ interface ShopPayoutEntry {
3062
+ /** The payout's id, or null while the order has no payout yet. */
3063
+ id: string | null;
3064
+ order_id: string;
3065
+ invoice_number: string | null;
3066
+ state: PayoutState;
3067
+ amount_minor: number;
3068
+ currency: string;
3069
+ /** True when `amount_minor` is an estimate from the order's frozen fees. */
3070
+ estimated: boolean;
3071
+ created_at: string;
3072
+ /** When the provider confirmed it, for a sent payout. */
3073
+ sent_at: string | null;
3074
+ /** Where it was sent, for a payout that is sending, sent or failed. */
3075
+ destination: PayoutDestinationLabel | null;
3076
+ }
3077
+ /** `GET /orders/stores/:storeId/earnings/entries`. */
3078
+ interface ShopPayoutEntriesPage {
3079
+ data: ShopPayoutEntry[];
3080
+ page: number;
3081
+ page_size: number;
3082
+ total: number;
3083
+ }
3084
+ interface ShopPayoutEntriesParams {
3085
+ state?: PayoutState;
3086
+ page?: number;
3087
+ }
3088
+ /** `GET /orders/stores/:storeId/payouts/:payoutId`: one payout with its settlement lines. */
3089
+ interface ShopPayout extends ShopPayoutEntry {
3090
+ id: string;
3091
+ /** Signed lines in minor units that sum to the payout. */
3092
+ lines: SettlementLine[];
3093
+ }
3094
+ /** A payout method. A market lists the ones it offers. */
3095
+ type PayoutMethodType = 'mpesa_mobile' | 'mpesa_pochi' | 'mpesa_till' | 'mpesa_paybill' | 'bank_account';
3096
+ interface PayoutMethodOption {
3097
+ id: PayoutMethodType;
3098
+ name: string;
3099
+ /** Whether destinations of this method can be added now. */
3100
+ enabled: boolean;
3101
+ }
3102
+ interface PayoutBankOption {
3103
+ id: string;
3104
+ name: string;
3105
+ }
3106
+ /** One of the shop's destinations, masked. */
3107
+ interface PayoutDestination {
3108
+ id: string;
3109
+ method: PayoutMethodType;
3110
+ method_name: string;
3111
+ label: string;
3112
+ /** `cooling_off` until `effective_at`: it cannot receive payouts yet. */
3113
+ state: 'active' | 'cooling_off';
3114
+ effective_at: string;
3115
+ is_default: boolean;
3116
+ created_at: string;
3117
+ }
3118
+ /** The shop's destinations, as every change answers. */
3119
+ interface PayoutDestinationsState {
3120
+ destinations: PayoutDestination[];
3121
+ default_destination_id: string | null;
3122
+ /** A change of default waiting out its cooling-off, or null. */
3123
+ pending_default: {
3124
+ destination_id: string;
3125
+ from: string;
3126
+ } | null;
3127
+ }
3128
+ /** `GET /listings/stores/:storeId/payout-destinations`. */
3129
+ interface PayoutDestinations extends PayoutDestinationsState {
3130
+ market_code: string;
3131
+ methods: PayoutMethodOption[];
3132
+ banks: PayoutBankOption[];
3133
+ /** Whether the caller may change them (the owner). */
3134
+ can_manage: boolean;
3135
+ }
3136
+ /** What the owner gives for each method. */
3137
+ type AddPayoutDestinationInput = {
3138
+ method: 'mpesa_mobile' | 'mpesa_pochi';
3139
+ phone: string;
3140
+ make_default?: boolean;
3141
+ } | {
3142
+ method: 'mpesa_till';
3143
+ till_number: string;
3144
+ make_default?: boolean;
3145
+ } | {
3146
+ method: 'mpesa_paybill';
3147
+ paybill_number: string;
3148
+ account_number: string;
3149
+ make_default?: boolean;
3150
+ } | {
3151
+ method: 'bank_account';
3152
+ bank_id: string;
3153
+ account_number: string;
3154
+ make_default?: boolean;
3155
+ };
3156
+ /** Why a destination was refused on entry, with the field to fix. */
3157
+ type PayoutDestinationRejection = 'invalid_phone' | 'invalid_till' | 'invalid_paybill' | 'invalid_account' | 'unknown_bank' | 'method_not_offered';
3158
+
2989
3159
  interface Review {
2990
3160
  id: string;
2991
3161
  store_id: string;
@@ -4515,7 +4685,66 @@ declare class StoresModule {
4515
4685
  blocked: true;
4516
4686
  reasons: string[];
4517
4687
  }>;
4688
+ /**
4689
+ * A shop's earnings: per currency, what is in escrow, on hold, awaiting approval, approved,
4690
+ * sending, sent, failed or a test, in minor units. The owner, or a team member who may read
4691
+ * earnings.
4692
+ *
4693
+ * Errors: 403 forbidden (a member whose role does not include earnings); 404 not_found.
4694
+ */
4695
+ getEarnings(storeId: string, options?: RequestOptions): Promise<ShopEarnings>;
4696
+ /**
4697
+ * Each paid order's entitlement, newest first, 20 per page, optionally of one state.
4698
+ *
4699
+ * Errors: 400 invalid_input (unknown state); 403 forbidden; 404 not_found.
4700
+ */
4701
+ getEarningsEntries(storeId: string, params?: ShopPayoutEntriesParams, options?: RequestOptions): Promise<ShopPayoutEntriesPage>;
4702
+ /**
4703
+ * One payout of the shop, with the settlement lines that explain it.
4704
+ *
4705
+ * Errors: 403 forbidden; 404 not_found.
4706
+ */
4707
+ getPayout(storeId: string, payoutId: string, options?: RequestOptions): Promise<ShopPayout>;
4708
+ /**
4709
+ * Where the shop is paid: its destinations, masked, with the methods and banks on offer. The
4710
+ * owner, or a team member who may read earnings.
4711
+ *
4712
+ * Errors: 403 store_forbidden.
4713
+ */
4714
+ getPayoutDestinations(storeId: string, options?: RequestOptions): Promise<PayoutDestinations>;
4715
+ /**
4716
+ * Owner: add a payout destination. The shop's first applies at once; every later one, and a change
4717
+ * of default, 48 hours later. Needs a second factor used in the last 10 minutes.
4718
+ *
4719
+ * Errors: 400 invalid_input, or a `PayoutDestinationRejection` with `field`; 403 store_forbidden,
4720
+ * step_up_required; 409 method_unavailable, destination_exists, too_many_destinations.
4721
+ */
4722
+ addPayoutDestination(storeId: string, input: AddPayoutDestinationInput, options?: RequestOptions): Promise<PayoutDestinationsState>;
4723
+ /**
4724
+ * Owner: make a destination the default, 48 hours from now. Choosing the current default again
4725
+ * cancels any pending change. Needs a recent second factor.
4726
+ *
4727
+ * Errors: 403 store_forbidden, step_up_required; 404 not_found.
4728
+ */
4729
+ setDefaultPayoutDestination(storeId: string, destinationId: string, options?: RequestOptions): Promise<PayoutDestinationsState>;
4730
+ /**
4731
+ * Owner: cancel a pending change of default to this destination. Needs a recent second factor.
4732
+ *
4733
+ * Errors: 403 store_forbidden, step_up_required; 404 not_found; 409 no_pending_default.
4734
+ */
4735
+ cancelPendingDefault(storeId: string, destinationId: string, options?: RequestOptions): Promise<PayoutDestinationsState>;
4736
+ /**
4737
+ * Owner: remove a destination, or cancel one still cooling off. The current default cannot be
4738
+ * removed: make another destination the default first, and remove this one once that applies.
4739
+ * Needs a recent second factor.
4740
+ *
4741
+ * Errors: 403 store_forbidden, step_up_required; 404 not_found; 409 default_destination.
4742
+ */
4743
+ removePayoutDestination(storeId: string, destinationId: string, options?: RequestOptions): Promise<PayoutDestinationsState>;
4744
+ private destinationPath;
4518
4745
  }
4746
+ /** Whether an error asks the caller to sign in again with a second factor before retrying. */
4747
+ declare function stepUpRequired(error: unknown): boolean;
4519
4748
 
4520
4749
  declare class ReviewsModule {
4521
4750
  private readonly client;
@@ -4946,6 +5175,26 @@ declare class AdminModule {
4946
5175
  ok: true;
4947
5176
  result: unknown;
4948
5177
  }>;
5178
+ /**
5179
+ * Refunds owed to buyers, newest first, 25 per page. `admin:read`.
5180
+ *
5181
+ * Errors: 400 invalid_input (unknown status).
5182
+ */
5183
+ listRefunds(params?: {
5184
+ status?: AdminRefundStatus;
5185
+ page?: number;
5186
+ }, options?: RequestOptions): Promise<{
5187
+ data: AdminRefundItem[];
5188
+ page: number;
5189
+ page_size: number;
5190
+ }>;
5191
+ /**
5192
+ * Send a pending refund to the number that paid. `payouts:disburse` with a recent passkey.
5193
+ *
5194
+ * Errors: 403 forbidden; 404 refund_not_found; 409 refund_sandbox_payment, refund_number_unavailable;
5195
+ * 503 refund_disbursement_paused, refund_method_unsupported.
5196
+ */
5197
+ sendRefund(refundId: string, options?: RequestOptions): Promise<AdminRefundSendResult>;
4949
5198
  listReports(params?: {
4950
5199
  status?: 'open' | 'reviewed' | 'dismissed' | 'actioned';
4951
5200
  type?: 'listing' | 'review' | 'store' | 'user';
@@ -5653,4 +5902,4 @@ declare class MitumbaClient {
5653
5902
  isAuthenticated(): Promise<boolean>;
5654
5903
  }
5655
5904
 
5656
- export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, type AdminMessageReport, type AdminMessageReportDetail, type AdminMessageReportList, type AdminMessageReportThreadMessage, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CancelCheckoutRefusalCode, type CancelCheckoutResponse, type CancelOrderInput, type CancelOrderResult, type CartItem, type CartLineAvailability, CartModule, type CartPartition, type CategoriesBySection, type Category, type CategorySection, type ChangePasswordInput, type ChangePlatformSettingInput, type ChangePlatformSettingResult, type Checkout, type CheckoutMoney, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutRefusal, type CheckoutRefusalCode, type CheckoutShopOrder, type CheckoutState, type CheckoutStatus, type CheckoutStatusResponse, CheckoutsModule, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateCheckoutInput, type CreateCheckoutResponse, type CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CreatedBaleOrder, type CursorPage, DEFAULT_SHARE_ORIGIN, 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 FileResponse, type FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, type GetCheckoutResponse, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamSession, type IamSessionsResult, type IamSignIn, type IamSignInFailureReason, type IamSignInsResult, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, type KnownShopStep, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LibraryCadence, type LibraryCompleter, type LibraryDocument, type LibraryDocumentSummary, type LibraryKind, type LibraryListing, type LibraryOccurrence, type LibraryOccurrenceRecorded, type LibraryOccurrenceStatus, type LibraryRoutineState, type LibrarySchedule, type LibraryScheduleRule, type LibrarySeason, type LibraryWeekday, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LiveUnread, type LiveUnreadOptions, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportOutcome, type MessageReportReason, type MessageReportStatus, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, type MessagingSide, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationAction, type NotificationCategory, type NotificationFlash, type NotificationLink, type NotificationPref, type NotificationStream, type NotificationStreamFrame, type NotificationStreamItem, type NotificationStreamOptions, type NotificationStreamState, type NotificationStreamTicket, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthClient, type OAuthClientSummary, type OAuthClientTrustLevel, type OAuthClientType, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OidcSigningKey, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderDocument, type OrderDocumentKind, type OrderEvent, type OrderHistoryEntry, type OrderHistoryParams, type OrderItem, type OrderItemSummary, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PlatformSetting, type PlatformSettingChange, type PlatformSettingDetail, type PlatformSettingGroup, type PlatformSettingKind, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegenerateIamBackupCodesResult, type RegisterInput, type RegisterOAuthClientInput, type RegisteredOAuthClient, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveMessageReportInput, type ResolveMessageReportResult, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendTestNotificationResult, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type SettlementLine, type ShareUrlOptions, type ShopCancelReason, type ShopHolder, type ShopNextStep, type ShopOrderFields, type ShopSettlement, type ShopStep, type SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, cartLineAvailability, categoriesBySection, categorySection, checkoutRefusal, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isCartLineBuyable, isConditionAllowed, isConsentRequired, isMessagingAPIError, isNewOnlyCategory, isValidPhone, listingShareUrl, maskPhone, normalizePhone, partitionCart, regionById, storeShareUrl };
5905
+ export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type AddPayoutDestinationInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, type AdminMessageReport, type AdminMessageReportDetail, type AdminMessageReportList, type AdminMessageReportThreadMessage, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminRefundItem, type AdminRefundReason, type AdminRefundSendResult, type AdminRefundStatus, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CancelCheckoutRefusalCode, type CancelCheckoutResponse, type CancelOrderInput, type CancelOrderResult, type CartItem, type CartLineAvailability, CartModule, type CartPartition, type CategoriesBySection, type Category, type CategorySection, type ChangePasswordInput, type ChangePlatformSettingInput, type ChangePlatformSettingResult, type Checkout, type CheckoutMoney, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutRefusal, type CheckoutRefusalCode, type CheckoutShopOrder, type CheckoutState, type CheckoutStatus, type CheckoutStatusResponse, CheckoutsModule, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateCheckoutInput, type CreateCheckoutResponse, type CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CreatedBaleOrder, type CursorPage, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EarningsBalance, type EmailLoginInput, type EmailRegisterInput, type FileResponse, type FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, type GetCheckoutResponse, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamSession, type IamSessionsResult, type IamSignIn, type IamSignInFailureReason, type IamSignInsResult, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, type KnownShopStep, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LibraryCadence, type LibraryCompleter, type LibraryDocument, type LibraryDocumentSummary, type LibraryKind, type LibraryListing, type LibraryOccurrence, type LibraryOccurrenceRecorded, type LibraryOccurrenceStatus, type LibraryRoutineState, type LibrarySchedule, type LibraryScheduleRule, type LibrarySeason, type LibraryWeekday, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LiveUnread, type LiveUnreadOptions, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportOutcome, type MessageReportReason, type MessageReportStatus, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, type MessagingSide, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationAction, type NotificationCategory, type NotificationFlash, type NotificationLink, type NotificationPref, type NotificationStream, type NotificationStreamFrame, type NotificationStreamItem, type NotificationStreamOptions, type NotificationStreamState, type NotificationStreamTicket, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthClient, type OAuthClientSummary, type OAuthClientTrustLevel, type OAuthClientType, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OidcSigningKey, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderDocument, type OrderDocumentKind, type OrderEvent, type OrderHistoryEntry, type OrderHistoryParams, type OrderItem, type OrderItemSummary, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PayoutBankOption, type PayoutDestination, type PayoutDestinationLabel, type PayoutDestinationRejection, type PayoutDestinations, type PayoutDestinationsState, type PayoutMethodOption, type PayoutMethodType, type PayoutState, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PlatformSetting, type PlatformSettingChange, type PlatformSettingDetail, type PlatformSettingGroup, type PlatformSettingKind, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegenerateIamBackupCodesResult, type RegisterInput, type RegisterOAuthClientInput, type RegisteredOAuthClient, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveMessageReportInput, type ResolveMessageReportResult, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendTestNotificationResult, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type SettlementLine, type ShareUrlOptions, type ShopCancelReason, type ShopEarnings, type ShopHolder, type ShopNextStep, type ShopOrderFields, type ShopPayout, type ShopPayoutEntriesPage, type ShopPayoutEntriesParams, type ShopPayoutEntry, type ShopSettlement, type ShopStep, type SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, cartLineAvailability, categoriesBySection, categorySection, checkoutRefusal, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isCartLineBuyable, isConditionAllowed, isConsentRequired, isMessagingAPIError, isNewOnlyCategory, isValidPhone, listingShareUrl, maskPhone, normalizePhone, partitionCart, regionById, stepUpRequired, storeShareUrl };