Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion types/customer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Address, AuthorizedUser, BusinessContact, FullName, Phone, Relationship, State } from "./common"

export type CustomerStatus = "Active" | "Archived"

export type CustomerArchiveReason = "Inactive" | "FraudACHActivity" | "FraudCardActivity" | "FraudCheckActivity" | "FraudApplicationHistory" | "FraudAccountActivity" | "FraudClientIdentified" | "FraudLinkedToFraudulentCustomer"

export type Customer = IndividualCustomer | BusinessCustomer

export interface BaseCustomer {
Expand Down Expand Up @@ -59,7 +63,7 @@ export interface IndividualCustomer extends BaseCustomer {
* Required on passport only. Two letters representing the individual nationality.
* ISO31661 - Alpha2 format. For more information: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
*/
nationality: string
nationality?: string

/**
* Full name of the individual.
Expand Down Expand Up @@ -87,6 +91,23 @@ export interface IndividualCustomer extends BaseCustomer {
*/
email: string

/**
* Status of the customer, either Active, Archived. You can't do any write operations with Archived customers.
*/
status: CustomerStatus

/**
* Optional. The reason the account was archived, can be one of Inactive, FraudACHActivity, FraudCardActivity, FraudCheckActivity, FraudApplicationHistory, FraudAccountActivity, FraudClientIdentified, FraudLinkedToFraudulentCustomer.
*/
archiveReason?: CustomerArchiveReason

/**
* Array of authorized users.
* An authorized user is someone who can participate in the One Time Password(OTP) authentication process.
*
*/
authorizedUsers: AuthorizedUser[]

/**
* See [Tags](https://developers.unit.co/#tags).
*/
Expand Down Expand Up @@ -157,6 +178,16 @@ export interface BusinessCustomer extends BaseCustomer {
*/
authorizedUsers: AuthorizedUser[]

/**
* Status of the customer, either Active, Archived. You can't do any write operations with Archived customers.
*/
status: CustomerStatus

/**
* Optional. The reason the account was archived, can be one of Inactive, FraudACHActivity, FraudCardActivity, FraudCheckActivity, FraudApplicationHistory, FraudAccountActivity, FraudClientIdentified, FraudLinkedToFraudulentCustomer.
*/
archiveReason?: CustomerArchiveReason

/**
* See [Tags](https://developers.unit.co/#tags).
* Inherited from the application tags(see [Tag Inheritance](https://developers.unit.co/#tag-inheritance)).
Expand Down