palbase 0.70.0 → 0.72.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.
Files changed (67) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/ai-sdk/index.js +2 -2
  3. package/dist/backend/engine.js +2 -2
  4. package/dist/backend/env.js +1 -1
  5. package/dist/backend/index.js +11 -11
  6. package/dist/backend/stack.js +1 -1
  7. package/dist/backend/test.js +2 -2
  8. package/dist/chunks/{RZ5MXOUV.js → 3MF6NROQ.js} +2 -2
  9. package/dist/chunks/{UCPA6FO4.js → 7TZJLWWX.js} +2 -2
  10. package/dist/chunks/CYS75YV4.js +2 -0
  11. package/dist/chunks/{LBOXE7TK.js → D5I74USX.js} +2 -2
  12. package/dist/chunks/{4MGTVQVW.js → DE7BWXBF.js} +1 -1
  13. package/dist/chunks/{WVGN2ZVF.js → E2MNCFOU.js} +1 -1
  14. package/dist/chunks/{PQPCHYX6.js → F4LE2YZX.js} +2 -2
  15. package/dist/chunks/{Q3HIUVZS.js → I4SH2RTD.js} +1 -1
  16. package/dist/chunks/{YFWP2OZQ.js → JMNQRIEG.js} +2 -2
  17. package/dist/chunks/{OCGBLC6V.js → JP55FW66.js} +2 -2
  18. package/dist/chunks/{LPBEFJE5.js → JXIKBG4D.js} +1 -1
  19. package/dist/chunks/{EHPVCQN6.js → LDFOUUBT.js} +2 -2
  20. package/dist/chunks/{VH3R7VEC.js → MB6ITBD2.js} +1 -1
  21. package/dist/chunks/{GECTCWAJ.js → MVVULWTH.js} +2 -2
  22. package/dist/chunks/{U5NKNWFY.js → O6JNTYC5.js} +2 -2
  23. package/dist/chunks/{HQJIOCXK.js → OY2MT7N5.js} +2 -2
  24. package/dist/chunks/{6U37PDRV.js → QDPRR5PE.js} +2 -2
  25. package/dist/chunks/{2V7Q5VXI.js → QROXSSPQ.js} +1 -1
  26. package/dist/chunks/{TXSOG3EG.js → S3N7N6UD.js} +2 -2
  27. package/dist/chunks/UXU6RXU3.js +23 -0
  28. package/dist/chunks/{YG3BUCUL.js → WWXBXZUO.js} +1 -1
  29. package/dist/chunks/XUYC354U.js +2 -0
  30. package/dist/chunks/{3QQXHQUT.js → Y7ZJ3M5F.js} +2 -2
  31. package/dist/chunks/ZHSM4NCV.js +13 -0
  32. package/dist/cli.js +343 -343
  33. package/dist/cloud/index.js +2 -2
  34. package/dist/refuse/ai-sdk.js +1 -1
  35. package/dist/refuse/ai.js +1 -1
  36. package/dist/refuse/backend.js +1 -1
  37. package/dist/refuse/cloud.js +1 -1
  38. package/dist/refuse/server.js +1 -1
  39. package/dist/server/index.js +2 -2
  40. package/dist/server/testing.js +2 -2
  41. package/dist/web/index.js +2 -2
  42. package/dist/web/message.js +2 -2
  43. package/dist/web/palbe.js +2 -2
  44. package/dist/web/payments-ui.js +2 -2
  45. package/dist/web/paywall.js +2 -2
  46. package/dist/web/push-sw.js +1 -1
  47. package/dist/web/ssr.js +2 -2
  48. package/dist/web/vite.js +2 -2
  49. package/package.json +3 -3
  50. package/types/backend/src/index.d.ts +1 -1
  51. package/types/backend/src/services.d.ts +47 -0
  52. package/types/cloud/src/generated/project.d.ts +2 -1
  53. package/types/internal/src/modules/commerce.d.ts +4244 -0
  54. package/types/internal/src/modules/events.d.ts +4 -3
  55. package/types/internal/src/modules/index.d.ts +1 -0
  56. package/types/internal/src/modules/payments.d.ts +851 -2
  57. package/types/server/src/commerce.d.ts +78 -0
  58. package/types/server/src/index.d.ts +2 -1
  59. package/types/server/src/payments.d.ts +6 -0
  60. package/types/server/src/server.d.ts +2 -0
  61. package/types/web/src/client.d.ts +3 -0
  62. package/types/web/src/commerce.d.ts +130 -0
  63. package/types/web/src/index.d.ts +1 -0
  64. package/dist/chunks/DZBZLLLK.js +0 -13
  65. package/dist/chunks/GORZGXUQ.js +0 -23
  66. package/dist/chunks/PNUUNJSU.js +0 -2
  67. package/dist/chunks/WB5IL3JP.js +0 -2
