@tapsilat/tapsilat-js 2026.7.7 → 2026.10.26

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 (50) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +217 -46
  3. package/dist/TapsilatSDK.d.ts +158 -40
  4. package/dist/TapsilatSDK.d.ts.map +1 -1
  5. package/dist/__mocks__/HttpClient.d.ts +1 -0
  6. package/dist/__mocks__/HttpClient.d.ts.map +1 -1
  7. package/dist/errors/TapsilatError.d.ts +12 -1
  8. package/dist/errors/TapsilatError.d.ts.map +1 -1
  9. package/dist/http/HttpClient.d.ts +19 -1
  10. package/dist/http/HttpClient.d.ts.map +1 -1
  11. package/dist/http/interceptors.d.ts.map +1 -1
  12. package/dist/index.cjs +1442 -128
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.ts +2029 -133
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +1429 -129
  17. package/dist/index.js.map +1 -1
  18. package/dist/services/MarketplaceService.d.ts +59 -0
  19. package/dist/services/MarketplaceService.d.ts.map +1 -0
  20. package/dist/services/ServiceBase.d.ts +21 -0
  21. package/dist/services/ServiceBase.d.ts.map +1 -0
  22. package/dist/services/SubmerchantService.d.ts +31 -0
  23. package/dist/services/SubmerchantService.d.ts.map +1 -0
  24. package/dist/services/TokenizationService.d.ts +14 -0
  25. package/dist/services/TokenizationService.d.ts.map +1 -0
  26. package/dist/services/VposService.d.ts +26 -0
  27. package/dist/services/VposService.d.ts.map +1 -0
  28. package/dist/services/index.d.ts +6 -0
  29. package/dist/services/index.d.ts.map +1 -0
  30. package/dist/types/elements.d.ts +144 -0
  31. package/dist/types/elements.d.ts.map +1 -0
  32. package/dist/types/index.d.ts +90 -44
  33. package/dist/types/index.d.ts.map +1 -1
  34. package/dist/types/panel.d.ts +839 -0
  35. package/dist/types/panel.d.ts.map +1 -0
  36. package/dist/utils/currency.d.ts +25 -0
  37. package/dist/utils/currency.d.ts.map +1 -0
  38. package/dist/utils/redact.d.ts +16 -0
  39. package/dist/utils/redact.d.ts.map +1 -0
  40. package/dist/utils/response.d.ts +12 -0
  41. package/dist/utils/response.d.ts.map +1 -1
  42. package/dist/utils/validators.d.ts +12 -0
  43. package/dist/utils/validators.d.ts.map +1 -1
  44. package/dist/utils/verify.d.ts +31 -8
  45. package/dist/utils/verify.d.ts.map +1 -1
  46. package/dist/webhooks/OrderStatus.d.ts +98 -0
  47. package/dist/webhooks/OrderStatus.d.ts.map +1 -0
  48. package/dist/webhooks/WebhookEvent.d.ts +58 -0
  49. package/dist/webhooks/WebhookEvent.d.ts.map +1 -0
  50. package/package.json +7 -7
