@instabrain-sdks/api-client 2.2.2 → 2.3.1

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.
@@ -4,8 +4,9 @@ import { ApplicationService } from '../services/application.service';
4
4
  import { ReportsService } from '../services/reports.service';
5
5
  import { GigdbService } from '../services/gigdb.service';
6
6
  import { AdbService } from '../services/adb.service';
7
+ import { IBTermService } from '../services/ibterm.service';
7
8
  import { SecureSignService } from '../services/secure-sign.service';
8
- import { InstaBrainConfig, Environment, ThirdPartyQuoteReq, ThirdPartyQuoteResp, ThirdPartyStartApplicationReq, ThirdPartyStartAppResp, AgentPortalReq, ThirdPartyProspectsResp, ThirdPartySalesReportRes, ThirdPartyApplicationReportRes, ThirdPartyGigdbQuoteRequest, ThirdPartyGigdbUpdateQuoteReq, ThirdPartyGigdbAppReq, ThirdPartyEftPaymentReq, ThirdPartyAdbQuoteRequest, ThirdPartyAdbUpdateQuoteReq, ThirdPartyAdbAppReq, ThirdPartyAdbStartAppResp, AdbRiderDetailsResp, ThirdPartySendPinReq, ThirdPartyResendPinReq, ThirdPartyVerifyPinReq, ThirdPartyPrepareDocsResp, ThirdPartySendPinResp, ThirdPartyResendPinResp, ThirdPartyVerifyPinResp, ThirdPartyFinalSubmitResp } from '../types';
9
+ import { InstaBrainConfig, Environment, ThirdPartyQuoteReq, ThirdPartyQuoteResp, ThirdPartyStartApplicationReq, ThirdPartyStartAppResp, AgentPortalReq, ThirdPartyProspectsResp, ThirdPartySalesReportRes, ThirdPartyApplicationReportRes, ThirdPartyGigdbQuoteRequest, ThirdPartyGigdbUpdateQuoteReq, ThirdPartyGigdbAppReq, ThirdPartyEftPaymentReq, ThirdPartyAdbQuoteRequest, ThirdPartyAdbUpdateQuoteReq, ThirdPartyAdbAppReq, ThirdPartyAdbStartAppResp, AdbRiderDetailsResp, IBTermRiderDetailsResp, IBTermStartApplicationReq, ThirdPartySendPinReq, ThirdPartyResendPinReq, ThirdPartyVerifyPinReq, ThirdPartyPrepareDocsResp, ThirdPartySendPinResp, ThirdPartyResendPinResp, ThirdPartyVerifyPinResp, ThirdPartyFinalSubmitResp } from '../types';
9
10
  /**
10
11
  * Main InstaBrain SDK client
11
12
  */
