@signalhouse-sms/sdk 1.8.0 → 1.9.0

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.
@@ -66,48 +66,19 @@
66
66
  */
67
67
  /**
68
68
  * @typedef {Object} TollFreeBrandDetails
69
- * @property {string} [businessRegistrationType] - The business registration type (required unless businessVerificationId is sent, one of EIN, CBN, NEQ, PROVINCIAL_NUMBER, CRN, VAT, ACN, ABN, BRN, SIREN, SIRET, NZBN, UST_IDNR, CIF, NIF, CNPJ, UID, OTHER)
69
+ * @property {string} businessRegistrationType - The business registration type (required, one of EIN, CBN, NEQ, PROVINCIAL_NUMBER, CRN, VAT, ACN, ABN, BRN, SIREN, SIRET, NZBN, UST_IDNR, CIF, NIF, CNPJ, UID, OTHER)
70
70
  * @property {string} legalEntityType - The legal entity type (required, one of PRIVATE_COMPANY, PUBLIC_COMPANY, NON_PROFIT, GOVERNMENT, SOLE_PROPRIETOR)
71
- * @property {string} [taxId] - The business tax identifier (required unless businessVerificationId is sent, at most 50 characters)
72
- * @property {string} [countryCode] - The business country code (required unless businessVerificationId is sent, 2-letter ISO code)
71
+ * @property {string} taxId - The business tax identifier (required, at most 50 characters)
72
+ * @property {string} countryCode - The business country code (required, 2-letter ISO code; "US" or "CA" when the group's toll-free brands are reviewed on submit)
73
73
  * @property {string} supportPhone - The customer-support phone number (required, E.164 with an optional leading "+" and no spaces, parentheses or hyphens, e.g. "17025550100")
74
74
  * @property {string} [taxIdIssuingCountry] - The country that issued the tax ID (optional, 2-letter ISO code)
75
75
  * @property {string} [businessDBA] - The business "doing business as" name (optional, at most 255 characters)
76
- * @property {string} [businessWebsite] - The customer's real website, sent to Infobip for brand verification (optional, valid URL, at most 255 characters; distinct from the top-level website / landing URL)
77
- * @property {string} [businessVerificationId] - The ID of the business verification the brand uses (starts with BV). Required for a group whose toll-free brands need a business verification, and must name a VERIFIED one of the brand's group (in a group that verifies each subgroup's business separately, of the brand's subgroup); refused (400) for any other group. Set at creation only: it can't be changed
78
- */
79
- /**
80
- * @typedef {Object} BusinessVerificationDetails
81
- * @property {string} businessName - The legal business name (required, at most 255 characters)
82
- * @property {string} businessType - The business type (required, one of CO_OPERATIVE, CORPORATION, LIMITED_LIABILITY_CORPORATION, NON_PROFIT_CORPORATION, PARTNERSHIP)
83
- * @property {string} industry - The business industry (required, one of AGRICULTURE, AUTOMOTIVE, BANKING, CONSTRUCTION, CONSUMER, EDUCATION, ELECTRONICS, ENGINEERING, ENERGY, FAST_MOVING_CONSUMER_GOODS, FINANCIAL, FINTECH, FOOD_AND_BEVERAGE, GOVERNMENT, HEALTHCARE, HOSPITALITY, INSURANCE, JEWELRY, LEGAL, MANUFACTURING, MEDIA, NOT_FOR_PROFIT, OIL_AND_GAS, ONLINE, PROFESSIONAL_SERVICES, RAW_MATERIALS, REAL_ESTATE, RELIGION, RETAIL, TECHNOLOGY, TELECOMMUNICATIONS, TRANSPORTATION, TRAVEL)
84
- * @property {string} registrationType - The business registration type (required, one of EIN, CBN, NEQ, PROVINCIAL_NUMBER, CRN, VAT, ACN, ABN, BRN, SIREN, SIRET, NZBN, UST_IDNR, CIF, NIF, CNPJ, UID, OTHER)
85
- * @property {string} registrationNumber - The business registration number, e.g. the EIN (required, at most 50 characters)
86
- * @property {string} website - The business website (required, valid URL, at most 255 characters)
87
- * @property {string} street - The business street address (required, at most 255 characters)
88
- * @property {string} [street2] - The second line of the street address (optional, at most 255 characters)
89
- * @property {string} city - The business city (required, at most 100 characters)
90
- * @property {string} state - The business state or province (required, 2-letter code)
91
- * @property {string} postalCode - The business postal code (required, at most 10 characters)
92
- * @property {string} country - The business country (required, "US" or "CA")
93
- * @property {Object} representative - The business's authorized representative (required)
94
- * @property {string} representative.firstName - The representative's first name (required, at most 100 characters)
95
- * @property {string} representative.lastName - The representative's last name (required, at most 100 characters)
96
- * @property {string} representative.email - The representative's email address (required, valid email, at most 100 characters)
97
- * @property {string} representative.phone - The representative's phone number (required, E.164 with an optional leading "+" and no spaces, parentheses or hyphens, e.g. "+17025550100")
98
- * @property {string} representative.jobTitle - The representative's job title (required, at most 100 characters)
99
- * @property {string} representative.jobLevel - The representative's job level (required, one of DIRECTOR, GM, VP, CEO, CFO, GENERAL_COUNSEL, OTHER)
100
- */
101
- /**
102
- * @typedef {Object} BusinessVerification
103
- * @property {string} businessVerificationId - The business verification's ID (starts with BV)
104
- * @property {string} groupId - The group it belongs to
105
- * @property {string} [subgroupId] - The subgroup whose business it verifies; present only in a group that verifies each subgroup's business separately
106
- * @property {string} status - SUBMITTING, IN_REVIEW, VERIFIED or NEEDS_CHANGES
107
- * @property {BusinessVerificationDetails} details - The submitted details
108
- * @property {string} submittedAt - When it was last submitted (ISO date)
109
- * @property {string|null} reviewedAt - When it was last reviewed (ISO date), or null
110
- * @property {string|null} rejectionReason - Why it needs changes, or null
76
+ * @property {string} [businessWebsite] - The customer's real website, sent to the toll-free carrier for verification (optional, valid URL, at most 255 characters; distinct from the top-level website / landing URL)
77
+ * @property {string} [businessStructure] - The business structure (one of CO_OPERATIVE, CORPORATION, LIMITED_LIABILITY_CORPORATION, NON_PROFIT_CORPORATION, PARTNERSHIP). Required when the group's toll-free brands are reviewed on submit; refused (400) otherwise
78
+ * @property {string} [industry] - The business industry (one of AGRICULTURE, AUTOMOTIVE, BANKING, CONSTRUCTION, CONSUMER, EDUCATION, ELECTRONICS, ENGINEERING, ENERGY, FAST_MOVING_CONSUMER_GOODS, FINANCIAL, FINTECH, FOOD_AND_BEVERAGE, GOVERNMENT, HEALTHCARE, HOSPITALITY, INSURANCE, JEWELRY, LEGAL, MANUFACTURING, MEDIA, NOT_FOR_PROFIT, OIL_AND_GAS, ONLINE, PROFESSIONAL_SERVICES, RAW_MATERIALS, REAL_ESTATE, RELIGION, RETAIL, TECHNOLOGY, TELECOMMUNICATIONS, TRANSPORTATION, TRAVEL). Required when the group's toll-free brands are reviewed on submit; refused (400) otherwise
79
+ * @property {string} [contactEmail] - The email address of the contact named by firstName and lastName (valid email, at most 100 characters). Required when the group's toll-free brands are reviewed on submit; refused (400) otherwise
80
+ * @property {string} [contactJobTitle] - The contact's job title (at most 100 characters). Required when the group's toll-free brands are reviewed on submit; refused (400) otherwise
81
+ * @property {string} [contactJobLevel] - The contact's job level (one of DIRECTOR, GM, VP, CEO, CFO, GENERAL_COUNSEL, OTHER). Required when the group's toll-free brands are reviewed on submit; refused (400) otherwise
111
82
  */