package/dist/index.d.ts CHANGED
@@ -1,3 +1,837 @@
1
+ /**
2
+ * Request and response types for the panel REST API groups added for parity
3
+ * with the other Tapsilat SDKs: order payments and charging, card installments,
4
+ * organization currencies and users, submerchants, suborganizations, VPOS,
5
+ * card tokenization and the version 2 marketplace API.
6
+ *
7
+ * Field names match the JSON wire format. Response fields are optional because
8
+ * the server omits empty values.
9
+ */
10
+ /** Identifies an order by any one of its identifiers */
11
+ interface OrderPaymentsRequest {
12
+ order_id?: string;
13
+ order_reference_id?: string;
14
+ conversation_id?: string;
15
+ }
16
+ /** A payment made against an order */
17
+ interface OrderPayment {
18
+ id?: string;
19
+ date?: string;
20
+ payment_mode?: string;
21
+ amount?: number;
22
+ card_id?: string;
23
+ masked_card?: string;
24
+ card_holder_name?: string;
25
+ card_type?: string;
26
+ card_brand?: string;
27
+ card_bank?: string;
28
+ card_network?: string;
29
+ paid?: boolean;
30
+ type?: string;
31
+ acquirer_response?: string;
32
+ vpos_commission_amount?: number;
33
+ vpos_commission_rate?: number;
34
+ vpos_commission_fee_type?: string;
35
+ organization_commission_amount?: number;
36
+ organization_commission_rate?: number;
37
+ organization_commission_fee_type?: string;
38
+ total_amount?: number;
39
+ acquirer_commission_amount?: number;
40
+ acquirer_commission_rate?: number;
41
+ acquirer_commission_fee_type?: string;
42
+ acquirer_name?: string;
43
+ customer_paid_commission_amount?: number;
44
+ merchant_paid_commission_amount?: number;
45
+ merchant_net_amount?: number;
46
+ }
47
+ /** Payments made against an order with their totals */
48
+ interface OrderPaymentsResponse {
49
+ payments?: OrderPayment[];
50
+ total_amount?: number;
51
+ total_customer_paid_commission_amount?: number;
52
+ total_merchant_paid_commission_amount?: number;
53
+ total_merchant_net_amount?: number;
54
+ order_amount?: number;
55
+ }
56
+ /** Charges an order, for example with its saved card */
57
+ interface OrderChargeRequest {
58
+ order_reference_id: string;
59
+ retry?: boolean;
60
+ }
61
+ /** Charge result; the server sends these keys in camelCase */
62
+ interface OrderChargeResponse {
63
+ isSuccess?: boolean;
64
+ message?: string;
65
+ statusCode?: string;
66
+ errorCode?: string;
67
+ }
68
+ /** Submits or withdraws settlement approval for an item payment */
69
+ interface SubmerchantPaymentAction {
70
+ locale: string;
71
+ conversation_id: string;
72
+ payment_transaction_id: string;
73
+ acquirer: string;
74
+ }
75
+ interface SubmerchantPaymentActionResponse {
76
+ operation_id?: string;
77
+ status?: string;
78
+ locale?: string;
79
+ system_time?: number;
80
+ conversation_id?: string;
81
+ payment_transaction_id?: string;
82
+ acquirer?: string;
83
+ }
84
+ /** Changes the seller or payout of a completed marketplace item */
85
+ interface SubmerchantPaymentItemUpdate {
86
+ locale: string;
87
+ conversation_id: string;
88
+ payment_transaction_id: string;
89
+ sub_merchant_key: string;
90
+ /** Positive decimal amount as a string, for example "60.25" */
91
+ sub_merchant_price: string;
92
+ acquirer: string;
93
+ }
94
+ interface SubmerchantPaymentItemUpdateResponse {
95
+ operation_id?: string;
96
+ status?: string;
97
+ locale?: string;
98
+ system_time?: number;
99
+ conversation_id?: string;
100
+ payment_transaction_id?: string;
101
+ }
102
+ interface OrderSubmerchantListItem {
103
+ id?: string;
104
+ name?: string;
105
+ email?: string;
106
+ submerchant_type?: string;
107
+ submerchant_key?: string;
108
+ labels?: string;
109
+ status?: string;
110
+ acquirer?: string;
111
+ }
112
+ /** Paginated submerchants of the organization's orders; rows are under `row` */
113
+ interface OrderSubmerchantListResponse {
114
+ page?: number;
115
+ per_page?: number;
116
+ total?: number;
117
+ total_pages?: number;
118
+ row?: OrderSubmerchantListItem[];
119
+ }
120
+ interface CardInstallmentsRequest {
121
+ /** The card's first digits (at least 8) */
122
+ bin: string;
123
+ amount: number;
124
+ /** Currency unit or name, for example "TRY" */
125
+ currency: string;
126
+ is_three_d?: boolean;
127
+ }
128
+ interface CardInstallment {
129
+ installment?: number;
130
+ amount?: string;
131
+ total_amount?: string;
132
+ commission_rate?: number;
133
+ monthly_payment?: string;
134
+ }
135
+ interface CardInstallmentsResponse {
136
+ is_installment_available?: boolean;
137
+ installments?: CardInstallment[];
138
+ }
139
+ interface InstallmentTableRequest {
140
+ amount: number;
141
+ /** Currency unit or name, for example "TRY" */
142
+ currency: string;
143
+ is_three_d?: boolean;
144
+ }
145
+ interface InstallmentTableRow {
146
+ installment?: number;
147
+ installment_amount?: string;
148
+ total_amount?: string;
149
+ commission_rate?: number;
150
+ is_interest_free?: boolean;
151
+ }
152
+ interface InstallmentTableGroup {
153
+ bank?: string;
154
+ program?: string;
155
+ program_code?: string;
156
+ rows?: InstallmentTableRow[];
157
+ }
158
+ interface InstallmentTableResponse {
159
+ groups?: InstallmentTableGroup[];
160
+ }
161
+ interface OrganizationCurrency$1 {
162
+ id?: string;
163
+ name?: string;
164
+ code?: string;
165
+ symbol?: string;
166
+ currency_unit?: string;
167
+ }
168
+ interface OrganizationCurrenciesResponse {
169
+ currencies?: OrganizationCurrency$1[];
170
+ }
171
+ interface OrganizationCurrencyPreset {
172
+ currency_code?: string;
173
+ currency_unit?: string;
174
+ name?: string;
175
+ minor_unit?: number;
176
+ }
177
+ interface OrganizationCurrencyPresetsResponse {
178
+ items?: OrganizationCurrencyPreset[];
179
+ }
180
+ interface CreateOrganizationCurrencyResponse {
181
+ code?: number;
182
+ message?: string;
183
+ created?: boolean;
184
+ currency?: OrganizationCurrency$1;
185
+ }
186
+ /** Creates an access token for an organization user; `expire` is in minutes */
187
+ interface OrgUserTokenCreateRequest {
188
+ email?: string;
189
+ expire?: number;
190
+ invalidate_old_tokens?: boolean;
191
+ user_id?: string;
192
+ }
193
+ interface OrgUserTokenCreateResponse {
194
+ code?: number;
195
+ message?: string;
196
+ token?: string;
197
+ user_id?: string;
198
+ }
199
+ /**
200
+ * Creates or replaces a submerchant. `currency_id` accepts a currency UUID or
201
+ * an organization currency unit such as "TRY".
202
+ */
203
+ interface SubmerchantCreateRequest {
204
+ locale: string;
205
+ conversation_id: string;
206
+ name: string;
207
+ email: string;
208
+ gsm_number: string;
209
+ address?: string;
210
+ iban?: string;
211
+ tax_office?: string;
212
+ legal_company_title?: string;
213
+ currency_id?: string;
214
+ sub_merchant_external_id?: string;
215
+ identity_number?: string;
216
+ /** PERSONAL, PRIVATE_COMPANY or LIMITED_OR_JOINT_STOCK_COMPANY */
217
+ sub_merchant_type?: string;
218
+ tax_number?: string;
219
+ sub_merchant_key?: string;
220
+ organization_id?: string;
221
+ status?: string;
222
+ system_time?: number;
223
+ contact_name?: string;
224
+ contact_surname?: string;
225
+ }
226
+ /** Replaces the submerchant profile; send every field */
227
+ type SubmerchantUpdateRequest = SubmerchantCreateRequest;
228
+ interface Submerchant {
229
+ id?: string;
230
+ locale?: string;
231
+ conversation_id?: string;
232
+ name?: string;
233
+ email?: string;
234
+ gsm_number?: string;
235
+ address?: string;
236
+ iban?: string;
237
+ tax_office?: string;
238
+ legal_company_title?: string;
239
+ currency_id?: string;
240
+ sub_merchant_external_id?: string;
241
+ identity_number?: string;
242
+ sub_merchant_type?: string;
243
+ tax_number?: string;
244
+ sub_merchant_key?: string;
245
+ organization_id?: string;
246
+ labels?: string;
247
+ status?: string;
248
+ system_time?: number;
249
+ acquirer?: string;
250
+ contact_name?: string;
251
+ contact_surname?: string;
252
+ }
253
+ interface SubmerchantListItem {
254
+ id?: string;
255
+ name?: string;
256
+ email?: string;
257
+ submerchant_type?: string;
258
+ submerchant_key?: string;
259
+ labels?: string;
260
+ status?: string;
261
+ acquirer?: string;
262
+ }
263
+ /** Paginated submerchants; rows are under `row` */
264
+ interface SubmerchantListResponse {
265
+ page?: number;
266
+ per_page?: number;
267
+ total?: number;
268
+ total_pages?: number;
269
+ row?: SubmerchantListItem[];
270
+ }
271
+ /** Returned by submerchant create, update and delete */
272
+ interface SubmerchantMutationResponse {
273
+ code?: number;
274
+ message?: string;
275
+ }
276
+ /** Selects a VPOS account in one environment for marketplace seller provisioning */
277
+ interface MarketplaceAccountTarget {
278
+ vpos_id: string;
279
+ /** TEST or PROD */
280
+ environment: string;
281
+ }
282
+ /**
283
+ * Creates a marketplace seller. Omit both `vpos_id` and `provider_accounts` to
284
+ * create only the logical seller; never combine them.
285
+ */
286
+ interface MarketplaceSubmerchantCreateRequest extends SubmerchantCreateRequest {
287
+ provider_accounts?: MarketplaceAccountTarget[];
288
+ labels?: string[];
289
+ vpos_id?: string;
290
+ /** auto or manual */
291
+ approval_mode?: string | null;
292
+ release_policy_id?: string | null;
293
+ idempotency_key?: string;
294
+ }
295
+ interface MarketplaceSubmerchantProvisioning {
296
+ vpos_id?: string;
297
+ vpos_submerchant_id?: string;
298
+ provider?: string;
299
+ status?: string;
300
+ provider_submerchant_key?: string;
301
+ retryable?: boolean;
302
+ error_message?: string;
303
+ }
304
+ interface MarketplaceSubmerchantCreateResponse {
305
+ id?: string;
306
+ suborganization_id?: string;
307
+ vpos_submerchant_id?: string;
308
+ routing_reference?: string;
309
+ provisionings?: MarketplaceSubmerchantProvisioning[];
310
+ }
311
+ /** Records an item business event such as `service_completed` */
312
+ interface SubmerchantPayoutEventRequest {
313
+ idempotency_key: string;
314
+ order_reference: string;
315
+ item_id: string;
316
+ event_type: string;
317
+ /** RFC3339 timestamp */
318
+ occurred_at?: string;
319
+ payload?: Record<string, unknown>;
320
+ }
321
+ interface SubmerchantPayoutEventResponse {
322
+ id?: string;
323
+ idempotency_key?: string;
324
+ order_reference?: string;
325
+ item_id?: string;
326
+ event_type?: string;
327
+ occurred_at?: string;
328
+ payload?: Record<string, unknown>;
329
+ }
330
+ interface SuborganizationListItem {
331
+ id?: string;
332
+ name?: string;
333
+ address?: string;
334
+ city?: string;
335
+ country?: string;
336
+ phone?: string;
337
+ currency?: string;
338
+ logo?: string;
339
+ }
340
+ interface SuborganizationListResponse {
341
+ page?: number;
342
+ per_page?: number;
343
+ total?: number;
344
+ total_pages?: number;
345
+ rows?: SuborganizationListItem[];
346
+ }
347
+ interface SuborganizationDetail {
348
+ id?: string;
349
+ name?: string;
350
+ parent_id?: string;
351
+ public_status?: number;
352
+ availability_status?: number;
353
+ created_at?: string;
354
+ updated_at?: string;
355
+ }
356
+ interface SubmerchantSuborganizationMapping {
357
+ submerchant_id?: string;
358
+ suborganization_id?: string;
359
+ }
360
+ interface SuborganizationSubmerchantMapping {
361
+ suborganization_id?: string;
362
+ submerchant_id?: string;
363
+ }
364
+ /**
365
+ * VPOS configuration. Updates replace the stored configuration, so fields
366
+ * left out are stored as empty or false: read the VPOS first and send every
367
+ * field back. `currencies` accepts currency UUIDs or units such as "TRY".
368
+ */
369
+ interface VposCreateRequest {
370
+ name: string;
371
+ bank_name?: string;
372
+ env_mode?: string;
373
+ merchant?: string;
374
+ merchant_code?: string;
375
+ merchant_key?: string;
376
+ auth_key?: string;
377
+ terminal?: string;
378
+ company?: string;
379
+ username?: string;
380
+ password?: string;
381
+ store_key?: string;
382
+ api_key?: string;
383
+ api_secret?: string;
384
+ guid?: string;
385
+ pid?: string;
386
+ client_id?: string;
387
+ client_code?: string;
388
+ type?: string;
389
+ block_date?: number;
390
+ priority?: number;
391
+ main?: boolean;
392
+ force_three_d?: boolean;
393
+ marketplace?: boolean;
394
+ pf?: boolean;
395
+ payment_mode?: string;
396
+ prefix?: string;
397
+ acquirer_id: string;
398
+ card_schemes?: string[];
399
+ currencies: string[];
400
+ failover?: boolean;
401
+ pf_id?: string;
402
+ redirect_uri?: string;
403
+ tls?: boolean;
404
+ tls_key?: string;
405
+ tls_cert?: string;
406
+ root_ca?: string;
407
+ main_installment?: boolean;
408
+ main_without_installment?: boolean;
409
+ }
410
+ type VposUpdateRequest = VposCreateRequest;
411
+ interface Vpos extends Partial<VposCreateRequest> {
412
+ id?: string;
413
+ provider?: string;
414
+ }
415
+ interface VposListItem {
416
+ id?: string;
417
+ name?: string;
418
+ bank_name?: string;
419
+ env_mode?: string;
420
+ provider?: string;
421
+ payment_mode?: string;
422
+ }
423
+ interface VposListParams {
424
+ page?: number;
425
+ per_page?: number;
426
+ suborganization_id?: string;
427
+ }
428
+ interface VposListResponse {
429
+ page?: number;
430
+ per_page?: number;
431
+ total?: number;
432
+ total_pages?: number;
433
+ rows?: VposListItem[];
434
+ }
435
+ interface VposMutationResponse {
436
+ code?: number;
437
+ message?: string;
438
+ }
439
+ interface VposAcquirer {
440
+ id?: string;
441
+ name?: string;
442
+ prefix?: string;
443
+ }
444
+ interface VposAcquirerListResponse {
445
+ items?: VposAcquirer[];
446
+ }
447
+ interface CardScheme {
448
+ id?: string;
449
+ name?: string;
450
+ }
451
+ interface CardSchemeListResponse {
452
+ items?: CardScheme[];
453
+ }
454
+ interface VposAcquirerTemplateDefaults {
455
+ payment_mode?: string;
456
+ main?: boolean;
457
+ marketplace?: boolean;
458
+ force_three_d?: boolean;
459
+ credentials?: Record<string, string>;
460
+ }
461
+ interface VposAcquirerTemplate {
462
+ acquirer_id?: string;
463
+ name?: string;
464
+ prefix?: string;
465
+ required_fields?: string[];
466
+ optional_fields?: string[];
467
+ defaults?: VposAcquirerTemplateDefaults;
468
+ }
469
+ interface VposAcquirerTemplateListResponse {
470
+ items?: VposAcquirerTemplate[];
471
+ }
472
+ interface VposSubmerchantCreateRequest {
473
+ external_reference_id?: string;
474
+ submerchant_id?: string;
475
+ terminal_no?: string;
476
+ vpos_id: string;
477
+ mcc?: string;
478
+ tax_id?: string;
479
+ national_id?: string;
480
+ title?: string;
481
+ switch_id?: string;
482
+ city?: string;
483
+ country?: string;
484
+ country_isocode?: string;
485
+ postal_code?: string;
486
+ address?: string;
487
+ submerchant_url?: string;
488
+ submerchant_nin?: string;
489
+ }
490
+ interface VposSubmerchantUpdateRequest {
491
+ external_reference_id?: string;
492
+ submerchant_id?: string;
493
+ terminal_no?: string;
494
+ mcc?: string;
495
+ tax_id?: string;
496
+ national_id?: string;
497
+ title?: string;
498
+ switch_id?: string;
499
+ }
500
+ interface VposSubmerchant {
501
+ id?: string;
502
+ external_reference_id?: string;
503
+ submerchant_id?: string;
504
+ terminal_no?: string;
505
+ vpos_id?: string;
506
+ mcc?: string;
507
+ tax_id?: string;
508
+ national_id?: string;
509
+ title?: string;
510
+ switch_id?: string;
511
+ }
512
+ interface VposSubmerchantListItem {
513
+ id?: string;
514
+ external_reference_id?: string;
515
+ submerchant_id?: string;
516
+ terminal_no?: string;
517
+ vpos_id?: string;
518
+ }
519
+ interface VposSubmerchantListParams {
520
+ page?: number;
521
+ per_page?: number;
522
+ vpos_id?: string;
523
+ external_reference_id?: string;
524
+ }
525
+ interface VposSubmerchantListResponse {
526
+ page?: number;
527
+ per_page?: number;
528
+ total?: number;
529
+ total_pages?: number;
530
+ rows?: VposSubmerchantListItem[];
531
+ }
532
+ interface VposSubmerchantMutationResponse {
533
+ code?: number;
534
+ message?: string;
535
+ }
536
+ interface CardTokenizeRequest {
537
+ card_number: string;
538
+ holder_name: string;
539
+ expiry_month: string;
540
+ /** Two or four digits */
541
+ expiry_year: string;
542
+ cvv: string;
543
+ name?: string;
544
+ default?: boolean;
545
+ /** 1 = 3D secure, 2 = half secure, 3 = non-secure */
546
+ mode?: number;
547
+ user_id?: string;
548
+ user_email?: string;
549
+ redirect_success_url?: string;
550
+ redirect_failure_url?: string;
551
+ }
552
+ interface CardTokenizeResponse {
553
+ threedform_url?: string;
554
+ threedform_html?: string;
555
+ is_success?: boolean;
556
+ message?: string;
557
+ status_code?: string;
558
+ error_code?: string;
559
+ order_reference_id?: string;
560
+ card_id?: string;
561
+ }
562
+ interface SavedCard {
563
+ id?: string;
564
+ name?: string;
565
+ holder_name?: string;
566
+ masked_number?: string;
567
+ last_four?: string;
568
+ brand?: string;
569
+ bin?: string;
570
+ is_default?: boolean;
571
+ }
572
+ interface ListSavedCardsResponse {
573
+ page?: number;
574
+ per_page?: number;
575
+ total?: number;
576
+ total_pages?: number;
577
+ rows?: SavedCard[];
578
+ }
579
+ interface DeleteSavedCardResponse {
580
+ success?: boolean;
581
+ message?: string;
582
+ }
583
+ interface MarketplaceSeller {
584
+ id?: string;
585
+ routing_reference?: string;
586
+ /** Opaque revision string; send it back unchanged */
587
+ revision?: string;
588
+ name?: string;
589
+ email?: string;
590
+ gsm_number?: string;
591
+ address?: string;
592
+ iban?: string;
593
+ currency_id?: string;
594
+ sub_merchant_type?: string;
595
+ sub_merchant_external_id?: string;
596
+ identity_number?: string;
597
+ tax_number?: string;
598
+ tax_office?: string;
599
+ legal_company_title?: string;
600
+ contact_name?: string;
601
+ contact_surname?: string;
602
+ locale?: string;
603
+ conversation_id?: string;
604
+ status?: string;
605
+ labels?: string[];
606
+ approval_mode?: string | null;
607
+ release_policy_id?: string | null;
608
+ }
609
+ interface MarketplaceSellerList {
610
+ rows?: MarketplaceSeller[];
611
+ page?: number;
612
+ per_page?: number;
613
+ total?: number;
614
+ total_pages?: number;
615
+ }
616
+ interface MarketplaceSellerListParams {
617
+ page?: number;
618
+ per_page?: number;
619
+ /** Exact external ID match */
620
+ external_id?: string;
621
+ }
622
+ /**
623
+ * Replaces the seller profile at `revision` (from getMarketplaceSubmerchant).
624
+ * Omit account selectors (`vpos_id`, `provider_accounts`).
625
+ */
626
+ interface MarketplaceProfileUpdate extends Omit<MarketplaceSubmerchantCreateRequest, "vpos_id" | "provider_accounts"> {
627
+ /** Opaque revision string, sent back exactly as received */
628
+ revision: string;
629
+ }
630
+ interface MarketplaceProfileUpdateResponse {
631
+ approval_required?: boolean;
632
+ }
633
+ interface MarketplaceSellerContract {
634
+ supported?: boolean;
635
+ remote?: boolean;
636
+ fields?: Record<string, boolean>;
637
+ immutable_fields?: string[];
638
+ currencies?: string[];
639
+ }
640
+ interface MarketplaceContracts {
641
+ contracts?: Record<string, MarketplaceSellerContract>;
642
+ }
643
+ interface MarketplaceContractFilter {
644
+ /** Currency UUID or unit such as "TRY" */
645
+ currency_id: string;
646
+ seller_type: string;
647
+ operation: string;
648
+ vpos_ids: string[];
649
+ }
650
+ interface MarketplaceSynchronization {
651
+ status?: string;
652
+ operation?: string;
653
+ error_message?: string;
654
+ needs_update?: boolean;
655
+ attempts?: number;
656
+ verified_at?: string;
657
+ missing_fields?: string[];
658
+ }
659
+ interface MarketplaceSellerAccount {
660
+ vpos_id?: string;
661
+ name?: string;
662
+ provider?: string;
663
+ environment?: string;
664
+ eligible?: boolean;
665
+ mapped?: boolean;
666
+ status?: string;
667
+ attempts?: number;
668
+ updated_at?: string;
669
+ error_message?: string;
670
+ retryable?: boolean;
671
+ revision?: string;
672
+ seller_revision?: string;
673
+ account_revision?: string;
674
+ actions?: string[];
675
+ contracts?: Record<string, MarketplaceSellerContract>;
676
+ contract_error?: string;
677
+ sync?: MarketplaceSynchronization;
678
+ registration_profile_changed?: boolean;
679
+ registration_missing_fields?: string[];
680
+ provider_submerchant_key?: string;
681
+ }
682
+ interface MarketplaceSellerAccounts {
683
+ rows?: MarketplaceSellerAccount[];
684
+ }
685
+ /** Confirms a listed account action using the account's latest revision and environment */
686
+ interface MarketplaceAccountAction {
687
+ /** create, retry, resubmit, update, retrieve or retry_sync */
688
+ action: string;
689
+ environment: string;
690
+ revision: string;
691
+ }
692
+ interface MarketplacePayout {
693
+ /** Opaque revision string; send it back unchanged */
694
+ revision?: string;
695
+ active_operation_id?: string;
696
+ id?: string;
697
+ provider?: string;
698
+ organization_id?: string;
699
+ submerchant_id?: string;
700
+ submerchant_name?: string;
701
+ order_id?: string;
702
+ order_reference_id?: string;
703
+ order_display?: string;
704
+ amount?: string;
705
+ currency?: string;
706
+ approval_mode?: string;
707
+ approval_rule_id?: string;
708
+ approval_rule_name?: string;
709
+ release_policy_id?: string;
710
+ release_policy_name?: string;
711
+ eligibility_status?: string;
712
+ required_event?: string;
713
+ item_id?: string;
714
+ business_eligible_at?: string;
715
+ eligible_at?: string;
716
+ release_status?: string;
717
+ status?: string;
718
+ provider_reference?: string;
719
+ attempts?: number;
720
+ released_at?: string;
721
+ created_at?: string;
722
+ error_message?: string;
723
+ }
724
+ interface MarketplacePayoutFilter {
725
+ order_id?: string;
726
+ submerchant_id?: string;
727
+ vpos_id?: string;
728
+ provider?: string;
729
+ status?: string;
730
+ release_status?: string;
731
+ approval_mode?: string;
732
+ /** Currency unit such as "TRY" */
733
+ currency?: string;
734
+ eligibility?: string;
735
+ search?: string;
736
+ min_amount?: string;
737
+ max_amount?: string;
738
+ /** YYYY-MM-DD */
739
+ start_date?: string;
740
+ /** YYYY-MM-DD */
741
+ end_date?: string;
742
+ page?: number;
743
+ per_page?: number;
744
+ }
745
+ interface MarketplacePayoutList {
746
+ rows?: MarketplacePayout[];
747
+ page?: number;
748
+ per_page?: number;
749
+ total?: number;
750
+ total_pages?: number;
751
+ }
752
+ interface MarketplacePayoutApproval {
753
+ /** At most 100 payout IDs */
754
+ ids: string[];
755
+ }
756
+ interface MarketplacePayoutAcceptance {
757
+ status?: string;
758
+ }
759
+ interface MarketplaceApprovalPolicy {
760
+ id?: string;
761
+ name?: string;
762
+ priority?: number;
763
+ enabled?: boolean;
764
+ provider?: string;
765
+ min_amount?: string | null;
766
+ max_amount?: string | null;
767
+ currency_id?: string | null;
768
+ submerchant_ids?: string[];
769
+ labels_any?: string[];
770
+ mode?: string;
771
+ }
772
+ interface MarketplaceApprovalPolicies {
773
+ rows?: MarketplaceApprovalPolicy[];
774
+ }
775
+ /**
776
+ * Creates or replaces an approval rule. `currency_id` must be a UUID on the
777
+ * wire; the SDK resolves units such as "TRY" before sending.
778
+ */
779
+ interface MarketplaceApprovalPolicyInput {
780
+ name: string;
781
+ priority: number;
782
+ enabled?: boolean | null;
783
+ provider?: string;
784
+ min_amount?: string | null;
785
+ max_amount?: string | null;
786
+ currency_id?: string;
787
+ submerchant_ids?: string[];
788
+ labels_any?: string[];
789
+ mode: string;
790
+ }
791
+ interface MarketplaceReleasePolicy {
792
+ id?: string;
793
+ name?: string;
794
+ enabled?: boolean;
795
+ default?: boolean;
796
+ minimum_delay_seconds?: number;
797
+ explicit_not_before?: string;
798
+ required_external_event?: string;
799
+ }
800
+ interface MarketplaceReleasePolicies {
801
+ rows?: MarketplaceReleasePolicy[];
802
+ }
803
+ interface MarketplaceReleasePolicyInput {
804
+ name: string;
805
+ enabled?: boolean;
806
+ default?: boolean;
807
+ minimum_delay_seconds?: number;
808
+ explicit_not_before?: string;
809
+ required_external_event?: string;
810
+ }
811
+ interface MarketplaceApprovalSettings {
812
+ /** auto or manual */
813
+ default_mode?: string;
814
+ }
815
+ interface MarketplacePayoutOperationInput {
816
+ /** disapprove or update_item */
817
+ kind: string;
818
+ idempotency_key: string;
819
+ /** The payout's current revision, sent back exactly as received */
820
+ revision: string;
821
+ seller_reference?: string;
822
+ net_amount?: string;
823
+ }
824
+ interface MarketplacePayoutOperation {
825
+ id?: string;
826
+ payout_id?: string;
827
+ kind?: string;
828
+ status?: string;
829
+ attempts?: number;
830
+ error_message?: string;
831
+ created_at?: string;
832
+ updated_at?: string;
833
+ }
834
+
1
835
  /**
2
836
  * @module Types
3
837
  * @description Tapsilat SDK type definitions, interfaces, and API data structures
@@ -109,7 +943,7 @@ interface Address {
109
943
  * @interface BillingAddress
110
944
  */