@@ -17,6 +18,7 @@ export declare class InstaBrainClient {
17
18
  readonly reports: ReportsService;
18
19
  readonly gigdb: GigdbService;
19
20
  readonly adb: AdbService;
21
+ readonly ibterm: IBTermService;
20
22
  readonly secureSign: SecureSignService;
21
23
  constructor(config?: InstaBrainConfig);
22
24
  /**
@@ -143,6 +145,41 @@ export declare class InstaBrainClient {
143
145
  * @returns Promise with the list of matching occupation labels
144
146
  */
145
147
  getAdbOccupationOptions(query?: string): Promise<string[]>;
148
+ /**
149
+ * Get available riders for IB Term in a given state, filtered by the
150
+ * applicant's age and nicotine-use status.
151
+ *
152
+ * Optional pre-quote step. When `flagProductNotAvailableForState` is `true`
153
+ * in the response, IB Term is not available for these inputs — do not proceed
154
+ * to the Quote API.
155
+ *
156
+ * @param stateCode - Two-letter US state code (e.g. "TX")
157
+ * @param age - Applicant's age, integer, 18–60 inclusive
158
+ * @param flagNicotineUse - Whether the applicant uses nicotine
159
+ * @returns Promise with riders list and product availability flag
160
+ */
161
+ getIBTermRiderDetails(stateCode: string, age: number, flagNicotineUse: boolean): Promise<IBTermRiderDetailsResp>;
162
+ /**
163
+ * Start an IB Term application from a prior IB Term quote.
164
+ *
165
+ * `isDeclined: true` is a valid success response (knockout), not an error.
166
+ * IB Term does NOT use `ApplicationLimitReached` (that applies to ADB/GIGDB only).
167
+ *
168
+ * @param request - The IB Term application request payload
169
+ * @returns Promise with opportunityId, isDeclined flag, and isQuoteChanged
170
+ */
171
+ startIBTermApplication(request: IBTermStartApplicationReq): Promise<ThirdPartyStartAppResp>;
172
+ /**
173
+ * Get the existing quote for an in-flight IB Term opportunity.
174
+ *
175
+ * Use to resume or review a previously created IB Term quote by its
176
+ * opportunity ID. A not-found result is an error (surfaced via the SDK error
177
+ * model), not a valid business state.
178
+ *
179
+ * @param opportunityId - UUID from a prior IB Term application/quote flow
180
+ * @returns Promise with the current quote response
181
+ */
182
+ getExistingIBTermQuote(opportunityId: string): Promise<ThirdPartyQuoteResp>;
146
183
  /**
147
184
  * Prepare the signing package and check available delivery channels
148
185
  * Always call this first in the signing flow. If isSignCompleted is true, skip to finalSubmit().
@@ -8,6 +8,7 @@ const application_service_1 = require("../services/application.service");
8
8
  const reports_service_1 = require("../services/reports.service");
9
9
  const gigdb_service_1 = require("../services/gigdb.service");
10
10
  const adb_service_1 = require("../services/adb.service");
11
+ const ibterm_service_1 = require("../services/ibterm.service");
11
12
  const secure_sign_service_1 = require("../services/secure-sign.service");
12
13
  /**
13
14
  * Main InstaBrain SDK client
@@ -21,6 +22,7 @@ class InstaBrainClient {
21
22
  this.reports = new reports_service_1.ReportsService(this.httpClient);
22
23
  this.gigdb = new gigdb_service_1.GigdbService(this.httpClient);
23
24
  this.adb = new adb_service_1.AdbService(this.httpClient);
25
+ this.ibterm = new ibterm_service_1.IBTermService(this.httpClient);
24
26
  this.secureSign = new secure_sign_service_1.SecureSignService(this.httpClient);
25
27
  }
26
28
  /**
@@ -189,6 +191,48 @@ class InstaBrainClient {
189
191
  async getAdbOccupationOptions(query) {
190
192
  return this.adb.getOccupationOptions(query);
191
193
  }
194
+ // ── IB Term Methods ────────────────────────────────────────────────
195
+ /**
196
+ * Get available riders for IB Term in a given state, filtered by the
197
+ * applicant's age and nicotine-use status.
198
+ *
199
+ * Optional pre-quote step. When `flagProductNotAvailableForState` is `true`
200
+ * in the response, IB Term is not available for these inputs — do not proceed
201
+ * to the Quote API.
202
+ *
203
+ * @param stateCode - Two-letter US state code (e.g. "TX")
204
+ * @param age - Applicant's age, integer, 18–60 inclusive
205
+ * @param flagNicotineUse - Whether the applicant uses nicotine
206
+ * @returns Promise with riders list and product availability flag
207
+ */
208
+ async getIBTermRiderDetails(stateCode, age, flagNicotineUse) {
209
+ return this.ibterm.getRiderDetails(stateCode, age, flagNicotineUse);
210
+ }
211
+ /**
212
+ * Start an IB Term application from a prior IB Term quote.
213
+ *
214
+ * `isDeclined: true` is a valid success response (knockout), not an error.
215
+ * IB Term does NOT use `ApplicationLimitReached` (that applies to ADB/GIGDB only).
216
+ *
217
+ * @param request - The IB Term application request payload
218
+ * @returns Promise with opportunityId, isDeclined flag, and isQuoteChanged
219
+ */
220
+ async startIBTermApplication(request) {
221
+ return this.ibterm.startApplication(request);
222
+ }
223
+ /**
224
+ * Get the existing quote for an in-flight IB Term opportunity.
225
+ *
226
+ * Use to resume or review a previously created IB Term quote by its
227
+ * opportunity ID. A not-found result is an error (surfaced via the SDK error
228
+ * model), not a valid business state.
229
+ *
230
+ * @param opportunityId - UUID from a prior IB Term application/quote flow
231
+ * @returns Promise with the current quote response
232
+ */
233
+ async getExistingIBTermQuote(opportunityId) {
234
+ return this.ibterm.getExistingQuote(opportunityId);
235
+ }
192
236
  // ── Secure Sign Methods ─────────────────────────────────────────────
193
237
  /**
194
238
  * Prepare the signing package and check available delivery channels
@@ -0,0 +1,66 @@
1
+ import { HttpClient } from '../utils/http-client';
2
+ import { BaseService } from './base.service';
3
+ import { IBTermRiderDetailsResp, IBTermStartApplicationReq } from '../types/ibterm.types';
4
+ import { ThirdPartyStartAppResp, ThirdPartyQuoteResp } from '../types';
5
+ /**
6
+ * IB Term (InstaBrain Term Life) service
7
+ * Handles lookup, quote, and application for the IB Term product (ages 18–60)
8
+ * distributed through Fidelity Life.
9
+ *
10
+ * Flow:
11
+ * 1. (optional) getRiderDetails(stateCode, age, flagNicotineUse) → rider availability + codes
12
+ * 2. InstaBrainClient.getQuote() → quoteResponseId (uses ThirdPartyIbTermQuote/get via QuoteService)
13
+ * 3. startApplication() → opportunityId (or isDeclined=true)
14
+ * 4. GigdbService.saveEftPayment() → true (shared endpoint — use via InstaBrainClient.saveEftPayment)
15
+ * 5. SecureSign flow → (shared — use SecureSignService)
16
+ * 6. Final Submit → (shared — use ApplicationService.finalSubmit)
17
+ */
18
+ export declare class IBTermService extends BaseService {
19
+ constructor(httpClient: HttpClient);
20
+ /**
21
+ * Get available riders for IB Term in a given state, filtered by the
22
+ * applicant's age and nicotine-use status.
23
+ *
24
+ * Optional pre-quote step. When `flagProductNotAvailableForState` is `true`
25
+ * in the response, IB Term is not available for these inputs — do not proceed
26
+ * to the Quote API. The empty `riders` array in that case is a valid business
27
+ * state, not an error, and is returned as-is by the SDK.
28
+ *
29
+ * @param stateCode - Two-letter US state code (e.g. "TX").
30
+ * @param age - Applicant's age, integer, 18–60 inclusive.
31
+ * @param flagNicotineUse - Whether the applicant uses nicotine; required by the backend.
32
+ * @returns Rider list + product availability flag.
33
+ */
34
+ getRiderDetails(stateCode: string, age: number, flagNicotineUse: boolean): Promise<IBTermRiderDetailsResp>;
35
+ /**
36
+ * Start an IB Term application from a prior IB Term quote.
37
+ *
38
+ * Notes:
39
+ * - `isDeclined: true` is a valid success response (knockout), not an error.
40
+ * - IB Term does NOT use `ApplicationLimitReached` (that applies to ADB/GIGDB only).
41
+ * - When the Dependent Child Rider was selected on the quote, `childRiderInfo`
42
+ * becomes required. Setting any of the 4 child knockout questions to `true`
43
+ * declines the application.
44
+ *
45
+ * @param request - The IB Term application request payload.
46
+ * @returns Promise with opportunityId, isDeclined flag, and `isQuoteChanged`.
47
+ */
48
+ startApplication(request: IBTermStartApplicationReq): Promise<ThirdPartyStartAppResp>;
49
+ /**
50
+ * Get the existing quote for an in-flight IB Term opportunity.
51
+ *
52
+ * Use to resume or review a previously created IB Term quote by its
53
+ * opportunity ID without re-quoting.
54
+ *
55
+ * Unlike rider-details product-unavailability, a not-found result here is an
56
+ * error (surfaced via the SDK error model), not a valid business state:
57
+ * - missing / empty / non-GUID `opportunityId` → `InvalidRequestFormat`
58
+ * - opportunity belongs to a different product → `OpportunityIdDoesNotMatchProduct`
59
+ * (field-level message under `InvalidRequestFormat`)
60
+ * - opportunity exists but has no stored quote → `QuoteNotFound`
61
+ *
62
+ * @param opportunityId - UUID from a prior IB Term application/quote flow.
63
+ * @returns Promise with the current quote response.
64
+ */
65
+ getExistingQuote(opportunityId: string): Promise<ThirdPartyQuoteResp>;
66
+ }
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IBTermService = void 0;
4
+ const base_service_1 = require("./base.service");
5
+ /**
6
+ * IB Term (InstaBrain Term Life) service
7
+ * Handles lookup, quote, and application for the IB Term product (ages 18–60)
8
+ * distributed through Fidelity Life.
9
+ *
10
+ * Flow:
11
+ * 1. (optional) getRiderDetails(stateCode, age, flagNicotineUse) → rider availability + codes
12
+ * 2. InstaBrainClient.getQuote() → quoteResponseId (uses ThirdPartyIbTermQuote/get via QuoteService)
13
+ * 3. startApplication() → opportunityId (or isDeclined=true)
14
+ * 4. GigdbService.saveEftPayment() → true (shared endpoint — use via InstaBrainClient.saveEftPayment)
15
+ * 5. SecureSign flow → (shared — use SecureSignService)
16
+ * 6. Final Submit → (shared — use ApplicationService.finalSubmit)
17
+ */
18
+ class IBTermService extends base_service_1.BaseService {
19
+ constructor(httpClient) {
20
+ super(httpClient);
21
+ }
22
+ /**
23
+ * Get available riders for IB Term in a given state, filtered by the
24
+ * applicant's age and nicotine-use status.
25
+ *
26
+ * Optional pre-quote step. When `flagProductNotAvailableForState` is `true`
27
+ * in the response, IB Term is not available for these inputs — do not proceed
28
+ * to the Quote API. The empty `riders` array in that case is a valid business
29
+ * state, not an error, and is returned as-is by the SDK.
30
+ *
31
+ * @param stateCode - Two-letter US state code (e.g. "TX").
32
+ * @param age - Applicant's age, integer, 18–60 inclusive.
33
+ * @param flagNicotineUse - Whether the applicant uses nicotine; required by the backend.
34
+ * @returns Rider list + product availability flag.
35
+ */
36
+ async getRiderDetails(stateCode, age, flagNicotineUse) {
37
+ return this.get('get IB Term rider details', '/api/ThirdPartyIbTermLookup/get-rider-details', { params: { stateCode, age, flagNicotineUse } });
38
+ }
39
+ /**
40
+ * Start an IB Term application from a prior IB Term quote.
41
+ *
42
+ * Notes:
43
+ * - `isDeclined: true` is a valid success response (knockout), not an error.
44
+ * - IB Term does NOT use `ApplicationLimitReached` (that applies to ADB/GIGDB only).
45
+ * - When the Dependent Child Rider was selected on the quote, `childRiderInfo`
46
+ * becomes required. Setting any of the 4 child knockout questions to `true`
47
+ * declines the application.
48
+ *
49
+ * @param request - The IB Term application request payload.
50
+ * @returns Promise with opportunityId, isDeclined flag, and `isQuoteChanged`.
51
+ */
52
+ async startApplication(request) {
53
+ return this.post('start IB Term application', '/api/ThirdPartyIBTermApplication/start-application', request);
54
+ }
55
+ /**
56
+ * Get the existing quote for an in-flight IB Term opportunity.
57
+ *
58
+ * Use to resume or review a previously created IB Term quote by its
59
+ * opportunity ID without re-quoting.
60
+ *
61
+ * Unlike rider-details product-unavailability, a not-found result here is an
62
+ * error (surfaced via the SDK error model), not a valid business state:
63
+ * - missing / empty / non-GUID `opportunityId` → `InvalidRequestFormat`
64
+ * - opportunity belongs to a different product → `OpportunityIdDoesNotMatchProduct`
65
+ * (field-level message under `InvalidRequestFormat`)
66
+ * - opportunity exists but has no stored quote → `QuoteNotFound`
67
+ *
68
+ * @param opportunityId - UUID from a prior IB Term application/quote flow.
69
+ * @returns Promise with the current quote response.
70
+ */
71
+ async getExistingQuote(opportunityId) {
72
+ return this.get('get existing IB Term quote', '/api/ThirdPartyIbTermQuote/get-existing-quote', { params: { opportunityId } });
73
+ }
74
+ }
75
+ exports.IBTermService = IBTermService;
@@ -26,7 +26,7 @@ export interface ThirdPartyAdbQuoteRequest {
26
26
  lastName?: string;
27
27
  /** Valid email format */
28
28
  email?: string;
29
- /** 10-digit numeric */
29
+ /** 10-digit local (e.g. `1234567890`) or E.164 format (e.g. `+11234567890`; optional space allowed: `+1 1234567890`) */
30
30
  phoneNum?: string;
31
31
  }
32
32
  /**
@@ -90,7 +90,7 @@ export interface ThirdPartyAdbAppReq {
90
90
  lastName: string;
91
91
  /** Valid email format */
92
92
  email: string;
93
- /** 10-digit numeric */
93
+ /** 10-digit local (e.g. `1234567890`) or E.164 format (e.g. `+11234567890`; optional space allowed: `+1 1234567890`) */
94
94
  phoneNumber: string;
95
95
  isUsCitizen: boolean;
96
96
  /** Required when isUsCitizen = false */
@@ -10,8 +10,8 @@ export interface ThirdPartyStartAppResp {
10
10
  agentLink: string | null;
11
11
  eAppAgentLink: string | null;
12
12
  applicantLink: string | null;
13
- /** Whether the application was declined (GIGDB product) */
13
+ /** `true` when the application is declined (knockout or underwriting decision). Applies to GIGDB and IB Term. */
14
14
  isDeclined: boolean;
15
- /** Whether the quote changed during application (GIGDB product) */
15
+ /** `true` when re-quote logic updated values during start-application processing. Applies to GIGDB and IB Term. */
16
16
  isQuoteChanged: boolean;
17
17
  }
@@ -395,47 +395,126 @@ export declare enum RiderType {
395
395
  ADBRider = "ADB Rider",
396
396
  DependentChildRider = "Dependent Child Rider"
397
397
  }
398
+ /**
399
+ * Buckets describing how recently the applicant last used tobacco/nicotine.
400
+ * Used on `IBTermTobaccoNicotineUsage.lastUsedPeriod` on the IB Term Start
401
+ * Application request. Values match the backend `TobaccoNicotineLastUsedPeriodOptions`
402
+ * list — case-sensitive, lowercase strings.
403
+ */
404
+ export declare enum TobaccoNicotineLastUsedPeriod {
405
+ WithinLastTwelveMonths = "within the last 12 months",
406
+ TwelveToTwentyThreeMonths = "12 to 23 months",
407
+ TwentyFourToThirtyFiveMonths = "24 to 35 months",
408
+ ThirtySixMonthsOrGreater = "36 months or greater",
409
+ Never = "never used"
410
+ }
411
+ /**
412
+ * Tobacco / nicotine product types the applicant has used. Values match the
413
+ * backend `TobaccoNicotineProductTypeOptions` list — case-sensitive, lowercase.
414
+ * Used as a non-empty array on `IBTermTobaccoNicotineUsage.productTypesUsed`.
415
+ */
416
+ export declare enum TobaccoNicotineProductType {
417
+ ChewingTobacco = "chewing tobacco",
418
+ Cigarettes = "cigarettes",
419
+ Cigars = "cigars",
420
+ ECigarettes = "e-cigarettes",
421
+ Hookah = "hookah",
422
+ NicotineGum = "nicotine gum",
423
+ NicotinePatches = "nicotine patches",
424
+ None = "none",
425
+ Other = "other",
426
+ Pipes = "pipes",
427
+ SmokelessTobacco = "smokeless tobacco",
428
+ Snuff = "snuff",
429
+ Vaping = "vaping"
430
+ }
398
431
  export declare enum AdbRiderType {
399
432
  FamilyADB = "FamilyADB",
400
433
  ReturnOfPremium = "ReturnOfPremium",
401
434
  InflationBenefit = "InflationBenefit"
402
435
  }
436
+ /**
437
+ * API Error codes returned in the top-level `error` field of a failed response.
438
+ *
439
+ * **Most validation failures use `InvalidRequestFormat`** with per-field details
440
+ * nested under `value.fields`. Only the IB Term Quote endpoint and a few
441
+ * cross-cutting business cases use other top-level error codes.
442
+ *
443
+ * Codes marked `@deprecated` are not returned by the current Third-Party API
444
+ * (per `THIRD_PARTY_ERROR_CODES.md` reference, 2026-05). They remain in the enum
445
+ * for backward-compatibility with existing integrations and will be removed in a
446
+ * future major version. Detect the equivalent failures via field-level messages
447
+ * under `InvalidRequestFormat` — see the README "Field-Level Error Messages"
448
+ * section.
449
+ */
403
450
  export declare enum APIErrorCode {
451
+ /** Top-level code for every FluentValidation failure across all products. Inspect `value.fields` for field-level details. */
452
+ InvalidRequestFormat = "InvalidRequestFormat",
453
+ /** State code missing or not recognized for the product. */
404
454
  StateNotFound = "stateNotFound",
405
- RateClassNotFound = "RateClassNotFound",
406
- RiderNotAvailable = "RiderNotAvailable",
407
- HeightNotValid = "HeightNotValid",
408
- InvalidRateclass = "InvalidRateclass",
409
- InvalidHealthClass = "InvalidHealthClass",
410
- ZipCodeNotFound = "ZipCodeNotFound",
411
- OutsideBuildChart = "outsideBuildChart",
412
- QuoteNotEligibleForGivenConditions = "QuoteNotEligibleForGivenConditions",
455
+ /** Product not offered for the selected state. */
413
456
  NotAvailableForState = "NotAvailableForState",
414
- BenefitPeriodNotAvailable = "BenefitPeriodNotAvailable",
457
+ /** Quote not eligible for the given combination of state, age, and smoker status. */
458
+ QuoteNotEligibleForGivenConditions = "QuoteNotEligibleForGivenConditions",
459
+ /** The requested face amount is not available for the selected state, age, and smoker status. */
415
460
  CoverageNotAvailable = "CoverageNotAvailable",
461
+ /** ADB only — a requested rider is not available for this state, or riders were sent when none are offered. */
462
+ RiderNotAvailable = "RiderNotAvailable",
463
+ /** ADB only — a rider benefit amount is outside the allowed minimum or maximum. */
416
464
  RiderFaceAmountNotValid = "RiderFaceAmountNotValid",
465
+ /** IB Term Quote — neither `Age` nor `DateOfBirth` was supplied. */
417
466
  AgeNotFound = "AgeNotFound",
418
- AgentLogout = "AgentLogout",
419
- DataNotFound = "dataNotFound",
467
+ /** IB Term Quote only — the requested `BenefitPeriod` is not allowed for the selected state, age, and smoker status. May appear in either the request-validation envelope (`value.fields`) or as a business-rule top-level (`value: null`). */
468
+ BenefitPeriodNotAvailable = "BenefitPeriodNotAvailable",
469
+ /** IB Term Quote only — height + weight fall outside the carrier's acceptable build chart. */
470
+ OutsideBuildChart = "outsideBuildChart",
471
+ /** IB Term Quote only — `Height` / `WeightInLbs` value or combination is invalid. */
472
+ HeightNotValid = "HeightNotValid",
473
+ /** Returned by ADB / GIGDB / IB Term `get-existing-quote` when no saved quote exists for the opportunity. */
474
+ QuoteNotFound = "QuoteNotFound",
475
+ /** ADB / GIGDB Start Application only — same SSN, email, or phone already has a policy generated within the last 30 days. IB Term does NOT use this code. */
476
+ ApplicationLimitReached = "ApplicationLimitReached",
477
+ /** Quote state and `Address.State` on Start Application refer to different US states (case-insensitive compare). Returned only after request validation passes. */
420
478
  StateMismatchIdentified = "StateMismatchIdentified",
479
+ /** The quote cannot be linked to an agent account during Start Application. */
480
+ AgentNotFound = "agentNotFound",
481
+ /** Unexpected backend failure while processing a Start Application request. */
482
+ InternalServerError = "internalServerError",
483
+ AgentLogout = "AgentLogout",
484
+ /** @deprecated Returned as a field-level message on `BirthJurisdiction.Country` under `InvalidRequestFormat`. */
421
485
  InvalidBirthCountry = "InvalidBirthCountry",
486
+ /** @deprecated Returned as a field-level message on `BirthJurisdiction.State` under `InvalidRequestFormat`. */
422
487
  InvalidBirthState = "InvalidBirthState",
488
+ /** @deprecated Returned as a field-level message on `Address.State` under `InvalidRequestFormat`. */
423
489
  InvalidResidenceState = "InvalidResidenceState",
490
+ /** @deprecated No longer returned by the API. */
424
491
  OneOfTheExistingCoveragesQuestionsNotFound = "OneOfTheExistingCoveragesQuestionsNotFound",
492
+ /** @deprecated Returned as a field-level message on `OpportunityId` under `InvalidRequestFormat` ("Quote update is not allowed when payment is already made."). */
425
493
  PaymentAlreadyMade = "PaymentAlreadyMade",
494
+ /** @deprecated Returned as a field-level message under `InvalidRequestFormat`. */
426
495
  ErrorInSaveEftPaymentDetails = "ErrorInSaveEftPaymentDetails",
496
+ /** @deprecated Returned as a field-level message under `InvalidRequestFormat`. */
427
497
  InvalidPaymentScheduledDate = "InvalidPaymentScheduledDate",
498
+ /** @deprecated Generic legacy code; no longer returned. */
428
499
  ThirdPartyQuoteError = "ThirdPartyQuoteError",
500
+ /** @deprecated Generic legacy code; no longer returned. */
429
501
  InvalidQuoteParameters = "InvalidQuoteParameters",
430
- InvalidRequestFormat = "InvalidRequestFormat",
431
- QuoteNotFound = "QuoteNotFound",
502
+ /** @deprecated ADB state issues now return field-level messages on `Address.State` under `InvalidRequestFormat`. */
432
503
  InvalidStateCode = "InvalidStateCode",
504
+ /** @deprecated ADB age range failure now returns "Age must be between 20 and 59 for ADB." on `DateOfBirth` under `InvalidRequestFormat`. */
433
505
  InvalidAdbAgeRange = "InvalidAdbAgeRange",
506
+ /** @deprecated Final Submit now returns "Application has already been final submitted." on `opportunityId` under `InvalidRequestFormat`. */
434
507
  PaymentNotMade = "paymentNotMade",
508
+ /** @deprecated Secure Sign endpoints now return field-level messages under `InvalidRequestFormat`. */
435
509
  SecureSignRelatedError = "SecureSignRelatedError",
510
+ /** @deprecated Secure Sign endpoints now return field-level messages under `InvalidRequestFormat`. */
436
511
  SigningPackageNotCreated = "SigningPackageNotCreated",
512
+ /** @deprecated Secure Sign endpoints now return field-level messages under `InvalidRequestFormat`. */
437
513
  SecureSignPinMismatch = "SecureSignPinMismatch",
514
+ /** @deprecated Secure Sign endpoints now return field-level messages under `InvalidRequestFormat`. */
438
515
  PinExpired = "PinExpired",
516
+ /** @deprecated Secure Sign endpoints now return field-level messages under `InvalidRequestFormat`. */
439
517
  DocumentsNotViewed = "DocumentsNotViewed",
518
+ /** @deprecated Secure Sign endpoints now return "Documents are already signed." on `OpportunityId` under `InvalidRequestFormat`. */
440
519
  DocumentsAlreadySigned = "DocumentsAlreadySigned"
441
520
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.APIErrorCode = exports.AdbRiderType = exports.RiderType = exports.HealthClass = exports.RateClass = exports.Country = exports.BeneficiaryRelationship = exports.BeneficiaryType = exports.State = exports.PaymentFrequency = exports.Gender = void 0;
3
+ exports.APIErrorCode = exports.AdbRiderType = exports.TobaccoNicotineProductType = exports.TobaccoNicotineLastUsedPeriod = exports.RiderType = exports.HealthClass = exports.RateClass = exports.Country = exports.BeneficiaryRelationship = exports.BeneficiaryType = exports.State = exports.PaymentFrequency = exports.Gender = void 0;
4
4
  // Gender enum (string-based — used by GIGDB and other string-API products)
5
5
  var Gender;
6
6
  (function (Gender) {
@@ -417,6 +417,41 @@ var RiderType;
417
417
  RiderType["ADBRider"] = "ADB Rider";
418
418
  RiderType["DependentChildRider"] = "Dependent Child Rider";
419
419
  })(RiderType || (exports.RiderType = RiderType = {}));
420
+ /**
421
+ * Buckets describing how recently the applicant last used tobacco/nicotine.
422
+ * Used on `IBTermTobaccoNicotineUsage.lastUsedPeriod` on the IB Term Start
423
+ * Application request. Values match the backend `TobaccoNicotineLastUsedPeriodOptions`
424
+ * list — case-sensitive, lowercase strings.
425
+ */
426
+ var TobaccoNicotineLastUsedPeriod;
427
+ (function (TobaccoNicotineLastUsedPeriod) {
428
+ TobaccoNicotineLastUsedPeriod["WithinLastTwelveMonths"] = "within the last 12 months";
429
+ TobaccoNicotineLastUsedPeriod["TwelveToTwentyThreeMonths"] = "12 to 23 months";
430
+ TobaccoNicotineLastUsedPeriod["TwentyFourToThirtyFiveMonths"] = "24 to 35 months";
431
+ TobaccoNicotineLastUsedPeriod["ThirtySixMonthsOrGreater"] = "36 months or greater";
432
+ TobaccoNicotineLastUsedPeriod["Never"] = "never used";
433
+ })(TobaccoNicotineLastUsedPeriod || (exports.TobaccoNicotineLastUsedPeriod = TobaccoNicotineLastUsedPeriod = {}));
434
+ /**
435
+ * Tobacco / nicotine product types the applicant has used. Values match the
436
+ * backend `TobaccoNicotineProductTypeOptions` list — case-sensitive, lowercase.
437
+ * Used as a non-empty array on `IBTermTobaccoNicotineUsage.productTypesUsed`.
438
+ */
439
+ var TobaccoNicotineProductType;
440
+ (function (TobaccoNicotineProductType) {
441
+ TobaccoNicotineProductType["ChewingTobacco"] = "chewing tobacco";
442
+ TobaccoNicotineProductType["Cigarettes"] = "cigarettes";
443
+ TobaccoNicotineProductType["Cigars"] = "cigars";
444
+ TobaccoNicotineProductType["ECigarettes"] = "e-cigarettes";
445
+ TobaccoNicotineProductType["Hookah"] = "hookah";
446
+ TobaccoNicotineProductType["NicotineGum"] = "nicotine gum";
447
+ TobaccoNicotineProductType["NicotinePatches"] = "nicotine patches";
448
+ TobaccoNicotineProductType["None"] = "none";
449
+ TobaccoNicotineProductType["Other"] = "other";
450
+ TobaccoNicotineProductType["Pipes"] = "pipes";
451
+ TobaccoNicotineProductType["SmokelessTobacco"] = "smokeless tobacco";
452
+ TobaccoNicotineProductType["Snuff"] = "snuff";
453
+ TobaccoNicotineProductType["Vaping"] = "vaping";
454
+ })(TobaccoNicotineProductType || (exports.TobaccoNicotineProductType = TobaccoNicotineProductType = {}));
420
455
  // Rider codes for the ADB (Accidental Death Benefit) product.
421
456
  // These are the rider *codes* (not titles) — pass them as `riders` on the
422
457
  // ADB quote / update-quote requests. Titles/descriptions are returned by
@@ -427,48 +462,97 @@ var AdbRiderType;
427
462
  AdbRiderType["ReturnOfPremium"] = "ReturnOfPremium";
428
463
  AdbRiderType["InflationBenefit"] = "InflationBenefit";
429
464
  })(AdbRiderType || (exports.AdbRiderType = AdbRiderType = {}));
