@ecodrix/erix-api 1.3.3 → 1.3.5

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
@@ -23,6 +23,174 @@ declare abstract class APIResource {
23
23
  private handleError;
24
24
  }
25
25
 
26
+ declare class Agency extends APIResource {
27
+ /**
28
+ * List all available blueprints.
29
+ */
30
+ listBlueprints<T = any>(): Promise<T>;
31
+ /**
32
+ * Create a new blueprint configuration ("Gold Standard").
33
+ */
34
+ createBlueprint<T = any>(payload: any): Promise<T>;
35
+ /**
36
+ * Deploy a blueprint to a specific tenant client code.
37
+ */
38
+ deployBlueprint<T = any>(payload: {
39
+ clientCode: string;
40
+ blueprintId: string;
41
+ }): Promise<T>;
42
+ /**
43
+ * Get aggregate portfolio statistics for an agency.
44
+ */
45
+ getPortfolioStats<T = any>(agencyCode: string): Promise<T>;
46
+ /**
47
+ * Get proactive health report for an agency portfolio.
48
+ */
49
+ getPortfolioHealth<T = any>(agencyCode: string): Promise<T>;
50
+ /**
51
+ * View consumption usage for a specific client code.
52
+ */
53
+ getUsage<T = any>(clientCode: string): Promise<T>;
54
+ /**
55
+ * List staff members under a specific agency code.
56
+ */
57
+ listStaff<T = any>(agencyCode: string): Promise<T>;
58
+ /**
59
+ * Create a new staff member for an agency.
60
+ */
61
+ createStaff<T = any>(payload: any): Promise<T>;
62
+ }
63
+
64
+ interface CheckoutProduct {
65
+ externalId: string;
66
+ name: string;
67
+ price: number;
68
+ image?: string;
69
+ }
70
+ interface CheckoutAmountBreakdown {
71
+ subtotal: number;
72
+ discount: number;
73
+ delivery: number;
74
+ total: number;
75
+ }
76
+ interface CheckoutSession {
77
+ sessionId: string;
78
+ product: {
79
+ name: string;
80
+ price: number;
81
+ image?: string;
82
+ };
83
+ amounts: CheckoutAmountBreakdown;
84
+ items: Array<{
85
+ productId: string;
86
+ quantity: number;
87
+ }>;
88
+ }
89
+ interface CreateSessionPayload {
90
+ productId: string;
91
+ quantity: number;
92
+ couponCode?: string;
93
+ }
94
+ interface ApplyCouponPayload {
95
+ sessionId: string;
96
+ couponCode: string;
97
+ }
98
+ interface VerifyPayload {
99
+ sessionId: string;
100
+ method: "truecaller" | "otp";
101
+ token?: string;
102
+ phone?: string;
103
+ otp?: string;
104
+ }
105
+ interface CreateOrderPayload {
106
+ sessionId: string;
107
+ customer: {
108
+ name: string;
109
+ phone: string;
110
+ email?: string;
111
+ address: {
112
+ line1: string;
113
+ city: string;
114
+ state: string;
115
+ pincode: string;
116
+ };
117
+ };
118
+ paymentProvider: "razorpay" | "cod";
119
+ }
120
+ interface CheckoutOrderResponse {
121
+ order_id: string;
122
+ payment_order_id?: string;
123
+ amount?: number;
124
+ currency?: string;
125
+ status?: string;
126
+ message?: string;
127
+ }
128
+
129
+ /**
130
+ * Resource for managing the ErixCheckout one-click flow.
131
+ *
132
+ * This resource handles session creation, coupon application,
133
+ * identity verification, and final order placement.
134
+ */
135
+ declare class Checkout extends APIResource {
136
+ /**
137
+ * Retrieves product information for the checkout modal.
138
+ * @param productId - External SKU/ID of the product.
139
+ */
140
+ getProduct(productId: string): Promise<CheckoutProduct>;
141
+ /**
142
+ * Initializes a new checkout session.
143
+ */
144
+ createSession(payload: CreateSessionPayload): Promise<CheckoutSession>;
145
+ /**
146
+ * Applies a discount coupon to an active session.
147
+ */
148
+ applyCoupon(payload: ApplyCouponPayload): Promise<CheckoutSession>;
149
+ /**
150
+ * Verifies user identity via Truecaller or OTP.
151
+ */
152
+ verify(payload: VerifyPayload): Promise<{
153
+ verified: boolean;
154
+ data?: any;
155
+ }>;
156
+ /**
157
+ * Finalizes the order and initiates payment.
158
+ */
159
+ createOrder(payload: CreateOrderPayload): Promise<CheckoutOrderResponse>;
160
+ }
161
+
162
+ interface CorsOriginCreatePayload {
163
+ url: string;
164
+ name?: string;
165
+ allowedHeaders?: string[];
166
+ allowedMethods?: string[];
167
+ }
168
+ interface CorsOriginUpdatePayload {
169
+ url?: string;
170
+ name?: string;
171
+ allowedHeaders?: string[];
172
+ allowedMethods?: string[];
173
+ isActive?: boolean;
174
+ }
175
+ declare class Cors extends APIResource {
176
+ /**
177
+ * List all dynamic cross-origin policies.
178
+ */
179
+ list<T = any>(): Promise<T>;
180
+ /**
181
+ * Register a new cross-origin client for the SaaS API network dynamically.
182
+ */
183
+ create<T = any>(payload: CorsOriginCreatePayload): Promise<T>;
184
+ /**
185
+ * Adjust active states or configurations for an existing origin policy.
186
+ */
187
+ update<T = any>(id: string, payload: CorsOriginUpdatePayload): Promise<T>;
188
+ /**
189
+ * Irreversibly drop support for a cross-origin client URL policy permanently.
190
+ */
191
+ delete<T = any>(id: string): Promise<T>;
192
+ }
193
+
26
194
  interface LogActivityParams {
27
195
  leadId: string;
28
196
  type: "note" | "call" | "email" | "meeting" | "whatsapp" | "system";
@@ -211,6 +379,12 @@ declare class Analytics extends APIResource {
211
379
  * Consolidated analytics including CRM overview and WhatsApp messaging metrics.
212
380
  *
213
381
  * @param params - Time range filters.
382
+ * @returns {Promise<any>} Consolidated analytics object containing CRM overview and WhatsApp messaging metrics.
383
+ * @example
384
+ * ```typescript
385
+ * const stats = await erixClient.crm.analytics.summary({ range: "30d" });
386
+ * console.log(stats.overview.totalLeads);
387
+ * ```
214
388
  */
215
389
  summary<T = any>(params?: AnalyticsParams): Promise<T>;
216
390
  /**
@@ -376,6 +550,21 @@ declare class Automations extends APIResource {
376
550
  * @param payload - Arbitrary data forwarded to the node context.
377
551
  */
378
552
  webhookEvent<T = any>(ruleId: string, eventName: string, payload?: any): Promise<T>;
553
+ /**
554
+ * Fire a CRM automation trigger for a given phone number.
555
+ *
556
+ * @param params - Trigger payload (trigger name, phone, variables, etc.)
557
+ */
558
+ trigger<T = any>(params: {
559
+ trigger: string;
560
+ phone: string;
561
+ email?: string;
562
+ variables?: Record<string, string>;
563
+ createLeadIfMissing?: boolean;
564
+ leadData?: any;
565
+ delayMinutes?: number;
566
+ runAt?: Date | string;
567
+ }): Promise<T>;
379
568
  }
380
569
 
381
570
  /**
@@ -451,18 +640,32 @@ type LeadSource = "website" | "whatsapp" | "direct" | "referral" | string;
451
640
  * Parameters for creating a new CRM Lead.
452
641
  */
453
642
  interface CreateLeadParams {
454
- /** Lead's first name. Required. */
455
- firstName: string;
643
+ /** Lead's full name (alternative to firstName/lastName). */
644
+ name?: string;
645
+ /** Lead's first name. Required for creation if name is not provided. */
646
+ firstName?: string;
456
647
  /** Lead's last name. */
457
648
  lastName?: string;
458
649
  /** Lead's email address. */
459
650
  email?: string;
460
651
  /** Lead's phone number in E.164 format (e.g. "+919876543210"). */
461
652
  phone?: string;
653
+ /**
654
+ * Current status of the lead.
655
+ */
656
+ status?: LeadStatus;
657
+ /**
658
+ * Estimated value of the lead.
659
+ */
660
+ value?: number;
462
661
  /**
463
662
  * Acquisition channel.
464
663
  */
465
664
  source?: LeadSource;
665
+ /** Primary message or enquiry from the lead. */
666
+ message?: string;
667
+ /** Internal note about the lead activity. */
668
+ activityNote?: string;
466
669
  /** Arbitrary key-value metadata (UTM params, order IDs, etc.). */
467
670
  metadata?: Record<string, any>;
468
671
  /** Pipeline ID to assign the lead */
@@ -568,11 +771,19 @@ declare class Leads extends APIResource {
568
771
  */
569
772
  createMany(leads: CreateLeadParams[], chunkSize?: number): Promise<any[]>;
570
773
  /**
571
- * Bulk upsert (import) leads.
774
+ * Bulk upsert (import) leads. Supports high-volume synchronization.
572
775
  *
573
776
  * @param leads - Array of leads to import.
777
+ * ---- **Done** ---- API Endpoint
574
778
  */
575
779
  import<T = any>(leads: Partial<CreateLeadParams>[]): Promise<T>;
780
+ /**
781
+ * Alias for bulk upserting leads.
782
+ *
783
+ * @param leads - Array of leads to import.
784
+ * ---- **Done** ---- API Endpoint
785
+ */
786
+ bulkUpsert<T = any>(leads: Partial<CreateLeadParams>[]): Promise<T>;
576
787
  /**
577
788
  * List CRM leads with optional filtering and pagination.
578
789
  *
@@ -615,8 +826,22 @@ declare class Leads extends APIResource {
615
826
  * Retrieve a single lead by its phone number.
616
827
  *
617
828
  * @param phone - Lead's phone number.
829
+ * ---- **Done** ---- API Endpoint
618
830
  */
619
831
  retrieveByPhone<T = any>(phone: string): Promise<T>;
832
+ /**
833
+ * Fetches all leads belonging to a specific Kanban column in a pipeline.
834
+ *
835
+ * @param pipelineId - Parent pipeline ID.
836
+ * @param stageId - Target stage ID.
837
+ * @param params - Pagination controls.
838
+ * @returns Paginated result set.
839
+ * ---- **Done** ---- API Endpoint
840
+ */
841
+ byStage<T = any>(pipelineId: string, stageId: string, params?: {
842
+ page?: number;
843
+ limit?: number;
844
+ }): Promise<T>;
620
845
  /**
621
846
  * Retrieve a single lead by a reference key and value.
622
847
  *
@@ -712,17 +937,32 @@ declare class Leads extends APIResource {
712
937
  */
713
938
  deleteNote<T = any>(leadId: string, noteId: string): Promise<unknown>;
714
939
  /**
715
- * Archive (soft-delete) a single lead.
940
+ * Delete a single lead permanently.
716
941
  *
717
- * @param leadId - The ID of the lead to archive.
942
+ * @param leadId - The ID of the lead to delete.
943
+ * ---- **Done** ---- API Endpoint
718
944
  */
719
945
  delete(leadId: string): Promise<unknown>;
720
946
  /**
721
947
  * Bulk archive multiple leads.
722
948
  *
723
949
  * @param ids - Array of lead IDs to archive.
950
+ * ---- **Done** ---- API Endpoint
951
+ */
952
+ bulkArchive<T = any>(ids: string[]): Promise<T>;
953
+ /**
954
+ * Bulk delete multiple leads permanently.
955
+ *
956
+ * @param ids - Array of lead IDs to archive.
957
+ * ---- **Done** ---- API Endpoint
724
958
  */
725
959
  bulkDelete(ids: string[]): Promise<unknown>;
960
+ /**
961
+ * Archive a single lead.
962
+ *
963
+ * @param leadId - The ID of the lead to archive.
964
+ */
965
+ archive<T = any>(leadId: string): Promise<T>;
726
966
  }
727
967
 
728
968
  declare class Payments extends APIResource {
@@ -749,15 +989,12 @@ declare class Payments extends APIResource {
749
989
  }): Promise<T>;
750
990
  }
751
991
 
752
- interface CreatePipelineParams {
753
- name: string;
754
- isDefault?: boolean;
755
- stages?: any[];
756
- }
757
992
  interface PipelineStageParams {
758
993
  name: string;
759
994
  color?: string;
760
995
  probability?: number;
996
+ isWon?: boolean;
997
+ isLost?: boolean;
761
998
  }
762
999
  declare class Pipelines extends APIResource {
763
1000
  /**
@@ -880,12 +1117,23 @@ declare class Pipelines extends APIResource {
880
1117
  }
881
1118
 
882
1119
  interface ScoringConfig {
883
- decayDays: number;
884
- thresholds: {
885
- hot: number;
886
- warm: number;
887
- };
1120
+ /** Scoring rules — each rule adds/subtracts points based on field conditions. */
888
1121
  rules: any[];
1122
+ /**
1123
+ * Score threshold above which a lead is considered "hot".
1124
+ * @default 70
1125
+ */
1126
+ hotThreshold?: number;
1127
+ /**
1128
+ * Score threshold below which a lead is considered "cold".
1129
+ * @default 20
1130
+ */
1131
+ coldThreshold?: number;
1132
+ /**
1133
+ * List of CRM trigger names that cause an automatic score recalculation.
1134
+ * @example ["lead_created", "appointment_booked"]
1135
+ */
1136
+ recalculateOnTriggers?: string[];
889
1137
  }
890
1138
  declare class Scoring extends APIResource {
891
1139
  /**
@@ -985,41 +1233,80 @@ interface SendCampaignPayload {
985
1233
  * Interface representing the result of a campaign dispatch.
986
1234
  */
987
1235
  interface CampaignResult {
1236
+ /** Indicates if the campaign was successfully queued/sent. */
988
1237
  success: boolean;
1238
+ /** Optional message detailing the result. */
989
1239
  message?: string;
1240
+ /** Additional dynamic properties. */
990
1241
  [key: string]: any;
991
1242
  }
1243
+ /**
1244
+ * Represents an email template within the system.
1245
+ */
992
1246
  interface EmailTemplate {
1247
+ /** Unique identifier of the template. */
993
1248
  id: string;
1249
+ /** Human-readable name of the template. */
994
1250
  name: string;
1251
+ /** Optional description explaining the template's purpose. */
995
1252
  description?: string;
1253
+ /** Subject line used when sending emails with this template. */
996
1254
  subject: string;
1255
+ /** Optional preheader text (hidden snippet visible in email clients). */
997
1256
  preheader?: string;
1257
+ /** Raw HTML content of the template. */
998
1258
  htmlBody: string;
1259
+ /** Optional plain-text fallback content. */
999
1260
  textBody?: string;
1261
+ /** Broad category classification for the template. */
1000
1262
  category: "marketing" | "transactional" | "sequence";
1263
+ /** Current state of the template. */
1001
1264
  status: "draft" | "published" | "archived";
1265
+ /** Type of template, whether standard or a reusable layout. */
1002
1266
  type: "standard" | "layout";
1267
+ /** Optional layout ID if this template inherits from a layout. */
1003
1268
  layoutId?: string;
1269
+ /** Optional URL to a thumbnail image representing the template. */
1004
1270
  thumbnail?: string;
1271
+ /** Array defining dynamic variables used within the template. */
1005
1272
  variableMapping?: any[];
1273
+ /** ISO timestamp of when the template was created. */
1006
1274
  createdAt: string;
1275
+ /** ISO timestamp of when the template was last updated. */
1007
1276
  updatedAt: string;
1008
1277
  }
1278
+ /**
1279
+ * Data transfer object for creating a new email template.
1280
+ */
1009
1281
  interface CreateTemplateDTO {
1282
+ /** Name of the template. */
1010
1283
  name: string;
1284
+ /** Email subject line. */
1011
1285
  subject: string;
1286
+ /** Raw HTML content. */
1012
1287
  htmlBody: string;
1288
+ /** Optional description. */
1013
1289
  description?: string;
1290
+ /** Category of the template. Defaults to marketing if not provided. */
1014
1291
  category?: "marketing" | "transactional" | "sequence";
1292
+ /** Initial status. Defaults to draft. */
1015
1293
  status?: "draft" | "published" | "archived";
1294
+ /** Optional variable mapping definitions. */
1016
1295
  variableMapping?: any[];
1017
1296
  }
1297
+ /**
1298
+ * Response structure when previewing an email template.
1299
+ */
1018
1300
  interface TemplatePreviewResponse {
1301
+ /** Indicates if the preview generation was successful. */
1019
1302
  success: boolean;
1303
+ /** The generated preview content. */
1020
1304
  data: {
1305
+ /** Resolved subject line. */
1021
1306
  subject: string;
1307
+ /** Resolved HTML body. */
1022
1308
  html: string;
1309
+ /** Resolved plain text fallback (if available). */
1023
1310
  text?: string;
1024
1311
  };
1025
1312
  }
@@ -1031,14 +1318,40 @@ interface TemplatePreviewResponse {
1031
1318
  declare class Email extends APIResource {
1032
1319
  /**
1033
1320
  * Send an HTML email campaign to a list of recipients.
1321
+ *
1322
+ * @param payload - Data required to send a campaign.
1323
+ * @returns A promise resolving to the campaign result.
1324
+ * @example
1325
+ * ```typescript
1326
+ * await erixClient.email.sendCampaign({
1327
+ * recipients: ["test@example.com"],
1328
+ * subject: "Hello!",
1329
+ * html: "<h1>Hi there</h1>"
1330
+ * });
1331
+ * ```
1034
1332
  */
1035
1333
  sendCampaign(payload: SendCampaignPayload): Promise<CampaignResult>;
1036
1334
  /**
1037
1335
  * Send a system test email to validate your current SMTP configuration.
1336
+ *
1337
+ * @param to - The recipient email address for the test email.
1338
+ * @returns A promise resolving to the result of the test email dispatch.
1339
+ * @example
1340
+ * ```typescript
1341
+ * await erixClient.email.sendTest("admin@mycompany.com");
1342
+ * ```
1038
1343
  */
1039
1344
  sendTest(to: string): Promise<CampaignResult>;
1040
1345
  /**
1041
1346
  * List all email templates.
1347
+ *
1348
+ * @param query - Optional query parameters for filtering and pagination.
1349
+ * @returns A promise resolving to a paginated or filtered list of templates.
1350
+ * @example
1351
+ * ```typescript
1352
+ * const response = await erixClient.email.listTemplates({ category: "marketing" });
1353
+ * console.log(response.data);
1354
+ * ```
1042
1355
  */
1043
1356
  listTemplates(query?: any): Promise<{
1044
1357
  success: boolean;
@@ -1046,6 +1359,13 @@ declare class Email extends APIResource {
1046
1359
  }>;
1047
1360
  /**
1048
1361
  * Get a single email template by ID.
1362
+ *
1363
+ * @param id - The unique identifier of the template.
1364
+ * @returns A promise resolving to the requested template details.
1365
+ * @example
1366
+ * ```typescript
1367
+ * const template = await erixClient.email.getTemplate("tpl_123abc");
1368
+ * ```
1049
1369
  */
1050
1370
  getTemplate(id: string): Promise<{
1051
1371
  success: boolean;
@@ -1053,6 +1373,17 @@ declare class Email extends APIResource {
1053
1373
  }>;
1054
1374
  /**
1055
1375
  * Create a new email template.
1376
+ *
1377
+ * @param data - The template data transfer object containing the details.
1378
+ * @returns A promise resolving to the newly created template.
1379
+ * @example
1380
+ * ```typescript
1381
+ * const newTpl = await erixClient.email.createTemplate({
1382
+ * name: "Welcome Series 1",
1383
+ * subject: "Welcome to our platform!",
1384
+ * htmlBody: "<h1>Welcome</h1><p>We are glad you are here.</p>"
1385
+ * });
1386
+ * ```
1056
1387
  */
1057
1388
  createTemplate(data: CreateTemplateDTO): Promise<{
1058
1389
  success: boolean;
@@ -1060,6 +1391,16 @@ declare class Email extends APIResource {
1060
1391
  }>;
1061
1392
  /**
1062
1393
  * Update an existing email template.
1394
+ *
1395
+ * @param id - The unique identifier of the template to update.
1396
+ * @param data - The partial data transfer object to update the template with.
1397
+ * @returns A promise resolving to the updated template.
1398
+ * @example
1399
+ * ```typescript
1400
+ * await erixClient.email.updateTemplate("tpl_123abc", {
1401
+ * subject: "Updated Welcome Subject"
1402
+ * });
1403
+ * ```
1063
1404
  */
1064
1405
  updateTemplate(id: string, data: Partial<CreateTemplateDTO>): Promise<{
1065
1406
  success: boolean;
@@ -1067,21 +1408,38 @@ declare class Email extends APIResource {
1067
1408
  }>;
1068
1409
  /**
1069
1410
  * Delete an email template.
1411
+ *
1412
+ * @param id - The unique identifier of the template to delete.
1413
+ * @param force - Optional flag to force deletion even if the template is in use (default: false).
1414
+ * @returns A promise resolving to a success indicator.
1415
+ * @example
1416
+ * ```typescript
1417
+ * await erixClient.email.deleteTemplate("tpl_123abc");
1418
+ * ```
1070
1419
  */
1071
1420
  deleteTemplate(id: string, force?: boolean): Promise<{
1072
1421
  success: boolean;
1073
1422
  }>;
1074
1423
  /**
1075
1424
  * Preview a template with dynamic variable resolution.
1076
- */
1077
- previewTemplate(id: string, params: {
1078
- leadId?: string;
1079
- variables?: Record<string, any>;
1425
+ * Use this to see how a template renders with specific lead data or custom variables.
1426
+ *
1427
+ * @param id - The unique identifier of the template.
1428
+ * @param params - Parameters containing the lead ID or custom variables to inject.
1429
+ * @returns A promise resolving to the rendered HTML and subject.
1430
+ * @example
1431
+ * ```typescript
1432
+ * const preview = await erixClient.email.previewTemplate("tpl_123abc", {
1433
+ * variables: { first_name: "Jane" }
1434
+ * });
1435
+ * console.log(preview.data.html);
1436
+ * ```
1437
+ */
1438
+ previewTemplate(id: string, params: {
1439
+ leadId?: string;
1440
+ variables?: Record<string, any>;
1080
1441
  }): Promise<TemplatePreviewResponse>;
1081
1442
  }
1082
- /** @deprecated Use Email instead */
1083
- declare class EmailResource extends Email {
1084
- }
1085
1443
 
1086
1444
  /**
1087
1445
  * Event definition representing an entry point capable of triggering automations.
@@ -1396,9 +1754,15 @@ declare class Logs extends APIResource {
1396
1754
  }>;
1397
1755
  }
1398
1756
 
1757
+ /**
1758
+ * Parameters required to send an email campaign.
1759
+ */
1399
1760
  interface SendCampaignParams {
1761
+ /** Array of recipient email addresses. */
1400
1762
  recipients: string[];
1763
+ /** Subject line of the email. */
1401
1764
  subject: string;
1765
+ /** HTML body content of the email. */
1402
1766
  html: string;
1403
1767
  }
1404
1768
  declare class Emails extends APIResource {
@@ -1419,14 +1783,21 @@ declare class Emails extends APIResource {
1419
1783
  sendCampaign<T = any>(params: SendCampaignParams): Promise<T>;
1420
1784
  /**
1421
1785
  * Send a test verification email (used to verify SMTP functionality).
1786
+ *
1787
+ * @param to - The recipient email address for the test email.
1788
+ * @returns A promise resolving to the result of the test email dispatch.
1789
+ * @example
1790
+ * ```typescript
1791
+ * await erixClient.marketing.emails.sendTest("admin@mycompany.com");
1792
+ * ```
1422
1793
  */
1423
1794
  sendTest<T = any>(to: string): Promise<T>;
1424
1795
  }
1425
1796
  declare class Campaigns extends APIResource {
1426
1797
  /**
1427
- * List all email and SMS marketing campaigns with optional status filtering.
1798
+ * List all email marketing campaigns with optional status filtering.
1428
1799
  *
1429
- * @param params - Optional filters (status, limit).
1800
+ * @param params - Optional filters (status, limit, startDate, endDate, page).
1430
1801
  * @returns Paginated list of campaign objects.
1431
1802
  * @example
1432
1803
  * ```typescript
@@ -1436,66 +1807,9 @@ declare class Campaigns extends APIResource {
1436
1807
  list<T = any>(params?: {
1437
1808
  status?: string;
1438
1809
  limit?: number;
1439
- }): Promise<T>;
1440
- /**
1441
- * Create a new marketing campaign (Email or SMS).
1442
- *
1443
- * @param payload - Campaign details (name, type, content).
1444
- * @returns The created campaign record.
1445
- * @example
1446
- * ```typescript
1447
- * await erixClient.marketing.campaigns.create({
1448
- * name: "Spring Sale",
1449
- * type: "email",
1450
- * subject: "Our Spring Sale is Here!",
1451
- * html: "<h1>BIG DEALS!</h1>"
1452
- * });
1453
- * ```
1454
- */
1455
- create<T = any>(payload: {
1456
- name: string;
1457
- type: string;
1458
- subject?: string;
1459
- html?: string;
1460
- templateId?: string;
1461
- recipients?: string[];
1462
- }): Promise<T>;
1463
- /**
1464
- * Retrieve full details for a specific marketing campaign.
1465
- *
1466
- * @param campaignId - The unique ID of the campaign.
1467
- * @example
1468
- * ```typescript
1469
- * const campaign = await erixClient.marketing.campaigns.retrieve("camp_123");
1470
- * ```
1471
- */
1472
- retrieve<T = any>(campaignId: string): Promise<T>;
1473
- /**
1474
- * Update a campaign.
1475
- */
1476
- update<T = any>(campaignId: string, payload: any): Promise<T>;
1477
- /**
1478
- * Delete a campaign.
1479
- */
1480
- delete<T = any>(campaignId: string): Promise<T>;
1481
- /**
1482
- * Send a campaign immediately or schedule it for a later date.
1483
- *
1484
- * @param campaignId - The ID of the campaign to dispatch.
1485
- * @param payload - Optional scheduling information (ISO timestamp).
1486
- * @example
1487
- * ```typescript
1488
- * // Send immediately
1489
- * await erixClient.marketing.campaigns.send("camp_123");
1490
- *
1491
- * // Schedule for tomorrow
1492
- * await erixClient.marketing.campaigns.send("camp_123", {
1493
- * scheduledAt: "2026-04-10T09:00:00Z"
1494
- * });
1495
- * ```
1496
- */
1497
- send<T = any>(campaignId: string, payload?: {
1498
- scheduledAt?: string;
1810
+ page?: number;
1811
+ startDate?: string;
1812
+ endDate?: string;
1499
1813
  }): Promise<T>;
1500
1814
  /**
1501
1815
  * Get detailed delivery and engagement statistics for a campaign.
@@ -1506,7 +1820,7 @@ declare class Campaigns extends APIResource {
1506
1820
  * @example
1507
1821
  * ```typescript
1508
1822
  * const report = await erixClient.marketing.campaigns.stats("camp_123");
1509
- * console.log(`Open Rate: ${report.openRate}%`);
1823
+ * console.log(`Open Rate: ${report.data.openRate}%`);
1510
1824
  * ```
1511
1825
  */
1512
1826
  stats<T = any>(campaignId: string): Promise<T>;
@@ -1515,7 +1829,7 @@ declare class WhatsAppMarketing extends APIResource {
1515
1829
  /**
1516
1830
  * Dispatch a template-based WhatsApp message with CRM-integrated variable resolution.
1517
1831
  *
1518
- * Unlike direct WhatsApp sending, this endpoint documentation automatically pulls data from the CRM
1832
+ * Unlike direct WhatsApp sending, this endpoint automatically pulls data from the CRM
1519
1833
  * based on the provided variables mapping.
1520
1834
  *
1521
1835
  * @param params - Template details and recipient phone.
@@ -1529,16 +1843,29 @@ declare class WhatsAppMarketing extends APIResource {
1529
1843
  * ```
1530
1844
  */
1531
1845
  sendTemplate<T = any>(params: {
1846
+ /** Recipient's phone number. */
1532
1847
  phone: string;
1848
+ /** The WhatsApp template name approved in Meta. */
1533
1849
  templateName: string;
1850
+ /** Language code for the template (e.g. en_US). */
1534
1851
  languageCode?: string;
1852
+ /** CRM mapped variables. */
1535
1853
  variables?: Record<string, string>;
1854
+ /** Directly resolved variables to inject into the template. */
1536
1855
  resolvedVariables?: Record<string, string>;
1537
1856
  }): Promise<T>;
1538
1857
  }
1858
+ /**
1859
+ * Global Marketing resource namespace.
1860
+ *
1861
+ * Access via `ecod.marketing`.
1862
+ */
1539
1863
  declare class Marketing extends APIResource {
1864
+ /** Email marketing resources */
1540
1865
  emails: Emails;
1866
+ /** Campaign analytics and lists */
1541
1867
  campaigns: Campaigns;
1868
+ /** WhatsApp marketing resources */
1542
1869
  whatsapp: WhatsAppMarketing;
1543
1870
  constructor(client: any);
1544
1871
  }
@@ -1695,9 +2022,6 @@ declare class Media extends APIResource {
1695
2022
  */
1696
2023
  upload(file: any, options: UploadOptions): Promise<any>;
1697
2024
  }
1698
- /** @deprecated Use Media instead */
1699
- declare class MediaResource extends Media {
1700
- }
1701
2025
 
1702
2026
  /**
1703
2027
  * Parameters for scheduling a new Google Meet appointment.
@@ -1709,6 +2033,8 @@ interface CreateMeetingParams {
1709
2033
  participantName: string;
1710
2034
  /** Phone number of the participant in E.164 format. */
1711
2035
  participantPhone: string;
2036
+ /** Email addresses of the participants. */
2037
+ participantEmails?: string[];
1712
2038
  /**
1713
2039
  * Meeting start time.
1714
2040
  * @example new Date("2026-04-10T10:00:00.000Z")
@@ -1719,8 +2045,19 @@ interface CreateMeetingParams {
1719
2045
  * @example new Date("2026-04-10T10:30:00.000Z")
1720
2046
  */
1721
2047
  endTime: Date | string;
2048
+ /** Duration in minutes. */
2049
+ duration?: number;
2050
+ /** Whether the meeting is online (Google Meet) or offline (In-person). */
2051
+ meetingMode?: "online" | "offline";
2052
+ /** Whether this is a free or paid consultation. */
2053
+ type?: "free" | "paid";
2054
+ /** Amount charged for paid consultations. */
2055
+ amount?: number;
1722
2056
  /** Arbitrary metadata to attach to the meeting record. */
1723
- metadata?: Record<string, any>;
2057
+ metadata?: {
2058
+ refs?: Record<string, string | undefined>;
2059
+ extra?: Record<string, any>;
2060
+ };
1724
2061
  }
1725
2062
  /**
1726
2063
  * Parameters for updating an existing meeting.
@@ -1730,15 +2067,17 @@ interface UpdateMeetingParams {
1730
2067
  * Update the meeting status.
1731
2068
  * @example "scheduled" | "completed" | "cancelled"
1732
2069
  */
1733
- status?: string;
2070
+ status?: "scheduled" | "completed" | "cancelled" | string;
1734
2071
  /** Update the payment status for paid consultations. */
1735
- paymentStatus?: string;
2072
+ paymentStatus?: "pending" | "paid" | "na" | string;
1736
2073
  /** New start time for rescheduling. */
1737
2074
  startTime?: Date | string;
1738
2075
  /** New end time for rescheduling. */
1739
2076
  endTime?: Date | string;
1740
2077
  /** Duration in minutes. */
1741
2078
  duration?: number;
2079
+ /** Update metadata. */
2080
+ metadata?: any;
1742
2081
  }
1743
2082
  /**
1744
2083
  * Google Meet appointment scheduling resource.
@@ -2053,6 +2392,161 @@ declare class Queue extends APIResource {
2053
2392
  deleteJob<T = any>(jobId: string): Promise<T>;
2054
2393
  }
2055
2394
 
2395
+ declare class Clients extends APIResource {
2396
+ /**
2397
+ * List all clients in the ecosystem.
2398
+ */
2399
+ list<T = any>(): Promise<T>;
2400
+ /**
2401
+ * Get client count and auto-generate a unique code.
2402
+ */
2403
+ getCountAndGenerateCode<T = any>(): Promise<T>;
2404
+ /**
2405
+ * Retrieve a single client by client code.
2406
+ */
2407
+ retrieve<T = any>(clientCode: string): Promise<T>;
2408
+ /**
2409
+ * Get API Key for a specific client (Admin Only).
2410
+ */
2411
+ getApiKey<T = any>(clientCode: string): Promise<T>;
2412
+ /**
2413
+ * Generate or rotate API Key for a specific client (Admin Only).
2414
+ */
2415
+ rotateApiKey<T = any>(clientCode: string): Promise<T>;
2416
+ /**
2417
+ * Create a new client identity and provision initial resources.
2418
+ */
2419
+ create<T = any>(payload: {
2420
+ name: string;
2421
+ clientCode: string;
2422
+ business?: any;
2423
+ plan?: any;
2424
+ }): Promise<T>;
2425
+ /**
2426
+ * Get active service configuration for a specific client.
2427
+ */
2428
+ getConfig<T = any>(clientCode: string): Promise<T>;
2429
+ /**
2430
+ * Update active service configuration for a specific client.
2431
+ */
2432
+ updateConfig<T = any>(clientCode: string, payload: any): Promise<T>;
2433
+ /**
2434
+ * Get decrypted secrets for a specific client.
2435
+ */
2436
+ getSecrets<T = any>(clientCode: string): Promise<T>;
2437
+ /**
2438
+ * Set secrets for a specific client.
2439
+ */
2440
+ updateSecrets<T = any>(clientCode: string, payload: any): Promise<T>;
2441
+ /**
2442
+ * Completely replace secrets for a specific client.
2443
+ */
2444
+ replaceSecrets<T = any>(clientCode: string, payload: any): Promise<T>;
2445
+ /**
2446
+ * Partially update secrets for a specific client.
2447
+ */
2448
+ patchSecrets<T = any>(clientCode: string, payload: any): Promise<T>;
2449
+ /**
2450
+ * Retrieve Data Source connection metadata.
2451
+ */
2452
+ getDataSource<T = any>(clientCode: string): Promise<T>;
2453
+ /**
2454
+ * Configure Data Source metadata.
2455
+ */
2456
+ manageDataSource<T = any>(clientCode: string, payload: any): Promise<T>;
2457
+ /**
2458
+ * Update Client Identity and perform cascading updates if required.
2459
+ */
2460
+ updateIdentity<T = any>(id: string, payload: any): Promise<T>;
2461
+ /**
2462
+ * Initiate Google Re-authentication for OAuth tokens.
2463
+ */
2464
+ googleReauth<T = any>(clientCode: string, payload?: {
2465
+ authCode?: string;
2466
+ }): Promise<T>;
2467
+ /**
2468
+ * Delete a client and perform cascading cleanup.
2469
+ */
2470
+ delete<T = any>(id: string): Promise<T>;
2471
+ }
2472
+ declare class Blogs extends APIResource {
2473
+ /**
2474
+ * Retrieve public corporate blogs/news.
2475
+ */
2476
+ list<T = any>(): Promise<T>;
2477
+ }
2478
+ declare class GlobalLeads extends APIResource {
2479
+ /**
2480
+ * Add a corporate lead capture entry.
2481
+ */
2482
+ add<T = any>(payload: any): Promise<T>;
2483
+ }
2484
+ declare class Services extends APIResource {
2485
+ clients: Clients;
2486
+ blogs: Blogs;
2487
+ globalLeads: GlobalLeads;
2488
+ constructor(client: any);
2489
+ }
2490
+
2491
+ declare class EmailConfig extends APIResource {
2492
+ /**
2493
+ * Retrieve current email provider configuration and domain verification statuses.
2494
+ */
2495
+ getConfig<T = any>(): Promise<T>;
2496
+ /**
2497
+ * Switch the active email provider.
2498
+ */
2499
+ switchProvider<T = any>(provider: string): Promise<T>;
2500
+ /**
2501
+ * Provide explicit SMTP credentials and connection preferences.
2502
+ */
2503
+ saveSmtp<T = any>(payload: any): Promise<T>;
2504
+ /**
2505
+ * Initialize a new domain for SES identity verification.
2506
+ */
2507
+ initDomainVerification<T = any>(domain: string): Promise<T>;
2508
+ /**
2509
+ * Confirm "From" details and finalize configuration payload.
2510
+ */
2511
+ saveEmailConfig<T = any>(payload: {
2512
+ fromName: string;
2513
+ fromEmail: string;
2514
+ replyTo?: string;
2515
+ }): Promise<T>;
2516
+ /**
2517
+ * Check status of AWS SES domain validation DNS records.
2518
+ */
2519
+ checkSesVerification<T = any>(): Promise<T>;
2520
+ /**
2521
+ * Remove a verified SES domain identity and clean up local secrets.
2522
+ */
2523
+ removeSesIdentity<T = any>(): Promise<T>;
2524
+ /**
2525
+ * Send a test email to verify infrastructure is correctly bound.
2526
+ */
2527
+ sendTest<T = any>(toEmail: string): Promise<T>;
2528
+ /**
2529
+ * Define customized global email footers, limits, and specific campaign policies.
2530
+ */
2531
+ saveAdvancedConfig<T = any>(payload: any): Promise<T>;
2532
+ /**
2533
+ * Retrieve email configuration health properties including bounce limits metrics.
2534
+ */
2535
+ getHealth<T = any>(): Promise<T>;
2536
+ /**
2537
+ * Upgrade configurations dynamically to add DMARC enforcement records.
2538
+ */
2539
+ fixDmarc<T = any>(): Promise<T>;
2540
+ /**
2541
+ * Discover internally available providers constants metadata.
2542
+ */
2543
+ listProviders<T = any>(): Promise<T>;
2544
+ }
2545
+ declare class Settings extends APIResource {
2546
+ email: EmailConfig;
2547
+ constructor(client: any);
2548
+ }
2549
+
2056
2550
  declare class Folders extends APIResource {
2057
2551
  /**
2058
2552
  * Create a new folder in the tenant's cloud storage.
@@ -2184,9 +2678,6 @@ declare class RateLimitError extends APIError {
2184
2678
  constructor(message?: string);
2185
2679
  }
2186
2680
 
2187
- declare class WebhookSignatureError extends APIError {
2188
- constructor(message: string);
2189
- }
2190
2681
  /**
2191
2682
  * Validates and constructs webhook events sent by the ECODrIx platform.
2192
2683
  * Ensures the payload has not been tampered with.
@@ -2786,336 +3277,13 @@ declare class WhatsApp extends APIResource {
2786
3277
  }>;
2787
3278
  }
2788
3279
 
2789
- declare class Agency extends APIResource {
2790
- /**
2791
- * List all available blueprints.
2792
- */
2793
- listBlueprints<T = any>(): Promise<T>;
2794
- /**
2795
- * Create a new blueprint configuration ("Gold Standard").
2796
- */
2797
- createBlueprint<T = any>(payload: any): Promise<T>;
2798
- /**
2799
- * Deploy a blueprint to a specific tenant client code.
2800
- */
2801
- deployBlueprint<T = any>(payload: {
2802
- clientCode: string;
2803
- blueprintId: string;
2804
- }): Promise<T>;
2805
- /**
2806
- * Get aggregate portfolio statistics for an agency.
2807
- */
2808
- getPortfolioStats<T = any>(agencyCode: string): Promise<T>;
2809
- /**
2810
- * Get proactive health report for an agency portfolio.
2811
- */
2812
- getPortfolioHealth<T = any>(agencyCode: string): Promise<T>;
2813
- /**
2814
- * View consumption usage for a specific client code.
2815
- */
2816
- getUsage<T = any>(clientCode: string): Promise<T>;
2817
- /**
2818
- * List staff members under a specific agency code.
2819
- */
2820
- listStaff<T = any>(agencyCode: string): Promise<T>;
2821
- /**
2822
- * Create a new staff member for an agency.
2823
- */
2824
- createStaff<T = any>(payload: any): Promise<T>;
2825
- }
2826
-
2827
- declare class Clients extends APIResource {
2828
- /**
2829
- * List all clients in the ecosystem.
2830
- */
2831
- list<T = any>(): Promise<T>;
2832
- /**
2833
- * Get client count and auto-generate a unique code.
2834
- */
2835
- getCountAndGenerateCode<T = any>(): Promise<T>;
2836
- /**
2837
- * Retrieve a single client by client code.
2838
- */
2839
- retrieve<T = any>(clientCode: string): Promise<T>;
2840
- /**
2841
- * Get API Key for a specific client (Admin Only).
2842
- */
2843
- getApiKey<T = any>(clientCode: string): Promise<T>;
2844
- /**
2845
- * Generate or rotate API Key for a specific client (Admin Only).
2846
- */
2847
- rotateApiKey<T = any>(clientCode: string): Promise<T>;
2848
- /**
2849
- * Create a new client identity and provision initial resources.
2850
- */
2851
- create<T = any>(payload: {
2852
- name: string;
2853
- clientCode: string;
2854
- business?: any;
2855
- plan?: any;
2856
- }): Promise<T>;
2857
- /**
2858
- * Get active service configuration for a specific client.
2859
- */
2860
- getConfig<T = any>(clientCode: string): Promise<T>;
2861
- /**
2862
- * Update active service configuration for a specific client.
2863
- */
2864
- updateConfig<T = any>(clientCode: string, payload: any): Promise<T>;
2865
- /**
2866
- * Get decrypted secrets for a specific client.
2867
- */
2868
- getSecrets<T = any>(clientCode: string): Promise<T>;
2869
- /**
2870
- * Set secrets for a specific client.
2871
- */
2872
- updateSecrets<T = any>(clientCode: string, payload: any): Promise<T>;
2873
- /**
2874
- * Completely replace secrets for a specific client.
2875
- */
2876
- replaceSecrets<T = any>(clientCode: string, payload: any): Promise<T>;
2877
- /**
2878
- * Partially update secrets for a specific client.
2879
- */
2880
- patchSecrets<T = any>(clientCode: string, payload: any): Promise<T>;
2881
- /**
2882
- * Retrieve Data Source connection metadata.
2883
- */
2884
- getDataSource<T = any>(clientCode: string): Promise<T>;
2885
- /**
2886
- * Configure Data Source metadata.
2887
- */
2888
- manageDataSource<T = any>(clientCode: string, payload: any): Promise<T>;
2889
- /**
2890
- * Update Client Identity and perform cascading updates if required.
2891
- */
2892
- updateIdentity<T = any>(id: string, payload: any): Promise<T>;
2893
- /**
2894
- * Initiate Google Re-authentication for OAuth tokens.
2895
- */
2896
- googleReauth<T = any>(clientCode: string, payload?: {
2897
- authCode?: string;
2898
- }): Promise<T>;
2899
- /**
2900
- * Delete a client and perform cascading cleanup.
2901
- */
2902
- delete<T = any>(id: string): Promise<T>;
2903
- }
2904
- declare class Blogs extends APIResource {
2905
- /**
2906
- * Retrieve public corporate blogs/news.
2907
- */
2908
- list<T = any>(): Promise<T>;
2909
- }
2910
- declare class GlobalLeads extends APIResource {
2911
- /**
2912
- * Add a corporate lead capture entry.
2913
- */
2914
- add<T = any>(payload: any): Promise<T>;
2915
- }
2916
- declare class Services extends APIResource {
2917
- clients: Clients;
2918
- blogs: Blogs;
2919
- globalLeads: GlobalLeads;
2920
- constructor(client: any);
2921
- }
2922
-
2923
- declare class EmailConfig extends APIResource {
2924
- /**
2925
- * Retrieve current email provider configuration and domain verification statuses.
2926
- */
2927
- getConfig<T = any>(): Promise<T>;
2928
- /**
2929
- * Switch the active email provider.
2930
- */
2931
- switchProvider<T = any>(provider: string): Promise<T>;
2932
- /**
2933
- * Provide explicit SMTP credentials and connection preferences.
2934
- */
2935
- saveSmtp<T = any>(payload: any): Promise<T>;
2936
- /**
2937
- * Initialize a new domain for SES identity verification.
2938
- */
2939
- initDomainVerification<T = any>(domain: string): Promise<T>;
2940
- /**
2941
- * Confirm "From" details and finalize configuration payload.
2942
- */
2943
- saveEmailConfig<T = any>(payload: {
2944
- fromName: string;
2945
- fromEmail: string;
2946
- replyTo?: string;
2947
- }): Promise<T>;
2948
- /**
2949
- * Check status of AWS SES domain validation DNS records.
2950
- */
2951
- checkSesVerification<T = any>(): Promise<T>;
2952
- /**
2953
- * Remove a verified SES domain identity and clean up local secrets.
2954
- */
2955
- removeSesIdentity<T = any>(): Promise<T>;
2956
- /**
2957
- * Send a test email to verify infrastructure is correctly bound.
2958
- */
2959
- sendTest<T = any>(toEmail: string): Promise<T>;
2960
- /**
2961
- * Define customized global email footers, limits, and specific campaign policies.
2962
- */
2963
- saveAdvancedConfig<T = any>(payload: any): Promise<T>;
2964
- /**
2965
- * Retrieve email configuration health properties including bounce limits metrics.
2966
- */
2967
- getHealth<T = any>(): Promise<T>;
2968
- /**
2969
- * Upgrade configurations dynamically to add DMARC enforcement records.
2970
- */
2971
- fixDmarc<T = any>(): Promise<T>;
2972
- /**
2973
- * Discover internally available providers constants metadata.
2974
- */
2975
- listProviders<T = any>(): Promise<T>;
2976
- }
2977
- declare class Settings extends APIResource {
2978
- email: EmailConfig;
2979
- constructor(client: any);
2980
- }
2981
-
2982
- interface CorsOriginCreatePayload {
2983
- url: string;
2984
- name?: string;
2985
- allowedHeaders?: string[];
2986
- allowedMethods?: string[];
2987
- }
2988
- interface CorsOriginUpdatePayload {
2989
- url?: string;
2990
- name?: string;
2991
- allowedHeaders?: string[];
2992
- allowedMethods?: string[];
2993
- isActive?: boolean;
2994
- }
2995
- declare class Cors extends APIResource {
2996
- /**
2997
- * List all dynamic cross-origin policies.
2998
- */
2999
- list<T = any>(): Promise<T>;
3000
- /**
3001
- * Register a new cross-origin client for the SaaS API network dynamically.
3002
- */
3003
- create<T = any>(payload: CorsOriginCreatePayload): Promise<T>;
3004
- /**
3005
- * Adjust active states or configurations for an existing origin policy.
3006
- */
3007
- update<T = any>(id: string, payload: CorsOriginUpdatePayload): Promise<T>;
3008
- /**
3009
- * Irreversibly drop support for a cross-origin client URL policy permanently.
3010
- */
3011
- delete<T = any>(id: string): Promise<T>;
3012
- }
3013
-
3014
- interface CheckoutProduct {
3015
- externalId: string;
3016
- name: string;
3017
- price: number;
3018
- image?: string;
3019
- }
3020
- interface CheckoutAmountBreakdown {
3021
- subtotal: number;
3022
- discount: number;
3023
- delivery: number;
3024
- total: number;
3025
- }
3026
- interface CheckoutSession {
3027
- sessionId: string;
3028
- product: {
3029
- name: string;
3030
- price: number;
3031
- image?: string;
3032
- };
3033
- amounts: CheckoutAmountBreakdown;
3034
- items: Array<{
3035
- productId: string;
3036
- quantity: number;
3037
- }>;
3038
- }
3039
- interface CreateSessionPayload {
3040
- productId: string;
3041
- quantity: number;
3042
- couponCode?: string;
3043
- }
3044
- interface ApplyCouponPayload {
3045
- sessionId: string;
3046
- couponCode: string;
3047
- }
3048
- interface VerifyPayload {
3049
- sessionId: string;
3050
- method: "truecaller" | "otp";
3051
- token?: string;
3052
- phone?: string;
3053
- otp?: string;
3054
- }
3055
- interface CreateOrderPayload {
3056
- sessionId: string;
3057
- customer: {
3058
- name: string;
3059
- phone: string;
3060
- email?: string;
3061
- address: {
3062
- line1: string;
3063
- city: string;
3064
- state: string;
3065
- pincode: string;
3066
- };
3067
- };
3068
- paymentProvider: "razorpay" | "cod";
3069
- }
3070
- interface CheckoutOrderResponse {
3071
- order_id: string;
3072
- payment_order_id?: string;
3073
- amount?: number;
3074
- currency?: string;
3075
- status?: string;
3076
- message?: string;
3077
- }
3078
-
3079
- /**
3080
- * Resource for managing the ErixCheckout one-click flow.
3081
- *
3082
- * This resource handles session creation, coupon application,
3083
- * identity verification, and final order placement.
3084
- */
3085
- declare class Checkout extends APIResource {
3086
- /**
3087
- * Retrieves product information for the checkout modal.
3088
- * @param productId - External SKU/ID of the product.
3089
- */
3090
- getProduct(productId: string): Promise<CheckoutProduct>;
3091
- /**
3092
- * Initializes a new checkout session.
3093
- */
3094
- createSession(payload: CreateSessionPayload): Promise<CheckoutSession>;
3095
- /**
3096
- * Applies a discount coupon to an active session.
3097
- */
3098
- applyCoupon(payload: ApplyCouponPayload): Promise<CheckoutSession>;
3099
- /**
3100
- * Verifies user identity via Truecaller or OTP.
3101
- */
3102
- verify(payload: VerifyPayload): Promise<{
3103
- verified: boolean;
3104
- data?: any;
3105
- }>;
3106
- /**
3107
- * Finalizes the order and initiates payment.
3108
- */
3109
- createOrder(payload: CreateOrderPayload): Promise<CheckoutOrderResponse>;
3110
- }
3111
-
3112
3280
  /**
3113
- * Configuration options for the Ecodrix client.
3281
+ * Configuration options for the ECODrIxAPI client.
3114
3282
  *
3115
3283
  * Minimum required: `apiKey` and `clientCode`.
3116
3284
  * The backend URL is managed internally and should not need to be changed.
3117
3285
  */
3118
- interface EcodrixOptions {
3286
+ interface ECODrIxAPIOptions {
3119
3287
  /**
3120
3288
  * Your ECODrIx Platform API key.
3121
3289
  * Obtain this from the ECODrIx dashboard under Settings → API Keys.
@@ -3152,9 +3320,9 @@ interface EcodrixOptions {
3152
3320
  *
3153
3321
  * @example
3154
3322
  * ```typescript
3155
- * import { Ecodrix } from "@ecodrix/erix-api";
3323
+ * import { ECODrIxAPI } from "@ecodrix/erix-api";
3156
3324
  *
3157
- * const ecod = new Ecodrix({
3325
+ * const ecod = new ECODrIxAPI({
3158
3326
  * apiKey: process.env.ECOD_API_KEY!,
3159
3327
  * clientCode: "ERIX_CLNT_JHBJHF",
3160
3328
  * });
@@ -3163,7 +3331,7 @@ interface EcodrixOptions {
3163
3331
  * const lead = await ecod.crm.leads.create({ firstName: "Alice", phone: "+91..." });
3164
3332
  * ```
3165
3333
  */
3166
- declare class Ecodrix {
3334
+ declare class ECODrIxAPI {
3167
3335
  /**
3168
3336
  * @internal Axios HTTP client for making API requests.
3169
3337
  */
@@ -3214,7 +3382,7 @@ declare class Ecodrix {
3214
3382
  readonly cors: Cors;
3215
3383
  /** ErixCheckout one-click checkout flow management. */
3216
3384
  readonly checkout: Checkout;
3217
- constructor(options: EcodrixOptions);
3385
+ constructor(options: ECODrIxAPIOptions);
3218
3386
  /**
3219
3387
  * Join a specific real-time room (e.g., a conversation or a lead).
3220
3388
  *
@@ -3295,4 +3463,4 @@ declare class Ecodrix {
3295
3463
  request<T = any>(method: Method, path: string, data?: any, params?: any): Promise<T>;
3296
3464
  }
3297
3465
 
3298
- export { APIError, Activities, Agency, Analytics, type AnalyticsParams, type AnalyticsRange, type ApplyCouponPayload, type AssignEventPayload, AuthenticationError, AutomationDashboard, type AutomationRulePayload, Automations, Blogs, Broadcasts, CRM, type CallbackLog, type CampaignResult, Campaigns, type ChatMediaMeta, Checkout, type CheckoutAmountBreakdown, type CheckoutOrderResponse, type CheckoutProduct, type CheckoutSession, type ClientHealth, Clients, Conversations, Cors, type CorsOriginCreatePayload, type CorsOriginUpdatePayload, type CreateBroadcastParams, type CreateLeadParams, type CreateMeetingParams, type CreateOrderPayload, type CreatePipelineParams, type CreateSessionPayload, type CreateTemplateDTO, Ecodrix, EcodrixError, type EcodrixOptions, Email, EmailConfig, EmailResource, type EmailTemplate, Emails, type EventDefinition, type EventLog, EventsResource, type FieldManifest, type FieldType, Files, Folders, GlobalLeads, Health, type JobStats, type JobStatus, type LeadSource, type LeadStatus, Leads, type ListLeadsParams, type ListParams, type LogActivityParams, type LogCallParams, type LogFilter, type LogPaginationQuery, type LogResponse, Logs, Marketing, Media, MediaResource, Meetings, Messages, Notes, Notifications, Payments, type PipelineStageParams, Pipelines, Queue, RateLimitError, type ResourceManifest, Scoring, type ScoringConfig, type SendCampaignParams, type SendCampaignPayload, type SendMessageParams, type SendTemplateParams, type SendTemplatePayload, Sequences, Services, Settings, Storage, type SystemHealth, type TemplateMapping, type TemplatePreviewResponse, Templates, type TriggerPayload, type TriggerResponse, type UpdateMeetingParams, type UploadOptions, type UpsertLeadParams, type VerifyPayload, WebhookSignatureError, Webhooks, WhatsApp, WhatsAppMarketing, Ecodrix as default };
3466
+ export { APIError, type ApplyCouponPayload, AuthenticationError, type CheckoutAmountBreakdown, type CheckoutOrderResponse, type CheckoutProduct, type CheckoutSession, type CreateOrderPayload, type CreateSessionPayload, ECODrIxAPI as ECODrIx, ECODrIxAPI, type ECODrIxAPIOptions, EcodrixError, type FieldManifest, type FieldType, RateLimitError, type ResourceManifest, type VerifyPayload, ECODrIxAPI as default };