111
945
  interface BillingAddress extends Address {
112
- billing_type: "PERSONAL" | "BUSINESS" | "CORPORATE";
946
+ billing_type: "PERSONAL" | "CORPORATE" | "BUSINESS";
113
947
  citizenship?: string;
114
948
  neighbourhood?: string;
115
949
  street1?: string;
@@ -144,6 +978,8 @@ interface BasketItem {
144
978
  quantity_unit?: string;
145
979
  sub_merchant_key?: string;
146
980
  sub_merchant_price?: string;
981
+ /** RFC3339 timestamp before which the item's marketplace payout is not released */
982
+ payout_release_at?: string;
147
983
  }
148
984
  /**
149
985
  * @category Payment Processing
@@ -177,18 +1013,6 @@ interface RefundResponse {
177
1013
  reason?: string;
178
1014
  createdAt: string;
179
1015
  }
180
- /**
181
- * @category Webhooks
182
- * @summary Notification data structure for system events
183
- * @description Event payload sent to webhook endpoints when important events occur in the payment lifecycle
184
- * @interface WebhookEvent
185
- */
186
- interface WebhookEvent {
187
- id: string;
188
- type: "payment.completed" | "payment.failed" | "refund.completed";
189
- data: PaymentResponse | RefundResponse;
190
- createdAt: string;
191
- }
192
1016
  /**
193
1017
  * @category Error Handling
194
1018
  * @summary Standardized error format returned by the API
@@ -199,6 +1023,18 @@ interface APIError {
199
1023
  code: string;
200
1024
  message: string;
201
1025
  details?: unknown;
1026
+ /** HTTP status code of the failed response */
1027
+ statusCode?: number;
1028
+ /** `code` field from the response body, as a string */
1029
+ apiCode?: string;
1030
+ /** `status` field from the response body */
1031
+ apiStatus?: string;
1032
+ /** Per-field validation messages from the response body */
1033
+ errors?: Record<string, unknown>;
1034
+ /** Whether the error object in the response body says the request can be retried */
1035
+ retryable?: boolean;
1036
+ /** Raw response body */
1037
+ rawBody?: string;
202
1038
  }
203
1039
  /**
204
1040
  * @category HTTP
@@ -209,11 +1045,7 @@ interface APIError {
209
1045
  interface APIResponse<T> {
210
1046
  success: boolean;
211
1047
  data?: T;
212
- error?: {
213
- message: string;
214
- code: string;
215
- details?: unknown;
216
- };
1048
+ error?: APIError;
217
1049
  status?: number;
218
1050
  headers?: Record<string, string>;
219
1051
  }
@@ -273,6 +1105,9 @@ interface Buyer {
273
1105
  ip?: string;
274
1106
  registration_date?: string;
275
1107
  last_login_date?: string;
1108
+ income_type?: string;
1109
+ education?: string;
1110
+ occupation?: string;
276
1111
  }
277
1112
  /**
278
1113
  * @category Order Management
@@ -314,6 +1149,7 @@ interface OrderCreateRequest {
314
1149
  metadata?: OrderMetadata[];
315
1150
  sub_organization?: SubOrganizationDTO;
316
1151
  submerchants?: SubmerchantDTO[];
1152
+ order_vpos_id?: string;
317
1153
  }
318
1154
  /**
319
1155
  * @category Order Management
@@ -401,8 +1237,10 @@ interface GetOrdersRequest {
401
1237
  end_date?: string;
402
1238
  organization_id?: string;
403
1239
  related_reference_id?: string;
1240
+ conversation_id?: string;
404
1241
  buyer_id?: string;
405
- status?: number;
1242
+ /** Numeric order status */
1243
+ status?: number | string;
406
1244
  }
407
1245
  /**
408
1246
  * @category Order Management
@@ -682,6 +1520,8 @@ interface BasketItemDTO {
682
1520
  status?: number;
683
1521
  sub_merchant_key?: string;
684
1522
  sub_merchant_price?: string;
1523
+ /** RFC3339 timestamp before which the item's marketplace payout is not released */
1524
+ payout_release_at?: string;
685
1525
  }
686
1526
  /**
687
1527
  * @category API DTOs
@@ -714,16 +1554,28 @@ interface BillingAddressDTO {
714
1554
  * @interface CheckoutDesignDTO
715
1555
  */
716
1556
  interface CheckoutDesignDTO {
1557
+ placeholder_color?: string;
717
1558
  input_background_color?: string;
718
1559
  input_text_color?: string;
719
1560
  label_text_color?: string;
720
1561
  left_background_color?: string;
721
1562
  logo?: string;
1563
+ /** @deprecated Checkout no longer renders custom order detail HTML; the value is ignored. */
722
1564
  order_detail_html?: string;
723
1565
  pay_button_color?: string;
1566
+ /** @deprecated Ignored by checkout. Use the order's redirect_success_url and redirect_failure_url. */
724
1567
  redirect_url?: string;
725
1568
  right_background_color?: string;
726
1569
  text_color?: string;
1570
+ pay_button_text_color?: string;
1571
+ page_background_color?: string;
1572
+ border_color?: string;
1573
+ input_border_color?: string;
1574
+ accent_color?: string;
1575
+ text_muted_color?: string;
1576
+ surface_muted_color?: string;
1577
+ dark_mode_enabled?: boolean;
1578
+ dark_colors?: Record<string, string>;
727
1579
  }
728
1580
  /**
729
1581
  * @category API DTOs
@@ -751,7 +1603,11 @@ interface OrderCardDTO {
751
1603
  * @description Details for installment or partial payments with due dates and status
752
1604
  * @interface PaymentTermDTO
753
1605
  */