430
- // API Error codes enum
465
+ /**
466
+ * API Error codes returned in the top-level `error` field of a failed response.
467
+ *
468
+ * **Most validation failures use `InvalidRequestFormat`** with per-field details
469
+ * nested under `value.fields`. Only the IB Term Quote endpoint and a few
470
+ * cross-cutting business cases use other top-level error codes.
471
+ *
472
+ * Codes marked `@deprecated` are not returned by the current Third-Party API
473
+ * (per `THIRD_PARTY_ERROR_CODES.md` reference, 2026-05). They remain in the enum
474
+ * for backward-compatibility with existing integrations and will be removed in a
475
+ * future major version. Detect the equivalent failures via field-level messages
476
+ * under `InvalidRequestFormat` — see the README "Field-Level Error Messages"
477
+ * section.
478
+ */
431
479
  var APIErrorCode;
432
480
  (function (APIErrorCode) {
481
+ // ─── Universal validation envelope ───────────────────────────────────────
482
+ /** Top-level code for every FluentValidation failure across all products. Inspect `value.fields` for field-level details. */
483
+ APIErrorCode["InvalidRequestFormat"] = "InvalidRequestFormat";
484
+ // ─── Quote business errors (ADB / GIGDB / IB Term, value: null) ──────────
485
+ /** State code missing or not recognized for the product. */
433
486
  APIErrorCode["StateNotFound"] = "stateNotFound";
434
- APIErrorCode["RateClassNotFound"] = "RateClassNotFound";
435
- APIErrorCode["RiderNotAvailable"] = "RiderNotAvailable";
436
- APIErrorCode["HeightNotValid"] = "HeightNotValid";
437
- APIErrorCode["InvalidRateclass"] = "InvalidRateclass";
438
- APIErrorCode["InvalidHealthClass"] = "InvalidHealthClass";
439
- APIErrorCode["ZipCodeNotFound"] = "ZipCodeNotFound";
440
- APIErrorCode["OutsideBuildChart"] = "outsideBuildChart";
441
- APIErrorCode["QuoteNotEligibleForGivenConditions"] = "QuoteNotEligibleForGivenConditions";
487
+ /** Product not offered for the selected state. */
442
488
  APIErrorCode["NotAvailableForState"] = "NotAvailableForState";
443
- APIErrorCode["BenefitPeriodNotAvailable"] = "BenefitPeriodNotAvailable";
489
+ /** Quote not eligible for the given combination of state, age, and smoker status. */
490
+ APIErrorCode["QuoteNotEligibleForGivenConditions"] = "QuoteNotEligibleForGivenConditions";
491
+ /** The requested face amount is not available for the selected state, age, and smoker status. */
444
492
  APIErrorCode["CoverageNotAvailable"] = "CoverageNotAvailable";
493
+ /** ADB only — a requested rider is not available for this state, or riders were sent when none are offered. */
494
+ APIErrorCode["RiderNotAvailable"] = "RiderNotAvailable";
495
+ /** ADB only — a rider benefit amount is outside the allowed minimum or maximum. */
445
496
  APIErrorCode["RiderFaceAmountNotValid"] = "RiderFaceAmountNotValid";
446
- // GIGDB-specific error codes
497
+ /** IB Term Quote — neither `Age` nor `DateOfBirth` was supplied. */
447
498
  APIErrorCode["AgeNotFound"] = "AgeNotFound";
448
- APIErrorCode["AgentLogout"] = "AgentLogout";
449
- APIErrorCode["DataNotFound"] = "dataNotFound";
499
+ // ─── IB Term Quote — additional business errors ───────────────────────────
500
+ /** IB Term Quote only — the requested `BenefitPeriod` is not allowed for the selected state, age, and smoker status. May appear in either the request-validation envelope (`value.fields`) or as a business-rule top-level (`value: null`). */
501
+ APIErrorCode["BenefitPeriodNotAvailable"] = "BenefitPeriodNotAvailable";
502
+ /** IB Term Quote only — height + weight fall outside the carrier's acceptable build chart. */
503
+ APIErrorCode["OutsideBuildChart"] = "outsideBuildChart";
504
+ /** IB Term Quote only — `Height` / `WeightInLbs` value or combination is invalid. */
505
+ APIErrorCode["HeightNotValid"] = "HeightNotValid";
506
+ // ─── Get-Existing-Quote business error ────────────────────────────────────
507
+ /** Returned by ADB / GIGDB / IB Term `get-existing-quote` when no saved quote exists for the opportunity. */
508
+ APIErrorCode["QuoteNotFound"] = "QuoteNotFound";
509
+ // ─── Start Application — duplicate-detection limit ───────────────────────
510
+ /** ADB / GIGDB Start Application only — same SSN, email, or phone already has a policy generated within the last 30 days. IB Term does NOT use this code. */
511
+ APIErrorCode["ApplicationLimitReached"] = "ApplicationLimitReached";
512
+ // ─── Start Application — business top-level errors (ADB / GIGDB / IB Term) ─
513
+ /** Quote state and `Address.State` on Start Application refer to different US states (case-insensitive compare). Returned only after request validation passes. */
450
514
  APIErrorCode["StateMismatchIdentified"] = "StateMismatchIdentified";
515
+ /** The quote cannot be linked to an agent account during Start Application. */
516
+ APIErrorCode["AgentNotFound"] = "agentNotFound";
517
+ /** Unexpected backend failure while processing a Start Application request. */
518
+ APIErrorCode["InternalServerError"] = "internalServerError";
519
+ // ─── Session ─────────────────────────────────────────────────────────────
520
+ APIErrorCode["AgentLogout"] = "AgentLogout";
521
+ // ─── DEPRECATED — superseded by `InvalidRequestFormat` field-level messages ──
522
+ /** @deprecated Returned as a field-level message on `BirthJurisdiction.Country` under `InvalidRequestFormat`. */
451
523
  APIErrorCode["InvalidBirthCountry"] = "InvalidBirthCountry";
524
+ /** @deprecated Returned as a field-level message on `BirthJurisdiction.State` under `InvalidRequestFormat`. */
452
525
  APIErrorCode["InvalidBirthState"] = "InvalidBirthState";
526
+ /** @deprecated Returned as a field-level message on `Address.State` under `InvalidRequestFormat`. */
453
527
  APIErrorCode["InvalidResidenceState"] = "InvalidResidenceState";
528
+ /** @deprecated No longer returned by the API. */
454
529
  APIErrorCode["OneOfTheExistingCoveragesQuestionsNotFound"] = "OneOfTheExistingCoveragesQuestionsNotFound";
530
+ /** @deprecated Returned as a field-level message on `OpportunityId` under `InvalidRequestFormat` ("Quote update is not allowed when payment is already made."). */
455
531
  APIErrorCode["PaymentAlreadyMade"] = "PaymentAlreadyMade";
532
+ /** @deprecated Returned as a field-level message under `InvalidRequestFormat`. */
456
533
  APIErrorCode["ErrorInSaveEftPaymentDetails"] = "ErrorInSaveEftPaymentDetails";
534
+ /** @deprecated Returned as a field-level message under `InvalidRequestFormat`. */
457
535
  APIErrorCode["InvalidPaymentScheduledDate"] = "InvalidPaymentScheduledDate";
536
+ /** @deprecated Generic legacy code; no longer returned. */
458
537
  APIErrorCode["ThirdPartyQuoteError"] = "ThirdPartyQuoteError";
538
+ /** @deprecated Generic legacy code; no longer returned. */
459
539
  APIErrorCode["InvalidQuoteParameters"] = "InvalidQuoteParameters";
460
- APIErrorCode["InvalidRequestFormat"] = "InvalidRequestFormat";
461
- APIErrorCode["QuoteNotFound"] = "QuoteNotFound";
462
- // ADB-specific error codes
540
+ /** @deprecated ADB state issues now return field-level messages on `Address.State` under `InvalidRequestFormat`. */
463
541
  APIErrorCode["InvalidStateCode"] = "InvalidStateCode";
542
+ /** @deprecated ADB age range failure now returns "Age must be between 20 and 59 for ADB." on `DateOfBirth` under `InvalidRequestFormat`. */
464
543
  APIErrorCode["InvalidAdbAgeRange"] = "InvalidAdbAgeRange";
465
- // Final Submit error codes
544
+ /** @deprecated Final Submit now returns "Application has already been final submitted." on `opportunityId` under `InvalidRequestFormat`. */
466
545
  APIErrorCode["PaymentNotMade"] = "paymentNotMade";
467
- // Secure Sign error codes
546
+ /** @deprecated Secure Sign endpoints now return field-level messages under `InvalidRequestFormat`. */
468
547
  APIErrorCode["SecureSignRelatedError"] = "SecureSignRelatedError";
548
+ /** @deprecated Secure Sign endpoints now return field-level messages under `InvalidRequestFormat`. */
469
549
  APIErrorCode["SigningPackageNotCreated"] = "SigningPackageNotCreated";
550
+ /** @deprecated Secure Sign endpoints now return field-level messages under `InvalidRequestFormat`. */
470
551
  APIErrorCode["SecureSignPinMismatch"] = "SecureSignPinMismatch";
552
+ /** @deprecated Secure Sign endpoints now return field-level messages under `InvalidRequestFormat`. */
471
553
  APIErrorCode["PinExpired"] = "PinExpired";
554
+ /** @deprecated Secure Sign endpoints now return field-level messages under `InvalidRequestFormat`. */
472
555
  APIErrorCode["DocumentsNotViewed"] = "DocumentsNotViewed";
556
+ /** @deprecated Secure Sign endpoints now return "Documents are already signed." on `OpportunityId` under `InvalidRequestFormat`. */
473
557
  APIErrorCode["DocumentsAlreadySigned"] = "DocumentsAlreadySigned";
474
558
  })(APIErrorCode || (exports.APIErrorCode = APIErrorCode = {}));