112
83
  /**
113
84
  * @typedef {Object} TollFreeIsvAccount
@@ -119,20 +90,23 @@
119
90
  * @property {string} updatedAt - When the account or its API key was last saved (ISO date)
120
91
  */
121
92
  /**
122
- * Toll-free brand data. When tollFree.businessVerificationId is sent, the legal fields (companyName, street, city, state,
123
- * postalCode, country, firstName, lastName and tollFree's businessRegistrationType, taxId, countryCode and
124
- * taxIdIssuingCountry) are optional: the business verification's values replace any that are sent.
93
+ * Toll-free brand data. When the group's toll-free brands are reviewed on submit (see getTollFreeRequirements), tollFree
94
+ * also needs businessStructure, industry, contactEmail, contactJobTitle and contactJobLevel, tollFree.countryCode must be
95
+ * "US" or "CA", and state must be a 2-letter state or province code. Any other group is refused those five fields.
96
+ * Such a brand's business details can't be changed after it's submitted: companyName, street, city, state, postalCode,
97
+ * country, firstName, lastName and tollFree's businessRegistrationType, taxId, countryCode, taxIdIssuingCountry,
98
+ * businessStructure, industry, contactEmail, contactJobTitle and contactJobLevel.
125
99
  * @typedef {Object} CreateTollFreeBrandData
126
100
  * @property {string} subgroupId - The ID of the subgroup to create the brand under (required, exactly 8 characters)
127
101
  * @property {string} displayName - The display name for the brand (required, at most 255 characters)
128
- * @property {string} [companyName] - The company name for the brand (required unless tollFree.businessVerificationId is sent, at most 255 characters)
129
- * @property {string} [street] - The street address of the primary contact for the brand (required unless tollFree.businessVerificationId is sent, at most 255 characters)
130
- * @property {string} [city] - The city of the primary contact for the brand (required unless tollFree.businessVerificationId is sent, at most 100 characters)
131
- * @property {string} [state] - The state of the primary contact for the brand (required unless tollFree.businessVerificationId is sent, at most 20 characters; must be a valid 2-letter US state code when country is "US")
132
- * @property {string} [postalCode] - The postal code of the primary contact for the brand (required unless tollFree.businessVerificationId is sent, at most 10 characters)
133
- * @property {string} email - The email address of the primary contact for the brand (required, valid email, at most 100 characters)
134
- * @property {string} [firstName] - The first name of the primary contact for the brand (required unless tollFree.businessVerificationId is sent, at most 100 characters)
135
- * @property {string} [lastName] - The last name of the primary contact for the brand (required unless tollFree.businessVerificationId is sent, at most 100 characters)
102
+ * @property {string} companyName - The company name for the brand (required, at most 255 characters)
103
+ * @property {string} street - The street address of the primary contact for the brand (required, at most 255 characters)
104
+ * @property {string} city - The city of the primary contact for the brand (required, at most 100 characters)
105
+ * @property {string} state - The state of the primary contact for the brand (required, at most 20 characters; must be a valid 2-letter US state code when country is "US", and a 2-letter state or province code when the group's toll-free brands are reviewed on submit)
106
+ * @property {string} postalCode - The postal code of the primary contact for the brand (required, at most 10 characters)
107
+ * @property {string} email - The brand's support email address (required, valid email, at most 100 characters)
108
+ * @property {string} firstName - The first name of the primary contact for the brand (required, at most 100 characters)
109
+ * @property {string} lastName - The last name of the primary contact for the brand (required, at most 100 characters)
136
110
  * @property {string} website - The website URL for the brand (required, valid URL, at most 255 characters)
137
111
  * @property {TollFreeBrandDetails} tollFree - The Toll-Free brand details (required)
138
112
  * @property {string} [referenceId] - A unique reference for the brand (optional, at most 50 characters)
@@ -144,6 +118,11 @@
144
118
  * @property {string} [landingId] - The ID of the landing page associated with the brand (optional)
145
119
  * @property {string} [country] - The country code of the primary contact for the brand (optional, 2-letter code; when "US", state must be a valid 2-letter US state code)
146
120
  */