1606
+ /** Payment term sent with order creation; due_date and paid_date must be RFC3339 timestamps */
754
1607
  interface PaymentTermDTO {
1608
+ hash_id?: string;
1609
+ id?: number;
1610
+ payments?: any[];
755
1611
  amount?: number;
756
1612
  data?: string;
757
1613
  due_date?: string;
@@ -863,17 +1719,19 @@ interface OrderCreateDTO {
863
1719
  external_reference_id?: string;
864
1720
  metadata?: MetadataDTO[];
865
1721
  order_cards?: OrderCardDTO[];
1722
+ order_vpos_id?: string;
866
1723
  paid_amount?: number;
1724
+ /** "auth" (default) or "preauth" */
1725
+ payment_mode?: string;
1726
+ redirect_success_url?: string;
1727
+ redirect_failure_url?: string;
867
1728
  partial_payment?: boolean;
868
1729
  payment_failure_url?: string;
869
- payment_mode?: string;
870
1730
  payment_methods?: boolean;
871
1731
  payment_options?: string[];
872
1732
  payment_success_url?: string;
873
1733
  payment_terms?: PaymentTermDTO[];
874
1734
  pf_sub_merchant?: OrderPFSubMerchantDTO;
875
- redirect_failure_url?: string;
876
- redirect_success_url?: string;
877
1735
  shipping_address?: ShippingAddressDTO;
878
1736
  sub_organization?: SubOrganizationDTO;
879
1737
  submerchants?: SubmerchantDTO[];
@@ -917,14 +1775,16 @@ interface OrderPaymentDetailDTO {
917
1775
  * @description Structure for creating a new payment term for an existing order
918
1776
  * @interface OrderPaymentTermCreateDTO
919
1777
  */
1778
+ /** Adds a payment term to an existing order; dates use YYYY-MM-DD */
920
1779
  interface OrderPaymentTermCreateDTO {
1780
+ /** The order's ID (order_id from order creation), not its reference ID */
921
1781
  order_id: string;
922
- term_reference_id: string;
1782
+ term_reference_id?: string;
923
1783
  amount: number;
924
1784
  due_date: string;
925
- term_sequence: number;
1785
+ term_sequence?: number;
926
1786
  required: boolean;
927
- status: string;
1787
+ status?: string;
928
1788
  data?: string;
929
1789
  paid_date?: string;
930
1790
  }
@@ -950,9 +1810,11 @@ interface OrderPaymentTermUpdateDTO {
950
1810
  * @interface OrderTermRefundRequest
951
1811
  */
952
1812
  interface OrderTermRefundRequest {
1813
+ /** The payment term's ID */
953
1814
  term_id: string;
954
1815
  amount: number;
955
- reference_id?: string;
1816
+ /** The order's reference ID; required by the server */
1817
+ reference_id: string;
956
1818
  term_payment_id?: string;
957
1819
  }
958
1820
  /**
@@ -987,7 +1849,7 @@ interface PaymentTermResponse {
987
1849
  }
988
1850
  /**
989
1851
  * @category Payment Terms
990
- * @summary Protobuf timestamp payload
1852
+ * @summary Seconds-and-nanos timestamp payload
991
1853
  * @description Timestamp structure used by term APIs (`seconds` + `nanos`)
992
1854
  * @interface TimestampDTO
993
1855
  */
@@ -1020,6 +1882,7 @@ interface OrderPaymentTermActionResponse {
1020
1882
  * @interface PaymentTermDeleteRequest
1021
1883
  */
1022
1884
  interface PaymentTermDeleteRequest {
1885
+ /** The order's ID, not its reference ID; the server requires it */
1023
1886
  order_id?: string;
1024
1887
  term_reference_id: string;
1025
1888
  }
@@ -1144,6 +2007,9 @@ interface SubscriptionCreateRequest {
1144
2007
  title?: string;
1145
2008
  user?: SubscriptionUser;
1146
2009
  price_option?: SubscriptionPriceOption;
2010
+ /** day, week, month or year */
2011
+ interval?: string;
2012
+ interval_count?: number;
1147
2013
  }
1148
2014
  interface SubscriptionPriceOption {
1149
2015
  count: number;
@@ -1171,6 +2037,10 @@ interface SubscriptionDetail {
1171
2037
  payment_status?: string;
1172
2038
  period?: number;
1173
2039
  title?: string;
2040
+ cycle?: number;
2041
+ cycles_completed?: number;
2042
+ interval?: string;
2043
+ interval_count?: number;
1174
2044
  }
1175
2045
  interface SubscriptionListItem {
1176
2046
  amount?: string;
@@ -1213,6 +2083,9 @@ interface OrganizationSettings {
1213
2083
  domain_address?: string;
1214
2084
  checkout_domain?: string;
1215
2085
  subscription_domain?: string;
2086
+ has_kyc_kyx_template?: boolean;
2087
+ has_kyb_kyx_template?: boolean;
2088
+ is_money_transfer_partner?: boolean;
1216
2089
  }
1217
2090
  interface OrderTransaction {
1218
2091
  amount?: string;
@@ -1226,6 +2099,7 @@ interface OrderTransaction {
1226
2099
  status?: string;
1227
2100
  [key: string]: unknown;
1228
2101
  }
2102
+ /** @deprecated The API returns the transactions as an array; `getOrderTransactions` returns `OrderTransaction[]`. */
1229
2103
  interface GetOrderTransactionsResponse {
1230
2104
  orderTX?: OrderTransaction[];
1231
2105
  }
@@ -1541,6 +2415,7 @@ interface OrderPostAuthRequest {
1541
2415
  amount: number;
1542
2416
  reference_id: string;
1543
2417
  }
2418
+
1544
2419
  /**
1545
2420
  * @category Order Management
1546
2421
  * @summary Response for order post-authorization
@@ -1567,13 +2442,9 @@ interface OrderCallbackResponse {
1567
2442
  interface OrderVposQueryResponse {
1568
2443
  [key: string]: unknown;
1569
2444
  }
1570
- interface OrganizationCurrencyPreset {
1571
- id?: string;
1572
- name?: string;
1573
- code?: string;
1574
- [key: string]: unknown;
1575
- }
1576
2445
  interface GetOrganizationCurrencyPresetsResponse {
2446
+ items?: OrganizationCurrencyPreset[];
2447
+ /** @deprecated The API returns the presets in `items`. */
1577
2448
  presets?: OrganizationCurrencyPreset[];
1578
2449
  }
1579
2450
  interface GetSuborganizationDetailsResponse {
@@ -1638,12 +2509,9 @@ interface SystemTransactionStatus {
1638
2509
  interface GetSystemTransactionStatusesResponse {
1639
2510
  rows?: SystemTransactionStatus[];
1640
2511
  }
1641
- interface GetOrderPaymentsRequest {
1642
- order_id: string;
1643
- }
1644
- interface GetOrderPaymentsResponse {
1645
- [key: string]: unknown;
1646
- }
2512
+ /** Selects the order whose payments to list; set at least one identifier. */
2513
+ type GetOrderPaymentsRequest = OrderPaymentsRequest;
2514
+ type GetOrderPaymentsResponse = OrderPaymentsResponse;
1647
2515
  interface OrderOIPDTO {
1648
2516
  amount: number;
1649
2517
  type: number;
@@ -1681,93 +2549,830 @@ interface ListSubmerchantsResponse {
1681
2549
  page?: number;
1682
2550
  per_page?: number;
1683
2551
  }
1684
- interface OrgUserTokenCreateReq {
1685
- email: string;
1686
- expire?: number;
2552
+ interface OrgUserTokenCreateReq extends OrgUserTokenCreateRequest {
2553
+ /** @deprecated Not part of the API; the server ignores it. */
1687
2554
  language?: string;
2555
+ /** @deprecated Not part of the API; the server ignores it. */
1688
2556
  metadata?: Record<string, unknown>;
2557
+ /** @deprecated Not part of the API; the server ignores it. */
1689
2558
  title?: string;
2559
+ /** @deprecated Not part of the API; the server ignores it. */
1690
2560
  type?: string;
1691
2561
  }
1692
- interface OrgUserTokenCreateResponse {
1693
- [key: string]: unknown;
2562
+ interface CreateOrganizationCurrencyPayload {
2563
+ currency_code: string;
2564
+ }
2565
+ interface GetOrganizationPartnersResponse {
2566
+ [key: string]: any;
2567
+ }
2568
+ interface GetOrganizationLimitsByIdResponse {
2569
+ [key: string]: any;
2570
+ }
2571
+ interface GetSystemConfigResponse {
2572
+ [key: string]: any;
2573
+ }
2574
+
2575
+ /**
2576
+ * @category Configuration
2577
+ * @module ConfigManager
2578
+ */
2579
+
2580
+ /**
2581
+ * @category Configuration
2582
+ * @summary Configuration management for Tapsilat SDK
2583
+ * @description Handles SDK configuration updates, validation, and secure access to configuration data
2584
+ * @class ConfigManager
2585
+ */
2586
+ declare class ConfigManager {
2587
+ private config;
2588
+ /**
2589
+ * @summary Creates a new configuration manager
2590
+ * @description Initializes the configuration manager with the provided configuration options
2591
+ *
2592
+ * @param config - Initial SDK configuration
2593
+ */
2594
+ constructor(config: TapsilatConfig);
2595
+ /**
2596
+ * @category Configuration Access
2597
+ * @summary Get current SDK configuration without sensitive information
2598
+ * @description Returns a copy of the current configuration with sensitive data (like bearer token) excluded
2599
+ *
2600
+ * @returns Copy of current configuration without bearer token
2601
+ */
2602
+ getConfig(): Omit<TapsilatConfig, "bearerToken"> & {
2603
+ hasBearerToken: boolean;
2604
+ };
2605
+ /**
2606
+ * @category Configuration Management
2607
+ * @summary Update SDK configuration with new values
2608
+ * @description Updates the SDK configuration with provided values, validating bearer token if changed
2609
+ *
2610
+ * @param newConfig - Partial configuration to update
2611
+ * @throws {TapsilatValidationError} When Bearer token is invalid
2612
+ */
2613
+ updateConfig(newConfig: Partial<TapsilatConfig>): void;
2614
+ /**
2615
+ * @category Internal
2616
+ * @summary Gets the internal configuration for SDK use
2617
+ * @description Returns a full copy of the configuration for internal SDK operations
2618
+ *
2619
+ * @internal
2620
+ * @returns Full configuration including sensitive data
2621
+ */
2622
+ getInternalConfig(): TapsilatConfig;
2623
+ /**
2624
+ * @category Authentication
2625
+ * @summary Gets the bearer token for authentication
2626
+ * @description Retrieves the configured bearer token for API authentication
2627
+ *
2628
+ * @internal
2629
+ * @returns Bearer token
2630
+ */
2631
+ getBearerToken(): string;
2632
+ /**
2633
+ * @category Endpoints
2634
+ * @summary Gets the base URL for API requests
2635
+ * @description Retrieves the configured base URL for API endpoints
2636
+ *
2637
+ * @internal
2638
+ * @returns API base URL
2639
+ */
2640
+ getBaseUrl(): string | undefined;
2641
+ /**
2642
+ * @category Networking
2643
+ * @summary Gets the request timeout value
2644
+ * @description Retrieves the configured timeout value for API requests
2645
+ *
2646
+ * @internal
2647
+ * @returns Request timeout in milliseconds
2648
+ */
2649
+ getTimeout(): number | undefined;
2650
+ }
2651
+
2652
+ /**
2653
+ * Request and response types for Tapsilat Elements sessions.
2654
+ *
2655
+ * Tapsilat Elements is the native Android and iOS card sheet. Your backend creates a session with
2656
+ * its secret API key and hands only the session's `client_secret` to the app, which opens the sheet
2657
+ * with it. Card data goes from the sheet to Tapsilat encrypted and never reaches your backend.
2658
+ *
2659
+ * Field names match the JSON wire format. Response fields are optional because the server omits
2660
+ * empty values. `purpose`, `status` and `brand` are plain strings so that values added later still
2661
+ * decode; compare them with the constants below.
2662
+ */
2663
+ /**
2664
+ * @category Elements
2665
+ * @summary Purposes of an Elements session
2666
+ */
2667
+ declare const ElementsSessionPurpose: Readonly<{
2668
+ /** Save a card for a user without charging it */
2669
+ readonly TOKENIZE: "tokenize";
2670
+ /** Pay an existing order */
2671
+ readonly PAY: "pay";
2672
+ }>;
2673
+ /**
2674
+ * @category Elements
2675
+ * @summary Statuses of an Elements session
2676
+ */
2677
+ declare const ElementsSessionStatus: Readonly<{
2678
+ readonly REQUIRES_PAYMENT_METHOD: "requires_payment_method";
2679
+ readonly PROCESSING: "processing";
2680
+ readonly REQUIRES_ACTION: "requires_action";
2681
+ readonly SUCCEEDED: "succeeded";
2682
+ readonly FAILED: "failed";
2683
+ readonly EXPIRED: "expired";
2684
+ readonly CANCELED: "canceled";
2685
+ }>;
2686
+ /**
2687
+ * @category Elements
2688
+ * @summary Tokenize modes of an Elements session
2689
+ */
2690
+ declare const ElementsTokenizeMode: Readonly<{
2691
+ /** 3D Secure */
2692
+ readonly SECURE: 1;
2693
+ readonly HALF_SECURE: 2;
2694
+ readonly NON_SECURE: 3;
2695
+ }>;
2696
+ /**
2697
+ * @category Elements
2698
+ * @summary Card brands an Elements session reports
2699
+ */
2700
+ declare const ElementsCardBrand: Readonly<{
2701
+ readonly VISA: "visa";
2702
+ readonly MASTERCARD: "mastercard";
2703
+ readonly AMEX: "amex";
2704
+ readonly TROY: "troy";
2705
+ readonly DISCOVER: "discover";
2706
+ readonly UNIONPAY: "unionpay";
2707
+ readonly UNKNOWN: "unknown";
2708
+ }>;
2709
+ /**
2710
+ * @category Elements
2711
+ * @summary Request to create an Elements session
2712
+ * @description Sent to POST /elements/sessions. Optional fields that are undefined or null are left out of the body.
2713
+ * @interface ElementsSessionCreateRequest
2714
+ */
2715
+ interface ElementsSessionCreateRequest {
2716
+ /** `ElementsSessionPurpose.PAY` or `ElementsSessionPurpose.TOKENIZE` */
2717
+ purpose: string;
2718
+ /** The order to pay; required for a `pay` session */
2719
+ order_reference_id?: string;
2720
+ /** The card owner for a `tokenize` session, scoped to your organization */
2721
+ user_id?: string;
2722
+ user_email?: string;
2723
+ /** Tokenize mode: `ElementsTokenizeMode.SECURE` (3D Secure), `HALF_SECURE` or `NON_SECURE` */
2724
+ mode?: number;
2725
+ /** Lets the buyer save the card on a `pay` session */
2726
+ save_card?: boolean;
2727
+ }
2728
+ /**
2729
+ * @category Elements
2730
+ * @summary The card an Elements session used
2731
+ * @interface ElementsCardSummary
2732
+ */
2733
+ interface ElementsCardSummary {
2734
+ id?: string;
2735
+ /** One of `ElementsCardBrand`, such as "visa" */
2736
+ brand?: string;
2737
+ last4?: string;
2738
+ exp_month?: number;
2739
+ exp_year?: number;
2740
+ }
2741
+ /**
2742
+ * @category Elements
2743
+ * @summary The error of an Elements session's last failed attempt
2744
+ * @interface ElementsSessionError
2745
+ */
2746
+ interface ElementsSessionError {
2747
+ /** Stable error code, such as "card_declined" */
2748
+ code?: string;
2749
+ message?: string;
2750
+ retryable?: boolean;
2751
+ }
2752
+ /**
2753
+ * @category Elements
2754
+ * @summary The authoritative state of an Elements session
2755
+ * @description
2756
+ * Returned by GET /elements/sessions/{id} and POST /elements/sessions/{id}/cancel. Read it on your
2757
+ * backend before fulfilling an order, rather than trusting what the app reports. Timestamps are
2758
+ * RFC 3339 strings.
2759
+ * @interface ElementsSession
2760
+ */
2761
+ interface ElementsSession {
2762
+ /** Session ID, such as "es_test_8Kq2nV0rX4" */
2763
+ id?: string;
2764
+ /** One of `ElementsSessionPurpose` */
2765
+ purpose?: string;
2766
+ /** One of `ElementsSessionStatus` */
2767
+ status?: string;
2768
+ order_reference_id?: string;
2769
+ user_id?: string;
2770
+ attempts?: number;
2771
+ max_attempts?: number;
2772
+ created_at?: string;
2773
+ expires_at?: string;
2774
+ completed_at?: string;
2775
+ /** The card used, once one was entered; absent or null before that */
2776
+ card?: ElementsCardSummary | null;
2777
+ /** The error of the last failed attempt; absent or null when there was none */
2778
+ last_error?: ElementsSessionError | null;
2779
+ }
2780
+ /**
2781
+ * @category Elements
2782
+ * @summary A newly created Elements session with its client secret
2783
+ * @description
2784
+ * Returned only by POST /elements/sessions. Hand `client_secret` to the app that opens the card
2785
+ * sheet, and do not log or store it. In Node.js, `console.log` and `util.inspect` print it as
2786
+ * `[redacted]`; `JSON.stringify` keeps it, so you can still send it to the app.
2787
+ * @interface ElementsSessionCreateResponse
2788
+ */
2789
+ interface ElementsSessionCreateResponse extends ElementsSession {
2790
+ /** The secret the app opens the card sheet with */
2791
+ client_secret: string;
2792
+ /** The base URL the app's card sheet talks to */
2793
+ elements_base_url?: string;
2794
+ }
2795
+
2796
+ /**
2797
+ * @category HTTP
2798
+ * @module Interceptors
2799
+ */
2800
+
2801
+ /**
2802
+ * @category Interceptors
2803
+ * @summary Function type for modifying HTTP requests before they are sent
2804
+ * @description Allows preprocessing of URL and request options before the API call is made
2805
+ * @typedef {Function} RequestInterceptor
2806
+ */
2807
+ type RequestInterceptor = (url: string, options: RequestInit) => Promise<{
2808
+ url: string;
2809
+ options: RequestInit;
2810
+ }> | {
2811
+ url: string;
2812
+ options: RequestInit;
2813
+ };
2814
+ /**
2815
+ * @category Interceptors
2816
+ * @summary Function type for processing HTTP responses before returning to caller
2817
+ * @description Allows transformation and analysis of API responses after receiving them but before they reach the calling code
2818
+ * @typedef {Function} ResponseInterceptor
2819
+ */
2820
+ type ResponseInterceptor = (response: APIResponse<unknown>, request: {
2821
+ url: string;
2822
+ options: RequestInit;
2823
+ }) => Promise<APIResponse<unknown>> | APIResponse<unknown>;
2824
+ /**
2825
+ * @category Interceptors
2826
+ * @summary Function type for handling errors that occur during HTTP requests
2827
+ * @description Provides opportunity to recover from errors, transform them, or perform logging operations before they propagate
2828
+ * @typedef {Function} ErrorInterceptor
2829
+ */
2830
+ type ErrorInterceptor = (error: Error, request: {
2831
+ url: string;
2832
+ options: RequestInit;
2833
+ }) => Promise<never | APIResponse<unknown>> | never | APIResponse<unknown>;
2834
+ /**
2835
+ * @category HTTP
2836
+ * @summary Central registry and execution engine for all HTTP interceptors
2837
+ * @description Maintains lists of request, response and error interceptors and provides methods to execute them in sequence
2838
+ * @class InterceptorManager
2839
+ */
2840
+ declare class InterceptorManager {
2841
+ private requestInterceptors;
2842
+ private responseInterceptors;
2843
+ private errorInterceptors;
2844
+ /**
2845
+ * Adds a request interceptor to the chain
2846
+ *
2847
+ * @summary Register a new request interceptor function
2848
+ * @description Adds a new interceptor to process requests before they are sent
2849
+ *
2850
+ * @param interceptor - The request interceptor function to add
2851
+ * @returns The index of the added interceptor (can be used to remove it later)
2852
+ */
2853
+ addRequestInterceptor(interceptor: RequestInterceptor): number;
2854
+ /**
2855
+ * Removes a previously added request interceptor
2856
+ *
2857
+ * @summary Unregister a request interceptor by its ID
2858
+ * @description Removes the request interceptor at the specified position
2859
+ *
2860
+ * @param id - The index of the interceptor to remove
2861
+ */
2862
+ removeRequestInterceptor(id: number): void;
2863
+ /**
2864
+ * Runs all registered request interceptors in sequence
2865
+ *
2866
+ * @summary Process a request through all interceptors
2867
+ * @description Executes each registered request interceptor in order, passing modified url and options to each
2868
+ *
2869
+ * @param url - The initial request URL
2870
+ * @param options - The initial request options
2871
+ * @returns Modified URL and options after all interceptors have processed them
2872
+ */
2873
+ executeRequestInterceptors(url: string, options: RequestInit): Promise<{
2874
+ url: string;
2875
+ options: RequestInit;
2876
+ }>;
2877
+ /**
2878
+ * @summary Register a new response interceptor function
2879
+ * @description Adds a new interceptor to process responses before they are returned to the caller
2880
+ *
2881
+ * @param interceptor - The response interceptor function to add
2882
+ * @returns The index of the added interceptor (can be used to remove it later)
2883
+ */
2884
+ addResponseInterceptor(interceptor: ResponseInterceptor): number;
2885
+ /**
2886
+ * @summary Unregister a response interceptor by its ID
2887
+ * @description Removes the response interceptor at the specified position
2888
+ *
2889
+ * @param id - The index of the interceptor to remove
2890
+ */
2891
+ removeResponseInterceptor(id: number): void;
2892
+ /**
2893
+ * @summary Process a response through all interceptors
2894
+ * @description Executes each registered response interceptor in order
2895
+ *
2896
+ * @param response - The API response to process
2897
+ * @param request - The original request information
2898
+ * @returns Modified response after all interceptors have processed it
2899
+ */
2900
+ executeResponseInterceptors<T>(response: APIResponse<T>, request: {
2901
+ url: string;
2902
+ options: RequestInit;
2903
+ }): Promise<APIResponse<T>>;
2904
+ /**
2905
+ * @summary Register a new error interceptor function
2906
+ * @description Adds a new interceptor to process errors before they are thrown
2907
+ *
2908
+ * @param interceptor - The error interceptor function to add
2909
+ * @returns The index of the added interceptor (can be used to remove it later)
2910
+ */
2911
+ addErrorInterceptor(interceptor: ErrorInterceptor): number;
2912
+ /**
2913
+ * @summary Unregister an error interceptor by its ID
2914
+ * @description Removes the error interceptor at the specified position
2915
+ *
2916
+ * @param id - The index of the interceptor to remove
2917
+ */
2918
+ removeErrorInterceptor(id: number): void;
2919
+ /**
2920
+ * @summary Process an error through all interceptors
2921
+ * @description Executes each registered error interceptor in order until one handles the error
2922
+ *
2923
+ * @param error - The error that occurred during the request
2924
+ * @param request - The original request information
2925
+ * @returns Either a recovery response or throws the error if no interceptors handle it
2926
+ */
2927
+ executeErrorInterceptors(error: Error, request: {
2928
+ url: string;
2929
+ options: RequestInit;
2930
+ }): Promise<never | APIResponse<unknown>>;
2931
+ /**
2932
+ * @summary Remove all registered interceptors
2933
+ * @description Clears all request, response, and error interceptors at once
2934
+ */
2935
+ clear(): void;
1694
2936
  }
1695
2937
 
1696
2938
  /**
1697
- * @category Configuration
1698
- * @module ConfigManager
2939
+ * @category HTTP
2940
+ * @module HttpClient
1699
2941
  */
1700
2942
 
1701
2943
  /**
1702
- * @category Configuration
1703
- * @summary Configuration management for Tapsilat SDK
1704
- * @description Handles SDK configuration updates, validation, and secure access to configuration data
1705
- * @class ConfigManager
2944
+ * @category HTTP
2945
+ * @summary Configuration options for individual HTTP requests
2946
+ * @description Extends RequestInit with additional Tapsilat-specific options for HTTP requests
2947
+ * @interface RequestConfig
1706
2948
  */
1707
- declare class ConfigManager {
1708
- private config;
2949
+ interface RequestConfig extends Omit<RequestInit, "method" | "body"> {
2950
+ timeout?: number;
2951
+ retries?: number;
2952
+ baseURL?: string;
2953
+ maxRetries?: number;
2954
+ params?: Record<string, unknown>;
2955
+ responseType?: "json" | "text" | "blob" | "arraybuffer";
2956
+ }
2957
+ /**
2958
+ * @category HTTP
2959
+ * @summary Generic constraint for request body types
2960
+ * @description Types that can be sent as HTTP request bodies
2961
+ * @typedef {object|array|string|FormData} RequestBody
2962
+ */
2963
+ type RequestBody = Record<string, unknown> | Record<string, unknown> | object | unknown[] | string | FormData;
2964
+ /**
2965
+ * @category HTTP
2966
+ * @summary HTTP Client for making API requests to Tapsilat services
2967
+ * @description Provides a robust client with comprehensive error handling,
2968
+ * retry logic, and request/response interceptors for interacting with the Tapsilat API
2969
+ *
2970
+ * @example
2971
+ * ```typescript
2972
+ * const client = new HttpClient({
2973
+ * apiKey: 'your-api-key',
2974
+ * baseURL: 'https://api.example.com/v1'
2975
+ * });
2976
+ *
2977
+ * const data = await client.get<UserResponse>('/users/123');
2978
+ * ```
2979
+ * @class HttpClient
2980
+ */
2981
+ declare class HttpClient {
2982
+ private readonly config;
2983
+ private readonly interceptors;
1709
2984
  /**
1710
- * @summary Creates a new configuration manager
1711
- * @description Initializes the configuration manager with the provided configuration options
2985
+ * @summary Creates a new HTTP client instance
2986
+ * @description Initializes the HTTP client with the provided configuration
1712
2987
  *
1713
- * @param config - Initial SDK configuration
2988
+ * @param config - The configuration for the Tapsilat API client
1714
2989
  */
1715
2990
  constructor(config: TapsilatConfig);
1716
2991
  /**
1717
- * @category Configuration Access
1718
- * @summary Get current SDK configuration without sensitive information
1719
- * @description Returns a copy of the current configuration with sensitive data (like bearer token) excluded
2992
+ * @summary Performs GET requests to the API
2993
+ * @description Makes HTTP GET requests to retrieve data from the API
2994
+ */
2995
+ get<T = unknown>(url: string): Promise<APIResponse<T>>;
2996
+ get<T = unknown>(url: string, config: RequestConfig): Promise<APIResponse<T>>;
2997
+ /**
2998
+ * @summary Performs POST requests to the API
2999
+ * @description Makes HTTP POST requests to send data to the API
3000
+ */
3001
+ post<T = unknown>(url: string): Promise<APIResponse<T>>;
3002
+ post<T = unknown>(url: string, body: RequestBody): Promise<APIResponse<T>>;
3003
+ post<T = unknown>(url: string, body: RequestBody | undefined, config: RequestConfig): Promise<APIResponse<T>>;
3004
+ /**
3005
+ * @summary Performs PUT requests to the API
3006
+ * @description Makes HTTP PUT requests to update entire resources in the API
3007
+ */
3008
+ put<T = unknown>(url: string): Promise<APIResponse<T>>;
3009
+ put<T = unknown>(url: string, body: RequestBody): Promise<APIResponse<T>>;
3010
+ put<T = unknown>(url: string, body: RequestBody, config: RequestConfig): Promise<APIResponse<T>>;
3011
+ /**
3012
+ * @summary Performs PATCH requests to the API
3013
+ * @description Makes HTTP PATCH requests to update parts of resources in the API
3014
+ */
3015
+ patch<T = unknown>(url: string): Promise<APIResponse<T>>;
3016
+ patch<T = unknown>(url: string, body: RequestBody): Promise<APIResponse<T>>;
3017
+ patch<T = unknown>(url: string, body: RequestBody, config: RequestConfig): Promise<APIResponse<T>>;
3018
+ /**
3019
+ * @summary Performs DELETE requests to the API
3020
+ * @description Makes HTTP DELETE requests to remove resources from the API
3021
+ */
3022
+ delete<T = unknown>(url: string): Promise<APIResponse<T>>;
3023
+ delete<T = unknown>(url: string, config: RequestConfig): Promise<APIResponse<T>>;
3024
+ delete<T = unknown>(url: string, body: RequestBody, config?: RequestConfig): Promise<APIResponse<T>>;
3025
+ private isRequestConfig;
3026
+ /**
3027
+ * @category HTTP Client
3028
+ * @summary Core request method with comprehensive error handling and retry logic
3029
+ * @description Handles all HTTP requests with error handling, retries, and interceptors
1720
3030
  *
1721
- * @returns Copy of current configuration without bearer token
3031
+ * @param method - HTTP method to use
3032
+ * @param url - Request URL (relative to baseURL)
3033
+ * @param body - Request body data
3034
+ * @param config - Additional request configuration
3035
+ * @returns Promise resolving to API response
1722
3036
  */
1723
- getConfig(): Omit<TapsilatConfig, "bearerToken"> & {
1724
- hasBearerToken: boolean;
1725
- };
3037
+ private request;
1726
3038
  /**
1727
- * @category Configuration Management
1728
- * @summary Update SDK configuration with new values
1729
- * @description Updates the SDK configuration with provided values, validating bearer token if changed
3039
+ * @category HTTP Client Internals
3040
+ * @summary Makes the actual HTTP request with timeout handling
3041
+ * @description Performs the fetch request with timeout handling and abort controller
1730
3042
  *
1731
- * @param newConfig - Partial configuration to update
1732
- * @throws {TapsilatValidationError} When Bearer token is invalid
3043
+ * @param url - Full URL to request
3044
+ * @param options - Fetch request options
3045
+ * @param timeout - Optional timeout in milliseconds
3046
+ * @returns Promise resolving to API response
1733
3047
  */
1734
- updateConfig(newConfig: Partial<TapsilatConfig>): void;
3048
+ private makeRequest;
1735
3049
  /**
1736
- * @category Internal
1737
- * @summary Gets the internal configuration for SDK use
1738
- * @description Returns a full copy of the configuration for internal SDK operations
3050
+ * @category HTTP Client Internals
3051
+ * @summary Processes the fetch response and converts to APIResponse format
3052
+ * @description Parses the response and formats it according to the APIResponse interface
1739
3053
  *
1740
- * @internal
1741
- * @returns Full configuration including sensitive data
3054
+ * @param response - The raw fetch Response object
3055
+ * @returns Processed API response
1742
3056
  */
1743
- getInternalConfig(): TapsilatConfig;
3057
+ private processResponse;
1744
3058
  /**
1745
- * @category Authentication
1746
- * @summary Gets the bearer token for authentication
1747
- * @description Retrieves the configured bearer token for API authentication
3059
+ * @category HTTP Client Internals
3060
+ * @summary Creates appropriate error based on response status and data
3061
+ * @description Maps HTTP status codes to specific Tapsilat error types
1748
3062
  *
1749
- * @internal
1750
- * @returns Bearer token
3063
+ * @param response - The raw fetch Response object
3064
+ * @param data - The parsed response data
3065
+ * @returns Appropriate TapsilatError subclass instance
1751
3066
  */
1752
- getBearerToken(): string;
3067
+ private createErrorFromResponse;
1753
3068
  /**
1754
- * @category Endpoints
1755
- * @summary Gets the base URL for API requests
1756
- * @description Retrieves the configured base URL for API endpoints
3069
+ * @category HTTP Client Internals
3070
+ * @summary Extracts error message from response data
3071
+ * @description Attempts to find an error message in various locations within the response
1757
3072
  *
1758
- * @internal
1759
- * @returns API base URL
3073
+ * @param data - The parsed response data
3074
+ * @returns Error message if found
1760
3075
  */
1761
- getBaseUrl(): string | undefined;
3076
+ private extractErrorMessage;
1762
3077
  /**
1763
- * @category Networking
1764
- * @summary Gets the request timeout value
1765
- * @description Retrieves the configured timeout value for API requests
3078
+ * @category HTTP Client Internals
3079
+ * @summary Returns the error object of a nested error body
3080
+ * @description Elements routes answer with {"error": {"code", "message", "retryable"}} instead of top-level fields
1766
3081
  *
1767
- * @internal
1768
- * @returns Request timeout in milliseconds
3082
+ * @param data - The parsed response data
3083
+ * @returns The nested error object, or undefined when `error` is not an object
1769
3084
  */
1770
- getTimeout(): number | undefined;
3085
+ private nestedError;
3086
+ /**
3087
+ * @category HTTP Client Internals
3088
+ * @summary Extracts validation details from error response
3089
+ * @description Parses field-specific validation errors from the API response
3090
+ *
3091
+ * @param data - The parsed response data
3092
+ * @returns Object mapping field names to error messages
3093
+ */
3094
+ private extractValidationDetails;
3095
+ /**
3096
+ * @category HTTP Client Internals
3097
+ * @summary Extracts rate limit information from response headers
3098
+ * @description Reads and parses rate limiting headers from the API response
3099
+ *
3100
+ * @param response - The raw fetch Response object
3101
+ * @returns Rate limit information including limits and reset time
3102
+ */
3103
+ private extractRateLimitInfo;
3104
+ /**
3105
+ * @category HTTP Client Internals
3106
+ * @summary Builds the complete URL for the request
3107
+ * @description Constructs the full URL with base URL and query parameters
3108
+ *
3109
+ * @param url - The endpoint path or full URL
3110
+ * @param customBaseURL - Optional override for the base URL
3111
+ * @param params - Optional query parameters
3112
+ * @returns Complete request URL
3113
+ */
3114
+ /**
3115
+ * @category HTTP Client
3116
+ * @summary Returns the configured base URL for another API version
3117
+ * @description Replaces a trailing `/api/vN` path segment with `/api/{version}`, or appends `/api/{version}`
3118
+ *
3119
+ * @param version - API version such as "v2"
3120
+ * @returns Base URL for that API version
3121
+ */
3122
+ versionedBaseURL(version: string): string;
3123
+ private buildUrl;
3124
+ /**
3125
+ * @category HTTP Client Internals
3126
+ * @summary Builds RequestInit options for the fetch request
3127
+ * @description Prepares headers and request configuration for fetch API
3128
+ *
3129
+ * @param method - The HTTP method to use
3130
+ * @param body - Optional request body
3131
+ * @param config - Additional request configuration
3132
+ * @returns Configured RequestInit object for fetch
3133
+ */
3134
+ private buildRequestOptions;
3135
+ /**
3136
+ * @category HTTP Client Internals
3137
+ * @summary Determines if an error should prevent retrying
3138
+ * @description Checks error types to decide if retry attempts should be aborted
3139
+ *
3140
+ * @param error - The error that occurred
3141
+ * @returns Whether retry should be prevented for this error
3142
+ */
3143
+ private shouldNotRetry;
3144
+ /**
3145
+ * @category HTTP Client Internals
3146
+ * @summary Calculates retry delay with exponential backoff
3147
+ * @description Implements exponential backoff with jitter for retry attempts
3148
+ *
3149
+ * @param attempt - The current retry attempt number (0-indexed)
3150
+ * @returns Delay in milliseconds before next retry
3151
+ */
3152
+ private calculateRetryDelay;
3153
+ /**
3154
+ * @category HTTP Client Internals
3155
+ * @summary Utility method to create delay
3156
+ * @description Creates a promise that resolves after the specified time
3157
+ *
3158
+ * @param ms - Delay time in milliseconds
3159
+ * @returns Promise that resolves after the delay
3160
+ */
3161
+ private delay;
3162
+ /**
3163
+ * @category Interceptors
3164
+ * @summary Gets the interceptor manager for advanced request/response handling
3165
+ * @description Provides access to the internal interceptor manager for custom handling
3166
+ *
3167
+ * @returns InterceptorManager instance
3168
+ */
3169
+ getInterceptors(): InterceptorManager;
3170
+ /**
3171
+ * @category Interceptors
3172
+ * @summary Adds a request interceptor
3173
+ * @description Registers a function to intercept and modify requests before they are sent
3174
+ *
3175
+ * @param interceptor - Request interceptor function
3176
+ * @returns Interceptor ID for removal
3177
+ */
3178
+ addRequestInterceptor(interceptor: Parameters<InterceptorManager["addRequestInterceptor"]>[0]): number;
3179
+ /**
3180
+ * @category Interceptors
3181
+ * @summary Adds a response interceptor
3182
+ * @description Registers a function to intercept and modify responses before they are returned
3183
+ *
3184
+ * @param interceptor - Response interceptor function
3185
+ * @returns Interceptor ID for removal
3186
+ */
3187
+ addResponseInterceptor(interceptor: Parameters<InterceptorManager["addResponseInterceptor"]>[0]): number;
3188
+ /**
3189
+ * @category Interceptors
3190
+ * @summary Adds an error interceptor
3191
+ * @description Registers a function to intercept and potentially recover from errors
3192
+ *
3193
+ * @param interceptor - Error interceptor function
3194
+ * @returns Interceptor ID for removal
3195
+ */
3196
+ addErrorInterceptor(interceptor: Parameters<InterceptorManager["addErrorInterceptor"]>[0]): number;
3197
+ }
3198
+
3199
+ /**
3200
+ * Shared request handling for the SDK's grouped services
3201
+ *
3202
+ * @summary Base class for API service groups
3203
+ * @description Unwraps responses, converts failures to TapsilatError and builds version 2 request configs.
3204
+ */
3205
+ declare abstract class ServiceBase {
3206
+ protected readonly httpClient: HttpClient;
3207
+ constructor(httpClient: HttpClient);
3208
+ /** Runs a request and returns its data, throwing on failure or an empty body */
3209
+ protected request<T>(context: string, call: () => Promise<APIResponse<T>>): Promise<T>;
3210
+ /** Runs a request whose successful response may have an empty body */
3211
+ protected requestOptional<T>(context: string, call: () => Promise<APIResponse<T>>): Promise<T | undefined>;
3212
+ /** Request config for version 2 routes, derived from the configured base URL */
3213
+ protected v2(config?: RequestConfig): RequestConfig;
3214
+ /** Throws when a required identifier is missing and returns it URL-encoded */
3215
+ protected id(value: string, name: string): string;
3216
+ }
3217
+
3218
+ /**
3219
+ * Submerchant management
3220
+ *
3221
+ * @summary Create, read, update and delete submerchants
3222
+ * @description Covers the version 1 submerchant routes, item payout events and marketplace seller creation.
3223
+ * Currency fields accept a currency UUID or an organization unit such as "TRY".
3224
+ */
3225
+ declare class SubmerchantService extends ServiceBase {
3226
+ /** Creates a submerchant; the response carries only code and message */
3227
+ createSubmerchant(request: SubmerchantCreateRequest): Promise<SubmerchantMutationResponse>;
3228
+ getSubmerchant(id: string): Promise<Submerchant>;
3229
+ /** Lists submerchants; rows are returned under `row` */
3230
+ listSubmerchants(page?: number, perPage?: number): Promise<SubmerchantListResponse>;
3231
+ /** Replaces the submerchant profile; send every field */
3232
+ updateSubmerchant(id: string, request: SubmerchantUpdateRequest): Promise<SubmerchantMutationResponse>;
3233
+ deleteSubmerchant(id: string): Promise<SubmerchantMutationResponse>;
3234
+ getSuborganizationBySubmerchant(submerchantId: string): Promise<SubmerchantSuborganizationMapping>;
3235
+ /**
3236
+ * Records an item business event; time gates, approval and settlement remain separate.
3237
+ * Repeating an event with the same idempotency key and payload is safe.
3238
+ */
3239
+ recordSubmerchantPayoutEvent(request: SubmerchantPayoutEventRequest): Promise<SubmerchantPayoutEventResponse>;
3240
+ /**
3241
+ * Creates a logical marketplace seller; inspect `provisionings` for each VPOS account's readiness.
3242
+ * Reuse the same idempotency key and request data when retrying.
3243
+ */
3244
+ createMarketplaceSubmerchant(request: MarketplaceSubmerchantCreateRequest): Promise<MarketplaceSubmerchantCreateResponse>;
3245
+ }
3246
+
3247
+ /**
3248
+ * Virtual POS management
3249
+ *
3250
+ * @summary Manage VPOS configurations, their submerchants and acquirer lookups
3251
+ * @description Updates replace the stored configuration: read the VPOS first and send every field back.
3252
+ */
3253
+ declare class VposService extends ServiceBase {
3254
+ listVpos(params?: VposListParams): Promise<VposListResponse>;
3255
+ /** Creates a VPOS; `currencies` accepts currency UUIDs or units such as "TRY" */
3256
+ createVpos(request: VposCreateRequest): Promise<VposMutationResponse>;
3257
+ getVpos(id: string): Promise<Vpos>;
3258
+ /** Replaces a VPOS configuration; fields left out are stored as empty or false */
3259
+ updateVpos(id: string, request: VposUpdateRequest): Promise<VposMutationResponse>;
3260
+ deleteVpos(id: string): Promise<VposMutationResponse>;
3261
+ listVposAcquirers(): Promise<VposAcquirerListResponse>;
3262
+ listCardSchemes(): Promise<CardSchemeListResponse>;
3263
+ listVposAcquirerTemplates(): Promise<VposAcquirerTemplateListResponse>;
3264
+ listVposSubmerchants(params?: VposSubmerchantListParams): Promise<VposSubmerchantListResponse>;
3265
+ createVposSubmerchant(request: VposSubmerchantCreateRequest): Promise<VposSubmerchantMutationResponse>;
3266
+ getVposSubmerchant(id: string): Promise<VposSubmerchant>;
3267
+ updateVposSubmerchant(id: string, request: VposSubmerchantUpdateRequest): Promise<VposSubmerchantMutationResponse>;
3268
+ deleteVposSubmerchant(id: string): Promise<VposSubmerchantMutationResponse>;
3269
+ }
3270
+
3271
+ /**
3272
+ * Card tokenization
3273
+ *
3274
+ * @summary Tokenize, list and delete saved cards
3275
+ */
3276
+ declare class TokenizationService extends ServiceBase {
3277
+ /** Tokenizes a card; returns 3D secure form details when verification is required */
3278
+ tokenizeCard(request: CardTokenizeRequest): Promise<CardTokenizeResponse>;
3279
+ listSavedCards(page?: number, perPage?: number): Promise<ListSavedCardsResponse>;
3280
+ deleteSavedCard(id: string): Promise<DeleteSavedCardResponse>;
3281
+ }
3282
+
3283
+ /**
3284
+ * Resolves organization currency units such as "TRY" to currency UUIDs
3285
+ *
3286
+ * @summary Cached lookup of organization currency IDs by unit
3287
+ * @description Most endpoints accept currency units directly. Use this where the server requires a UUID,
3288
+ * such as marketplace approval policies. The lookup is cached until invalidate() is called.
3289
+ */
3290
+ declare class CurrencyResolver {
3291
+ private readonly httpClient;
3292
+ private idsByUnit?;
3293
+ constructor(httpClient: HttpClient);
3294
+ /**
3295
+ * Returns the currency UUID for ref; a UUID is returned unchanged
3296
+ *
3297
+ * @param ref - Currency UUID or organization currency unit
3298
+ * @throws {TapsilatValidationError} When ref is empty or not one of the organization's currencies
3299
+ */
3300
+ resolve(ref: string): Promise<string>;
3301
+ /** Clears the cached currencies, for example after creating a currency */
3302
+ invalidate(): void;
3303
+ private load;
3304
+ private fetch;
3305
+ }
3306
+
3307
+ /**
3308
+ * Marketplace API (version 2)
3309
+ *
3310
+ * @summary Manage marketplace sellers, payouts, policies and payout operations
3311
+ * @description All calls use the version 2 routes derived from the configured base URL and are scoped to the
3312
+ * API token's organization. Revisions are opaque strings: send them back exactly as received.
3313
+ */
3314
+ declare class MarketplaceService extends ServiceBase {
3315
+ private readonly currencies;
3316
+ constructor(httpClient: HttpClient, currencies: CurrencyResolver);
3317
+ /** Lists sellers; `external_id` selects an exact external ID match */
3318
+ listMarketplaceSubmerchants(params?: MarketplaceSellerListParams): Promise<MarketplaceSellerList>;
3319
+ /** Returns the seller profile and its current revision */
3320
+ getMarketplaceSubmerchant(id: string): Promise<MarketplaceSeller>;
3321
+ /** Replaces the seller profile at its revision; inspect `approval_required` */
3322
+ updateMarketplaceSubmerchant(id: string, input: MarketplaceProfileUpdate): Promise<MarketplaceProfileUpdateResponse>;
3323
+ /** Returns the selected accounts' requirements for a seller operation */
3324
+ getMarketplaceSellerContracts(filter: MarketplaceContractFilter): Promise<MarketplaceContracts>;
3325
+ /** Returns account registration, synchronization and available actions */
3326
+ getMarketplaceSellerAccounts(id: string): Promise<MarketplaceSellerAccounts>;
3327
+ /** Runs an action listed on the account at its revision and environment; inspect the returned status */
3328
+ runMarketplaceSellerAccountAction(id: string, vposId: string, action: MarketplaceAccountAction): Promise<MarketplaceSubmerchantProvisioning>;
3329
+ listMarketplacePayouts(filter?: MarketplacePayoutFilter): Promise<MarketplacePayoutList>;
3330
+ /** Returns a payout's eligibility, approval and settlement state */
3331
+ getMarketplacePayout(id: string): Promise<MarketplacePayout>;
3332
+ /**
3333
+ * Submits up to 100 eligible payouts for approval without bypassing release gates.
3334
+ * "accepted" acknowledges approval; poll the payout for settlement.
3335
+ */
3336
+ approveMarketplacePayouts(input: MarketplacePayoutApproval): Promise<MarketplacePayoutAcceptance>;
3337
+ listMarketplaceApprovalPolicies(): Promise<MarketplaceApprovalPolicies>;
3338
+ getMarketplaceApprovalPolicy(id: string): Promise<MarketplaceApprovalPolicy>;
3339
+ /** Creates an approval rule; a currency unit such as "TRY" is resolved to its UUID */
3340
+ createMarketplaceApprovalPolicy(input: MarketplaceApprovalPolicyInput): Promise<void>;
3341
+ /** Replaces an approval rule; a currency unit such as "TRY" is resolved to its UUID */
3342
+ updateMarketplaceApprovalPolicy(id: string, input: MarketplaceApprovalPolicyInput): Promise<void>;
3343
+ deleteMarketplaceApprovalPolicy(id: string): Promise<void>;
3344
+ listMarketplaceReleasePolicies(): Promise<MarketplaceReleasePolicies>;
3345
+ getMarketplaceReleasePolicy(id: string): Promise<MarketplaceReleasePolicy>;
3346
+ createMarketplaceReleasePolicy(input: MarketplaceReleasePolicyInput): Promise<MarketplaceReleasePolicy>;
3347
+ updateMarketplaceReleasePolicy(id: string, input: MarketplaceReleasePolicyInput): Promise<MarketplaceReleasePolicy>;
3348
+ deleteMarketplaceReleasePolicy(id: string): Promise<void>;
3349
+ getMarketplaceApprovalSettings(): Promise<MarketplaceApprovalSettings>;
3350
+ updateMarketplaceApprovalSettings(input: MarketplaceApprovalSettings): Promise<MarketplaceApprovalSettings>;
3351
+ /** Changes a payout allocation or withdraws approval; inspect `status` before treating it as complete */
3352
+ runMarketplacePayoutOperation(payoutId: string, input: MarketplacePayoutOperationInput): Promise<MarketplacePayoutOperation>;
3353
+ /** Returns a persisted payout operation receipt */
3354
+ getMarketplacePayoutOperation(id: string): Promise<MarketplacePayoutOperation>;
3355
+ /** Checks the provider result without repeating the change */
3356
+ reconcileMarketplacePayoutOperation(id: string): Promise<MarketplacePayoutOperation>;
3357
+ /** Repeats an unresolved change only after the previous provider state is verified */
3358
+ retryMarketplacePayoutOperation(id: string): Promise<MarketplacePayoutOperation>;
3359
+ private withResolvedCurrency;
3360
+ }
3361
+
3362
+ /** The header that carries the signature of every callback Tapsilat sends */
3363
+ declare const WEBHOOK_SIGNATURE_HEADER = "Tapsilat-Signature";
3364
+ /** How many seconds a callback's signature timestamp may differ from the current time */
3365
+ declare const WEBHOOK_TOLERANCE = 300;
3366
+ /**
3367
+ * @category Webhooks
3368
+ * @summary Options for webhook signature verification
3369
+ * @interface WebhookVerifyOptions
3370
+ */
3371
+ interface WebhookVerifyOptions {
3372
+ /** Seconds the signature timestamp may differ from `now`; 0 disables the check. Defaults to 300 */
3373
+ tolerance?: number;
3374
+ /** Unix time in seconds to compare the signature timestamp with. Defaults to the current time */
3375
+ now?: number;
1771
3376
  }
1772
3377
 
1773
3378
  /**
@@ -1790,6 +3395,15 @@ declare class ConfigManager {
1790
3395
  declare class TapsilatSDK {
1791
3396
  private readonly httpClient;
1792
3397
  private readonly configManager;
3398
+ private readonly currencyResolver;
3399
+ /** Submerchant management, payout events and marketplace seller creation */
3400
+ readonly submerchants: SubmerchantService;
3401
+ /** VPOS configurations, VPOS submerchants and acquirer lookups */
3402
+ readonly vpos: VposService;
3403
+ /** Card tokenization and saved cards */
3404
+ readonly tokenization: TokenizationService;
3405
+ /** Marketplace sellers, payouts, policies and payout operations (API version 2) */
3406
+ readonly marketplace: MarketplaceService;
1793
3407
  /**
1794
3408
  * Creates a new TapsilatSDK instance
1795
3409
  *
@@ -2116,7 +3730,7 @@ declare class TapsilatSDK {
2116
3730
  * @throws {TapsilatValidationError} When referenceId is invalid
2117
3731
  * @throws {TapsilatError} When API returns an error response
2118
3732
  */
2119
- getOrderTransactions(referenceId: string): Promise<GetOrderTransactionsResponse>;
3733
+ getOrderTransactions(referenceId: string): Promise<OrderTransaction[]>;
2120
3734
  /**
2121
3735
  * Gets order submerchants with pagination.
2122
3736
  * Based on `get_order_submerchants` from the Python SDK.
@@ -2142,18 +3756,27 @@ declare class TapsilatSDK {
2142
3756
  */
2143
3757
  getCheckoutUrl(referenceId: string): Promise<string>;
2144
3758
  /**
2145
- * Verifies webhook signature for security
3759
+ * Verifies the Tapsilat-Signature header of a callback against the organization's webhook secret
3760
+ *
3761
+ * @summary Verify the Tapsilat-Signature header of a callback
3762
+ * @description
3763
+ * Tapsilat sends "t=<unix timestamp>,v1=<hex HMAC-SHA256 of '<timestamp>.<raw body>'>". The timestamp
3764
+ * must be within `options.tolerance` seconds (300 by default; 0 disables the check) of `options.now`
3765
+ * (the current time by default) so that a captured callback cannot be replayed. The comparison takes
3766
+ * constant time.
2146
3767
  *
2147
- * @summary Validate webhook signature for security verification
2148
- * @description Verifies the authenticity of webhook payloads using HMAC signature validation.
3768
+ * A bare hex HMAC-SHA256 of the payload, with or without a "sha256=" prefix, is still accepted for
3769
+ * signatures made the way earlier versions of this SDK documented.
2149
3770
  *
2150
- * @param payload - Raw webhook payload string
2151
- * @param signature - Webhook signature from headers
2152
- * @param secret - Your webhook secret key
2153
- * @returns Promise resolving to true if signature is valid
2154
- * @throws {TapsilatValidationError} When input validation fails for payload, signature or secret
3771
+ * @param payload - The raw request body as a string or Buffer, before any JSON decoding
3772
+ * @param signature - The Tapsilat-Signature header
3773
+ * @param secret - The webhook secret from the panel's callback settings
3774
+ * @param options - Timestamp tolerance in seconds and the current Unix time
3775
+ * @returns Promise resolving to true when the signature is valid, and to false when the header or
3776
+ * secret is empty, or the signature is malformed, stale or wrong
3777
+ * @throws {TapsilatValidationError} When payload is not a string or bytes, or an option is not a number
2155
3778
  */
2156
- verifyWebhook(payload: string, signature: string, secret: string): Promise<boolean>;
3779
+ verifyWebhook(payload: string | Uint8Array, signature: string | null | undefined, secret: string, options?: WebhookVerifyOptions): Promise<boolean>;
2157
3780
  /**
2158
3781
  * Checks API service health and availability
2159
3782
  *
@@ -2200,13 +3823,13 @@ declare class TapsilatSDK {
2200
3823
  * across multiple payments with specific due dates and requirements.
2201
3824
  *
2202
3825
  * @param {OrderPaymentTermCreateDTO} termData - Payment term creation data
2203
- * @param {string} termData.order_id - Reference ID of the existing order
2204
- * @param {string} termData.term_reference_id - Unique identifier for this payment term
3826
+ * @param {string} termData.order_id - ID of the existing order (order_id from order creation, not its reference ID)
3827
+ * @param {string} [termData.term_reference_id] - Unique identifier for this payment term
2205
3828
  * @param {number} termData.amount - Amount for this payment term
2206
- * @param {string} termData.due_date - Due date for this payment (ISO 8601 format)
2207
- * @param {number} termData.term_sequence - Sequence number for this term
3829
+ * @param {string} termData.due_date - Due date for this payment (YYYY-MM-DD)
3830
+ * @param {number} [termData.term_sequence] - Sequence number for this term
2208
3831
  * @param {boolean} termData.required - Whether this payment term is required
2209
- * @param {string} termData.status - Initial status of the payment term
3832
+ * @param {string} [termData.status] - Initial status of the payment term
2210
3833
  * @param {string} [termData.data] - Additional metadata for the term
2211
3834
  * @param {string} [termData.paid_date] - Date when payment was completed
2212
3835
  *
@@ -2247,6 +3870,7 @@ declare class TapsilatSDK {
2247
3870
  * Only unpaid payment terms can be deleted.
2248
3871
  *
2249
3872
  * @param {PaymentTermDeleteRequest} deleteData - Payment term deletion data
3873
+ * @param {string} deleteData.order_id - ID of the order (not its reference ID)
2250
3874
  * @param {string} deleteData.term_reference_id - Reference ID of the term to delete
2251
3875
  *
2252
3876
  * @returns {Promise<PaymentTermResponse>} Promise resolving to deleted payment term details
@@ -2265,7 +3889,7 @@ declare class TapsilatSDK {
2265
3889
  * @param {OrderTermRefundRequest} refundData - Payment term refund data
2266
3890
  * @param {string} refundData.term_id - ID of the term to refund
2267
3891
  * @param {number} refundData.amount - Amount to refund
2268
- * @param {string} [refundData.reference_id] - Optional reference ID
3892
+ * @param {string} refundData.reference_id - Reference ID of the order
2269
3893
  * @param {string} [refundData.term_payment_id] - Optional term payment ID
2270
3894
  *
2271
3895
  * @returns {Promise<PaymentTermRefundResponse>} Promise resolving to refund details
@@ -2288,6 +3912,8 @@ declare class TapsilatSDK {
2288
3912
  * @returns {Promise<PaymentTermResponse>} Promise resolving to terminated term details
2289
3913
  * @throws {TapsilatValidationError} When input validation fails
2290
3914
  * @throws {TapsilatError} When API returns an error response
3915
+ * @deprecated The API has no payment term termination route, so this call always fails.
3916
+ * Use deleteOrderTerm to remove a term or terminateOrder to end the whole order.
2291
3917
  */
2292
3918
  terminateOrderTerm(terminateData: PaymentTermTerminateRequest): Promise<PaymentTermResponse>;
2293
3919
  /**
@@ -2357,18 +3983,24 @@ declare class TapsilatSDK {
2357
3983
  getOrganizationSuborganizationSubmerchants(id: string): Promise<GetSuborganizationSubmerchantsResponse>;
2358
3984
  /**
2359
3985
  * Retrieve limit information for a specific organization user
3986
+ * @deprecated The API has no organization user limit route, so this call always fails.
2360
3987
  */
2361
3988
  getOrganizationLimitUser(request: GetUserLimitRequest): Promise<GetUserLimitResponse>;
2362
3989
  /**
2363
3990
  * Set limit for a specific organization user
3991
+ * @deprecated The API has no organization user limit route, so this call always fails.
2364
3992
  */
2365
3993
  setOrganizationLimitUser(request: SetLimitUserRequest): Promise<SetLimitUserResponse>;
2366
3994
  /**
2367
- * Retrieve organization overall limits
3995
+ * Retrieve an organization's limits
3996
+ * @deprecated The API has no `/organization/limits` route, so this call always fails.
3997
+ * Use getOrganizationLimitsById.
2368
3998
  */
2369
3999
  getOrganizationLimits(): Promise<GetOrganizationLimitsResponse>;
2370
4000
  /**
2371
- * Retrieve meta information for the organization
4001
+ * Retrieve an organization meta value by name
4002
+ *
4003
+ * @param name - Name of the meta value
2372
4004
  */
2373
4005
  getOrganizationMeta(name: string): Promise<GetMetaResponse>;
2374
4006
  /**
@@ -2376,7 +4008,7 @@ declare class TapsilatSDK {
2376
4008
  */
2377
4009
  getOrganizationScopes(): Promise<GetOrganizationScopesResponse>;
2378
4010
  /**
2379
- * Retrieve list of sub-organizations
4011
+ * Retrieve a page of sub-organizations
2380
4012
  */
2381
4013
  getOrganizationSuborganizations(params?: GetSuborganizationsRequest): Promise<GetSubOrganizationListResponse>;
2382
4014
  /**
@@ -2395,22 +4027,100 @@ declare class TapsilatSDK {
2395
4027
  * List virtual POS terminals for the organization
2396
4028
  */
2397
4029
  listOrganizationVpos(request: GetVposRequest): Promise<GetVposResponse>;
4030
+ /**
4031
+ * Lists the payments made against an order with commission totals
4032
+ *
4033
+ * @param request - Identify the order by order_id, order_reference_id or conversation_id
4034
+ */
4035
+ getOrderPayments(request: GetOrderPaymentsRequest): Promise<GetOrderPaymentsResponse>;
4036
+ /**
4037
+ * Charges an order; inspect isSuccess, since the request can succeed while the charge fails
4038
+ */
4039
+ chargeOrder(request: OrderChargeRequest): Promise<OrderChargeResponse>;
4040
+ /**
4041
+ * Returns an order's payment details looked up by its conversation ID
4042
+ */
4043
+ getOrderPaymentDetailsByConversationId(conversationId: string): Promise<OrderPaymentDetail[]>;
4044
+ /**
4045
+ * Submits the stored item payout to the approval workflow
4046
+ * @deprecated Use marketplace.approveMarketplacePayouts with explicit payout IDs.
4047
+ */
4048
+ approveSubmerchantPayment(request: SubmerchantPaymentAction): Promise<SubmerchantPaymentActionResponse>;
4049
+ /**
4050
+ * Withdraws a stored payout's approval; inspect status and keep operation_id
4051
+ */
4052
+ disapproveSubmerchantPayment(request: SubmerchantPaymentAction): Promise<SubmerchantPaymentActionResponse>;
4053
+ /**
4054
+ * Changes a stored payout allocation; inspect status and keep operation_id
4055
+ */
4056
+ updateSubmerchantPaymentItem(request: SubmerchantPaymentItemUpdate): Promise<SubmerchantPaymentItemUpdateResponse>;
4057
+ /**
4058
+ * Returns installment options and commission rates for a card BIN and amount
4059
+ */
4060
+ getCardInstallments(request: CardInstallmentsRequest): Promise<CardInstallmentsResponse>;
4061
+ /**
4062
+ * Returns installment options grouped by bank card program, with an interest-free flag per row
4063
+ */
4064
+ getInstallmentTable(request: InstallmentTableRequest): Promise<InstallmentTableResponse>;
4065
+ /**
4066
+ * Creates a Tapsilat Elements session for the native card sheet
4067
+ *
4068
+ * @summary Create an Elements session
4069
+ * @description
4070
+ * Sends POST /elements/sessions. Hand the returned `client_secret` to your app, which opens the card
4071
+ * sheet with it, and do not log or store it. A `pay` session needs `order_reference_id`; a `tokenize`
4072
+ * session saves a card for `user_id` with the given `mode`.
4073
+ *
4074
+ * @param request - The session's purpose and its order or card owner
4075
+ * @returns The new session with its `client_secret` and `elements_base_url`
4076
+ * @throws {TapsilatValidationError} When `purpose` is missing
4077
+ * @throws {TapsilatError} When the API rejects the request; `apiCode` and `retryable` say why
4078
+ */
4079
+ createElementsSession(request: ElementsSessionCreateRequest): Promise<ElementsSessionCreateResponse>;
4080
+ /**
4081
+ * Returns the authoritative state and outcome of an Elements session
4082
+ *
4083
+ * @summary Get an Elements session
4084
+ * @description
4085
+ * Sends GET /elements/sessions/{id}. Read the outcome here on your backend before fulfilling an
4086
+ * order, rather than trusting what the app reports.
4087
+ *
4088
+ * @param id - Session ID, such as "es_test_8Kq2nV0rX4"
4089
+ * @throws {TapsilatError} With `apiCode` "session_not_found" and `statusCode` 404 for an unknown session
4090
+ */
4091
+ getElementsSession(id: string): Promise<ElementsSession>;
4092
+ /**
4093
+ * Cancels an Elements session that is still waiting for a card
4094
+ *
4095
+ * @summary Cancel an Elements session
4096
+ * @description
4097
+ * Sends POST /elements/sessions/{id}/cancel with no body. A session that is confirming or has
4098
+ * completed comes back unchanged, so check `status` in the result.
4099
+ *
4100
+ * @param id - Session ID, such as "es_test_8Kq2nV0rX4"
4101
+ */
4102
+ cancelElementsSession(id: string): Promise<ElementsSession>;
4103
+ listOrganizationCurrencyPresets(): Promise<OrganizationCurrencyPresetsResponse>;
4104
+ /**
4105
+ * Adds a currency to the organization by ISO code, for example "USD"
4106
+ */
4107
+ createOrganizationCurrency(input: string | CreateOrganizationCurrencyPayload): Promise<CreateOrganizationCurrencyResponse>;
4108
+ /**
4109
+ * Creates an access token for an organization user; expire is in minutes
4110
+ */
4111
+ createOrganizationUserToken(request: OrgUserTokenCreateReq): Promise<OrgUserTokenCreateResponse>;
4112
+ getSuborganizationDetail(id: string): Promise<SuborganizationDetail>;
4113
+ getSubmerchantBySuborganization(suborganizationId: string): Promise<SuborganizationSubmerchantMapping>;
4114
+ /**
4115
+ * Returns the organization currency UUID for a unit such as "TRY"; a UUID is returned unchanged.
4116
+ * Most endpoints accept units directly, so this is only needed where a UUID is required.
4117
+ */
4118
+ resolveCurrencyId(ref: string): Promise<string>;
2398
4119
  createSubscription(request: SubscriptionCreateRequest): Promise<SubscriptionCreateResponse>;
2399
4120
  getSubscription(request: SubscriptionGetRequest): Promise<SubscriptionDetail>;
2400
4121
  listSubscriptions(params?: ListSubscriptionsRequest): Promise<ListSubscriptionsResponse>;
2401
4122
  cancelSubscription(request: SubscriptionCancelRequest): Promise<CancelSubscriptionResponse>;
2402
4123
  redirectSubscription(request: SubscriptionRedirectRequest): Promise<SubscriptionRedirectResponse>;
2403
- /**
2404
- * Gets payments for an order.
2405
- * Based on `get_order_payments` from the Python SDK.
2406
- *
2407
- * @summary Get order payments
2408
- * @description Retrieve a list of payments made for a specific order.
2409
- *
2410
- * @param request - Order payments request containing order_id
2411
- * @returns Promise resolving to order payments
2412
- */
2413
- getOrderPayments(request: GetOrderPaymentsRequest): Promise<GetOrderPaymentsResponse>;
2414
4124
  /**
2415
4125
  * Downloads order PDF.
2416
4126
  * Based on `get_order_pdf` from the Python SDK.
@@ -2524,16 +4234,179 @@ declare class TapsilatSDK {
2524
4234
  */
2525
4235
  listSubmerchants(page?: number, perPage?: number): Promise<ListSubmerchantsResponse>;
2526
4236
  /**
2527
- * Creates an organization user token.
2528
- * Based on `create_organization_user_token` from the Python SDK.
2529
- *
2530
- * @summary Create organization user token
2531
- * @description Creates a token for an organization user.
4237
+ * Get payments for an order
4238
+ * @deprecated The API has no `/orders/payments` route, so this call always fails.
4239
+ * Use getOrderPayments with an order ID, reference ID or conversation ID.
4240
+ */
4241
+ getAllOrdersPayments(): Promise<GetOrderPaymentsResponse>;
4242
+ /**
4243
+ * Get organization partners
4244
+ */
4245
+ getOrganizationPartners(): Promise<GetOrganizationPartnersResponse>;
4246
+ /**
4247
+ * Get organization limits by ID
4248
+ */
4249
+ getOrganizationLimitsById(id: string, params?: {
4250
+ currency?: string;
4251
+ operation?: string;
4252
+ }): Promise<GetOrganizationLimitsByIdResponse>;
4253
+ /**
4254
+ * Get system config
4255
+ */
4256
+ getSystemConfig(): Promise<GetSystemConfigResponse>;
4257
+ }
4258
+
4259
+ declare const CODES: {
4260
+ readonly RECEIVED: 1;
4261
+ readonly UNPAID: 2;
4262
+ readonly PAID: 3;
4263
+ readonly PROCESSING: 4;
4264
+ readonly SHIPPED: 5;
4265
+ readonly ON_HOLD: 6;
4266
+ readonly WAITING_FOR_PAYMENT: 7;
4267
+ readonly CANCELLED: 8;
4268
+ readonly COMPLETED: 9;
4269
+ readonly REFUNDED: 10;
4270
+ readonly FRAUD: 11;
4271
+ readonly REJECTED: 12;
4272
+ readonly FAILURE: 13;
4273
+ readonly RETRYING: 14;
4274
+ readonly PARTIALLY_REFUNDED: 15;
4275
+ readonly SUB_MERCHANT_PAYMENT_APPROVED: 16;
4276
+ readonly SUB_MERCHANT_PAYMENT_DISAPPROVED: 17;
4277
+ readonly SUB_MERCHANT_PAYMENT_ERRORED: 18;
4278
+ readonly STILL_HAS_UNPAID_INSTALLMENTS: 19;
4279
+ readonly STILL_HAS_UNPAID_TERMS: 20;
4280
+ readonly EXPIRED: 21;
4281
+ readonly STILL_HAS_UNPAID_SUB_MERCHANT_PAYMENTS: 22;
4282
+ readonly PARTIALLY_PAID: 23;
4283
+ readonly TERMINATED: 24;
4284
+ readonly CARD_TOKENIZATION: 25;
4285
+ readonly PRE_AUTHORIZED: 26;
4286
+ readonly DISPUTED: 27;
4287
+ readonly PARTIALLY_DISPUTED: 28;
4288
+ readonly SUSPECT: 29;
4289
+ };
4290
+ /**
4291
+ * @category Order Management
4292
+ * @summary Numeric order status code, as callbacks and order details carry it
4293
+ */
4294
+ type OrderStatusCode = (typeof CODES)[keyof typeof CODES];
4295
+ /**
4296
+ * @category Order Management
4297
+ * @summary Order status codes, their names and the paid, failed and refunded groups
4298
+ * @description
4299
+ * The numeric codes that callbacks and order details carry, and the names that
4300
+ * GET /order/{reference_id}/status returns for them. Every helper accepts a code, a numeric string or
4301
+ * a name.
4302
+ *
4303
+ * @example
4304
+ * ```typescript
4305
+ * const { status } = await tapsilat.getOrderStatus(referenceId); // e.g. "Waiting for payment"
4306
+ * OrderStatus.isPaid(status); // Paid, Completed, Sub merchant payment approved
4307
+ * OrderStatus.code(status); // 7; also accepts "7" or 7
4308
+ * ```
4309
+ */
4310
+ declare const OrderStatus: Readonly<{
4311
+ readonly NAMES: Readonly<Record<OrderStatusCode, string>>;
4312
+ readonly PAID_STATUSES: readonly OrderStatusCode[];
4313
+ readonly FAILED_STATUSES: readonly OrderStatusCode[];
4314
+ readonly REFUNDED_STATUSES: readonly OrderStatusCode[];
4315
+ /** The code for a code, a numeric string or a name (case-insensitive), or null */
4316
+ readonly code: (status: unknown) => OrderStatusCode | null;
4317
+ /** The status name, such as "Paid", or null */
4318
+ readonly name: (status: unknown) => string | null;
4319
+ /** Paid, Completed or Sub merchant payment approved */
4320
+ readonly isPaid: (status: unknown) => boolean;
4321
+ /** Cancelled, Fraud, Rejected, Failure, Expired or Terminated */
4322
+ readonly isFailed: (status: unknown) => boolean;
4323
+ /** Refunded or Partially refunded */
4324
+ readonly isRefunded: (status: unknown) => boolean;
4325
+ readonly RECEIVED: 1;
4326
+ readonly UNPAID: 2;
4327
+ readonly PAID: 3;
4328
+ readonly PROCESSING: 4;
4329
+ readonly SHIPPED: 5;
4330
+ readonly ON_HOLD: 6;
4331
+ readonly WAITING_FOR_PAYMENT: 7;
4332
+ readonly CANCELLED: 8;
4333
+ readonly COMPLETED: 9;
4334
+ readonly REFUNDED: 10;
4335
+ readonly FRAUD: 11;
4336
+ readonly REJECTED: 12;
4337
+ readonly FAILURE: 13;
4338
+ readonly RETRYING: 14;
4339
+ readonly PARTIALLY_REFUNDED: 15;
4340
+ readonly SUB_MERCHANT_PAYMENT_APPROVED: 16;
4341
+ readonly SUB_MERCHANT_PAYMENT_DISAPPROVED: 17;
4342
+ readonly SUB_MERCHANT_PAYMENT_ERRORED: 18;
4343
+ readonly STILL_HAS_UNPAID_INSTALLMENTS: 19;
4344
+ readonly STILL_HAS_UNPAID_TERMS: 20;
4345
+ readonly EXPIRED: 21;
4346
+ readonly STILL_HAS_UNPAID_SUB_MERCHANT_PAYMENTS: 22;
4347
+ readonly PARTIALLY_PAID: 23;
4348
+ readonly TERMINATED: 24;
4349
+ readonly CARD_TOKENIZATION: 25;
4350
+ readonly PRE_AUTHORIZED: 26;
4351
+ readonly DISPUTED: 27;
4352
+ readonly PARTIALLY_DISPUTED: 28;
4353
+ readonly SUSPECT: 29;
4354
+ }>;
4355
+
4356
+ type JsonObject = Record<string, unknown>;
4357
+ /**
4358
+ * @category Webhooks
4359
+ * @summary A callback Tapsilat posts to an organization's callback URLs
4360
+ * @description
4361
+ * Tapsilat posts {"type": "...", "data": {...}, "token": "<delivery id>"} to the organization's callback
4362
+ * URLs and to an order's payment_success_url and payment_failure_url. The shape of "data" depends on the
4363
+ * type, which each organization chooses in the panel: "order_lite" (the default), "order",
4364
+ * "order_payment_detail", "extended_order" or "payment_facilitator". The getters read the order's
4365
+ * reference ID, conversation ID and status from whichever shape arrived.
4366
+ *
4367
+ * Verify the Tapsilat-Signature header with `verifyWebhook()` before trusting a callback.
4368
+ *
4369
+ * @example
4370
+ * ```typescript
4371
+ * const event = WebhookEvent.fromPayload(rawBody);
4372
+ * if (event.isPaid()) {
4373
+ * await fulfil(event.referenceId);
4374
+ * }
4375
+ * ```
4376
+ */
4377
+ declare class WebhookEvent {
4378
+ static readonly TYPE_ORDER = "order";
4379
+ static readonly TYPE_ORDER_LITE = "order_lite";
4380
+ static readonly TYPE_ORDER_PAYMENT_DETAIL = "order_payment_detail";
4381
+ static readonly TYPE_EXTENDED_ORDER = "extended_order";
4382
+ static readonly TYPE_PAYMENT_FACILITATOR = "payment_facilitator";
4383
+ /** The callback type, such as "order_lite" */
4384
+ readonly type: string | null;
4385
+ /** Unique per delivery */
4386
+ readonly token: string | null;
4387
+ /** The callback's "data" object, or the whole payload when it has none */
4388
+ readonly data: JsonObject;
4389
+ /** The decoded payload */
4390
+ readonly payload: JsonObject;
4391
+ constructor(payload: JsonObject);
4392
+ /**
4393
+ * Decodes a raw callback body
2532
4394
  *
2533
- * @param request - Token creation payload
2534
- * @returns Promise resolving to the created token details
4395
+ * @param payload - The raw request body
4396
+ * @throws {TapsilatValidationError} When the body is not a JSON object
2535
4397
  */
2536
- createOrganizationUserToken(request: OrgUserTokenCreateReq): Promise<OrgUserTokenCreateResponse>;
4398
+ static fromPayload(payload: string | Uint8Array): WebhookEvent;
4399
+ /** The order's reference ID */
4400
+ get referenceId(): string | null;
4401
+ /** The conversation ID the order was created with */
4402
+ get conversationId(): string | null;
4403
+ /** The order status code (see OrderStatus), or null when this callback type carries none */
4404
+ get statusCode(): OrderStatusCode | null;
4405
+ /** The order status name, such as "Paid" */
4406
+ get status(): string | null;
4407
+ isPaid(): boolean;
4408
+ isFailed(): boolean;
4409
+ isRefunded(): boolean;
2537
4410
  }
2538
4411
 
2539
4412
  /**
@@ -2551,6 +4424,18 @@ declare class TapsilatSDK {
2551
4424
  declare class TapsilatError extends Error {
2552
4425
  readonly code: string;
2553
4426
  readonly details?: unknown;
4427
+ /** HTTP status code, when the error came from an HTTP response */
4428
+ statusCode?: number;
4429
+ /** `code` field from the API response body, as a string */
4430
+ apiCode?: string;
4431
+ /** `status` field from the API response body */
4432
+ apiStatus?: string;
4433
+ /** Per-field validation messages from the API response body */
4434
+ errors?: Record<string, unknown>;
4435
+ /** Whether the API error says the request can be retried, as Elements errors do */
4436
+ retryable?: boolean;
4437
+ /** Raw API response body */
4438
+ rawBody?: string;
2554
4439
  /**
2555
4440
  * @summary Creates a new TapsilatError instance
2556
4441
  * @description Initializes base error with message, code and optional details
@@ -2577,7 +4462,6 @@ declare class TapsilatError extends Error {
2577
4462
  * @extends TapsilatError
2578
4463
  */
2579
4464
  declare class TapsilatNetworkError extends TapsilatError {
2580
- readonly statusCode?: number;
2581
4465
  /**
2582
4466
  * @summary Creates a new network error instance
2583
4467
  * @description Initializes network error with message, code, status code and optional details
@@ -2739,6 +4623,18 @@ declare function validateGsmNumber(gsmNumber: string | number): GsmValidationRes
2739
4623
  * @returns {InstallmentsValidationResult} Validation result with standardized array
2740
4624
  */
2741
4625
  declare function validateInstallments(installments: string | number | number[]): InstallmentsValidationResult;
4626
+ /**
4627
+ * Cleans and validates a GSM number for order creation
4628
+ *
4629
+ * @summary Clean a GSM number with the SDK-wide rules
4630
+ * @description Removes spaces, dashes and parentheses, then checks that only digits and + remain and that the
4631
+ * number is long enough for its format (international +, 00, national 0 or local). Any country is accepted.
4632
+ *
4633
+ * @param phone - Phone number as entered
4634
+ * @returns The cleaned number, or an empty string when phone is empty
4635
+ * @throws {TapsilatValidationError} When the number is malformed or too short
4636
+ */
4637
+ declare function cleanGsmNumber(phone: string): string;
2742
4638
 
2743
- export { BusinessType, ConfigManager, TapsilatAuthenticationError, TapsilatError, TapsilatNetworkError, TapsilatRateLimitError, TapsilatSDK, TapsilatValidationError, isValidCurrency, isValidPaymentMethod, isValidUrl, sanitizeMetadata, validateEmail, validateGsmNumber, validateInstallments, validatePaymentRequest };
2744
- export type { APIError, APIResponse, AddBasketItemRequest, AddBasketItemResponse, Address, BasketItem, BasketItemDTO, BasketItemPayerDTO, BasketItemPaymentDTO, BillingAddress, BillingAddressDTO, Buyer, BuyerDTO, CallbackURLDTO, CancelOrderRequest, CancelOrderResponse, CancelSubscriptionResponse, CheckoutDesignDTO, Currency, Customer, GetMetaResponse, GetOrderPaymentDetailsResponse, GetOrderPaymentsRequest, GetOrderPaymentsResponse, GetOrderResponse, GetOrderSubmerchantsRequest, GetOrderSubmerchantsResponse, GetOrderTermResponse, GetOrderTransactionsResponse, GetOrdersListItem, GetOrdersRequest, GetOrdersResponse, GetOrganizationCurrenciesResponse, GetOrganizationLimitsResponse, GetOrganizationScopesResponse, GetSubOrganizationListResponse, GetSubmerchantResponse, GetSuborganizationsRequest, GetSystemOrderStatusesResponse, GetUserLimitRequest, GetUserLimitResponse, GetVposRequest, GetVposResponse, GsmValidationResult, InstallmentsValidationResult, ListSubmerchantsResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, Locale, MetadataDTO, Order, OrderAccountingRequest, OrderAccountingResponse, OrderCardDTO, OrderCreateDTO, OrderCreateRequest, OrderCreateResponse, OrderManualCallbackRequest, OrderManualCallbackResponse, OrderOIPDTO, OrderOIPResponse, OrderPFSubMerchantDTO, OrderPaymentDetail, OrderPaymentDetailDTO, OrderPaymentTermActionResponse, OrderPaymentTermCreateDTO, OrderPaymentTermUpdateDTO, OrderPostAuthRequest, OrderPostAuthResponse, OrderRefundRequest, OrderRefundResponse, OrderRelatedUpdateRequest, OrderRelatedUpdateResponse, OrderResponse, OrderStatusResponse, OrderSubmerchant, OrderTermRefundRequest, OrderTerminateRequest, OrderTerminateResponse, OrderTransaction, OrgCreateBusinessRequest, OrgCreateBusinessResponse, OrgCreateUserReq, OrgCreateUserRequest, OrgCreateUserResponse, OrgUserMobileVerifyReq, OrgUserMobileVerifyRequest, OrgUserMobileVerifyResponse, OrgUserTokenCreateReq, OrgUserTokenCreateResponse, OrgUserVerifyReq, OrgUserVerifyRequest, OrgUserVerifyResponse, OrganizationResponse, OrganizationSettings, PaginatedResponse, PaginationParams, PaymentMethod, PaymentOption, PaymentRequest, PaymentResponse, PaymentStatus, PaymentTermDTO, PaymentTermDeleteRequest, PaymentTermRefundResponse, PaymentTermResponse, PaymentTermTerminateRequest, RefundAllOrderDTO, RefundOrderDTO, RefundRequest, RefundResponse, RemoveBasketItemRequest, RemoveBasketItemResponse, SetLimitUserRequest, SetLimitUserResponse, ShippingAddressDTO, SubOrganizationDTO, SubmerchantCreateDTO, SubmerchantDTO, SubmerchantUpdateDTO, SubscriptionBilling, SubscriptionCancelRequest, SubscriptionCreateRequest, SubscriptionCreateResponse, SubscriptionDetail, SubscriptionGetRequest, SubscriptionListItem, SubscriptionOrder, SubscriptionRedirectRequest, SubscriptionRedirectResponse, SubscriptionUser, SystemOrderStatus, TapsilatConfig, TimestampDTO, UpdateBasketItemRequest, UpdateBasketItemResponse, WebhookEvent };
4639
+ export { BusinessType, ConfigManager, CurrencyResolver, ElementsCardBrand, ElementsSessionPurpose, ElementsSessionStatus, ElementsTokenizeMode, MarketplaceService, OrderStatus, SubmerchantService, TapsilatAuthenticationError, TapsilatError, TapsilatNetworkError, TapsilatRateLimitError, TapsilatSDK, TapsilatValidationError, TokenizationService, VposService, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TOLERANCE, WebhookEvent, cleanGsmNumber, isValidCurrency, isValidPaymentMethod, isValidUrl, sanitizeMetadata, validateEmail, validateGsmNumber, validateInstallments, validatePaymentRequest };
4640
+ export type { APIError, APIResponse, AddBasketItemRequest, AddBasketItemResponse, Address, BasketItem, BasketItemDTO, BasketItemPayerDTO, BasketItemPaymentDTO, BillingAddress, BillingAddressDTO, Buyer, BuyerDTO, CallbackURLDTO, CancelOrderRequest, CancelOrderResponse, CancelSubscriptionResponse, CardInstallment, CardInstallmentsRequest, CardInstallmentsResponse, CardScheme, CardSchemeListResponse, CardTokenizeRequest, CardTokenizeResponse, CheckoutDesignDTO, CreateOrganizationCurrencyResponse, Currency, Customer, DeleteSavedCardResponse, ElementsCardSummary, ElementsSession, ElementsSessionCreateRequest, ElementsSessionCreateResponse, ElementsSessionError, GetMetaResponse, GetOrderPaymentDetailsResponse, GetOrderPaymentsRequest, GetOrderPaymentsResponse, GetOrderResponse, GetOrderSubmerchantsRequest, GetOrderSubmerchantsResponse, GetOrderTermResponse, GetOrderTransactionsResponse, GetOrdersListItem, GetOrdersRequest, GetOrdersResponse, GetOrganizationCurrenciesResponse, GetOrganizationLimitsResponse, GetOrganizationScopesResponse, GetSubOrganizationListResponse, GetSubmerchantResponse, GetSuborganizationsRequest, GetSystemOrderStatusesResponse, GetUserLimitRequest, GetUserLimitResponse, GetVposRequest, GetVposResponse, GsmValidationResult, InstallmentTableGroup, InstallmentTableRequest, InstallmentTableResponse, InstallmentTableRow, InstallmentsValidationResult, ListSavedCardsResponse, ListSubmerchantsResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, Locale, MarketplaceAccountAction, MarketplaceAccountTarget, MarketplaceApprovalPolicies, MarketplaceApprovalPolicy, MarketplaceApprovalPolicyInput, MarketplaceApprovalSettings, MarketplaceContractFilter, MarketplaceContracts, MarketplacePayout, MarketplacePayoutAcceptance, MarketplacePayoutApproval, MarketplacePayoutFilter, MarketplacePayoutList, MarketplacePayoutOperation, MarketplacePayoutOperationInput, MarketplaceProfileUpdate, MarketplaceProfileUpdateResponse, MarketplaceReleasePolicies, MarketplaceReleasePolicy, MarketplaceReleasePolicyInput, MarketplaceSeller, MarketplaceSellerAccount, MarketplaceSellerAccounts, MarketplaceSellerContract, MarketplaceSellerList, MarketplaceSellerListParams, MarketplaceSubmerchantCreateRequest, MarketplaceSubmerchantCreateResponse, MarketplaceSubmerchantProvisioning, MarketplaceSynchronization, MetadataDTO, Order, OrderAccountingRequest, OrderAccountingResponse, OrderCardDTO, OrderChargeRequest, OrderChargeResponse, OrderCreateDTO, OrderCreateRequest, OrderCreateResponse, OrderManualCallbackRequest, OrderManualCallbackResponse, OrderOIPDTO, OrderOIPResponse, OrderPFSubMerchantDTO, OrderPayment, OrderPaymentDetail, OrderPaymentDetailDTO, OrderPaymentTermActionResponse, OrderPaymentTermCreateDTO, OrderPaymentTermUpdateDTO, OrderPaymentsRequest, OrderPaymentsResponse, OrderPostAuthRequest, OrderPostAuthResponse, OrderRefundRequest, OrderRefundResponse, OrderRelatedUpdateRequest, OrderRelatedUpdateResponse, OrderResponse, OrderStatusCode, OrderStatusResponse, OrderSubmerchant, OrderSubmerchantListItem, OrderSubmerchantListResponse, OrderTermRefundRequest, OrderTerminateRequest, OrderTerminateResponse, OrderTransaction, OrgCreateBusinessRequest, OrgCreateBusinessResponse, OrgCreateUserReq, OrgCreateUserRequest, OrgCreateUserResponse, OrgUserMobileVerifyReq, OrgUserMobileVerifyRequest, OrgUserMobileVerifyResponse, OrgUserTokenCreateReq, OrgUserTokenCreateRequest, OrgUserTokenCreateResponse, OrgUserVerifyReq, OrgUserVerifyRequest, OrgUserVerifyResponse, OrganizationCurrenciesResponse, OrganizationCurrency$1 as OrganizationCurrency, OrganizationCurrencyPreset, OrganizationCurrencyPresetsResponse, OrganizationResponse, OrganizationSettings, PaginatedResponse, PaginationParams, PaymentMethod, PaymentOption, PaymentRequest, PaymentResponse, PaymentStatus, PaymentTermDTO, PaymentTermDeleteRequest, PaymentTermRefundResponse, PaymentTermResponse, PaymentTermTerminateRequest, RefundAllOrderDTO, RefundOrderDTO, RefundRequest, RefundResponse, RemoveBasketItemRequest, RemoveBasketItemResponse, SavedCard, SetLimitUserRequest, SetLimitUserResponse, ShippingAddressDTO, SubOrganizationDTO, Submerchant, SubmerchantCreateDTO, SubmerchantCreateRequest, SubmerchantDTO, SubmerchantListItem, SubmerchantListResponse, SubmerchantMutationResponse, SubmerchantPaymentAction, SubmerchantPaymentActionResponse, SubmerchantPaymentItemUpdate, SubmerchantPaymentItemUpdateResponse, SubmerchantPayoutEventRequest, SubmerchantPayoutEventResponse, SubmerchantSuborganizationMapping, SubmerchantUpdateDTO, SubmerchantUpdateRequest, SuborganizationDetail, SuborganizationListItem, SuborganizationListResponse, SuborganizationSubmerchantMapping, SubscriptionBilling, SubscriptionCancelRequest, SubscriptionCreateRequest, SubscriptionCreateResponse, SubscriptionDetail, SubscriptionGetRequest, SubscriptionListItem, SubscriptionOrder, SubscriptionRedirectRequest, SubscriptionRedirectResponse, SubscriptionUser, SystemOrderStatus, TapsilatConfig, TimestampDTO, UpdateBasketItemRequest, UpdateBasketItemResponse, Vpos, VposAcquirer, VposAcquirerListResponse, VposAcquirerTemplate, VposAcquirerTemplateDefaults, VposAcquirerTemplateListResponse, VposCreateRequest, VposListItem, VposListParams, VposListResponse, VposMutationResponse, VposSubmerchant, VposSubmerchantCreateRequest, VposSubmerchantListItem, VposSubmerchantListParams, VposSubmerchantListResponse, VposSubmerchantMutationResponse, VposSubmerchantUpdateRequest, VposUpdateRequest, WebhookVerifyOptions };