# Customers ## Lookup a customer `client.customers.get(stringid, CustomerGetParamsparams?, RequestOptionsoptions?): CustomerV1` **get** `/v1/customers/{id}` Retrieves the details of an existing customer. Supply the unique customer ID that was returned from your 'create customer' request, and Straddle will return the corresponding customer information. ### Parameters - `id: string` - `params: CustomerGetParams` - `correlationID?: string` Optional client generated identifier to trace and debug a series of requests. - `requestID?: string` Optional client generated identifier to trace and debug a request. - `straddleAccountID?: string` For use by platforms to specify an account id and set scope of a request. ### Returns - `CustomerV1` - `data: Data` - `id: string` Unique identifier for the customer. - `created_at: string` Timestamp of when the customer record was created. - `email: string` The customer's email address. - `name: string` Full name of the individual or business name. - `phone: string` The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `type: "individual" | "business"` - `"individual"` - `"business"` - `updated_at: string` Timestamp of the most recent update to the customer record. - `address?: CustomerAddressV1 | null` An object containing the customer's address. This is optional, but if provided, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile?: IndividualComplianceProfile | BusinessComplianceProfile | null` PII required to trigger Patriot Act compliant KYC verification. - `IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: string | null` Masked date of birth in ****-**-** format. - `ssn: string | null` Masked Social Security Number in the format ***-**-*\***. - `BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: string | null` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: string | null` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives?: Array | null` A list of people related to the company. Only valid where customer type is 'business'. - `name: string` - `email?: string | null` - `phone?: string | null` - `website?: string | null` Official business website URL. Optional but recommended for enhanced KYB. - `config?: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "verified" | "rejected" | "review"` - `"standard"` - `"verified"` - `"rejected"` - `"review"` - `device?: Device` - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. - `external_id?: string | null` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const customerV1 = await client.customers.get('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(customerV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "email": "ron.swanson@pawnee.com", "name": "Ron Swanson", "phone": "+12128675309", "status": "pending", "type": "individual", "updated_at": "2019-12-27T18:11:19.117Z", "address": { "address1": "123 Main St", "city": "Anytown", "state": "CA", "zip": "12345", "address2": "Apt 1" }, "compliance_profile": { "dob": "2019-12-27", "ssn": "***-**-****" }, "config": { "processing_method": "inline", "sandbox_outcome": "standard" }, "device": { "ip_address": "192.168.1.1" }, "external_id": "external_id", "metadata": { "foo": "string" } }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Update a customer `client.customers.update(stringid, CustomerUpdateParamsparams, RequestOptionsoptions?): CustomerV1` **put** `/v1/customers/{id}` Updates an existing customer's information. This endpoint allows you to modify the customer's contact details, PII, and metadata. ### Parameters - `id: string` - `params: CustomerUpdateParams` - `device: DeviceUnmaskedV1` Body param - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. - `email: string` Body param: The customer's email address. - `name: string` Body param: The customer's full name or business name. - `phone: string` Body param: The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` Body param - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `address?: CustomerAddressV1 | null` Body param: An object containing the customer's address. This is optional, but if provided, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile?: IndividualComplianceProfile | BusinessComplianceProfile | null` Body param: Individual PII data required to trigger Patriot Act compliant KYC verification. - `IndividualComplianceProfile` Individual PII data required to trigger Patriot Act compliant KYC verification. - `dob: string | null` Date of birth (YYYY-MM-DD). Required for Patriot Act-compliant KYC verification. - `ssn: string | null` Social Security Number (format XXX-XX-XXXX). Required for Patriot Act-compliant KYC verification. - `BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: string | null` Employer Identification Number (format XX-XXXXXXX). Required for Patriot Act-compliant KYB verification. - `legal_business_name: string | null` Official registered business name as listed with the IRS. This value will be matched against the 'legal_business name'. - `representatives?: Array | null` A list of people related to the company. Only valid where customer type is 'business'. - `name: string` - `email?: string | null` - `phone?: string | null` - `website?: string | null` Official business website URL. Optional but recommended for enhanced KYB. - `external_id?: string | null` Body param: Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Body param: Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Header param: Optional client generated value to use for idempotent requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. - `straddleAccountID?: string` Header param: For use by platforms to specify an account id and set scope of a request. ### Returns - `CustomerV1` - `data: Data` - `id: string` Unique identifier for the customer. - `created_at: string` Timestamp of when the customer record was created. - `email: string` The customer's email address. - `name: string` Full name of the individual or business name. - `phone: string` The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `type: "individual" | "business"` - `"individual"` - `"business"` - `updated_at: string` Timestamp of the most recent update to the customer record. - `address?: CustomerAddressV1 | null` An object containing the customer's address. This is optional, but if provided, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile?: IndividualComplianceProfile | BusinessComplianceProfile | null` PII required to trigger Patriot Act compliant KYC verification. - `IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: string | null` Masked date of birth in ****-**-** format. - `ssn: string | null` Masked Social Security Number in the format ***-**-*\***. - `BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: string | null` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: string | null` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives?: Array | null` A list of people related to the company. Only valid where customer type is 'business'. - `name: string` - `email?: string | null` - `phone?: string | null` - `website?: string | null` Official business website URL. Optional but recommended for enhanced KYB. - `config?: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "verified" | "rejected" | "review"` - `"standard"` - `"verified"` - `"rejected"` - `"review"` - `device?: Device` - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. - `external_id?: string | null` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const customerV1 = await client.customers.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { device: { ip_address: '192.168.1.1' }, email: 'dev@stainless.com', name: 'name', phone: '+46991022', status: 'pending', }); console.log(customerV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "email": "ron.swanson@pawnee.com", "name": "Ron Swanson", "phone": "+12128675309", "status": "pending", "type": "individual", "updated_at": "2019-12-27T18:11:19.117Z", "address": { "address1": "123 Main St", "city": "Anytown", "state": "CA", "zip": "12345", "address2": "Apt 1" }, "compliance_profile": { "dob": "2019-12-27", "ssn": "***-**-****" }, "config": { "processing_method": "inline", "sandbox_outcome": "standard" }, "device": { "ip_address": "192.168.1.1" }, "external_id": "external_id", "metadata": { "foo": "string" } }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Delete a customer `client.customers.delete(stringid, CustomerDeleteParamsparams?, RequestOptionsoptions?): CustomerV1` **delete** `/v1/customers/{id}` Permanently removes a customer record from Straddle. This action cannot be undone and should only be used to satisfy regulatory requirements or for privacy compliance. ### Parameters - `id: string` - `params: CustomerDeleteParams` - `correlationID?: string` Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Optional client generated value to use for idempotent requests. - `requestID?: string` Optional client generated identifier to trace and debug a request. - `straddleAccountID?: string` For use by platforms to specify an account id and set scope of a request. ### Returns - `CustomerV1` - `data: Data` - `id: string` Unique identifier for the customer. - `created_at: string` Timestamp of when the customer record was created. - `email: string` The customer's email address. - `name: string` Full name of the individual or business name. - `phone: string` The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `type: "individual" | "business"` - `"individual"` - `"business"` - `updated_at: string` Timestamp of the most recent update to the customer record. - `address?: CustomerAddressV1 | null` An object containing the customer's address. This is optional, but if provided, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile?: IndividualComplianceProfile | BusinessComplianceProfile | null` PII required to trigger Patriot Act compliant KYC verification. - `IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: string | null` Masked date of birth in ****-**-** format. - `ssn: string | null` Masked Social Security Number in the format ***-**-*\***. - `BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: string | null` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: string | null` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives?: Array | null` A list of people related to the company. Only valid where customer type is 'business'. - `name: string` - `email?: string | null` - `phone?: string | null` - `website?: string | null` Official business website URL. Optional but recommended for enhanced KYB. - `config?: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "verified" | "rejected" | "review"` - `"standard"` - `"verified"` - `"rejected"` - `"review"` - `device?: Device` - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. - `external_id?: string | null` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const customerV1 = await client.customers.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(customerV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "email": "ron.swanson@pawnee.com", "name": "Ron Swanson", "phone": "+12128675309", "status": "pending", "type": "individual", "updated_at": "2019-12-27T18:11:19.117Z", "address": { "address1": "123 Main St", "city": "Anytown", "state": "CA", "zip": "12345", "address2": "Apt 1" }, "compliance_profile": { "dob": "2019-12-27", "ssn": "***-**-****" }, "config": { "processing_method": "inline", "sandbox_outcome": "standard" }, "device": { "ip_address": "192.168.1.1" }, "external_id": "external_id", "metadata": { "foo": "string" } }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## List customers `client.customers.list(CustomerListParamsparams?, RequestOptionsoptions?): PageNumberSchema` **get** `/v1/customers` Lists or searches customers connected to your account. All supported query parameters are optional. If none are provided, the response will include all customers connected to your account. This endpoint supports advanced sorting and filtering options. ### Parameters - `params: CustomerListParams` - `created_from?: string` Query param: Start date for filtering by `created_at` date. - `created_to?: string` Query param: End date for filtering by `created_at` date. - `email?: string` Query param: Filter customers by `email` address. - `external_id?: string` Query param: Filter by your system's `external_id`. - `name?: string` Query param: Filter customers by `name` (partial match). - `page_number?: number` Query param: Page number for paginated results. Starts at 1. - `page_size?: number` Query param: Number of results per page. Maximum: 1000. - `search_text?: string` Query param: General search term to filter customers. - `sort_by?: "name" | "created_at"` Query param - `"name"` - `"created_at"` - `sort_order?: "asc" | "desc"` Query param - `"asc"` - `"desc"` - `status?: Array<"pending" | "review" | "verified" | 2 more>` Query param: Filter customers by their current `status`. - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `types?: Array<"individual" | "business">` Query param: Filter by customer type `individual` or `business`. - `"individual"` - `"business"` - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. - `straddleAccountID?: string` Header param: For use by platforms to specify an `account_id` to set the scope of a request. ### Returns - `Data` - `id: string` Unique identifier for the customer. - `created_at: string` Timestamp of when the customer record was created. - `email: string` The customer's email address. - `name: string` Full name of the individual or business name. - `phone: string` The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `type: "individual" | "business"` - `"individual"` - `"business"` - `updated_at: string` Timestamp of the most recent update to the customer record. - `external_id?: string | null` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const customer of client.customers.list()) { console.log(customer.id); } ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "email": "dev@stainless.com", "name": "name", "phone": "+46991022", "status": "pending", "type": "individual", "updated_at": "2019-12-27T18:11:19.117Z", "external_id": "external_id" } ], "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z", "max_page_size": 0, "page_number": 0, "page_size": 0, "sort_by": "sort_by", "sort_order": "asc", "total_items": 0, "total_pages": 0 }, "response_type": "object" } ``` ## Create a customer `client.customers.create(CustomerCreateParamsparams, RequestOptionsoptions?): CustomerV1` **post** `/v1/customers` Creates a new customer record and automatically initiates identity, fraud, and risk assessment scores. This endpoint allows you to create a customer profile and associate it with paykeys and payments. ### Parameters - `params: CustomerCreateParams` - `device: DeviceUnmaskedV1` Body param - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. - `email: string` Body param: The customer's email address. - `name: string` Body param: Full name of the individual or business name. - `phone: string` Body param: The customer's phone number in E.164 format. Mobile number is preferred. - `type: "individual" | "business"` Body param - `"individual"` - `"business"` - `address?: CustomerAddressV1 | null` Body param: An object containing the customer's address. **This is optional.** If used, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile?: IndividualComplianceProfile | BusinessComplianceProfile | null` Body param: An object containing the customer's compliance profile. **This is optional.** If all required fields must be present for the appropriate customer type. - `IndividualComplianceProfile` Individual PII data required to trigger Patriot Act compliant KYC verification. - `dob: string | null` Date of birth (YYYY-MM-DD). Required for Patriot Act-compliant KYC verification. - `ssn: string | null` Social Security Number (format XXX-XX-XXXX). Required for Patriot Act-compliant KYC verification. - `BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: string | null` Employer Identification Number (format XX-XXXXXXX). Required for Patriot Act-compliant KYB verification. - `legal_business_name: string | null` Official registered business name as listed with the IRS. This value will be matched against the 'legal_business name'. - `representatives?: Array | null` A list of people related to the company. Only valid where customer type is 'business'. - `name: string` - `email?: string | null` - `phone?: string | null` - `website?: string | null` Official business website URL. Optional but recommended for enhanced KYB. - `config?: Config` Body param - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "verified" | "rejected" | "review"` - `"standard"` - `"verified"` - `"rejected"` - `"review"` - `external_id?: string | null` Body param: Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Body param: Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Header param: Optional client generated value to use for idempotent requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. - `straddleAccountID?: string` Header param: For use by platforms to specify an account id and set scope of a request. ### Returns - `CustomerV1` - `data: Data` - `id: string` Unique identifier for the customer. - `created_at: string` Timestamp of when the customer record was created. - `email: string` The customer's email address. - `name: string` Full name of the individual or business name. - `phone: string` The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `type: "individual" | "business"` - `"individual"` - `"business"` - `updated_at: string` Timestamp of the most recent update to the customer record. - `address?: CustomerAddressV1 | null` An object containing the customer's address. This is optional, but if provided, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile?: IndividualComplianceProfile | BusinessComplianceProfile | null` PII required to trigger Patriot Act compliant KYC verification. - `IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: string | null` Masked date of birth in ****-**-** format. - `ssn: string | null` Masked Social Security Number in the format ***-**-*\***. - `BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: string | null` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: string | null` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives?: Array | null` A list of people related to the company. Only valid where customer type is 'business'. - `name: string` - `email?: string | null` - `phone?: string | null` - `website?: string | null` Official business website URL. Optional but recommended for enhanced KYB. - `config?: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "verified" | "rejected" | "review"` - `"standard"` - `"verified"` - `"rejected"` - `"review"` - `device?: Device` - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. - `external_id?: string | null` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const customerV1 = await client.customers.create({ device: { ip_address: '192.168.1.1' }, email: 'ron.swanson@pawnee.com', name: 'Ron Swanson', phone: '+12128675309', type: 'individual', }); console.log(customerV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "email": "ron.swanson@pawnee.com", "name": "Ron Swanson", "phone": "+12128675309", "status": "pending", "type": "individual", "updated_at": "2019-12-27T18:11:19.117Z", "address": { "address1": "123 Main St", "city": "Anytown", "state": "CA", "zip": "12345", "address2": "Apt 1" }, "compliance_profile": { "dob": "2019-12-27", "ssn": "***-**-****" }, "config": { "processing_method": "inline", "sandbox_outcome": "standard" }, "device": { "ip_address": "192.168.1.1" }, "external_id": "external_id", "metadata": { "foo": "string" } }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Unmask customer data `client.customers.unmasked(stringid, CustomerUnmaskedParamsparams?, RequestOptionsoptions?): CustomerUnmaskedV1` **get** `/v1/customers/{id}/unmasked` Retrieves the unmasked details, including PII, of an existing customer. Supply the unique customer ID that was returned from your 'create customer' request, and Straddle will return the corresponding customer information. This endpoint needs to be enabled by Straddle and should only be used when absolutely necessary. ### Parameters - `id: string` - `params: CustomerUnmaskedParams` - `correlationID?: string` Optional client generated identifier to trace and debug a series of requests. - `requestID?: string` Optional client generated identifier to trace and debug a request. - `straddleAccountID?: string` For use by platforms to specify an account id and set scope of a request. ### Returns - `CustomerUnmaskedV1` - `data: Data` - `id: string` Unique identifier for the customer. - `created_at: string` Timestamp of when the customer record was created. - `email: string` The customer's email address. - `name: string` Full name of the individual or business name. - `phone: string` The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `type: "individual" | "business"` - `"individual"` - `"business"` - `updated_at: string` Timestamp of the most recent update to the customer record. - `address?: CustomerAddressV1 | null` An object containing the customer's address. This is optional, but if provided, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile?: IndividualComplianceProfile | BusinessComplianceProfile | null` Individual PII data required to trigger Patriot Act compliant KYC verification. - `IndividualComplianceProfile` Individual PII data required to trigger Patriot Act compliant KYC verification. - `dob: string | null` Date of birth (YYYY-MM-DD). Required for Patriot Act-compliant KYC verification. - `ssn: string | null` Social Security Number (format XXX-XX-XXXX). Required for Patriot Act-compliant KYC verification. - `BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: string | null` Employer Identification Number (format XX-XXXXXXX). Required for Patriot Act-compliant KYB verification. - `legal_business_name: string | null` Official registered business name as listed with the IRS. This value will be matched against the 'legal_business name'. - `representatives?: Array | null` A list of people related to the company. Only valid where customer type is 'business'. - `name: string` - `email?: string | null` - `phone?: string | null` - `website?: string | null` Official business website URL. Optional but recommended for enhanced KYB. - `config?: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "verified" | "rejected" | "review"` - `"standard"` - `"verified"` - `"rejected"` - `"review"` - `device?: DeviceUnmaskedV1` - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. - `external_id?: string | null` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const customerUnmaskedV1 = await client.customers.unmasked('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(customerUnmaskedV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "email": "ron.swanson@pawnee.com", "name": "Ron Swanson", "phone": "+12128675309", "status": "pending", "type": "individual", "updated_at": "2019-12-27T18:11:19.117Z", "address": { "address1": "123 Main St", "city": "Anytown", "state": "CA", "zip": "12345", "address2": "Apt 1" }, "compliance_profile": { "dob": "1969-04-20", "ssn": "123-45-6789" }, "config": { "processing_method": "inline", "sandbox_outcome": "standard" }, "device": { "ip_address": "192.168.1.1" }, "external_id": "external_id", "metadata": { "foo": "string" } }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Domain Types ### Customer Address V1 - `CustomerAddressV1` An object containing the customer's address. This is optional, but if provided, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). ### Customer Summary Paged V1 - `CustomerSummaryPagedV1` - `data: Array` - `id: string` Unique identifier for the customer. - `created_at: string` Timestamp of when the customer record was created. - `email: string` The customer's email address. - `name: string` Full name of the individual or business name. - `phone: string` The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `type: "individual" | "business"` - `"individual"` - `"business"` - `updated_at: string` Timestamp of the most recent update to the customer record. - `external_id?: string | null` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `meta: Meta` - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `max_page_size: number` Maximum allowed page size for this endpoint. - `page_number: number` Page number for paginated results. - `page_size: number` Number of items per page in this response. - `sort_by: string` The field that the results were sorted by. - `sort_order: "asc" | "desc"` - `"asc"` - `"desc"` - `total_items: number` - `total_pages: number` The number of pages available. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Customer Unmasked V1 - `CustomerUnmaskedV1` - `data: Data` - `id: string` Unique identifier for the customer. - `created_at: string` Timestamp of when the customer record was created. - `email: string` The customer's email address. - `name: string` Full name of the individual or business name. - `phone: string` The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `type: "individual" | "business"` - `"individual"` - `"business"` - `updated_at: string` Timestamp of the most recent update to the customer record. - `address?: CustomerAddressV1 | null` An object containing the customer's address. This is optional, but if provided, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile?: IndividualComplianceProfile | BusinessComplianceProfile | null` Individual PII data required to trigger Patriot Act compliant KYC verification. - `IndividualComplianceProfile` Individual PII data required to trigger Patriot Act compliant KYC verification. - `dob: string | null` Date of birth (YYYY-MM-DD). Required for Patriot Act-compliant KYC verification. - `ssn: string | null` Social Security Number (format XXX-XX-XXXX). Required for Patriot Act-compliant KYC verification. - `BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: string | null` Employer Identification Number (format XX-XXXXXXX). Required for Patriot Act-compliant KYB verification. - `legal_business_name: string | null` Official registered business name as listed with the IRS. This value will be matched against the 'legal_business name'. - `representatives?: Array | null` A list of people related to the company. Only valid where customer type is 'business'. - `name: string` - `email?: string | null` - `phone?: string | null` - `website?: string | null` Official business website URL. Optional but recommended for enhanced KYB. - `config?: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "verified" | "rejected" | "review"` - `"standard"` - `"verified"` - `"rejected"` - `"review"` - `device?: DeviceUnmaskedV1` - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. - `external_id?: string | null` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Customer V1 - `CustomerV1` - `data: Data` - `id: string` Unique identifier for the customer. - `created_at: string` Timestamp of when the customer record was created. - `email: string` The customer's email address. - `name: string` Full name of the individual or business name. - `phone: string` The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `type: "individual" | "business"` - `"individual"` - `"business"` - `updated_at: string` Timestamp of the most recent update to the customer record. - `address?: CustomerAddressV1 | null` An object containing the customer's address. This is optional, but if provided, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile?: IndividualComplianceProfile | BusinessComplianceProfile | null` PII required to trigger Patriot Act compliant KYC verification. - `IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: string | null` Masked date of birth in ****-**-** format. - `ssn: string | null` Masked Social Security Number in the format ***-**-*\***. - `BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: string | null` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: string | null` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives?: Array | null` A list of people related to the company. Only valid where customer type is 'business'. - `name: string` - `email?: string | null` - `phone?: string | null` - `website?: string | null` Official business website URL. Optional but recommended for enhanced KYB. - `config?: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "verified" | "rejected" | "review"` - `"standard"` - `"verified"` - `"rejected"` - `"review"` - `device?: Device` - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. - `external_id?: string | null` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Device Unmasked V1 - `DeviceUnmaskedV1` - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. # Review ## Review a customer's identity results `client.customers.review.get(stringid, ReviewGetParamsparams?, RequestOptionsoptions?): CustomerReviewV1` **get** `/v1/customers/{id}/review` Retrieves and analyzes the results of a customer's identity validation and fraud score. This endpoint provides a comprehensive breakdown of the validation outcome, including: - Risk and correlation scores - Reason codes for the decision - Results of watchlist screening - Any network alerts detected Use this endpoint to gain insights into the verification process and make informed decisions about customer onboarding. ### Parameters - `id: string` - `params: ReviewGetParams` - `correlationID?: string` Optional client generated identifier to trace and debug a series of requests. - `requestID?: string` Optional client generated identifier to trace and debug a request. - `straddleAccountID?: string` For use by platforms to specify an account id and set scope of a request. ### Returns - `CustomerReviewV1` - `data: Data` - `customer_details: CustomerDetails` - `id: string` Unique identifier for the customer. - `created_at: string` Timestamp of when the customer record was created. - `email: string` The customer's email address. - `name: string` Full name of the individual or business name. - `phone: string` The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `type: "individual" | "business"` - `"individual"` - `"business"` - `updated_at: string` Timestamp of the most recent update to the customer record. - `address?: CustomerAddressV1 | null` An object containing the customer's address. This is optional, but if provided, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile?: IndividualComplianceProfile | BusinessComplianceProfile | null` PII required to trigger Patriot Act compliant KYC verification. - `IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: string | null` Masked date of birth in ****-**-** format. - `ssn: string | null` Masked Social Security Number in the format ***-**-*\***. - `BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: string | null` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: string | null` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives?: Array | null` A list of people related to the company. Only valid where customer type is 'business'. - `name: string` - `email?: string | null` - `phone?: string | null` - `website?: string | null` Official business website URL. Optional but recommended for enhanced KYB. - `config?: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "verified" | "rejected" | "review"` - `"standard"` - `"verified"` - `"rejected"` - `"review"` - `device?: Device` - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. - `external_id?: string | null` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `identity_details?: IdentityDetails` - `breakdown: Breakdown` Detailed breakdown of the customer verification results, including decisions, risk scores, correlation score, and more. - `address?: IdentityVerificationBreakdownV1` - `codes?: Array | null` List of specific result codes from the fraud and risk screening. - `correlation?: "low_confidence" | "potential_match" | "likely_match" | "high_confidence"` - `"low_confidence"` - `"potential_match"` - `"likely_match"` - `"high_confidence"` - `correlation_score?: number | null` Represents the strength of the correlation between provided and known information. A higher score indicates a stronger correlation. - `decision?: "accept" | "reject" | "review"` - `"accept"` - `"reject"` - `"review"` - `risk_score?: number | null` Predicts the inherent risk associated with the customer for a given module. A higher score indicates a greater likelihood of fraud. - `business_evaluation?: IdentityVerificationBreakdownV1` - `business_identification?: IdentityVerificationBreakdownV1` - `business_validation?: IdentityVerificationBreakdownV1` - `email?: IdentityVerificationBreakdownV1` - `fraud?: IdentityVerificationBreakdownV1` - `phone?: IdentityVerificationBreakdownV1` - `synthetic?: IdentityVerificationBreakdownV1` - `created_at: string` Timestamp of when the review was initiated. - `decision: "accept" | "reject" | "review"` - `"accept"` - `"reject"` - `"review"` - `review_id: string` Unique identifier for the review. - `updated_at: string` Timestamp of the most recent update to the review. - `kyc?: KYC` - `validations: Validations` Boolean values indicating the result of each validation in the KYC process. - `address?: boolean` - `city?: boolean` - `dob?: boolean` - `email?: boolean` - `first_name?: boolean` - `last_name?: boolean` - `phone?: boolean` - `ssn?: boolean` - `state?: boolean` - `zip?: boolean` - `codes?: Array | null` List of specific result codes from the KYC screening process. - `decision?: "accept" | "reject" | "review"` - `"accept"` - `"reject"` - `"review"` - `messages?: Record | null` Dictionary of all messages from the customer verification process. - `network_alerts?: NetworkAlerts` - `alerts?: Array | null` Any alerts or flags raised during the consortium alert screening. - `codes?: Array | null` List of specific result codes from the consortium alert screening. - `decision?: "accept" | "reject" | "review"` - `"accept"` - `"reject"` - `"review"` - `reputation?: Reputation` - `codes?: Array | null` Specific codes related to the Straddle reputation screening results. - `decision?: "accept" | "reject" | "review"` - `"accept"` - `"reject"` - `"review"` - `insights?: Insights` - `accounts_active_count?: number | null` - `accounts_closed_count?: number | null` - `accounts_closed_dates?: Array | null` - `accounts_count?: number | null` - `accounts_fraud_count?: number | null` - `accounts_fraud_labeled_dates?: Array | null` - `accounts_fraud_loss_total_amount?: number | null` - `ach_fraud_transactions_count?: number | null` - `ach_fraud_transactions_dates?: Array | null` - `ach_fraud_transactions_total_amount?: number | null` - `ach_returned_transactions_count?: number | null` - `ach_returned_transactions_dates?: Array | null` - `ach_returned_transactions_total_amount?: number | null` - `applications_approved_count?: number | null` - `applications_count?: number | null` - `applications_dates?: Array | null` - `applications_declined_count?: number | null` - `applications_fraud_count?: number | null` - `card_disputed_transactions_count?: number | null` - `card_disputed_transactions_dates?: Array | null` - `card_disputed_transactions_total_amount?: number | null` - `card_fraud_transactions_count?: number | null` - `card_fraud_transactions_dates?: Array | null` - `card_fraud_transactions_total_amount?: number | null` - `card_stopped_transactions_count?: number | null` - `card_stopped_transactions_dates?: Array | null` - `user_active_profile_count?: number | null` - `user_address_count?: number | null` - `user_closed_profile_count?: number | null` - `user_dob_count?: number | null` - `user_email_count?: number | null` - `user_institution_count?: number | null` - `user_mobile_count?: number | null` - `risk_score?: number | null` - `watch_list?: WatchList` - `codes?: Array | null` Specific codes related to the Straddle watchlist screening results. - `decision?: "accept" | "reject" | "review"` - `"accept"` - `"reject"` - `"review"` - `matched?: Array | null` Information about any matches found during screening. - `matches?: Array | null` Information about any matches found during screening. - `correlation: "low_confidence" | "potential_match" | "likely_match" | "high_confidence"` - `"low_confidence"` - `"potential_match"` - `"likely_match"` - `"high_confidence"` - `list_name: string` The name of the list the match was found. - `match_fields: Array` Data fields that matched. - `urls: Array` Relevent Urls to review. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const customerReviewV1 = await client.customers.review.get('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(customerReviewV1.data); ``` #### Response ```json { "data": { "customer_details": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "email": "ron.swanson@pawnee.com", "name": "Ron Swanson", "phone": "+12128675309", "status": "pending", "type": "individual", "updated_at": "2019-12-27T18:11:19.117Z", "address": { "address1": "123 Main St", "city": "Anytown", "state": "CA", "zip": "12345", "address2": "Apt 1" }, "compliance_profile": { "dob": "2019-12-27", "ssn": "***-**-****" }, "config": { "processing_method": "inline", "sandbox_outcome": "standard" }, "device": { "ip_address": "192.168.1.1" }, "external_id": "external_id", "metadata": { "foo": "string" } }, "identity_details": { "breakdown": { "address": { "codes": [ "string" ], "correlation": "low_confidence", "correlation_score": 0, "decision": "accept", "risk_score": 0 }, "business_evaluation": { "codes": [ "string" ], "correlation": "low_confidence", "correlation_score": 0, "decision": "accept", "risk_score": 0 }, "business_identification": { "codes": [ "string" ], "correlation": "low_confidence", "correlation_score": 0, "decision": "accept", "risk_score": 0 }, "business_validation": { "codes": [ "string" ], "correlation": "low_confidence", "correlation_score": 0, "decision": "accept", "risk_score": 0 }, "email": { "codes": [ "string" ], "correlation": "low_confidence", "correlation_score": 0, "decision": "accept", "risk_score": 0 }, "fraud": { "codes": [ "string" ], "correlation": "low_confidence", "correlation_score": 0, "decision": "accept", "risk_score": 0 }, "phone": { "codes": [ "string" ], "correlation": "low_confidence", "correlation_score": 0, "decision": "accept", "risk_score": 0 }, "synthetic": { "codes": [ "string" ], "correlation": "low_confidence", "correlation_score": 0, "decision": "accept", "risk_score": 0 } }, "created_at": "2019-12-27T18:11:19.117Z", "decision": "accept", "review_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updated_at": "2019-12-27T18:11:19.117Z", "kyc": { "validations": { "address": true, "city": true, "dob": true, "email": true, "first_name": true, "last_name": true, "phone": true, "ssn": true, "state": true, "zip": true }, "codes": [ "string" ], "decision": "accept" }, "messages": { "foo": "string" }, "network_alerts": { "alerts": [ "string" ], "codes": [ "string" ], "decision": "accept" }, "reputation": { "codes": [ "string" ], "decision": "accept", "insights": { "accounts_active_count": 0, "accounts_closed_count": 0, "accounts_closed_dates": [ "2019-12-27" ], "accounts_count": 0, "accounts_fraud_count": 0, "accounts_fraud_labeled_dates": [ "2019-12-27" ], "accounts_fraud_loss_total_amount": 0, "ach_fraud_transactions_count": 0, "ach_fraud_transactions_dates": [ "2019-12-27" ], "ach_fraud_transactions_total_amount": 0, "ach_returned_transactions_count": 0, "ach_returned_transactions_dates": [ "2019-12-27" ], "ach_returned_transactions_total_amount": 0, "applications_approved_count": 0, "applications_count": 0, "applications_dates": [ "2019-12-27" ], "applications_declined_count": 0, "applications_fraud_count": 0, "card_disputed_transactions_count": 0, "card_disputed_transactions_dates": [ "2019-12-27" ], "card_disputed_transactions_total_amount": 0, "card_fraud_transactions_count": 0, "card_fraud_transactions_dates": [ "2019-12-27" ], "card_fraud_transactions_total_amount": 0, "card_stopped_transactions_count": 0, "card_stopped_transactions_dates": [ "2019-12-27" ], "user_active_profile_count": 0, "user_address_count": 0, "user_closed_profile_count": 0, "user_dob_count": 0, "user_email_count": 0, "user_institution_count": 0, "user_mobile_count": 0 }, "risk_score": 0 }, "watch_list": { "codes": [ "string" ], "decision": "accept", "matched": [ "string" ], "matches": [ { "correlation": "low_confidence", "list_name": "list_name", "match_fields": [ "string" ], "urls": [ "string" ] } ] } } }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Update a customer's verification status `client.customers.review.decision(stringid, ReviewDecisionParamsparams, RequestOptionsoptions?): CustomerV1` **patch** `/v1/customers/{id}/review` Updates the status of a customer's identity decision. This endpoint allows you to modify the outcome of a customer risk screening and is useful for correcting or updating the status of a customer's verification. Note that this endpoint is only available for customers with a current status of `review`. ### Parameters - `id: string` - `params: ReviewDecisionParams` - `status: "verified" | "rejected"` Body param: The final status of the customer review. - `"verified"` - `"rejected"` - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Header param: Optional client generated value to use for idempotent requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. - `straddleAccountID?: string` Header param: For use by platforms to specify an account id and set scope of a request. ### Returns - `CustomerV1` - `data: Data` - `id: string` Unique identifier for the customer. - `created_at: string` Timestamp of when the customer record was created. - `email: string` The customer's email address. - `name: string` Full name of the individual or business name. - `phone: string` The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `type: "individual" | "business"` - `"individual"` - `"business"` - `updated_at: string` Timestamp of the most recent update to the customer record. - `address?: CustomerAddressV1 | null` An object containing the customer's address. This is optional, but if provided, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile?: IndividualComplianceProfile | BusinessComplianceProfile | null` PII required to trigger Patriot Act compliant KYC verification. - `IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: string | null` Masked date of birth in ****-**-** format. - `ssn: string | null` Masked Social Security Number in the format ***-**-*\***. - `BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: string | null` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: string | null` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives?: Array | null` A list of people related to the company. Only valid where customer type is 'business'. - `name: string` - `email?: string | null` - `phone?: string | null` - `website?: string | null` Official business website URL. Optional but recommended for enhanced KYB. - `config?: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "verified" | "rejected" | "review"` - `"standard"` - `"verified"` - `"rejected"` - `"review"` - `device?: Device` - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. - `external_id?: string | null` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const customerV1 = await client.customers.review.decision('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { status: 'verified', }); console.log(customerV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "email": "ron.swanson@pawnee.com", "name": "Ron Swanson", "phone": "+12128675309", "status": "pending", "type": "individual", "updated_at": "2019-12-27T18:11:19.117Z", "address": { "address1": "123 Main St", "city": "Anytown", "state": "CA", "zip": "12345", "address2": "Apt 1" }, "compliance_profile": { "dob": "2019-12-27", "ssn": "***-**-****" }, "config": { "processing_method": "inline", "sandbox_outcome": "standard" }, "device": { "ip_address": "192.168.1.1" }, "external_id": "external_id", "metadata": { "foo": "string" } }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Update a customer's identity decision `client.customers.review.refreshReview(stringid, ReviewRefreshReviewParamsparams?, RequestOptionsoptions?): CustomerV1` **put** `/v1/customers/{id}/refresh_review` Updates the decision of a customer's identity validation. This endpoint allows you to modify the outcome of a customer decision and is useful for correcting or updating the status of a customer's verification. ### Parameters - `id: string` - `params: ReviewRefreshReviewParams` - `correlationID?: string` Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Optional client generated value to use for idempotent requests. - `requestID?: string` Optional client generated identifier to trace and debug a request. - `straddleAccountID?: string` For use by platforms to specify an account id and set scope of a request. ### Returns - `CustomerV1` - `data: Data` - `id: string` Unique identifier for the customer. - `created_at: string` Timestamp of when the customer record was created. - `email: string` The customer's email address. - `name: string` Full name of the individual or business name. - `phone: string` The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `type: "individual" | "business"` - `"individual"` - `"business"` - `updated_at: string` Timestamp of the most recent update to the customer record. - `address?: CustomerAddressV1 | null` An object containing the customer's address. This is optional, but if provided, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile?: IndividualComplianceProfile | BusinessComplianceProfile | null` PII required to trigger Patriot Act compliant KYC verification. - `IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: string | null` Masked date of birth in ****-**-** format. - `ssn: string | null` Masked Social Security Number in the format ***-**-*\***. - `BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: string | null` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: string | null` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives?: Array | null` A list of people related to the company. Only valid where customer type is 'business'. - `name: string` - `email?: string | null` - `phone?: string | null` - `website?: string | null` Official business website URL. Optional but recommended for enhanced KYB. - `config?: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "verified" | "rejected" | "review"` - `"standard"` - `"verified"` - `"rejected"` - `"review"` - `device?: Device` - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. - `external_id?: string | null` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const customerV1 = await client.customers.review.refreshReview( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', ); console.log(customerV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "email": "ron.swanson@pawnee.com", "name": "Ron Swanson", "phone": "+12128675309", "status": "pending", "type": "individual", "updated_at": "2019-12-27T18:11:19.117Z", "address": { "address1": "123 Main St", "city": "Anytown", "state": "CA", "zip": "12345", "address2": "Apt 1" }, "compliance_profile": { "dob": "2019-12-27", "ssn": "***-**-****" }, "config": { "processing_method": "inline", "sandbox_outcome": "standard" }, "device": { "ip_address": "192.168.1.1" }, "external_id": "external_id", "metadata": { "foo": "string" } }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Domain Types ### Customer Review V1 - `CustomerReviewV1` - `data: Data` - `customer_details: CustomerDetails` - `id: string` Unique identifier for the customer. - `created_at: string` Timestamp of when the customer record was created. - `email: string` The customer's email address. - `name: string` Full name of the individual or business name. - `phone: string` The customer's phone number in E.164 format. - `status: "pending" | "review" | "verified" | 2 more` - `"pending"` - `"review"` - `"verified"` - `"inactive"` - `"rejected"` - `type: "individual" | "business"` - `"individual"` - `"business"` - `updated_at: string` Timestamp of the most recent update to the customer record. - `address?: CustomerAddressV1 | null` An object containing the customer's address. This is optional, but if provided, all required fields must be present. - `address1: string` Primary address line (e.g., street, PO Box). - `city: string` City, district, suburb, town, or village. - `state: string` Two-letter state code. - `zip: string` Zip or postal code. - `address2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile?: IndividualComplianceProfile | BusinessComplianceProfile | null` PII required to trigger Patriot Act compliant KYC verification. - `IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: string | null` Masked date of birth in ****-**-** format. - `ssn: string | null` Masked Social Security Number in the format ***-**-*\***. - `BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: string | null` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: string | null` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives?: Array | null` A list of people related to the company. Only valid where customer type is 'business'. - `name: string` - `email?: string | null` - `phone?: string | null` - `website?: string | null` Official business website URL. Optional but recommended for enhanced KYB. - `config?: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "verified" | "rejected" | "review"` - `"standard"` - `"verified"` - `"rejected"` - `"review"` - `device?: Device` - `ip_address: string` The customer's IP address at the time of profile creation. Use `0.0.0.0` to represent an offline customer registration. - `external_id?: string | null` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `identity_details?: IdentityDetails` - `breakdown: Breakdown` Detailed breakdown of the customer verification results, including decisions, risk scores, correlation score, and more. - `address?: IdentityVerificationBreakdownV1` - `codes?: Array | null` List of specific result codes from the fraud and risk screening. - `correlation?: "low_confidence" | "potential_match" | "likely_match" | "high_confidence"` - `"low_confidence"` - `"potential_match"` - `"likely_match"` - `"high_confidence"` - `correlation_score?: number | null` Represents the strength of the correlation between provided and known information. A higher score indicates a stronger correlation. - `decision?: "accept" | "reject" | "review"` - `"accept"` - `"reject"` - `"review"` - `risk_score?: number | null` Predicts the inherent risk associated with the customer for a given module. A higher score indicates a greater likelihood of fraud. - `business_evaluation?: IdentityVerificationBreakdownV1` - `business_identification?: IdentityVerificationBreakdownV1` - `business_validation?: IdentityVerificationBreakdownV1` - `email?: IdentityVerificationBreakdownV1` - `fraud?: IdentityVerificationBreakdownV1` - `phone?: IdentityVerificationBreakdownV1` - `synthetic?: IdentityVerificationBreakdownV1` - `created_at: string` Timestamp of when the review was initiated. - `decision: "accept" | "reject" | "review"` - `"accept"` - `"reject"` - `"review"` - `review_id: string` Unique identifier for the review. - `updated_at: string` Timestamp of the most recent update to the review. - `kyc?: KYC` - `validations: Validations` Boolean values indicating the result of each validation in the KYC process. - `address?: boolean` - `city?: boolean` - `dob?: boolean` - `email?: boolean` - `first_name?: boolean` - `last_name?: boolean` - `phone?: boolean` - `ssn?: boolean` - `state?: boolean` - `zip?: boolean` - `codes?: Array | null` List of specific result codes from the KYC screening process. - `decision?: "accept" | "reject" | "review"` - `"accept"` - `"reject"` - `"review"` - `messages?: Record | null` Dictionary of all messages from the customer verification process. - `network_alerts?: NetworkAlerts` - `alerts?: Array | null` Any alerts or flags raised during the consortium alert screening. - `codes?: Array | null` List of specific result codes from the consortium alert screening. - `decision?: "accept" | "reject" | "review"` - `"accept"` - `"reject"` - `"review"` - `reputation?: Reputation` - `codes?: Array | null` Specific codes related to the Straddle reputation screening results. - `decision?: "accept" | "reject" | "review"` - `"accept"` - `"reject"` - `"review"` - `insights?: Insights` - `accounts_active_count?: number | null` - `accounts_closed_count?: number | null` - `accounts_closed_dates?: Array | null` - `accounts_count?: number | null` - `accounts_fraud_count?: number | null` - `accounts_fraud_labeled_dates?: Array | null` - `accounts_fraud_loss_total_amount?: number | null` - `ach_fraud_transactions_count?: number | null` - `ach_fraud_transactions_dates?: Array | null` - `ach_fraud_transactions_total_amount?: number | null` - `ach_returned_transactions_count?: number | null` - `ach_returned_transactions_dates?: Array | null` - `ach_returned_transactions_total_amount?: number | null` - `applications_approved_count?: number | null` - `applications_count?: number | null` - `applications_dates?: Array | null` - `applications_declined_count?: number | null` - `applications_fraud_count?: number | null` - `card_disputed_transactions_count?: number | null` - `card_disputed_transactions_dates?: Array | null` - `card_disputed_transactions_total_amount?: number | null` - `card_fraud_transactions_count?: number | null` - `card_fraud_transactions_dates?: Array | null` - `card_fraud_transactions_total_amount?: number | null` - `card_stopped_transactions_count?: number | null` - `card_stopped_transactions_dates?: Array | null` - `user_active_profile_count?: number | null` - `user_address_count?: number | null` - `user_closed_profile_count?: number | null` - `user_dob_count?: number | null` - `user_email_count?: number | null` - `user_institution_count?: number | null` - `user_mobile_count?: number | null` - `risk_score?: number | null` - `watch_list?: WatchList` - `codes?: Array | null` Specific codes related to the Straddle watchlist screening results. - `decision?: "accept" | "reject" | "review"` - `"accept"` - `"reject"` - `"review"` - `matched?: Array | null` Information about any matches found during screening. - `matches?: Array | null` Information about any matches found during screening. - `correlation: "low_confidence" | "potential_match" | "likely_match" | "high_confidence"` - `"low_confidence"` - `"potential_match"` - `"likely_match"` - `"high_confidence"` - `list_name: string` The name of the list the match was found. - `match_fields: Array` Data fields that matched. - `urls: Array` Relevent Urls to review. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Identity Verification Breakdown V1 - `IdentityVerificationBreakdownV1` - `codes?: Array | null` List of specific result codes from the fraud and risk screening. - `correlation?: "low_confidence" | "potential_match" | "likely_match" | "high_confidence"` - `"low_confidence"` - `"potential_match"` - `"likely_match"` - `"high_confidence"` - `correlation_score?: number | null` Represents the strength of the correlation between provided and known information. A higher score indicates a stronger correlation. - `decision?: "accept" | "reject" | "review"` - `"accept"` - `"reject"` - `"review"` - `risk_score?: number | null` Predicts the inherent risk associated with the customer for a given module. A higher score indicates a greater likelihood of fraud.