121
+ /**
122
+ * @typedef {Object} TollFreeRequirements
123
+ * @property {string} groupId - The group the requirements are for
124
+ * @property {boolean} reviewsBusinessOnSubmit - Whether the group's new toll-free brands are reviewed when they're submitted. When true, a new toll-free brand needs tollFree.businessStructure, industry, contactEmail, contactJobTitle and contactJobLevel, a tollFree.countryCode of "US" or "CA" and a 2-letter state or province code; it stays DCA_PENDING until it's reviewed, and its business details can't be changed after it's submitted. When false, those five fields are refused
125
+ */
147
126
  /**
148
127
  * @typedef {Object} CreateShortCodeBrandData
149
128
  * @property {string} subgroupId - The ID of the subgroup to create the brand under.
@@ -168,8 +147,7 @@ export class Brands {
168
147
  admin: {
169
148
  /**
170
149
  * Get a group's toll-free ISV account: the group's own top-level account at the toll-free provider, used when its
171
- * subgroups are separate businesses. Each subgroup gets an account and business verifications of its own under it.
172
- * Staff only.
150
+ * subgroups are separate businesses. Each subgroup gets an account of its own under it. Staff only.
173
151
  * @async
174
152
  * @roles signalhouse_api, signalhouse_admin, signalhouse_user
175
153
  * @param {Object} params - The parameters for getting the toll-free ISV account
@@ -231,7 +209,7 @@ export class Brands {
231
209
  * @param {boolean} [params.excludeDeleted] - Staff-only: hide DELETED brands when no status is given
232
210
  * @param {boolean} [params.includeTotal] - Staff-only: with page and limit, return `{ data, total, page, limit, totalPages }` instead of the array
233
211
  * @param {RequestOptions} [params.options] - Additional options for the request
234
- * @returns {Promise<SdkResponse<Array<{ _id: string, brandId: string|null, status: string, registrationType: string, tollFree?: { isBrandReady?: boolean, maxNumbersPerCampaign?: number, maxOptInMethods?: number, requiresPrivacyPolicy?: boolean, requiresTermsAndConditions?: boolean, maxAppealReasonLength?: number, labelsSamples?: boolean, supportsMms?: boolean, usesBusinessVerification?: boolean, businessVerificationId?: string|null, [key: string]: any }, [key: string]: any }>|{ data: Array<Object>, total: number, page: number, limit: number, totalPages: number }>>} Brand records. For 10DLC brands in PENDING_CREATION (or rejected before carrier assignment), brandId is null — poll by _id until status advances and brandId is assigned. Toll-free brands carry `tollFree.isBrandReady` (whether the brand can host campaigns), `tollFree.maxNumbersPerCampaign` (the most numbers one of its campaigns can hold), `tollFree.maxOptInMethods` (the most opt-in methods one of its campaigns can declare), `tollFree.requiresPrivacyPolicy` (whether its campaigns need a privacy policy URL), `tollFree.requiresTermsAndConditions` (whether its campaigns need a terms and conditions URL), `tollFree.maxAppealReasonLength` (the longest appeal reason its campaigns may give), `tollFree.labelsSamples` (whether its campaigns' sample messages each start with their use case's name), `tollFree.supportsMms` (whether its numbers can send MMS and group messages), `tollFree.usesBusinessVerification` (whether it waits on its own business verification) and `tollFree.businessVerificationId` (the ID of the business verification it uses, or null when it uses none). The staff-only list (no id/subgroupId/groupId) returns the `{ data, total, page, limit, totalPages }` envelope only when includeTotal is sent with page and limit. Each brand carries `carrierSuspensions` (carrier brand suspension rules; active while liftedAt is null).
212
+ * @returns {Promise<SdkResponse<Array<{ _id: string, brandId: string|null, status: string, registrationType: string, tollFree?: { isBrandReady?: boolean, maxNumbersPerCampaign?: number, maxOptInMethods?: number, requiresPrivacyPolicy?: boolean, requiresTermsAndConditions?: boolean, maxAppealReasonLength?: number, labelsSamples?: boolean, supportsMms?: boolean, reviewsBusinessOnSubmit?: boolean, businessStructure?: string|null, industry?: string|null, contactEmail?: string|null, contactJobTitle?: string|null, contactJobLevel?: string|null, rejectionReason?: string|null, [key: string]: any }, [key: string]: any }>|{ data: Array<Object>, total: number, page: number, limit: number, totalPages: number }>>} Brand records. For 10DLC brands in PENDING_CREATION (or rejected before carrier assignment), brandId is null — poll by _id until status advances and brandId is assigned. Toll-free brands carry `tollFree.isBrandReady` (whether the brand can host campaigns), `tollFree.maxNumbersPerCampaign` (the most numbers one of its campaigns can hold), `tollFree.maxOptInMethods` (the most opt-in methods one of its campaigns can declare), `tollFree.requiresPrivacyPolicy` (whether its campaigns need a privacy policy URL), `tollFree.requiresTermsAndConditions` (whether its campaigns need a terms and conditions URL), `tollFree.maxAppealReasonLength` (the longest appeal reason its campaigns may give), `tollFree.labelsSamples` (whether its campaigns' sample messages each start with their use case's name), `tollFree.supportsMms` (whether its numbers can send MMS and group messages) and `tollFree.reviewsBusinessOnSubmit` (whether it's reviewed when it's submitted and keeps its business details from then on). A brand reviewed on submit also carries its `tollFree.businessStructure`, `tollFree.industry`, `tollFree.contactEmail`, `tollFree.contactJobTitle` and `tollFree.contactJobLevel`, and `tollFree.rejectionReason` (why its review rejected it, in plain English, or null). On other toll-free brands these are null or absent. The staff-only list (no id/subgroupId/groupId) returns the `{ data, total, page, limit, totalPages }` envelope only when includeTotal is sent with page and limit. Each brand carries `carrierSuspensions` (carrier brand suspension rules; active while liftedAt is null).
235
213
  */
