@instabrain-sdks/api-client 2.3.0 → 2.3.2
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 +1788 -1619
- package/dist/services/ibterm.service.d.ts +1 -1
- package/dist/services/ibterm.service.js +1 -1
- package/dist/types/enums.d.ts +45 -41
- package/dist/types/enums.js +51 -42
- package/dist/types/errors.d.ts +4 -1
- package/dist/types/errors.js +19 -18
- package/dist/types/ibterm.types.d.ts +85 -29
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
# @instabrain-sdks/api-client
|
|
2
2
|
|
|
3
|
-
[npm version](https://badge.fury.io/js/%40instabrain-sdks%2Fapi-client)
|
|
3
|
+
[](https://badge.fury.io/js/%40instabrain-sdks%2Fapi-client)
|
|
4
4
|
|
|
5
|
-
TypeScript
|
|
5
|
+
TypeScript SDK for Node.js. All operations go through `InstaBrainClient` — request/response types are exported from `@instabrain-sdks/api-client`.
|
|
6
6
|
|
|
7
|
-
**
|
|
7
|
+
**Products covered:** GIGDB, ADB, IB Term.
|
|
8
|
+
|
|
9
|
+
- **GIGDB & ADB** — full client flow: `get*Quote()` → `start*Application()` → `saveEftPayment()` → SecureSign methods → `finalSubmit()`.
|
|
10
|
+
- **IB Term** — client flow ends at `startIBTermApplication()`; use returned `agentLink` / `applicantLink` / `eAppAgentLink` for the InstaBrain frontend.
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
import { InstaBrainClient } from '@instabrain-sdks/api-client';
|
|
14
|
+
|
|
15
|
+
const client = InstaBrainClient.forEnvironment('sandbox');
|
|
16
|
+
await client.authenticate(userId, accessToken);
|
|
17
|
+
```
|
|
8
18
|
|
|
9
19
|
Credentials (`userId` and `accessToken`) are provisioned during onboarding.
|
|
10
20
|
|
|
@@ -15,25 +25,59 @@ Credentials (`userId` and `accessToken`) are provisioned during onboarding.
|
|
|
15
25
|
1. [Installation](#installation)
|
|
16
26
|
2. [Requirements](#requirements)
|
|
17
27
|
3. [Authentication](#authentication)
|
|
18
|
-
4. [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
4. [GIGDB](#gigdb)
|
|
29
|
+
- [Integration flow](#integration-flow)
|
|
30
|
+
- [Get quote](#gigdb--get-quote)
|
|
31
|
+
- [Start application](#gigdb--start-application)
|
|
32
|
+
- [Get existing quote](#gigdb--get-existing-quote)
|
|
33
|
+
- [Update quote](#gigdb--update-quote)
|
|
34
|
+
5. [ADB](#adb)
|
|
35
|
+
- [Integration flow](#integration-flow-1)
|
|
36
|
+
- [Rider lookup](#adb--rider-lookup)
|
|
37
|
+
- [Occupation lookup (CA)](#adb--occupation-lookup-ca-only)
|
|
38
|
+
- [Get quote](#adb--get-quote)
|
|
39
|
+
- [Start application](#adb--start-application)
|
|
40
|
+
- [Get existing quote](#adb--get-existing-quote)
|
|
41
|
+
- [Update quote](#adb--update-quote)
|
|
42
|
+
6. [IB Term](#ib-term)
|
|
43
|
+
- [Integration flow](#integration-flow-2)
|
|
44
|
+
- [Rider lookup](#ib-term--rider-lookup)
|
|
45
|
+
- [Get quote](#ib-term--get-quote)
|
|
46
|
+
- [Start application](#ib-term--start-application)
|
|
47
|
+
- [Get existing quote](#ib-term--get-existing-quote)
|
|
48
|
+
7. [Shared methods — GIGDB & ADB](#shared-methods--gigdb--adb)
|
|
49
|
+
- [Save EFT payment](#save-eft-payment)
|
|
50
|
+
- [Prepare docs & get delivery channels](#prepare-docs--get-delivery-channels)
|
|
51
|
+
- [Send PIN & get documents link](#send-pin--get-documents-link)
|
|
52
|
+
- [Resend PIN](#resend-pin)
|
|
53
|
+
- [Verify PIN](#verify-pin)
|
|
54
|
+
- [Final submit](#final-submit)
|
|
55
|
+
8. [Reporting](#reporting)
|
|
56
|
+
- [Request fields](#request-fields-shared-shape)
|
|
57
|
+
- [Filters (`SQLOperator`)](#filters--sqloperator-enum)
|
|
58
|
+
- [Response shapes](#response-shapes)
|
|
59
|
+
9. [Enums & Constants](#enums--constants)
|
|
60
|
+
10. [Beneficiary Reference](#beneficiary-reference)
|
|
61
|
+
- [No extra fields](#variant-1--no-extra-fields)
|
|
62
|
+
- [Named person](#variant-2--named-person)
|
|
63
|
+
- [Named entity](#variant-3--named-entity)
|
|
64
|
+
11. [Error Handling](#error-handling)
|
|
65
|
+
- [Error class hierarchy](#error-class-hierarchy)
|
|
66
|
+
- [Using `APIValidationError`](#using-apivalidationerror)
|
|
67
|
+
- [`BaseResponse<T>` envelope](#baseresponset-envelope)
|
|
68
|
+
- [Field-level error messages](#field-level-error-messages)
|
|
69
|
+
12. [Error codes (`APIErrorCode`)](#apierrorcode-reference)
|
|
70
|
+
- [Quote errors](#quote-errors)
|
|
71
|
+
- [Start application errors](#start-application-errors)
|
|
72
|
+
- [Payment & quote update errors](#payment--quote-update-errors)
|
|
73
|
+
- [Secure Sign errors](#secure-sign-errors)
|
|
74
|
+
- [Final submit errors](#final-submit-errors)
|
|
75
|
+
- [Session](#session)
|
|
76
|
+
- [Deprecated codes (reference only)](#deprecated-codes-reference-only)
|
|
77
|
+
13. [Environment Configuration](#environment-configuration)
|
|
78
|
+
14. [Token Management](#token-management)
|
|
79
|
+
15. [Examples Directory](#examples-directory)
|
|
80
|
+
16. [Support](#support)
|
|
37
81
|
|
|
38
82
|
---
|
|
39
83
|
|
|
@@ -50,83 +94,143 @@ npm install @instabrain-sdks/api-client
|
|
|
50
94
|
## Requirements
|
|
51
95
|
|
|
52
96
|
- Node.js >= 14.0.0
|
|
53
|
-
- TypeScript >= 4.0 *(optional
|
|
97
|
+
- TypeScript >= 4.0 *(optional — the SDK ships with full type definitions)*
|
|
98
|
+
|
|
99
|
+
In request field tables, **Type** matches the SDK TypeScript definitions. **Required** values:
|
|
100
|
+
|
|
101
|
+
| Value | Meaning |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `Yes` | Must be sent with a non-null value |
|
|
104
|
+
| `No` | Optional; may be omitted |
|
|
105
|
+
| `Yes*` | Send one of the fields marked `Yes*` in that table |
|
|
106
|
+
| `Yes**` | Send either `dayCount` or both `startDate` and `endDate` (see table footnote) |
|
|
107
|
+
| `One of †` | Send exactly one rating group (see † footnote on that table) |
|
|
108
|
+
| `Conditional` | Required only when the condition in the description or notes applies |
|
|
54
109
|
|
|
55
110
|
---
|
|
56
111
|
|
|
57
112
|
## Authentication
|
|
58
113
|
|
|
59
|
-
|
|
60
|
-
|
|
114
|
+
**Method:** `client.authenticate(userId, accessToken)`
|
|
61
115
|
|
|
62
|
-
| Credential | Type | Description |
|
|
63
|
-
| ------------- | --------------- | ------------------------ |
|
|
64
|
-
| `userId` | `number` | Your account user ID |
|
|
65
|
-
| `accessToken` | `string` (UUID) | Your secret access token |
|
|
66
116
|
|
|
117
|
+
**Token validity:** 30 minutes. Design your system to refresh before expiry.
|
|
67
118
|
|
|
68
119
|
```typescript
|
|
69
120
|
import { InstaBrainClient } from '@instabrain-sdks/api-client';
|
|
70
121
|
|
|
71
|
-
const client = InstaBrainClient.forEnvironment('sandbox');
|
|
72
|
-
|
|
73
|
-
// JWT is stored internally
|
|
74
|
-
// No need to manually set it after authenticate()
|
|
122
|
+
const client = InstaBrainClient.forEnvironment('sandbox'); // or 'production'
|
|
123
|
+
await client.authenticate(userId, accessToken);
|
|
124
|
+
// JWT is stored internally — all subsequent calls include it automatically
|
|
75
125
|
```
|
|
76
126
|
|
|
77
|
-
|
|
127
|
+
| Parameter | Type | Description |
|
|
128
|
+
|---------------|----------|--------------------------|
|
|
129
|
+
| `userId` | `number` | Account user ID |
|
|
130
|
+
| `accessToken` | `string` | UUID secret access token |
|
|
131
|
+
|
|
132
|
+
| Environment | Code |
|
|
133
|
+
|-------------|----------|
|
|
134
|
+
| Sandbox | sandbox |
|
|
135
|
+
| Production | production |
|
|
78
136
|
|
|
79
137
|
---
|
|
80
138
|
|
|
81
|
-
##
|
|
139
|
+
## GIGDB
|
|
140
|
+
|
|
141
|
+
**Guaranteed Issue Guaranteed Death Benefit** — whole life product, no medical exam.
|
|
82
142
|
|
|
143
|
+
- **Eligible ages:** 50–85
|
|
144
|
+
- **Face amount:** $5,000–$25,000
|
|
145
|
+
- **Not available in:** NY, MT
|
|
146
|
+
- **Requires:** `isSmoker` on both quote and application; `birthJurisdiction` on application
|
|
83
147
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
| Face amount | $5,000–$25,000 | $50,000-$300,000 | $50,000–$1,000,000 (age-scaled) |
|
|
88
|
-
| Medical exam | No | No | No (build chart used) |
|
|
89
|
-
| Smoker/tobacco field | `isSmoker` (required) | N/A | `flagTobaccoUse` (required) |
|
|
90
|
-
| Birth jurisdiction | Yes (`birthJurisdiction`) | No | No |
|
|
91
|
-
| App response type | `ThirdPartyStartAppResp` | `ThirdPartyAdbStartAppResp` | `ThirdPartyStartAppResp` |
|
|
92
|
-
| `isDeclined` | Yes | Yes | No |
|
|
93
|
-
| `isQuoteChanged` | Yes | No | No |
|
|
94
|
-
| Response links | None | None | `agentLink`, `eAppAgentLink`, `applicantLink` |
|
|
95
|
-
| EFT method | `saveEftPayment()` | `saveEftPayment()` | N/A |
|
|
96
|
-
| Unavailable states | NY, MT | MA, NH, AK *(CA: next release)* | WY, NY |
|
|
97
|
-
| Status | **Primary** | **Primary** | Secondary *(not fully live yet)* |
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Integration flow
|
|
98
151
|
|
|
152
|
+
```
|
|
153
|
+
1. [`getGigdbQuote()`](#gigdb--get-quote) Get quote → quoteResponseId
|
|
154
|
+
2. [`startGigdbApplication()`](#gigdb--start-application) Start app → opportunityId
|
|
155
|
+
├── isDeclined = true → STOP (valid knockout, not an error)
|
|
156
|
+
└── isQuoteChanged = true → call `getExistingGigdbQuote()` to fetch updated premium
|
|
157
|
+
3. [`getExistingGigdbQuote()`](#gigdb--get-existing-quote) [When isQuoteChanged=true, or resuming a prior session]
|
|
158
|
+
4. [`updateGigdbQuote()`](#gigdb--update-quote) [Optional] Change face amount / payment freq (before EFT only)
|
|
159
|
+
5. [`saveEftPayment()`](#save-eft-payment) Save bank details — locks the quote
|
|
160
|
+
6. [`prepareDocsAndGetDeliveryChannels()`](#prepare-docs--get-delivery-channels)
|
|
161
|
+
└── isSignCompleted = true → skip to step 9
|
|
162
|
+
7. [`sendPinAndGetDocumentsLink()`](#send-pin--get-documents-link)
|
|
163
|
+
8. [`verifyPin()`](#verify-pin)
|
|
164
|
+
9. [`finalSubmit()`](#final-submit) → policyNumber
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
> Steps 5–9 are documented under [Shared methods — GIGDB & ADB](#shared-methods--gigdb--adb).
|
|
99
168
|
|
|
100
169
|
---
|
|
101
170
|
|
|
102
|
-
## GIGDB
|
|
171
|
+
## GIGDB — Get Quote
|
|
103
172
|
|
|
104
|
-
|
|
173
|
+
**Method:** `client.getGigdbQuote(request)` · **Type:** `ThirdPartyGigdbQuoteRequest`
|
|
105
174
|
|
|
106
|
-
GIGDB (Guaranteed Issue Guaranteed Death Benefit) is a simplified-issue whole life product for ages 50–85 with no medical exam.
|
|
107
175
|
|
|
108
|
-
|
|
176
|
+
***
|
|
177
|
+
|
|
178
|
+
### Request Fields
|
|
179
|
+
|
|
180
|
+
| Field | Type | Required | Description | Validation Error |
|
|
181
|
+
|---|---|---|---|---|
|
|
182
|
+
| `faceAmount` | `number` | Yes | Coverage amount in dollars ($5,000–$25,000) | `Coverage amount (FaceAmount) is required.` |
|
|
183
|
+
| `gender` | `Gender` | Yes | `Gender.Male`, `Gender.Female` | `Gender is required.` / `Invalid gender.` |
|
|
184
|
+
| `stateCode` | `string` | Yes | 2-letter US state code | `State code is required.` / `State code is not valid.` / `This product is not available for the selected state.` |
|
|
185
|
+
| `age` | `number` | Yes* | Applicant age — must be 50–85 | `Either age or date of birth must be provided.` / `Age must be between 50 and 85 for GIGDB.` |
|
|
186
|
+
| `dateOfBirth` | `string` (ISO 8601) | Yes* | Date of birth — derived age must be 50–85 | `Date of birth must be a valid date.` |
|
|
187
|
+
| `paymentFreq` | `PaymentFrequency` | Yes | `"Monthly"` or `"Annually"` | `Payment frequency is required.` / `Invalid payment frequency.` |
|
|
188
|
+
| `isSmoker` | `boolean` | Yes | Smoker status — affects premium | `Smoker status is required.` |
|
|
189
|
+
| `firstName` | `string` | No | Alphabetic only — lead capture | `First name is invalid. Only alphabetic characters are allowed.` |
|
|
190
|
+
| `lastName` | `string` | No | Alphabetic only — lead capture | `Last name is invalid. Only alphabetic characters are allowed.` |
|
|
191
|
+
| `email` | `string` | No | Lead capture | `Please enter a valid email address.` |
|
|
192
|
+
| `phoneNum` | `string` | No | 10 digits or E.164 — lead capture | `Phone number format is incorrect. Use 10 digits or +1XXXXXXXXXX.` / `Phone number is invalid.` |
|
|
193
|
+
|
|
194
|
+
> *Provide `age` OR `dateOfBirth`. When both are sent, `dateOfBirth` takes priority.
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
***
|
|
198
|
+
|
|
199
|
+
### Business Rules
|
|
200
|
+
|
|
201
|
+
1. `isSmoker` is required and affects premium calculation.
|
|
202
|
+
2. Age is validated against 50–85 range after derivation from `dateOfBirth`.
|
|
203
|
+
3. GIGDB is not available in NY and MT.
|
|
109
204
|
|
|
110
|
-
```
|
|
111
|
-
getGigdbQuote()
|
|
112
|
-
↓
|
|
113
|
-
startGigdbApplication()
|
|
114
|
-
↓
|
|
115
|
-
[if isDeclined = true] → stop - applicant not eligible
|
|
116
|
-
[if isQuoteChanged = true] → getExistingGigdbQuote() (conditional)
|
|
117
|
-
↓
|
|
118
|
-
updateGigdbQuote() ← optional; MUST be called before saveEftPayment
|
|
119
|
-
↓
|
|
120
|
-
saveEftPayment() ← quote cannot be updated after this point
|
|
121
|
-
↓
|
|
122
|
-
prepareDocsAndGetDeliveryChannels()
|
|
123
|
-
↓
|
|
124
|
-
sendPinAndGetDocumentsLink() → verifyPin()
|
|
125
|
-
↓
|
|
126
|
-
finalSubmit()
|
|
127
|
-
```
|
|
128
205
|
|
|
129
|
-
|
|
206
|
+
***
|
|
207
|
+
|
|
208
|
+
### Error Codes
|
|
209
|
+
|
|
210
|
+
| Code | When |
|
|
211
|
+
|---|---|
|
|
212
|
+
| `InvalidRequestFormat` | Any field validation failure — inspect `value.fields` for details |
|
|
213
|
+
| `StateNotFound` | State code not recognized |
|
|
214
|
+
| `AgeNotFound` | Neither age nor date of birth supplied, or age could not be derived |
|
|
215
|
+
| `NotAvailableForState` | GIGDB not available in the requested state |
|
|
216
|
+
| `QuoteNotEligibleForGivenConditions` | State / age / smoker combination not eligible |
|
|
217
|
+
| `CoverageNotAvailable` | Face amount outside allowed range for state / age / smoker |
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
***
|
|
221
|
+
|
|
222
|
+
### Response
|
|
223
|
+
|
|
224
|
+
| Field | Type | Description |
|
|
225
|
+
|---|---|---|
|
|
226
|
+
| `productName` | `string` | `"InstaGIGDB"` |
|
|
227
|
+
| `selectedQuote.quoteResponseId` | `string` | Pass as `quoteResponseId` in Start Application |
|
|
228
|
+
| `selectedQuote.quoteAmount` | `number` | Premium at requested payment frequency |
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
***
|
|
232
|
+
|
|
233
|
+
### Example
|
|
130
234
|
|
|
131
235
|
```typescript
|
|
132
236
|
import { InstaBrainClient, Gender, PaymentFrequency } from '@instabrain-sdks/api-client';
|
|
@@ -136,251 +240,585 @@ const quoteResp = await client.getGigdbQuote({
|
|
|
136
240
|
gender: Gender.Female,
|
|
137
241
|
stateCode: 'TX',
|
|
138
242
|
age: 65,
|
|
139
|
-
dateOfBirth: null,
|
|
140
243
|
paymentFreq: PaymentFrequency.Monthly,
|
|
141
|
-
isSmoker: false
|
|
142
|
-
firstName: 'Jane',
|
|
143
|
-
lastName: 'Doe',
|
|
144
|
-
email: 'jane.doe@example.com',
|
|
145
|
-
phoneNum: null
|
|
244
|
+
isSmoker: false
|
|
146
245
|
});
|
|
147
246
|
|
|
148
247
|
const { quoteResponseId, quoteAmount } = quoteResp.selectedQuote;
|
|
149
248
|
```
|
|
150
249
|
|
|
151
|
-
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## GIGDB — Start Application
|
|
253
|
+
|
|
254
|
+
**Method:** `client.startGigdbApplication(request)` · **Type:** `ThirdPartyGigdbAppReq`
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
***
|
|
258
|
+
|
|
259
|
+
### Top-Level Request Fields
|
|
260
|
+
|
|
261
|
+
| Field | Type | Required | Applicant-Facing Question | Validation Error |
|
|
262
|
+
|---|---|---|---|---|
|
|
263
|
+
| `quoteResponseId` | `string` | Yes | — | `QuoteResponseId is required.` / `QuoteResponseId does not exist or does not belong to the requested product.` |
|
|
264
|
+
| `firstName` | `string` | Yes | *First Name* | `First name is required.` / `First name is invalid. Only alphabetic characters are allowed.` |
|
|
265
|
+
| `lastName` | `string` | Yes | *Last Name* | `Last name is required.` / `Last name is invalid. Only alphabetic characters are allowed.` |
|
|
266
|
+
| `email` | `string` | Yes | *Email Address* | `Email is required.` / `Please enter a valid email address.` |
|
|
267
|
+
| `phoneNumber` | `string` | Yes | *Preferred Phone Number* | `Phone number is required.` / `Phone number format is incorrect. Use 10 digits or +1XXXXXXXXXX.` |
|
|
268
|
+
| `dateOfBirth` | `string` (ISO 8601) | Yes | *Date of Birth* | `Date of birth is required.` / `Date of birth must be a valid date in the past.` / `Age must be between 50 and 85 for GIGDB.` |
|
|
269
|
+
| `isUsCitizen` | `boolean` | Yes | *Are you a United States citizen?* | `US citizenship status is required.` |
|
|
270
|
+
| `isLegalUsResident` | `boolean` | Conditional | *Are you a legal U.S. resident and have you resided in the U.S. for more than 2 years?* | `Legal US residency status is required for non-US citizens.` |
|
|
271
|
+
| `isPayerAlsoOwnerAndInsured` | `boolean` | Yes | *This product requires that the payer, the person purchasing the policy, and the owner are the same person. Please confirm that you are both the insured individual and will also be the owner of the policy.* | `IsPayerAlsoOwnerAndInsured field is required.` |
|
|
272
|
+
| `socialSecurityNumber` | `string` | Yes | *Social Security Number* | `Social Security Number is required.` / `Social Security Number must be in valid format (e.g., XXX-XX-XXXX).` |
|
|
273
|
+
| `isSmoker` | `boolean` | Yes | *Within the past 2 years have you used tobacco or any other product that contains nicotine?* | `Smoker status is required.` |
|
|
274
|
+
| `hasExistingCoverage` | `boolean` | Yes | See state-specific wording below | `Existing coverage field is required` |
|
|
275
|
+
| `willOtherCoverageBeReplacedOrFinanced` | `boolean\|null` | Conditional | See state-specific wording below | `Please indicate whether any other coverage will be replaced or financed.` / `Other Coverage be replaced or financed must be either null or false as no existing coverage passed.` |
|
|
276
|
+
|
|
277
|
+
> `isLegalUsResident` required when `isUsCitizen = false`.
|
|
278
|
+
> `willOtherCoverageBeReplacedOrFinanced` required when `hasExistingCoverage = true`; must be `null` or `false` when `hasExistingCoverage = false`.
|
|
279
|
+
> `socialSecurityNumber` must be **9 consecutive digits, no dashes** (e.g. `123456789`). The `XXX-XX-XXXX` text in validation messages shows digit positions only.
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
***
|
|
283
|
+
|
|
284
|
+
### `hasExistingCoverage` — State-Specific Question Text
|
|
285
|
+
|
|
286
|
+
| States | Exact Question |
|
|
287
|
+
|---|---|
|
|
288
|
+
| AR, CO, DE, DC, IA, KY, NJ, OK, PA, VA | *Do you have any existing life or health coverage in force or is any application for life or health coverage, or reinstatement, now pending?* |
|
|
289
|
+
| AZ, ID, IN, MI, MS, NV | *Do you have any existing life or health coverage in force or is any application for life or annuity coverage, or reinstatement, now pending?* |
|
|
290
|
+
| All others | *Do you have any existing life insurance or annuity contracts in force or is any application for life insurance, or reinstatement now pending with any insurance company?* |
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
***
|
|
294
|
+
|
|
295
|
+
### `willOtherCoverageBeReplacedOrFinanced` — State-Specific Question Text
|
|
296
|
+
|
|
297
|
+
| States | Exact Question |
|
|
298
|
+
|---|---|
|
|
299
|
+
| AR, CO, DE, DC, IA, KY, NJ, OK, PA, VA | *If this policy is issued, will any other existing life or health coverage be cancelled, terminated, lapsed or not renewed?* |
|
|
300
|
+
| AZ, ID, IN, MI, MS, NV | *If this policy is issued, will any other existing life or annuity coverage be cancelled, terminated, lapsed or not renewed?* |
|
|
301
|
+
| All others | *If this policy is issued, will any other existing life insurance or annuity contract be cancelled, lapsed or not renewed, or are you considering using funds from your existing policies or contracts to pay premiums on the new policy or contract?* |
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
***
|
|
305
|
+
|
|
306
|
+
### Address
|
|
307
|
+
|
|
308
|
+
| Field | Type | Required | Question | Validation Error |
|
|
309
|
+
|---|---|---|---|---|
|
|
310
|
+
| `address.addressLine1` | `string` | Yes | *Street* | `Address line is required.` / `Street address is invalid. Avoid special characters.` |
|
|
311
|
+
| `address.city` | `string` | Yes | *City* | `Address city is required.` / `City name is invalid. Only letters and spaces are allowed.` |
|
|
312
|
+
| `address.state` | `string` | Yes | *State* | `Residence state is required.` / `Residence state code is invalid.` |
|
|
313
|
+
| `address.zipcode` | `string` | Yes | *Zip Code* | `Zip code is required.` / `Zip code is invalid. It must be in 5-digit format.` / `Zip code is not found.` |
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
***
|
|
317
|
+
|
|
318
|
+
### Birth Jurisdiction
|
|
319
|
+
|
|
320
|
+
| Field | Type | Required | Question | Validation Error |
|
|
321
|
+
|---|---|---|---|---|
|
|
322
|
+
| `birthJurisdiction.country` | `string` | Yes | *Birth Country* | `Birth jurisdiction details are required.` / `Birth country is required when applicant is not a U.S. citizen.` / `Birth country code is invalid.` |
|
|
323
|
+
| `birthJurisdiction.state` | `string` | Conditional | *State (Birth Jurisdiction)* | `Birth state is required when applicant is a U.S. citizen.` / `Birth state code is invalid.` |
|
|
324
|
+
|
|
325
|
+
> `birthJurisdiction.state` required when `birthJurisdiction.country = "US"`.
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
***
|
|
329
|
+
|
|
330
|
+
### Nicotine Info (required when `isSmoker = true`)
|
|
331
|
+
|
|
332
|
+
| Field | Type | Required | Question | Validation Error |
|
|
333
|
+
|---|---|---|---|---|
|
|
334
|
+
| `nicotineInfo.lastUseDate` | `string` (`YYYY-MM`) | Yes (when smoker) | *When was the last time you used tobacco or any other product that contains nicotine?* | `Nicotine details are required when applicant is a smoker.` / `Last nicotine use date is required when applicant is a smoker.` / `Nicotine last use date must be in YYYY-MM format.` |
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
***
|
|
338
|
+
|
|
339
|
+
### Existing Coverage (when `hasExistingCoverage = true`)
|
|
340
|
+
|
|
341
|
+
| Field | Type | Required | Question | Validation Error |
|
|
342
|
+
|---|---|---|---|---|
|
|
343
|
+
| `existingCoverageData.isExistingPolicyBeingTerminated` | `boolean` | No | *Are you considering discontinuing making premium payments, surrendering, forfeiting, assigning to the insurer, or otherwise terminating your existing policy or contract?* | `Please indicate whether any existing policy is being terminated.` |
|
|
344
|
+
| `existingCoverageData.existingCoverages[n].nameOfTheCompany` | `string` | Yes | *Name of Company (Enter unknown if company name is not available)* | `Please provide the name of the insurance company.` |
|
|
345
|
+
| `existingCoverageData.existingCoverages[n].insuranceAmount` | `string` | Yes | *Insurance Amount* | `Insurance amount must be provided.` |
|
|
346
|
+
| `existingCoverageData.existingCoverages[n].dateOfIssue` | `string` (`YYYY-MM`) | Yes | *Date of Issue* | `Please provide Date of Issue in YYYY-MM format` / `Date of issue must be in YYYY-MM format.` |
|
|
347
|
+
| `existingCoverageData.existingCoverages[n].toBeReplaced` | `boolean` | Yes | *To Be Replaced* | `Replacement coverage answer must be specified.` |
|
|
348
|
+
| `existingCoverageData.existingCoverages[n].toBeFinanced` | `boolean` | Yes | *Are you considering using funds from your existing policies or contracts to pay premiums due on the new policy or contract?* | `Financing coverage answer must be specified.` |
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
***
|
|
352
|
+
|
|
353
|
+
### State-Specific Existing Coverage Fields
|
|
354
|
+
|
|
355
|
+
| State(s) | Field on `existingCoverages[n]` | Exact Question | Validation Error |
|
|
356
|
+
|---|---|---|---|
|
|
357
|
+
| MA | `requestsYieldIndices` | *Would you like to request yield indices for cash value policies?* | `Please indicate whether yield indices for cash value policies are requested (required for Massachusetts).` |
|
|
358
|
+
| OK | `notifyPresentInsurer` | *Please notify my present insurer(s) regarding this transaction?* | `Please indicate whether to notify present insurer(s) (required for Oklahoma).` |
|
|
359
|
+
| DE, GA | `wantsPolicySummary` | *Do you want a policy summary statement from your existing insurer?* | `Please indicate whether you want a policy summary statement (required for Delaware and Georgia).` |
|
|
360
|
+
| FL | `wantsComparativeInformationForm` | *Indicate whether or not you wish a Comparative Information Form from the proposed company and your existing insurer or insurers?* | `Please indicate whether you want a Comparative Information Form (required for Florida).` |
|
|
361
|
+
|
|
362
|
+
| State(s) | Field on `existingCoverageData` | Exact Question | Validation Error |
|
|
363
|
+
|---|---|---|---|
|
|
364
|
+
| RI, WV | `areExistingPoliciesIssuedByFidelity` | *Are any of your existing policies issued by Fidelity Life Association?* | `Please indicate whether any existing policies are issued by Fidelity Life Association (required for RI and WV).` |
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
***
|
|
368
|
+
|
|
369
|
+
### Replacement / Financing Data (when `willOtherCoverageBeReplacedOrFinanced = true`)
|
|
370
|
+
|
|
371
|
+
For **KS**, populate `willOtherCoverageBeReplacedOrFinancedData.areReplacedPoliciesIssuedByFidelity`:
|
|
372
|
+
|
|
373
|
+
| Field | Exact Question | Validation Error |
|
|
374
|
+
|---|---|---|
|
|
375
|
+
| `areReplacedPoliciesIssuedByFidelity` | *Are any of the policies you are considering replacing issued by Fidelity Life Association?* | `Please indicate whether any policies being replaced are issued by Fidelity Life Association (required for Kansas when replacing or financing coverage).` |
|
|
376
|
+
|
|
377
|
+
For **WA**, populate `willOtherCoverageBeReplacedOrFinancedData.otherInsuranceReplacementData`. All 7 booleans are required. For each boolean set to `true`, the paired `specify*` string is required.
|
|
378
|
+
|
|
379
|
+
| Field | Exact Question |
|
|
380
|
+
|---|---|
|
|
381
|
+
| `mayReduceBenefitsIncreasePremiums` | *Can there be reduced benefits or increased premiums in later years?* |
|
|
382
|
+
| `specifyReduceBenefitsIncreasePremiums` | *Please explain* |
|
|
383
|
+
| `hasNewPolicyCharges` | *Are there penalties, set up or surrender charges for the new policy?* |
|
|
384
|
+
| `specifyNewPolicyCharges` | *Please explain, emphasizing any extra cost for early withdrawal.* |
|
|
385
|
+
| `hasPriorPolicyCharges` | *Will there be penalties or surrender charges under the existing insurance as a result of the proposed transaction?* |
|
|
386
|
+
| `specifyPriorPolicyCharges` | *Please explain* |
|
|
387
|
+
| `hasTaxConsequences` | *Are there adverse tax consequences from the replacement under current tax law?* |
|
|
388
|
+
| `specifyTaxConsequences` | *Please explain* |
|
|
389
|
+
| `hasInterestConsiderations` | *Are interest earnings a consideration in this replacement?* |
|
|
390
|
+
| `specifyInterestConsiderations` | *Please explain what portions of premiums or contributions will produce limited or no earnings. As pertinent, include the need for minimum deposits to enhance earnings, and the reduction of earnings that may result from set up charges, policy fees, and other factors.* |
|
|
391
|
+
| `hasMinRequirementsBeforeInterest` | *Are minimum amounts required to be on deposit before excess interest will be paid?* |
|
|
392
|
+
| `specifyMinRequirementsBeforeInterest` | *Please explain* |
|
|
393
|
+
| `hasOtherAdverseEffects` | *Are there other short or long term effects from the replacement that might be materially adverse?* |
|
|
394
|
+
| `specifyOtherAdverseEffects` | *Please explain* |
|
|
395
|
+
|
|
396
|
+
WA Validation Errors:
|
|
397
|
+
|
|
398
|
+
| Field | Error |
|
|
399
|
+
|---|---|
|
|
400
|
+
| `WillOtherCoverageBeReplacedOrFinancedData` | `State-specific replacement data is required when other coverage will be replaced or financed.` |
|
|
401
|
+
| `WillOtherCoverageBeReplacedOrFinancedData.OtherInsuranceReplacementData` | `Washington replacement disclosure answers are required when replacing or financing coverage.` |
|
|
402
|
+
| `WillOtherCoverageBeReplacedOrFinancedData.OtherInsuranceReplacementData[n]` | `Each Washington replacement disclosure question must be answered.` |
|
|
403
|
+
| `WillOtherCoverageBeReplacedOrFinancedData.OtherInsuranceReplacementData[n].Explain` | `Please explain is required when the answer is Yes.` |
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
***
|
|
407
|
+
|
|
408
|
+
### Beneficiary Details
|
|
409
|
+
|
|
410
|
+
See [Beneficiary Reference](#beneficiary-reference). GIGDB accepts all `BeneficiaryType` values.
|
|
411
|
+
|
|
412
|
+
| Field | Type | Required | Validation Error |
|
|
413
|
+
|---|---|---|---|
|
|
414
|
+
| `beneficiaryDetails.beneficiaryType` | `string` | Yes | `Beneficiary details are required.` / `Please select a valid beneficiary option.` |
|
|
415
|
+
| `beneficiaryDetails.beneficiaryPerson.firstName` | `string` | Yes (Person) | `Beneficiary first name is required.` / `Beneficiary's first name is invalid.` |
|
|
416
|
+
| `beneficiaryDetails.beneficiaryPerson.lastName` | `string` | Yes (Person) | `Beneficiary last name is required.` / `Beneficiary's last name is invalid.` |
|
|
417
|
+
| `beneficiaryDetails.beneficiaryPerson.relationship` | `string` | Yes (Person) | `Please specify the relationship with the beneficiary.` |
|
|
418
|
+
| `beneficiaryDetails.namedEntity.name` | `string` | Yes (entity types) | `Named entity details must be provided for this beneficiary type.` / `Beneficiary name is required.` |
|
|
419
|
+
| `beneficiaryDetails.namedEntity.trustDate` | `string` (`YYYY-MM`) | Yes (Trust) | `Trust date must be in YYYY-MM format.` |
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
***
|
|
423
|
+
|
|
424
|
+
### Business Rules
|
|
425
|
+
|
|
426
|
+
1. Quote state and `address.state` must match — mismatch returns `StateMismatchIdentified`.
|
|
427
|
+
2. `isSmoker = true` requires `nicotineInfo.lastUseDate` in `YYYY-MM` format.
|
|
428
|
+
3. `hasExistingCoverage = false` requires `existingCoverageData = null` and `willOtherCoverageBeReplacedOrFinanced` null or false.
|
|
429
|
+
4. State-specific existing coverage fields are only enforced when `hasExistingCoverage = true` or `willOtherCoverageBeReplacedOrFinanced = true`.
|
|
430
|
+
5. `ApplicationLimitReached` fires (as a top-level error code, not `InvalidRequestFormat`) when the same SSN, email, or phone already has a GIGDB policy generated within the last 30 days.
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
***
|
|
434
|
+
|
|
435
|
+
### Knockout Rules
|
|
436
|
+
|
|
437
|
+
Returns `isDeclined: true` on a successful response — the SDK does **not** throw. Check the field explicitly; do not treat it as an exception.
|
|
438
|
+
|
|
439
|
+
- `isPayerAlsoOwnerAndInsured = false`
|
|
440
|
+
- `isUsCitizen = false` AND `isLegalUsResident = false`
|
|
441
|
+
|
|
442
|
+
> When declined, `opportunityId` may be the all-zero UUID (`00000000-0000-0000-0000-000000000000`).
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
***
|
|
446
|
+
|
|
447
|
+
### `isQuoteChanged`
|
|
448
|
+
|
|
449
|
+
When `isQuoteChanged = true`, the carrier adjusted the premium based on application data. Call [`getExistingGigdbQuote()`](#gigdb--get-existing-quote) with the returned `opportunityId` to retrieve the revised quote, then re-present it to the applicant before proceeding to EFT.
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
***
|
|
453
|
+
|
|
454
|
+
### Error Codes
|
|
455
|
+
|
|
456
|
+
| Code | When |
|
|
457
|
+
|---|---|
|
|
458
|
+
| `InvalidRequestFormat` | Any field validation failure — inspect `value.fields` |
|
|
459
|
+
| `ApplicationLimitReached` | SSN, email, or phone matches a GIGDB policy generated within the last 30 days |
|
|
460
|
+
| `StateMismatchIdentified` | Quote state ≠ `address.state` |
|
|
461
|
+
| `AgentNotFound` | Quote cannot be linked to the agent account — verify credentials |
|
|
462
|
+
| `InternalServerError` | Unexpected backend failure — retry; contact support if persistent |
|
|
463
|
+
|
|
464
|
+
**`ApplicationLimitReached` field-level messages:**
|
|
465
|
+
|
|
466
|
+
| Field | Message |
|
|
467
|
+
|---|---|
|
|
468
|
+
| `SocialSecurityNumber` | `An application with the same SSN has a policy generated within the last 30 days.` |
|
|
469
|
+
| `Email` | `An application with the same email has a policy generated within the last 30 days.` |
|
|
470
|
+
| `PhoneNumber` | `Two applications with the same phone have policies generated within the last 30 days.` |
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
***
|
|
474
|
+
|
|
475
|
+
### Response
|
|
476
|
+
|
|
477
|
+
| Field | Type | Description |
|
|
478
|
+
|---|---|---|
|
|
479
|
+
| `opportunityId` | `string` | Pass to later `client.*` calls (EFT, SecureSign, `finalSubmit`, etc.) |
|
|
480
|
+
| `isDeclined` | `boolean` | `true` = knockout; stop the flow |
|
|
481
|
+
| `isQuoteChanged` | `boolean` | `true` = carrier adjusted premium; call `getExistingGigdbQuote()` before EFT |
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
***
|
|
485
|
+
|
|
486
|
+
### Example
|
|
152
487
|
|
|
153
488
|
```typescript
|
|
154
489
|
import { BeneficiaryType, BeneficiaryRelationship } from '@instabrain-sdks/api-client';
|
|
155
490
|
|
|
156
491
|
const appResp = await client.startGigdbApplication({
|
|
157
|
-
quoteResponseId
|
|
158
|
-
firstName: 'Jane',
|
|
159
|
-
|
|
160
|
-
email: 'jane.doe@example.com',
|
|
161
|
-
phoneNumber: '5551234567',
|
|
162
|
-
isUsCitizen: true,
|
|
163
|
-
isPayerAlsoOwnerAndInsured: true,
|
|
164
|
-
isLegalUsResident: true,
|
|
165
|
-
address: {
|
|
166
|
-
addressLine1: '123 Main St',
|
|
167
|
-
city: 'Austin',
|
|
168
|
-
state: 'TX',
|
|
169
|
-
zipcode: '73301'
|
|
170
|
-
},
|
|
492
|
+
quoteResponseId,
|
|
493
|
+
firstName: 'Jane', lastName: 'Doe',
|
|
494
|
+
email: 'jane.doe@example.com', phoneNumber: '5551234567',
|
|
171
495
|
dateOfBirth: '1958-06-15',
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
nicotineInfo: null,
|
|
179
|
-
hasExistingCoverage: false,
|
|
180
|
-
willOtherCoverageBeReplacedOrFinanced: null,
|
|
181
|
-
existingCoverageData: null,
|
|
496
|
+
isUsCitizen: true, isPayerAlsoOwnerAndInsured: true,
|
|
497
|
+
socialSecurityNumber: '123456789',
|
|
498
|
+
isSmoker: false, nicotineInfo: null,
|
|
499
|
+
hasExistingCoverage: false, willOtherCoverageBeReplacedOrFinanced: null, existingCoverageData: null,
|
|
500
|
+
address: { addressLine1: '123 Main St', city: 'Austin', state: 'TX', zipcode: '73301' },
|
|
501
|
+
birthJurisdiction: { country: 'US', state: 'TX' },
|
|
182
502
|
beneficiaryDetails: {
|
|
183
503
|
beneficiaryType: BeneficiaryType.Person,
|
|
184
|
-
beneficiaryPerson: {
|
|
185
|
-
firstName: 'John',
|
|
186
|
-
lastName: 'Doe',
|
|
187
|
-
relationship: BeneficiaryRelationship.Spouse
|
|
188
|
-
}
|
|
504
|
+
beneficiaryPerson: { firstName: 'John', lastName: 'Doe', relationship: BeneficiaryRelationship.Spouse }
|
|
189
505
|
}
|
|
190
506
|
});
|
|
191
507
|
|
|
192
508
|
if (appResp.isDeclined) {
|
|
193
|
-
// Valid knockout
|
|
194
|
-
// This is NOT an error - do not throw.
|
|
195
|
-
console.log('Application declined');
|
|
509
|
+
// Valid knockout — stop the flow, do not proceed
|
|
196
510
|
return;
|
|
197
511
|
}
|
|
198
|
-
|
|
199
|
-
|
|
512
|
+
if (appResp.isQuoteChanged) {
|
|
513
|
+
// Carrier adjusted the premium — fetch updated quote before saving EFT
|
|
514
|
+
const updated = await client.getExistingGigdbQuote(appResp.opportunityId);
|
|
515
|
+
// Re-present updated.selectedQuote.quoteAmount to the applicant
|
|
516
|
+
}
|
|
517
|
+
const { opportunityId } = appResp;
|
|
200
518
|
```
|
|
201
519
|
|
|
202
|
-
|
|
520
|
+
---
|
|
203
521
|
|
|
204
|
-
|
|
522
|
+
## GIGDB — Get Existing Quote
|
|
205
523
|
|
|
206
|
-
|
|
524
|
+
**Method:** `client.getExistingGigdbQuote(opportunityId)`
|
|
207
525
|
|
|
208
|
-
> Third-party integrations must display the exact regulated question text below to applicants — paraphrasing is not sufficient. Source: Confluence page 687800321 (GIGDB Start Application API).
|
|
209
526
|
|
|
210
|
-
When
|
|
527
|
+
**When to call:**
|
|
528
|
+
- `isQuoteChanged = true` returned by Start Application — fetch the carrier-adjusted premium before proceeding.
|
|
529
|
+
- Resuming a prior session — re-fetch the quote for an existing opportunity without re-quoting.
|
|
211
530
|
|
|
212
|
-
| State | Field on `existingCoverages[]` | Type | Exact applicant-facing question text |
|
|
213
|
-
|-----------|------------------------------------|-----------|---------------------------------------|
|
|
214
|
-
| MA | `requestsYieldIndices` | `boolean` | *Would you like to request yield indices for cash value policies?* |
|
|
215
|
-
| OK | `notifyPresentInsurer` | `boolean` | *Please notify my present insurer(s) regarding this transaction?* |
|
|
216
|
-
| DE / GA | `wantsPolicySummary` | `boolean` | *Do you want a policy summary statement from your existing insurer?* |
|
|
217
|
-
| FL | `wantsComparativeInformationForm` | `boolean` | *Indicate whether or not you wish a Comparative Information Form from the proposed company and your existing insurer or insurers?* |
|
|
218
531
|
|
|
219
|
-
|
|
220
|
-
> Question text: *"Are any of your existing policies issued by Fidelity Life Association?"*
|
|
532
|
+
***
|
|
221
533
|
|
|
222
|
-
|
|
534
|
+
### Request Parameters
|
|
223
535
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
536
|
+
| Parameter | Type | Required |
|
|
537
|
+
|---|---|---|
|
|
538
|
+
| `opportunityId` | `string` | Yes |
|
|
227
539
|
|
|
228
|
-
##### WA `otherInsuranceReplacementData` — exact question text per field
|
|
229
540
|
|
|
230
|
-
|
|
541
|
+
***
|
|
542
|
+
|
|
543
|
+
### Error Codes
|
|
544
|
+
|
|
545
|
+
| Code | When |
|
|
231
546
|
|---|---|
|
|
232
|
-
| `
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
|
241
|
-
|
|
242
|
-
| `
|
|
243
|
-
| `
|
|
244
|
-
| `
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
547
|
+
| `InvalidRequestFormat` | `OpportunityId is required.` / `OpportunityId does not exist.` / `OpportunityId does not match selected product.` |
|
|
548
|
+
> Throws `AuthenticationError` when the opportunity ID is not found or not in scope for your token. Distinct from `APIValidationError` with message `"does not exist"`.
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
***
|
|
552
|
+
|
|
553
|
+
### Response
|
|
554
|
+
|
|
555
|
+
| Field | Type | Description |
|
|
556
|
+
|---|---|---|
|
|
557
|
+
| `productName` | `string` | `"InstaGIGDB"` |
|
|
558
|
+
| `selectedQuote.quoteResponseId` | `string` | Updated quote response ID |
|
|
559
|
+
| `selectedQuote.quoteAmount` | `number` | Revised premium |
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
***
|
|
563
|
+
|
|
564
|
+
### Example
|
|
248
565
|
|
|
249
566
|
```typescript
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
mayReduceBenefitsIncreasePremiums: true,
|
|
253
|
-
specifyReduceBenefitsIncreasePremiums: 'Premiums may rise after year 5',
|
|
254
|
-
hasNewPolicyCharges: true,
|
|
255
|
-
specifyNewPolicyCharges: 'Surrender charges in years 1-3',
|
|
256
|
-
hasPriorPolicyCharges: false,
|
|
257
|
-
hasTaxConsequences: false,
|
|
258
|
-
hasInterestConsiderations: true,
|
|
259
|
-
specifyInterestConsiderations: 'Lower guaranteed rate on new policy',
|
|
260
|
-
hasMinRequirementsBeforeInterest: false,
|
|
261
|
-
hasOtherAdverseEffects: false
|
|
262
|
-
}
|
|
263
|
-
}
|
|
567
|
+
const quoteResp = await client.getExistingGigdbQuote(opportunityId);
|
|
568
|
+
const { quoteResponseId, quoteAmount } = quoteResp.selectedQuote;
|
|
264
569
|
```
|
|
265
570
|
|
|
266
|
-
|
|
571
|
+
---
|
|
267
572
|
|
|
268
|
-
|
|
269
|
-
let currentQuote = quoteResp.selectedQuote;
|
|
573
|
+
## GIGDB — Update Quote
|
|
270
574
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
575
|
+
**Method:** `client.updateGigdbQuote(request)` · **Type:** `ThirdPartyGigdbUpdateQuoteReq`
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
Changes face amount or payment frequency after start application. Must be called **before** `save-eft-payment` — blocked once payment is saved.
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
***
|
|
582
|
+
|
|
583
|
+
### Request Fields
|
|
584
|
+
|
|
585
|
+
| Field | Type | Required | Validation Error |
|
|
586
|
+
|---|---|---|---|
|
|
587
|
+
| `opportunityId` | `string` | Yes | `OpportunityId is required.` / `OpportunityId does not exist.` / `Quote update is not allowed when payment is already made.` |
|
|
588
|
+
| `faceAmount` | `number` | Yes | `Coverage amount (FaceAmount) is required.` |
|
|
589
|
+
| `paymentFreq` | `PaymentFrequency` | Yes | `Payment frequency is required.` / `Invalid payment frequency.` |
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
***
|
|
277
593
|
|
|
278
|
-
###
|
|
594
|
+
### Business Rules
|
|
279
595
|
|
|
280
|
-
|
|
596
|
+
1. GIGDB does not support riders — do not send a `riders` field.
|
|
597
|
+
2. Only `faceAmount` and `paymentFreq` can be changed. Smoker status, state, and age cannot be modified.
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
***
|
|
601
|
+
|
|
602
|
+
### Error Codes
|
|
603
|
+
|
|
604
|
+
| Code | When |
|
|
605
|
+
|---|---|
|
|
606
|
+
| `InvalidRequestFormat` | Any field validation failure — inspect `value.fields` |
|
|
607
|
+
| `PaymentAlreadyMade` | EFT already saved — quote update no longer allowed |
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
***
|
|
611
|
+
|
|
612
|
+
### Response
|
|
613
|
+
|
|
614
|
+
Same shape as Get Quote — reflects the recalculated premium.
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
***
|
|
618
|
+
|
|
619
|
+
### Example
|
|
281
620
|
|
|
282
621
|
```typescript
|
|
283
|
-
|
|
622
|
+
import { PaymentFrequency } from '@instabrain-sdks/api-client';
|
|
623
|
+
|
|
624
|
+
const updatedQuote = await client.updateGigdbQuote({
|
|
284
625
|
opportunityId,
|
|
285
626
|
faceAmount: 20000,
|
|
286
627
|
paymentFreq: PaymentFrequency.Annually
|
|
287
628
|
});
|
|
288
|
-
//
|
|
629
|
+
// updatedQuote.selectedQuote.quoteAmount reflects the new premium
|
|
289
630
|
```
|
|
290
631
|
|
|
291
|
-
|
|
632
|
+
---
|
|
292
633
|
|
|
293
|
-
|
|
634
|
+
## ADB
|
|
294
635
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
636
|
+
**Accidental Death Benefit** — simplified-issue product, no medical exam.
|
|
637
|
+
|
|
638
|
+
- **Eligible ages:** 20–59
|
|
639
|
+
- **Face amount:** $50,000–$300,000
|
|
640
|
+
- **Not available in:** MA, NH, AK
|
|
641
|
+
- **CA:** Supported — `occupation` field required on application
|
|
642
|
+
- **No** `isSmoker`, `birthJurisdiction`, or `nicotineInfo` fields
|
|
643
|
+
|
|
644
|
+
---
|
|
304
645
|
|
|
305
|
-
|
|
646
|
+
## Integration flow
|
|
647
|
+
|
|
648
|
+
```
|
|
649
|
+
0. [`getAdbRiderDetails()`](#adb--rider-lookup) [Optional] Confirm availability + rider codes
|
|
650
|
+
└── flagProductNotAvailableForState = true → STOP
|
|
651
|
+
0b. [`getAdbOccupationOptions()`](#adb--occupation-lookup-ca-only) [CA only] Fetch valid occupation labels
|
|
652
|
+
1. [`getAdbQuote()`](#adb--get-quote) Get quote → quoteResponseId
|
|
653
|
+
2. [`startAdbApplication()`](#adb--start-application) Start app → opportunityId
|
|
654
|
+
└── isDeclined = true → STOP (valid knockout, not an error)
|
|
655
|
+
3. [`getExistingAdbQuote()`](#adb--get-existing-quote) [Optional] Re-fetch quote for resumed session
|
|
656
|
+
4. [`updateAdbQuote()`](#adb--update-quote) [Optional] Change face amount / payment freq / riders (before EFT only)
|
|
657
|
+
5. [`saveEftPayment()`](#save-eft-payment) Save bank details — locks the quote
|
|
658
|
+
6. [`prepareDocsAndGetDeliveryChannels()`](#prepare-docs--get-delivery-channels)
|
|
659
|
+
└── isSignCompleted = true → skip to step 9
|
|
660
|
+
7. [`sendPinAndGetDocumentsLink()`](#send-pin--get-documents-link)
|
|
661
|
+
8. [`verifyPin()`](#verify-pin)
|
|
662
|
+
9. [`finalSubmit()`](#final-submit) → policyNumber
|
|
663
|
+
```
|
|
306
664
|
|
|
307
|
-
|
|
665
|
+
> Steps 5–9 are documented under [Shared methods — GIGDB & ADB](#shared-methods--gigdb--adb).
|
|
308
666
|
|
|
309
667
|
---
|
|
310
668
|
|
|
311
|
-
## ADB
|
|
669
|
+
## ADB — Rider Lookup
|
|
312
670
|
|
|
313
|
-
|
|
314
|
-
>
|
|
315
|
-
> **CA:** Supported. The ADB application requires the `occupation` field for California residents — populate it via `getAdbOccupationOptions()`.
|
|
671
|
+
**Method:** `client.getAdbRiderDetails(stateCode)`
|
|
316
672
|
|
|
317
|
-
ADB (Accidental Death Benefit) provides coverage for accidental deaths for ages 20–59.
|
|
318
673
|
|
|
319
|
-
|
|
674
|
+
Optional pre-quote step. Confirms ADB availability for a state and returns valid rider codes.
|
|
320
675
|
|
|
321
|
-
|
|
322
|
-
getAdbRiderDetails() ← check state availability & collect riderCodes
|
|
323
|
-
↓
|
|
324
|
-
getAdbOccupationOptions() ← CA only — lookup occupation labels for the application
|
|
325
|
-
↓
|
|
326
|
-
getAdbQuote()
|
|
327
|
-
↓
|
|
328
|
-
startAdbApplication()
|
|
329
|
-
↓
|
|
330
|
-
[if isDeclined = true] → stop - applicant not eligible
|
|
331
|
-
↓
|
|
332
|
-
updateAdbQuote() ← optional — MUST be before saveEftPayment
|
|
333
|
-
↓
|
|
334
|
-
getExistingAdbQuote() ← optional — fetch the current quote after update
|
|
335
|
-
↓
|
|
336
|
-
saveEftPayment() ← shared with GIGDB; quote cannot be updated after this point
|
|
337
|
-
↓
|
|
338
|
-
prepareDocsAndGetDeliveryChannels()
|
|
339
|
-
↓
|
|
340
|
-
sendPinAndGetDocumentsLink() → verifyPin()
|
|
341
|
-
↓
|
|
342
|
-
finalSubmit()
|
|
343
|
-
```
|
|
676
|
+
> **CA is not supported.** `stateCode = "CA"` returns a 400 validation error — not a `flagProductNotAvailableForState` flag.
|
|
344
677
|
|
|
345
|
-
### Step 0 - `getAdbRiderDetails(stateCode: string)` (optional pre-step)
|
|
346
678
|
|
|
347
|
-
|
|
679
|
+
***
|
|
348
680
|
|
|
349
|
-
|
|
681
|
+
### Request Parameters
|
|
350
682
|
|
|
351
|
-
|
|
352
|
-
|
|
683
|
+
| Parameter | Type | Required | Validation Error |
|
|
684
|
+
|---|---|---|---|
|
|
685
|
+
| `stateCode` | `string` (query) | Yes | `State code is required.` / `State code is not valid.` / `This state is currently not supported.` |
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
***
|
|
689
|
+
|
|
690
|
+
### Error Codes
|
|
353
691
|
|
|
692
|
+
| Code | When |
|
|
693
|
+
|---|---|
|
|
694
|
+
| `InvalidRequestFormat` | State code missing, invalid, or unsupported |
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
***
|
|
698
|
+
|
|
699
|
+
### Response
|
|
700
|
+
|
|
701
|
+
| Field | Type | Description |
|
|
702
|
+
|---|---|---|
|
|
703
|
+
| `flagProductNotAvailableForState` | `boolean` | `true` → ADB not available in this state — do not proceed |
|
|
704
|
+
| `riders[n].riderCode` | `string` | Pass as a value in `riders[]` on Get Quote and Update Quote |
|
|
705
|
+
| `riders[n].riderTitle` | `string` | Display name |
|
|
706
|
+
| `riders[n].riderDescription` | `string` | Coverage description |
|
|
707
|
+
|
|
708
|
+
> `riders` may be an empty array even when `flagProductNotAvailableForState = false` — no optional riders configured for that state.
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
***
|
|
712
|
+
|
|
713
|
+
### Example
|
|
714
|
+
|
|
715
|
+
```typescript
|
|
354
716
|
const riderDetails = await client.getAdbRiderDetails('TX');
|
|
355
717
|
|
|
356
718
|
if (riderDetails.flagProductNotAvailableForState) {
|
|
357
|
-
// ADB not available in this state — do not proceed
|
|
719
|
+
// ADB not available in this state — do not proceed
|
|
358
720
|
return;
|
|
359
721
|
}
|
|
360
722
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
// Pass selectedRiderCodes into ThirdPartyAdbQuoteRequest.riders
|
|
723
|
+
const riderCodes = riderDetails.riders.map(r => r.riderCode);
|
|
724
|
+
// Pass riderCodes into the riders[] field on Get Quote
|
|
364
725
|
```
|
|
365
726
|
|
|
366
|
-
> **Note:** `riders` may be an empty array even when `flagProductNotAvailableForState = false` — this means no optional riders are configured for that state.
|
|
367
727
|
|
|
368
|
-
|
|
728
|
+
***
|
|
729
|
+
|
|
730
|
+
### Available Rider Codes
|
|
731
|
+
|
|
732
|
+
| `AdbRiderType` Enum | Code Value | Description |
|
|
733
|
+
|---|---|---|
|
|
734
|
+
| `AdbRiderType.FamilyADB` | `'FamilyADB'` | Accidental death benefit for spouse and eligible dependent children |
|
|
735
|
+
| `AdbRiderType.ReturnOfPremium` | `'ReturnOfPremium'` | Returns all premiums paid if no claim during policy term |
|
|
736
|
+
| `AdbRiderType.InflationBenefit` | `'InflationBenefit'` | Face amount increases annually with inflation |
|
|
737
|
+
|
|
738
|
+
> Do **not** use `RiderType` values (`"ADB Rider"`, `"Dependent Child Rider"`) — those are IB Term display titles. Do **not** use `"CHILD_TERM"` — it does not exist for ADB.
|
|
739
|
+
|
|
740
|
+
---
|
|
741
|
+
|
|
742
|
+
## ADB — Occupation Lookup (CA only)
|
|
369
743
|
|
|
370
|
-
|
|
744
|
+
**Method:** `client.getAdbOccupationOptions(query?)`
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
Returns valid occupation label strings for CA residents. Pass returned values directly as the `occupation` array in Start Application. `query` is optional — omit to retrieve all options.
|
|
371
748
|
|
|
372
749
|
```typescript
|
|
373
|
-
// Filter to a short list
|
|
374
750
|
const matches = await client.getAdbOccupationOptions('nurse');
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
// Or fetch the full list (omit the query)
|
|
378
|
-
const allOccupations = await client.getAdbOccupationOptions();
|
|
751
|
+
const all = await client.getAdbOccupationOptions();
|
|
379
752
|
```
|
|
380
753
|
|
|
381
|
-
|
|
754
|
+
No field-validation errors are returned for this method.
|
|
755
|
+
|
|
756
|
+
---
|
|
757
|
+
|
|
758
|
+
## ADB — Get Quote
|
|
759
|
+
|
|
760
|
+
**Method:** `client.getAdbQuote(request)` · **Type:** `ThirdPartyAdbQuoteRequest`
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
***
|
|
764
|
+
|
|
765
|
+
### Request Fields
|
|
766
|
+
|
|
767
|
+
| Field | Type | Required | Description | Validation Error |
|
|
768
|
+
|---|---|---|---|---|
|
|
769
|
+
| `faceAmount` | `number` | Yes | Coverage amount ($50,000–$300,000) | `Coverage amount (FaceAmount) is required.` |
|
|
770
|
+
| `gender` | `Gender` | Yes | `Gender.Male`, `Gender.Female` | `Gender is required.` / `Invalid gender.` |
|
|
771
|
+
| `stateCode` | `string` | Yes | 2-letter US state — not MA, NH, AK, CA | `State code is required.` / `State code is not valid.` / `This state is currently not supported.` / `This product is not available for the selected state.` |
|
|
772
|
+
| `age` | `number` | Yes* | Must be 20–59 | `Either age or date of birth must be provided.` / `Age must be between 20 and 59 for ADB.` |
|
|
773
|
+
| `dateOfBirth` | `string` (ISO 8601) | Yes* | Derived age must be 20–59 | `Date of birth must be a valid date.` |
|
|
774
|
+
| `paymentFreq` | `PaymentFrequency` | Yes | `"Monthly"` or `"Annually"` | `Payment frequency is required.` / `Invalid payment frequency.` |
|
|
775
|
+
| `riders` | `AdbRiderType[]` | No | `riderCode` values from Rider Lookup | `Riders are invalid.` |
|
|
776
|
+
| `firstName` | `string` | No | Alphabetic only | `First name is invalid. Only alphabetic characters are allowed.` |
|
|
777
|
+
| `lastName` | `string` | No | Alphabetic only | `Last name is invalid. Only alphabetic characters are allowed.` |
|
|
778
|
+
| `email` | `string` | No | Lead capture | `Please enter a valid email address.` |
|
|
779
|
+
| `phoneNum` | `string` | No | 10 digits or E.164 | `Phone number format is incorrect. Use 10 digits or +1XXXXXXXXXX.` / `Phone number is invalid.` |
|
|
780
|
+
|
|
781
|
+
> *Provide `age` OR `dateOfBirth`.
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
***
|
|
785
|
+
|
|
786
|
+
### Business Rules
|
|
787
|
+
|
|
788
|
+
1. Rider codes are validated against ADB for the given state — unrecognised codes are rejected.
|
|
789
|
+
2. CA is not supported at quote time — returns `This state is currently not supported.`
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
***
|
|
793
|
+
|
|
794
|
+
### Error Codes
|
|
795
|
+
|
|
796
|
+
| Code | When |
|
|
797
|
+
|---|---|
|
|
798
|
+
| `InvalidRequestFormat` | Any field validation failure — inspect `value.fields` |
|
|
799
|
+
| `StateNotFound` | State code not recognized |
|
|
800
|
+
| `AgeNotFound` | Neither age nor date of birth supplied, or age could not be derived |
|
|
801
|
+
| `NotAvailableForState` | ADB not available in the requested state |
|
|
802
|
+
| `QuoteNotEligibleForGivenConditions` | State / age combination not eligible |
|
|
803
|
+
| `CoverageNotAvailable` | Face amount outside allowed range |
|
|
804
|
+
| `RiderNotAvailable` | Rider not available for this product or state |
|
|
805
|
+
| `RiderFaceAmountNotValid` | Rider benefit amount outside allowed range |
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
***
|
|
809
|
+
|
|
810
|
+
### Response
|
|
811
|
+
|
|
812
|
+
| Field | Type | Description |
|
|
813
|
+
|---|---|---|
|
|
814
|
+
| `productName` | `string` | `"InstaADB"` |
|
|
815
|
+
| `selectedQuote.quoteResponseId` | `string` | Pass as `quoteResponseId` in Start Application |
|
|
816
|
+
| `selectedQuote.quoteAmount` | `number` | Premium at requested payment frequency |
|
|
817
|
+
|
|
382
818
|
|
|
383
|
-
|
|
819
|
+
***
|
|
820
|
+
|
|
821
|
+
### Example
|
|
384
822
|
|
|
385
823
|
```typescript
|
|
386
824
|
import { InstaBrainClient, Gender, PaymentFrequency, AdbRiderType } from '@instabrain-sdks/api-client';
|
|
@@ -391,208 +829,458 @@ const quoteResp = await client.getAdbQuote({
|
|
|
391
829
|
stateCode: 'TX',
|
|
392
830
|
age: 35,
|
|
393
831
|
paymentFreq: PaymentFrequency.Monthly,
|
|
394
|
-
riders: [AdbRiderType.FamilyADB]
|
|
395
|
-
firstName: 'John',
|
|
396
|
-
lastName: 'Smith',
|
|
397
|
-
email: 'john.smith@example.com'
|
|
832
|
+
riders: [AdbRiderType.FamilyADB]
|
|
398
833
|
});
|
|
399
834
|
|
|
400
|
-
const { quoteResponseId } = quoteResp.selectedQuote;
|
|
835
|
+
const { quoteResponseId, quoteAmount } = quoteResp.selectedQuote;
|
|
401
836
|
```
|
|
402
837
|
|
|
403
|
-
|
|
838
|
+
---
|
|
839
|
+
|
|
840
|
+
## ADB — Start Application
|
|
841
|
+
|
|
842
|
+
**Method:** `client.startAdbApplication(request)` · **Type:** `ThirdPartyAdbAppReq`
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
***
|
|
846
|
+
|
|
847
|
+
### Top-Level Request Fields
|
|
848
|
+
|
|
849
|
+
| Field | Type | Required | Applicant-Facing Question | Validation Error |
|
|
850
|
+
|---|---|---|---|---|
|
|
851
|
+
| `quoteResponseId` | `string` | Yes | — | `QuoteResponseId is required.` / `QuoteResponseId does not exist or does not belong to the requested product.` |
|
|
852
|
+
| `firstName` | `string` | Yes | *First Name* | `First name is required.` / `First name is invalid. Only alphabetic characters are allowed.` |
|
|
853
|
+
| `lastName` | `string` | Yes | *Last Name* | `Last name is required.` / `Last name is invalid. Only alphabetic characters are allowed.` |
|
|
854
|
+
| `email` | `string` | Yes | *Email Address* | `Email is required.` / `Please enter a valid email address.` |
|
|
855
|
+
| `phoneNumber` | `string` | Yes | *Preferred Phone Number* | `Phone number is required.` / `Phone number format is incorrect. Use 10 digits or +1XXXXXXXXXX.` |
|
|
856
|
+
| `dateOfBirth` | `string` (ISO 8601) | Yes | *Date of Birth* | `Date of birth is required.` / `Date of birth must be a valid date in the past.` / `Age must be between 20 and 59 for ADB.` |
|
|
857
|
+
| `isUsCitizen` | `boolean` | Yes | *Are you a United States citizen?* | `US citizenship status is required.` |
|
|
858
|
+
| `isLegalUsResident` | `boolean` | Conditional | *Are you a legal U.S. resident and have you resided in the U.S. for more than 2 years?* | `Legal US residency status is required for non-US citizens.` |
|
|
859
|
+
| `isPayerAlsoOwnerAndInsured` | `boolean` | Yes | *This product requires that the payer, the person purchasing the policy, and the owner are the same person. Please confirm that you are both the insured individual and will also be the owner of the policy.* | `IsPayerAlsoOwnerAndInsured field is required.` |
|
|
860
|
+
| `socialSecurityNumber` | `string` | Yes | *Social Security Number* | `Social Security Number is required.` / `Social Security Number must be in valid format (e.g., XXX-XX-XXXX).` |
|
|
861
|
+
| `hasExistingCoverage` | `boolean` | Yes | See state-specific wording in GIGDB section above | `Existing coverage field is required` |
|
|
862
|
+
| `willOtherCoverageBeReplacedOrFinanced` | `boolean\|null` | Conditional | See state-specific wording in GIGDB section above | `Please indicate whether any other coverage will be replaced or financed.` / `Other Coverage be replaced or financed must be either null or false as no existing coverage passed.` |
|
|
863
|
+
| `occupation` | `string[]` | CA only | *Please enter your occupation* | `At least one occupation is required when residence state is CA.` / `One or more selected occupations are invalid.` |
|
|
864
|
+
| `hasMedicalCoverage` | `boolean` | DC only | *Do you have comprehensive medical coverage including the minimum essential coverage required by the Affordable Care Act (ACA) or are you treated as having minimum essential coverage due to your status as a bona fide resident of any possession of the United States?* | `Medical coverage acknowledgement is required when residence state is DC.` |
|
|
865
|
+
| `understandsBenefits` | `boolean` | DC only | *Do you understand most supplemental only policies may not pay full benefits if your ACA compliant minimum essential coverage plan is not in force?* | `Supplemental policy benefits acknowledgement is required when residence state is DC.` |
|
|
866
|
+
| `understandsLimitedBenefits` | `boolean` | DC only | *Do you understand that the benefits provided under this policy may be limited?* | `Limited benefits acknowledgement is required when residence state is DC.` |
|
|
867
|
+
|
|
868
|
+
> `socialSecurityNumber` must be **9 consecutive digits, no dashes** (e.g. `123456789`).
|
|
869
|
+
> `isLegalUsResident` required when `isUsCitizen = false`.
|
|
870
|
+
> `occupation` values must come from [`getAdbOccupationOptions()`](#adb--occupation-lookup-ca-only).
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
***
|
|
874
|
+
|
|
875
|
+
### Address
|
|
876
|
+
|
|
877
|
+
| Field | Type | Required | Question | Validation Error |
|
|
878
|
+
|---|---|---|---|---|
|
|
879
|
+
| `address.addressLine1` | `string` | Yes | *Street* | `Address line is required.` / `Street address is invalid. Avoid special characters.` |
|
|
880
|
+
| `address.city` | `string` | Yes | *City* | `Address city is required.` / `City name is invalid. Only letters and spaces are allowed.` |
|
|
881
|
+
| `address.state` | `string` | Yes | *State* | `Residence state is required.` / `Residence state code is invalid.` |
|
|
882
|
+
| `address.zipcode` | `string` | Yes | *Zip Code* | `Zip code is required.` / `Zip code is invalid. It must be in 5-digit format.` / `Zip code is not found.` |
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
***
|
|
886
|
+
|
|
887
|
+
### Existing Coverage (when `hasExistingCoverage = true`)
|
|
888
|
+
|
|
889
|
+
Base fields are the same as GIGDB: `nameOfTheCompany`, `insuranceAmount`, `dateOfIssue`, `toBeReplaced`, `toBeFinanced`.
|
|
890
|
+
|
|
891
|
+
ADB state-specific per-coverage fields (ADB does not use MA `requestsYieldIndices` or GA `wantsPolicySummary`):
|
|
892
|
+
|
|
893
|
+
| State | Field on `existingCoverages[n]` | Exact Question | Validation Error |
|
|
894
|
+
|---|---|---|---|
|
|
895
|
+
| OK | `notifyPresentInsurer` | *Please notify my present insurer(s) regarding this transaction?* | `Notify present insurer response is required for Oklahoma when existing coverage is provided.` |
|
|
896
|
+
| FL | `wantsComparativeInformationForm` | *Indicate whether or not you wish a Comparative Information Form from the proposed company and your existing insurer or insurers?* | `Comparative information form preference is required for Florida when existing coverage is provided.` |
|
|
897
|
+
| DE | `wantsPolicySummary` | *Do you want a policy summary statement from your existing insurer?* | `Policy summary preference is required for Delaware when existing coverage is provided.` |
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
***
|
|
901
|
+
|
|
902
|
+
### Beneficiary Details
|
|
903
|
+
|
|
904
|
+
Same shape as GIGDB. ADB accepts all `BeneficiaryType` values.
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
***
|
|
908
|
+
|
|
909
|
+
### Business Rules
|
|
404
910
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
911
|
+
1. ADB does **not** accept `isSmoker`, `birthJurisdiction`, or `nicotineInfo`.
|
|
912
|
+
2. Quote state and `address.state` must match — mismatch returns `StateMismatchIdentified`.
|
|
913
|
+
3. Age at application (from `dateOfBirth`) must be 20–59.
|
|
914
|
+
4. For CA: `occupation` must contain at least one valid label from `getAdbOccupationOptions()`.
|
|
915
|
+
5. For DC: all three ACA acknowledgement booleans are required.
|
|
916
|
+
6. ADB does **not** return `isQuoteChanged`.
|
|
917
|
+
7. `ApplicationLimitReached` applies — same SSN/email/phone within 30 days for ADB.
|
|
408
918
|
|
|
409
|
-
|
|
919
|
+
|
|
920
|
+
***
|
|
921
|
+
|
|
922
|
+
### Knockout Rules
|
|
923
|
+
|
|
924
|
+
Returns `isDeclined: true` on a successful response — the SDK does **not** throw.
|
|
925
|
+
|
|
926
|
+
- `isPayerAlsoOwnerAndInsured = false`
|
|
927
|
+
- `isUsCitizen = false` AND `isLegalUsResident = false`
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
***
|
|
931
|
+
|
|
932
|
+
### Error Codes
|
|
933
|
+
|
|
934
|
+
| Code | When |
|
|
935
|
+
|---|---|
|
|
936
|
+
| `InvalidRequestFormat` | Any field validation failure — inspect `value.fields` |
|
|
937
|
+
| `ApplicationLimitReached` | SSN, email, or phone matches an ADB policy generated within the last 30 days |
|
|
938
|
+
| `StateMismatchIdentified` | Quote state ≠ `address.state` |
|
|
939
|
+
| `AgentNotFound` | Quote cannot be linked to the agent account — verify credentials |
|
|
940
|
+
| `InternalServerError` | Unexpected backend failure — retry; contact support if persistent |
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
***
|
|
944
|
+
|
|
945
|
+
### Response
|
|
946
|
+
|
|
947
|
+
| Field | Type | Description |
|
|
948
|
+
|---|---|---|
|
|
949
|
+
| `opportunityId` | `string` | All-zero UUID when `isDeclined = true` |
|
|
950
|
+
| `isDeclined` | `boolean` | `true` = knockout; stop the flow |
|
|
951
|
+
|
|
952
|
+
> ADB does **not** return `isQuoteChanged`, `agentLink`, `eAppAgentLink`, or `applicantLink`.
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
***
|
|
956
|
+
|
|
957
|
+
### Example
|
|
410
958
|
|
|
411
959
|
```typescript
|
|
412
960
|
import { BeneficiaryType, BeneficiaryRelationship } from '@instabrain-sdks/api-client';
|
|
413
961
|
|
|
414
962
|
const appResp = await client.startAdbApplication({
|
|
415
|
-
quoteResponseId
|
|
416
|
-
firstName: 'John',
|
|
417
|
-
|
|
418
|
-
email: 'john.smith@example.com',
|
|
419
|
-
phoneNumber: '5559876543',
|
|
420
|
-
isUsCitizen: true,
|
|
421
|
-
isPayerAlsoOwnerAndInsured: true, // must be true - knockout if false
|
|
422
|
-
address: {
|
|
423
|
-
addressLine1: '456 Oak Ave',
|
|
424
|
-
city: 'Dallas',
|
|
425
|
-
state: 'TX',
|
|
426
|
-
zipcode: '75201'
|
|
427
|
-
},
|
|
963
|
+
quoteResponseId,
|
|
964
|
+
firstName: 'John', lastName: 'Smith',
|
|
965
|
+
email: 'john.smith@example.com', phoneNumber: '5559876543',
|
|
428
966
|
dateOfBirth: '1988-03-20',
|
|
429
|
-
|
|
430
|
-
|
|
967
|
+
isUsCitizen: true, isPayerAlsoOwnerAndInsured: true,
|
|
968
|
+
socialSecurityNumber: '987654321',
|
|
969
|
+
hasExistingCoverage: false, willOtherCoverageBeReplacedOrFinanced: null, existingCoverageData: null,
|
|
970
|
+
address: { addressLine1: '456 Oak Ave', city: 'Dallas', state: 'TX', zipcode: '75201' },
|
|
431
971
|
beneficiaryDetails: {
|
|
432
972
|
beneficiaryType: BeneficiaryType.Person,
|
|
433
|
-
beneficiaryPerson: {
|
|
434
|
-
firstName: 'Mary',
|
|
435
|
-
lastName: 'Smith',
|
|
436
|
-
relationship: BeneficiaryRelationship.Spouse
|
|
437
|
-
}
|
|
973
|
+
beneficiaryPerson: { firstName: 'Mary', lastName: 'Smith', relationship: BeneficiaryRelationship.Spouse }
|
|
438
974
|
}
|
|
439
975
|
});
|
|
440
976
|
|
|
441
977
|
if (appResp.isDeclined) {
|
|
442
|
-
// Valid knockout - stop the flow
|
|
443
978
|
return;
|
|
444
979
|
}
|
|
445
|
-
|
|
446
980
|
const { opportunityId } = appResp;
|
|
447
981
|
```
|
|
448
982
|
|
|
449
|
-
|
|
983
|
+
---
|
|
450
984
|
|
|
451
|
-
|
|
452
|
-
- `isUsCitizen === false` AND `isLegalUsResident === false` → declined
|
|
985
|
+
## ADB — Get Existing Quote
|
|
453
986
|
|
|
454
|
-
**
|
|
987
|
+
**Method:** `client.getExistingAdbQuote(opportunityId)`
|
|
455
988
|
|
|
456
|
-
```typescript
|
|
457
|
-
const appResp = await client.startAdbApplication({
|
|
458
|
-
// ...same fields as above, with CA address...
|
|
459
|
-
address: { addressLine1: '...', city: 'Los Angeles', state: 'CA', zipcode: '90001' },
|
|
460
|
-
occupation: ['Registered Nurse'], // populate from getAdbOccupationOptions()
|
|
461
|
-
// ...
|
|
462
|
-
});
|
|
463
|
-
```
|
|
464
989
|
|
|
465
|
-
-
|
|
466
|
-
- Required only when `address.state === "CA"` — omit for all other states
|
|
467
|
-
- Values must come from `getAdbOccupationOptions()`
|
|
990
|
+
**When to call:** Session resumption — re-fetch the quote for an existing opportunity. ADB does not return `isQuoteChanged` so this is not needed immediately after Start Application.
|
|
468
991
|
|
|
469
|
-
**District of Columbia residents — three top-level ACA acknowledgement booleans required:**
|
|
470
992
|
|
|
471
|
-
|
|
993
|
+
***
|
|
472
994
|
|
|
473
|
-
|
|
995
|
+
### Request Parameters
|
|
996
|
+
|
|
997
|
+
| Parameter | Type | Required |
|
|
998
|
+
|---|---|---|
|
|
999
|
+
| `opportunityId` | `string` | Yes |
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
***
|
|
1003
|
+
|
|
1004
|
+
### Error Codes
|
|
1005
|
+
|
|
1006
|
+
| Code | When |
|
|
474
1007
|
|---|---|
|
|
475
|
-
| `
|
|
476
|
-
|
|
477
|
-
|
|
1008
|
+
| `InvalidRequestFormat` | `OpportunityId is required.` / `OpportunityId does not exist.` / `OpportunityId does not match selected product.` |
|
|
1009
|
+
|
|
1010
|
+
> Throws `AuthenticationError` when the opportunity ID is not found or not in scope for your token.
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
***
|
|
1014
|
+
|
|
1015
|
+
### Response
|
|
1016
|
+
|
|
1017
|
+
| Field | Type | Description |
|
|
1018
|
+
|---|---|---|
|
|
1019
|
+
| `productName` | `string` | `"InstaADB"` |
|
|
1020
|
+
| `selectedQuote.quoteResponseId` | `string` | Quote response ID |
|
|
1021
|
+
| `selectedQuote.quoteAmount` | `number` | Premium |
|
|
1022
|
+
|
|
1023
|
+
|
|
1024
|
+
***
|
|
1025
|
+
|
|
1026
|
+
### Example
|
|
478
1027
|
|
|
479
1028
|
```typescript
|
|
480
|
-
await client.
|
|
481
|
-
|
|
482
|
-
address: { addressLine1: '100 7th St NW', city: 'Washington', state: 'DC', zipcode: '20001' },
|
|
483
|
-
hasMedicalCoverage: true, // ACA minimum essential coverage
|
|
484
|
-
understandsBenefits: true, // supplemental policy benefits acknowledgement
|
|
485
|
-
understandsLimitedBenefits: true // limited benefits acknowledgement
|
|
486
|
-
});
|
|
1029
|
+
const quoteResp = await client.getExistingAdbQuote(opportunityId);
|
|
1030
|
+
const { quoteResponseId, quoteAmount } = quoteResp.selectedQuote;
|
|
487
1031
|
```
|
|
488
1032
|
|
|
489
|
-
|
|
1033
|
+
---
|
|
1034
|
+
|
|
1035
|
+
## ADB — Update Quote
|
|
1036
|
+
|
|
1037
|
+
**Method:** `client.updateAdbQuote(request)` · **Type:** `ThirdPartyAdbUpdateQuoteReq`
|
|
490
1038
|
|
|
491
|
-
When `hasExistingCoverage === true`, set the corresponding flag on each `existingCoverages[]` item. Display the exact regulated question text:
|
|
492
1039
|
|
|
493
|
-
|
|
494
|
-
|-------|------------------------------------|---------------------------------------|
|
|
495
|
-
| OK | `notifyPresentInsurer` | *Please notify my present insurer(s) regarding this transaction?* |
|
|
496
|
-
| FL | `wantsComparativeInformationForm` | *Indicate whether or not you wish a Comparative Information Form from the proposed company and your existing insurer or insurers?* |
|
|
497
|
-
| DE | `wantsPolicySummary` | *Do you want a policy summary statement from your existing insurer?* |
|
|
1040
|
+
Changes face amount, payment frequency, or riders after start application. Must be called **before** `save-eft-payment`.
|
|
498
1041
|
|
|
499
|
-
**ADB response differences from GIGDB/IB Term:**
|
|
500
1042
|
|
|
501
|
-
|
|
502
|
-
- No `agentLink`, `eAppAgentLink`, `applicantLink`
|
|
503
|
-
- No `isQuoteChanged`
|
|
504
|
-
- No `birthJurisdiction` field in the application request (unlike GIGDB)
|
|
1043
|
+
***
|
|
505
1044
|
|
|
506
|
-
###
|
|
1045
|
+
### Request Fields
|
|
507
1046
|
|
|
508
|
-
|
|
1047
|
+
| Field | Type | Required | Description | Validation Error |
|
|
1048
|
+
|---|---|---|---|---|
|
|
1049
|
+
| `opportunityId` | `string` | Yes | From Start Application | `OpportunityId is required.` / `OpportunityId does not exist.` / `Quote update is not allowed when payment is already made.` |
|
|
1050
|
+
| `faceAmount` | `number` | Yes | New coverage amount | `Coverage amount (FaceAmount) is required.` |
|
|
1051
|
+
| `paymentFreq` | `PaymentFrequency` | Yes | `"Monthly"` or `"Annually"` | `Payment frequency is required.` / `Invalid payment frequency.` |
|
|
1052
|
+
| `riders` | `AdbRiderType[]` | Yes | Rider codes — pass `[]` to clear all riders | `Riders are required.` / `Riders are invalid.` |
|
|
1053
|
+
|
|
1054
|
+
> `riders` is **required** on Update Quote (unlike Get Quote where it is optional). Send `[]` to remove all riders.
|
|
1055
|
+
|
|
1056
|
+
|
|
1057
|
+
***
|
|
1058
|
+
|
|
1059
|
+
### Error Codes
|
|
1060
|
+
|
|
1061
|
+
| Code | When |
|
|
1062
|
+
|---|---|
|
|
1063
|
+
| `InvalidRequestFormat` | Any field validation failure — inspect `value.fields` |
|
|
1064
|
+
| `PaymentAlreadyMade` | EFT already saved — quote update no longer allowed |
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
***
|
|
1068
|
+
|
|
1069
|
+
### Response
|
|
1070
|
+
|
|
1071
|
+
Same shape as Get Quote — reflects the recalculated premium.
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
***
|
|
1075
|
+
|
|
1076
|
+
### Example
|
|
509
1077
|
|
|
510
1078
|
```typescript
|
|
511
|
-
import { PaymentFrequency } from '@instabrain-sdks/api-client';
|
|
1079
|
+
import { PaymentFrequency, AdbRiderType } from '@instabrain-sdks/api-client';
|
|
512
1080
|
|
|
513
1081
|
const updatedQuote = await client.updateAdbQuote({
|
|
514
1082
|
opportunityId,
|
|
515
1083
|
faceAmount: 150000,
|
|
516
1084
|
paymentFreq: PaymentFrequency.Monthly,
|
|
517
|
-
riders: []
|
|
1085
|
+
riders: [AdbRiderType.FamilyADB] // pass [] to clear all riders
|
|
518
1086
|
});
|
|
519
|
-
|
|
520
|
-
const { quoteResponseId, quoteAmount } = updatedQuote.selectedQuote;
|
|
521
1087
|
```
|
|
522
1088
|
|
|
523
|
-
|
|
1089
|
+
---
|
|
524
1090
|
|
|
525
|
-
|
|
1091
|
+
## IB Term
|
|
526
1092
|
|
|
527
|
-
|
|
528
|
-
const currentQuote = await client.getExistingAdbQuote(opportunityId);
|
|
529
|
-
console.log(currentQuote.selectedQuote.quoteAmount);
|
|
530
|
-
```
|
|
1093
|
+
**InstaBrain Term** — term life product, no medical exam.
|
|
531
1094
|
|
|
532
|
-
|
|
1095
|
+
This is a **pre-fill flow**: use `getQuote()` and `startIBTermApplication()`, then hand off via `agentLink`, `applicantLink`, and `eAppAgentLink`. Do **not** call `saveEftPayment()`, SecureSign methods, or `finalSubmit()` for IB Term.
|
|
533
1096
|
|
|
534
|
-
|
|
1097
|
+
- **Eligible ages:** 18–60
|
|
1098
|
+
- **Not available in:** WY, NY
|
|
1099
|
+
- **Term lengths:** 10, 20, or 30 years (`benefitPeriod`)
|
|
1100
|
+
- **Rating:** `rateClass`, `healthClass`, or `height` + `weightInLbs`
|
|
535
1101
|
|
|
536
|
-
|
|
537
|
-
await client.saveEftPayment({
|
|
538
|
-
opportunityId,
|
|
539
|
-
accountHolderName: 'John Smith',
|
|
540
|
-
routingNumber: '021000021',
|
|
541
|
-
accountNumber: '987654321'
|
|
542
|
-
});
|
|
543
|
-
// After this point, the quote can no longer be updated.
|
|
544
|
-
```
|
|
1102
|
+
---
|
|
545
1103
|
|
|
546
|
-
|
|
1104
|
+
## Integration flow
|
|
547
1105
|
|
|
548
|
-
|
|
1106
|
+
```
|
|
1107
|
+
0. [`getIBTermRiderDetails()`](#ib-term--rider-lookup) [Optional] Confirm availability + rider codes
|
|
1108
|
+
└── flagProductNotAvailableForState = true → STOP
|
|
1109
|
+
1. [`getQuote()`](#ib-term--get-quote) Get quote → quoteResponseId
|
|
1110
|
+
2. [`startIBTermApplication()`](#ib-term--start-application) Start app → agentLink / applicantLink
|
|
1111
|
+
├── isDeclined = true → STOP
|
|
1112
|
+
└── isQuoteChanged = true → re-present updated premium, then hand off via links
|
|
1113
|
+
3. [`getExistingIBTermQuote()`](#ib-term--get-existing-quote) [Optional] Re-fetch prior quote for resumed session
|
|
1114
|
+
|
|
1115
|
+
→ Direct agent or applicant to agentLink / applicantLink / eAppAgentLink
|
|
1116
|
+
All remaining steps (underwriting, payment, signing) complete inside the InstaBrain frontend.
|
|
1117
|
+
No further `InstaBrainClient` methods for IB Term.
|
|
1118
|
+
```
|
|
549
1119
|
|
|
550
1120
|
---
|
|
551
1121
|
|
|
552
|
-
## IB Term
|
|
1122
|
+
## IB Term — Rider Lookup
|
|
553
1123
|
|
|
554
|
-
|
|
1124
|
+
**Method:** `client.getIBTermRiderDetails(stateCode, age, flagNicotineUse)`
|
|
555
1125
|
|
|
556
|
-
### Complete flow
|
|
557
1126
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
prepareDocsAndGetDeliveryChannels() → sendPinAndGetDocumentsLink() → verifyPin()
|
|
568
|
-
↓
|
|
569
|
-
finalSubmit()
|
|
570
|
-
```
|
|
1127
|
+
***
|
|
1128
|
+
|
|
1129
|
+
### Request Parameters
|
|
1130
|
+
|
|
1131
|
+
| Parameter | Type | Required | Validation Error |
|
|
1132
|
+
|---|---|---|---|
|
|
1133
|
+
| `stateCode` | `string` | Yes | `State code is required.` / `State code is not valid.` |
|
|
1134
|
+
| `age` | `number` | Yes | `Age is required.` / `Age must be between 18 and 60.` |
|
|
1135
|
+
| `flagNicotineUse` | `boolean` | Yes | `Nicotine use status is required.` |
|
|
571
1136
|
|
|
572
|
-
|
|
1137
|
+
> Send the same `stateCode`, `age`, and `flagNicotineUse` you intend to use on Get Quote.
|
|
573
1138
|
|
|
574
|
-
|
|
1139
|
+
|
|
1140
|
+
***
|
|
1141
|
+
|
|
1142
|
+
### Error Codes
|
|
1143
|
+
|
|
1144
|
+
| Code | When |
|
|
1145
|
+
|---|---|
|
|
1146
|
+
| `InvalidRequestFormat` | Any parameter missing or invalid |
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
***
|
|
1150
|
+
|
|
1151
|
+
### Response
|
|
1152
|
+
|
|
1153
|
+
| Field | Type | Description |
|
|
1154
|
+
|---|---|---|
|
|
1155
|
+
| `flagProductNotAvailableForState` | `boolean` | `true` → not available for this state/age/nicotine combination — do not proceed |
|
|
1156
|
+
| `riders[n].riderCode` | `string` | Pass as `riders[n].rider` on the Get Quote request |
|
|
1157
|
+
| `riders[n].riderTitle` | `string` | Display name |
|
|
1158
|
+
| `riders[n].riderDescription` | `string` | Coverage description |
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
***
|
|
1162
|
+
|
|
1163
|
+
### Example
|
|
575
1164
|
|
|
576
1165
|
```typescript
|
|
577
1166
|
const riderDetails = await client.getIBTermRiderDetails('TX', 35, false);
|
|
578
1167
|
|
|
579
1168
|
if (riderDetails.flagProductNotAvailableForState) {
|
|
580
|
-
// IB Term is not available for this state/age/nicotine combo — do not proceed
|
|
581
1169
|
return;
|
|
582
1170
|
}
|
|
583
|
-
|
|
584
|
-
// riderDetails.riders[].riderCode → pass into ThirdPartyQuoteReq.riders[n].rider on the quote
|
|
1171
|
+
// Pass riderDetails.riders[n].riderCode as riders[n].rider on Get Quote
|
|
585
1172
|
```
|
|
586
1173
|
|
|
587
|
-
|
|
1174
|
+
---
|
|
1175
|
+
|
|
588
1176
|
|
|
589
|
-
|
|
1177
|
+
---
|
|
590
1178
|
|
|
591
|
-
|
|
1179
|
+
## IB Term — Get Quote
|
|
1180
|
+
|
|
1181
|
+
**Method:** `client.getQuote(request)` · **Type:** `ThirdPartyQuoteReq`
|
|
1182
|
+
|
|
1183
|
+
|
|
1184
|
+
***
|
|
1185
|
+
|
|
1186
|
+
### Request Fields
|
|
1187
|
+
|
|
1188
|
+
Provide exactly one rating group (†) and exactly one age input (‡).
|
|
1189
|
+
|
|
1190
|
+
| Field | Type | Required | Description | Validation Error |
|
|
1191
|
+
|---|---|---|---|---|
|
|
1192
|
+
| `faceAmount` | `number` | Yes | Coverage amount — age-based limits apply | `Coverage amount (FaceAmount) is required.` |
|
|
1193
|
+
| `benefitPeriod` | `number` | Yes | Term: 10, 20, or 30 years (state/age/nicotine dependent) | `Benefit period is required.` |
|
|
1194
|
+
| `flagTobaccoUse` | `boolean` | No | Defaults to `false` when omitted | — |
|
|
1195
|
+
| `gender` | `Gender` | Yes | `Gender.Male`, `Gender.Female` | `Gender is required.` / `Invalid gender.` |
|
|
1196
|
+
| `stateCode` | `string` | Yes | 2-letter US state — do **not** send `zipCode` for IB Term | `State code is required.` / `State code is not valid.` / `This product is not available for the selected state.` |
|
|
1197
|
+
| `rateClass` | `RateClass` | One of † | `"Preferred Plus"`, `"Preferred"`, `"Standard"`, `"Standard Extra"` | `Either RateClass, HealthClass, or Height and WeightInLbs must be provided.` / `Rate class is invalid. Allowed values: Preferred Plus, Preferred, Standard, Standard Extra.` |
|
|
1198
|
+
| `healthClass` | `HealthClass` | One of † | `"excellent"`, `"great"`, `"good"`, `"average"` (case-insensitive) | `Health class is invalid. Allowed values: excellent, great, good, average.` |
|
|
1199
|
+
| `height` | `ThirdPartyQuoteReqHeight \| null` | One of † | `feet` (1–8), `inches` (0–11) — required with `weightInLbs` | `Height or weight is invalid.` |
|
|
1200
|
+
| `weightInLbs` | `number \| null` | One of † | Paired with `height` | — |
|
|
1201
|
+
| `age` | `number` | Yes‡ | 18–60 | `Either age or date of birth must be provided.` / `Age must be between 18 and 60.` |
|
|
1202
|
+
| `dateOfBirth` | `string` (ISO 8601) | Yes‡ | Wins over `age` when both provided | `Date of birth must be a valid date.` |
|
|
1203
|
+
| `riders` | `object[]` | No | `[{ rider: riderCode, riderFaceAmount: number }]` — use `riderCode` from `getIBTermRiderDetails()` | `Riders are invalid.` |
|
|
1204
|
+
| `paymentFreq` | `PaymentFrequency` | Yes | `"Monthly"` or `"Annually"` | `Payment frequency is required.` / `Invalid payment frequency.` |
|
|
1205
|
+
| `firstName` | `string` | No | Alphabetic only | `First name is invalid. Only alphabetic characters are allowed.` |
|
|
1206
|
+
| `lastName` | `string` | No | Alphabetic only | `Last name is invalid. Only alphabetic characters are allowed.` |
|
|
1207
|
+
| `email` | `string` | No | Lead capture | `Please enter a valid email address.` |
|
|
1208
|
+
| `phoneNum` | `string` | No | 10 digits or E.164 | `Phone number format is incorrect. Use 10 digits or +1XXXXXXXXXX.` |
|
|
1209
|
+
|
|
1210
|
+
> **†** Supply exactly **one** rating group: `rateClass`, OR `healthClass`, OR both `height` and `weightInLbs`. Do not send all three.
|
|
1211
|
+
> `HealthClass.Preferred` does **not** exist — using it throws `APIValidationError`.
|
|
1212
|
+
> Rider face amounts: ADB Rider $25,000–$250,000 · Dependent Child Rider $5,000–$25,000. Must not exceed `faceAmount`.
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
***
|
|
1216
|
+
|
|
1217
|
+
### Face Amount Limits (age-based)
|
|
1218
|
+
|
|
1219
|
+
| Age | Min | Max |
|
|
1220
|
+
|---|---|---|
|
|
1221
|
+
| Up to 55 | $50,000 | $1,000,000 |
|
|
1222
|
+
| 56 | $50,000 | $900,000 |
|
|
1223
|
+
| 57 | $50,000 | $800,000 |
|
|
1224
|
+
| 58 | $50,000 | $700,000 |
|
|
1225
|
+
| 59 | $50,000 | $600,000 |
|
|
1226
|
+
| 60 | $50,000 | $500,000 |
|
|
592
1227
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
1228
|
+
|
|
1229
|
+
***
|
|
1230
|
+
|
|
1231
|
+
### Benefit Period Availability
|
|
1232
|
+
|
|
1233
|
+
| Age | Tobacco use | Available periods |
|
|
1234
|
+
|---|---|---|
|
|
1235
|
+
| Up to 45 | Any | 10, 20, 30 |
|
|
1236
|
+
| 45–50 | Non-tobacco | 10, 20, 30 |
|
|
1237
|
+
| 45–50 | Tobacco | 10, 20 |
|
|
1238
|
+
| 51–60 | Any | 10, 20 |
|
|
1239
|
+
|
|
1240
|
+
|
|
1241
|
+
***
|
|
1242
|
+
|
|
1243
|
+
### Error Codes
|
|
1244
|
+
|
|
1245
|
+
`getQuote()` throws `APIValidationError` when the server returns `flagStatus: false`. Common codes:
|
|
1246
|
+
|
|
1247
|
+
| Code | `err.response.value` | When |
|
|
1248
|
+
|---|---|---|
|
|
1249
|
+
| `InvalidRequestFormat` | `fields` object present | Any field validation failure |
|
|
1250
|
+
| `StateNotFound` | `null` | State code not recognized |
|
|
1251
|
+
| `AgeNotFound` | `null` | Neither age nor date of birth supplied, or age could not be derived |
|
|
1252
|
+
| `BenefitPeriodNotAvailable` | `fields` object present | `benefitPeriod` not allowed for state/age/nicotine |
|
|
1253
|
+
| `CoverageNotAvailable` | `fields` object present | `faceAmount` out of range for state/age/nicotine |
|
|
1254
|
+
| `NotAvailableForState` | `null` | Product not available in this state |
|
|
1255
|
+
| `QuoteNotEligibleForGivenConditions` | `null` | State/age/nicotine combination not eligible |
|
|
1256
|
+
| `OutsideBuildChart` | `null` | Height/weight outside carrier build chart |
|
|
1257
|
+
| `RiderNotAvailable` | `null` | Rider not available for this product/state |
|
|
1258
|
+
| `RiderFaceAmountNotValid` | `null` | Rider face amount outside allowed range |
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
***
|
|
1262
|
+
|
|
1263
|
+
### Response
|
|
1264
|
+
|
|
1265
|
+
| Field | Type | Description |
|
|
1266
|
+
|---|---|---|
|
|
1267
|
+
| `productName` | `string` | `"InstaTerm"` |
|
|
1268
|
+
| `selectedQuote.quoteResponseId` | `string` | Pass as `quoteResponseId` in Start Application |
|
|
1269
|
+
| `selectedQuote.quoteAmount` | `number` | Total premium at requested payment frequency |
|
|
1270
|
+
| `selectedQuote.premiumSaveWhenSelectingAnnual` | `number \| null` | Annual billing savings vs monthly; `null` when already annual |
|
|
1271
|
+
| `selectedQuote.maxQuoteAmount` | `number \| null` | Upper premium bound for the quoted profile |
|
|
1272
|
+
| `selectedQuote.minQuoteAmount` | `number \| null` | Lower premium bound for the quoted profile |
|
|
1273
|
+
| `selectedQuote.faceAmount` | `number` | Coverage amount |
|
|
1274
|
+
| `selectedQuote.benefitPeriod` | `number \| null` | Term length in years |
|
|
1275
|
+
| `selectedQuote.paymentFrequency` | `string\|null` | `"Monthly"` or `"Annually"` |
|
|
1276
|
+
| `selectedQuote.selectedRiders[n].rider` | `string` | Rider code |
|
|
1277
|
+
| `selectedQuote.selectedRiders[n].riderFaceAmount` | `number` | Rider face amount |
|
|
1278
|
+
| `selectedQuote.selectedRiders[n].riderQuoteAmount` | `number` | Rider-only premium contribution |
|
|
1279
|
+
|
|
1280
|
+
|
|
1281
|
+
***
|
|
1282
|
+
|
|
1283
|
+
### Example
|
|
596
1284
|
|
|
597
1285
|
```typescript
|
|
598
1286
|
import { Gender, PaymentFrequency, HealthClass } from '@instabrain-sdks/api-client';
|
|
@@ -603,1218 +1291,950 @@ const quoteResp = await client.getQuote({
|
|
|
603
1291
|
flagTobaccoUse: false,
|
|
604
1292
|
gender: Gender.Male,
|
|
605
1293
|
stateCode: 'TX',
|
|
606
|
-
zipCode: null,
|
|
607
1294
|
healthClass: HealthClass.Great,
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
weightInLbs: null,
|
|
611
|
-
age: 40,
|
|
612
|
-
dateOfBirth: null,
|
|
613
|
-
riders: null,
|
|
614
|
-
paymentFreq: PaymentFrequency.Monthly,
|
|
615
|
-
firstName: 'John',
|
|
616
|
-
lastName: null,
|
|
617
|
-
email: null,
|
|
618
|
-
phoneNum: null
|
|
1295
|
+
age: 35,
|
|
1296
|
+
paymentFreq: PaymentFrequency.Monthly
|
|
619
1297
|
});
|
|
620
1298
|
|
|
621
|
-
const { quoteResponseId } = quoteResp.selectedQuote;
|
|
622
|
-
```
|
|
623
|
-
|
|
624
|
-
**Field priority rules:**
|
|
625
|
-
|
|
626
|
-
- `zipCode` takes priority over `stateCode` if both are provided
|
|
627
|
-
- `dateOfBirth` takes priority over `age` if both are provided
|
|
628
|
-
|
|
629
|
-
**Required-field rules (enforced server-side):**
|
|
630
|
-
|
|
631
|
-
- `benefitPeriod` is **required**.
|
|
632
|
-
- **Rating input** — supply exactly ONE group: `rateClass`, OR `healthClass`, OR `height` + `weightInLbs` together. `height` is optional in the type (omit it when rating via `rateClass`/`healthClass`).
|
|
633
|
-
- **Age** — supply `age` OR `dateOfBirth`; resolved age must be **18–60**.
|
|
634
|
-
- **Location** — supply `stateCode` OR `zipCode`.
|
|
635
|
-
|
|
636
|
-
> The IB Term Quote endpoint returns failures in **two shapes**:
|
|
637
|
-
>
|
|
638
|
-
> 1. **Request validation** (HTTP 400, `value.fields`) — top-level `error` is usually `InvalidRequestFormat`. The two cross-field eligibility checks below can also be returned as top-level codes in this same shape:
|
|
639
|
-
> - `BenefitPeriodNotAvailable` — `BenefitPeriod` is not allowed for the selected state, age, and smoker status (carrier params).
|
|
640
|
-
> - `CoverageNotAvailable` — `FaceAmount` is outside the min/max/step for the selected state, age, and smoker status (carrier params).
|
|
641
|
-
> 2. **Business rules** (HTTP 400, `value: null`) — top-level `error` is `BenefitPeriodNotAvailable`, `CoverageNotAvailable`, `outsideBuildChart`, `QuoteNotEligibleForGivenConditions`, `NotAvailableForState`, `RiderNotAvailable`, or `RiderFaceAmountNotValid`.
|
|
642
|
-
>
|
|
643
|
-
> Detect specific failures with `err.isErrorType(APIErrorCode.X)`. See [APIErrorCode Reference → IB Term Quote Business Errors](#ib-term-quote-business-errors).
|
|
644
|
-
|
|
645
|
-
### Step 1a - `getExistingIBTermQuote(opportunityId)` (resume / review an existing quote)
|
|
646
|
-
|
|
647
|
-
Retrieve a previously created IB Term quote by its opportunity ID — useful for resuming or reviewing a quote without re-quoting.
|
|
648
|
-
|
|
649
|
-
```typescript
|
|
650
|
-
const quoteResp = await client.getExistingIBTermQuote(opportunityId);
|
|
651
1299
|
const { quoteResponseId, quoteAmount } = quoteResp.selectedQuote;
|
|
652
1300
|
```
|
|
653
1301
|
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
### Step 2 - `startIBTermApplication(request: IBTermStartApplicationReq)`
|
|
1302
|
+
---
|
|
657
1303
|
|
|
658
|
-
|
|
1304
|
+
## IB Term — Start Application
|
|
659
1305
|
|
|
660
|
-
|
|
661
|
-
import {
|
|
662
|
-
BeneficiaryType,
|
|
663
|
-
BeneficiaryRelationship,
|
|
664
|
-
Gender,
|
|
665
|
-
TobaccoNicotineLastUsedPeriod,
|
|
666
|
-
TobaccoNicotineProductType,
|
|
667
|
-
} from '@instabrain-sdks/api-client';
|
|
1306
|
+
**Method:** `client.startIBTermApplication(request)` · **Type:** `IBTermStartApplicationReq`
|
|
668
1307
|
|
|
669
|
-
const appResp = await client.startIBTermApplication({
|
|
670
|
-
quoteResponseId: quoteResp.selectedQuote.quoteResponseId,
|
|
671
|
-
firstName: 'John',
|
|
672
|
-
lastName: 'Smith',
|
|
673
|
-
email: 'john.smith@example.com',
|
|
674
|
-
phoneNumber: '5559876543', // 10-digit local OR E.164 ('+15559876543')
|
|
675
|
-
isUsCitizenOrIsPermanentResident: true,
|
|
676
|
-
isPayerAlsoOwnerAndInsured: true, // must be true; knockout otherwise
|
|
677
|
-
dateOfBirth: '1988-03-20',
|
|
678
|
-
socialSecurityNumber: '123456789',
|
|
679
|
-
address: {
|
|
680
|
-
addressLine1: '456 Oak Ave',
|
|
681
|
-
city: 'Dallas',
|
|
682
|
-
state: 'TX',
|
|
683
|
-
zipcode: '75201',
|
|
684
|
-
},
|
|
685
|
-
birthJurisdiction: { country: 'US', state: 'TX' },
|
|
686
|
-
height: { feet: 5, inches: 10 },
|
|
687
|
-
weight: 175,
|
|
688
|
-
isHoldingValidDriverLicense: true,
|
|
689
|
-
driverLicenseState: 'TX', // flat field, NOT nested
|
|
690
|
-
driverLicenseNumber: 'D12345678', // flat field, NOT nested
|
|
691
|
-
hasPrimaryCarePhysician: false,
|
|
692
|
-
physicianDetails: null,
|
|
693
|
-
tobaccoNicotineUsage: {
|
|
694
|
-
lastUsedPeriod: TobaccoNicotineLastUsedPeriod.Never,
|
|
695
|
-
lastTimeUsed: null, // null when lastUsedPeriod === Never
|
|
696
|
-
productTypesUsed: null, // null when lastUsedPeriod === Never
|
|
697
|
-
},
|
|
698
|
-
areListedConditionsNotApplicable: true, // false → declined (knockout)
|
|
699
|
-
hasExistingCoverage: false,
|
|
700
|
-
beneficiaryDetails: {
|
|
701
|
-
beneficiaryType: BeneficiaryType.Person,
|
|
702
|
-
beneficiaryPerson: {
|
|
703
|
-
firstName: 'Mary',
|
|
704
|
-
lastName: 'Smith',
|
|
705
|
-
relationship: BeneficiaryRelationship.Spouse,
|
|
706
|
-
},
|
|
707
|
-
},
|
|
708
|
-
});
|
|
709
1308
|
|
|
710
|
-
|
|
711
|
-
// Valid knockout — stop the flow
|
|
712
|
-
return;
|
|
713
|
-
}
|
|
1309
|
+
***
|
|
714
1310
|
|
|
715
|
-
|
|
716
|
-
```
|
|
1311
|
+
### Progressive Disclosure
|
|
717
1312
|
|
|
718
|
-
**
|
|
1313
|
+
Many fields are **optional** — validated only when sent. Backend validation fires only when the parent block is present.
|
|
719
1314
|
|
|
720
|
-
|
|
721
|
-
- `isUsCitizenOrIsPermanentResident === false` → declined
|
|
722
|
-
- `areListedConditionsNotApplicable === false` → declined (one or more of the listed health conditions applies to the applicant)
|
|
723
|
-
- Any child knockout (`isAnyChildTakingMedication`, `isAnyChildDiagnosedWithDisability`, `isAnyChildDiagnosedWithSevereCondition`, `isAnyChildAdvisedForSurgery`) set to `true` → declined when Dependent Child Rider is selected
|
|
1315
|
+
**Always required:** `quoteResponseId`, `firstName`, `lastName`, `email`, `phoneNumber`, `isUsCitizenOrIsPermanentResident`, `isPayerAlsoOwnerAndInsured`, `height`, `weight`, `isHoldingValidDriverLicense`, `areListedConditionsNotApplicable`.
|
|
724
1316
|
|
|
725
|
-
|
|
1317
|
+
**Optional — validated when sent:** `address`, `dateOfBirth`, `socialSecurityNumber`, `birthJurisdiction`, `driverLicenseState`, `driverLicenseNumber`, `hasPrimaryCarePhysician` / `physicianDetails`, `tobaccoNicotineUsage`, `hasExistingCoverage` / `existingCoverageData`, `beneficiaryDetails`.
|
|
726
1318
|
|
|
727
|
-
**
|
|
1319
|
+
**Conditional:** `childRiderInfo` — required when Dependent Child Rider is on the quote; must not be sent otherwise.
|
|
728
1320
|
|
|
729
|
-
#### Driver license
|
|
730
1321
|
|
|
731
|
-
|
|
1322
|
+
***
|
|
732
1323
|
|
|
733
|
-
|
|
1324
|
+
### Always-Required Fields
|
|
734
1325
|
|
|
735
|
-
|
|
1326
|
+
| Field | Type | Required | Applicant-Facing Question | Validation Error |
|
|
1327
|
+
|---|---|---|---|---|
|
|
1328
|
+
| `quoteResponseId` | `string` | Yes | — | `QuoteResponseId is required.` / `QuoteResponseId does not exist or does not belong to the requested product.` |
|
|
1329
|
+
| `firstName` | `string` | Yes | *First Name* | `First name is required.` / `First name is invalid. Only alphabetic characters are allowed.` |
|
|
1330
|
+
| `lastName` | `string` | Yes | *Last Name* | `Last name is required.` / `Last name is invalid. Only alphabetic characters are allowed.` |
|
|
1331
|
+
| `email` | `string` | Yes | *Email Address* | `Email is required.` / `Please enter a valid email address.` |
|
|
1332
|
+
| `phoneNumber` | `string` | Yes | *Preferred Phone Number* | `Phone number is required.` / `Phone number format is incorrect. Use 10 digits or +1XXXXXXXXXX.` |
|
|
1333
|
+
| `isUsCitizenOrIsPermanentResident` | `boolean` | Yes | *Are you a US citizen or lawful permanent resident who has resided in the US for more than 2 years?* | `US citizenship or permanent residency status is required.` |
|
|
1334
|
+
| `isPayerAlsoOwnerAndInsured` | `boolean` | Yes | *Are you the insured, owner, and payor of this policy?* | `IsPayerAlsoOwnerAndInsured field is required.` |
|
|
1335
|
+
| `height.feet` | `number` | Yes | — | `Height is required.` / `Height feet is required.` / `Height feet must be between 1 and 8.` |
|
|
1336
|
+
| `height.inches` | `number` | Yes | — | `Height inches is required.` / `Height inches must be between 0 and 11.` |
|
|
1337
|
+
| `weight` | `number` | Yes | — | `Weight is required.` / `Weight must be greater than 0.` |
|
|
1338
|
+
| `isHoldingValidDriverLicense` | `boolean` | Yes | *Do you hold a valid driver's license?* | `IsHoldingValidDriverLicense is required.` |
|
|
1339
|
+
| `areListedConditionsNotApplicable` | `boolean` | Yes | *By checking the box I confirm the conditions listed are not applicable and able to proceed with the application.* | `AreListedConditionsNotApplicable is required.` |
|
|
736
1340
|
|
|
737
|
-
#### Tobacco / nicotine usage
|
|
738
1341
|
|
|
739
|
-
|
|
1342
|
+
***
|
|
740
1343
|
|
|
741
|
-
|
|
742
|
-
- Otherwise: supply `lastTimeUsed` (`YYYY-MM`) AND at least one `productTypesUsed` value. If `productTypesUsed` includes `Cigars`, `cigarUsagePerYear` (1–999) is required.
|
|
1344
|
+
### `areListedConditionsNotApplicable` — Listed Conditions
|
|
743
1345
|
|
|
744
|
-
|
|
1346
|
+
`true` = none apply → application proceeds. `false` = one or more apply → immediate decline.
|
|
745
1347
|
|
|
746
|
-
|
|
1348
|
+
Display the full list to the applicant. Only set `true` when they confirm none apply.
|
|
747
1349
|
|
|
748
|
-
|
|
749
|
-
childRiderInfo: {
|
|
750
|
-
hasExistingCoverageForChildren: true,
|
|
751
|
-
isAnyChildTakingMedication: false,
|
|
752
|
-
isAnyChildDiagnosedWithDisability: false,
|
|
753
|
-
isAnyChildDiagnosedWithSevereCondition: false,
|
|
754
|
-
isAnyChildAdvisedForSurgery: false,
|
|
755
|
-
childrenToBeInsuredDetails: [{
|
|
756
|
-
firstName: 'Alice',
|
|
757
|
-
lastName: 'Smith',
|
|
758
|
-
gender: Gender.Female,
|
|
759
|
-
dob: '2020-05-10', // 15 days – under 18 years (BE field: DOB → dob)
|
|
760
|
-
height: { feet: 3, inches: 6 },
|
|
761
|
-
weight: 40,
|
|
762
|
-
relation: 'Daughter', // BE field: Relation → relation
|
|
763
|
-
}],
|
|
764
|
-
existingCoverageInfoForChildren: [{
|
|
765
|
-
nameOfTheCompany: 'KidsCo',
|
|
766
|
-
insuranceAmount: '25000', // string, NOT number (matches adult coverage shape)
|
|
767
|
-
policyNumber: 'POL-1',
|
|
768
|
-
dateOfIssue: '2022-01',
|
|
769
|
-
toBeReplaced: false, // required
|
|
770
|
-
toBeFinanced: false, // required
|
|
771
|
-
}],
|
|
772
|
-
}
|
|
773
|
-
```
|
|
1350
|
+
**Cardiovascular:** Angina / Heart Attack / Stroke · Aortic or Brain Aneurysm · Atrial Fibrillation / Arrhythmia · Cardiomyopathy / Congestive Heart Failure · Cerebrovascular Accident / TIAs · Coronary Artery Blockage / Bypass / Stent · Myocardial Infarction · Myocarditis
|
|
774
1351
|
|
|
775
|
-
|
|
1352
|
+
**Neurological:** ALS · Alzheimer's / Dementia / Cognitive Impairment · Cerebral Palsy · Multiple Sclerosis · Parkinson's Disease · Seizures (Grand Mal, Partial, or Focal with moderate control)
|
|
776
1353
|
|
|
777
|
-
|
|
1354
|
+
**Metabolic / Endocrine:** Diabetes Type I · Diabetes Type II under age 40 · Liver Disease / Cirrhosis / Hemochromatosis
|
|
778
1355
|
|
|
779
|
-
|
|
1356
|
+
**Mental Health / Developmental:** Autism · Schizophrenia or Psychosis · Mentally Challenged (Down's Syndrome, etc.)
|
|
780
1357
|
|
|
781
|
-
|
|
782
|
-
|-----------|------------------------------------|-----------|
|
|
783
|
-
| MA | `requestsYieldIndices` | `boolean` |
|
|
784
|
-
| OK | `notifyPresentInsurer` | `boolean` |
|
|
785
|
-
| DE / GA | `wantsPolicySummary` | `boolean` |
|
|
786
|
-
| FL | `wantsComparativeInformationForm` | `boolean` |
|
|
1358
|
+
**Other Medical:** Pending medical tests or exams · Lupus (SLE) · Muscular Dystrophy · Organ Transplant · Sleep Apnea (non-compliant or within 6 months of diagnosis) · Drug/Alcohol treatment within past 5 years · Ventilator use
|
|
787
1359
|
|
|
788
|
-
|
|
1360
|
+
**Legal / Insurance History:** Adverse action by another insurer · Misdemeanor within past 8 years · Convicted of a felony · Currently disabled · Declined by or submitted more than 3 life insurance applications in past year · No valid driver's license · DUI / License Suspension / Reckless Driving within last 2 years · Pending criminal charges or probation
|
|
789
1361
|
|
|
790
|
-
### Legacy `startApplication(request: ThirdPartyStartApplicationReq)`
|
|
791
1362
|
|
|
792
|
-
|
|
1363
|
+
***
|
|
793
1364
|
|
|
794
|
-
|
|
795
|
-
// Legacy iframe-driven flow:
|
|
796
|
-
const appResp = await client.startApplication({
|
|
797
|
-
quoteResponseId, firstName: 'John', lastName: 'Smith',
|
|
798
|
-
email: 'john.smith@example.com', phoneNumber: '5559876543',
|
|
799
|
-
});
|
|
800
|
-
const { agentLink, applicantLink } = appResp;
|
|
801
|
-
```
|
|
1365
|
+
### Optional Fields (validated when sent)
|
|
802
1366
|
|
|
803
|
-
|
|
1367
|
+
| Field | Type | Notes | Validation Error |
|
|
1368
|
+
|---|---|---|---|
|
|
1369
|
+
| `dateOfBirth` | `string\|null` | ISO date; age 18–60 when sent | `Date of birth must be a valid date in the past.` / `Age must be between 18 and 60 for IB Term.` |
|
|
1370
|
+
| `socialSecurityNumber` | `string\|null` | 9 consecutive digits, no dashes (e.g. `123456789`) | `Social Security Number must be in valid format (e.g., XXX-XX-XXXX).` |
|
|
1371
|
+
| `address.addressLine1` | `string` | When `address` sent | `Address line is required.` / `Street address is invalid. Avoid special characters.` |
|
|
1372
|
+
| `address.city` | `string` | When `address` sent | `Address city is required.` / `City name is invalid. Only letters and spaces are allowed.` |
|
|
1373
|
+
| `address.state` | `string` | When `address` sent — must match quote state | `Residence state is required.` / `Residence state code is invalid.` |
|
|
1374
|
+
| `address.zipcode` | `string` | When `address` sent | `Zip code is required.` / `Zip code is invalid. It must be in 5-digit format.` / `Zip code is not found.` |
|
|
1375
|
+
| `birthJurisdiction.country` | `string` | When `birthJurisdiction` sent | `Birth jurisdiction country is required.` |
|
|
1376
|
+
| `birthJurisdiction.state` | `string` | When `country = "US"` | `Birth jurisdiction state is required when birth country is US.` / `Birth state code is invalid.` |
|
|
1377
|
+
| `driverLicenseState` | `string\|null` | Flat field — independent of `isHoldingValidDriverLicense` | `Residence state code is invalid.` *(when sent)* |
|
|
1378
|
+
| `driverLicenseNumber` | `string\|null` | Flat field — validated against `driverLicenseState` when both sent | `Driver license number format is invalid for the selected driver license state.` |
|
|
804
1379
|
|
|
805
|
-
|
|
1380
|
+
> `driverLicenseState` and `driverLicenseNumber` are **flat top-level fields**, not nested. `isHoldingValidDriverLicense = false` is still a knockout regardless of whether these fields are provided.
|
|
806
1381
|
|
|
807
|
-
---
|
|
808
1382
|
|
|
809
|
-
|
|
1383
|
+
***
|
|
810
1384
|
|
|
811
|
-
|
|
1385
|
+
### Primary Care Physician (optional)
|
|
812
1386
|
|
|
813
|
-
|
|
1387
|
+
| Field | Type | Required | Question | Validation Error |
|
|
1388
|
+
|---|---|---|---|---|
|
|
1389
|
+
| `hasPrimaryCarePhysician` | `boolean\|null` | No | *Do you have a primary care physician?* | — |
|
|
1390
|
+
| `physicianDetails.physicianName` | `string` | When `hasPrimaryCarePhysician = true` | *What is the name of your primary care physician?* | `Physician name is required when HasPrimaryCarePhysician is true.` |
|
|
1391
|
+
| `physicianDetails.city` | `string` | When `hasPrimaryCarePhysician = true` | *In which city does your physician practice?* | `Physician city/address is required when HasPrimaryCarePhysician is true.` |
|
|
1392
|
+
| `physicianDetails.stateCode` | `string` | When `hasPrimaryCarePhysician = true` | *In which state does your physician practice?* | `Physician state is required when HasPrimaryCarePhysician is true.` / `Outside Of The USA is not allowed for physician state.` / `Physician state code is invalid.` |
|
|
1393
|
+
| `physicianDetails.lastSeen` | `string` (`YYYY-MM`) | When `hasPrimaryCarePhysician = true` | *When did you last see your physician?* | `Physician last-seen date is required when HasPrimaryCarePhysician is true.` / `Physician last-seen date must be in YYYY-MM format and must not be after the current month.` |
|
|
814
1394
|
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
↓
|
|
818
|
-
[if isSignCompleted = true] → skip directly to finalSubmit()
|
|
819
|
-
↓
|
|
820
|
-
sendPinAndGetDocumentsLink()
|
|
821
|
-
↓
|
|
822
|
-
[agent reads script aloud; applicant reviews and signs documents via link]
|
|
823
|
-
↓
|
|
824
|
-
verifyPin() [or resendPin() if PIN was not received]
|
|
825
|
-
↓
|
|
826
|
-
finalSubmit()
|
|
827
|
-
```
|
|
1395
|
+
> When `hasPrimaryCarePhysician = false`, `physicianDetails` must be `null`. Error: `Physician details must be null when HasPrimaryCarePhysician is false.`
|
|
1396
|
+
> The physician-age-55 knockout has been **removed** — applicants 55+ without a physician are not declined.
|
|
828
1397
|
|
|
829
|
-
### Step 1 - `prepareDocsAndGetDeliveryChannels(opportunityId: string)`
|
|
830
1398
|
|
|
831
|
-
|
|
1399
|
+
***
|
|
832
1400
|
|
|
833
|
-
|
|
834
|
-
const prepResp = await client.prepareDocsAndGetDeliveryChannels(opportunityId);
|
|
1401
|
+
### Tobacco / Nicotine Usage (optional — validated when sent)
|
|
835
1402
|
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
```
|
|
1403
|
+
| Field | Type | Required | Question | Validation Error |
|
|
1404
|
+
|---|---|---|---|---|
|
|
1405
|
+
| `tobaccoNicotineUsage.lastUsedPeriod` | `TobaccoNicotineLastUsedPeriod` | Yes (in block) | *When did you last use tobacco or nicotine products?* | `Last used period is required.` / `Last used period must be one of: within the last 12 months, 12 to 23 months, 24 to 35 months, 36 months or greater, never used.` |
|
|
1406
|
+
| `tobaccoNicotineUsage.productTypesUsed` | `TobaccoNicotineProductType[] \| null` | When `lastUsedPeriod !== TobaccoNicotineLastUsedPeriod.Never` | *Which tobacco or nicotine products have you used?* | `At least one tobacco or nicotine product type must be selected.` |
|
|
1407
|
+
| `tobaccoNicotineUsage.lastTimeUsed` | `string \| null` (`YYYY-MM`) | When `lastUsedPeriod !== TobaccoNicotineLastUsedPeriod.Never` | *When was the most recent time you used tobacco or nicotine?* | `Last time used tobacco/nicotine date is required.` / `Last time used tobacco/nicotine date must be in YYYY-MM format.` |
|
|
1408
|
+
| `tobaccoNicotineUsage.cigarUsagePerYear` | `number \| null` | When `productTypesUsed` is `[TobaccoNicotineProductType.Cigars]` only | *How many cigars do you smoke per year?* (1–999) | `Number of times cigars are smoked per year is required when Cigars is selected.` / `Cigar usage per year must be greater than 0.` / `Cigar usage per year must be less than or equal to 999.` |
|
|
843
1409
|
|
|
844
|
-
|
|
1410
|
+
> When `lastUsedPeriod === TobaccoNicotineLastUsedPeriod.Never`, `lastTimeUsed`, `productTypesUsed`, and `cigarUsagePerYear` must all be `null`.
|
|
1411
|
+
> `cigarUsagePerYear` is required **only when `productTypesUsed` is exclusively `[TobaccoNicotineProductType.Cigars]`**. When cigars appear alongside other products it is not required.
|
|
845
1412
|
|
|
846
|
-
At least one of `flagSendSms` or `flagSendEmail` must be `true`.
|
|
847
1413
|
|
|
848
|
-
|
|
849
|
-
const pinResp = await client.sendPinAndGetDocumentsLink({
|
|
850
|
-
opportunityId,
|
|
851
|
-
flagSendSms: true,
|
|
852
|
-
flagSendEmail: false
|
|
853
|
-
});
|
|
1414
|
+
***
|
|
854
1415
|
|
|
855
|
-
|
|
856
|
-
// pinResp.scriptHeader - header for the disclosure section
|
|
857
|
-
// pinResp.script - array of disclosure statements to read aloud
|
|
858
|
-
// pinResp.consentMessage - consent statement with the applicant's name
|
|
859
|
-
```
|
|
1416
|
+
### Existing Coverage (when `hasExistingCoverage` is sent as `true` or `false`)
|
|
860
1417
|
|
|
861
|
-
|
|
1418
|
+
Same base fields and state-specific existing coverage fields as GIGDB (MA / OK / DE / GA / FL / RI / WV / KS / WA). See GIGDB Start Application section above for full field tables and exact question text.
|
|
862
1419
|
|
|
863
|
-
|
|
864
|
-
2. The applicant opens `pinResp.link` in their browser to review and sign documents
|
|
865
|
-
3. *(Non-code step - the SDK does not manage the applicant's browser session)*
|
|
1420
|
+
> State-specific existing coverage fields are only enforced when `address` is included in the request. If `address` is omitted, these per-state fields are not validated.
|
|
866
1421
|
|
|
867
|
-
### Step 4 - `verifyPin(request: ThirdPartyVerifyPinReq)`
|
|
868
1422
|
|
|
869
|
-
|
|
1423
|
+
***
|
|
870
1424
|
|
|
871
|
-
|
|
872
|
-
const verifyResp = await client.verifyPin({
|
|
873
|
-
opportunityId,
|
|
874
|
-
pin: '123456',
|
|
875
|
-
isScriptReadConfirmed: true
|
|
876
|
-
});
|
|
1425
|
+
### Beneficiary Details (optional — validated when sent)
|
|
877
1426
|
|
|
878
|
-
|
|
879
|
-
// Signing complete - proceed to finalSubmit()
|
|
880
|
-
}
|
|
881
|
-
```
|
|
1427
|
+
IB Term accepts only: `Person`, `Trust`, `Insured Estate`, `All Children Of The Insured Equally`, `All Children Of The Marriage Equally`. Business, Corporation, Charitable Organization, Employer, and Other types are **rejected** by IB Term.
|
|
882
1428
|
|
|
883
|
-
|
|
1429
|
+
| Field | Type | Question | Validation Error |
|
|
1430
|
+
|---|---|---|---|
|
|
1431
|
+
| `beneficiaryDetails.beneficiaryType` | `string` | *Who is your primary beneficiary?* | `Please select a valid beneficiary option.` |
|
|
1432
|
+
| `beneficiaryDetails.beneficiaryPerson.firstName` | `string` | *What is your beneficiary's first name?* | `Beneficiary first name is required.` |
|
|
1433
|
+
| `beneficiaryDetails.beneficiaryPerson.lastName` | `string` | *What is your beneficiary's last name?* | `Beneficiary last name is required.` |
|
|
1434
|
+
| `beneficiaryDetails.beneficiaryPerson.relationship` | `string` | *What is your relationship to the beneficiary?* | `Please specify the relationship with the beneficiary.` |
|
|
1435
|
+
| `beneficiaryDetails.namedEntity.name` | `string` | *What is the name of the trust or estate?* | `Beneficiary name is required.` |
|
|
1436
|
+
| `beneficiaryDetails.namedEntity.trustDate` | `string` (`YYYY-MM`) | *When was the trust established?* | `Trust date must be in YYYY-MM format.` |
|
|
884
1437
|
|
|
885
|
-
```typescript
|
|
886
|
-
await client.resendPin({
|
|
887
|
-
opportunityId,
|
|
888
|
-
flagSendSms: true,
|
|
889
|
-
flagSendEmail: false
|
|
890
|
-
});
|
|
891
|
-
```
|
|
892
1438
|
|
|
893
|
-
|
|
1439
|
+
***
|
|
894
1440
|
|
|
895
|
-
|
|
1441
|
+
### Child Rider (when Dependent Child Rider is on the quote)
|
|
896
1442
|
|
|
897
|
-
|
|
1443
|
+
`childRiderInfo` is **required** when Dependent Child Rider was selected on the quote. Omit it otherwise — `startIBTermApplication()` returns validation errors if sent without the rider.
|
|
898
1444
|
|
|
899
|
-
|
|
900
|
-
const submitResp = await client.finalSubmit(opportunityId);
|
|
901
|
-
console.log('Policy number:', submitResp.policyNumber);
|
|
902
|
-
```
|
|
1445
|
+
**Knockout booleans (all required — `true` = immediate decline):**
|
|
903
1446
|
|
|
904
|
-
|
|
1447
|
+
| Field | Exact Question | Validation Error |
|
|
1448
|
+
|---|---|---|
|
|
1449
|
+
| `childRiderInfo.isAnyChildTakingMedication` | *Is any Proposed Child (Children) to be Insured now taking medication, by prescription or over the counter (OTC), or undergoing treatment or therapy of any kind by a member of the medical profession?* | `Child medication knockout question is required.` |
|
|
1450
|
+
| `childRiderInfo.isAnyChildDiagnosedWithDisability` | *Has any Proposed Child (Children) to be Insured been diagnosed with or treated by a Physician for any physical or mental disability?* | `Child disability knockout question is required.` |
|
|
1451
|
+
| `childRiderInfo.isAnyChildDiagnosedWithSevereCondition` | *Has any Proposed Child (Children) to be Insured ever been diagnosed with or treated by a physician for any disorder of the heart, lung or for cancer?* | `Child severe condition knockout question is required.` |
|
|
1452
|
+
| `childRiderInfo.isAnyChildAdvisedForSurgery` | *Within the last 5 years, has any Proposed Child (Children) to be Insured been advised by a member of the medical profession to have any surgery or hospitalization which has not yet been completed?* | `Child surgery knockout question is required.` |
|
|
905
1453
|
|
|
906
|
-
|
|
1454
|
+
**`childrenToBeInsuredDetails[]`** (optional, max 10):
|
|
907
1455
|
|
|
908
|
-
|
|
1456
|
+
> **TypeScript / JSON property names:** use `dob` (not `dateOfBirth`) and `relation` (not `relationship`). Wrong keys are ignored by the serializer.
|
|
909
1457
|
|
|
910
|
-
|
|
1458
|
+
| Field | Type | Constraints | Validation Error |
|
|
1459
|
+
|---|---|---|---|
|
|
1460
|
+
| `firstName` | `string` | Alphabetic only | `Child first name is required.` / `Invalid child first name.` |
|
|
1461
|
+
| `lastName` | `string` | Alphabetic only | `Child last name is required.` / `Invalid child last name.` |
|
|
1462
|
+
| `gender` | `Gender` | Male or Female | `Child gender is required.` / `Gender must be Male or Female.` |
|
|
1463
|
+
| `dob` | `string` | 15 days – under 18 years | `Child date of birth is required.` / `Child must be between 15 days and under 18 years old.` |
|
|
1464
|
+
| `height.feet` | `number` | 0–8 | `Child height feet must be between 0 and 8.` |
|
|
1465
|
+
| `height.inches` | `number` | 0–11 | `Child height inches must be between 0 and 11.` |
|
|
1466
|
+
| `weight` | `number` | > 0 | `Child weight must be greater than 0.` |
|
|
1467
|
+
| `relation` | `string` | **Restricted:** `"biological child"` \| `"legally adopted child"` \| `"stepchild"` | `Child relationship is required.` / `Relationship must be one of: biological child, legally adopted child, stepchild.` |
|
|
911
1468
|
|
|
912
|
-
|
|
1469
|
+
**`existingCoverageInfoForChildren[]`** (required when `hasExistingCoverageForChildren = true`, max 10):
|
|
913
1470
|
|
|
914
|
-
|
|
915
|
-
|
|
1471
|
+
| Field | Type | Validation Error |
|
|
1472
|
+
|---|---|---|
|
|
1473
|
+
| `nameOfTheCompany` | `string` | `Name of the company is required for child existing coverage.` |
|
|
1474
|
+
| `insuranceAmount` | `string` | `Insurance amount is required for child existing coverage.` / `Insurance amount must be a positive number.` |
|
|
1475
|
+
| `policyNumber` | `string` | `Policy number is required for child existing coverage.` |
|
|
1476
|
+
| `dateOfIssue` | `string` (`YYYY-MM`) | `Date of issue is required for child existing coverage.` |
|
|
1477
|
+
| `toBeReplaced` | `boolean` | `Replacement coverage answer must be specified.` |
|
|
1478
|
+
| `toBeFinanced` | `boolean` | `Financing coverage answer must be specified.` |
|
|
916
1479
|
|
|
917
|
-
|
|
918
|
-
pageSize: 20, // required
|
|
919
|
-
pageIndex: 0 // required, 0-based
|
|
920
|
-
};
|
|
921
|
-
```
|
|
1480
|
+
> Total `insuranceAmount` for entries where `toBeReplaced = false` must not exceed $100,000.
|
|
922
1481
|
|
|
923
|
-
### Methods
|
|
924
1482
|
|
|
925
|
-
|
|
926
|
-
// Quotes not yet converted to applications
|
|
927
|
-
const prospects = await client.getProspects(request);
|
|
928
|
-
// Returns: { prospectCount: number, prospects: ThirdPartyProspectsDetails[] }
|
|
1483
|
+
***
|
|
929
1484
|
|
|
930
|
-
|
|
931
|
-
const sales = await client.getSales(request);
|
|
932
|
-
// Returns: { applicationCount: number, salesReport: ThirdPartySalesReport[], totalPremiumAmount: number }
|
|
1485
|
+
### Business Rules
|
|
933
1486
|
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
1487
|
+
1. `quoteResponseId` must belong to an IB Term quote.
|
|
1488
|
+
2. `address.state` (when sent) must match the quote state — mismatch returns `StateMismatchIdentified`.
|
|
1489
|
+
3. IB Term does **not** return `ApplicationLimitReached` (30-day duplicate limit applies to ADB/GIGDB only).
|
|
1490
|
+
4. State-specific existing coverage fields are only enforced when `address` is included in the request.
|
|
1491
|
+
5. When Dependent Child Rider is on the quote, `childRiderInfo` is required. If not on the quote, sending it returns `Child rider was not included in the quote. Cannot add child rider details.`
|
|
1492
|
+
6. No physician knockout for applicants ≥ 55 — that rule was removed.
|
|
938
1493
|
|
|
939
|
-
### Full `AgentPortalReq` field reference
|
|
940
1494
|
|
|
1495
|
+
***
|
|
941
1496
|
|
|
942
|
-
|
|
943
|
-
| -------------- | ------------------------- | -------- | --------------------------------------------- |
|
|
944
|
-
| `pageSize` | `number` | **Yes** | Items per page |
|
|
945
|
-
| `pageIndex` | `number` | **Yes** | Page index, 0-based |
|
|
946
|
-
| `startDate` | `string` (ISO) | No | Start of date range |
|
|
947
|
-
| `endDate` | `string` (ISO) | No | End of date range |
|
|
948
|
-
| `dayCount` | `number` | No | Alternative to date range - fetch last N days |
|
|
949
|
-
| `userTimeZone` | `string` | No | IANA timezone (e.g., `'America/Chicago'`) |
|
|
950
|
-
| `sort` | `AgentPortalReqSorting` | No | Sort configuration |
|
|
951
|
-
| `filters` | `AgentPortalReqFilters[]` | No | Array of filters |
|
|
952
|
-
| `searchParam` | `string` | No | Text search |
|
|
1497
|
+
### Knockout Rules
|
|
953
1498
|
|
|
1499
|
+
Returns `isDeclined: true` on a successful response — the SDK does **not** throw.
|
|
954
1500
|
|
|
955
|
-
|
|
1501
|
+
- `isPayerAlsoOwnerAndInsured = false`
|
|
1502
|
+
- `isUsCitizenOrIsPermanentResident = false`
|
|
1503
|
+
- `isHoldingValidDriverLicense = false`
|
|
1504
|
+
- `areListedConditionsNotApplicable = false`
|
|
1505
|
+
- Any child knockout boolean = `true`
|
|
1506
|
+
- Height / weight outside the IB Term build chart
|
|
956
1507
|
|
|
957
|
-
```typescript
|
|
958
|
-
sort: {
|
|
959
|
-
value: 'createdOn',
|
|
960
|
-
sortDescending: true
|
|
961
|
-
}
|
|
962
|
-
```
|
|
963
1508
|
|
|
964
|
-
|
|
1509
|
+
***
|
|
965
1510
|
|
|
966
|
-
|
|
967
|
-
import { SQLOperator } from '@instabrain-sdks/api-client';
|
|
1511
|
+
### `isQuoteChanged`
|
|
968
1512
|
|
|
969
|
-
|
|
970
|
-
{
|
|
971
|
-
field: 'stateCode',
|
|
972
|
-
operator: SQLOperator.Equal,
|
|
973
|
-
value: 'TX'
|
|
974
|
-
}
|
|
975
|
-
]
|
|
976
|
-
```
|
|
1513
|
+
When `isQuoteChanged = true`, the carrier adjusted the premium. Re-present the updated premium to the applicant before directing them to the link.
|
|
977
1514
|
|
|
978
|
-
`**SQLOperator` enum values:**
|
|
979
1515
|
|
|
1516
|
+
***
|
|
980
1517
|
|
|
981
|
-
|
|
982
|
-
| -------------------- | ------------- | --------------------- |
|
|
983
|
-
| `Equal` | `0` | Exact match |
|
|
984
|
-
| `NotEqual` | `1` | Not equal |
|
|
985
|
-
| `GreaterThan` | `2` | Greater than |
|
|
986
|
-
| `GreaterThanOrEqual` | `3` | Greater than or equal |
|
|
987
|
-
| `LessThan` | `4` | Less than |
|
|
988
|
-
| `LessThanOrEqual` | `5` | Less than or equal |
|
|
989
|
-
| `Contains` | `6` | Contains substring |
|
|
990
|
-
| `StartsWith` | `7` | Starts with |
|
|
991
|
-
| `EndsWith` | `8` | Ends with |
|
|
992
|
-
| `In` | `9` | In list |
|
|
993
|
-
| `NotIn` | `10` | Not in list |
|
|
1518
|
+
### Error Codes
|
|
994
1519
|
|
|
1520
|
+
| Code | When |
|
|
1521
|
+
|---|---|
|
|
1522
|
+
| `InvalidRequestFormat` | Any field validation failure — inspect `value.fields` |
|
|
1523
|
+
| `StateMismatchIdentified` | Quote state ≠ `address.state` |
|
|
1524
|
+
| `AgentNotFound` | Quote cannot be linked to the agent account — verify credentials |
|
|
1525
|
+
| `InternalServerError` | Unexpected backend failure — retry; contact support if persistent |
|
|
995
1526
|
|
|
996
|
-
---
|
|
997
1527
|
|
|
998
|
-
|
|
1528
|
+
***
|
|
999
1529
|
|
|
1000
|
-
###
|
|
1530
|
+
### Response
|
|
1001
1531
|
|
|
1532
|
+
| Field | Type | Description |
|
|
1533
|
+
|---|---|---|
|
|
1534
|
+
| `opportunityId` | `string` | All-zero UUID when declined before opportunity creation |
|
|
1535
|
+
| `isDeclined` | `boolean` | `true` = knockout; stop the flow |
|
|
1536
|
+
| `isQuoteChanged` | `boolean` | `true` = carrier adjusted premium; re-present before handoff |
|
|
1537
|
+
| `agentLink` | `string\|null` | Agent Conversational UI |
|
|
1538
|
+
| `applicantLink` | `string\|null` | Applicant Conversational UI |
|
|
1539
|
+
| `eAppAgentLink` | `string\|null` | Agent E-App |
|
|
1002
1540
|
|
|
1003
|
-
|
|
1004
|
-
| ------------- | ------------------ | -------- | ----------- |
|
|
1005
|
-
| `faceAmount` | `number | null` | Yes |
|
|
1006
|
-
| `gender` | `Gender` | Yes | |
|
|
1007
|
-
| `stateCode` | `string | null` | Yes |
|
|
1008
|
-
| `age` | `number | null` | Yes* |
|
|
1009
|
-
| `dateOfBirth` | `string | null` | Yes* |
|
|
1010
|
-
| `paymentFreq` | `PaymentFrequency` | Yes | |
|
|
1011
|
-
| `isSmoker` | `boolean | null` | Yes |
|
|
1012
|
-
| `firstName` | `string | null` | No |
|
|
1013
|
-
| `lastName` | `string | null` | No |
|
|
1014
|
-
| `email` | `string | null` | No |
|
|
1015
|
-
| `phoneNum` | `string | null` | No |
|
|
1541
|
+
> After a non-declined response, direct the agent or applicant to the appropriate link. All remaining steps (underwriting, payment, signing) complete inside the InstaBrain frontend.
|
|
1016
1542
|
|
|
1017
1543
|
|
|
1018
|
-
|
|
1544
|
+
***
|
|
1019
1545
|
|
|
1546
|
+
### Example
|
|
1020
1547
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
| `email` | `string | null` | No |
|
|
1027
|
-
| `phoneNumber` | `string | null` | No |
|
|
1028
|
-
| `isUsCitizen` | `boolean | null` | Yes |
|
|
1029
|
-
| `isPayerAlsoOwnerAndInsured` | `boolean | null` | Yes |
|
|
1030
|
-
| `isLegalUsResident` | `boolean | null` | No |
|
|
1031
|
-
| `address` | `GigdbAddress` | Yes | See sub-fields below |
|
|
1032
|
-
| `dateOfBirth` | `string | null` | Yes |
|
|
1033
|
-
| `socialSecurityNumber` | `string | null` | Yes |
|
|
1034
|
-
| `birthJurisdiction` | `GigdbBirthJurisdiction` | Yes | See sub-fields below |
|
|
1035
|
-
| `isSmoker` | `boolean | null` | Yes |
|
|
1036
|
-
| `nicotineInfo` | `GigdbNicotineInfo | null` | No |
|
|
1037
|
-
| `hasExistingCoverage` | `boolean | null` | Yes |
|
|
1038
|
-
| `willOtherCoverageBeReplacedOrFinanced` | `boolean | null` | No |
|
|
1039
|
-
| `existingCoverageData` | `GigdbExistingCoverageData | null` | No |
|
|
1040
|
-
| `willOtherCoverageBeReplacedOrFinancedData` | `GigdbWillOtherCoverageBeReplacedOrFinancedData | null` | No | Required when `address.state` is `"KS"` or `"WA"` AND `willOtherCoverageBeReplacedOrFinanced === true` |
|
|
1041
|
-
| `beneficiaryDetails` | `BeneficiaryDetails` | Yes | See [Beneficiary Reference](#beneficiary-reference) |
|
|
1548
|
+
```typescript
|
|
1549
|
+
import {
|
|
1550
|
+
BeneficiaryType, BeneficiaryRelationship,
|
|
1551
|
+
TobaccoNicotineLastUsedPeriod, TobaccoNicotineProductType
|
|
1552
|
+
} from '@instabrain-sdks/api-client';
|
|
1042
1553
|
|
|
1554
|
+
const appResp = await client.startIBTermApplication({
|
|
1555
|
+
quoteResponseId,
|
|
1556
|
+
firstName: 'John', lastName: 'Smith',
|
|
1557
|
+
email: 'john.smith@example.com', phoneNumber: '5559876543',
|
|
1558
|
+
isUsCitizenOrIsPermanentResident: true,
|
|
1559
|
+
isPayerAlsoOwnerAndInsured: true,
|
|
1560
|
+
height: { feet: 5, inches: 10 },
|
|
1561
|
+
weight: 175,
|
|
1562
|
+
isHoldingValidDriverLicense: true,
|
|
1563
|
+
areListedConditionsNotApplicable: true,
|
|
1564
|
+
tobaccoNicotineUsage: {
|
|
1565
|
+
lastUsedPeriod: TobaccoNicotineLastUsedPeriod.Never,
|
|
1566
|
+
lastTimeUsed: null,
|
|
1567
|
+
productTypesUsed: null
|
|
1568
|
+
},
|
|
1569
|
+
beneficiaryDetails: {
|
|
1570
|
+
beneficiaryType: BeneficiaryType.Person,
|
|
1571
|
+
beneficiaryPerson: { firstName: 'Mary', lastName: 'Smith', relationship: BeneficiaryRelationship.Spouse }
|
|
1572
|
+
}
|
|
1573
|
+
});
|
|
1043
1574
|
|
|
1044
|
-
|
|
1575
|
+
if (appResp.isDeclined) {
|
|
1576
|
+
return;
|
|
1577
|
+
}
|
|
1578
|
+
if (appResp.isQuoteChanged) {
|
|
1579
|
+
// Re-present updated premium before directing to link
|
|
1580
|
+
}
|
|
1581
|
+
// Hand off to InstaBrain frontend
|
|
1582
|
+
console.log('Applicant link:', appResp.applicantLink);
|
|
1583
|
+
```
|
|
1045
1584
|
|
|
1585
|
+
---
|
|
1046
1586
|
|
|
1047
|
-
|
|
1048
|
-
| -------------- | ------- |
|
|
1049
|
-
| `addressLine1` | `string |
|
|
1050
|
-
| `city` | `string |
|
|
1051
|
-
| `state` | `string |
|
|
1052
|
-
| `zipcode` | `string |
|
|
1587
|
+
## IB Term — Get Existing Quote
|
|
1053
1588
|
|
|
1589
|
+
**Method:** `client.getExistingIBTermQuote(opportunityId)`
|
|
1054
1590
|
|
|
1055
|
-
`**GigdbBirthJurisdiction`:**
|
|
1056
1591
|
|
|
1592
|
+
**When to call:** Resuming a prior session — re-fetch a previously generated IB Term quote.
|
|
1057
1593
|
|
|
1058
|
-
| Field | Type | Description |
|
|
1059
|
-
| --------- | ------- | ----------- |
|
|
1060
|
-
| `state` | `string | null` |
|
|
1061
|
-
| `country` | `string | null` |
|
|
1062
1594
|
|
|
1595
|
+
***
|
|
1063
1596
|
|
|
1064
|
-
|
|
1597
|
+
### Request Parameters
|
|
1065
1598
|
|
|
1599
|
+
| Parameter | Type | Required |
|
|
1600
|
+
|---|---|---|
|
|
1601
|
+
| `opportunityId` | `string` | Yes |
|
|
1066
1602
|
|
|
1067
|
-
| Field | Type | Required | Notes |
|
|
1068
|
-
| --------------------------------------- | ---------------------------- | -------- | ----- |
|
|
1069
|
-
| `isExistingPolicyBeingTerminated` | `boolean | null` | No |
|
|
1070
|
-
| `existingCoverages` | `GigdbExistingCoverageInfo[] | null` | Yes (when `hasExistingCoverage === true`) |
|
|
1071
|
-
| `areExistingPoliciesIssuedByFidelity` | `boolean | null` | No | Required when `address.state` is `"RI"` or `"WV"` |
|
|
1072
1603
|
|
|
1604
|
+
***
|
|
1073
1605
|
|
|
1074
|
-
|
|
1606
|
+
### Error Codes
|
|
1075
1607
|
|
|
1608
|
+
| Code | When |
|
|
1609
|
+
|---|---|
|
|
1610
|
+
| `InvalidRequestFormat` | `OpportunityId is required.` / `OpportunityId does not exist.` / `OpportunityId does not match selected product.` |
|
|
1076
1611
|
|
|
1077
|
-
|
|
1078
|
-
| --------------------------------- | ---------------- | -------- | ----- |
|
|
1079
|
-
| `nameOfTheCompany` | `string | null` | Yes | |
|
|
1080
|
-
| `insuranceAmount` | `string | null` | Yes | |
|
|
1081
|
-
| `dateOfIssue` | `string | null` | Yes | `YYYY-MM` |
|
|
1082
|
-
| `toBeReplaced` | `boolean | null` | Yes | |
|
|
1083
|
-
| `toBeFinanced` | `boolean | null` | Yes | |
|
|
1084
|
-
| `requestsYieldIndices` | `boolean | null` | No | Required when `address.state === "MA"` (per-coverage Q-08) |
|
|
1085
|
-
| `notifyPresentInsurer` | `boolean | null` | No | Required when `address.state === "OK"` (per-coverage Q-08) |
|
|
1086
|
-
| `wantsPolicySummary` | `boolean | null` | No | Required when `address.state` is `"DE"` or `"GA"` (per-coverage Q-08) |
|
|
1087
|
-
| `wantsComparativeInformationForm` | `boolean | null` | No | Required when `address.state === "FL"` (per-coverage Q-08) |
|
|
1612
|
+
> Throws `AuthenticationError` when the opportunity ID is not found or not in scope for your token.
|
|
1088
1613
|
|
|
1089
1614
|
|
|
1090
|
-
|
|
1615
|
+
***
|
|
1091
1616
|
|
|
1617
|
+
### Response
|
|
1092
1618
|
|
|
1093
|
-
|
|
1094
|
-
| -------------------------------------- | ------------------------------------- | -------- | ----- |
|
|
1095
|
-
| `areReplacedPoliciesIssuedByFidelity` | `boolean | null` | No | Required when `address.state === "KS"` AND `willOtherCoverageBeReplacedOrFinanced === true` |
|
|
1096
|
-
| `otherInsuranceReplacementData` | `GigdbOtherInsuranceReplacementData | null` | No | Required when `address.state === "WA"` AND `willOtherCoverageBeReplacedOrFinanced === true` |
|
|
1619
|
+
Same shape as Get Quote response, including `premiumSaveWhenSelectingAnnual`, `maxQuoteAmount`, `minQuoteAmount`, and `selectedRiders[n].riderQuoteAmount`.
|
|
1097
1620
|
|
|
1098
1621
|
|
|
1099
|
-
|
|
1622
|
+
***
|
|
1100
1623
|
|
|
1101
|
-
|
|
1624
|
+
### Example
|
|
1102
1625
|
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
| `hasNewPolicyCharges` | `boolean` | Always (WA) | *Are there penalties, set up or surrender charges for the new policy?* |
|
|
1108
|
-
| `specifyNewPolicyCharges` | `string | null` | When `hasNewPolicyCharges === true` | *Please explain, emphasizing any extra cost for early withdrawal.* |
|
|
1109
|
-
| `hasPriorPolicyCharges` | `boolean` | Always (WA) | *Will there be penalties or surrender charges under the existing insurance as a result of the proposed transaction?* |
|
|
1110
|
-
| `specifyPriorPolicyCharges` | `string | null` | When `hasPriorPolicyCharges === true` | *Please explain* |
|
|
1111
|
-
| `hasTaxConsequences` | `boolean` | Always (WA) | *Are there adverse tax consequences from the replacement under current tax law?* |
|
|
1112
|
-
| `specifyTaxConsequences` | `string | null` | When `hasTaxConsequences === true` | *Please explain* |
|
|
1113
|
-
| `hasInterestConsiderations` | `boolean` | Always (WA) | *Are interest earnings a consideration in this replacement?* |
|
|
1114
|
-
| `specifyInterestConsiderations` | `string | null` | When `hasInterestConsiderations === true` | *Please explain what portions of premiums or contributions will produce limited or no earnings. As pertinent, include the need for minimum deposits to enhance earnings, and the reduction of earnings that may result from set up charges, policy fees, and other factors.* |
|
|
1115
|
-
| `hasMinRequirementsBeforeInterest` | `boolean` | Always (WA) | *Are minimum amounts required to be on deposit before excess interest will be paid?* |
|
|
1116
|
-
| `specifyMinRequirementsBeforeInterest` | `string | null` | When `hasMinRequirementsBeforeInterest === true` | *Please explain* |
|
|
1117
|
-
| `hasOtherAdverseEffects` | `boolean` | Always (WA) | *Are there other short or long term effects from the replacement that might be materially adverse?* |
|
|
1118
|
-
| `specifyOtherAdverseEffects` | `string | null` | When `hasOtherAdverseEffects === true` | *Please explain* |
|
|
1626
|
+
```typescript
|
|
1627
|
+
const quoteResp = await client.getExistingIBTermQuote(opportunityId);
|
|
1628
|
+
const { quoteResponseId, quoteAmount } = quoteResp.selectedQuote;
|
|
1629
|
+
```
|
|
1119
1630
|
|
|
1631
|
+
---
|
|
1120
1632
|
|
|
1121
|
-
|
|
1633
|
+
## Shared methods — GIGDB & ADB
|
|
1122
1634
|
|
|
1635
|
+
These methods apply to **GIGDB and ADB only**. IB Term uses the frontend links returned by Start Application.
|
|
1123
1636
|
|
|
1124
|
-
|
|
1125
|
-
| --------------- | ------------------ | -------- | ------------------------------------ |
|
|
1126
|
-
| `opportunityId` | `string` | Yes | UUID from start application response |
|
|
1127
|
-
| `faceAmount` | `number` | Yes | $5,000–$25,000 |
|
|
1128
|
-
| `paymentFreq` | `PaymentFrequency` | Yes | |
|
|
1637
|
+
---
|
|
1129
1638
|
|
|
1639
|
+
## Save EFT Payment
|
|
1130
1640
|
|
|
1131
|
-
|
|
1641
|
+
**Method:** `client.saveEftPayment(request)` · **Type:** `ThirdPartyEftPaymentReq`
|
|
1132
1642
|
|
|
1133
|
-
### `ThirdPartyAdbQuoteRequest`
|
|
1134
1643
|
|
|
1644
|
+
Saves bank account details for premium payment. Call after Start Application, before Prepare Docs. Once saved, quote updates are blocked.
|
|
1135
1645
|
|
|
1136
|
-
| Field | Type | Required | Constraints |
|
|
1137
|
-
| ------------- | ------------------ | -------- | --------------------------------------------------------- |
|
|
1138
|
-
| `faceAmount` | `number` | Yes | |
|
|
1139
|
-
| `gender` | `Gender` | Yes | |
|
|
1140
|
-
| `stateCode` | `string` | Yes | 2-char US state; not MA, NH, AK; CA not yet supported |
|
|
1141
|
-
| `age` | `number` | Yes* | 20–59; required if `dateOfBirth` not provided |
|
|
1142
|
-
| `dateOfBirth` | `string` | Yes* | ISO 8601; required if `age` not provided |
|
|
1143
|
-
| `paymentFreq` | `PaymentFrequency` | Yes | |
|
|
1144
|
-
| `riders` | `AdbRiderType[]` | No | Use `AdbRiderType` enum values; availability varies by state |
|
|
1145
|
-
| `firstName` | `string` | No | Max 35 chars |
|
|
1146
|
-
| `lastName` | `string` | No | Max 35 chars |
|
|
1147
|
-
| `email` | `string` | No | Valid email format |
|
|
1148
|
-
| `phoneNum` | `string` | No | 10-digit local or E.164 (e.g. `+11234567890`) |
|
|
1149
1646
|
|
|
1647
|
+
***
|
|
1150
1648
|
|
|
1151
|
-
###
|
|
1649
|
+
### Request Fields
|
|
1152
1650
|
|
|
1651
|
+
| Field | Type | Required | Validation Error |
|
|
1652
|
+
|---|---|---|---|
|
|
1653
|
+
| `opportunityId` | `string` | Yes | `OpportunityId is required.` |
|
|
1654
|
+
| `accountHolderName` | `string` | Yes | `Account holder name is required.` / `Account holder name must be 100 characters or fewer.` |
|
|
1655
|
+
| `routingNumber` | `string` | Yes | `Routing number is required.` / `Routing number must be 9 digits.` |
|
|
1656
|
+
| `accountNumber` | `string` | Yes | `Account number is required.` / `Account number must be 4 to 17 digits.` |
|
|
1153
1657
|
|
|
1154
|
-
| Field | Type | Required | Constraints |
|
|
1155
|
-
| --------------------------------------- | ------------------------- | -------- | --------------------------------------------------- |
|
|
1156
|
-
| `quoteResponseId` | `string` | Yes | UUID from ADB quote response |
|
|
1157
|
-
| `firstName` | `string` | Yes | Max 35 chars |
|
|
1158
|
-
| `lastName` | `string` | Yes | Max 35 chars |
|
|
1159
|
-
| `email` | `string` | Yes | Valid email format |
|
|
1160
|
-
| `phoneNumber` | `string` | Yes | 10-digit local or E.164 (e.g. `+11234567890`) |
|
|
1161
|
-
| `isUsCitizen` | `boolean` | Yes | |
|
|
1162
|
-
| `isLegalUsResident` | `boolean` | No | Required when `isUsCitizen = false` |
|
|
1163
|
-
| `isPayerAlsoOwnerAndInsured` | `boolean` | Yes | Must be `true`; knockout if `false` |
|
|
1164
|
-
| `address` | `AdbAddress` | Yes | See sub-fields below |
|
|
1165
|
-
| `dateOfBirth` | `string` | Yes | ISO 8601; age must be 20–59 |
|
|
1166
|
-
| `socialSecurityNumber` | `string` | Yes | Format: `XXXXXXXXX` (9 digits, no dashes) |
|
|
1167
|
-
| `hasExistingCoverage` | `boolean` | Yes | |
|
|
1168
|
-
| `willOtherCoverageBeReplacedOrFinanced` | `boolean` | No | Required if `hasExistingCoverage = true` |
|
|
1169
|
-
| `existingCoverageData` | `AdbExistingCoverageData` | No | Required if `hasExistingCoverage = true` |
|
|
1170
|
-
| `occupation` | `string[]` | No | Required when `address.state === "CA"`; values from `getAdbOccupationOptions()` |
|
|
1171
|
-
| `hasMedicalCoverage` | `boolean` | No | Required when `address.state === "DC"` (ACA acknowledgement) |
|
|
1172
|
-
| `understandsBenefits` | `boolean` | No | Required when `address.state === "DC"` (ACA acknowledgement) |
|
|
1173
|
-
| `understandsLimitedBenefits` | `boolean` | No | Required when `address.state === "DC"` (ACA acknowledgement) |
|
|
1174
|
-
| `beneficiaryDetails` | `BeneficiaryDetails` | Yes | See [Beneficiary Reference](#beneficiary-reference) |
|
|
1175
1658
|
|
|
1659
|
+
***
|
|
1176
1660
|
|
|
1177
|
-
|
|
1661
|
+
### Business Rules
|
|
1178
1662
|
|
|
1663
|
+
1. Once EFT payment is saved, quote update calls for the same `opportunityId` are blocked.
|
|
1179
1664
|
|
|
1180
|
-
| Field | Type | Constraints |
|
|
1181
|
-
| -------------- | -------- | ------------------------------------------- |
|
|
1182
|
-
| `addressLine1` | `string` | |
|
|
1183
|
-
| `city` | `string` | |
|
|
1184
|
-
| `state` | `string` | 2-char; must match state used at quote time |
|
|
1185
|
-
| `zipcode` | `string` | 5-digit numeric |
|
|
1186
1665
|
|
|
1666
|
+
***
|
|
1187
1667
|
|
|
1188
|
-
|
|
1668
|
+
### Error Codes
|
|
1189
1669
|
|
|
1670
|
+
| Code | When |
|
|
1671
|
+
|---|---|
|
|
1672
|
+
| `InvalidRequestFormat` | Any field validation failure — inspect `value.fields` |
|
|
1673
|
+
| `PaymentAlreadyMade` | EFT already saved for this opportunity |
|
|
1190
1674
|
|
|
1191
|
-
| Field | Type | Required | Notes |
|
|
1192
|
-
| --------------------------------- | -------------------------- | -------- | ----- |
|
|
1193
|
-
| `isExistingPolicyBeingTerminated` | `boolean` | Yes | |
|
|
1194
|
-
| `existingCoverages` | `AdbExistingCoverageInfo[]`| Yes | At least one entry required when present |
|
|
1195
1675
|
|
|
1676
|
+
***
|
|
1196
1677
|
|
|
1197
|
-
|
|
1678
|
+
### Response
|
|
1198
1679
|
|
|
1680
|
+
`flagStatus: true` with `value: null` on success.
|
|
1199
1681
|
|
|
1200
|
-
| Field | Type | Required | Notes |
|
|
1201
|
-
| --------------------------------- | --------- | -------- | ----- |
|
|
1202
|
-
| `nameOfTheCompany` | `string` | Yes | |
|
|
1203
|
-
| `insuranceAmount` | `string` | Yes | |
|
|
1204
|
-
| `dateOfIssue` | `string` | Yes | `YYYY-MM` |
|
|
1205
|
-
| `toBeReplaced` | `boolean` | Yes | |
|
|
1206
|
-
| `toBeFinanced` | `boolean` | Yes | |
|
|
1207
|
-
| `notifyPresentInsurer` | `boolean` | No | Required when `address.state === "OK"` AND `hasExistingCoverage === true` |
|
|
1208
|
-
| `wantsComparativeInformationForm` | `boolean` | No | Required when `address.state === "FL"` AND `hasExistingCoverage === true` |
|
|
1209
|
-
| `wantsPolicySummary` | `boolean` | No | Required when `address.state === "DE"` AND `hasExistingCoverage === true` |
|
|
1210
1682
|
|
|
1683
|
+
***
|
|
1211
1684
|
|
|
1212
|
-
###
|
|
1685
|
+
### Example
|
|
1213
1686
|
|
|
1687
|
+
```typescript
|
|
1688
|
+
await client.saveEftPayment({
|
|
1689
|
+
opportunityId,
|
|
1690
|
+
accountHolderName: 'Jane Doe',
|
|
1691
|
+
routingNumber: '021000021',
|
|
1692
|
+
accountNumber: '123456789012'
|
|
1693
|
+
});
|
|
1694
|
+
// After this point, quote updates are blocked
|
|
1695
|
+
```
|
|
1214
1696
|
|
|
1215
|
-
|
|
1216
|
-
| ------------------- | -------- | -------- | ------------------------------------ |
|
|
1217
|
-
| `opportunityId` | `string` | Yes | UUID from start application response |
|
|
1218
|
-
| `accountHolderName` | `string | null` | Yes |
|
|
1219
|
-
| `routingNumber` | `string | null` | Yes |
|
|
1220
|
-
| `accountNumber` | `string | null` | Yes |
|
|
1697
|
+
---
|
|
1221
1698
|
|
|
1699
|
+
## Prepare Docs & Get Delivery Channels
|
|
1222
1700
|
|
|
1223
|
-
|
|
1701
|
+
**Method:** `client.prepareDocsAndGetDeliveryChannels(opportunityId)`
|
|
1224
1702
|
|
|
1225
|
-
### `IBTermStartApplicationReq`
|
|
1226
1703
|
|
|
1704
|
+
Always call this first in the signing flow. Prepares e-signature documents server-side and returns available delivery channels.
|
|
1227
1705
|
|
|
1228
|
-
| Field | Type | Required | Constraints |
|
|
1229
|
-
| --- | --- | --- | --- |
|
|
1230
|
-
| `quoteResponseId` | `string` | Yes | UUID from IB Term quote response |
|
|
1231
|
-
| `firstName` | `string` | Yes | Alphabetic only |
|
|
1232
|
-
| `lastName` | `string` | Yes | Alphabetic only |
|
|
1233
|
-
| `email` | `string` | Yes | Valid email format |
|
|
1234
|
-
| `phoneNumber` | `string` | Yes | 10-digit local or E.164 (e.g. `+11234567890`) |
|
|
1235
|
-
| `isUsCitizenOrIsPermanentResident` | `boolean` | Yes | Single combined field (IB Term variant) |
|
|
1236
|
-
| `isPayerAlsoOwnerAndInsured` | `boolean` | Yes | Must be `true`; knockout otherwise |
|
|
1237
|
-
| `dateOfBirth` | `string` | Yes | ISO date; age 18–60 |
|
|
1238
|
-
| `socialSecurityNumber` | `string` | Yes | `XXXXXXXXX` or `XXX-XX-XXXX` |
|
|
1239
|
-
| `address` | `IBTermAddress` | Yes | See sub-fields below |
|
|
1240
|
-
| `birthJurisdiction` | `IBTermBirthJurisdiction` | Yes | See sub-fields below |
|
|
1241
|
-
| `height` | `IBTermHeight` | Yes | See sub-fields below |
|
|
1242
|
-
| `weight` | `number` | Yes | Must be > 0 |
|
|
1243
|
-
| `isHoldingValidDriverLicense` | `boolean` | Yes | |
|
|
1244
|
-
| `driverLicenseState` | `string | null` | Yes (nullable) | 2-letter US state. Non-null when `isHoldingValidDriverLicense === true`; `null` when `false`. BE field: `DriverLicenseState` (top-level flat). |
|
|
1245
|
-
| `driverLicenseNumber` | `string | null` | Yes (nullable) | Non-null when `isHoldingValidDriverLicense === true`; `null` when `false`. BE field: `DriverLicenseNumber` (top-level flat). |
|
|
1246
|
-
| `hasPrimaryCarePhysician` | `boolean` | Yes | |
|
|
1247
|
-
| `physicianDetails` | `IBTermPhysicianDetails | null` | No |
|
|
1248
|
-
| `tobaccoNicotineUsage` | `IBTermTobaccoNicotineUsage` | Yes | Structured object — see sub-fields |
|
|
1249
|
-
| `areListedConditionsNotApplicable` | `boolean` | Yes | Required acknowledgement. `false` → knockout (declined) |
|
|
1250
|
-
| `hasExistingCoverage` | `boolean` | Yes | |
|
|
1251
|
-
| `willOtherCoverageBeReplacedOrFinanced` | `boolean` | No | Required when `hasExistingCoverage = true` |
|
|
1252
|
-
| `existingCoverageData` | `IBTermExistingCoverageData` | No | Required when `hasExistingCoverage = true` |
|
|
1253
|
-
| `willOtherCoverageBeReplacedOrFinancedData` | `IBTermWillOtherCoverageBeReplacedOrFinancedData` | No | Required when `address.state` is `"KS"` or `"WA"` AND `willOtherCoverageBeReplacedOrFinanced === true` |
|
|
1254
|
-
| `beneficiaryDetails` | `BeneficiaryDetails` | Yes | Restricted to Person / Trust / Insured Estate / All-children-of-insured-equally / All-children-of-marriage-equally |
|
|
1255
|
-
| `childRiderInfo` | `IBTermChildRiderInfo` | No | Required when Dependent Child Rider was selected on the quote |
|
|
1256
1706
|
|
|
1707
|
+
***
|
|
1257
1708
|
|
|
1258
|
-
|
|
1709
|
+
### Request Parameters
|
|
1259
1710
|
|
|
1711
|
+
| Parameter | Type | Required |
|
|
1712
|
+
|---|---|---|
|
|
1713
|
+
| `opportunityId` | `string` | Yes |
|
|
1260
1714
|
|
|
1261
|
-
| Field | Type | Constraints |
|
|
1262
|
-
| -------------- | -------- | ------------------------------------------- |
|
|
1263
|
-
| `addressLine1` | `string` | Avoid special characters |
|
|
1264
|
-
| `city` | `string` | Letters and spaces only |
|
|
1265
|
-
| `state` | `string` | 2-char; must match state used at quote time |
|
|
1266
|
-
| `zipcode` | `string` | 5-digit numeric |
|
|
1267
1715
|
|
|
1716
|
+
***
|
|
1268
1717
|
|
|
1269
|
-
|
|
1718
|
+
### Business Rules
|
|
1270
1719
|
|
|
1720
|
+
1. If `isSignCompleted = true`, documents are already signed — skip Send PIN, Resend PIN, and Verify PIN. Call Final Submit directly.
|
|
1271
1721
|
|
|
1272
|
-
| Field | Type | Required | Notes |
|
|
1273
|
-
| --------- | -------- | -------- | --------------------------------------------- |
|
|
1274
|
-
| `country` | `string` | Yes | ISO country code (e.g. `"US"`) |
|
|
1275
|
-
| `state` | `string` | No | 2-letter US state; required when `country === "US"` |
|
|
1276
1722
|
|
|
1723
|
+
***
|
|
1277
1724
|
|
|
1278
|
-
|
|
1725
|
+
### Error Codes
|
|
1279
1726
|
|
|
1727
|
+
| Code | When |
|
|
1728
|
+
|---|---|
|
|
1729
|
+
| `InvalidRequestFormat` | `OpportunityId is required.` / `OpportunityId does not exist.` / `Documents are already signed.` (field-level) |
|
|
1730
|
+
| `DocumentsAlreadySigned` | Documents already completed for this opportunity |
|
|
1731
|
+
| `SecureSignRelatedError` | Generic SecureSign failure during document preparation — retry; if persistent, contact support |
|
|
1280
1732
|
|
|
1281
|
-
|
|
1282
|
-
| -------- | -------- | ---------------- |
|
|
1283
|
-
| `feet` | `number` | 1–8 inclusive |
|
|
1284
|
-
| `inches` | `number` | 0–11 inclusive |
|
|
1733
|
+
> When signing is already complete, you may see `DocumentsAlreadySigned` or the `InvalidRequestFormat` field message `"Documents are already signed."` — both are terminal; do not retry Prepare Docs / Send PIN.
|
|
1285
1734
|
|
|
1286
1735
|
|
|
1287
|
-
|
|
1736
|
+
***
|
|
1288
1737
|
|
|
1738
|
+
### Response
|
|
1289
1739
|
|
|
1290
|
-
| Field
|
|
1291
|
-
|
|
1292
|
-
| `
|
|
1293
|
-
| `
|
|
1294
|
-
| `
|
|
1295
|
-
| `lastSeen` | `string` | `YYYY-MM`, must be in the past |
|
|
1740
|
+
| Field | Type | Description |
|
|
1741
|
+
|---|---|---|
|
|
1742
|
+
| `isSignCompleted` | `boolean` | `true` → skip PIN flow; go to Final Submit |
|
|
1743
|
+
| `isSmsAvailable` | `boolean` | SMS delivery available for this applicant |
|
|
1744
|
+
| `isEmailAvailable` | `boolean` | Email delivery available for this applicant |
|
|
1296
1745
|
|
|
1297
1746
|
|
|
1298
|
-
|
|
1747
|
+
***
|
|
1299
1748
|
|
|
1749
|
+
### Example
|
|
1300
1750
|
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
| `lastUsedPeriod` | `TobaccoNicotineLastUsedPeriod` | Yes | Use enum values |
|
|
1304
|
-
| `lastTimeUsed` | `string | null` | Yes (nullable) | `YYYY-MM`. **Must be `null`** when `lastUsedPeriod === Never` (`'never used'`); non-null otherwise. |
|
|
1305
|
-
| `productTypesUsed` | `TobaccoNicotineProductType[] | null` | Yes (nullable) | **Must be `null`** when `lastUsedPeriod === Never`; non-null with ≥1 entry otherwise. BE field: `TobaccoNicotineUsage.ProductTypesUsed` |
|
|
1306
|
-
| `cigarUsagePerYear` | `number` | No | 1–999; required when `productTypesUsed` includes `Cigars` |
|
|
1751
|
+
```typescript
|
|
1752
|
+
const prepResp = await client.prepareDocsAndGetDeliveryChannels(opportunityId);
|
|
1307
1753
|
|
|
1754
|
+
if (prepResp.isSignCompleted) {
|
|
1755
|
+
// Documents already signed — skip directly to final submit
|
|
1756
|
+
} else {
|
|
1757
|
+
// Proceed to send PIN using an available channel
|
|
1758
|
+
const useSms = prepResp.isSmsAvailable;
|
|
1759
|
+
}
|
|
1760
|
+
```
|
|
1308
1761
|
|
|
1309
|
-
|
|
1762
|
+
---
|
|
1310
1763
|
|
|
1764
|
+
## Send PIN & Get Documents Link
|
|
1311
1765
|
|
|
1312
|
-
|
|
1313
|
-
| ------------------------------------- | --------------------------------- | -------- | ----- |
|
|
1314
|
-
| `isExistingPolicyBeingTerminated` | `boolean` | Yes | |
|
|
1315
|
-
| `existingCoverages` | `IBTermExistingCoverageInfo[]` | Yes | At least one entry when present |
|
|
1316
|
-
| `areExistingPoliciesIssuedByFidelity` | `boolean` | No | Required when `address.state` is `"RI"` or `"WV"` |
|
|
1766
|
+
**Method:** `client.sendPinAndGetDocumentsLink(request)` · **Type:** `ThirdPartySendPinReq`
|
|
1317
1767
|
|
|
1318
1768
|
|
|
1319
|
-
|
|
1769
|
+
Sends a signing PIN to the applicant and returns the document URL plus the consent script to read aloud.
|
|
1320
1770
|
|
|
1321
1771
|
|
|
1322
|
-
|
|
1323
|
-
| --------------------------------- | --------- | -------- | ----- |
|
|
1324
|
-
| `nameOfTheCompany` | `string` | Yes | |
|
|
1325
|
-
| `insuranceAmount` | `string` | Yes | |
|
|
1326
|
-
| `dateOfIssue` | `string` | Yes | `YYYY-MM` |
|
|
1327
|
-
| `toBeReplaced` | `boolean` | Yes | |
|
|
1328
|
-
| `toBeFinanced` | `boolean` | Yes | |
|
|
1329
|
-
| `requestsYieldIndices` | `boolean` | No | Required when `address.state === "MA"` |
|
|
1330
|
-
| `notifyPresentInsurer` | `boolean` | No | Required when `address.state === "OK"` |
|
|
1331
|
-
| `wantsPolicySummary` | `boolean` | No | Required when `address.state` is `"DE"` or `"GA"` |
|
|
1332
|
-
| `wantsComparativeInformationForm` | `boolean` | No | Required when `address.state === "FL"` |
|
|
1772
|
+
***
|
|
1333
1773
|
|
|
1774
|
+
### Request Fields
|
|
1334
1775
|
|
|
1335
|
-
|
|
1776
|
+
| Field | Type | Required | Description | Validation Error |
|
|
1777
|
+
|---|---|---|---|---|
|
|
1778
|
+
| `opportunityId` | `string` | Yes | | `OpportunityId is required.` / `OpportunityId does not exist.` / `Documents are already signed.` |
|
|
1779
|
+
| `flagSendSms` | `boolean` | Yes | `true` to send via SMS | `FlagSendSms is required.` |
|
|
1780
|
+
| `flagSendEmail` | `boolean` | Yes | `true` to send via email | `FlagSendEmail is required.` |
|
|
1336
1781
|
|
|
1782
|
+
> **Exactly one** of `flagSendSms` / `flagSendEmail` must be `true`.
|
|
1783
|
+
> Both `null` → `"At least one delivery channel (SMS or Email) must be selected."` (on both fields).
|
|
1784
|
+
> Both `true` → `"Only one delivery channel can be selected at a time."` (on both fields).
|
|
1337
1785
|
|
|
1338
|
-
| Field | Type | Required | Notes |
|
|
1339
|
-
| -------------------------------------- | ------------------------------------- | -------- | ----- |
|
|
1340
|
-
| `areReplacedPoliciesIssuedByFidelity` | `boolean` | No | Required when `address.state === "KS"` AND `willOtherCoverageBeReplacedOrFinanced === true` |
|
|
1341
|
-
| `otherInsuranceReplacementData` | `IBTermOtherInsuranceReplacementData` | No | Required when `address.state === "WA"` AND `willOtherCoverageBeReplacedOrFinanced === true` |
|
|
1342
1786
|
|
|
1787
|
+
***
|
|
1343
1788
|
|
|
1344
|
-
|
|
1789
|
+
### Business Rules
|
|
1345
1790
|
|
|
1346
|
-
|
|
1791
|
+
1. Read each item in the `script` array aloud to the applicant before they sign.
|
|
1792
|
+
2. Give the applicant the `link` URL to review and sign documents.
|
|
1347
1793
|
|
|
1348
|
-
| Field | Type | Notes |
|
|
1349
|
-
| -------------------------------------- | -------- | ----- |
|
|
1350
|
-
| `mayReduceBenefitsIncreasePremiums` | `boolean` | Always required |
|
|
1351
|
-
| `specifyReduceBenefitsIncreasePremiums`| `string` | Required when `mayReduceBenefitsIncreasePremiums === true` |
|
|
1352
|
-
| `hasNewPolicyCharges` | `boolean` | Always required |
|
|
1353
|
-
| `specifyNewPolicyCharges` | `string` | Required when `hasNewPolicyCharges === true` |
|
|
1354
|
-
| `hasPriorPolicyCharges` | `boolean` | Always required |
|
|
1355
|
-
| `specifyPriorPolicyCharges` | `string` | Required when `hasPriorPolicyCharges === true` |
|
|
1356
|
-
| `hasTaxConsequences` | `boolean` | Always required |
|
|
1357
|
-
| `specifyTaxConsequences` | `string` | Required when `hasTaxConsequences === true` |
|
|
1358
|
-
| `hasInterestConsiderations` | `boolean` | Always required |
|
|
1359
|
-
| `specifyInterestConsiderations` | `string` | Required when `hasInterestConsiderations === true` |
|
|
1360
|
-
| `hasMinRequirementsBeforeInterest` | `boolean` | Always required |
|
|
1361
|
-
| `specifyMinRequirementsBeforeInterest` | `string` | Required when `hasMinRequirementsBeforeInterest === true` |
|
|
1362
|
-
| `hasOtherAdverseEffects` | `boolean` | Always required |
|
|
1363
|
-
| `specifyOtherAdverseEffects` | `string` | Required when `hasOtherAdverseEffects === true` |
|
|
1364
1794
|
|
|
1795
|
+
***
|
|
1365
1796
|
|
|
1366
|
-
|
|
1797
|
+
### Error Codes
|
|
1367
1798
|
|
|
1799
|
+
| Code | When |
|
|
1800
|
+
|---|---|
|
|
1801
|
+
| `InvalidRequestFormat` | Any field validation failure including channel rules |
|
|
1802
|
+
| `SigningPackageNotCreated` | Signing package not yet created — call Prepare Docs first |
|
|
1803
|
+
| `SecureSignRelatedError` | Generic SecureSign failure — retry; if persistent, contact support |
|
|
1804
|
+
| `PinExpired` | PIN validity window exceeded — call Resend PIN |
|
|
1805
|
+
| `DocumentsAlreadySigned` | Documents already completed |
|
|
1806
|
+
| `InvalidPhoneNumber` | Phone number on application is invalid for SMS delivery — check applicant phone number |
|
|
1807
|
+
| `EmailDeliveryFailed` | Email delivery failed — retry with Resend PIN or switch to SMS |
|
|
1808
|
+
| `MessageNotDelivered` | SMS delivery failed — retry with Resend PIN or switch to email |
|
|
1368
1809
|
|
|
1369
|
-
| Field | Type | Required | Notes |
|
|
1370
|
-
| ------------------------------------------- | --------------------------------- | -------- | ----- |
|
|
1371
|
-
| `hasExistingCoverageForChildren` | `boolean` | Yes | |
|
|
1372
|
-
| `isAnyChildTakingMedication` | `boolean` | Yes | Knockout when `true` |
|
|
1373
|
-
| `isAnyChildDiagnosedWithDisability` | `boolean` | Yes | Knockout when `true` |
|
|
1374
|
-
| `isAnyChildDiagnosedWithSevereCondition` | `boolean` | Yes | Knockout when `true` |
|
|
1375
|
-
| `isAnyChildAdvisedForSurgery` | `boolean` | Yes | Knockout when `true` |
|
|
1376
|
-
| `childrenToBeInsuredDetails` | `IBTermChildToBeInsured[]` | Yes | 1–10 entries |
|
|
1377
|
-
| `existingCoverageInfoForChildren` | `IBTermChildExistingCoverage[]` | No | Required when `hasExistingCoverageForChildren === true`; max 10 entries; total non-replaced coverage ≤ $100,000 |
|
|
1378
1810
|
|
|
1811
|
+
***
|
|
1379
1812
|
|
|
1380
|
-
|
|
1813
|
+
### Response
|
|
1381
1814
|
|
|
1815
|
+
| Field | Type | Description |
|
|
1816
|
+
|---|---|---|
|
|
1817
|
+
| `link` | `string\|null` | URL for applicant to review and sign documents |
|
|
1818
|
+
| `scriptHeader` | `string\|null` | Header for the consent script |
|
|
1819
|
+
| `script` | `string[]\|null` | Lines to read aloud to the applicant |
|
|
1820
|
+
| `consentMessage` | `string\|null` | Consent confirmation message |
|
|
1382
1821
|
|
|
1383
|
-
| Field | Type | Constraints |
|
|
1384
|
-
| ------------- | --------------- | --------------------------------------------------- |
|
|
1385
|
-
| `firstName` | `string` | Alphabetic only |
|
|
1386
|
-
| `lastName` | `string` | Alphabetic only |
|
|
1387
|
-
| `gender` | `Gender` | Use enum |
|
|
1388
|
-
| `dob` | `string` | ISO date; 15 days – under 18 years old. BE field name: `DOB` (serializes as `dob`) |
|
|
1389
|
-
| `height` | `IBTermHeight` | Child: feet 0–8, inches 0–11 |
|
|
1390
|
-
| `weight` | `number` | > 0 |
|
|
1391
|
-
| `relation` | `string` | Free-form (e.g. "Daughter", "Son", "Stepchild"). BE field name: `Relation` (serializes as `relation`) |
|
|
1392
1822
|
|
|
1823
|
+
***
|
|
1393
1824
|
|
|
1394
|
-
|
|
1825
|
+
### Example
|
|
1395
1826
|
|
|
1827
|
+
```typescript
|
|
1828
|
+
const pinResp = await client.sendPinAndGetDocumentsLink({
|
|
1829
|
+
opportunityId,
|
|
1830
|
+
flagSendSms: true,
|
|
1831
|
+
flagSendEmail: false
|
|
1832
|
+
});
|
|
1396
1833
|
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
| `toBeReplaced` | `boolean` | Whether this child policy is being replaced |
|
|
1404
|
-
| `toBeFinanced` | `boolean` | Whether premiums on the new policy will be financed from this existing child policy |
|
|
1834
|
+
// Read each line of pinResp.script aloud to the applicant
|
|
1835
|
+
for (const line of pinResp.script ?? []) {
|
|
1836
|
+
console.log(line);
|
|
1837
|
+
}
|
|
1838
|
+
// Share pinResp.link with the applicant to review and sign
|
|
1839
|
+
```
|
|
1405
1840
|
|
|
1841
|
+
---
|
|
1406
1842
|
|
|
1407
|
-
|
|
1843
|
+
## Resend PIN
|
|
1408
1844
|
|
|
1845
|
+
**Method:** `client.resendPin(request)` · **Type:** `ThirdPartyResendPinReq`
|
|
1409
1846
|
|
|
1410
|
-
| Field | Type | Notes |
|
|
1411
|
-
| ---------------------------------- | ---------------- | ----- |
|
|
1412
|
-
| `flagProductNotAvailableForState` | `boolean` | `true` → IB Term not available for this state/age/nicotine combo |
|
|
1413
|
-
| `riders` | `IBTermRider[]` | Empty when product is not available |
|
|
1414
1847
|
|
|
1848
|
+
Resends the signing PIN. Use when the applicant did not receive the PIN. Same channel rules as Send PIN.
|
|
1415
1849
|
|
|
1416
|
-
`**IBTermRider`:**
|
|
1417
1850
|
|
|
1851
|
+
***
|
|
1418
1852
|
|
|
1419
|
-
|
|
1420
|
-
| ----------------- | -------- | ----- |
|
|
1421
|
-
| `riderCode` | `string` | Pass into `ThirdPartyQuoteReq.riders[n].rider` on the quote |
|
|
1422
|
-
| `riderTitle` | `string` | Display title |
|
|
1423
|
-
| `riderDescription`| `string` | Display description |
|
|
1853
|
+
### Request Fields
|
|
1424
1854
|
|
|
1855
|
+
Same as Send PIN: `opportunityId`, `flagSendSms`, `flagSendEmail`.
|
|
1425
1856
|
|
|
1426
|
-
### `ThirdPartyQuoteReq` (IB Term - Secondary)
|
|
1427
1857
|
|
|
1858
|
+
***
|
|
1428
1859
|
|
|
1429
|
-
|
|
1430
|
-
| ---------------- | ---------------------------------- | -------- | ----------------------------------------------- |
|
|
1431
|
-
| `faceAmount` | `number` | Yes | See age-based limits below. `CoverageNotAvailable` if not offered for state+age |
|
|
1432
|
-
| `benefitPeriod` | `number` | Yes | 10, 20, or 30 (age-dependent - see table below). `BenefitPeriodNotAvailable` if not offered for state+age |
|
|
1433
|
-
| `flagTobaccoUse` | `boolean` | Yes | |
|
|
1434
|
-
| `gender` | `Gender` | Yes | |
|
|
1435
|
-
| `stateCode` | `string | null` | Yes* (one of stateCode / zipCode) |
|
|
1436
|
-
| `zipCode` | `string | null` | Yes* (zipCode wins if both) |
|
|
1437
|
-
| `rateClass` | `RateClass | null` | Yes† (one of rateClass / healthClass / height+weight) |
|
|
1438
|
-
| `healthClass` | `HealthClass | null` | Yes† (rating OR-group) |
|
|
1439
|
-
| `height` | `{ feet, inches } | null` | Yes† — optional; required only with `weightInLbs` (height+weight rating path) |
|
|
1440
|
-
| `weightInLbs` | `number | null` | Yes† (paired with `height`) |
|
|
1441
|
-
| `age` | `number | null` | Yes‡ (one of age / dateOfBirth; resolved 18–60) |
|
|
1442
|
-
| `dateOfBirth` | `string | null` | Yes‡ (dateOfBirth wins if both) |
|
|
1443
|
-
| `riders` | `ThirdPartyQuoteReqRider[] | null` | No |
|
|
1444
|
-
| `paymentFreq` | `PaymentFrequency` | Yes | |
|
|
1445
|
-
| `firstName` | `string | null` | No |
|
|
1446
|
-
| `lastName` | `string | null` | No |
|
|
1447
|
-
| `email` | `string | null` | No |
|
|
1448
|
-
| `phoneNum` | `string | null` | No |
|
|
1860
|
+
### Error Codes
|
|
1449
1861
|
|
|
1450
|
-
|
|
1862
|
+
Same error codes as Send PIN.
|
|
1451
1863
|
|
|
1452
1864
|
|
|
1453
|
-
|
|
1865
|
+
***
|
|
1454
1866
|
|
|
1867
|
+
### Response
|
|
1868
|
+
|
|
1869
|
+
| Field | Type | Description |
|
|
1870
|
+
|---|---|---|
|
|
1871
|
+
| `flagPinSent` | `boolean` | `true` when PIN successfully resent |
|
|
1455
1872
|
|
|
1456
|
-
| Age | Min | Max |
|
|
1457
|
-
| -------- | ------- | ---------- |
|
|
1458
|
-
| Up to 55 | $50,000 | $1,000,000 |
|
|
1459
|
-
| 56 | $50,000 | $900,000 |
|
|
1460
|
-
| 57 | $50,000 | $800,000 |
|
|
1461
|
-
| 58 | $50,000 | $700,000 |
|
|
1462
|
-
| 59 | $50,000 | $600,000 |
|
|
1463
|
-
| 60 | $50,000 | $500,000 |
|
|
1464
1873
|
|
|
1874
|
+
***
|
|
1465
1875
|
|
|
1466
|
-
|
|
1876
|
+
### Example
|
|
1467
1877
|
|
|
1878
|
+
```typescript
|
|
1879
|
+
const resendResp = await client.resendPin({
|
|
1880
|
+
opportunityId,
|
|
1881
|
+
flagSendSms: false,
|
|
1882
|
+
flagSendEmail: true // switch channel if SMS wasn't received
|
|
1883
|
+
});
|
|
1884
|
+
```
|
|
1468
1885
|
|
|
1469
|
-
|
|
1470
|
-
| -------- | ----------- | ----------------- |
|
|
1471
|
-
| Up to 45 | Any | 10, 20, 30 |
|
|
1472
|
-
| 45–50 | Non-tobacco | 10, 20, 30 |
|
|
1473
|
-
| 45–50 | Tobacco | 10, 20 |
|
|
1474
|
-
| 51–60 | Any | 10, 20 |
|
|
1886
|
+
---
|
|
1475
1887
|
|
|
1888
|
+
## Verify PIN
|
|
1476
1889
|
|
|
1477
|
-
|
|
1890
|
+
**Method:** `client.verifyPin(request)` · **Type:** `ThirdPartyVerifyPinReq`
|
|
1478
1891
|
|
|
1479
1892
|
|
|
1480
|
-
|
|
1481
|
-
| --------------- | --------- | -------- | --------------------------------------------------------------- |
|
|
1482
|
-
| `opportunityId` | `string` | Yes | |
|
|
1483
|
-
| `flagSendSms` | `boolean` | Yes | At least one of `flagSendSms` or `flagSendEmail` must be `true` |
|
|
1484
|
-
| `flagSendEmail` | `boolean` | Yes | At least one of `flagSendSms` or `flagSendEmail` must be `true` |
|
|
1893
|
+
Verifies the PIN and confirms the consent script was read aloud.
|
|
1485
1894
|
|
|
1486
1895
|
|
|
1487
|
-
|
|
1896
|
+
***
|
|
1488
1897
|
|
|
1898
|
+
### Request Fields
|
|
1489
1899
|
|
|
1490
|
-
| Field
|
|
1491
|
-
|
|
1492
|
-
| `opportunityId` | `string`
|
|
1493
|
-
| `
|
|
1494
|
-
| `
|
|
1900
|
+
| Field | Type | Required | Description | Validation Error |
|
|
1901
|
+
|---|---|---|---|---|
|
|
1902
|
+
| `opportunityId` | `string` | Yes | | `OpportunityId is required.` / `OpportunityId does not exist.` / `Documents are already signed.` |
|
|
1903
|
+
| `pin` | `string` | Yes | PIN entered by the applicant | `Pin is required.` |
|
|
1904
|
+
| `isScriptReadConfirmed` | `boolean` | Yes | Must be `true` — confirms consent script was read aloud | `IsScriptReadConfirmed is required.` / `IsScriptReadConfirmed must be true.` |
|
|
1495
1905
|
|
|
1496
1906
|
|
|
1497
|
-
|
|
1907
|
+
***
|
|
1498
1908
|
|
|
1909
|
+
### Business Rules
|
|
1499
1910
|
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
| `pin` | `string` | Yes | PIN entered by the signer |
|
|
1504
|
-
| `isScriptReadConfirmed` | `boolean` | Yes | Must be `true`; confirms disclosure was read aloud |
|
|
1911
|
+
1. `isScriptReadConfirmed = false` is rejected — the caller must confirm the script was read before submitting.
|
|
1912
|
+
2. Wrong PIN returns `isVerified: false` on a successful response — the SDK does **not** throw.
|
|
1913
|
+
3. After successful verification, calling Prepare Docs again returns `isSignCompleted: true`.
|
|
1505
1914
|
|
|
1506
1915
|
|
|
1507
|
-
|
|
1916
|
+
***
|
|
1508
1917
|
|
|
1509
|
-
|
|
1918
|
+
### Error Codes
|
|
1510
1919
|
|
|
1511
|
-
|
|
1920
|
+
| Code | When |
|
|
1921
|
+
|---|---|
|
|
1922
|
+
| `InvalidRequestFormat` | Any field validation failure |
|
|
1923
|
+
| `SigningPackageNotCreated` | Signing package missing — call Prepare Docs first |
|
|
1924
|
+
| `SecureSignPinMismatch` | Wrong PIN entered — applicant should re-enter |
|
|
1925
|
+
| `PinExpired` | PIN validity window exceeded — call Resend PIN |
|
|
1926
|
+
| `DocumentsNotViewed` | Applicant has not viewed all documents before PIN verification |
|
|
1927
|
+
| `DocumentsAlreadySigned` | Documents already completed |
|
|
1928
|
+
| `SecureSignRelatedError` | Generic SecureSign failure — retry; if persistent, contact support |
|
|
1512
1929
|
|
|
1513
|
-
All InstaBrain API responses are wrapped in this envelope:
|
|
1514
1930
|
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
```
|
|
1931
|
+
***
|
|
1932
|
+
|
|
1933
|
+
### Response
|
|
1934
|
+
|
|
1935
|
+
| Field | Type | Description |
|
|
1936
|
+
|---|---|---|
|
|
1937
|
+
| `isVerified` | `boolean` | `true` = PIN matched, signing complete · `false` = wrong PIN (successful response, not thrown) |
|
|
1523
1938
|
|
|
1524
|
-
The SDK unwraps this envelope automatically - integrators receive `value` directly. When `flagStatus = false`, the SDK throws `APIValidationError`. You never check `flagStatus` manually.
|
|
1525
1939
|
|
|
1526
|
-
|
|
1940
|
+
***
|
|
1527
1941
|
|
|
1528
|
-
|
|
1942
|
+
### Example
|
|
1529
1943
|
|
|
1530
1944
|
```typescript
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1945
|
+
const verifyResp = await client.verifyPin({
|
|
1946
|
+
opportunityId,
|
|
1947
|
+
pin: '482910',
|
|
1948
|
+
isScriptReadConfirmed: true // confirms script was read aloud
|
|
1949
|
+
});
|
|
1950
|
+
|
|
1951
|
+
if (verifyResp.isVerified) {
|
|
1952
|
+
// Signing complete — proceed to final submit
|
|
1953
|
+
} else {
|
|
1954
|
+
// Wrong PIN — ask applicant to try again or call resendPin()
|
|
1534
1955
|
}
|
|
1535
1956
|
```
|
|
1536
1957
|
|
|
1537
|
-
|
|
1538
|
-
|
|
1958
|
+
---
|
|
1539
1959
|
|
|
1540
|
-
|
|
1541
|
-
| ------------------- | ------------- | -------------------------------------- |
|
|
1542
|
-
| `quoteResponseId` | `string` | UUID - pass to `startXxxApplication()` |
|
|
1543
|
-
| `quoteAmount` | `number | null` |
|
|
1544
|
-
| `faceAmount` | `number` | Coverage amount |
|
|
1545
|
-
| `benefitPeriod` | `number | null` |
|
|
1546
|
-
| `paymentFrequency` | `string | null` |
|
|
1547
|
-
| `isMedicalRequired` | `boolean` | Whether a medical exam is required |
|
|
1548
|
-
| `selectedRiders` | `RidersList[] | null` |
|
|
1960
|
+
## Final Submit
|
|
1549
1961
|
|
|
1962
|
+
**Method:** `client.finalSubmit(opportunityId)`
|
|
1550
1963
|
|
|
1551
|
-
### `ThirdPartyStartAppResp` (GIGDB, IB Term)
|
|
1552
1964
|
|
|
1553
|
-
|
|
1965
|
+
Submits the signed application to the carrier. Can only be called once per opportunity.
|
|
1554
1966
|
|
|
1555
1967
|
|
|
1556
|
-
|
|
1557
|
-
| ---------------- | --------- | --------------------------------------------- |
|
|
1558
|
-
| `opportunityId` | `string` | UUID - used for all subsequent calls |
|
|
1559
|
-
| `agentLink` | `string | null` |
|
|
1560
|
-
| `eAppAgentLink` | `string | null` |
|
|
1561
|
-
| `applicantLink` | `string | null` |
|
|
1562
|
-
| `isDeclined` | `boolean` | `true` = valid knockout (GIGDB); not an error |
|
|
1563
|
-
| `isQuoteChanged` | `boolean` | `true` = premium was adjusted (GIGDB) |
|
|
1968
|
+
***
|
|
1564
1969
|
|
|
1970
|
+
### Request Fields
|
|
1565
1971
|
|
|
1566
|
-
|
|
1972
|
+
| Field | Type | Required | Validation Error |
|
|
1973
|
+
|---|---|---|---|
|
|
1974
|
+
| `opportunityId` | `string` | Yes | `OpportunityId is required.` / `OpportunityId does not exist.` / `Application has already been final submitted.` |
|
|
1567
1975
|
|
|
1568
|
-
|
|
1976
|
+
> `"Application has already been final submitted."` is a terminal state — do not retry.
|
|
1569
1977
|
|
|
1570
|
-
|
|
1571
|
-
|---|---|---|
|
|
1572
|
-
| `riders` | `AdbRiderResp[]` | Available riders for the state. May be empty even when product is available. |
|
|
1573
|
-
| `flagProductNotAvailableForState` | `boolean` | `true` = ADB not available in this state; stop. `false` = available; proceed to quote. |
|
|
1978
|
+
> Throws `AuthenticationError` when `opportunityId` is not authorized for the current JWT.
|
|
1574
1979
|
|
|
1575
|
-
### `AdbRiderResp`
|
|
1576
1980
|
|
|
1577
|
-
|
|
1578
|
-
|---|---|---|
|
|
1579
|
-
| `riderCode` | `AdbRiderType` | Pass into `ThirdPartyAdbQuoteRequest.riders` to include this rider in the quote. Values: `FamilyADB`, `ReturnOfPremium`, `InflationBenefit`. |
|
|
1580
|
-
| `riderTitle` | `string` | Display title for UI rendering. |
|
|
1581
|
-
| `riderDescription` | `string` | Display description for UI rendering. |
|
|
1981
|
+
***
|
|
1582
1982
|
|
|
1583
|
-
###
|
|
1983
|
+
### Business Rules
|
|
1584
1984
|
|
|
1585
|
-
|
|
1985
|
+
1. Can only be called once. Subsequent calls for the same `opportunityId` are rejected.
|
|
1986
|
+
2. `policyNumber` may be `null` — carrier decisions can be async/pending. A `null` on `flagStatus: true` is **not** an error.
|
|
1586
1987
|
|
|
1587
1988
|
|
|
1588
|
-
|
|
1589
|
-
| --------------- | --------- | ------------------------------------------ |
|
|
1590
|
-
| `opportunityId` | `string` | UUID - empty GUID when `isDeclined = true` |
|
|
1591
|
-
| `isDeclined` | `boolean` | `true` = knockout; stop the flow |
|
|
1989
|
+
***
|
|
1592
1990
|
|
|
1991
|
+
### Error Codes
|
|
1593
1992
|
|
|
1594
|
-
|
|
1993
|
+
| Code | When |
|
|
1994
|
+
|---|---|
|
|
1995
|
+
| `InvalidRequestFormat` | `opportunityId` missing, not found, or already submitted |
|
|
1996
|
+
| `PaymentNotMade` | EFT not saved — call `saveEftPayment()` first |
|
|
1997
|
+
| `FidelityFinalSubmitError` | Fidelity carrier rejected or failed to process the final submission — contact support with the `opportunityId` |
|
|
1595
1998
|
|
|
1596
1999
|
|
|
1597
|
-
|
|
1598
|
-
| ------------------ | --------- | ---------------------------------- |
|
|
1599
|
-
| `isSignCompleted` | `boolean` | If `true`, skip to `finalSubmit()` |
|
|
1600
|
-
| `isSmsAvailable` | `boolean` | SMS delivery channel available |
|
|
1601
|
-
| `isEmailAvailable` | `boolean` | Email delivery channel available |
|
|
1602
|
-
| `productName` | `string | null` |
|
|
2000
|
+
***
|
|
1603
2001
|
|
|
2002
|
+
### Response
|
|
1604
2003
|
|
|
1605
|
-
|
|
2004
|
+
| Field | Type | Description |
|
|
2005
|
+
|---|---|---|
|
|
2006
|
+
| `policyNumber` | `string\|null` | Issued policy number. May be `null` — carrier decision may be pending. |
|
|
1606
2007
|
|
|
1607
2008
|
|
|
1608
|
-
|
|
1609
|
-
| ---------------- | --------- | ----------- |
|
|
1610
|
-
| `link` | `string | null` |
|
|
1611
|
-
| `scriptHeader` | `string | null` |
|
|
1612
|
-
| `script` | `string[] | null` |
|
|
1613
|
-
| `consentMessage` | `string | null` |
|
|
2009
|
+
***
|
|
1614
2010
|
|
|
2011
|
+
### Example
|
|
1615
2012
|
|
|
1616
|
-
|
|
2013
|
+
```typescript
|
|
2014
|
+
const submitResp = await client.finalSubmit(opportunityId);
|
|
1617
2015
|
|
|
2016
|
+
// policyNumber may be null — carrier decision may still be pending
|
|
2017
|
+
if (submitResp.policyNumber) {
|
|
2018
|
+
console.log('Policy issued:', submitResp.policyNumber);
|
|
2019
|
+
} else {
|
|
2020
|
+
console.log('Submission accepted — policy number pending carrier decision');
|
|
2021
|
+
}
|
|
2022
|
+
```
|
|
1618
2023
|
|
|
1619
|
-
|
|
1620
|
-
| ------------- | --------- | ----------------------------------- |
|
|
1621
|
-
| `flagPinSent` | `boolean` | `true` when PIN resent successfully |
|
|
2024
|
+
---
|
|
1622
2025
|
|
|
2026
|
+
## Reporting
|
|
1623
2027
|
|
|
1624
|
-
|
|
2028
|
+
| SDK method | Returns |
|
|
2029
|
+
|---|---|
|
|
2030
|
+
| `getProspects()` | Quotes not yet converted to applications |
|
|
2031
|
+
| `getSales()` | Completed / sold policies |
|
|
2032
|
+
| `getApplications()` | Applications in progress |
|
|
1625
2033
|
|
|
2034
|
+
All three methods accept `AgentPortalReq`.
|
|
1626
2035
|
|
|
1627
|
-
| Field | Type | Description |
|
|
1628
|
-
| ------------ | --------- | ------------------------------------------------ |
|
|
1629
|
-
| `isVerified` | `boolean` | `true` when PIN matched and documents are signed |
|
|
1630
2036
|
|
|
2037
|
+
***
|
|
1631
2038
|
|
|
1632
|
-
###
|
|
2039
|
+
### Request fields (shared shape)
|
|
1633
2040
|
|
|
2041
|
+
| Field | Type | Required | Description |
|
|
2042
|
+
|---|---|---|---|
|
|
2043
|
+
| `pageSize` | `number` | Yes | Items per page — do not pass `0` or `null` |
|
|
2044
|
+
| `pageIndex` | `number` | Yes | Page index, 0-based — do not pass `0` or `null` |
|
|
2045
|
+
| `startDate` | `string` (ISO) | Conditional | Start of date range — required if `dayCount` not provided |
|
|
2046
|
+
| `endDate` | `string` (ISO) | Conditional | End of date range — required with `startDate` |
|
|
2047
|
+
| `dayCount` | `number` | Conditional | Last N days — required if `startDate`/`endDate` not provided |
|
|
2048
|
+
| `userTimeZone` | `string` | No | IANA timezone e.g. `"America/Chicago"` |
|
|
2049
|
+
| `sort.value` | `string` | No | Column name to sort by |
|
|
2050
|
+
| `sort.sortDescending` | `boolean` | No | `true` = descending order |
|
|
2051
|
+
| `filters[]` | `object[]` | No | `{ field, operator, value }` — see `SQLOperator` below |
|
|
2052
|
+
| `searchParam` | `string` | No | Text search across all response fields except `riders` |
|
|
1634
2053
|
|
|
1635
|
-
| Field | Type | Description |
|
|
1636
|
-
| -------------- | ------- | ----------- |
|
|
1637
|
-
| `policyNumber` | `string | null` |
|
|
1638
2054
|
|
|
2055
|
+
***
|
|
1639
2056
|
|
|
1640
|
-
|
|
2057
|
+
### Filters — `SQLOperator` Enum
|
|
1641
2058
|
|
|
1642
|
-
|
|
2059
|
+
| Member | Value | Description |
|
|
2060
|
+
|---|---|---|
|
|
2061
|
+
| `Equal` | `0` | Exact match |
|
|
2062
|
+
| `NotEqual` | `1` | Not equal |
|
|
2063
|
+
| `GreaterThan` | `2` | Greater than |
|
|
2064
|
+
| `GreaterThanOrEqual` | `3` | Greater than or equal |
|
|
2065
|
+
| `LessThan` | `4` | Less than |
|
|
2066
|
+
| `LessThanOrEqual` | `5` | Less than or equal |
|
|
2067
|
+
| `Contains` | `6` | Substring match |
|
|
2068
|
+
| `StartsWith` | `7` | Starts with |
|
|
2069
|
+
| `EndsWith` | `8` | Ends with |
|
|
2070
|
+
| `In` | `9` | In list |
|
|
2071
|
+
| `NotIn` | `10` | Not in list |
|
|
1643
2072
|
|
|
1644
|
-
### `Gender`
|
|
1645
2073
|
|
|
2074
|
+
***
|
|
1646
2075
|
|
|
1647
|
-
|
|
1648
|
-
| --------------- | ---------- |
|
|
1649
|
-
| `Gender.Male` | `'Male'` |
|
|
1650
|
-
| `Gender.Female` | `'Female'` |
|
|
2076
|
+
### Response shapes
|
|
1651
2077
|
|
|
2078
|
+
| Method | Response |
|
|
2079
|
+
|---|---|
|
|
2080
|
+
| `getProspects()` | `{ prospectCount: number, prospects: ThirdPartyProspectsDetails[] }` |
|
|
2081
|
+
| `getSales()` | `{ applicationCount: number, salesReport: ThirdPartySalesReport[], totalPremiumAmount: number }` |
|
|
2082
|
+
| `getApplications()` | `{ applicationCount: number, applications: ThirdPartyApplicationsReport[] }` |
|
|
1652
2083
|
|
|
1653
|
-
|
|
2084
|
+
> `applicationStatus` format: `"{Status} {RateClass}: {Assessment Factor}"` e.g. `"InProgress Preferred: Drug Use"`
|
|
1654
2085
|
|
|
2086
|
+
---
|
|
1655
2087
|
|
|
1656
|
-
|
|
1657
|
-
| --------------------------- | ------------ |
|
|
1658
|
-
| `PaymentFrequency.Monthly` | `'Monthly'` |
|
|
1659
|
-
| `PaymentFrequency.Annually` | `'Annually'` |
|
|
2088
|
+
## Enums & Constants
|
|
1660
2089
|
|
|
1661
2090
|
|
|
1662
|
-
|
|
2091
|
+
***
|
|
1663
2092
|
|
|
2093
|
+
### `Gender`
|
|
1664
2094
|
|
|
1665
|
-
| Enum
|
|
1666
|
-
|
|
1667
|
-
| `
|
|
1668
|
-
| `
|
|
1669
|
-
| `HealthClass.Good` | `'Good'` |
|
|
1670
|
-
| `HealthClass.Average` | `'Average'` |
|
|
2095
|
+
| Enum | Value | Products |
|
|
2096
|
+
|---|---|---|
|
|
2097
|
+
| `Gender.Male` | `'Male'` | All products |
|
|
2098
|
+
| `Gender.Female` | `'Female'` | All products |
|
|
1671
2099
|
|
|
1672
2100
|
|
|
1673
|
-
|
|
2101
|
+
***
|
|
1674
2102
|
|
|
1675
|
-
### `
|
|
2103
|
+
### `PaymentFrequency`
|
|
1676
2104
|
|
|
2105
|
+
`PaymentFrequency.Monthly` = `'Monthly'` · `PaymentFrequency.Annually` = `'Annually'`
|
|
1677
2106
|
|
|
1678
|
-
| Enum Member | Value |
|
|
1679
|
-
| ------------------------- | ------------------ |
|
|
1680
|
-
| `RateClass.PreferredPlus` | `'Preferred Plus'` |
|
|
1681
|
-
| `RateClass.Preferred` | `'Preferred'` |
|
|
1682
|
-
| `RateClass.Standard` | `'Standard'` |
|
|
1683
|
-
| `RateClass.StandardExtra` | `'Standard Extra'` |
|
|
1684
2107
|
|
|
2108
|
+
***
|
|
1685
2109
|
|
|
1686
|
-
|
|
2110
|
+
### `HealthClass` (IB Term Quote)
|
|
1687
2111
|
|
|
1688
|
-
|
|
2112
|
+
`Excellent` · `Great` · `Good` · `Average` — accepted case-insensitively in `getQuote()` / `startIBTermApplication()` requests.
|
|
1689
2113
|
|
|
2114
|
+
> `HealthClass.Preferred` does **not** exist — using it throws `APIValidationError`.
|
|
1690
2115
|
|
|
1691
|
-
| Enum Member | Value | Coverage Range |
|
|
1692
|
-
| ------------------------------- | ------------------------- | ---------------- |
|
|
1693
|
-
| `RiderType.ADBRider` | `'ADB Rider'` | $25,000–$250,000 |
|
|
1694
|
-
| `RiderType.DependentChildRider` | `'Dependent Child Rider'` | $5,000–$25,000 |
|
|
1695
2116
|
|
|
2117
|
+
***
|
|
1696
2118
|
|
|
1697
|
-
|
|
2119
|
+
### `RateClass` (IB Term Quote)
|
|
1698
2120
|
|
|
1699
|
-
|
|
2121
|
+
| Enum | Value |
|
|
2122
|
+
|---|---|
|
|
2123
|
+
| `RateClass.PreferredPlus` | `'Preferred Plus'` |
|
|
2124
|
+
| `RateClass.Preferred` | `'Preferred'` |
|
|
2125
|
+
| `RateClass.Standard` | `'Standard'` |
|
|
2126
|
+
| `RateClass.StandardExtra` | `'Standard Extra'` |
|
|
1700
2127
|
|
|
1701
|
-
|
|
2128
|
+
> Values contain spaces — always use enum members, not raw strings.
|
|
1702
2129
|
|
|
1703
|
-
| Enum Member | Value |
|
|
1704
|
-
| ------------------------------ | -------------------- |
|
|
1705
|
-
| `AdbRiderType.FamilyADB` | `'FamilyADB'` |
|
|
1706
|
-
| `AdbRiderType.ReturnOfPremium` | `'ReturnOfPremium'` |
|
|
1707
|
-
| `AdbRiderType.InflationBenefit` | `'InflationBenefit'` |
|
|
1708
2130
|
|
|
1709
|
-
|
|
2131
|
+
***
|
|
1710
2132
|
|
|
1711
|
-
### `
|
|
2133
|
+
### `RiderType` (IB Term Quote — rider codes)
|
|
1712
2134
|
|
|
1713
|
-
|
|
2135
|
+
| Enum | Value | Face Amount Range |
|
|
2136
|
+
|---|---|---|
|
|
2137
|
+
| `RiderType.ADBRider` | `'ADB Rider'` | $25,000–$250,000 |
|
|
2138
|
+
| `RiderType.DependentChildRider` | `'Dependent Child Rider'` | $5,000–$25,000 |
|
|
1714
2139
|
|
|
1715
|
-
| Enum Member | Value |
|
|
1716
|
-
| -------------------------------------------------------- | ------------------------------ |
|
|
1717
|
-
| `TobaccoNicotineLastUsedPeriod.WithinLastTwelveMonths` | `'within the last 12 months'` |
|
|
1718
|
-
| `TobaccoNicotineLastUsedPeriod.TwelveToTwentyThreeMonths`| `'12 to 23 months'` |
|
|
1719
|
-
| `TobaccoNicotineLastUsedPeriod.TwentyFourToThirtyFiveMonths` | `'24 to 35 months'` |
|
|
1720
|
-
| `TobaccoNicotineLastUsedPeriod.ThirtySixMonthsOrGreater` | `'36 months or greater'` |
|
|
1721
|
-
| `TobaccoNicotineLastUsedPeriod.Never` | `'never used'` |
|
|
1722
2140
|
|
|
1723
|
-
|
|
2141
|
+
***
|
|
1724
2142
|
|
|
1725
|
-
|
|
2143
|
+
### `AdbRiderType` (ADB product only)
|
|
1726
2144
|
|
|
1727
|
-
| Enum
|
|
1728
|
-
|
|
1729
|
-
| `
|
|
1730
|
-
| `
|
|
1731
|
-
| `
|
|
1732
|
-
| `TobaccoNicotineProductType.ECigarettes` | `'e-cigarettes'` |
|
|
1733
|
-
| `TobaccoNicotineProductType.Hookah` | `'hookah'` |
|
|
1734
|
-
| `TobaccoNicotineProductType.NicotineGum` | `'nicotine gum'` |
|
|
1735
|
-
| `TobaccoNicotineProductType.NicotinePatches` | `'nicotine patches'` |
|
|
1736
|
-
| `TobaccoNicotineProductType.None` | `'none'` |
|
|
1737
|
-
| `TobaccoNicotineProductType.Other` | `'other'` |
|
|
1738
|
-
| `TobaccoNicotineProductType.Pipes` | `'pipes'` |
|
|
1739
|
-
| `TobaccoNicotineProductType.SmokelessTobacco`| `'smokeless tobacco'` |
|
|
1740
|
-
| `TobaccoNicotineProductType.Snuff` | `'snuff'` |
|
|
1741
|
-
| `TobaccoNicotineProductType.Vaping` | `'vaping'` |
|
|
2145
|
+
| Enum | Value |
|
|
2146
|
+
|---|---|
|
|
2147
|
+
| `AdbRiderType.FamilyADB` | `'FamilyADB'` |
|
|
2148
|
+
| `AdbRiderType.ReturnOfPremium` | `'ReturnOfPremium'` |
|
|
2149
|
+
| `AdbRiderType.InflationBenefit` | `'InflationBenefit'` |
|
|
1742
2150
|
|
|
1743
|
-
>
|
|
2151
|
+
> Do **not** mix `RiderType` (IB Term) and `AdbRiderType` (ADB) — they are for different products.
|
|
1744
2152
|
|
|
1745
|
-
### `State`
|
|
1746
2153
|
|
|
1747
|
-
|
|
2154
|
+
***
|
|
1748
2155
|
|
|
1749
|
-
|
|
2156
|
+
### `TobaccoNicotineLastUsedPeriod` (IB Term Start Application)
|
|
1750
2157
|
|
|
1751
|
-
|
|
2158
|
+
| Enum | Value |
|
|
2159
|
+
|---|---|
|
|
2160
|
+
| `WithinLastTwelveMonths` | `'within the last 12 months'` |
|
|
2161
|
+
| `TwelveToTwentyThreeMonths` | `'12 to 23 months'` |
|
|
2162
|
+
| `TwentyFourToThirtyFiveMonths` | `'24 to 35 months'` |
|
|
2163
|
+
| `ThirtySixMonthsOrGreater` | `'36 months or greater'` |
|
|
2164
|
+
| `Never` | `'never used'` |
|
|
1752
2165
|
|
|
1753
|
-
### `Country`
|
|
1754
2166
|
|
|
1755
|
-
|
|
2167
|
+
***
|
|
1756
2168
|
|
|
1757
|
-
### `
|
|
2169
|
+
### `TobaccoNicotineProductType` (IB Term Start Application)
|
|
1758
2170
|
|
|
2171
|
+
| Enum | Value |
|
|
2172
|
+
|---|---|
|
|
2173
|
+
| `ChewingTobacco` | `'chewing tobacco'` |
|
|
2174
|
+
| `Cigarettes` | `'cigarettes'` |
|
|
2175
|
+
| `Cigars` | `'cigars'` |
|
|
2176
|
+
| `ECigarettes` | `'e-cigarettes'` |
|
|
2177
|
+
| `Hookah` | `'hookah'` |
|
|
2178
|
+
| `NicotineGum` | `'nicotine gum'` |
|
|
2179
|
+
| `NicotinePatches` | `'nicotine patches'` |
|
|
2180
|
+
| `None` | `'none'` |
|
|
2181
|
+
| `Other` | `'other'` |
|
|
2182
|
+
| `Pipes` | `'pipes'` |
|
|
2183
|
+
| `SmokelessTobacco` | `'smokeless tobacco'` |
|
|
2184
|
+
| `Snuff` | `'snuff'` |
|
|
2185
|
+
| `Vaping` | `'vaping'` |
|
|
2186
|
+
|
|
2187
|
+
|
|
2188
|
+
***
|
|
1759
2189
|
|
|
1760
|
-
|
|
1761
|
-
| --------------------------------- | ---------------------------------------- |
|
|
1762
|
-
| `Person` | `'Person'` |
|
|
1763
|
-
| `AllChildrenOfTheInsuredEqually` | `'All Children Of The Insured Equally'` |
|
|
1764
|
-
| `AllChildrenOfTheMarriageEqually` | `'All Children Of The Marriage Equally'` |
|
|
1765
|
-
| `InsuredEstate` | `'Insured Estate'` |
|
|
1766
|
-
| `Business` | `'Business'` |
|
|
1767
|
-
| `Corporation` | `'Corporation'` |
|
|
1768
|
-
| `CharitableOrganization` | `'Charitable Organization'` |
|
|
1769
|
-
| `Employer` | `'Employer'` |
|
|
1770
|
-
| `Other` | `'Other'` |
|
|
1771
|
-
| `Trust` | `'Trust'` |
|
|
2190
|
+
### `BeneficiaryType`
|
|
1772
2191
|
|
|
2192
|
+
`Person` · `AllChildrenOfTheInsuredEqually` · `AllChildrenOfTheMarriageEqually` · `InsuredEstate` · `Business` · `Corporation` · `CharitableOrganization` · `Employer` · `Other` · `Trust`
|
|
1773
2193
|
|
|
1774
|
-
|
|
2194
|
+
> IB Term restricts to: `Person`, `Trust`, `InsuredEstate`, `AllChildrenOfTheInsuredEqually`, `AllChildrenOfTheMarriageEqually`.
|
|
1775
2195
|
|
|
1776
|
-
36 values: `Aunt`, `Boyfriend`, `Brother`, `BrotherInLaw`, `CommonLawHusband`, `CommonLawWife`, `Cousin`, `Daughter`, `DaughterInLaw`, `DomesticPartner`, `Father`, `FatherInLaw`, `FatherOfChild`, `Fiance`, `Fiancee`, `FormerSpouse`, `Friend`, `Girlfriend`, `Granddaughter`, `Grandfather`, `Grandmother`, `Grandson`, `Husband`, `LifePartner`, `Mother`, `MotherInLaw`, `MotherOfChild`, `Nephew`, `Niece`, `Sister`, `SisterInLaw`, `Son`, `SonInLaw`, `Spouse`, `Uncle`, `Wife`
|
|
1777
2196
|
|
|
1778
|
-
|
|
2197
|
+
***
|
|
1779
2198
|
|
|
1780
|
-
|
|
2199
|
+
### `BeneficiaryRelationship`
|
|
1781
2200
|
|
|
1782
|
-
|
|
2201
|
+
`Aunt` · `Boyfriend` · `Brother` · `BrotherInLaw` · `CommonLawHusband` · `CommonLawWife` · `Cousin` · `Daughter` · `DaughterInLaw` · `DomesticPartner` · `Father` · `FatherInLaw` · `FatherOfChild` · `Fiance` · `Fiancee` · `FormerSpouse` · `Friend` · `Girlfriend` · `Granddaughter` · `Grandfather` · `Grandmother` · `Grandson` · `Husband` · `LifePartner` · `Mother` · `MotherInLaw` · `MotherOfChild` · `Nephew` · `Niece` · `Sister` · `SisterInLaw` · `Son` · `SonInLaw` · `Spouse` · `Uncle` · `Wife`
|
|
1783
2202
|
|
|
1784
|
-
> CA: ADB product support is coming in the next SDK release and is not yet available.
|
|
1785
2203
|
|
|
1786
|
-
|
|
2204
|
+
***
|
|
1787
2205
|
|
|
1788
|
-
|
|
2206
|
+
### ADB Rider State Availability
|
|
1789
2207
|
|
|
1790
|
-
|
|
2208
|
+
**ADB Rider available in:** AL, AZ, AR, CA*, CO, CT, DC, DE, FL, GA, HI, ID, IL, IN, IA, KS, KY, LA, ME, MD, MI, MN, MS, MO, MT, NE, NV, NJ, NM, NC, ND, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VT, VA, WV, WI
|
|
1791
2209
|
|
|
1792
|
-
|
|
2210
|
+
**Dependent Child Rider available in:** AL, AK, AZ, AR, CO, CT, DC, DE, GA, HI, ID, IL, IN, IA, KS, KY, LA, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NC, OH, OK, OR, PA, RI, SC, TN, TX, UT, VA, WV, WI
|
|
1793
2211
|
|
|
1794
|
-
|
|
2212
|
+
**No riders available:** WA
|
|
1795
2213
|
|
|
1796
2214
|
---
|
|
1797
2215
|
|
|
1798
2216
|
## Beneficiary Reference
|
|
1799
2217
|
|
|
1800
|
-
|
|
2218
|
+
`beneficiaryDetails` uses a TypeScript discriminated union keyed on `beneficiaryType`.
|
|
1801
2219
|
|
|
1802
|
-
### Variant 1 - No extra fields
|
|
1803
2220
|
|
|
1804
|
-
|
|
2221
|
+
***
|
|
2222
|
+
|
|
2223
|
+
### Variant 1 — No extra fields
|
|
1805
2224
|
|
|
1806
2225
|
```typescript
|
|
1807
|
-
|
|
1808
|
-
beneficiaryType: BeneficiaryType.InsuredEstate
|
|
1809
|
-
}
|
|
2226
|
+
{ beneficiaryType: BeneficiaryType.InsuredEstate }
|
|
1810
2227
|
```
|
|
1811
2228
|
|
|
1812
|
-
|
|
2229
|
+
Types: `InsuredEstate` · `AllChildrenOfTheInsuredEqually` · `AllChildrenOfTheMarriageEqually`
|
|
1813
2230
|
|
|
1814
|
-
|
|
2231
|
+
|
|
2232
|
+
***
|
|
2233
|
+
|
|
2234
|
+
### Variant 2 — Named person
|
|
1815
2235
|
|
|
1816
2236
|
```typescript
|
|
1817
|
-
|
|
2237
|
+
{
|
|
1818
2238
|
beneficiaryType: BeneficiaryType.Person,
|
|
1819
2239
|
beneficiaryPerson: {
|
|
1820
2240
|
firstName: 'Jane',
|
|
@@ -1824,498 +2244,248 @@ beneficiaryDetails: {
|
|
|
1824
2244
|
}
|
|
1825
2245
|
```
|
|
1826
2246
|
|
|
1827
|
-
### Variant 3 - Named entity (organization)
|
|
1828
2247
|
|
|
1829
|
-
|
|
2248
|
+
***
|
|
2249
|
+
|
|
2250
|
+
### Variant 3 — Named entity
|
|
1830
2251
|
|
|
1831
2252
|
```typescript
|
|
1832
|
-
// Business
|
|
1833
|
-
|
|
2253
|
+
// Business, Corporation, Employer, etc.
|
|
2254
|
+
{
|
|
1834
2255
|
beneficiaryType: BeneficiaryType.Business,
|
|
1835
|
-
namedEntity: {
|
|
1836
|
-
name: 'Acme Corp',
|
|
1837
|
-
taxId: '12-3456789' // optional
|
|
1838
|
-
}
|
|
2256
|
+
namedEntity: { name: 'Acme Corp', taxId: '12-3456789' } // taxId optional
|
|
1839
2257
|
}
|
|
1840
2258
|
|
|
1841
|
-
// Trust
|
|
1842
|
-
|
|
2259
|
+
// Trust — trustDate required (YYYY-MM)
|
|
2260
|
+
{
|
|
1843
2261
|
beneficiaryType: BeneficiaryType.Trust,
|
|
1844
|
-
namedEntity: {
|
|
1845
|
-
name: 'Smith Family Trust',
|
|
1846
|
-
trustDate: '2020-01' // required for Trust only; format: YYYY-MM
|
|
1847
|
-
}
|
|
2262
|
+
namedEntity: { name: 'Smith Family Trust', trustDate: '2020-01' }
|
|
1848
2263
|
}
|
|
1849
2264
|
```
|
|
1850
2265
|
|
|
2266
|
+
Named entity types: `Business` · `Corporation` · `CharitableOrganization` · `Employer` · `Other` · `Trust`
|
|
2267
|
+
|
|
1851
2268
|
---
|
|
1852
2269
|
|
|
1853
2270
|
## Error Handling
|
|
1854
2271
|
|
|
1855
|
-
|
|
2272
|
+
|
|
2273
|
+
***
|
|
2274
|
+
|
|
2275
|
+
### Error Class Hierarchy
|
|
1856
2276
|
|
|
1857
2277
|
```
|
|
1858
2278
|
InstaBrainError
|
|
1859
|
-
├── AuthenticationError
|
|
1860
|
-
├── ValidationError
|
|
1861
|
-
└── APIValidationError
|
|
2279
|
+
├── AuthenticationError — invalid credentials, expired JWT, or unauthorized opportunityId
|
|
2280
|
+
├── ValidationError — client-side / transport validation before a successful response
|
|
2281
|
+
└── APIValidationError — server returned flagStatus: false (check APIErrorCode)
|
|
1862
2282
|
```
|
|
1863
2283
|
|
|
1864
|
-
### Field reference
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
| Class | `message` | `statusCode` | `errorCode` | `response` |
|
|
1868
|
-
| --------------------- | --------- | ------------ | ----------- | ---------- |
|
|
1869
|
-
| `InstaBrainError` | Yes | Yes | Yes | Yes |
|
|
1870
|
-
| `AuthenticationError` | Yes | `401` | - | - |
|
|
1871
|
-
| `ValidationError` | Yes | `400` | Yes | - |
|
|
1872
|
-
| `APIValidationError` | Yes | `400` | Yes | Yes |
|
|
1873
2284
|
|
|
2285
|
+
***
|
|
1874
2286
|
|
|
1875
2287
|
### Using `APIValidationError`
|
|
1876
2288
|
|
|
1877
|
-
|
|
2289
|
+
Always use `isErrorType(APIErrorCode.X)` — do **not** compare `errorCode` as a raw string. InstaBrain uses inconsistent casing across codes (see string values below).
|
|
1878
2290
|
|
|
1879
2291
|
```typescript
|
|
1880
|
-
import {
|
|
1881
|
-
APIValidationError,
|
|
1882
|
-
AuthenticationError,
|
|
1883
|
-
InstaBrainError,
|
|
1884
|
-
APIErrorCode
|
|
1885
|
-
} from '@instabrain-sdks/api-client';
|
|
2292
|
+
import { APIValidationError, AuthenticationError, APIErrorCode } from '@instabrain-sdks/api-client';
|
|
1886
2293
|
|
|
1887
2294
|
try {
|
|
1888
|
-
|
|
2295
|
+
await client.startGigdbApplication(req);
|
|
1889
2296
|
} catch (err) {
|
|
1890
2297
|
if (err instanceof APIValidationError) {
|
|
1891
|
-
if (err.isErrorType(APIErrorCode.
|
|
1892
|
-
|
|
1893
|
-
} else if (err.isErrorType(APIErrorCode.
|
|
1894
|
-
|
|
2298
|
+
if (err.isErrorType(APIErrorCode.ApplicationLimitReached)) {
|
|
2299
|
+
// same SSN/email/phone has a policy within 30 days — do not retry same identifiers
|
|
2300
|
+
} else if (err.isErrorType(APIErrorCode.StateMismatchIdentified)) {
|
|
2301
|
+
// re-quote with the correct state
|
|
2302
|
+
} else if (err.isErrorType(APIErrorCode.AgentNotFound)) {
|
|
2303
|
+
// verify agent credentials / token
|
|
1895
2304
|
} else {
|
|
1896
|
-
// getUserFriendlyMessage() returns a human-readable description
|
|
1897
2305
|
console.error(err.getUserFriendlyMessage());
|
|
2306
|
+
// inspect err.response.value.fields for per-field messages
|
|
1898
2307
|
}
|
|
1899
2308
|
} else if (err instanceof AuthenticationError) {
|
|
1900
|
-
|
|
1901
|
-
} else if (err instanceof InstaBrainError) {
|
|
1902
|
-
console.error(`SDK error: ${err.message} (status: ${err.statusCode})`);
|
|
2309
|
+
// re-authenticate
|
|
1903
2310
|
}
|
|
1904
2311
|
}
|
|
1905
2312
|
```
|
|
1906
2313
|
|
|
1907
|
-
> `**isDeclined: true` is not an error.** It is a response field on `ThirdPartyStartAppResp` and `ThirdPartyAdbStartAppResp`, indicating the application was declined due to knockout criteria. Always check this field in the response - it is never thrown as an exception.
|
|
1908
2314
|
|
|
1909
|
-
|
|
2315
|
+
***
|
|
1910
2316
|
|
|
1911
|
-
|
|
2317
|
+
### `BaseResponse<T>` Envelope
|
|
1912
2318
|
|
|
1913
|
-
|
|
2319
|
+
```typescript
|
|
2320
|
+
interface BaseResponse<T> {
|
|
2321
|
+
flagStatus: boolean; // true = success — unwrapped automatically by the SDK
|
|
2322
|
+
value: T;
|
|
2323
|
+
error: string | null; // top-level error code
|
|
2324
|
+
}
|
|
2325
|
+
```
|
|
1914
2326
|
|
|
1915
|
-
>
|
|
1916
|
-
>
|
|
1917
|
-
> - **Validation failures** (the common case across all products) return HTTP 400 with `error: "InvalidRequestFormat"` and a `value.fields: { <FieldPath>: ["<message>"] }` map. Detect specific failures by inspecting field-level messages — see the [Field-Level Error Messages](#field-level-error-messages) section below.
|
|
1918
|
-
> - **IB Term Quote business errors** return HTTP 400 with one of the codes in the *IB Term Quote Business Errors* table below; `value` is `null` and there is no `fields` map.
|
|
1919
|
-
> - **Get-Existing-Quote business error**: `QuoteNotFound` is returned when the opportunity exists but no quote is stored.
|
|
1920
|
-
> - **`ApplicationLimitReached`**: ADB / GIGDB Start Application only — same SSN, email, or phone matched a policy generated in the last 30 days. IB Term does NOT use this code.
|
|
1921
|
-
> - Codes marked **`@deprecated`** below were returned by older versions of the API. The current API surfaces those failures as field-level messages under `InvalidRequestFormat`. Use the equivalent field-level checks instead. Deprecated codes will remain in the enum until the next major release for backward compatibility.
|
|
2327
|
+
> **`isDeclined: true` is never thrown.** It is returned on the resolved object from `startGigdbApplication()`, `startAdbApplication()`, and `startIBTermApplication()`. Always check it before continuing.
|
|
1922
2328
|
|
|
1923
|
-
### Universal validation envelope
|
|
1924
2329
|
|
|
1925
|
-
|
|
1926
|
-
| ---------------------- | ------------------------ | ---------------------------------------------------------------------------- |
|
|
1927
|
-
| `InvalidRequestFormat` | `'InvalidRequestFormat'` | Top-level code for every FluentValidation failure. Inspect `value.fields`. |
|
|
2330
|
+
***
|
|
1928
2331
|
|
|
1929
|
-
###
|
|
2332
|
+
### Field-Level Error Messages
|
|
1930
2333
|
|
|
1931
|
-
|
|
2334
|
+
Most validation failures return top-level `InvalidRequestFormat`. Per-field details are in `err.response.value.fields` — keys are backend property paths (e.g. `Address.State`, `OpportunityId`, `ChildrenToBeInsuredDetails[0].DOB`).
|
|
1932
2335
|
|
|
1933
|
-
|
|
1934
|
-
| ------------------------------------ | -------------------------------------- | ---------- | -------------------------------------------------------------------------------------------- |
|
|
1935
|
-
| `StateNotFound` | `'stateNotFound'` | All quotes | State code missing, invalid, or not found |
|
|
1936
|
-
| `NotAvailableForState` | `'NotAvailableForState'` | All quotes | Product not offered for the selected state |
|
|
1937
|
-
| `QuoteNotEligibleForGivenConditions` | `'QuoteNotEligibleForGivenConditions'` | All quotes | Combination of state / age / smoker status not eligible |
|
|
1938
|
-
| `CoverageNotAvailable` | `'CoverageNotAvailable'` | All quotes | Face amount not available for the selected state, age, and smoker status |
|
|
1939
|
-
| `RiderNotAvailable` | `'RiderNotAvailable'` | ADB | Rider not available for the product or state |
|
|
1940
|
-
| `RiderFaceAmountNotValid` | `'RiderFaceAmountNotValid'` | ADB | Rider benefit amount outside the allowed range |
|
|
1941
|
-
| `AgeNotFound` | `'AgeNotFound'` | IB Term | Neither `Age` nor `DateOfBirth` supplied |
|
|
1942
|
-
| `BenefitPeriodNotAvailable` | `'BenefitPeriodNotAvailable'` | IB Term | Benefit period not allowed for the state + age + smoker combination. Returned as either top-level or via `value.fields`. |
|
|
1943
|
-
| `OutsideBuildChart` | `'outsideBuildChart'` | IB Term | Height / weight outside the carrier's build chart |
|
|
1944
|
-
| `HeightNotValid` | `'HeightNotValid'` | IB Term | Height / weight value or combination is invalid |
|
|
2336
|
+
This README does **not** duplicate the backend’s full master catalog. Instead, each method documents the messages you are likely to see:
|
|
1945
2337
|
|
|
1946
|
-
|
|
2338
|
+
| Where to look | What you get |
|
|
2339
|
+
|---|---|
|
|
2340
|
+
| **Request Fields** tables | **Validation Error** column — messages tied to each request field |
|
|
2341
|
+
| **Error Codes** tables (per method + [central `APIErrorCode` reference](#apierrorcode-reference)) | Top-level `APIErrorCode` values when `value` is `null` |
|
|
2342
|
+
| **`ApplicationLimitReached` field-level messages** (GIGDB Start Application) | Example of an explicit field-path → message list for one top-level code |
|
|
1947
2343
|
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
2344
|
+
```typescript
|
|
2345
|
+
if (err instanceof APIValidationError && err.isErrorType(APIErrorCode.InvalidRequestFormat)) {
|
|
2346
|
+
const fields = err.response?.value?.fields as Record<string, string[]> | undefined;
|
|
2347
|
+
// e.g. fields?.['OpportunityId'], fields?.['Address.State']
|
|
2348
|
+
}
|
|
2349
|
+
```
|
|
1951
2350
|
|
|
1952
|
-
|
|
2351
|
+
---
|
|
1953
2352
|
|
|
1954
|
-
|
|
2353
|
+
## Error codes (`APIErrorCode`)
|
|
1955
2354
|
|
|
1956
|
-
|
|
1957
|
-
| ------------------------- | --------------------------- | ------------------------------------------------------------------------------ |
|
|
1958
|
-
| `ApplicationLimitReached` | `'ApplicationLimitReached'` | An application with the same SSN, email, or phone has a policy generated within the last 30 days. |
|
|
2355
|
+
Active `APIErrorCode` enum members match the tables below. Compare failures with `err.isErrorType(APIErrorCode.X)` — do not rely on raw string casing; use the **String Value** column when logging or debugging.
|
|
1959
2356
|
|
|
1960
|
-
|
|
2357
|
+
Deprecated enum members (`QuoteNotFound`, `HeightNotValid`, `DocumentsNotViewed`, and others) remain in the package for backward compatibility but are **not** listed here; the API surfaces those cases via `InvalidRequestFormat` and `value.fields` instead.
|
|
1961
2358
|
|
|
1962
|
-
Returned as top-level codes (HTTP 400, `value: null`) when the request body is well-formed but the application cannot be started. Apply to **all three** Start Application endpoints.
|
|
1963
2359
|
|
|
1964
|
-
|
|
1965
|
-
| ------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
1966
|
-
| `StateMismatchIdentified` | `'StateMismatchIdentified'` | Quote state and `Address.State` on Start App refer to different US states (case-insensitive). Re-quote with the correct residence state. |
|
|
1967
|
-
| `AgentNotFound` | `'agentNotFound'` | The quote cannot be linked to an agent account. Verify the agent token. |
|
|
1968
|
-
| `InternalServerError` | `'internalServerError'`| Unexpected backend failure. Retry; if it persists, contact InstaBrain support. |
|
|
2360
|
+
***
|
|
1969
2361
|
|
|
1970
|
-
|
|
2362
|
+
### Quote Errors
|
|
1971
2363
|
|
|
1972
|
-
|
|
2364
|
+
| Code | String Value | Products | When |
|
|
2365
|
+
|---|---|---|---|
|
|
2366
|
+
| `InvalidRequestFormat` | `'InvalidRequestFormat'` | All | Any validation failure — inspect `value.fields` |
|
|
2367
|
+
| `StateNotFound` | `'stateNotFound'` | All quotes | State code not recognized |
|
|
2368
|
+
| `AgeNotFound` | `'AgeNotFound'` | All quotes | Neither age nor date of birth supplied, or age could not be derived |
|
|
2369
|
+
| `NotAvailableForState` | `'NotAvailableForState'` | All quotes | Product not available in state |
|
|
2370
|
+
| `QuoteNotEligibleForGivenConditions` | `'QuoteNotEligibleForGivenConditions'` | All quotes | State/age/nicotine combo not eligible |
|
|
2371
|
+
| `CoverageNotAvailable` | `'CoverageNotAvailable'` | All quotes | Face amount out of range |
|
|
2372
|
+
| `RiderNotAvailable` | `'RiderNotAvailable'` | ADB, IB Term | Rider unavailable for product/state |
|
|
2373
|
+
| `RiderFaceAmountNotValid` | `'RiderFaceAmountNotValid'` | ADB, IB Term | Rider face amount out of range |
|
|
2374
|
+
| `BenefitPeriodNotAvailable` | `'BenefitPeriodNotAvailable'` | IB Term | Benefit period not allowed for state/age/nicotine |
|
|
2375
|
+
| `OutsideBuildChart` | `'outsideBuildChart'` | IB Term | Height & weight provided and outside carrier build chart |
|
|
1973
2376
|
|
|
1974
|
-
| Enum Member | String Value | Description |
|
|
1975
|
-
| -------------- | ---------------- | ------------------------------------------------------ |
|
|
1976
|
-
| `AgentLogout` | `'AgentLogout'` | Agent session expired; re-authenticate |
|
|
1977
|
-
|
|
1978
|
-
### Deprecated codes
|
|
1979
|
-
|
|
1980
|
-
The following codes were returned by older API versions and are kept in the enum for backward compatibility. **They are no longer returned by the current API.** Detect the equivalent failures via field-level messages under `InvalidRequestFormat` — see the [Field-Level Error Messages](#field-level-error-messages) section.
|
|
1981
|
-
|
|
1982
|
-
| Enum Member (deprecated) | Use this field-level message instead |
|
|
1983
|
-
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
1984
|
-
| ~~`InvalidBirthCountry`~~ | `BirthJurisdiction.Country` → "Birth country code is invalid." |
|
|
1985
|
-
| ~~`InvalidBirthState`~~ | `BirthJurisdiction.State` → "Birth state code is invalid." |
|
|
1986
|
-
| ~~`InvalidResidenceState`~~ | `Address.State` → "Residence state code is invalid." |
|
|
1987
|
-
| ~~`OneOfTheExistingCoveragesQuestionsNotFound`~~ | (no longer returned) |
|
|
1988
|
-
| ~~`PaymentAlreadyMade`~~ | `OpportunityId` → "Quote update is not allowed when payment is already made." |
|
|
1989
|
-
| ~~`ErrorInSaveEftPaymentDetails`~~ | Field-level on EFT request (account holder name / routing / account number) |
|
|
1990
|
-
| ~~`InvalidPaymentScheduledDate`~~ | (no longer returned) |
|
|
1991
|
-
| ~~`ThirdPartyQuoteError`~~ | (generic legacy code; no longer returned) |
|
|
1992
|
-
| ~~`InvalidQuoteParameters`~~ | (generic legacy code; no longer returned) |
|
|
1993
|
-
| ~~`InvalidStateCode`~~ | `Address.State` → "Residence state code is invalid." or quote-specific state messages |
|
|
1994
|
-
| ~~`InvalidAdbAgeRange`~~ | `DateOfBirth` → "Age must be between 20 and 59 for ADB." |
|
|
1995
|
-
| ~~`PaymentNotMade`~~ | `opportunityId` (Final Submit) → "Application has already been final submitted." |
|
|
1996
|
-
| ~~`SecureSignRelatedError`~~ | Field-level on Secure Sign endpoint |
|
|
1997
|
-
| ~~`SigningPackageNotCreated`~~ | Field-level on Secure Sign endpoint |
|
|
1998
|
-
| ~~`SecureSignPinMismatch`~~ | `Pin` → "Pin is required." (Verify PIN endpoint) |
|
|
1999
|
-
| ~~`PinExpired`~~ | Field-level on Verify PIN endpoint |
|
|
2000
|
-
| ~~`DocumentsNotViewed`~~ | Field-level on Verify PIN endpoint |
|
|
2001
|
-
| ~~`DocumentsAlreadySigned`~~ | `OpportunityId` → "Documents are already signed." (Secure Sign endpoints) |
|
|
2002
2377
|
|
|
2378
|
+
***
|
|
2003
2379
|
|
|
2004
|
-
|
|
2380
|
+
### Start Application Errors
|
|
2005
2381
|
|
|
2006
|
-
|
|
2382
|
+
| Code | String Value | Products | When |
|
|
2383
|
+
|---|---|---|---|
|
|
2384
|
+
| `ApplicationLimitReached` | `'ApplicationLimitReached'` | ADB, GIGDB | Same SSN/email/phone has policy within last 30 days. Not used by IB Term. |
|
|
2385
|
+
| `StateMismatchIdentified` | `'StateMismatchIdentified'` | All | Quote state ≠ application address state — re-quote |
|
|
2386
|
+
| `AgentNotFound` | `'agentNotFound'` | All | Quote cannot be linked to agent account — verify credentials |
|
|
2387
|
+
| `InternalServerError` | `'internalServerError'` | All | Unexpected backend failure — retry; if persistent contact support |
|
|
2007
2388
|
|
|
2008
|
-
When the API returns `error: "InvalidRequestFormat"`, inspect `value.fields` (a `Record<string, string[]>`) for per-field messages. The catalog below lists every field path and its exact message text returned by the backend, organized by endpoint family.
|
|
2009
2389
|
|
|
2010
|
-
|
|
2390
|
+
***
|
|
2011
2391
|
|
|
2012
|
-
###
|
|
2392
|
+
### Payment & quote update errors
|
|
2013
2393
|
|
|
2014
|
-
|
|
|
2015
|
-
|
|
2016
|
-
| `
|
|
2017
|
-
| `QuoteResponseId` | QuoteResponseId does not exist or does not belong to the requested product. |
|
|
2018
|
-
| `FirstName` | First name is required. |
|
|
2019
|
-
| `FirstName` | First name is invalid. Only alphabetic characters are allowed. |
|
|
2020
|
-
| `LastName` | Last name is required. |
|
|
2021
|
-
| `LastName` | Last name is invalid. Only alphabetic characters are allowed. |
|
|
2022
|
-
| `Email` | Email is required. |
|
|
2023
|
-
| `Email` | Please enter a valid email address. |
|
|
2024
|
-
| `PhoneNumber` | Phone number is required. |
|
|
2025
|
-
| `PhoneNumber` | Phone number format is incorrect. Use 10 digits or +1XXXXXXXXXX. |
|
|
2026
|
-
| `PhoneNumber` | Phone number is invalid. |
|
|
2027
|
-
| `IsPayerAlsoOwnerAndInsured` | IsPayerAlsoOwnerAndInsured field is required. |
|
|
2028
|
-
| `DateOfBirth` | Date of birth is required. |
|
|
2029
|
-
| `DateOfBirth` | Date of birth must be a valid date in the past. |
|
|
2030
|
-
| `SocialSecurityNumber` | Social Security Number is required. |
|
|
2031
|
-
| `SocialSecurityNumber` | Social Security Number must be in valid format (e.g., XXX-XX-XXXX). |
|
|
2032
|
-
| `Address` | Address is required. |
|
|
2033
|
-
| `Address.AddressLine1` | Address line is required. |
|
|
2034
|
-
| `Address.AddressLine1` | Street address is invalid. Avoid special characters. |
|
|
2035
|
-
| `Address.City` | Address city is required. |
|
|
2036
|
-
| `Address.City` | City name is invalid. Only letters and spaces are allowed. |
|
|
2037
|
-
| `Address.State` | Residence state is required. |
|
|
2038
|
-
| `Address.State` | Residence state code is invalid. |
|
|
2039
|
-
| `Address.Zipcode` | Zip code is required. |
|
|
2040
|
-
| `Address.Zipcode` | Zip code is invalid. It must be in 5-digit format. |
|
|
2041
|
-
| `Address.Zipcode` | Zip code is not found. |
|
|
2042
|
-
| `HasExistingCoverage` | Existing coverage field is required |
|
|
2043
|
-
| `ExistingCoverageData` | Existing coverage details must be provided when HasExistingCoverage is true. |
|
|
2044
|
-
| `ExistingCoverageData` | Existing coverage details must be null when HasExistingCoverage is false. |
|
|
2045
|
-
| `ExistingCoverageData.ExistingCoverages` | At least one existing coverage entry is required. |
|
|
2046
|
-
| `ExistingCoverageData.IsExistingPolicyBeingTerminated` | Please indicate whether any existing policy is being terminated. |
|
|
2047
|
-
| `ExistingCoverageData.ExistingCoverages[n].NameOfTheCompany` | Please provide the name of the insurance company. |
|
|
2048
|
-
| `ExistingCoverageData.ExistingCoverages[n].InsuranceAmount` | Insurance amount must be provided. |
|
|
2049
|
-
| `ExistingCoverageData.ExistingCoverages[n].DateOfIssue` | Please provide Date of Issue in YYYY-MM format |
|
|
2050
|
-
| `ExistingCoverageData.ExistingCoverages[n].DateOfIssue` | Date of issue must be in YYYY-MM format. |
|
|
2051
|
-
| `ExistingCoverageData.ExistingCoverages[n].ToBeReplaced` | Replacement coverage answer must be specified. |
|
|
2052
|
-
| `ExistingCoverageData.ExistingCoverages[n].ToBeFinanced` | Financing coverage answer must be specified. |
|
|
2053
|
-
| `WillOtherCoverageBeReplacedOrFinanced` | Please indicate whether any other coverage will be replaced or financed. |
|
|
2054
|
-
| `WillOtherCoverageBeReplacedOrFinanced` | Other Coverage be replaced or financed must be either null or false as no existing coverage passed. |
|
|
2055
|
-
| `BeneficiaryDetails` | Beneficiary details are required. |
|
|
2056
|
-
| `BeneficiaryDetails.BeneficiaryType` | Please select a valid beneficiary option. |
|
|
2057
|
-
| `BeneficiaryDetails.BeneficiaryPerson` | Beneficiary person details must be provided. |
|
|
2058
|
-
| `BeneficiaryDetails.BeneficiaryPerson.FirstName` | Beneficiary first name is required. |
|
|
2059
|
-
| `BeneficiaryDetails.BeneficiaryPerson.FirstName` | Beneficiary's first name is invalid. |
|
|
2060
|
-
| `BeneficiaryDetails.BeneficiaryPerson.LastName` | Beneficiary last name is required. |
|
|
2061
|
-
| `BeneficiaryDetails.BeneficiaryPerson.LastName` | Beneficiary's last name is invalid. |
|
|
2062
|
-
| `BeneficiaryDetails.BeneficiaryPerson.Relationship` | Please specify the relationship with the beneficiary. |
|
|
2063
|
-
| `BeneficiaryDetails.NamedEntity` | Named entity details must be provided for this beneficiary type. |
|
|
2064
|
-
| `BeneficiaryDetails.NamedEntity.Name` | Beneficiary name is required. |
|
|
2065
|
-
| `BeneficiaryDetails.NamedEntity.TrustDate` | Trust date must be in YYYY-MM format. |
|
|
2066
|
-
| `IsUsCitizen` | US citizenship status is required. |
|
|
2067
|
-
| `IsLegalUsResident` | Legal US residency status is required for non-US citizens. |
|
|
2068
|
-
| `Email` *(top-level on Start App; ADB / GIGDB only)* | `error: "ApplicationLimitReached"` → "An application with the same email has a policy generated within the last 30 days." |
|
|
2069
|
-
| `PhoneNumber` *(top-level on Start App; ADB / GIGDB only)* | `error: "ApplicationLimitReached"` → "Two applications with the same phone have policies generated within the last 30 days." |
|
|
2070
|
-
| `SocialSecurityNumber` *(top-level on Start App; ADB / GIGDB only)* | `error: "ApplicationLimitReached"` → "An application with the same SSN has a policy generated within the last 30 days." |
|
|
2071
|
-
|
|
2072
|
-
### ADB — additional messages
|
|
2073
|
-
|
|
2074
|
-
| Field path | Message |
|
|
2075
|
-
|---|---|
|
|
2076
|
-
| `DateOfBirth` | Age must be between 20 and 59 for ADB. |
|
|
2077
|
-
| `Address.State` | This state is currently not supported. |
|
|
2078
|
-
| `Address.State` | This product is not available for the selected state. |
|
|
2079
|
-
| `Occupation` | At least one occupation is required when residence state is CA. |
|
|
2080
|
-
| `Occupation` | One or more selected occupations are invalid. |
|
|
2081
|
-
| `HasMedicalCoverage` | Medical coverage acknowledgement is required when residence state is DC. |
|
|
2082
|
-
| `UnderstandsBenefits` | Supplemental policy benefits acknowledgement is required when residence state is DC. |
|
|
2083
|
-
| `UnderstandsLimitedBenefits` | Limited benefits acknowledgement is required when residence state is DC. |
|
|
2084
|
-
| `ExistingCoverageData.ExistingCoverages[n].NotifyPresentInsurer` | Notify present insurer response is required for Oklahoma when existing coverage is provided. |
|
|
2085
|
-
| `ExistingCoverageData.ExistingCoverages[n].WantsComparativeInformationForm` | Comparative information form preference is required for Florida when existing coverage is provided. |
|
|
2086
|
-
| `ExistingCoverageData.ExistingCoverages[n].WantsPolicySummary` | Policy summary preference is required for Delaware when existing coverage is provided. |
|
|
2087
|
-
|
|
2088
|
-
### ADB — Update Quote / Get Existing Quote
|
|
2089
|
-
|
|
2090
|
-
| Field path | Message |
|
|
2091
|
-
|---|---|
|
|
2092
|
-
| `OpportunityId` | OpportunityId is required. |
|
|
2093
|
-
| `OpportunityId` | OpportunityId does not exist. |
|
|
2094
|
-
| `OpportunityId` | OpportunityId does not match selected product. |
|
|
2095
|
-
| `OpportunityId` | Quote update is not allowed when payment is already made. |
|
|
2096
|
-
| `FaceAmount` | Coverage amount (FaceAmount) is required. |
|
|
2097
|
-
| `PaymentFreq` | Payment frequency is required. |
|
|
2098
|
-
| `PaymentFreq` | Invalid payment frequency. |
|
|
2099
|
-
| `Riders` | Riders are required. *(Update Quote only)* |
|
|
2100
|
-
| `Riders` | Riders are invalid. |
|
|
2101
|
-
|
|
2102
|
-
### GIGDB — additional messages
|
|
2103
|
-
|
|
2104
|
-
| Field path | Message |
|
|
2105
|
-
|---|---|
|
|
2106
|
-
| `DateOfBirth` | Age must be between 50 and 85 for GIGDB. |
|
|
2107
|
-
| `Address.State` | This state is currently not supported. |
|
|
2108
|
-
| `Address.State` | This product is not available for the selected state. |
|
|
2109
|
-
| `IsSmoker` | Smoker status is required. |
|
|
2110
|
-
| `NicotineInfo` | Nicotine details are required when applicant is a smoker. |
|
|
2111
|
-
| `NicotineInfo.LastUseDate` | Last nicotine use date is required when applicant is a smoker. |
|
|
2112
|
-
| `NicotineInfo.LastUseDate` | Nicotine last use date must be in YYYY-MM format. |
|
|
2113
|
-
| `BirthJurisdiction` | Birth jurisdiction details are required. |
|
|
2114
|
-
| `BirthJurisdiction.Country` | Birth country is required when applicant is not a U.S. citizen. |
|
|
2115
|
-
| `BirthJurisdiction.Country` | Birth country code is invalid. |
|
|
2116
|
-
| `BirthJurisdiction.State` | Birth state is required when applicant is a U.S. citizen. |
|
|
2117
|
-
| `BirthJurisdiction.State` | Birth state code is invalid. |
|
|
2118
|
-
| `ExistingCoverageData.AreExistingPoliciesIssuedByFidelity` | Please indicate whether any existing policies are issued by Fidelity Life Association (required for RI and WV). |
|
|
2119
|
-
| `ExistingCoverageData.ExistingCoverages[n].RequestsYieldIndices` | Please indicate whether yield indices for cash value policies are requested (required for Massachusetts). |
|
|
2120
|
-
| `ExistingCoverageData.ExistingCoverages[n].NotifyPresentInsurer` | Please indicate whether to notify present insurer(s) (required for Oklahoma). |
|
|
2121
|
-
| `ExistingCoverageData.ExistingCoverages[n].WantsPolicySummary` | Please indicate whether you want a policy summary statement (required for Delaware and Georgia). |
|
|
2122
|
-
| `ExistingCoverageData.ExistingCoverages[n].WantsComparativeInformationForm` | Please indicate whether you want a Comparative Information Form (required for Florida). |
|
|
2123
|
-
| `WillOtherCoverageBeReplacedOrFinancedData` | State-specific replacement data is required when other coverage will be replaced or financed. |
|
|
2124
|
-
| `WillOtherCoverageBeReplacedOrFinancedData.AreReplacedPoliciesIssuedByFidelity` | Please indicate whether any policies being replaced are issued by Fidelity Life Association (required for Kansas when replacing or financing coverage). |
|
|
2125
|
-
| `WillOtherCoverageBeReplacedOrFinancedData.OtherInsuranceReplacementData` | Washington replacement disclosure answers are required when replacing or financing coverage. |
|
|
2126
|
-
| `WillOtherCoverageBeReplacedOrFinancedData.OtherInsuranceReplacementData[n]` | Each Washington replacement disclosure question must be answered. |
|
|
2127
|
-
| `WillOtherCoverageBeReplacedOrFinancedData.OtherInsuranceReplacementData[n].Explain` | Please explain is required when the answer is Yes. |
|
|
2128
|
-
|
|
2129
|
-
### GIGDB — Update Quote / Get Existing Quote
|
|
2130
|
-
|
|
2131
|
-
| Field path | Message |
|
|
2132
|
-
|---|---|
|
|
2133
|
-
| `OpportunityId` | OpportunityId is required. |
|
|
2134
|
-
| `OpportunityId` | OpportunityId does not exist. |
|
|
2135
|
-
| `OpportunityId` | OpportunityId does not match selected product. |
|
|
2136
|
-
| `OpportunityId` | Quote update is not allowed when payment is already made. |
|
|
2137
|
-
| `FaceAmount` | Coverage amount (FaceAmount) is required. |
|
|
2138
|
-
| `PaymentFreq` | Payment frequency is required. |
|
|
2139
|
-
| `PaymentFreq` | Invalid payment frequency. |
|
|
2394
|
+
| Code | String Value | Products | When |
|
|
2395
|
+
|---|---|---|---|
|
|
2396
|
+
| `PaymentAlreadyMade` | `'PaymentAlreadyMade'` | ADB, GIGDB | `update*Quote()` or `saveEftPayment()` after EFT is already saved for the opportunity |
|
|
2140
2397
|
|
|
2141
|
-
### IB Term — Start Application additional messages
|
|
2142
2398
|
|
|
2143
|
-
|
|
2144
|
-
|---|---|
|
|
2145
|
-
| `DateOfBirth` | Age must be between 18 and 60 for IB Term. |
|
|
2146
|
-
| `QuoteResponseId` | Child rider was not included in the quote. Cannot add child rider details. |
|
|
2147
|
-
| `ChildRiderInfo` | Child rider details are required because Dependent Child Rider is selected in the quote. |
|
|
2148
|
-
| `AreListedConditionsNotApplicable` | AreListedConditionsNotApplicable is required. |
|
|
2149
|
-
| `IsUsCitizenOrIsPermanentResident` | US citizenship or permanent residency status is required. |
|
|
2150
|
-
| `Height` | Height is required. |
|
|
2151
|
-
| `Height.Feet` | Height feet is required. |
|
|
2152
|
-
| `Height.Feet` | Height feet must be between 1 and 8. |
|
|
2153
|
-
| `Height.Inches` | Height inches is required. |
|
|
2154
|
-
| `Height.Inches` | Height inches must be between 0 and 11. |
|
|
2155
|
-
| `Weight` | Weight is required. |
|
|
2156
|
-
| `Weight` | Weight must be greater than 0. |
|
|
2157
|
-
| `IsHoldingValidDriverLicense` | IsHoldingValidDriverLicense is required. |
|
|
2158
|
-
| `DriverLicenseState` | Driver license state is required when IsHoldingValidDriverLicense is true. |
|
|
2159
|
-
| `DriverLicenseState` | Driver license state must be null when IsHoldingValidDriverLicense is false. |
|
|
2160
|
-
| `DriverLicenseNumber` | Driver license number is required when IsHoldingValidDriverLicense is true. |
|
|
2161
|
-
| `DriverLicenseNumber` | Driver license number format is invalid for the selected driver license state. |
|
|
2162
|
-
| `DriverLicenseNumber` | Driver license number must be null when IsHoldingValidDriverLicense is false. |
|
|
2163
|
-
| `BirthJurisdiction.Country` | Birth jurisdiction country is required. |
|
|
2164
|
-
| `BirthJurisdiction.State` | Birth jurisdiction state is required when birth country is US. |
|
|
2165
|
-
| `BirthJurisdiction.State` | Birth state code is invalid. |
|
|
2166
|
-
| `HasPrimaryCarePhysician` | HasPrimaryCarePhysician is required. |
|
|
2167
|
-
| `PhysicianDetails` | Physician details are required when HasPrimaryCarePhysician is true. |
|
|
2168
|
-
| `PhysicianDetails` | Physician details must be null when HasPrimaryCarePhysician is false. |
|
|
2169
|
-
| `PhysicianDetails.PhysicianName` | Physician name is required when HasPrimaryCarePhysician is true. |
|
|
2170
|
-
| `PhysicianDetails.City` | Physician city/address is required when HasPrimaryCarePhysician is true. |
|
|
2171
|
-
| `PhysicianDetails.StateCode` | Physician state is required when HasPrimaryCarePhysician is true. |
|
|
2172
|
-
| `PhysicianDetails.StateCode` | Outside Of The USA is not allowed for physician state. |
|
|
2173
|
-
| `PhysicianDetails.StateCode` | Physician state code is invalid. |
|
|
2174
|
-
| `PhysicianDetails.LastSeen` | Physician last-seen date is required when HasPrimaryCarePhysician is true. |
|
|
2175
|
-
| `PhysicianDetails.LastSeen` | Physician last-seen date must be in YYYY-MM format and in the past. |
|
|
2176
|
-
| `TobaccoNicotineUsage` | Tobacco nicotine usage details are required. |
|
|
2177
|
-
| `TobaccoNicotineUsage.LastUsedPeriod` | Last used period is required. |
|
|
2178
|
-
| `TobaccoNicotineUsage.LastUsedPeriod` | Last used period must be one of: *(allowed values)*. |
|
|
2179
|
-
| `TobaccoNicotineUsage.LastTimeUsed` | Last time used tobacco/nicotine date is required. |
|
|
2180
|
-
| `TobaccoNicotineUsage.LastTimeUsed` | Last time used tobacco/nicotine date must be in YYYY-MM format. |
|
|
2181
|
-
| `TobaccoNicotineUsage.ProductTypesUsed` | At least one tobacco or nicotine product type must be selected. |
|
|
2182
|
-
| `TobaccoNicotineUsage.ProductTypesUsed` | Each product type must be one of: *(allowed values)*. |
|
|
2183
|
-
| `TobaccoNicotineUsage.CigarUsagePerYear` | Number of times cigars are smoked per year is required when Cigars is selected (i.e. when `ProductTypesUsed` includes `Cigars`). |
|
|
2184
|
-
| `TobaccoNicotineUsage.CigarUsagePerYear` | Cigar usage per year must be greater than 0. |
|
|
2185
|
-
| `TobaccoNicotineUsage.CigarUsagePerYear` | Cigar usage per year must be less than or equal to 999. |
|
|
2186
|
-
|
|
2187
|
-
IB Term shares the state-specific Q-08 messages (MA / OK / DE / GA / FL / RI / WV / KS / WA) with GIGDB — see the GIGDB table above; the field paths are identical.
|
|
2188
|
-
|
|
2189
|
-
### IB Term — Child Rider
|
|
2190
|
-
|
|
2191
|
-
| Field path | Message |
|
|
2192
|
-
|---|---|
|
|
2193
|
-
| `ChildRiderInfo.HasExistingCoverageForChildren` | HasExistingCoverageForChildren is required when child rider info is present. |
|
|
2194
|
-
| `ChildRiderInfo.IsAnyChildTakingMedication` | Child medication knockout question is required. |
|
|
2195
|
-
| `ChildRiderInfo.IsAnyChildDiagnosedWithDisability` | Child disability knockout question is required. |
|
|
2196
|
-
| `ChildRiderInfo.IsAnyChildDiagnosedWithSevereCondition` | Child severe condition knockout question is required. |
|
|
2197
|
-
| `ChildRiderInfo.IsAnyChildAdvisedForSurgery` | Child surgery knockout question is required. |
|
|
2198
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails` | At least one child must be provided when child rider info is present. |
|
|
2199
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails` | Maximum 10 children to be insured details allowed. |
|
|
2200
|
-
| `ChildRiderInfo.ExistingCoverageInfoForChildren` | Existing coverage details required when HasExistingCoverageForChildren is true. |
|
|
2201
|
-
| `ChildRiderInfo.ExistingCoverageInfoForChildren` | Maximum 10 child existing coverage entries allowed. |
|
|
2202
|
-
| `ChildRiderInfo.ExistingCoverageInfoForChildren` | Total insurance amount for child coverages marked as not replacing existing policies must not exceed 100000. |
|
|
2203
|
-
| `ChildRiderInfo.ExistingCoverageInfoForChildren` | Existing coverage details must be empty when HasExistingCoverageForChildren is false. |
|
|
2204
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].FirstName` | Child first name is required. |
|
|
2205
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].FirstName` | Invalid child first name. |
|
|
2206
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].LastName` | Child last name is required. |
|
|
2207
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].LastName` | Invalid child last name. |
|
|
2208
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].Gender` | Child gender is required. |
|
|
2209
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].Gender` | Gender must be Male or Female. |
|
|
2210
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].Height` | Child height is required. |
|
|
2211
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].Height.Feet` | Child height feet is required. |
|
|
2212
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].Height.Feet` | Child height feet must be between 0 and 8. |
|
|
2213
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].Height.Inches` | Child height inches is required. |
|
|
2214
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].Height.Inches` | Child height inches must be between 0 and 11. |
|
|
2215
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].Weight` | Child weight is required. |
|
|
2216
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].Weight` | Child weight must be greater than 0. |
|
|
2217
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].DOB` | Child date of birth is required. |
|
|
2218
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].DOB` | Child date of birth must be in the past. |
|
|
2219
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].DOB` | Child must be between 15 days and under 18 years old. |
|
|
2220
|
-
| `ChildRiderInfo.ChildrenToBeInsuredDetails[n].Relation` | Child relationship is required. |
|
|
2221
|
-
| `ChildRiderInfo.ExistingCoverageInfoForChildren[n].NameOfTheCompany` | Name of the company is required for child existing coverage. |
|
|
2222
|
-
| `ChildRiderInfo.ExistingCoverageInfoForChildren[n].InsuranceAmount` | Insurance amount is required for child existing coverage. |
|
|
2223
|
-
| `ChildRiderInfo.ExistingCoverageInfoForChildren[n].InsuranceAmount` | Insurance amount must be a positive number. |
|
|
2224
|
-
| `ChildRiderInfo.ExistingCoverageInfoForChildren[n].PolicyNumber` | Policy number is required for child existing coverage. |
|
|
2225
|
-
| `ChildRiderInfo.ExistingCoverageInfoForChildren[n].DateOfIssue` | Date of issue is required for child existing coverage. |
|
|
2226
|
-
|
|
2227
|
-
### Shared APIs — EFT Payment
|
|
2228
|
-
|
|
2229
|
-
`POST /api/ThirdPartyPayment/save-eft-payment`
|
|
2230
|
-
|
|
2231
|
-
| Field path | Message |
|
|
2232
|
-
|---|---|
|
|
2233
|
-
| `OpportunityId` | OpportunityId is required. |
|
|
2234
|
-
| `AccountHolderName` | Account holder name is required. |
|
|
2235
|
-
| `AccountHolderName` | Account holder name must be 100 characters or fewer. |
|
|
2236
|
-
| `RoutingNumber` | Routing number is required. |
|
|
2237
|
-
| `RoutingNumber` | Routing number must be 9 digits. |
|
|
2238
|
-
| `AccountNumber` | Account number is required. |
|
|
2239
|
-
| `AccountNumber` | Account number must be 4 to 17 digits. |
|
|
2399
|
+
***
|
|
2240
2400
|
|
|
2241
|
-
###
|
|
2401
|
+
### Secure Sign Errors
|
|
2242
2402
|
|
|
2243
|
-
|
|
|
2244
|
-
|
|
2245
|
-
| `
|
|
2246
|
-
| `
|
|
2247
|
-
| `
|
|
2248
|
-
| `
|
|
2249
|
-
| `
|
|
2250
|
-
| `
|
|
2251
|
-
| `
|
|
2252
|
-
| `
|
|
2253
|
-
| `IsScriptReadConfirmed` | IsScriptReadConfirmed is required. | Verify PIN |
|
|
2254
|
-
| `IsScriptReadConfirmed` | IsScriptReadConfirmed must be true. | Verify PIN |
|
|
2255
|
-
|
|
2256
|
-
### Shared APIs — Final Submit
|
|
2257
|
-
|
|
2258
|
-
`POST /api/ThirdPartyApplication/final-submit`
|
|
2259
|
-
|
|
2260
|
-
| Field path | Message |
|
|
2261
|
-
|---|---|
|
|
2262
|
-
| `opportunityId` | OpportunityId is required. |
|
|
2263
|
-
| `opportunityId` | OpportunityId does not exist. |
|
|
2264
|
-
| `opportunityId` | Application has already been final submitted. *(terminal state — do not retry)* |
|
|
2403
|
+
| Code | String Value | Client methods | When |
|
|
2404
|
+
|---|---|---|---|
|
|
2405
|
+
| `SecureSignRelatedError` | `'SecureSignRelatedError'` | `prepareDocsAndGetDeliveryChannels`, `sendPinAndGetDocumentsLink`, `resendPin`, `verifyPin` | Generic SecureSign failure — retry; if persistent, contact support |
|
|
2406
|
+
| `SigningPackageNotCreated` | `'SigningPackageNotCreated'` | `sendPinAndGetDocumentsLink`, `resendPin`, `verifyPin` | Signing package missing — call `prepareDocsAndGetDeliveryChannels()` first |
|
|
2407
|
+
| `SecureSignPinMismatch` | `'SecureSignPinMismatch'` | `verifyPin` | Wrong PIN entered by applicant |
|
|
2408
|
+
| `PinExpired` | `'PinExpired'` | `verifyPin`, `sendPinAndGetDocumentsLink` | PIN validity window exceeded — call `resendPin()` |
|
|
2409
|
+
| `DocumentsAlreadySigned` | `'DocumentsAlreadySigned'` | `verifyPin`, `sendPinAndGetDocumentsLink`, `resendPin` | Documents already completed |
|
|
2410
|
+
| `InvalidPhoneNumber` | `'InvalidPhoneNumber'` | `sendPinAndGetDocumentsLink`, `resendPin` | Phone number invalid for SMS delivery |
|
|
2411
|
+
| `EmailDeliveryFailed` | `'EmailDeliveryFailed'` | `sendPinAndGetDocumentsLink`, `resendPin` | Email delivery failed — retry or switch to SMS |
|
|
2412
|
+
| `MessageNotDelivered` | `'MessageNotDelivered'` | `sendPinAndGetDocumentsLink`, `resendPin` | SMS delivery failed — retry or switch to email |
|
|
2265
2413
|
|
|
2266
|
-
> **Authorization** (Secure Sign + Final Submit): HTTP `403` when the `opportunityId` is not authorized for the agent token. This is enforced by middleware and not captured in the `error` / `value.fields` envelope.
|
|
2267
2414
|
|
|
2415
|
+
***
|
|
2268
2416
|
|
|
2269
|
-
|
|
2417
|
+
### Final Submit Errors
|
|
2270
2418
|
|
|
2271
|
-
|
|
2419
|
+
| Code | String Value | When |
|
|
2420
|
+
|---|---|---|
|
|
2421
|
+
| `PaymentNotMade` | `'paymentNotMade'` | EFT not saved — call `saveEftPayment()` before `finalSubmit()` |
|
|
2422
|
+
| `FidelityFinalSubmitError` | `'FidelityFinalSubmitError'` | Fidelity carrier rejected or failed to process the submission — contact support with the `opportunityId` |
|
|
2272
2423
|
|
|
2273
|
-
Pass `'sandbox'` or `'production'` to `InstaBrainClient.forEnvironment()`. The SDK handles all routing internally.
|
|
2274
2424
|
|
|
2275
|
-
|
|
2276
|
-
// Sandbox - for development and testing
|
|
2277
|
-
const client = InstaBrainClient.forEnvironment('sandbox');
|
|
2425
|
+
***
|
|
2278
2426
|
|
|
2279
|
-
|
|
2280
|
-
const client = InstaBrainClient.forEnvironment('production');
|
|
2281
|
-
```
|
|
2427
|
+
### Session
|
|
2282
2428
|
|
|
2283
|
-
|
|
2429
|
+
| Code | String Value | When |
|
|
2430
|
+
|---|---|---|
|
|
2431
|
+
| `AgentLogout` | `'AgentLogout'` | JWT expired — re-authenticate |
|
|
2284
2432
|
|
|
2285
|
-
---
|
|
2286
2433
|
|
|
2287
|
-
|
|
2434
|
+
***
|
|
2288
2435
|
|
|
2436
|
+
### Deprecated codes (reference only)
|
|
2289
2437
|
|
|
2290
|
-
|
|
2291
|
-
| ------------------- | ------------------------- | ----------------------------------------------------------- |
|
|
2292
|
-
| `isAuthenticated()` | `() => boolean` | Returns `true` if a JWT is currently stored |
|
|
2293
|
-
| `getCurrentToken()` | `() => string | null` |
|
|
2294
|
-
| `setToken(token)` | `(token: string) => void` | Manually set a JWT (e.g., restored from persistent storage) |
|
|
2295
|
-
| `logout()` | `() => void` | Clears the stored JWT |
|
|
2296
|
-
| `getBaseUrl()` | `() => string` | Returns the configured base URL (for debugging only) |
|
|
2438
|
+
Not documented as active responses. Kept on `APIErrorCode` for older integrations; prefer `InvalidRequestFormat` / `value.fields` (or `QuoteNotFound` → get-existing-quote field messages).
|
|
2297
2439
|
|
|
2440
|
+
| Code | String value |
|
|
2441
|
+
|---|---|
|
|
2442
|
+
| `QuoteNotFound` | `'QuoteNotFound'` |
|
|
2443
|
+
| `HeightNotValid` | `'HeightNotValid'` |
|
|
2444
|
+
| `DocumentsNotViewed` | `'DocumentsNotViewed'` |
|
|
2445
|
+
| `ThirdPartyQuoteError` | `'ThirdPartyQuoteError'` |
|
|
2446
|
+
| `ErrorInSaveEftPaymentDetails` | `'ErrorInSaveEftPaymentDetails'` |
|
|
2447
|
+
| `InvalidBirthCountry` | `'InvalidBirthCountry'` |
|
|
2448
|
+
| `InvalidBirthState` | `'InvalidBirthState'` |
|
|
2449
|
+
| `InvalidResidenceState` | `'InvalidResidenceState'` |
|
|
2450
|
+
| `OneOfTheExistingCoveragesQuestionsNotFound` | `'OneOfTheExistingCoveragesQuestionsNotFound'` |
|
|
2451
|
+
| `InvalidPaymentScheduledDate` | `'InvalidPaymentScheduledDate'` |
|
|
2452
|
+
| `InvalidQuoteParameters` | `'InvalidQuoteParameters'` |
|
|
2453
|
+
| `InvalidStateCode` | `'InvalidStateCode'` |
|
|
2454
|
+
| `InvalidAdbAgeRange` | `'InvalidAdbAgeRange'` |
|
|
2298
2455
|
|
|
2299
2456
|
---
|
|
2300
2457
|
|
|
2301
|
-
##
|
|
2458
|
+
## Environment Configuration
|
|
2459
|
+
|
|
2460
|
+
```typescript
|
|
2461
|
+
const client = InstaBrainClient.forEnvironment('sandbox'); // development
|
|
2462
|
+
const client = InstaBrainClient.forEnvironment('production'); // production
|
|
2463
|
+
```
|
|
2302
2464
|
|
|
2303
|
-
|
|
2465
|
+
Sandbox and production credentials are provisioned independently.
|
|
2304
2466
|
|
|
2467
|
+
---
|
|
2305
2468
|
|
|
2306
|
-
|
|
2307
|
-
| ---------------------------- | ---------------------------------------------------- |
|
|
2308
|
-
| `basic-usage.ts` | Authentication and basic quote/application flows |
|
|
2309
|
-
| `error-handling.ts` | Error catching and handling patterns |
|
|
2310
|
-
| `api-constraints-example.ts` | State restrictions, age limits, and validation rules |
|
|
2311
|
-
| `reports-example.ts` | Prospects, sales, and applications reporting |
|
|
2469
|
+
## Token Management
|
|
2312
2470
|
|
|
2471
|
+
| Method | Signature | Description |
|
|
2472
|
+
|---|---|---|
|
|
2473
|
+
| `isAuthenticated()` | `() => boolean` | `true` if a JWT is currently stored |
|
|
2474
|
+
| `getCurrentToken()` | `() => string \| null` | Returns the current JWT |
|
|
2475
|
+
| `setToken(token)` | `(token: string) => void` | Manually set a JWT (e.g. restored from persistent storage) |
|
|
2476
|
+
| `logout()` | `() => void` | Clears the stored JWT |
|
|
2477
|
+
| `getBaseUrl()` | `() => string` | Returns the configured base URL |
|
|
2313
2478
|
|
|
2314
2479
|
---
|
|
2315
2480
|
|
|
2316
|
-
##
|
|
2481
|
+
## Examples Directory
|
|
2317
2482
|
|
|
2318
|
-
|
|
2483
|
+
| File | Description |
|
|
2484
|
+
|---|---|
|
|
2485
|
+
| `basic-usage.ts` | Authentication and basic quote/application flows |
|
|
2486
|
+
| `error-handling.ts` | Error catching and handling patterns |
|
|
2487
|
+
| `api-constraints-example.ts` | State restrictions, age limits, and SDK validation patterns |
|
|
2488
|
+
| `reports-example.ts` | Prospects, sales, and applications reporting |
|
|
2319
2489
|
|
|
2320
2490
|
---
|
|
2321
2491
|
|
|
@@ -2323,4 +2493,3 @@ See [CHANGELOG.md](./CHANGELOG.md).
|
|
|
2323
2493
|
|
|
2324
2494
|
- **Email:** [helpdesk@instabrain.io](mailto:helpdesk@instabrain.io)
|
|
2325
2495
|
- **Website:** [https://www.instabrain.io](https://www.instabrain.io)
|
|
2326
|
-
|