monime-package 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/dist/index.d.mts +240 -1
- package/dist/index.d.ts +240 -1
- package/dist/index.js +1 -732
- package/dist/index.mjs +1 -694
- package/package.json +1 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -70,6 +70,7 @@ Recommended to store credentials in `.env`:
|
|
|
70
70
|
```bash
|
|
71
71
|
MONIME_SPACE_ID=space_XXXXXXXX
|
|
72
72
|
MONIME_ACCESS_TOKEN=sk_live_xxx
|
|
73
|
+
MONIME_VERSION=caph.2025-08-23 # Optional, defaults to latest
|
|
73
74
|
```
|
|
74
75
|
|
|
75
76
|
You can also pass credentials directly when creating the client.
|
|
@@ -86,6 +87,7 @@ import { createClient } from "monime-package";
|
|
|
86
87
|
const client = createClient({
|
|
87
88
|
monimeSpaceId: process.env.MONIME_SPACE_ID!,
|
|
88
89
|
accessToken: process.env.MONIME_ACCESS_TOKEN!,
|
|
90
|
+
monimeVersion: "caph.2025-08-23", // Optional
|
|
89
91
|
});
|
|
90
92
|
```
|
|
91
93
|
|
|
@@ -117,6 +119,72 @@ type Result<T> = {
|
|
|
117
119
|
|
|
118
120
|
The client exposes namespaced APIs under `client.<module>`. Below is the complete API reference:
|
|
119
121
|
|
|
122
|
+
### Payments (New)
|
|
123
|
+
|
|
124
|
+
Manage all incoming payments (payins).
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
// Get payment details
|
|
128
|
+
client.payment.get(paymentId: string): Promise<Result<GetPayment>>
|
|
129
|
+
|
|
130
|
+
// List payments
|
|
131
|
+
client.payment.getAll(params?: any): Promise<Result<ListPayments>>
|
|
132
|
+
|
|
133
|
+
// Patch payment
|
|
134
|
+
client.payment.patch(paymentId: string, body: any): Promise<Result<PatchPayment>>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Webhooks (New)
|
|
138
|
+
|
|
139
|
+
Manage webhooks for real-time notifications.
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
// Create webhook
|
|
143
|
+
client.webhook.create(body: CreateWebhookRequest): Promise<Result<CreateWebhookResponse>>
|
|
144
|
+
|
|
145
|
+
// Get webhook
|
|
146
|
+
client.webhook.get(webhookId: string): Promise<Result<GetWebhookResponse>>
|
|
147
|
+
|
|
148
|
+
// List webhooks
|
|
149
|
+
client.webhook.getAll(): Promise<Result<ListWebhooksResponse>>
|
|
150
|
+
|
|
151
|
+
// Update webhook
|
|
152
|
+
client.webhook.update(webhookId: string, body: UpdateWebhookRequest): Promise<Result<UpdateWebhookResponse>>
|
|
153
|
+
|
|
154
|
+
// Delete webhook
|
|
155
|
+
client.webhook.delete(webhookId: string): Promise<{ success: boolean; error?: Error }>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Receipts (New)
|
|
159
|
+
|
|
160
|
+
Manage payment receipts.
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
// Get receipt
|
|
164
|
+
client.receipt.get(orderNumber: string): Promise<Result<GetReceiptResponse>>
|
|
165
|
+
|
|
166
|
+
// Redeem receipt
|
|
167
|
+
client.receipt.redeem(orderNumber: string, body: any): Promise<Result<RedeemReceiptResponse>>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### USSD OTPs (New)
|
|
171
|
+
|
|
172
|
+
Generate USSD OTPs.
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
// Create USSD OTP
|
|
176
|
+
client.ussdOtp.create(body: CreateUssdOtpRequest): Promise<Result<CreateUssdOtpResponse>>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Provider KYC (New)
|
|
180
|
+
|
|
181
|
+
Get provider KYC details.
|
|
182
|
+
|
|
183
|
+
```ts
|
|
184
|
+
// Get provider KYC
|
|
185
|
+
client.providerKyc.get(providerId: string): Promise<Result<GetProviderKycResponse>>
|
|
186
|
+
```
|
|
187
|
+
|
|
120
188
|
### Financial Accounts
|
|
121
189
|
|
|
122
190
|
Manage digital wallets and financial accounts.
|
|
@@ -387,6 +455,7 @@ The client accepts the following options (see `src/client.ts`):
|
|
|
387
455
|
type ClientOptions = {
|
|
388
456
|
monimeSpaceId: string; // Your Monime Space ID
|
|
389
457
|
accessToken: string; // Your Monime API token
|
|
458
|
+
monimeVersion?: "caph.2025-08-23" | "caph.2025-06-20"; // API Version
|
|
390
459
|
};
|
|
391
460
|
```
|
|
392
461
|
|
package/dist/index.d.mts
CHANGED
|
@@ -753,6 +753,163 @@ interface Amount$1 {
|
|
|
753
753
|
value: number;
|
|
754
754
|
}
|
|
755
755
|
|
|
756
|
+
interface Payment {
|
|
757
|
+
id: string;
|
|
758
|
+
status: "pending" | "processing" | "completed" | "failed";
|
|
759
|
+
amount: {
|
|
760
|
+
currency: string;
|
|
761
|
+
value: number;
|
|
762
|
+
};
|
|
763
|
+
channel: {
|
|
764
|
+
type: "bank" | "card" | "momo" | "wallet";
|
|
765
|
+
};
|
|
766
|
+
name: string | null;
|
|
767
|
+
reference: string | null;
|
|
768
|
+
orderNumber: string | null;
|
|
769
|
+
financialAccountId: string | null;
|
|
770
|
+
financialTransactionReference: string | null;
|
|
771
|
+
fees: Array<{
|
|
772
|
+
code: string;
|
|
773
|
+
amount: {
|
|
774
|
+
currency: string;
|
|
775
|
+
value: number;
|
|
776
|
+
};
|
|
777
|
+
}>;
|
|
778
|
+
createTime: string;
|
|
779
|
+
updateTime: string;
|
|
780
|
+
ownershipGraph: {
|
|
781
|
+
owner: {
|
|
782
|
+
id: string;
|
|
783
|
+
type: string;
|
|
784
|
+
metadata: Record<string, any> | null;
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
metadata: Record<string, any> | null;
|
|
788
|
+
}
|
|
789
|
+
interface GetPayment {
|
|
790
|
+
success: boolean;
|
|
791
|
+
messages: string[];
|
|
792
|
+
result: Payment;
|
|
793
|
+
}
|
|
794
|
+
interface ListPayments {
|
|
795
|
+
success: boolean;
|
|
796
|
+
messages: string[];
|
|
797
|
+
result: Payment[];
|
|
798
|
+
pagination: {
|
|
799
|
+
next: string | null;
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
interface PatchPayment {
|
|
803
|
+
success: boolean;
|
|
804
|
+
messages: string[];
|
|
805
|
+
result: Payment;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
interface WebhookVerificationMethod {
|
|
809
|
+
type: "HS256" | "ES256";
|
|
810
|
+
secret: string;
|
|
811
|
+
}
|
|
812
|
+
interface Webhook {
|
|
813
|
+
id: string;
|
|
814
|
+
name: string;
|
|
815
|
+
url: string;
|
|
816
|
+
enabled: boolean;
|
|
817
|
+
events: string[];
|
|
818
|
+
apiRelease: string;
|
|
819
|
+
verificationMethod: WebhookVerificationMethod;
|
|
820
|
+
headers: Record<string, string>;
|
|
821
|
+
alertEmails: string[];
|
|
822
|
+
createTime: string;
|
|
823
|
+
updateTime: string;
|
|
824
|
+
metadata: Record<string, any>;
|
|
825
|
+
}
|
|
826
|
+
interface CreateWebhookRequest {
|
|
827
|
+
name: string;
|
|
828
|
+
url: string;
|
|
829
|
+
events: string[];
|
|
830
|
+
enabled?: boolean;
|
|
831
|
+
apiRelease?: string;
|
|
832
|
+
headers?: Record<string, string>;
|
|
833
|
+
alertEmails?: string[];
|
|
834
|
+
verificationMethod?: WebhookVerificationMethod;
|
|
835
|
+
metadata?: Record<string, any>;
|
|
836
|
+
}
|
|
837
|
+
interface CreateWebhookResponse {
|
|
838
|
+
success: boolean;
|
|
839
|
+
messages: string[];
|
|
840
|
+
result: Webhook;
|
|
841
|
+
}
|
|
842
|
+
interface GetWebhookResponse {
|
|
843
|
+
success: boolean;
|
|
844
|
+
messages: string[];
|
|
845
|
+
result: Webhook;
|
|
846
|
+
}
|
|
847
|
+
interface ListWebhooksResponse {
|
|
848
|
+
success: boolean;
|
|
849
|
+
messages: string[];
|
|
850
|
+
result: Webhook[];
|
|
851
|
+
pagination?: {
|
|
852
|
+
next: string | null;
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
interface UpdateWebhookRequest {
|
|
856
|
+
name?: string;
|
|
857
|
+
url?: string;
|
|
858
|
+
events?: string[];
|
|
859
|
+
enabled?: boolean;
|
|
860
|
+
headers?: Record<string, string>;
|
|
861
|
+
alertEmails?: string[];
|
|
862
|
+
verificationMethod?: WebhookVerificationMethod;
|
|
863
|
+
metadata?: Record<string, any>;
|
|
864
|
+
}
|
|
865
|
+
interface UpdateWebhookResponse {
|
|
866
|
+
success: boolean;
|
|
867
|
+
messages: string[];
|
|
868
|
+
result: Webhook;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
interface Receipt {
|
|
872
|
+
orderNumber: string;
|
|
873
|
+
[key: string]: any;
|
|
874
|
+
}
|
|
875
|
+
interface GetReceiptResponse {
|
|
876
|
+
success: boolean;
|
|
877
|
+
messages: string[];
|
|
878
|
+
result: Receipt;
|
|
879
|
+
}
|
|
880
|
+
interface RedeemReceiptResponse {
|
|
881
|
+
success: boolean;
|
|
882
|
+
messages: string[];
|
|
883
|
+
result: Receipt;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
interface UssdOtp {
|
|
887
|
+
id: string;
|
|
888
|
+
phoneNumber: string;
|
|
889
|
+
otp: string;
|
|
890
|
+
expiresAt: string;
|
|
891
|
+
[key: string]: any;
|
|
892
|
+
}
|
|
893
|
+
interface CreateUssdOtpRequest {
|
|
894
|
+
phoneNumber: string;
|
|
895
|
+
[key: string]: any;
|
|
896
|
+
}
|
|
897
|
+
interface CreateUssdOtpResponse {
|
|
898
|
+
success: boolean;
|
|
899
|
+
messages: string[];
|
|
900
|
+
result: UssdOtp;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
interface ProviderKyc {
|
|
904
|
+
providerId: string;
|
|
905
|
+
[key: string]: any;
|
|
906
|
+
}
|
|
907
|
+
interface GetProviderKycResponse {
|
|
908
|
+
success: boolean;
|
|
909
|
+
messages: string[];
|
|
910
|
+
result: ProviderKyc;
|
|
911
|
+
}
|
|
912
|
+
|
|
756
913
|
type Currency = "USD" | "SLE";
|
|
757
914
|
|
|
758
915
|
declare function FinancialAccountAPI(client: MonimeClient): {
|
|
@@ -906,6 +1063,24 @@ declare function InternalTransferAPI(client: MonimeClient): {
|
|
|
906
1063
|
}>;
|
|
907
1064
|
};
|
|
908
1065
|
|
|
1066
|
+
declare function PaymentAPI(client: MonimeClient): {
|
|
1067
|
+
get: (paymentId: string) => Promise<{
|
|
1068
|
+
success: boolean;
|
|
1069
|
+
data?: GetPayment;
|
|
1070
|
+
error?: Error;
|
|
1071
|
+
}>;
|
|
1072
|
+
getAll: (params?: Record<string, any>) => Promise<{
|
|
1073
|
+
success: boolean;
|
|
1074
|
+
data?: ListPayments;
|
|
1075
|
+
error?: Error;
|
|
1076
|
+
}>;
|
|
1077
|
+
patch: (paymentId: string, body: Record<string, any>) => Promise<{
|
|
1078
|
+
success: boolean;
|
|
1079
|
+
data?: PatchPayment;
|
|
1080
|
+
error?: Error;
|
|
1081
|
+
}>;
|
|
1082
|
+
};
|
|
1083
|
+
|
|
909
1084
|
declare function PaymentCodeAPI(client: MonimeClient): {
|
|
910
1085
|
create: (paymentName: string, amount: number, financialAccount: string, username: string, phoneNumber: string) => Promise<{
|
|
911
1086
|
success: boolean;
|
|
@@ -950,26 +1125,90 @@ declare function PayoutAPI(client: MonimeClient): {
|
|
|
950
1125
|
}>;
|
|
951
1126
|
};
|
|
952
1127
|
|
|
1128
|
+
declare function ProviderKycAPI(client: MonimeClient): {
|
|
1129
|
+
get: (providerId: string) => Promise<{
|
|
1130
|
+
success: boolean;
|
|
1131
|
+
data?: GetProviderKycResponse;
|
|
1132
|
+
error?: Error;
|
|
1133
|
+
}>;
|
|
1134
|
+
};
|
|
1135
|
+
|
|
1136
|
+
declare function ReceiptAPI(client: MonimeClient): {
|
|
1137
|
+
get: (orderNumber: string) => Promise<{
|
|
1138
|
+
success: boolean;
|
|
1139
|
+
data?: GetReceiptResponse;
|
|
1140
|
+
error?: Error;
|
|
1141
|
+
}>;
|
|
1142
|
+
redeem: (orderNumber: string, body?: Record<string, any>) => Promise<{
|
|
1143
|
+
success: boolean;
|
|
1144
|
+
data?: RedeemReceiptResponse;
|
|
1145
|
+
error?: Error;
|
|
1146
|
+
}>;
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
declare function UssdOtpAPI(client: MonimeClient): {
|
|
1150
|
+
create: (body: CreateUssdOtpRequest) => Promise<{
|
|
1151
|
+
success: boolean;
|
|
1152
|
+
data?: CreateUssdOtpResponse;
|
|
1153
|
+
error?: Error;
|
|
1154
|
+
}>;
|
|
1155
|
+
};
|
|
1156
|
+
|
|
1157
|
+
declare function WebhookAPI(client: MonimeClient): {
|
|
1158
|
+
create: (body: CreateWebhookRequest) => Promise<{
|
|
1159
|
+
success: boolean;
|
|
1160
|
+
data?: CreateWebhookResponse;
|
|
1161
|
+
error?: Error;
|
|
1162
|
+
}>;
|
|
1163
|
+
get: (webhookId: string) => Promise<{
|
|
1164
|
+
success: boolean;
|
|
1165
|
+
data?: GetWebhookResponse;
|
|
1166
|
+
error?: Error;
|
|
1167
|
+
}>;
|
|
1168
|
+
getAll: () => Promise<{
|
|
1169
|
+
success: boolean;
|
|
1170
|
+
data?: ListWebhooksResponse;
|
|
1171
|
+
error?: Error;
|
|
1172
|
+
}>;
|
|
1173
|
+
update: (webhookId: string, body: UpdateWebhookRequest) => Promise<{
|
|
1174
|
+
success: boolean;
|
|
1175
|
+
data?: UpdateWebhookResponse;
|
|
1176
|
+
error?: Error;
|
|
1177
|
+
}>;
|
|
1178
|
+
delete: (webhookId: string) => Promise<{
|
|
1179
|
+
success: boolean;
|
|
1180
|
+
error?: Error;
|
|
1181
|
+
}>;
|
|
1182
|
+
};
|
|
1183
|
+
|
|
953
1184
|
interface ClientOptions {
|
|
954
1185
|
monimeSpaceId: string;
|
|
955
1186
|
accessToken: string;
|
|
1187
|
+
monimeVersion?: "caph.2025-08-23" | "caph.2025-06-20";
|
|
956
1188
|
}
|
|
957
1189
|
declare class MonimeClient {
|
|
958
1190
|
private monimeSpaceId;
|
|
959
1191
|
private accessToken;
|
|
1192
|
+
private monimeVersion?;
|
|
960
1193
|
financialAccount: ReturnType<typeof FinancialAccountAPI>;
|
|
961
1194
|
internalTransfer: ReturnType<typeof InternalTransferAPI>;
|
|
962
1195
|
paymentCode: ReturnType<typeof PaymentCodeAPI>;
|
|
1196
|
+
payment: ReturnType<typeof PaymentAPI>;
|
|
963
1197
|
payout: ReturnType<typeof PayoutAPI>;
|
|
1198
|
+
providerKyc: ReturnType<typeof ProviderKycAPI>;
|
|
1199
|
+
receipt: ReturnType<typeof ReceiptAPI>;
|
|
1200
|
+
ussdOtp: ReturnType<typeof UssdOtpAPI>;
|
|
1201
|
+
webhook: ReturnType<typeof WebhookAPI>;
|
|
964
1202
|
financialTransaction: ReturnType<typeof FinancialTransactionAPI>;
|
|
965
1203
|
checkoutSession: ReturnType<typeof CheckoutSessionAPI>;
|
|
966
1204
|
constructor(options: ClientOptions);
|
|
967
1205
|
_getConfig(): {
|
|
968
1206
|
monimeSpaceId: string;
|
|
969
1207
|
accessToken: string;
|
|
1208
|
+
monimeVersion: string | undefined;
|
|
970
1209
|
};
|
|
971
1210
|
}
|
|
972
1211
|
|
|
973
1212
|
declare function createClient(options: ClientOptions): MonimeClient;
|
|
974
1213
|
|
|
975
|
-
export { type AllFinancialAccount, type AllInternalTransfers, type ClientOptions, type CreateFinancialAccount, type CreateInternalTransfer, type CreatePaymentCode, type CreatePayout, type DestinationOption, type GetAll, type GetAllPaymentCode, type GetFinancialAccount, type GetOne, type GetOnePayout, type InternalTransfer, MonimeClient, createClient };
|
|
1214
|
+
export { type AllFinancialAccount, type AllInternalTransfers, type ClientOptions, 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 GetWebhookResponse, type InternalTransfer, type ListPayments, type ListWebhooksResponse, MonimeClient, type PatchPayment, type Payment, type ProviderKyc, type Receipt, type RedeemReceiptResponse, type UpdateWebhookRequest, type UpdateWebhookResponse, type UssdOtp, type Webhook, type WebhookVerificationMethod, createClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -753,6 +753,163 @@ interface Amount$1 {
|
|
|
753
753
|
value: number;
|
|
754
754
|
}
|
|
755
755
|
|
|
756
|
+
interface Payment {
|
|
757
|
+
id: string;
|
|
758
|
+
status: "pending" | "processing" | "completed" | "failed";
|
|
759
|
+
amount: {
|
|
760
|
+
currency: string;
|
|
761
|
+
value: number;
|
|
762
|
+
};
|
|
763
|
+
channel: {
|
|
764
|
+
type: "bank" | "card" | "momo" | "wallet";
|
|
765
|
+
};
|
|
766
|
+
name: string | null;
|
|
767
|
+
reference: string | null;
|
|
768
|
+
orderNumber: string | null;
|
|
769
|
+
financialAccountId: string | null;
|
|
770
|
+
financialTransactionReference: string | null;
|
|
771
|
+
fees: Array<{
|
|
772
|
+
code: string;
|
|
773
|
+
amount: {
|
|
774
|
+
currency: string;
|
|
775
|
+
value: number;
|
|
776
|
+
};
|
|
777
|
+
}>;
|
|
778
|
+
createTime: string;
|
|
779
|
+
updateTime: string;
|
|
780
|
+
ownershipGraph: {
|
|
781
|
+
owner: {
|
|
782
|
+
id: string;
|
|
783
|
+
type: string;
|
|
784
|
+
metadata: Record<string, any> | null;
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
metadata: Record<string, any> | null;
|
|
788
|
+
}
|
|
789
|
+
interface GetPayment {
|
|
790
|
+
success: boolean;
|
|
791
|
+
messages: string[];
|
|
792
|
+
result: Payment;
|
|
793
|
+
}
|
|
794
|
+
interface ListPayments {
|
|
795
|
+
success: boolean;
|
|
796
|
+
messages: string[];
|
|
797
|
+
result: Payment[];
|
|
798
|
+
pagination: {
|
|
799
|
+
next: string | null;
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
interface PatchPayment {
|
|
803
|
+
success: boolean;
|
|
804
|
+
messages: string[];
|
|
805
|
+
result: Payment;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
interface WebhookVerificationMethod {
|
|
809
|
+
type: "HS256" | "ES256";
|
|
810
|
+
secret: string;
|
|
811
|
+
}
|
|
812
|
+
interface Webhook {
|
|
813
|
+
id: string;
|
|
814
|
+
name: string;
|
|
815
|
+
url: string;
|
|
816
|
+
enabled: boolean;
|
|
817
|
+
events: string[];
|
|
818
|
+
apiRelease: string;
|
|
819
|
+
verificationMethod: WebhookVerificationMethod;
|
|
820
|
+
headers: Record<string, string>;
|
|
821
|
+
alertEmails: string[];
|
|
822
|
+
createTime: string;
|
|
823
|
+
updateTime: string;
|
|
824
|
+
metadata: Record<string, any>;
|
|
825
|
+
}
|
|
826
|
+
interface CreateWebhookRequest {
|
|
827
|
+
name: string;
|
|
828
|
+
url: string;
|
|
829
|
+
events: string[];
|
|
830
|
+
enabled?: boolean;
|
|
831
|
+
apiRelease?: string;
|
|
832
|
+
headers?: Record<string, string>;
|
|
833
|
+
alertEmails?: string[];
|
|
834
|
+
verificationMethod?: WebhookVerificationMethod;
|
|
835
|
+
metadata?: Record<string, any>;
|
|
836
|
+
}
|
|
837
|
+
interface CreateWebhookResponse {
|
|
838
|
+
success: boolean;
|
|
839
|
+
messages: string[];
|
|
840
|
+
result: Webhook;
|
|
841
|
+
}
|
|
842
|
+
interface GetWebhookResponse {
|
|
843
|
+
success: boolean;
|
|
844
|
+
messages: string[];
|
|
845
|
+
result: Webhook;
|
|
846
|
+
}
|
|
847
|
+
interface ListWebhooksResponse {
|
|
848
|
+
success: boolean;
|
|
849
|
+
messages: string[];
|
|
850
|
+
result: Webhook[];
|
|
851
|
+
pagination?: {
|
|
852
|
+
next: string | null;
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
interface UpdateWebhookRequest {
|
|
856
|
+
name?: string;
|
|
857
|
+
url?: string;
|
|
858
|
+
events?: string[];
|
|
859
|
+
enabled?: boolean;
|
|
860
|
+
headers?: Record<string, string>;
|
|
861
|
+
alertEmails?: string[];
|
|
862
|
+
verificationMethod?: WebhookVerificationMethod;
|
|
863
|
+
metadata?: Record<string, any>;
|
|
864
|
+
}
|
|
865
|
+
interface UpdateWebhookResponse {
|
|
866
|
+
success: boolean;
|
|
867
|
+
messages: string[];
|
|
868
|
+
result: Webhook;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
interface Receipt {
|
|
872
|
+
orderNumber: string;
|
|
873
|
+
[key: string]: any;
|
|
874
|
+
}
|
|
875
|
+
interface GetReceiptResponse {
|
|
876
|
+
success: boolean;
|
|
877
|
+
messages: string[];
|
|
878
|
+
result: Receipt;
|
|
879
|
+
}
|
|
880
|
+
interface RedeemReceiptResponse {
|
|
881
|
+
success: boolean;
|
|
882
|
+
messages: string[];
|
|
883
|
+
result: Receipt;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
interface UssdOtp {
|
|
887
|
+
id: string;
|
|
888
|
+
phoneNumber: string;
|
|
889
|
+
otp: string;
|
|
890
|
+
expiresAt: string;
|
|
891
|
+
[key: string]: any;
|
|
892
|
+
}
|
|
893
|
+
interface CreateUssdOtpRequest {
|
|
894
|
+
phoneNumber: string;
|
|
895
|
+
[key: string]: any;
|
|
896
|
+
}
|
|
897
|
+
interface CreateUssdOtpResponse {
|
|
898
|
+
success: boolean;
|
|
899
|
+
messages: string[];
|
|
900
|
+
result: UssdOtp;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
interface ProviderKyc {
|
|
904
|
+
providerId: string;
|
|
905
|
+
[key: string]: any;
|
|
906
|
+
}
|
|
907
|
+
interface GetProviderKycResponse {
|
|
908
|
+
success: boolean;
|
|
909
|
+
messages: string[];
|
|
910
|
+
result: ProviderKyc;
|
|
911
|
+
}
|
|
912
|
+
|
|
756
913
|
type Currency = "USD" | "SLE";
|
|
757
914
|
|
|
758
915
|
declare function FinancialAccountAPI(client: MonimeClient): {
|
|
@@ -906,6 +1063,24 @@ declare function InternalTransferAPI(client: MonimeClient): {
|
|
|
906
1063
|
}>;
|
|
907
1064
|
};
|
|
908
1065
|
|
|
1066
|
+
declare function PaymentAPI(client: MonimeClient): {
|
|
1067
|
+
get: (paymentId: string) => Promise<{
|
|
1068
|
+
success: boolean;
|
|
1069
|
+
data?: GetPayment;
|
|
1070
|
+
error?: Error;
|
|
1071
|
+
}>;
|
|
1072
|
+
getAll: (params?: Record<string, any>) => Promise<{
|
|
1073
|
+
success: boolean;
|
|
1074
|
+
data?: ListPayments;
|
|
1075
|
+
error?: Error;
|
|
1076
|
+
}>;
|
|
1077
|
+
patch: (paymentId: string, body: Record<string, any>) => Promise<{
|
|
1078
|
+
success: boolean;
|
|
1079
|
+
data?: PatchPayment;
|
|
1080
|
+
error?: Error;
|
|
1081
|
+
}>;
|
|
1082
|
+
};
|
|
1083
|
+
|
|
909
1084
|
declare function PaymentCodeAPI(client: MonimeClient): {
|
|
910
1085
|
create: (paymentName: string, amount: number, financialAccount: string, username: string, phoneNumber: string) => Promise<{
|
|
911
1086
|
success: boolean;
|
|
@@ -950,26 +1125,90 @@ declare function PayoutAPI(client: MonimeClient): {
|
|
|
950
1125
|
}>;
|
|
951
1126
|
};
|
|
952
1127
|
|
|
1128
|
+
declare function ProviderKycAPI(client: MonimeClient): {
|
|
1129
|
+
get: (providerId: string) => Promise<{
|
|
1130
|
+
success: boolean;
|
|
1131
|
+
data?: GetProviderKycResponse;
|
|
1132
|
+
error?: Error;
|
|
1133
|
+
}>;
|
|
1134
|
+
};
|
|
1135
|
+
|
|
1136
|
+
declare function ReceiptAPI(client: MonimeClient): {
|
|
1137
|
+
get: (orderNumber: string) => Promise<{
|
|
1138
|
+
success: boolean;
|
|
1139
|
+
data?: GetReceiptResponse;
|
|
1140
|
+
error?: Error;
|
|
1141
|
+
}>;
|
|
1142
|
+
redeem: (orderNumber: string, body?: Record<string, any>) => Promise<{
|
|
1143
|
+
success: boolean;
|
|
1144
|
+
data?: RedeemReceiptResponse;
|
|
1145
|
+
error?: Error;
|
|
1146
|
+
}>;
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
declare function UssdOtpAPI(client: MonimeClient): {
|
|
1150
|
+
create: (body: CreateUssdOtpRequest) => Promise<{
|
|
1151
|
+
success: boolean;
|
|
1152
|
+
data?: CreateUssdOtpResponse;
|
|
1153
|
+
error?: Error;
|
|
1154
|
+
}>;
|
|
1155
|
+
};
|
|
1156
|
+
|
|
1157
|
+
declare function WebhookAPI(client: MonimeClient): {
|
|
1158
|
+
create: (body: CreateWebhookRequest) => Promise<{
|
|
1159
|
+
success: boolean;
|
|
1160
|
+
data?: CreateWebhookResponse;
|
|
1161
|
+
error?: Error;
|
|
1162
|
+
}>;
|
|
1163
|
+
get: (webhookId: string) => Promise<{
|
|
1164
|
+
success: boolean;
|
|
1165
|
+
data?: GetWebhookResponse;
|
|
1166
|
+
error?: Error;
|
|
1167
|
+
}>;
|
|
1168
|
+
getAll: () => Promise<{
|
|
1169
|
+
success: boolean;
|
|
1170
|
+
data?: ListWebhooksResponse;
|
|
1171
|
+
error?: Error;
|
|
1172
|
+
}>;
|
|
1173
|
+
update: (webhookId: string, body: UpdateWebhookRequest) => Promise<{
|
|
1174
|
+
success: boolean;
|
|
1175
|
+
data?: UpdateWebhookResponse;
|
|
1176
|
+
error?: Error;
|
|
1177
|
+
}>;
|
|
1178
|
+
delete: (webhookId: string) => Promise<{
|
|
1179
|
+
success: boolean;
|
|
1180
|
+
error?: Error;
|
|
1181
|
+
}>;
|
|
1182
|
+
};
|
|
1183
|
+
|
|
953
1184
|
interface ClientOptions {
|
|
954
1185
|
monimeSpaceId: string;
|
|
955
1186
|
accessToken: string;
|
|
1187
|
+
monimeVersion?: "caph.2025-08-23" | "caph.2025-06-20";
|
|
956
1188
|
}
|
|
957
1189
|
declare class MonimeClient {
|
|
958
1190
|
private monimeSpaceId;
|
|
959
1191
|
private accessToken;
|
|
1192
|
+
private monimeVersion?;
|
|
960
1193
|
financialAccount: ReturnType<typeof FinancialAccountAPI>;
|
|
961
1194
|
internalTransfer: ReturnType<typeof InternalTransferAPI>;
|
|
962
1195
|
paymentCode: ReturnType<typeof PaymentCodeAPI>;
|
|
1196
|
+
payment: ReturnType<typeof PaymentAPI>;
|
|
963
1197
|
payout: ReturnType<typeof PayoutAPI>;
|
|
1198
|
+
providerKyc: ReturnType<typeof ProviderKycAPI>;
|
|
1199
|
+
receipt: ReturnType<typeof ReceiptAPI>;
|
|
1200
|
+
ussdOtp: ReturnType<typeof UssdOtpAPI>;
|
|
1201
|
+
webhook: ReturnType<typeof WebhookAPI>;
|
|
964
1202
|
financialTransaction: ReturnType<typeof FinancialTransactionAPI>;
|
|
965
1203
|
checkoutSession: ReturnType<typeof CheckoutSessionAPI>;
|
|
966
1204
|
constructor(options: ClientOptions);
|
|
967
1205
|
_getConfig(): {
|
|
968
1206
|
monimeSpaceId: string;
|
|
969
1207
|
accessToken: string;
|
|
1208
|
+
monimeVersion: string | undefined;
|
|
970
1209
|
};
|
|
971
1210
|
}
|
|
972
1211
|
|
|
973
1212
|
declare function createClient(options: ClientOptions): MonimeClient;
|
|
974
1213
|
|
|
975
|
-
export { type AllFinancialAccount, type AllInternalTransfers, type ClientOptions, type CreateFinancialAccount, type CreateInternalTransfer, type CreatePaymentCode, type CreatePayout, type DestinationOption, type GetAll, type GetAllPaymentCode, type GetFinancialAccount, type GetOne, type GetOnePayout, type InternalTransfer, MonimeClient, createClient };
|
|
1214
|
+
export { type AllFinancialAccount, type AllInternalTransfers, type ClientOptions, 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 GetWebhookResponse, type InternalTransfer, type ListPayments, type ListWebhooksResponse, MonimeClient, type PatchPayment, type Payment, type ProviderKyc, type Receipt, type RedeemReceiptResponse, type UpdateWebhookRequest, type UpdateWebhookResponse, type UssdOtp, type Webhook, type WebhookVerificationMethod, createClient };
|