monime-package 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,16 +1,34 @@
1
+ declare class MonimeError extends Error {
2
+ readonly status?: number;
3
+ readonly requestId?: string;
4
+ readonly details?: unknown;
5
+ constructor(message: string, status?: number, requestId?: string, details?: unknown);
6
+ }
7
+ declare class MonimeAuthenticationError extends MonimeError {
8
+ constructor(message?: string);
9
+ }
10
+ declare class MonimeValidationError extends MonimeError {
11
+ constructor(message: string, details?: unknown);
12
+ }
13
+
1
14
  interface ClientConfig {
2
15
  monimeSpaceId: string;
3
16
  accessToken: string;
4
17
  monimeVersion?: string | undefined;
5
18
  }
6
19
  interface Pagination {
7
- count?: number;
8
- next: string | null;
20
+ count: number;
21
+ next: string;
22
+ }
23
+ interface Result<T> {
24
+ data?: T;
25
+ success: boolean;
26
+ error?: Error | MonimeError;
9
27
  }
10
28
 
11
- interface AllCheckout {
29
+ interface ListCheckoutsResponse {
12
30
  result: CheckoutSession[];
13
- pagination: Pagination;
31
+ Pagination: Pagination;
14
32
  }
15
33
  interface CheckoutSession {
16
34
  id: string;
@@ -29,7 +47,7 @@ interface CheckoutSession {
29
47
  createTime: string;
30
48
  ownershipGraph: OwnershipGraph$4;
31
49
  }
32
- interface OneCheckout {
50
+ interface RetrieveCheckoutResponse {
33
51
  id: string;
34
52
  status: string;
35
53
  name: string;
@@ -46,7 +64,7 @@ interface OneCheckout {
46
64
  createTime: string;
47
65
  ownershipGraph: OwnershipGraph$4;
48
66
  }
49
- interface CreateCheckout {
67
+ interface CreateCheckoutResponse {
50
68
  id: string;
51
69
  status: string;
52
70
  name: string;
@@ -160,29 +178,7 @@ interface Price {
160
178
  value: number;
161
179
  }
162
180
 
163
- declare function CheckoutSessionAPI(config: ClientConfig): {
164
- create: (name: string, amount: number, quantity: number, successUrl: string, cancelUrl: string, description?: string, financialAccountId?: string, primaryColor?: string, images?: string[]) => Promise<{
165
- success: boolean;
166
- error?: Error;
167
- data: CreateCheckout;
168
- }>;
169
- get: () => Promise<{
170
- success: boolean;
171
- error?: Error;
172
- data: AllCheckout;
173
- }>;
174
- getOne: (checkoutId: string) => Promise<{
175
- success: boolean;
176
- error?: Error;
177
- data: OneCheckout;
178
- }>;
179
- delete: (checkoutId: string) => Promise<{
180
- success: boolean;
181
- error?: Error;
182
- }>;
183
- };
184
-
185
- interface CreateFinancialAccount {
181
+ interface CreateFinancialAccountResponse {
186
182
  id: string;
187
183
  uvan: string;
188
184
  name: string;
@@ -193,7 +189,7 @@ interface CreateFinancialAccount {
193
189
  createTime: string;
194
190
  updateTime: string;
195
191
  }
196
- interface GetFinancialAccount {
192
+ interface RetrieveFinancialAccountResponse {
197
193
  id: string;
198
194
  uvan: string;
199
195
  name: string;
@@ -204,7 +200,7 @@ interface GetFinancialAccount {
204
200
  createTime: string;
205
201
  updateTime: string;
206
202
  }
207
- interface AllFinancialAccount {
203
+ interface ListFinancialAccountsResponse {
208
204
  result: FinancialAccount$1[];
209
205
  pagination: Pagination;
210
206
  }
@@ -241,82 +237,169 @@ interface Available {
241
237
  value: number;
242
238
  }
243
239
 
244
- interface CreateInternalTransfer {
240
+ interface RetrieveTransactionResponse {
245
241
  id: string;
246
- status: string;
242
+ type: string;
243
+ amount: Amount$3;
244
+ timestamp: string;
245
+ reference: string;
246
+ financialAccount: FinancialAccount;
247
+ originatingReversal: OriginatingReversal;
248
+ originatingFee: OriginatingFee;
249
+ ownershipGraph: OwnershipGraph$3;
250
+ }
251
+ interface ListTransactionsResponse {
252
+ result: Transaction[];
253
+ pagination: Pagination;
254
+ }
255
+ interface Transaction {
256
+ id: string;
257
+ type: string;
247
258
  amount: Amount$3;
259
+ timestamp: string;
260
+ reference: string;
261
+ financialAccount: FinancialAccount;
262
+ originatingReversal: OriginatingReversal;
263
+ originatingFee: OriginatingFee;
264
+ ownershipGraph: OwnershipGraph$3;
265
+ }
266
+ interface OwnershipGraph$3 {
267
+ owner: Owner2$3;
268
+ }
269
+ interface OwnershipGraph$3 {
270
+ owner: Owner2$3;
271
+ }
272
+ interface Owner2$3 {
273
+ id: string;
274
+ type: string;
275
+ owner: Owner$3;
276
+ }
277
+ interface Owner2$3 {
278
+ id: string;
279
+ type: string;
280
+ owner: Owner$3;
281
+ }
282
+ interface Owner$3 {
283
+ id: string;
284
+ type: string;
285
+ }
286
+ interface Owner$3 {
287
+ id: string;
288
+ type: string;
289
+ }
290
+ interface OriginatingFee {
291
+ code: string;
292
+ }
293
+ interface OriginatingFee {
294
+ code: string;
295
+ }
296
+ interface OriginatingReversal {
297
+ originTxnId: string;
298
+ originTxnRef: string;
299
+ }
300
+ interface OriginatingReversal {
301
+ originTxnId: string;
302
+ originTxnRef: string;
303
+ }
304
+ interface FinancialAccount {
305
+ id: string;
306
+ balance: Balance;
307
+ }
308
+ interface FinancialAccount {
309
+ id: string;
310
+ balance: Balance;
311
+ }
312
+ interface Balance {
313
+ after: Amount$3;
314
+ }
315
+ interface Balance {
316
+ after: Amount$3;
317
+ }
318
+ interface Amount$3 {
319
+ currency: string;
320
+ value: number;
321
+ }
322
+ interface Amount$3 {
323
+ currency: string;
324
+ value: number;
325
+ }
326
+
327
+ interface CreateInternalTransferResponse {
328
+ id: string;
329
+ status: string;
330
+ amount: Amount$2;
248
331
  sourceFinancialAccount: SourceFinancialAccount;
249
332
  destinationFinancialAccount: SourceFinancialAccount;
250
333
  financialTransactionReference: string;
251
334
  description: string;
252
335
  failureDetail: FailureDetail$1;
253
- ownershipGraph: OwnershipGraph$3;
336
+ ownershipGraph: OwnershipGraph$2;
254
337
  createTime: string;
255
338
  updateTime: string;
256
339
  }
257
- interface AllInternalTransfers {
340
+ interface ListInternalTransfersResponse {
258
341
  result: Transfer[];
259
342
  pagination: Pagination;
260
343
  }
261
344
  interface Transfer {
262
345
  id: string;
263
346
  status: string;
264
- amount: Amount$3;
347
+ amount: Amount$2;
265
348
  sourceFinancialAccount: SourceFinancialAccount;
266
349
  destinationFinancialAccount: SourceFinancialAccount;
267
350
  financialTransactionReference: string;
268
351
  description: string;
269
352
  failureDetail: FailureDetail$1;
270
- ownershipGraph: OwnershipGraph$3;
353
+ ownershipGraph: OwnershipGraph$2;
271
354
  createTime: string;
272
355
  updateTime: string;
273
356
  }
274
- interface InternalTransfer {
357
+ interface RetrieveInternalTransferResponse {
275
358
  id: string;
276
359
  status: string;
277
- amount: Amount$3;
360
+ amount: Amount$2;
278
361
  sourceFinancialAccount: SourceFinancialAccount;
279
362
  destinationFinancialAccount: SourceFinancialAccount;
280
363
  financialTransactionReference: string;
281
364
  description: string;
282
365
  failureDetail: FailureDetail$1;
283
- ownershipGraph: OwnershipGraph$3;
366
+ ownershipGraph: OwnershipGraph$2;
284
367
  createTime: string;
285
368
  updateTime: string;
286
369
  }
287
- interface OwnershipGraph$3 {
288
- owner: Owner2$3;
370
+ interface OwnershipGraph$2 {
371
+ owner: Owner2$2;
289
372
  }
290
- interface OwnershipGraph$3 {
291
- owner: Owner2$3;
373
+ interface OwnershipGraph$2 {
374
+ owner: Owner2$2;
292
375
  }
293
- interface OwnershipGraph$3 {
294
- owner: Owner2$3;
376
+ interface OwnershipGraph$2 {
377
+ owner: Owner2$2;
295
378
  }
296
- interface Owner2$3 {
379
+ interface Owner2$2 {
297
380
  id: string;
298
381
  type: string;
299
- owner: Owner$3;
382
+ owner: Owner$2;
300
383
  }
301
- interface Owner2$3 {
384
+ interface Owner2$2 {
302
385
  id: string;
303
386
  type: string;
304
- owner: Owner$3;
387
+ owner: Owner$2;
305
388
  }
306
- interface Owner2$3 {
389
+ interface Owner2$2 {
307
390
  id: string;
308
391
  type: string;
309
- owner: Owner$3;
392
+ owner: Owner$2;
310
393
  }
311
- interface Owner$3 {
394
+ interface Owner$2 {
312
395
  id: string;
313
396
  type: string;
314
397
  }
315
- interface Owner$3 {
398
+ interface Owner$2 {
316
399
  id: string;
317
400
  type: string;
318
401
  }
319
- interface Owner$3 {
402
+ interface Owner$2 {
320
403
  id: string;
321
404
  type: string;
322
405
  }
@@ -341,15 +424,15 @@ interface SourceFinancialAccount {
341
424
  interface SourceFinancialAccount {
342
425
  id: string;
343
426
  }
344
- interface Amount$3 {
427
+ interface Amount$2 {
345
428
  currency: string;
346
429
  value: number;
347
430
  }
348
- interface Amount$3 {
431
+ interface Amount$2 {
349
432
  currency: string;
350
433
  value: number;
351
434
  }
352
- interface Amount$3 {
435
+ interface Amount$2 {
353
436
  currency: string;
354
437
  value: number;
355
438
  }
@@ -387,16 +470,16 @@ interface Payment {
387
470
  };
388
471
  metadata: Record<string, unknown> | null;
389
472
  }
390
- interface GetPayment extends Payment {
473
+ interface RetrievePaymentResponse extends Payment {
391
474
  }
392
- interface ListPayments {
475
+ interface ListPaymentsResponse {
393
476
  result: Payment[];
394
477
  pagination: Pagination;
395
478
  }
396
- interface PatchPayment extends Payment {
479
+ interface UpdatePaymentResponse extends Payment {
397
480
  }
398
481
 
399
- interface CreatePaymentCode {
482
+ interface CreatePaymentCodeResponse {
400
483
  id: string;
401
484
  mode: string;
402
485
  status: string;
@@ -425,9 +508,9 @@ interface CreatePaymentCode {
425
508
  processedPaymentData: ProcessedPaymentData;
426
509
  createTime: string;
427
510
  updateTime: string;
428
- ownershipGraph: OwnershipGraph$2;
511
+ ownershipGraph: OwnershipGraph$1;
429
512
  }
430
- interface GetAllPaymentCode {
513
+ interface ListPaymentCodesResponse {
431
514
  result: PaymentCode[];
432
515
  pagination: Pagination;
433
516
  }
@@ -436,7 +519,7 @@ interface PaymentCode {
436
519
  mode: string;
437
520
  status: string;
438
521
  name: string;
439
- amount: Amount$2;
522
+ amount: Amount$1;
440
523
  enable: boolean;
441
524
  expireTime: string;
442
525
  customer: Customer;
@@ -449,14 +532,14 @@ interface PaymentCode {
449
532
  processedPaymentData: ProcessedPaymentData;
450
533
  createTime: string;
451
534
  updateTime: string;
452
- ownershipGraph: OwnershipGraph$2;
535
+ ownershipGraph: OwnershipGraph$1;
453
536
  }
454
- interface GetOne {
537
+ interface RetrievePaymentCodeResponse {
455
538
  id: string;
456
539
  mode: string;
457
540
  status: string;
458
541
  name: string;
459
- amount: Amount$2;
542
+ amount: Amount$1;
460
543
  enable: boolean;
461
544
  expireTime: string;
462
545
  customer: Customer;
@@ -469,9 +552,9 @@ interface GetOne {
469
552
  processedPaymentData: ProcessedPaymentData;
470
553
  createTime: string;
471
554
  updateTime: string;
472
- ownershipGraph: OwnershipGraph$2;
555
+ ownershipGraph: OwnershipGraph$1;
473
556
  }
474
- interface OwnershipGraph$2 {
557
+ interface OwnershipGraph$1 {
475
558
  owner: {
476
559
  id: string;
477
560
  type: string;
@@ -481,27 +564,27 @@ interface OwnershipGraph$2 {
481
564
  };
482
565
  };
483
566
  }
484
- interface OwnershipGraph$2 {
485
- owner: Owner2$2;
567
+ interface OwnershipGraph$1 {
568
+ owner: Owner2$1;
486
569
  }
487
- interface OwnershipGraph$2 {
488
- owner: Owner2$2;
570
+ interface OwnershipGraph$1 {
571
+ owner: Owner2$1;
489
572
  }
490
- interface Owner2$2 {
573
+ interface Owner2$1 {
491
574
  id: string;
492
575
  type: string;
493
- owner: Owner$2;
576
+ owner: Owner$1;
494
577
  }
495
- interface Owner2$2 {
578
+ interface Owner2$1 {
496
579
  id: string;
497
580
  type: string;
498
- owner: Owner$2;
581
+ owner: Owner$1;
499
582
  }
500
- interface Owner$2 {
583
+ interface Owner$1 {
501
584
  id: string;
502
585
  type: string;
503
586
  }
504
- interface Owner$2 {
587
+ interface Owner$1 {
505
588
  id: string;
506
589
  type: string;
507
590
  }
@@ -521,7 +604,7 @@ interface ProcessedPaymentData {
521
604
  financialTransactionReference: string;
522
605
  }
523
606
  interface ProcessedPaymentData {
524
- amount: Amount$2;
607
+ amount: Amount$1;
525
608
  orderId: string;
526
609
  paymentId: string;
527
610
  orderNumber: string;
@@ -529,7 +612,7 @@ interface ProcessedPaymentData {
529
612
  financialTransactionReference: string;
530
613
  }
531
614
  interface ProcessedPaymentData {
532
- amount: Amount$2;
615
+ amount: Amount$1;
533
616
  orderId: string;
534
617
  paymentId: string;
535
618
  orderNumber: string;
@@ -548,11 +631,11 @@ interface ChannelData {
548
631
  }
549
632
  interface RecurrentPaymentTarget {
550
633
  expectedPaymentCount: number;
551
- expectedPaymentTotal: Amount$2;
634
+ expectedPaymentTotal: Amount$1;
552
635
  }
553
636
  interface RecurrentPaymentTarget {
554
637
  expectedPaymentCount: number;
555
- expectedPaymentTotal: Amount$2;
638
+ expectedPaymentTotal: Amount$1;
556
639
  }
557
640
  interface Customer {
558
641
  name: string;
@@ -560,11 +643,11 @@ interface Customer {
560
643
  interface Customer {
561
644
  name: string;
562
645
  }
563
- interface Amount$2 {
646
+ interface Amount$1 {
564
647
  currency: string;
565
648
  value: number;
566
649
  }
567
- interface Amount$2 {
650
+ interface Amount$1 {
568
651
  currency: string;
569
652
  value: number;
570
653
  }
@@ -582,79 +665,79 @@ type DestinationOption = {
582
665
  providerId: "w01" | "w02";
583
666
  walletId: string;
584
667
  };
585
- interface CreatePayout {
668
+ interface CreatePayoutResponse {
586
669
  id: string;
587
670
  status: string;
588
- amount: Amount$1;
671
+ amount: Amount;
589
672
  source: Source;
590
673
  destination: Destination;
591
674
  fees: Fee[];
592
675
  failureDetail: FailureDetail;
593
676
  createTime: string;
594
677
  updateTime: string;
595
- ownershipGraph: OwnershipGraph$1;
678
+ ownershipGraph: OwnershipGraph;
596
679
  }
597
- interface GetAll {
680
+ interface ListPayoutsResponse {
598
681
  result: Payout[];
599
682
  pagination: Pagination;
600
683
  }
601
684
  interface Payout {
602
685
  id: string;
603
686
  status: string;
604
- amount: Amount$1;
687
+ amount: Amount;
605
688
  source: Source;
606
689
  destination: Destination;
607
690
  fees: Fee[];
608
691
  failureDetail: FailureDetail;
609
692
  createTime: string;
610
693
  updateTime: string;
611
- ownershipGraph: OwnershipGraph$1;
694
+ ownershipGraph: OwnershipGraph;
612
695
  }
613
- interface GetOnePayout {
696
+ interface RetrievePayoutResponse {
614
697
  id: string;
615
698
  status: string;
616
- amount: Amount$1;
699
+ amount: Amount;
617
700
  source: Source;
618
701
  destination: Destination;
619
702
  fees: Fee[];
620
703
  failureDetail: FailureDetail;
621
704
  createTime: string;
622
705
  updateTime: string;
623
- ownershipGraph: OwnershipGraph$1;
706
+ ownershipGraph: OwnershipGraph;
624
707
  }
625
- interface OwnershipGraph$1 {
626
- owner: Owner2$1;
708
+ interface OwnershipGraph {
709
+ owner: Owner2;
627
710
  }
628
- interface OwnershipGraph$1 {
629
- owner: Owner2$1;
711
+ interface OwnershipGraph {
712
+ owner: Owner2;
630
713
  }
631
- interface OwnershipGraph$1 {
632
- owner: Owner2$1;
714
+ interface OwnershipGraph {
715
+ owner: Owner2;
633
716
  }
634
- interface Owner2$1 {
717
+ interface Owner2 {
635
718
  id: string;
636
719
  type: string;
637
- owner: Owner$1;
720
+ owner: Owner;
638
721
  }
639
- interface Owner2$1 {
722
+ interface Owner2 {
640
723
  id: string;
641
724
  type: string;
642
- owner: Owner$1;
725
+ owner: Owner;
643
726
  }
644
- interface Owner2$1 {
727
+ interface Owner2 {
645
728
  id: string;
646
729
  type: string;
647
- owner: Owner$1;
730
+ owner: Owner;
648
731
  }
649
- interface Owner$1 {
732
+ interface Owner {
650
733
  id: string;
651
734
  type: string;
652
735
  }
653
- interface Owner$1 {
736
+ interface Owner {
654
737
  id: string;
655
738
  type: string;
656
739
  }
657
- interface Owner$1 {
740
+ interface Owner {
658
741
  id: string;
659
742
  type: string;
660
743
  }
@@ -672,15 +755,15 @@ interface FailureDetail {
672
755
  }
673
756
  interface Fee {
674
757
  code: string;
675
- amount: Amount$1;
758
+ amount: Amount;
676
759
  }
677
760
  interface Fee {
678
761
  code: string;
679
- amount: Amount$1;
762
+ amount: Amount;
680
763
  }
681
764
  interface Fee {
682
765
  code: string;
683
- amount: Amount$1;
766
+ amount: Amount;
684
767
  }
685
768
  interface Destination {
686
769
  type: string;
@@ -712,15 +795,15 @@ interface Source {
712
795
  financialAccountId: string;
713
796
  transactionReference: string;
714
797
  }
715
- interface Amount$1 {
798
+ interface Amount {
716
799
  currency: string;
717
800
  value: number;
718
801
  }
719
- interface Amount$1 {
802
+ interface Amount {
720
803
  currency: string;
721
804
  value: number;
722
805
  }
723
- interface Amount$1 {
806
+ interface Amount {
724
807
  currency: string;
725
808
  value: number;
726
809
  }
@@ -805,289 +888,199 @@ interface UpdateWebhookRequest {
805
888
  interface UpdateWebhookResponse extends Webhook {
806
889
  }
807
890
 
808
- interface GetTransaction {
809
- id: string;
810
- type: string;
811
- amount: Amount;
812
- timestamp: string;
813
- reference: string;
814
- financialAccount: FinancialAccount;
815
- originatingReversal: OriginatingReversal;
816
- originatingFee: OriginatingFee;
817
- ownershipGraph: OwnershipGraph;
818
- }
819
- interface AllTransaction {
820
- result: Transaction[];
821
- pagination: Pagination;
822
- }
823
- interface Transaction {
824
- id: string;
825
- type: string;
826
- amount: Amount;
827
- timestamp: string;
828
- reference: string;
829
- financialAccount: FinancialAccount;
830
- originatingReversal: OriginatingReversal;
831
- originatingFee: OriginatingFee;
832
- ownershipGraph: OwnershipGraph;
833
- }
834
- interface OwnershipGraph {
835
- owner: Owner2;
836
- }
837
- interface OwnershipGraph {
838
- owner: Owner2;
839
- }
840
- interface Owner2 {
841
- id: string;
842
- type: string;
843
- owner: Owner;
844
- }
845
- interface Owner2 {
846
- id: string;
847
- type: string;
848
- owner: Owner;
849
- }
850
- interface Owner {
851
- id: string;
852
- type: string;
891
+ interface BankFeature {
892
+ canPayTo?: boolean;
893
+ canPayFrom?: boolean;
894
+ canVerifyAccount?: boolean;
895
+ schemes?: string[];
896
+ metadata: Record<string, unknown>;
853
897
  }
854
- interface Owner {
855
- id: string;
856
- type: string;
898
+ interface BankFeatureSet {
899
+ payout: BankFeature;
900
+ payment: BankFeature;
901
+ kycVerification: BankFeature;
857
902
  }
858
- interface OriginatingFee {
859
- code: string;
903
+ interface Bank {
904
+ providerId: string;
905
+ name: string;
906
+ country: string;
907
+ status: {
908
+ active: boolean;
909
+ };
910
+ featureSet: BankFeatureSet;
911
+ createTime: string;
912
+ updateTime: string;
860
913
  }
861
- interface OriginatingFee {
862
- code: string;
914
+ interface ListBanksResponse {
915
+ result: Bank[];
916
+ pagination: Pagination;
863
917
  }
864
- interface OriginatingReversal {
865
- originTxnId: string;
866
- originTxnRef: string;
918
+ interface RetrieveBankResponse extends Bank {
867
919
  }
868
- interface OriginatingReversal {
869
- originTxnId: string;
870
- originTxnRef: string;
920
+
921
+ interface MomoFeature {
922
+ canPayTo?: boolean;
923
+ canPayFrom?: boolean;
924
+ canVerifyAccount?: boolean;
925
+ schemes?: string[];
926
+ metadata: Record<string, unknown>;
871
927
  }
872
- interface FinancialAccount {
873
- id: string;
874
- balance: Balance;
928
+ interface MomoFeatureSet {
929
+ payout: MomoFeature;
930
+ payment: MomoFeature;
931
+ kycVerification: MomoFeature;
875
932
  }
876
- interface FinancialAccount {
877
- id: string;
878
- balance: Balance;
933
+ interface Momo {
934
+ providerId: string;
935
+ name: string;
936
+ country: string;
937
+ status: {
938
+ active: boolean;
939
+ };
940
+ featureSet: MomoFeatureSet;
941
+ createTime: string;
942
+ updateTime: string;
879
943
  }
880
- interface Balance {
881
- after: Amount;
944
+ interface ListMomosResponse {
945
+ result: Momo[];
946
+ pagination: Pagination;
882
947
  }
883
- interface Balance {
884
- after: Amount;
948
+ interface RetrieveMomoResponse extends Momo {
885
949
  }
886
- interface Amount {
887
- currency: string;
888
- value: number;
950
+
951
+ interface RequestOptions {
952
+ path: string;
953
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
954
+ body?: unknown;
955
+ idempotencyKey?: string;
956
+ }
957
+ declare class HttpClient {
958
+ private readonly baseUrl;
959
+ protected readonly config: ClientConfig;
960
+ constructor(config: ClientConfig);
961
+ private getHeaders;
962
+ protected request<T>(options: RequestOptions): Promise<Result<T>>;
889
963
  }
890
- interface Amount {
891
- currency: string;
892
- value: number;
964
+
965
+ declare class CheckoutSessionAPI extends HttpClient {
966
+ private readonly path;
967
+ create(name: string, amount: number, quantity: number, successUrl: string, cancelUrl: string, options?: {
968
+ description?: string;
969
+ financialAccountId?: string;
970
+ primaryColor?: string;
971
+ images?: string[];
972
+ }): Promise<Result<CreateCheckoutResponse>>;
973
+ list(): Promise<Result<ListCheckoutsResponse>>;
974
+ retrieve(checkoutId: string): Promise<Result<RetrieveCheckoutResponse>>;
975
+ delete(checkoutId: string): Promise<Result<void>>;
893
976
  }
894
977
 
895
978
  type Currency = "USD" | "SLE";
979
+ declare class FinancialAccountAPI extends HttpClient {
980
+ private readonly path;
981
+ create(accountName: string, currency: Currency): Promise<Result<CreateFinancialAccountResponse>>;
982
+ retrieve(financialAccountId: string): Promise<Result<RetrieveFinancialAccountResponse>>;
983
+ list(): Promise<Result<ListFinancialAccountsResponse>>;
984
+ }
896
985
 
897
- declare function FinancialAccountAPI(config: ClientConfig): {
898
- create: (name: string, currency: Currency) => Promise<{
899
- success: boolean;
900
- data?: CreateFinancialAccount;
901
- error?: Error;
902
- }>;
903
- get: (financialAccountId: string) => Promise<{
904
- success: boolean;
905
- data?: GetFinancialAccount;
906
- error?: Error;
907
- }>;
908
- getAll: () => Promise<{
909
- success: boolean;
910
- data?: AllFinancialAccount;
911
- error?: Error;
912
- }>;
913
- };
986
+ declare class BankAPI extends HttpClient {
987
+ private readonly path;
988
+ retrieve(providerId: string): Promise<Result<RetrieveBankResponse>>;
989
+ list(): Promise<Result<ListBanksResponse>>;
990
+ }
914
991
 
915
- declare function FinancialTransactionAPI(config: ClientConfig): {
916
- get: (transactionId: string) => Promise<{
917
- success: boolean;
918
- error?: Error;
919
- data?: GetTransaction;
920
- }>;
921
- getAll: () => Promise<{
922
- success: boolean;
923
- error?: Error;
924
- data?: AllTransaction;
925
- }>;
926
- };
992
+ declare class MomoAPI extends HttpClient {
993
+ private readonly path;
994
+ retrieve(providerId: string): Promise<Result<RetrieveMomoResponse>>;
995
+ list(): Promise<Result<ListMomosResponse>>;
996
+ }
927
997
 
928
- declare function InternalTransferAPI(config: ClientConfig): {
929
- create: (sourceAccount: string, destinationAccount: string, amount: number) => Promise<{
930
- success: boolean;
931
- data?: CreateInternalTransfer;
932
- error?: Error;
933
- }>;
934
- get: (internalTransferId: string) => Promise<{
935
- success: boolean;
936
- data?: InternalTransfer;
937
- error?: Error;
938
- }>;
939
- getAll: () => Promise<{
940
- success: boolean;
941
- error?: Error;
942
- data?: AllInternalTransfers;
943
- }>;
944
- delete: (internalTransferId: string) => Promise<{
945
- success: boolean;
946
- error?: Error;
947
- }>;
948
- };
998
+ declare class FinancialTransactionAPI extends HttpClient {
999
+ private readonly path;
1000
+ list(): Promise<Result<ListTransactionsResponse>>;
1001
+ retrieve(transactionId: string): Promise<Result<RetrieveTransactionResponse>>;
1002
+ }
949
1003
 
950
- declare function PaymentAPI(config: ClientConfig): {
951
- get: (paymentId: string) => Promise<{
952
- success: boolean;
953
- data?: GetPayment;
954
- error?: Error;
955
- }>;
956
- getAll: (params?: Record<string, unknown>) => Promise<{
957
- success: boolean;
958
- data?: ListPayments;
959
- error?: Error;
960
- }>;
961
- patch: (paymentId: string, body: Record<string, unknown>) => Promise<{
962
- success: boolean;
963
- data?: PatchPayment;
964
- error?: Error;
965
- }>;
966
- };
1004
+ declare class InternalTransferAPI extends HttpClient {
1005
+ private readonly path;
1006
+ create(sourceAccount: string, destinationAccount: string, amount: number): Promise<Result<CreateInternalTransferResponse>>;
1007
+ list(): Promise<Result<ListInternalTransfersResponse>>;
1008
+ retrieve(internalTransferId: string): Promise<Result<RetrieveInternalTransferResponse>>;
1009
+ delete(internalTransferId: string): Promise<Result<void>>;
1010
+ }
967
1011
 
968
- declare function PaymentCodeAPI(config: ClientConfig): {
969
- create: (paymentName: string, amount: number, financialAccount: string, username: string, phoneNumber: string) => Promise<{
970
- success: boolean;
971
- data?: CreatePaymentCode;
972
- error?: Error;
973
- }>;
974
- delete: (paymentCodeId: string) => Promise<{
975
- success: boolean;
976
- error?: Error;
977
- }>;
978
- getAll: () => Promise<{
979
- success: boolean;
980
- data?: GetAllPaymentCode;
981
- error?: Error;
982
- }>;
983
- get: (paymentCodeId: string) => Promise<{
984
- success: boolean;
985
- data?: GetOne;
986
- error?: Error;
987
- }>;
988
- };
1012
+ declare class PaymentAPI extends HttpClient {
1013
+ private readonly path;
1014
+ retrieve(paymentId: string): Promise<Result<RetrievePaymentResponse>>;
1015
+ list(): Promise<Result<ListPaymentsResponse>>;
1016
+ update(paymentId: string, body: Record<string, unknown>): Promise<Result<UpdatePaymentResponse>>;
1017
+ }
989
1018
 
990
- declare function PayoutAPI(config: ClientConfig): {
991
- create: (amount: number, destination: DestinationOption, sourceAccount: string) => Promise<{
992
- success: boolean;
993
- data?: CreatePayout;
994
- error?: Error;
995
- }>;
996
- get: () => Promise<{
997
- success: boolean;
998
- data?: GetAll;
999
- error?: Error;
1000
- }>;
1001
- getOne: (payoutId: string) => Promise<{
1002
- success: boolean;
1003
- data?: GetOnePayout;
1004
- error?: Error;
1005
- }>;
1006
- delete: (payoutId: string) => Promise<{
1007
- success: boolean;
1008
- error?: Error;
1009
- }>;
1010
- };
1019
+ declare class PaymentCodeAPI extends HttpClient {
1020
+ private readonly path;
1021
+ create(paymentName: string, amount: number, financialAccountId: string | null, name: string, phoneNumber: string): Promise<Result<CreatePaymentCodeResponse>>;
1022
+ retrieve(paymentCodeId: string): Promise<Result<RetrievePaymentCodeResponse>>;
1023
+ list(): Promise<Result<ListPaymentCodesResponse>>;
1024
+ delete(paymentCodeId: string): Promise<Result<void>>;
1025
+ }
1011
1026
 
1012
- declare function ProviderKycAPI(config: ClientConfig): {
1013
- get: (providerId: string) => Promise<{
1014
- success: boolean;
1015
- data?: GetProviderKycResponse;
1016
- error?: Error;
1017
- }>;
1018
- };
1027
+ declare class PayoutAPI extends HttpClient {
1028
+ private readonly path;
1029
+ create(amount: number, sourceAccount: string, destination: DestinationOption): Promise<Result<CreatePayoutResponse>>;
1030
+ list(): Promise<Result<ListPayoutsResponse>>;
1031
+ retrieve(payoutId: string): Promise<Result<RetrievePayoutResponse>>;
1032
+ delete(payoutId: string): Promise<Result<void>>;
1033
+ }
1019
1034
 
1020
- declare function ReceiptAPI(config: ClientConfig): {
1021
- get: (orderNumber: string) => Promise<{
1022
- success: boolean;
1023
- data?: GetReceiptResponse;
1024
- error?: Error;
1025
- }>;
1026
- redeem: (orderNumber: string, body?: Record<string, unknown>) => Promise<{
1027
- success: boolean;
1028
- data?: RedeemReceiptResponse;
1029
- error?: Error;
1030
- }>;
1031
- };
1035
+ declare class ProviderKycAPI extends HttpClient {
1036
+ private readonly path;
1037
+ retrieve(providerId: string): Promise<Result<GetProviderKycResponse>>;
1038
+ }
1032
1039
 
1033
- declare function UssdOtpAPI(config: ClientConfig): {
1034
- create: (body: CreateUssdOtpRequest) => Promise<{
1035
- success: boolean;
1036
- data?: CreateUssdOtpResponse;
1037
- error?: Error;
1038
- }>;
1039
- };
1040
+ declare class ReceiptAPI extends HttpClient {
1041
+ private readonly path;
1042
+ retrieve(orderNumber: string): Promise<Result<GetReceiptResponse>>;
1043
+ redeem(orderNumber: string, body: Record<string, unknown>): Promise<Result<RedeemReceiptResponse>>;
1044
+ }
1040
1045
 
1041
- declare function WebhookAPI(config: ClientConfig): {
1042
- create: (body: CreateWebhookRequest) => Promise<{
1043
- success: boolean;
1044
- data?: CreateWebhookResponse;
1045
- error?: Error;
1046
- }>;
1047
- get: (webhookId: string) => Promise<{
1048
- success: boolean;
1049
- data?: GetWebhookResponse;
1050
- error?: Error;
1051
- }>;
1052
- getAll: () => Promise<{
1053
- success: boolean;
1054
- data?: ListWebhooksResponse;
1055
- error?: Error;
1056
- }>;
1057
- update: (webhookId: string, body: UpdateWebhookRequest) => Promise<{
1058
- success: boolean;
1059
- data?: UpdateWebhookResponse;
1060
- error?: Error;
1061
- }>;
1062
- delete: (webhookId: string) => Promise<{
1063
- success: boolean;
1064
- error?: Error;
1065
- }>;
1066
- };
1046
+ declare class UssdOtpAPI extends HttpClient {
1047
+ private readonly path;
1048
+ create(body: CreateUssdOtpRequest): Promise<Result<CreateUssdOtpResponse>>;
1049
+ }
1050
+
1051
+ declare class WebhookAPI extends HttpClient {
1052
+ private readonly path;
1053
+ create(body: CreateWebhookRequest): Promise<Result<CreateWebhookResponse>>;
1054
+ retrieve(webhookId: string): Promise<Result<GetWebhookResponse>>;
1055
+ list(): Promise<Result<ListWebhooksResponse>>;
1056
+ update(webhookId: string, body: UpdateWebhookRequest): Promise<Result<UpdateWebhookResponse>>;
1057
+ delete(webhookId: string): Promise<Result<void>>;
1058
+ }
1067
1059
 
1068
1060
  interface ClientOptions {
1069
- monimeSpaceId: string;
1070
- accessToken: string;
1061
+ monimeSpaceId?: string;
1062
+ accessToken?: string;
1071
1063
  monimeVersion?: "caph.2025-08-23" | "caph.2025-06-20";
1072
1064
  }
1073
1065
  declare class MonimeClient {
1074
- private monimeSpaceId;
1075
- private accessToken;
1076
- private monimeVersion?;
1077
- financialAccount: ReturnType<typeof FinancialAccountAPI>;
1078
- internalTransfer: ReturnType<typeof InternalTransferAPI>;
1079
- paymentCode: ReturnType<typeof PaymentCodeAPI>;
1080
- payment: ReturnType<typeof PaymentAPI>;
1081
- payout: ReturnType<typeof PayoutAPI>;
1082
- providerKyc: ReturnType<typeof ProviderKycAPI>;
1083
- receipt: ReturnType<typeof ReceiptAPI>;
1084
- ussdOtp: ReturnType<typeof UssdOtpAPI>;
1085
- webhook: ReturnType<typeof WebhookAPI>;
1086
- financialTransaction: ReturnType<typeof FinancialTransactionAPI>;
1087
- checkoutSession: ReturnType<typeof CheckoutSessionAPI>;
1088
- constructor(options: ClientOptions);
1066
+ financialAccount: FinancialAccountAPI;
1067
+ internalTransfer: InternalTransferAPI;
1068
+ paymentCode: PaymentCodeAPI;
1069
+ payment: PaymentAPI;
1070
+ payout: PayoutAPI;
1071
+ providerKyc: ProviderKycAPI;
1072
+ receipt: ReceiptAPI;
1073
+ ussdOtp: UssdOtpAPI;
1074
+ webhook: WebhookAPI;
1075
+ financialTransaction: FinancialTransactionAPI;
1076
+ checkoutSession: CheckoutSessionAPI;
1077
+ financialProvider: {
1078
+ bank: BankAPI;
1079
+ momo: MomoAPI;
1080
+ };
1081
+ constructor(options?: ClientOptions);
1089
1082
  }
1090
1083
 
1091
1084
  declare function createClient(options: ClientOptions): MonimeClient;
1092
1085
 
1093
- export { type AllCheckout, type AllFinancialAccount, type AllInternalTransfers, type AllTransaction, type ClientOptions, type CreateCheckout, type CreateFinancialAccount, type CreateInternalTransfer, type CreatePaymentCode, type CreatePayout, type CreateUssdOtpRequest, type CreateUssdOtpResponse, type CreateWebhookRequest, type CreateWebhookResponse, type DestinationOption, type GetAll, type GetAllPaymentCode, type GetFinancialAccount, type GetOne, type GetOnePayout, type GetPayment, type GetProviderKycResponse, type GetReceiptResponse, type GetTransaction, type GetWebhookResponse, type InternalTransfer, type ListPayments, type ListWebhooksResponse, MonimeClient, type OneCheckout, type PatchPayment, type Payment, type ProviderKyc, type Receipt, type RedeemReceiptResponse, type UpdateWebhookRequest, type UpdateWebhookResponse, type UssdOtp, type Webhook, type WebhookVerificationMethod, createClient };
1086
+ export { type Bank, type BankFeature, type BankFeatureSet, type ClientConfig, type ClientOptions, type CreateCheckoutResponse, type CreateFinancialAccountResponse, type CreateInternalTransferResponse, type CreatePaymentCodeResponse, type CreatePayoutResponse, type CreateUssdOtpRequest, type CreateUssdOtpResponse, type CreateWebhookRequest, type CreateWebhookResponse, type DestinationOption, type GetProviderKycResponse, type GetReceiptResponse, type GetWebhookResponse, type ListBanksResponse, type ListCheckoutsResponse, type ListFinancialAccountsResponse, type ListInternalTransfersResponse, type ListMomosResponse, type ListPaymentCodesResponse, type ListPaymentsResponse, type ListPayoutsResponse, type ListTransactionsResponse, type ListWebhooksResponse, type Momo, type MomoFeature, type MomoFeatureSet, MonimeAuthenticationError, MonimeClient, MonimeError, MonimeValidationError, type Pagination, type Payment, type ProviderKyc, type Receipt, type RedeemReceiptResponse, type Result, type RetrieveBankResponse, type RetrieveCheckoutResponse, type RetrieveFinancialAccountResponse, type RetrieveInternalTransferResponse, type RetrieveMomoResponse, type RetrievePaymentCodeResponse, type RetrievePaymentResponse, type RetrievePayoutResponse, type RetrieveTransactionResponse, type UpdatePaymentResponse, type UpdateWebhookRequest, type UpdateWebhookResponse, type UssdOtp, type Webhook, type WebhookVerificationMethod, createClient };