@@ -320,6 +320,10 @@ export type Capabilities = {
320
320
  * Whether separate auth and capture is supported.
321
321
  */
322
322
  manual_capture: boolean;
323
+ /**
324
+ * Whether marketplace split payments and sub-merchant settlement are supported.
325
+ */
326
+ marketplace?: boolean;
323
327
  /**
324
328
  * Whether Masterpass vault checkout is enabled.
325
329
  */
@@ -388,6 +392,26 @@ export type CashFlowBucket = {
388
392
  * ISO 4217 currency code.
389
393
  */
390
394
  currency: string;
395
+ /**
396
+ * Total marketplace platform commission in minor units.
397
+ */
398
+ marketplace_commission?: number;
399
+ /**
400
+ * Open seller escrow + top-up escrow balance in minor units.
401
+ */
402
+ marketplace_escrow?: number;
403
+ /**
404
+ * Total cardholder installment fees in minor units.
405
+ */
406
+ marketplace_installment_fees?: number;
407
+ /**
408
+ * Total platform-funded promotion subsidies in minor units.
409
+ */
410
+ marketplace_subsidies?: number;
411
+ /**
412
+ * Total marketplace withholding tax accrued in minor units.
413
+ */
414
+ marketplace_withholding?: number;
391
415
  /**
392
416
  * Total provider processing fees.
393
417
  */
@@ -661,6 +685,10 @@ export type CreateIntentRequest = {
661
685
  * Human-readable payment description.
662
686
  */
663
687
  description?: string;
688
+ /**
689
+ * Optional PaymentIntent expiry TTL in seconds (60..86400).
690
+ */
691
+ expires_in_seconds?: number;
664
692
  installments?: InstallmentConfig;
665
693
  /**
666
694
  * Order line items.
@@ -681,6 +709,10 @@ export type CreateIntentRequest = {
681
709
  * Allowed app return URL after checkout or 3DS.
682
710
  */
683
711
  return_url?: string;
712
+ /**
713
+ * Optional marketplace split lines.
714
+ */
715
+ splits?: SplitInput[];
684
716
  /**
685
717
  * Portion of amount paid from the customer's wallet in minor units.
686
718
  */
@@ -740,6 +772,10 @@ export type CreateSubscriptionRequest = {
740
772
  * Recurring charge amount in minor units.
741
773
  */
742
774
  amount: number;
775
+ /**
776
+ * Billing mode: provider_native or platform_mit_marketplace.
777
+ */
778
+ billing_mode?: string;
743
779
  /**
744
780
  * Allowed cancel URL.
745
781
  */
@@ -774,6 +810,10 @@ export type CreateSubscriptionRequest = {
774
810
  metadata?: {
775
811
  [key: string]: unknown;
776
812
  };
813
+ /**
814
+ * Saved payment method UUID for platform_mit_marketplace renewals.
815
+ */
816
+ payment_method_id?: string;
777
817
  /**
778
818
  * Subscription product name.
779
819
  */
@@ -782,6 +822,10 @@ export type CreateSubscriptionRequest = {
782
822
  * Allowed return URL.
783
823
  */
784
824
  return_url: string;
825
+ /**
826
+ * Marketplace split template for MIT renewals.
827
+ */
828
+ split_template?: SplitInput[];
785
829
  /**
786
830
  * Optional trial duration in days.
787
831
  */
@@ -821,6 +865,18 @@ export type CreditWalletRequest = {
821
865
  * Reference.
822
866
  */
823
867
  reference?: string;
868
+ /**
869
+ * Optional external source UUID for pending lot voiding.
870
+ */
871
+ source_reference_id?: string;
872
+ /**
873
+ * Optional external source type (e.g. commerce_order) for pending lot voiding.
874
+ */
875
+ source_reference_type?: string;
876
+ /**
877
+ * Optional future vesting timestamp (RFC3339) for pending cashback/referral rewards.
878
+ */
879
+ vests_at?: string;
824
880
  /**
825
881
  * Wallet key.
826
882
  */
@@ -1547,6 +1603,32 @@ export type NextAction = {
1547
1603
  export type NextActionResponse = {
1548
1604
  next_action: NextAction;
1549
1605
  };
1606
+ /**
1607
+ * Request a hosted provider KYC onboarding link.
1608
+ */
1609
+ export type OnboardingLinkRequest = {
1610
+ /**
1611
+ * URL redirected to if the onboarding link expires.
1612
+ */
1613
+ refresh_url?: string;
1614
+ /**
1615
+ * Allowed app URL redirected to after onboarding.
1616
+ */
1617
+ return_url: string;
1618
+ };
1619
+ /**
1620
+ * Hosted provider onboarding link.
1621
+ */
1622
+ export type OnboardingLinkResponse = {
1623
+ /**
1624
+ * Payment provider.
1625
+ */
1626
+ provider: string;
1627
+ /**
1628
+ * Provider onboarding URL.
1629
+ */
1630
+ url: string;
1631
+ };
1550
1632
  /**
1551
1633
  * Emitted when a PaymentIntent transitions to succeeded, requires_capture, failed, or canceled.
1552
1634
  */
@@ -1626,6 +1708,120 @@ export type PaymentLifecycleEvent = {
1626
1708
  */
1627
1709
  tax_amount?: number;
1628
1710
  };
1711
+ /**
1712
+ * List of payment splits.
1713
+ */
1714
+ export type PaymentSplitListResponse = {
1715
+ /**
1716
+ * Cursor for the next page.
1717
+ */
1718
+ next_cursor?: string;
1719
+ /**
1720
+ * Payment splits.
1721
+ */
1722
+ splits: PaymentSplitView[];
1723
+ };
1724
+ /**
1725
+ * Marketplace payment split and escrow state.
1726
+ */
1727
+ export type PaymentSplitView = {
1728
+ /**
1729
+ * Escrow approval timestamp.
1730
+ */
1731
+ approved_at?: string;
1732
+ /**
1733
+ * Card gross amount.
1734
+ */
1735
+ card_gross_amount: number;
1736
+ /**
1737
+ * Split creation timestamp.
1738
+ */
1739
+ created_at: string;
1740
+ /**
1741
+ * 3-letter ISO 4217 currency.
1742
+ */
1743
+ currency: string;
1744
+ /**
1745
+ * pending, held, approved, disapproved, transferred, partially_refunded, or refunded.
1746
+ */
1747
+ escrow_status: string;
1748
+ /**
1749
+ * Item / order-line reference.
1750
+ */
1751
+ external_item_ref: string;
1752
+ /**
1753
+ * Split UUID.
1754
+ */
1755
+ id: string;
1756
+ /**
1757
+ * Cardholder installment fee.
1758
+ */
1759
+ installment_fee_amount: number;
1760
+ /**
1761
+ * Parent PaymentIntent UUID.
1762
+ */
1763
+ intent_id: string;
1764
+ /**
1765
+ * Platform commission fee.
1766
+ */
1767
+ platform_fee_amount: number;
1768
+ /**
1769
+ * Platform-remitted tax.
1770
+ */
1771
+ platform_remitted_tax_amount: number;
1772
+ /**
1773
+ * Platform promotion subsidy.
1774
+ */
1775
+ platform_subsidy_amount: number;
1776
+ /**
1777
+ * Platform top-up escrow amount.
1778
+ */
1779
+ platform_topup_amount: number;
1780
+ /**
1781
+ * Provider item transaction ID or Stripe Transfer ID.
1782
+ */
1783
+ provider_transaction_id?: string;
1784
+ /**
1785
+ * PSP escrow amount.
1786
+ */
1787
+ psp_escrow_amount: number;
1788
+ /**
1789
+ * Cumulative refunded amount.
1790
+ */
1791
+ refunded_amount: number;
1792
+ /**
1793
+ * Seller deficit added to debt.
1794
+ */
1795
+ seller_deficit_amount: number;
1796
+ /**
1797
+ * Seller net proceeds.
1798
+ */
1799
+ seller_net_amount: number;
1800
+ /**
1801
+ * Seller reference.
1802
+ */
1803
+ seller_ref: string;
1804
+ /**
1805
+ * Seller shipping deduction.
1806
+ */
1807
+ seller_shipping_deduction_amount: number;
1808
+ /**
1809
+ * Shipping retained by platform.
1810
+ */
1811
+ shipping_to_platform_amount: number;
1812
+ /**
1813
+ * Sub-merchant UUID.
1814
+ */
1815
+ sub_merchant_id: string;
1816
+ /**
1817
+ * Wallet gross amount.
1818
+ */
1819
+ wallet_gross_amount: number;
1820
+ /**
1821
+ * Withholding tax accrued.
1822
+ */
1823
+ withholding_tax_amount: number;
1824
+ };
1629
1825
  /**
1630
1826
  * Open a self-service billing portal session.
1631
1827
  */
@@ -1884,6 +2080,69 @@ export type SavedMethodView = {
1884
2080
  */
1885
2081
  vault: string;
1886
2082
  };
2083
+ /**
2084
+ * Seller accounting balances across currencies.
2085
+ */
2086
+ export type SellerAccountResponse = {
2087
+ /**
2088
+ * Currency balances.
2089
+ */
2090
+ balances: SellerBalance[];
2091
+ /**
2092
+ * Seller reference.
2093
+ */
2094
+ seller_ref: string;
2095
+ };
2096
+ /**
2097
+ * Channel-independent seller accounting balance in one currency.
2098
+ */
2099
+ export type SellerBalance = {
2100
+ /**
2101
+ * 3-letter ISO 4217 currency.
2102
+ */
2103
+ currency: string;
2104
+ /**
2105
+ * Outstanding seller debt auto-offset on future approvals.
2106
+ */
2107
+ debt_balance: number;
2108
+ /**
2109
+ * PSP-held escrow balance.
2110
+ */
2111
+ escrow_balance: number;
2112
+ /**
2113
+ * Approved payable balance.
2114
+ */
2115
+ payable_balance: number;
2116
+ /**
2117
+ * Seller reference.
2118
+ */
2119
+ seller_ref: string;
2120
+ /**
2121
+ * Platform-funded top-up escrow balance.
2122
+ */
2123
+ topup_escrow_balance: number;
2124
+ /**
2125
+ * Last balance update timestamp.
2126
+ */
2127
+ updated_at: string;
2128
+ };
2129
+ /**
2130
+ * Double-entry ledger entries for a seller.
2131
+ */
2132
+ export type SellerLedgerResponse = {
2133
+ /**
2134
+ * Double-entry audit entries.
2135
+ */
2136
+ entries: AuditEntry[];
2137
+ /**
2138
+ * Opaque cursor for older entries.
2139
+ */
2140
+ next_cursor?: string;
2141
+ /**
2142
+ * Seller reference.
2143
+ */
2144
+ seller_ref: string;
2145
+ };
1887
2146
  /**
1888
2147
  * Project-wide payment limits, 3DS thresholds, velocity fraud rules, and defaults.
1889
2148
  */
@@ -1892,6 +2151,10 @@ export type Settings = {
1892
2151
  * When true, publishable-key clients may create intents directly (opt-in; false by default).
1893
2152
  */
1894
2153
  allow_client_payments: boolean;
2154
+ /**
2155
+ * Opt-in allowing closed-loop fiat wallet payments in marketplace splits (off by default for BDDK 6493 compliance).
2156
+ */
2157
+ allow_marketplace_fiat_wallet?: boolean;
1895
2158
  /**
1896
2159
  * Cancel active subscriptions when an auth user is deleted.
1897
2160
  */
@@ -1970,6 +2233,162 @@ export type SpendToken = {
1970
2233
  */
1971
2234
  wallet_key: string;
1972
2235
  };
2236
+ /**
2237
+ * Marketplace split line allocation for a PaymentIntent.
2238
+ */
2239
+ export type SplitInput = {
2240
+ /**
2241
+ * Buyer card amount allocated to this split line.
2242
+ */
2243
+ card_gross_amount: number;
2244
+ /**
2245
+ * Caller item/order-line reference.
2246
+ */
2247
+ external_item_ref: string;
2248
+ /**
2249
+ * Cardholder installment surcharge kept outside commission.
2250
+ */
2251
+ installment_fee_amount?: number;
2252
+ /**
2253
+ * Platform marketplace commission fee.
2254
+ */
2255
+ platform_fee_amount?: number;
2256
+ /**
2257
+ * Marketplace facilitator tax remitted by platform.
2258
+ */
2259
+ platform_remitted_tax_amount?: number;
2260
+ /**
2261
+ * Platform-funded discount subsidy credited to seller.
2262
+ */
2263
+ platform_subsidy_amount?: number;
2264
+ /**
2265
+ * Platform-funded top-up owed to seller.
2266
+ */
2267
+ platform_topup_amount?: number;
2268
+ /**
2269
+ * Escrow amount held at PSP (must be <= card_gross_amount).
2270
+ */
2271
+ psp_escrow_amount: number;
2272
+ /**
2273
+ * Negative net shortfall recorded to seller debt.
2274
+ */
2275
+ seller_deficit_amount?: number;
2276
+ /**
2277
+ * Net seller economic proceeds.
2278
+ */
2279
+ seller_net_amount: number;
2280
+ /**
2281
+ * Channel-independent seller reference.
2282
+ */
2283
+ seller_ref: string;
2284
+ /**
2285
+ * Shipping cost deducted from seller proceeds.
2286
+ */
2287
+ seller_shipping_deduction_amount?: number;
2288
+ /**
2289
+ * Shipping fee retained by platform.
2290
+ */
2291
+ shipping_to_platform_amount?: number;
2292
+ /**
2293
+ * Optional explicit sub-merchant UUID.
2294
+ */
2295
+ sub_merchant_id?: string;
2296
+ /**
2297
+ * Buyer wallet amount allocated to this split line.
2298
+ */
2299
+ wallet_gross_amount?: number;
2300
+ /**
2301
+ * E-commerce withholding tax accrued (e.g. TR 7524 %1).
2302
+ */
2303
+ withholding_tax_amount?: number;
2304
+ };
2305
+ /**
2306
+ * Payload emitted when a marketplace payment split is approved or refunded.
2307
+ */
2308
+ export type SplitLifecycleEvent = {
2309
+ /**
2310
+ * 3-letter ISO 4217 currency.
2311
+ */
2312
+ currency: string;
2313
+ /**
2314
+ * Current split escrow status.
2315
+ */
2316
+ escrow_status: string;
2317
+ /**
2318
+ * Parent PaymentIntent UUID.
2319
+ */
2320
+ intent_id: string;
2321
+ /**
2322
+ * Seller reference.
2323
+ */
2324
+ seller_ref: string;
2325
+ /**
2326
+ * Split UUID.
2327
+ */
2328
+ split_id: string;
2329
+ };
2330
+ /**
2331
+ * Refund all or part of one marketplace payment split line.
2332
+ */
2333
+ export type SplitRefundRequest = {
2334
+ /**
2335
+ * Card amount to refund to buyer.
2336
+ */
2337
+ card_refund_amount: number;
2338
+ /**
2339
+ * Commission fee reversed.
2340
+ */
2341
+ platform_fee_reversed_amount?: number;
2342
+ /**
2343
+ * Optional refund reason.
2344
+ */
2345
+ reason?: string;
2346
+ /**
2347
+ * Amount clawed back from seller escrow, payable, or debt.
2348
+ */
2349
+ seller_clawback_amount: number;
2350
+ /**
2351
+ * Platform subsidy reversed.
2352
+ */
2353
+ subsidy_reversed_amount?: number;
2354
+ /**
2355
+ * Wallet amount to refund to buyer.
2356
+ */
2357
+ wallet_refund_amount?: number;
2358
+ /**
2359
+ * Withholding tax reversed.
2360
+ */
2361
+ withholding_tax_reversed_amount?: number;
2362
+ };
2363
+ /**
2364
+ * Outcome of a marketplace split refund.
2365
+ */
2366
+ export type SplitRefundResponse = {
2367
+ /**
2368
+ * Updated split escrow status.
2369
+ */
2370
+ escrow_status: string;
2371
+ /**
2372
+ * Provider refund reference.
2373
+ */
2374
+ provider_refund_id?: string;
2375
+ /**
2376
+ * Stripe Transfer Reversal ID if reversed.
2377
+ */
2378
+ provider_reversal_id?: string;
2379
+ /**
2380
+ * Created refund UUID.
2381
+ */
2382
+ refund_id: string;
2383
+ /**
2384
+ * Created refund_split UUID.
2385
+ */
2386
+ refund_split_id: string;
2387
+ /**
2388
+ * Parent split UUID.
2389
+ */
2390
+ split_id: string;
2391
+ };
1973
2392
  /**
1974
2393
  * Mint a one-time grant to install the Palbase Stripe App.
1975
2394
  */
@@ -1996,6 +2415,111 @@ export type StripeOptions = {
1996
2415
  */
1997
2416
  tax_code?: string;
1998
2417
  };
2418
+ /**
2419
+ * List of marketplace sub-merchants.
2420
+ */
2421
+ export type SubMerchantListResponse = {
2422
+ /**
2423
+ * Cursor for the next page.
2424
+ */
2425
+ next_cursor?: string;
2426
+ /**
2427
+ * Sub-merchant records.
2428
+ */
2429
+ sub_merchants: SubMerchantView[];
2430
+ };
2431
+ /**
2432
+ * Payload emitted when a marketplace sub-merchant is onboarded or updated.
2433
+ */
2434
+ export type SubMerchantUpdatedEvent = {
2435
+ /**
2436
+ * Channel key.
2437
+ */
2438
+ channel_key: string;
2439
+ /**
2440
+ * Charges enabled.
2441
+ */
2442
+ charges_enabled: boolean;
2443
+ /**
2444
+ * Provider account identifier.
2445
+ */
2446
+ external_id: string;
2447
+ /**
2448
+ * Payouts enabled.
2449
+ */
2450
+ payouts_enabled: boolean;
2451
+ /**
2452
+ * Payment provider.
2453
+ */
2454
+ provider: string;
2455
+ /**
2456
+ * Seller reference.
2457
+ */
2458
+ seller_ref: string;
2459
+ /**
2460
+ * Sub-merchant status.
2461
+ */
2462
+ status: string;
2463
+ /**
2464
+ * Sub-merchant UUID.
2465
+ */
2466
+ sub_merchant_id: string;
2467
+ };
2468
+ /**
2469
+ * Marketplace sub-merchant / connected account snapshot.
2470
+ */
2471
+ export type SubMerchantView = {
2472
+ /**
2473
+ * Connected payment channel key.
2474
+ */
2475
+ channel_key: string;
2476
+ /**
2477
+ * Whether charges are enabled.
2478
+ */
2479
+ charges_enabled: boolean;
2480
+ /**
2481
+ * Creation timestamp.
2482
+ */
2483
+ created_at: string;
2484
+ /**
2485
+ * Provider subMerchantKey or Stripe acct_* ID.
2486
+ */
2487
+ external_id: string;
2488
+ /**
2489
+ * Sub-merchant UUID.
2490
+ */
2491
+ id: string;
2492
+ /**
2493
+ * Whether payouts are enabled.
2494
+ */
2495
+ payouts_enabled: boolean;
2496
+ /**
2497
+ * Payment provider (iyzico or stripe).
2498
+ */
2499
+ provider: string;
2500
+ /**
2501
+ * Pending KYC/verification requirements.
2502
+ */
2503
+ requirements?: {
2504
+ [key: string]: unknown;
2505
+ };
2506
+ /**
2507
+ * Channel-independent seller identifier.
2508
+ */
2509
+ seller_ref: string;
2510
+ /**
2511
+ * pending, active, restricted, or disabled.
2512
+ */
2513
+ status: string;
2514
+ /**
2515
+ * Sub-merchant legal/account type.
2516
+ */
2517
+ sub_merchant_type: string;
2518
+ /**
2519
+ * Last update timestamp.
2520
+ */
2521
+ updated_at: string;
2522
+ };
1999
2523
  /**
2000
2524
  * Submit an OTP code to complete a Masterpass or bank verification step.
2001
2525
  */
@@ -2296,6 +2820,116 @@ export type TransferWalletResponse = {
2296
2820
  to_balance: WalletBalance;
2297
2821
  transaction: LedgerTxResult;
2298
2822
  };
2823
+ /**
2824
+ * Update a pending escrow split sub-merchant amount prior to approval.
2825
+ */
2826
+ export type UpdateSplitRequest = {
2827
+ /**
2828
+ * Updated PSP escrow payout amount.
2829
+ */
2830
+ psp_escrow_amount: number;
2831
+ };
2832
+ /**
2833
+ * Create or update a channel-bound marketplace sub-merchant.
2834
+ */
2835
+ export type UpsertSubMerchantRequest = {
2836
+ /**
2837
+ * Merchant business address.
2838
+ */
2839
+ address?: string;
2840
+ /**
2841
+ * Optional channel key override.
2842
+ */
2843
+ channel?: string;
2844
+ /**
2845
+ * Authorized representative first name.
2846
+ */
2847
+ contact_name?: string;
2848
+ /**
2849
+ * Authorized representative surname.
2850
+ */
2851
+ contact_surname?: string;
2852
+ /**
2853
+ * ISO 3166-1 alpha-2 country code.
2854
+ */
2855
+ country?: string;
2856
+ /**
2857
+ * 3-letter ISO 4217 settlement currency.
2858
+ */
2859
+ currency?: string;
2860
+ /**
2861
+ * Merchant contact email.
2862
+ */
2863
+ email?: string;
2864
+ /**
2865
+ * Merchant E.164 phone number.
2866
+ */
2867
+ gsm_number?: string;
2868
+ /**
2869
+ * Settlement IBAN.
2870
+ */
2871
+ iban?: string;
2872
+ /**
2873
+ * National identity number (TCKN).
2874
+ */
2875
+ identity_number?: string;
2876
+ /**
2877
+ * Registered legal entity title.
2878
+ */
2879
+ legal_company_title?: string;
2880
+ /**
2881
+ * Optional key-value metadata.
2882
+ */
2883
+ metadata?: {
2884
+ [key: string]: unknown;
2885
+ };
2886
+ /**
2887
+ * Merchant display name.
2888
+ */
2889
+ name?: string;
2890
+ /**
2891
+ * Channel-independent seller identifier.
2892
+ */
2893
+ seller_ref: string;
2894
+ /**
2895
+ * personal, private_company, limited_or_joint_stock, express, custom, or standard.
2896
+ */
2897
+ sub_merchant_type?: string;
2898
+ /**
2899
+ * Optional SWIFT/BIC code.
2900
+ */
2901
+ swift_code?: string;
2902
+ /**
2903
+ * Tax identification number (VKN).
2904
+ */
2905
+ tax_number?: string;
2906
+ /**
2907
+ * Tax office name.
2908
+ */
2909
+ tax_office?: string;
2910
+ };
2911
+ /**
2912
+ * Void unvested pending cashback/referral lots tied to a source.
2913
+ */
2914
+ export type VoidPendingWalletRequest = {
2915
+ /**
2916
+ * Source entity UUID.
2917
+ */
2918
+ source_reference_id: string;
2919
+ /**
2920
+ * Source entity type (e.g. commerce_order).
2921
+ */
2922
+ source_reference_type: string;
2923
+ };
2924
+ /**
2925
+ * Count of voided pending wallet lots.
2926
+ */
2927
+ export type VoidPendingWalletResponse = {
2928
+ /**
2929
+ * Number of pending lots voided.
2930
+ */
2931
+ voided: number;
2932
+ };
2299
2933
  /**
2300
2934
  * Customer's live balance in a closed-loop wallet.
2301
2935
  */
@@ -2477,7 +3111,7 @@ export type WalletHold = {
2477
3111
  */
2478
3112
  settled_at?: string | null;
2479
3113
  /**
2480
- * Hold status (active, committed, released, expired).
3114
+ * Hold status (held, committed, released, expired).
2481
3115
  */
2482
3116
  status: string;
2483
3117
  /**
@@ -2506,7 +3140,7 @@ export type WalletHoldEvent = {
2506
3140
  */
2507
3141
  hold_id: string;
2508
3142
  /**
2509
- * Hold status (active, committed, released, expired).
3143
+ * Hold status (held, committed, released, expired).
2510
3144
  */
2511
3145
  status: string;
2512
3146
  /**
@@ -2530,6 +3164,43 @@ export type WalletTxBalanceResponse = {
2530
3164
  balance: WalletBalance;
2531
3165
  transaction: LedgerTxResult;
2532
3166
  };
3167
+ /**
3168
+ * Payload emitted when a pending cashback or referral wallet lot vests into spendable balance.
3169
+ */
3170
+ export type WalletVestedEvent = {
3171
+ /**
3172
+ * Vested amount in minor units.
3173
+ */
3174
+ amount: number;
3175
+ /**
3176
+ * Updated spendable balance.
3177
+ */
3178
+ available: number;
3179
+ /**
3180
+ * 3-letter ISO 4217 currency.
3181
+ */
3182
+ currency: string;
3183
+ /**
3184
+ * Customer ID.
3185
+ */
3186
+ customer_id: string;
3187
+ /**
3188
+ * Vested wallet lot UUID.
3189
+ */
3190
+ lot_id: string;
3191
+ /**
3192
+ * Updated posted balance.
3193
+ */
3194
+ posted: number;
3195
+ /**
3196
+ * Ledger transaction UUID.
3197
+ */
3198
+ tx_id: string;
3199
+ /**
3200
+ * Wallet key.
3201
+ */
3202
+ wallet_key: string;
3203
+ };
2533
3204
  /** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
2534
3205
  export interface Events {
2535
3206
  /**
@@ -2560,6 +3231,18 @@ export interface Events {
2560
3231
  * payments.refund.succeeded: a refund settled to the original card or instantly to the customer's wallet.
2561
3232
  */
2562
3233
  "payments.refund.succeeded": RefundSucceededEvent;
3234
+ /**
3235
+ * payments.split.approved: a marketplace payment split was approved or transferred to the seller.
3236
+ */
3237
+ "payments.split.approved": SplitLifecycleEvent;
3238
+ /**
3239
+ * payments.split.refunded: a marketplace payment split was partially or fully refunded with seller clawback.
3240
+ */
3241
+ "payments.split.refunded": SplitLifecycleEvent;
3242
+ /**
3243
+ * payments.sub_merchant.updated: a marketplace sub-merchant was onboarded, synced, or updated by provider webhook.
3244
+ */
3245
+ "payments.sub_merchant.updated": SubMerchantUpdatedEvent;
2563
3246
  /**
2564
3247
  * payments.subscription.canceled: a recurring subscription was canceled (immediately or at period end).
2565
3248
  */
@@ -2576,6 +3259,10 @@ export interface Events {
2576
3259
  * payments.wallet.hold_changed: a two-phase wallet hold was created, committed, released, or expired.
2577
3260
  */
2578
3261
  "payments.wallet.hold_changed": WalletHoldEvent;
3262
+ /**
3263
+ * payments.wallet.vested: a pending cashback or referral wallet lot vested into spendable balance.
3264
+ */
3265
+ "payments.wallet.vested": WalletVestedEvent;
2579
3266
  }
2580
3267
  /** Palbase Payments */
2581
3268
  export declare function client(t: Transport): {
@@ -3039,6 +3726,32 @@ export declare function client(t: Transport): {
3039
3726
  body: RoutingRulesPayload; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3040
3727
  signal?: AbortSignal;
3041
3728
  }): Promise<Reply<200, RoutingRulesPayload>>;
3729
+ /**
3730
+ * Get seller accounting balances
3731
+ *
3732
+ * Returns channel-independent seller accounting balances (escrow, top-up escrow, payable, debt) across currencies.
3733
+ */
3734
+ getSellerAccount(input: {
3735
+ path: {
3736
+ seller_ref: string;
3737
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3738
+ signal?: AbortSignal;
3739
+ }): Promise<Reply<200, SellerAccountResponse>>;
3740
+ /**
3741
+ * List seller double-entry ledger
3742
+ *
3743
+ * Lists immutable double-entry ledger entries affecting a seller account.
3744
+ */
3745
+ listSellerLedger(input: {
3746
+ path: {
3747
+ seller_ref: string;
3748
+ };
3749
+ query?: {
3750
+ limit?: number; /** Pagination cursor for older entries. */
3751
+ cursor?: string;
3752
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3753
+ signal?: AbortSignal;
3754
+ }): Promise<Reply<200, SellerLedgerResponse>>;
3042
3755
  /**
3043
3756
  * Get payments settings
3044
3757
  *
@@ -3056,6 +3769,67 @@ export declare function client(t: Transport): {
3056
3769
  body: Settings; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3057
3770
  signal?: AbortSignal;
3058
3771
  }): Promise<Reply<200, Settings>>;
3772
+ /**
3773
+ * List marketplace payment splits
3774
+ *
3775
+ * Lists marketplace payment splits filtered by intent, seller, or escrow status.
3776
+ */
3777
+ listPaymentSplits(input?: {
3778
+ query?: {
3779
+ intent_id?: string; /** Filter by seller reference. */
3780
+ seller_ref?: string; /** Filter by escrow status. */
3781
+ escrow_status?: string; /** Maximum records to return. */
3782
+ limit?: number; /** Pagination cursor from a previous response. */
3783
+ cursor?: string;
3784
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3785
+ signal?: AbortSignal;
3786
+ }): Promise<Reply<200, PaymentSplitListResponse>>;
3787
+ /**
3788
+ * Update held payment split
3789
+ *
3790
+ * Updates an unapproved held split payout amount at the PSP before escrow approval.
3791
+ */
3792
+ updatePaymentSplit(input: {
3793
+ path: {
3794
+ split_id: string;
3795
+ };
3796
+ body: UpdateSplitRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3797
+ signal?: AbortSignal;
3798
+ }): Promise<Reply<200, PaymentSplitView>>;
3799
+ /**
3800
+ * Approve payment split for seller payout
3801
+ *
3802
+ * Approves a held marketplace split for payout (iyzico item/approve or Stripe Connect Transfer) and automatically offsets any seller debt.
3803
+ */
3804
+ approvePaymentSplit(input: {
3805
+ path: {
3806
+ split_id: string;
3807
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3808
+ signal?: AbortSignal;
3809
+ }): Promise<Reply<200, PaymentSplitView>>;
3810
+ /**
3811
+ * Disapprove approved payment split
3812
+ *
3813
+ * Reverses escrow approval on a split (iyzico item/disapprove or Stripe Transfer Reversal).
3814
+ */
3815
+ disapprovePaymentSplit(input: {
3816
+ path: {
3817
+ split_id: string;
3818
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3819
+ signal?: AbortSignal;
3820
+ }): Promise<Reply<200, PaymentSplitView>>;
3821
+ /**
3822
+ * Refund marketplace payment split
3823
+ *
3824
+ * Executes an item-level partial or full marketplace split refund (iyzico v1 paymentTransactionId refund or Stripe refund + Transfer Reversal).
3825
+ */
3826
+ refundPaymentSplit(input: {
3827
+ path: {
3828
+ split_id: string;
3829
+ };
3830
+ body: SplitRefundRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3831
+ signal?: AbortSignal;
3832
+ }): Promise<Reply<201, SplitRefundResponse>>;
3059
3833
  /**
3060
3834
  * Handle Stripe App OAuth callback
3061
3835
  *
@@ -3097,6 +3871,64 @@ export declare function client(t: Transport): {
3097
3871
  stripeAppInstallStart(input?: {
3098
3872
  signal?: AbortSignal;
3099
3873
  }): Promise<Reply<303, undefined>>;
3874
+ /**
3875
+ * List marketplace sub-merchants
3876
+ *
3877
+ * Lists marketplace sub-merchants registered across connected iyzico Pazaryeri and Stripe Connect channels.
3878
+ */
3879
+ listSubMerchants(input?: {
3880
+ query?: {
3881
+ seller_ref?: string; /** Filter by channel key. */
3882
+ channel?: string; /** Filter by status. */
3883
+ status?: string; /** Maximum records to return. */
3884
+ limit?: number; /** Pagination cursor from a previous response. */
3885
+ cursor?: string;
3886
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3887
+ signal?: AbortSignal;
3888
+ }): Promise<Reply<200, SubMerchantListResponse>>;
3889
+ /**
3890
+ * Create or update marketplace sub-merchant
3891
+ *
3892
+ * Creates or updates a marketplace sub-merchant on iyzico Pazaryeri or Stripe Connect and seals KYC details at rest.
3893
+ */
3894
+ upsertSubMerchant(input: {
3895
+ body: UpsertSubMerchantRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3896
+ signal?: AbortSignal;
3897
+ }): Promise<Reply<201, SubMerchantView>>;
3898
+ /**
3899
+ * Get marketplace sub-merchant
3900
+ *
3901
+ * Retrieves one marketplace sub-merchant record.
3902
+ */
3903
+ getSubMerchant(input: {
3904
+ path: {
3905
+ sub_merchant_id: string;
3906
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3907
+ signal?: AbortSignal;
3908
+ }): Promise<Reply<200, SubMerchantView>>;
3909
+ /**
3910
+ * Create sub-merchant onboarding link
3911
+ *
3912
+ * Creates a short-lived hosted provider KYC onboarding link (Stripe Connect AccountLink).
3913
+ */
3914
+ createSubMerchantOnboardingLink(input: {
3915
+ path: {
3916
+ sub_merchant_id: string;
3917
+ };
3918
+ body: OnboardingLinkRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3919
+ signal?: AbortSignal;
3920
+ }): Promise<Reply<201, OnboardingLinkResponse>>;
3921
+ /**
3922
+ * Sync sub-merchant status from provider
3923
+ *
3924
+ * Re-fetches authoritative KYC, charges_enabled, and payouts_enabled status from the payment provider.
3925
+ */
3926
+ syncSubMerchant(input: {
3927
+ path: {
3928
+ sub_merchant_id: string;
3929
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3930
+ signal?: AbortSignal;
3931
+ }): Promise<Reply<200, SubMerchantView>>;
3100
3932
  /**
3101
3933
  * List subscriptions
3102
3934
  *
@@ -3246,6 +4078,15 @@ export declare function client(t: Transport): {
3246
4078
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3247
4079
  signal?: AbortSignal;
3248
4080
  }): Promise<Reply<200, WalletHold>>;
4081
+ /**
4082
+ * Void pending wallet credits
4083
+ *
4084
+ * Voids unvested pending cashback or referral wallet lots tied to a refunded order or source reference.
4085
+ */
4086
+ voidPendingWalletCredits(input: {
4087
+ body: VoidPendingWalletRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4088
+ signal?: AbortSignal;
4089
+ }): Promise<Reply<200, VoidPendingWalletResponse>>;
3249
4090
  /**
3250
4091
  * Transfer wallet balance
3251
4092
  *
@@ -3282,5 +4123,13 @@ export declare function client(t: Transport): {
3282
4123
  stripeAppWebhook(input?: {
3283
4124
  signal?: AbortSignal;
3284
4125
  }): Promise<Reply<200, undefined>>;
4126
+ /**
4127
+ * Receive Stripe Connect webhook
4128
+ *
4129
+ * Receives signed Stripe Connect webhook events (connect=true endpoint), stores them in the encrypted inbox, and syncs connected account / payout / transfer reversal state.
4130
+ */
4131
+ stripeConnectWebhook(input?: {
4132
+ signal?: AbortSignal;
4133
+ }): Promise<Reply<200, undefined>>;
3285
4134
  };
3286
4135
  export type Client = ReturnType<typeof client>;