@mitumba/sdk 1.28.0 → 1.29.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/README.md CHANGED
@@ -102,16 +102,30 @@ const trending = await mitumba.search.getTrending('nbi_01')
102
102
 
103
103
  ### 4. Orders & Pay Modules (`mitumba.orders`, `mitumba.pay`)
104
104
 
105
- End-to-end checkout and M-Pesa integration.
105
+ End-to-end checkout with provider-neutral payment initiation.
106
+
107
+ > `pay.initiateCheckout()` is available on the production API. Payment initiation can be temporarily paused and return `payment_initiation_paused`.
106
108
 
107
109
  ```typescript
108
110
  // 1. Create an order
109
111
  const { order_id, total } = await mitumba.orders.create({ listing_id: 'lst_123' })
110
112
 
111
- // 2. Initiate M-Pesa STK Push
112
- await mitumba.pay.initiateStk({ order_id, phone: '+254700000000' })
113
+ // 2. Select a payment method; the API selects the provider
114
+ const initiation = await mitumba.pay.initiateCheckout({
115
+ order_id,
116
+ idempotency_key: 'checkout-attempt-123',
117
+ method: { type: 'mobile_money', phone: '+254700000000' }
118
+ })
113
119
 
114
- // 3. Poll the aggregate checkout lifecycle
120
+ // 3. Continue only through the returned action
121
+ if (initiation.next_action.type === 'redirect') {
122
+ const { url, expires_at } = initiation.next_action
123
+ // Open the absolute HTTPS URL in your app's navigation layer.
124
+ } else {
125
+ // Wait for out-of-band confirmation on the buyer's device.
126
+ }
127
+
128
+ // 4. Initiation is not payment success; poll the checkout lifecycle
115
129
  const checkout = await mitumba.pay.getCheckoutStatus(order_id)
116
130
 
117
131
  if (!checkout.terminal) {
@@ -123,7 +137,9 @@ if (checkout.checkout_status === 'paid') {
123
137
  }
124
138
  ```
125
139
 
126
- `pay.getStatus(orderId)` remains available for existing consumers but is deprecated because its legacy response does not represent the aggregate retail/bale checkout lifecycle. New integrations should use `getCheckoutStatus()` and follow `terminal`, `retryable`, and `poll_after_ms` rather than interpreting an individual payment attempt as order success.
140
+ If an initiation request is cancelled or its result is lost, retry the identical input with the same `idempotency_key` to recover the authoritative result. Reusing the key with different input returns `idempotency_conflict`.
141
+
142
+ `pay.initMpesa()`, `pay.initPaystack()`, and `pay.initiateStk()` remain source- and runtime-compatible while the provider-neutral endpoint is introduced. `pay.getStatus(orderId)` also remains available, but is deprecated because its legacy response does not represent the aggregate retail/bale checkout lifecycle. New integrations should use `getCheckoutStatus()` and follow `terminal`, `retryable`, and `poll_after_ms` rather than interpreting an individual payment attempt as order success.
127
143
 
128
144
  ### 5. Vazi Module (`mitumba.vazi`)
129
145
 
package/dist/index.d.mts CHANGED
@@ -559,7 +559,38 @@ interface PaymentStatusResponse {
559
559
  status: PaymentStatus;
560
560
  total: number;
561
561
  }
562
- type PaymentProvider = 'daraja' | 'intasend' | 'paystack' | 'airtel';
562
+ type KnownPaymentProvider = 'daraja' | 'intasend' | 'paystack' | 'airtel';
563
+ type ProviderId = KnownPaymentProvider | (string & {});
564
+ type PaymentProvider = ProviderId;
565
+ type CheckoutPaymentMethod = {
566
+ type: 'mobile_money';
567
+ phone: string;
568
+ } | {
569
+ type: 'card';
570
+ };
571
+ interface InitiateCheckoutInput {
572
+ order_id: string;
573
+ idempotency_key: string;
574
+ method: CheckoutPaymentMethod;
575
+ }
576
+ type CheckoutNextAction = {
577
+ type: 'await_confirmation';
578
+ } | {
579
+ type: 'redirect';
580
+ url: string;
581
+ expires_at: string | null;
582
+ };
583
+ interface InitiateCheckoutResponse {
584
+ version: 1;
585
+ order_id: string;
586
+ attempt: {
587
+ id: string;
588
+ sequence: number;
589
+ provider: ProviderId;
590
+ status: 'initiated';
591
+ };
592
+ next_action: CheckoutNextAction;
593
+ }
563
594
  type PaymentAttemptStatus = 'initiated' | 'funded' | 'failed' | 'refunded' | 'cancelled';
564
595
  type CheckoutStatus = 'pending' | 'paid' | 'failed' | 'cancelled' | 'refunded';