236
214
  getBrands({ id, subgroupId, groupId, page, limit, status, registrationType, currentTollFreeCarrier, search, sortBy, sortOrder, entityType, ein, email, referenceId, groupIds, createdFrom, createdTo, excludeDeleted, includeTotal, options, }: {
237
215
  id?: string;
@@ -269,8 +247,13 @@ export class Brands {
269
247
  maxAppealReasonLength?: number;
270
248
  labelsSamples?: boolean;
271
249
  supportsMms?: boolean;
272
- usesBusinessVerification?: boolean;
273
- businessVerificationId?: string | null;
250
+ reviewsBusinessOnSubmit?: boolean;
251
+ businessStructure?: string | null;
252
+ industry?: string | null;
253
+ contactEmail?: string | null;
254
+ contactJobTitle?: string | null;
255
+ contactJobLevel?: string | null;
256
+ rejectionReason?: string | null;
274
257
  [key: string]: any;
275
258
  };
276
259
  [key: string]: any;
@@ -310,7 +293,10 @@ export class Brands {
310
293
  options?: RequestOptions;
311
294
  }): Promise<SdkResponse<any>>;
312
295
  /**
313
- * Create a new Toll-Free (TFN) brand
296
+ * Create a new Toll-Free (TFN) brand. When the group's toll-free brands are reviewed on submit (see
297
+ * getTollFreeRequirements), the brand stays DCA_PENDING until it's reviewed, then becomes DCA_ACTIVE, or DCA_REJECTED
298
+ * with tollFree.rejectionReason saying why. Its business details can't be changed after it's submitted, so a rejected
299
+ * brand is fixed by creating it again with the corrections.
314
300
  * @async
315
301
  * @roles api, admin, developer, billing, user
316
302
  * @param {Object} params - The parameters for creating the toll-free brand
@@ -324,85 +310,20 @@ export class Brands {
324
310
  options?: RequestOptions;
325
311
  }): Promise<SdkResponse<any>>;
326
312
  /**
327
- * List a group's business verifications, newest first, and whether its toll-free brands need one. Some groups verify
328
- * each subgroup's business separately: a platform whose subgroups are separate businesses, set up by Signal House. For
329
- * those groups pass the subgroup whose business verifications to list.
313
+ * Get whether a group's new toll-free brands are reviewed when they're submitted, which decides the details
314
+ * createTollFreeBrand needs.
330
315
  * @async
331
316
  * @roles api, admin, developer, billing, user
332
- * @param {Object} params - The parameters for listing the business verifications
333
- * @param {string} params.groupId - The ID of the group whose business verifications to list
334
- * @param {string} [params.subgroupId] - The subgroup whose business verifications to list, sent as a query parameter only when given. Required for a group that verifies each subgroup's business separately; for any other group it must be one of the group's subgroups and is otherwise ignored
317
+ * @param {Object} params - The parameters for getting the toll-free requirements
318
+ * @param {string} params.groupId - The ID of the group whose toll-free requirements to get
335
319
  * @param {RequestOptions} [params.options] - Additional options for the request
336
320
  * @throws {Error} Throws an error if the groupId parameter is missing
337
- * @returns {Promise<SdkResponse<{ groupId: string, subgroupId?: string, required: boolean, businessVerifications: Array<BusinessVerification> }>>} The business verifications, newest first. `subgroupId` is present only when they belong to one subgroup. `required` says whether the group's new toll-free brands need a business verification: each one names a VERIFIED business verification as `tollFree.businessVerificationId`. The API returns 400 when the group verifies each subgroup's business separately and no subgroupId is given, and 404 when the subgroup is not in the group.
338
- */
339
- getBusinessVerifications({ groupId, subgroupId, options }: {
340
- groupId: string;
341
- subgroupId?: string;
342
- options?: RequestOptions;
343
- }): Promise<SdkResponse<{
344
- groupId: string;
345
- subgroupId?: string;
346
- required: boolean;
347
- businessVerifications: Array<BusinessVerification>;
348
- }>>;
349
- /**
350
- * Get one of a group's business verifications by its ID.
351
- * @async
352
- * @roles api, admin, developer, billing, user
353
- * @param {Object} params - The parameters for getting the business verification
354
- * @param {string} params.groupId - The ID of the group the business verification belongs to
355
- * @param {string} params.businessVerificationId - The ID of the business verification to get (starts with BV)
356
- * @param {RequestOptions} [params.options] - Additional options for the request
357
- * @throws {Error} Throws an error if the groupId or businessVerificationId parameter is missing
358
- * @returns {Promise<SdkResponse<BusinessVerification & { required: boolean }>>} The business verification, plus `required` (whether the group's new toll-free brands need one). The API returns 404 when it isn't one of the group's.
359
- */
360
- getBusinessVerification({ groupId, businessVerificationId, options }: {
361
- groupId: string;
362
- businessVerificationId: string;
363
- options?: RequestOptions;
364
- }): Promise<SdkResponse<BusinessVerification & {
365
- required: boolean;
366
- }>>;
367
- /**
368
- * Create and submit a new business verification for a group, or for one subgroup in a group that verifies each
369
- * subgroup's business separately. Review usually takes 1–2 business days; once it is VERIFIED, new toll-free brands
370
- * can use it by naming it as `tollFree.businessVerificationId`.
371
- * @async
372
- * @roles api, admin, developer, billing, user
373
- * @param {Object} params - The parameters for creating the business verification
374
- * @param {string} params.groupId - The ID of the group the business verification is for (must be the caller's active group)
375
- * @param {string} [params.subgroupId] - The subgroup whose business it verifies, sent as a query parameter only when given. Required for a group that verifies each subgroup's business separately; for any other group it must be one of the group's subgroups and is otherwise ignored. The subgroup must be active
376
- * @param {BusinessVerificationDetails} params.details - The business verification details (see BusinessVerificationDetails typedef for details)
377
- * @param {RequestOptions} [params.options] - Additional options for the request
378
- * @throws {Error} Throws an error if the groupId or details parameter is missing
379
- * @returns {Promise<SdkResponse<BusinessVerification>>} A 202 with the new business verification, now SUBMITTING. The API returns 400 when the group's toll-free brands don't need a business verification, when the group verifies each subgroup's business separately and no subgroupId is given, or when the subgroup is inactive, and 404 when the subgroup is not in the group.
321
+ * @returns {Promise<SdkResponse<TollFreeRequirements>>} The group's toll-free requirements (see TollFreeRequirements typedef for details). The API returns 403 when the caller can't view the group.
380
322
  */
381
- createBusinessVerification({ groupId, subgroupId, details, options }: {
323
+ getTollFreeRequirements({ groupId, options }: {
382
324
  groupId: string;
383
- subgroupId?: string;
384
- details: BusinessVerificationDetails;
385
325
  options?: RequestOptions;
386
- }): Promise<SdkResponse<BusinessVerification>>;
387
- /**
388
- * Correct and resubmit a business verification that needs changes. Allowed only while its status is NEEDS_CHANGES.
389
- * Review usually takes 1–2 business days; the toll-free brands that use it stay pending until it is verified.
390
- * @async
391
- * @roles api, admin, developer, billing, user
392
- * @param {Object} params - The parameters for updating the business verification
393
- * @param {string} params.groupId - The ID of the group the business verification belongs to (must be the caller's active group)
394
- * @param {string} params.businessVerificationId - The ID of the business verification to update (starts with BV)
395
- * @param {BusinessVerificationDetails} params.details - The corrected business verification details (see BusinessVerificationDetails typedef for details)
396
- * @param {RequestOptions} [params.options] - Additional options for the request
397
- * @throws {Error} Throws an error if the groupId, businessVerificationId or details parameter is missing
398
- * @returns {Promise<SdkResponse<BusinessVerification>>} A 202 with the business verification, now SUBMITTING. The API returns 400 when it doesn't need changes, and 404 when it isn't one of the group's.
399
- */
400
- updateBusinessVerification({ groupId, businessVerificationId, details, options }: {
401
- groupId: string;
402
- businessVerificationId: string;
403
- details: BusinessVerificationDetails;
404
- options?: RequestOptions;
405
- }): Promise<SdkResponse<BusinessVerification>>;
326
+ }): Promise<SdkResponse<TollFreeRequirements>>;
406
327
  /**
407
328
  * Create a local Short Code brand for manual Signal House review.
408
329
  * @async
@@ -797,21 +718,21 @@ export type UpdateBrandData = {
797
718
  };
798
719
  export type TollFreeBrandDetails = {
799
720
  /**
800
- * - The business registration type (required unless businessVerificationId is sent, one of EIN, CBN, NEQ, PROVINCIAL_NUMBER, CRN, VAT, ACN, ABN, BRN, SIREN, SIRET, NZBN, UST_IDNR, CIF, NIF, CNPJ, UID, OTHER)
721
+ * - The business registration type (required, one of EIN, CBN, NEQ, PROVINCIAL_NUMBER, CRN, VAT, ACN, ABN, BRN, SIREN, SIRET, NZBN, UST_IDNR, CIF, NIF, CNPJ, UID, OTHER)
801
722
  */
802
- businessRegistrationType?: string;
723
+ businessRegistrationType: string;
803
724
  /**
804
725
  * - The legal entity type (required, one of PRIVATE_COMPANY, PUBLIC_COMPANY, NON_PROFIT, GOVERNMENT, SOLE_PROPRIETOR)
805
726
  */
806
727
  legalEntityType: string;
807
728
  /**
808
- * - The business tax identifier (required unless businessVerificationId is sent, at most 50 characters)
729
+ * - The business tax identifier (required, at most 50 characters)
809
730
  */
810
- taxId?: string;
731
+ taxId: string;
811
732
  /**
812
- * - The business country code (required unless businessVerificationId is sent, 2-letter ISO code)
733
+ * - The business country code (required, 2-letter ISO code; "US" or "CA" when the group's toll-free brands are reviewed on submit)
813
734
  */
814
- countryCode?: string;
735
+ countryCode: string;
815
736
  /**
816
737
  * - The customer-support phone number (required, E.164 with an optional leading "+" and no spaces, parentheses or hyphens, e.g. "17025550100")
817
738
  */
@@ -825,108 +746,29 @@ export type TollFreeBrandDetails = {
825
746
  */
826
747
  businessDBA?: string;
827
748
  /**
828
- * - The customer's real website, sent to Infobip for brand verification (optional, valid URL, at most 255 characters; distinct from the top-level website / landing URL)
749
+ * - The customer's real website, sent to the toll-free carrier for verification (optional, valid URL, at most 255 characters; distinct from the top-level website / landing URL)
829
750
  */
830
751
  businessWebsite?: string;
831
752
  /**
832
- * - The ID of the business verification the brand uses (starts with BV). Required for a group whose toll-free brands need a business verification, and must name a VERIFIED one of the brand's group (in a group that verifies each subgroup's business separately, of the brand's subgroup); refused (400) for any other group. Set at creation only: it can't be changed
833
- */
834
- businessVerificationId?: string;
835
- };
836
- export type BusinessVerificationDetails = {
837
- /**
838
- * - The legal business name (required, at most 255 characters)
753
+ * - The business structure (one of CO_OPERATIVE, CORPORATION, LIMITED_LIABILITY_CORPORATION, NON_PROFIT_CORPORATION, PARTNERSHIP). Required when the group's toll-free brands are reviewed on submit; refused (400) otherwise
839
754
  */
840
- businessName: string;
755
+ businessStructure?: string;
841
756
  /**
842
- * - The business type (required, one of CO_OPERATIVE, CORPORATION, LIMITED_LIABILITY_CORPORATION, NON_PROFIT_CORPORATION, PARTNERSHIP)
757
+ * - The business industry (one of AGRICULTURE, AUTOMOTIVE, BANKING, CONSTRUCTION, CONSUMER, EDUCATION, ELECTRONICS, ENGINEERING, ENERGY, FAST_MOVING_CONSUMER_GOODS, FINANCIAL, FINTECH, FOOD_AND_BEVERAGE, GOVERNMENT, HEALTHCARE, HOSPITALITY, INSURANCE, JEWELRY, LEGAL, MANUFACTURING, MEDIA, NOT_FOR_PROFIT, OIL_AND_GAS, ONLINE, PROFESSIONAL_SERVICES, RAW_MATERIALS, REAL_ESTATE, RELIGION, RETAIL, TECHNOLOGY, TELECOMMUNICATIONS, TRANSPORTATION, TRAVEL). Required when the group's toll-free brands are reviewed on submit; refused (400) otherwise
843
758
  */
844
- businessType: string;
759
+ industry?: string;
845
760
  /**
846
- * - The business industry (required, one of AGRICULTURE, AUTOMOTIVE, BANKING, CONSTRUCTION, CONSUMER, EDUCATION, ELECTRONICS, ENGINEERING, ENERGY, FAST_MOVING_CONSUMER_GOODS, FINANCIAL, FINTECH, FOOD_AND_BEVERAGE, GOVERNMENT, HEALTHCARE, HOSPITALITY, INSURANCE, JEWELRY, LEGAL, MANUFACTURING, MEDIA, NOT_FOR_PROFIT, OIL_AND_GAS, ONLINE, PROFESSIONAL_SERVICES, RAW_MATERIALS, REAL_ESTATE, RELIGION, RETAIL, TECHNOLOGY, TELECOMMUNICATIONS, TRANSPORTATION, TRAVEL)
761
+ * - The email address of the contact named by firstName and lastName (valid email, at most 100 characters). Required when the group's toll-free brands are reviewed on submit; refused (400) otherwise
847
762
  */
848
- industry: string;
763
+ contactEmail?: string;
849
764
  /**
850
- * - The business registration type (required, one of EIN, CBN, NEQ, PROVINCIAL_NUMBER, CRN, VAT, ACN, ABN, BRN, SIREN, SIRET, NZBN, UST_IDNR, CIF, NIF, CNPJ, UID, OTHER)
765
+ * - The contact's job title (at most 100 characters). Required when the group's toll-free brands are reviewed on submit; refused (400) otherwise
851
766
  */
852
- registrationType: string;
767
+ contactJobTitle?: string;
853
768
  /**
854
- * - The business registration number, e.g. the EIN (required, at most 50 characters)
769
+ * - The contact's job level (one of DIRECTOR, GM, VP, CEO, CFO, GENERAL_COUNSEL, OTHER). Required when the group's toll-free brands are reviewed on submit; refused (400) otherwise
855
770
  */
856
- registrationNumber: string;
857
- /**
858
- * - The business website (required, valid URL, at most 255 characters)
859
- */
860
- website: string;
861
- /**
862
- * - The business street address (required, at most 255 characters)
863
- */
864
- street: string;
865
- /**
866
- * - The second line of the street address (optional, at most 255 characters)
867
- */
868
- street2?: string;
869
- /**
870
- * - The business city (required, at most 100 characters)
871
- */
872
- city: string;
873
- /**
874
- * - The business state or province (required, 2-letter code)
875
- */
876
- state: string;
877
- /**
878
- * - The business postal code (required, at most 10 characters)
879
- */
880
- postalCode: string;
881
- /**
882
- * - The business country (required, "US" or "CA")
883
- */
884
- country: string;
885
- /**
886
- * - The business's authorized representative (required)
887
- */
888
- representative: {
889
- firstName: string;
890
- lastName: string;
891
- email: string;
892
- phone: string;
893
- jobTitle: string;
894
- jobLevel: string;
895
- };
896
- };
897
- export type BusinessVerification = {
898
- /**
899
- * - The business verification's ID (starts with BV)
900
- */
901
- businessVerificationId: string;
902
- /**
903
- * - The group it belongs to
904
- */
905
- groupId: string;
906
- /**
907
- * - The subgroup whose business it verifies; present only in a group that verifies each subgroup's business separately
908
- */
909
- subgroupId?: string;
910
- /**
911
- * - SUBMITTING, IN_REVIEW, VERIFIED or NEEDS_CHANGES
912
- */
913
- status: string;
914
- /**
915
- * - The submitted details
916
- */
917
- details: BusinessVerificationDetails;
918
- /**
919
- * - When it was last submitted (ISO date)
920
- */
921
- submittedAt: string;
922
- /**
923
- * - When it was last reviewed (ISO date), or null
924
- */
925
- reviewedAt: string | null;
926
- /**
927
- * - Why it needs changes, or null
928
- */
929
- rejectionReason: string | null;
771
+ contactJobLevel?: string;
930
772
  };
931
773
  export type TollFreeIsvAccount = {
932
774
  /**
@@ -955,9 +797,12 @@ export type TollFreeIsvAccount = {
955
797
  updatedAt: string;
956
798
  };
957
799
  /**
958
- * Toll-free brand data. When tollFree.businessVerificationId is sent, the legal fields (companyName, street, city, state,
959
- * postalCode, country, firstName, lastName and tollFree's businessRegistrationType, taxId, countryCode and
960
- * taxIdIssuingCountry) are optional: the business verification's values replace any that are sent.
800
+ * Toll-free brand data. When the group's toll-free brands are reviewed on submit (see getTollFreeRequirements), tollFree
801
+ * also needs businessStructure, industry, contactEmail, contactJobTitle and contactJobLevel, tollFree.countryCode must be
802
+ * "US" or "CA", and state must be a 2-letter state or province code. Any other group is refused those five fields.
803
+ * Such a brand's business details can't be changed after it's submitted: companyName, street, city, state, postalCode,
804
+ * country, firstName, lastName and tollFree's businessRegistrationType, taxId, countryCode, taxIdIssuingCountry,
805
+ * businessStructure, industry, contactEmail, contactJobTitle and contactJobLevel.
961
806
  */
962
807
  export type CreateTollFreeBrandData = {
963
808
  /**
@@ -969,37 +814,37 @@ export type CreateTollFreeBrandData = {
969
814
  */
970
815
  displayName: string;
971
816
  /**
972
- * - The company name for the brand (required unless tollFree.businessVerificationId is sent, at most 255 characters)
817
+ * - The company name for the brand (required, at most 255 characters)
973
818
  */
974
- companyName?: string;
819
+ companyName: string;
975
820
  /**
976
- * - The street address of the primary contact for the brand (required unless tollFree.businessVerificationId is sent, at most 255 characters)
821
+ * - The street address of the primary contact for the brand (required, at most 255 characters)
977
822
  */
978
- street?: string;
823
+ street: string;
979
824
  /**
980
- * - The city of the primary contact for the brand (required unless tollFree.businessVerificationId is sent, at most 100 characters)
825
+ * - The city of the primary contact for the brand (required, at most 100 characters)
981
826
  */
982
- city?: string;
827
+ city: string;
983
828
  /**
984
- * - The state of the primary contact for the brand (required unless tollFree.businessVerificationId is sent, at most 20 characters; must be a valid 2-letter US state code when country is "US")
829
+ * - The state of the primary contact for the brand (required, at most 20 characters; must be a valid 2-letter US state code when country is "US", and a 2-letter state or province code when the group's toll-free brands are reviewed on submit)
985
830
  */
986
- state?: string;
831
+ state: string;
987
832
  /**
988
- * - The postal code of the primary contact for the brand (required unless tollFree.businessVerificationId is sent, at most 10 characters)
833
+ * - The postal code of the primary contact for the brand (required, at most 10 characters)
989
834
  */
990
- postalCode?: string;
835
+ postalCode: string;
991
836
  /**
992
- * - The email address of the primary contact for the brand (required, valid email, at most 100 characters)
837
+ * - The brand's support email address (required, valid email, at most 100 characters)
993
838
  */
994
839
  email: string;
995
840
  /**
996
- * - The first name of the primary contact for the brand (required unless tollFree.businessVerificationId is sent, at most 100 characters)
841
+ * - The first name of the primary contact for the brand (required, at most 100 characters)
997
842
  */
998
- firstName?: string;
843
+ firstName: string;
999
844
  /**
1000
- * - The last name of the primary contact for the brand (required unless tollFree.businessVerificationId is sent, at most 100 characters)
845
+ * - The last name of the primary contact for the brand (required, at most 100 characters)
1001
846
  */
1002
- lastName?: string;
847
+ lastName: string;
1003
848
  /**
1004
849
  * - The website URL for the brand (required, valid URL, at most 255 characters)
1005
850
  */
@@ -1041,6 +886,16 @@ export type CreateTollFreeBrandData = {
1041
886
  */
1042
887
  country?: string;
1043
888
  };
889
+ export type TollFreeRequirements = {
890
+ /**
891
+ * - The group the requirements are for
892
+ */
893
+ groupId: string;
894
+ /**
895
+ * - Whether the group's new toll-free brands are reviewed when they're submitted. When true, a new toll-free brand needs tollFree.businessStructure, industry, contactEmail, contactJobTitle and contactJobLevel, a tollFree.countryCode of "US" or "CA" and a 2-letter state or province code; it stays DCA_PENDING until it's reviewed, and its business details can't be changed after it's submitted. When false, those five fields are refused
896
+ */
897
+ reviewsBusinessOnSubmit: boolean;
898
+ };
1044
899
  export type CreateShortCodeBrandData = {
1045
900
  /**
1046
901
  * - The ID of the subgroup to create the brand under.