565
596
  type CheckoutOrder = {
@@ -1638,6 +1669,19 @@ declare class PayModule {
1638
1669
  * Initiate a Paystack payment — returns access_code for inline popup.
1639
1670
  */
1640
1671
  initPaystack(input: PaystackInput, options?: RequestOptions): Promise<PaystackInitResponse>;
1672
+ /**
1673
+ * Initiate a provider-neutral checkout for an order.
1674
+ *
1675
+ * The payment provider is selected by the API. Continue checkout using the
1676
+ * returned next action, then poll {@link getCheckoutStatus} for payment state.
1677
+ * Retrying after cancellation requires the same input and idempotency key.
1678
+ *
1679
+ * @param input - Order, idempotency key, and buyer-selected payment method.
1680
+ * @param options - Request options, including an optional abort signal.
1681
+ * @returns The initiated attempt and its required continuation action.
1682
+ * @throws {APIError} When the API rejects or cannot initiate the checkout.
1683
+ */
1684
+ initiateCheckout(input: InitiateCheckoutInput, options?: RequestOptions): Promise<InitiateCheckoutResponse>;
1641
1685
  /**
1642
1686
  * Poll for the current status of a payment by its order ID.
1643
1687
  *
@@ -2442,4 +2486,4 @@ declare class MitumbaClient {
2442
2486
  isAuthenticated(): Promise<boolean>;
2443
2487
  }
2444
2488
 
2445
- 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 CheckoutOrder, type CheckoutStatus, type CheckoutStatusResponse, 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 PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, 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 };
2489
+ 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 CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, 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, type InitiateCheckoutInput, type InitiateCheckoutResponse, type KnownPaymentProvider, 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 PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, 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
@@ -559,7 +559,38 @@ interface PaymentStatusResponse {
559
559
  status: PaymentStatus;
560
560
  total: number;
561
561
  }
562
- type PaymentProvider = 'daraja' | 'intasend' | 'paystack' | 'airtel';
562
+ type KnownPaymentProvider = 'daraja' | 'intasend' | 'paystack' | 'airtel';
563
+ type ProviderId = KnownPaymentProvider | (string & {});
564
+ type PaymentProvider = ProviderId;
565
+ type CheckoutPaymentMethod = {
566
+ type: 'mobile_money';
567
+ phone: string;
568
+ } | {
569
+ type: 'card';
570
+ };
571
+ interface InitiateCheckoutInput {
572
+ order_id: string;
573
+ idempotency_key: string;
574
+ method: CheckoutPaymentMethod;
575
+ }
576
+ type CheckoutNextAction = {
577
+ type: 'await_confirmation';
578
+ } | {
579
+ type: 'redirect';
580
+ url: string;
581
+ expires_at: string | null;
582
+ };
583
+ interface InitiateCheckoutResponse {
584
+ version: 1;
585
+ order_id: string;
586
+ attempt: {
587
+ id: string;
588
+ sequence: number;
589
+ provider: ProviderId;
590
+ status: 'initiated';
591
+ };
592
+ next_action: CheckoutNextAction;
593
+ }
563
594
  type PaymentAttemptStatus = 'initiated' | 'funded' | 'failed' | 'refunded' | 'cancelled';
564
595
  type CheckoutStatus = 'pending' | 'paid' | 'failed' | 'cancelled' | 'refunded';
565
596
  type CheckoutOrder = {
@@ -1638,6 +1669,19 @@ declare class PayModule {
1638
1669
  * Initiate a Paystack payment — returns access_code for inline popup.
1639
1670
  */
1640
1671
  initPaystack(input: PaystackInput, options?: RequestOptions): Promise<PaystackInitResponse>;
1672
+ /**
1673
+ * Initiate a provider-neutral checkout for an order.
1674
+ *
1675
+ * The payment provider is selected by the API. Continue checkout using the
1676
+ * returned next action, then poll {@link getCheckoutStatus} for payment state.
1677
+ * Retrying after cancellation requires the same input and idempotency key.
1678
+ *
1679
+ * @param input - Order, idempotency key, and buyer-selected payment method.
1680
+ * @param options - Request options, including an optional abort signal.
1681
+ * @returns The initiated attempt and its required continuation action.
1682
+ * @throws {APIError} When the API rejects or cannot initiate the checkout.
1683
+ */
1684
+ initiateCheckout(input: InitiateCheckoutInput, options?: RequestOptions): Promise<InitiateCheckoutResponse>;
1641
1685
  /**
1642
1686
  * Poll for the current status of a payment by its order ID.
1643
1687
  *
@@ -2442,4 +2486,4 @@ declare class MitumbaClient {
2442
2486
  isAuthenticated(): Promise<boolean>;
2443
2487
  }
2444
2488
 
2445
- 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 CheckoutOrder, type CheckoutStatus, type CheckoutStatusResponse, 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 PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, 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 };
2489
+ 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 CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, 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, type InitiateCheckoutInput, type InitiateCheckoutResponse, type KnownPaymentProvider, 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 PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, 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
@@ -725,6 +725,21 @@ var PayModule = class {
725
725
  async initPaystack(input, options) {
726
726
  return this.client.post("/pay/paystack/init", input, options);
727
727
  }
728
+ /**
729
+ * Initiate a provider-neutral checkout for an order.
730
+ *
731
+ * The payment provider is selected by the API. Continue checkout using the
732
+ * returned next action, then poll {@link getCheckoutStatus} for payment state.
733
+ * Retrying after cancellation requires the same input and idempotency key.
734
+ *
735
+ * @param input - Order, idempotency key, and buyer-selected payment method.
736
+ * @param options - Request options, including an optional abort signal.
737
+ * @returns The initiated attempt and its required continuation action.
738
+ * @throws {APIError} When the API rejects or cannot initiate the checkout.
739
+ */
740
+ async initiateCheckout(input, options) {
741
+ return this.client.post("/pay/checkout/initiate", input, options);
742
+ }
728
743
  /**
729
744
  * Poll for the current status of a payment by its order ID.
730
745
  *