# Customers ## Lookup a customer `customers.get(id, **kwargs) -> 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` - `correlation_id: String` - `request_id: String` - `straddle_account_id: String` ### Returns - `class CustomerV1` - `data: { id, created_at, email, 11 more}` - `id: String` Unique identifier for the customer. - `created_at: Time` 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: Time` Timestamp of the most recent update to the customer record. - `address: 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` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile: { dob, ssn} | { ein, legal_business_name, representatives, website}` PII required to trigger Patriot Act compliant KYC verification. - `class IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: Date` Masked date of birth in ****-**-** format. - `ssn: String` Masked Social Security Number in the format ***-**-*\***. - `class BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: String` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: String` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives: Array[{ name, email, phone}]` A list of people related to the company. Only valid where customer type is 'business'. - `name: String` - `email: String` - `phone: String` - `website: String` Official business website URL. Optional but recommended for enhanced KYB. - `config: { processing_method, sandbox_outcome}` - `processing_method: :inline | :background | :skip` - `:inline` - `:background` - `:skip` - `sandbox_outcome: :standard | :verified | :rejected | :review` - `:standard` - `:verified` - `:rejected` - `:review` - `device: { ip_address}` - `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` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` 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: Time` 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 ```ruby require "straddle" straddle = Straddle::Client.new( api_key: "My API Key", environment: "production" # defaults to "sandbox" ) customer_v1 = straddle.customers.get("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") puts(customer_v1) ``` #### 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 `customers.update(id, **kwargs) -> 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` - `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. - `email: String` The customer's email address. - `name: String` The customer's full name 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` - `address: 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` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile: { dob, ssn} | { ein, legal_business_name, representatives, website}` Individual PII data required to trigger Patriot Act compliant KYC verification. - `class IndividualComplianceProfile` Individual PII data required to trigger Patriot Act compliant KYC verification. - `dob: Date` Date of birth (YYYY-MM-DD). Required for Patriot Act-compliant KYC verification. - `ssn: String` Social Security Number (format XXX-XX-XXXX). Required for Patriot Act-compliant KYC verification. - `class BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: String` Employer Identification Number (format XX-XXXXXXX). Required for Patriot Act-compliant KYB verification. - `legal_business_name: String` Official registered business name as listed with the IRS. This value will be matched against the 'legal_business name'. - `representatives: Array[{ name, email, phone}]` A list of people related to the company. Only valid where customer type is 'business'. - `name: String` - `email: String` - `phone: String` - `website: String` Official business website URL. Optional but recommended for enhanced KYB. - `external_id: String` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `correlation_id: String` - `idempotency_key: String` - `request_id: String` - `straddle_account_id: String` ### Returns - `class CustomerV1` - `data: { id, created_at, email, 11 more}` - `id: String` Unique identifier for the customer. - `created_at: Time` 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: Time` Timestamp of the most recent update to the customer record. - `address: 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` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile: { dob, ssn} | { ein, legal_business_name, representatives, website}` PII required to trigger Patriot Act compliant KYC verification. - `class IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: Date` Masked date of birth in ****-**-** format. - `ssn: String` Masked Social Security Number in the format ***-**-*\***. - `class BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: String` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: String` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives: Array[{ name, email, phone}]` A list of people related to the company. Only valid where customer type is 'business'. - `name: String` - `email: String` - `phone: String` - `website: String` Official business website URL. Optional but recommended for enhanced KYB. - `config: { processing_method, sandbox_outcome}` - `processing_method: :inline | :background | :skip` - `:inline` - `:background` - `:skip` - `sandbox_outcome: :standard | :verified | :rejected | :review` - `:standard` - `:verified` - `:rejected` - `:review` - `device: { ip_address}` - `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` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` 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: Time` 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 ```ruby require "straddle" straddle = Straddle::Client.new( api_key: "My API Key", environment: "production" # defaults to "sandbox" ) customer_v1 = straddle.customers.update( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", device: {ip_address: "192.168.1.1"}, email: "dev@stainless.com", name: "name", phone: "+46991022", status: :pending ) puts(customer_v1) ``` #### 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 `customers.delete(id, **kwargs) -> 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` - `correlation_id: String` - `idempotency_key: String` - `request_id: String` - `straddle_account_id: String` ### Returns - `class CustomerV1` - `data: { id, created_at, email, 11 more}` - `id: String` Unique identifier for the customer. - `created_at: Time` 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: Time` Timestamp of the most recent update to the customer record. - `address: 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` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile: { dob, ssn} | { ein, legal_business_name, representatives, website}` PII required to trigger Patriot Act compliant KYC verification. - `class IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: Date` Masked date of birth in ****-**-** format. - `ssn: String` Masked Social Security Number in the format ***-**-*\***. - `class BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: String` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: String` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives: Array[{ name, email, phone}]` A list of people related to the company. Only valid where customer type is 'business'. - `name: String` - `email: String` - `phone: String` - `website: String` Official business website URL. Optional but recommended for enhanced KYB. - `config: { processing_method, sandbox_outcome}` - `processing_method: :inline | :background | :skip` - `:inline` - `:background` - `:skip` - `sandbox_outcome: :standard | :verified | :rejected | :review` - `:standard` - `:verified` - `:rejected` - `:review` - `device: { ip_address}` - `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` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` 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: Time` 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 ```ruby require "straddle" straddle = Straddle::Client.new( api_key: "My API Key", environment: "production" # defaults to "sandbox" ) customer_v1 = straddle.customers.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") puts(customer_v1) ``` #### 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 `customers.list(**kwargs) -> PageNumberSchema<{ id, created_at, email, 6 more}>` **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 - `created_from: Time` Start date for filtering by `created_at` date. - `created_to: Time` End date for filtering by `created_at` date. - `email: String` Filter customers by `email` address. - `external_id: String` Filter by your system's `external_id`. - `name: String` Filter customers by `name` (partial match). - `page_number: Integer` Page number for paginated results. Starts at 1. - `page_size: Integer` Number of results per page. Maximum: 1000. - `search_text: String` General search term to filter customers. - `sort_by: :name | :created_at` - `:name` - `:created_at` - `sort_order: :asc | :desc` - `:asc` - `:desc` - `status: Array[:pending | :review | :verified | 2 more]` Filter customers by their current `status`. - `:pending` - `:review` - `:verified` - `:inactive` - `:rejected` - `types: Array[:individual | :business]` Filter by customer type `individual` or `business`. - `:individual` - `:business` - `correlation_id: String` - `request_id: String` - `straddle_account_id: String` ### Returns - `{ id, created_at, email, 6 more}` - `id: String` Unique identifier for the customer. - `created_at: Time` 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: Time` Timestamp of the most recent update to the customer record. - `external_id: String` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. ### Example ```ruby require "straddle" straddle = Straddle::Client.new( api_key: "My API Key", environment: "production" # defaults to "sandbox" ) page = straddle.customers.list puts(page) ``` #### 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 `customers.create(**kwargs) -> 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 - `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. - `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. Mobile number is preferred. - `type: :individual | :business` - `:individual` - `:business` - `address: CustomerAddressV1` 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` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile: { dob, ssn} | { ein, legal_business_name, representatives, website}` An object containing the customer's compliance profile. **This is optional.** If all required fields must be present for the appropriate customer type. - `class IndividualComplianceProfile` Individual PII data required to trigger Patriot Act compliant KYC verification. - `dob: Date` Date of birth (YYYY-MM-DD). Required for Patriot Act-compliant KYC verification. - `ssn: String` Social Security Number (format XXX-XX-XXXX). Required for Patriot Act-compliant KYC verification. - `class BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: String` Employer Identification Number (format XX-XXXXXXX). Required for Patriot Act-compliant KYB verification. - `legal_business_name: String` Official registered business name as listed with the IRS. This value will be matched against the 'legal_business name'. - `representatives: Array[{ name, email, phone}]` A list of people related to the company. Only valid where customer type is 'business'. - `name: String` - `email: String` - `phone: String` - `website: String` Official business website URL. Optional but recommended for enhanced KYB. - `config: { processing_method, sandbox_outcome}` - `processing_method: :inline | :background | :skip` - `:inline` - `:background` - `:skip` - `sandbox_outcome: :standard | :verified | :rejected | :review` - `:standard` - `:verified` - `:rejected` - `:review` - `external_id: String` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `correlation_id: String` - `idempotency_key: String` - `request_id: String` - `straddle_account_id: String` ### Returns - `class CustomerV1` - `data: { id, created_at, email, 11 more}` - `id: String` Unique identifier for the customer. - `created_at: Time` 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: Time` Timestamp of the most recent update to the customer record. - `address: 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` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile: { dob, ssn} | { ein, legal_business_name, representatives, website}` PII required to trigger Patriot Act compliant KYC verification. - `class IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: Date` Masked date of birth in ****-**-** format. - `ssn: String` Masked Social Security Number in the format ***-**-*\***. - `class BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: String` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: String` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives: Array[{ name, email, phone}]` A list of people related to the company. Only valid where customer type is 'business'. - `name: String` - `email: String` - `phone: String` - `website: String` Official business website URL. Optional but recommended for enhanced KYB. - `config: { processing_method, sandbox_outcome}` - `processing_method: :inline | :background | :skip` - `:inline` - `:background` - `:skip` - `sandbox_outcome: :standard | :verified | :rejected | :review` - `:standard` - `:verified` - `:rejected` - `:review` - `device: { ip_address}` - `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` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` 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: Time` 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 ```ruby require "straddle" straddle = Straddle::Client.new( api_key: "My API Key", environment: "production" # defaults to "sandbox" ) customer_v1 = straddle.customers.create( device: {ip_address: "192.168.1.1"}, email: "ron.swanson@pawnee.com", name: "Ron Swanson", phone: "+12128675309", type: :individual ) puts(customer_v1) ``` #### 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 `customers.unmasked(id, **kwargs) -> 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` - `correlation_id: String` - `request_id: String` - `straddle_account_id: String` ### Returns - `class CustomerUnmaskedV1` - `data: { id, created_at, email, 11 more}` - `id: String` Unique identifier for the customer. - `created_at: Time` 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: Time` Timestamp of the most recent update to the customer record. - `address: 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` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile: { dob, ssn} | { ein, legal_business_name, representatives, website}` Individual PII data required to trigger Patriot Act compliant KYC verification. - `class IndividualComplianceProfile` Individual PII data required to trigger Patriot Act compliant KYC verification. - `dob: Date` Date of birth (YYYY-MM-DD). Required for Patriot Act-compliant KYC verification. - `ssn: String` Social Security Number (format XXX-XX-XXXX). Required for Patriot Act-compliant KYC verification. - `class BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: String` Employer Identification Number (format XX-XXXXXXX). Required for Patriot Act-compliant KYB verification. - `legal_business_name: String` Official registered business name as listed with the IRS. This value will be matched against the 'legal_business name'. - `representatives: Array[{ name, email, phone}]` A list of people related to the company. Only valid where customer type is 'business'. - `name: String` - `email: String` - `phone: String` - `website: String` Official business website URL. Optional but recommended for enhanced KYB. - `config: { processing_method, sandbox_outcome}` - `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` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` 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: Time` 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 ```ruby require "straddle" straddle = Straddle::Client.new( api_key: "My API Key", environment: "production" # defaults to "sandbox" ) customer_unmasked_v1 = straddle.customers.unmasked("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") puts(customer_unmasked_v1) ``` #### 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 - `class 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` Secondary address line (e.g., apartment, suite, unit, or building). ### Customer Summary Paged V1 - `class CustomerSummaryPagedV1` - `data: Array[{ id, created_at, email, 6 more}]` - `id: String` Unique identifier for the customer. - `created_at: Time` 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: Time` Timestamp of the most recent update to the customer record. - `external_id: String` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `meta: { api_request_id, api_request_timestamp, max_page_size, 6 more}` - `api_request_id: String` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: Time` Timestamp for this API request, useful for troubleshooting. - `max_page_size: Integer` Maximum allowed page size for this endpoint. - `page_number: Integer` Page number for paginated results. - `page_size: Integer` 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: Integer` - `total_pages: Integer` 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 - `class CustomerUnmaskedV1` - `data: { id, created_at, email, 11 more}` - `id: String` Unique identifier for the customer. - `created_at: Time` 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: Time` Timestamp of the most recent update to the customer record. - `address: 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` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile: { dob, ssn} | { ein, legal_business_name, representatives, website}` Individual PII data required to trigger Patriot Act compliant KYC verification. - `class IndividualComplianceProfile` Individual PII data required to trigger Patriot Act compliant KYC verification. - `dob: Date` Date of birth (YYYY-MM-DD). Required for Patriot Act-compliant KYC verification. - `ssn: String` Social Security Number (format XXX-XX-XXXX). Required for Patriot Act-compliant KYC verification. - `class BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: String` Employer Identification Number (format XX-XXXXXXX). Required for Patriot Act-compliant KYB verification. - `legal_business_name: String` Official registered business name as listed with the IRS. This value will be matched against the 'legal_business name'. - `representatives: Array[{ name, email, phone}]` A list of people related to the company. Only valid where customer type is 'business'. - `name: String` - `email: String` - `phone: String` - `website: String` Official business website URL. Optional but recommended for enhanced KYB. - `config: { processing_method, sandbox_outcome}` - `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` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` 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: Time` 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 - `class CustomerV1` - `data: { id, created_at, email, 11 more}` - `id: String` Unique identifier for the customer. - `created_at: Time` 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: Time` Timestamp of the most recent update to the customer record. - `address: 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` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile: { dob, ssn} | { ein, legal_business_name, representatives, website}` PII required to trigger Patriot Act compliant KYC verification. - `class IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: Date` Masked date of birth in ****-**-** format. - `ssn: String` Masked Social Security Number in the format ***-**-*\***. - `class BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: String` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: String` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives: Array[{ name, email, phone}]` A list of people related to the company. Only valid where customer type is 'business'. - `name: String` - `email: String` - `phone: String` - `website: String` Official business website URL. Optional but recommended for enhanced KYB. - `config: { processing_method, sandbox_outcome}` - `processing_method: :inline | :background | :skip` - `:inline` - `:background` - `:skip` - `sandbox_outcome: :standard | :verified | :rejected | :review` - `:standard` - `:verified` - `:rejected` - `:review` - `device: { ip_address}` - `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` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` 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: Time` 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 - `class 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 `customers.review.get(id, **kwargs) -> 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` - `correlation_id: String` - `request_id: String` - `straddle_account_id: String` ### Returns - `class CustomerReviewV1` - `data: { customer_details, identity_details}` - `customer_details: { id, created_at, email, 11 more}` - `id: String` Unique identifier for the customer. - `created_at: Time` 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: Time` Timestamp of the most recent update to the customer record. - `address: 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` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile: { dob, ssn} | { ein, legal_business_name, representatives, website}` PII required to trigger Patriot Act compliant KYC verification. - `class IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: Date` Masked date of birth in ****-**-** format. - `ssn: String` Masked Social Security Number in the format ***-**-*\***. - `class BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: String` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: String` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives: Array[{ name, email, phone}]` A list of people related to the company. Only valid where customer type is 'business'. - `name: String` - `email: String` - `phone: String` - `website: String` Official business website URL. Optional but recommended for enhanced KYB. - `config: { processing_method, sandbox_outcome}` - `processing_method: :inline | :background | :skip` - `:inline` - `:background` - `:skip` - `sandbox_outcome: :standard | :verified | :rejected | :review` - `:standard` - `:verified` - `:rejected` - `:review` - `device: { ip_address}` - `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` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `identity_details: { breakdown, created_at, decision, 7 more}` - `breakdown: { address, business_evaluation, business_identification, 5 more}` Detailed breakdown of the customer verification results, including decisions, risk scores, correlation score, and more. - `address: IdentityVerificationBreakdownV1` - `codes: Array[String]` 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: Float` 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: Float` 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: Time` Timestamp of when the review was initiated. - `decision: :accept | :reject | :review` - `:accept` - `:reject` - `:review` - `review_id: String` Unique identifier for the review. - `updated_at: Time` Timestamp of the most recent update to the review. - `kyc: { validations, codes, decision}` - `validations: { address, city, dob, 7 more}` Boolean values indicating the result of each validation in the KYC process. - `address: bool` - `city: bool` - `dob: bool` - `email: bool` - `first_name: bool` - `last_name: bool` - `phone: bool` - `ssn: bool` - `state: bool` - `zip: bool` - `codes: Array[String]` List of specific result codes from the KYC screening process. - `decision: :accept | :reject | :review` - `:accept` - `:reject` - `:review` - `messages: Hash[Symbol, String]` Dictionary of all messages from the customer verification process. - `network_alerts: { alerts, codes, decision}` - `alerts: Array[String]` Any alerts or flags raised during the consortium alert screening. - `codes: Array[String]` List of specific result codes from the consortium alert screening. - `decision: :accept | :reject | :review` - `:accept` - `:reject` - `:review` - `reputation: { codes, decision, insights, risk_score}` - `codes: Array[String]` Specific codes related to the Straddle reputation screening results. - `decision: :accept | :reject | :review` - `:accept` - `:reject` - `:review` - `insights: { accounts_active_count, accounts_closed_count, accounts_closed_dates, 30 more}` - `accounts_active_count: Integer` - `accounts_closed_count: Integer` - `accounts_closed_dates: Array[Date]` - `accounts_count: Integer` - `accounts_fraud_count: Integer` - `accounts_fraud_labeled_dates: Array[Date]` - `accounts_fraud_loss_total_amount: Float` - `ach_fraud_transactions_count: Integer` - `ach_fraud_transactions_dates: Array[Date]` - `ach_fraud_transactions_total_amount: Float` - `ach_returned_transactions_count: Integer` - `ach_returned_transactions_dates: Array[Date]` - `ach_returned_transactions_total_amount: Float` - `applications_approved_count: Integer` - `applications_count: Integer` - `applications_dates: Array[Date]` - `applications_declined_count: Integer` - `applications_fraud_count: Integer` - `card_disputed_transactions_count: Integer` - `card_disputed_transactions_dates: Array[Date]` - `card_disputed_transactions_total_amount: Float` - `card_fraud_transactions_count: Integer` - `card_fraud_transactions_dates: Array[Date]` - `card_fraud_transactions_total_amount: Float` - `card_stopped_transactions_count: Integer` - `card_stopped_transactions_dates: Array[Date]` - `user_active_profile_count: Integer` - `user_address_count: Integer` - `user_closed_profile_count: Integer` - `user_dob_count: Integer` - `user_email_count: Integer` - `user_institution_count: Integer` - `user_mobile_count: Integer` - `risk_score: Float` - `watch_list: { codes, decision, matched, matches}` - `codes: Array[String]` Specific codes related to the Straddle watchlist screening results. - `decision: :accept | :reject | :review` - `:accept` - `:reject` - `:review` - `matched: Array[String]` Information about any matches found during screening. - `matches: Array[{ correlation, list_name, match_fields, urls}]` 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[String]` Data fields that matched. - `urls: Array[String]` 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: Time` 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 ```ruby require "straddle" straddle = Straddle::Client.new( api_key: "My API Key", environment: "production" # defaults to "sandbox" ) customer_review_v1 = straddle.customers.review.get("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") puts(customer_review_v1) ``` #### 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 `customers.review.decision(id, **kwargs) -> 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` - `status: :verified | :rejected` The final status of the customer review. - `:verified` - `:rejected` - `correlation_id: String` - `idempotency_key: String` - `request_id: String` - `straddle_account_id: String` ### Returns - `class CustomerV1` - `data: { id, created_at, email, 11 more}` - `id: String` Unique identifier for the customer. - `created_at: Time` 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: Time` Timestamp of the most recent update to the customer record. - `address: 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` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile: { dob, ssn} | { ein, legal_business_name, representatives, website}` PII required to trigger Patriot Act compliant KYC verification. - `class IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: Date` Masked date of birth in ****-**-** format. - `ssn: String` Masked Social Security Number in the format ***-**-*\***. - `class BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: String` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: String` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives: Array[{ name, email, phone}]` A list of people related to the company. Only valid where customer type is 'business'. - `name: String` - `email: String` - `phone: String` - `website: String` Official business website URL. Optional but recommended for enhanced KYB. - `config: { processing_method, sandbox_outcome}` - `processing_method: :inline | :background | :skip` - `:inline` - `:background` - `:skip` - `sandbox_outcome: :standard | :verified | :rejected | :review` - `:standard` - `:verified` - `:rejected` - `:review` - `device: { ip_address}` - `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` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` 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: Time` 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 ```ruby require "straddle" straddle = Straddle::Client.new( api_key: "My API Key", environment: "production" # defaults to "sandbox" ) customer_v1 = straddle.customers.review.decision("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", status: :verified) puts(customer_v1) ``` #### 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 `customers.review.refresh_review(id, **kwargs) -> 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` - `correlation_id: String` - `idempotency_key: String` - `request_id: String` - `straddle_account_id: String` ### Returns - `class CustomerV1` - `data: { id, created_at, email, 11 more}` - `id: String` Unique identifier for the customer. - `created_at: Time` 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: Time` Timestamp of the most recent update to the customer record. - `address: 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` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile: { dob, ssn} | { ein, legal_business_name, representatives, website}` PII required to trigger Patriot Act compliant KYC verification. - `class IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: Date` Masked date of birth in ****-**-** format. - `ssn: String` Masked Social Security Number in the format ***-**-*\***. - `class BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: String` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: String` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives: Array[{ name, email, phone}]` A list of people related to the company. Only valid where customer type is 'business'. - `name: String` - `email: String` - `phone: String` - `website: String` Official business website URL. Optional but recommended for enhanced KYB. - `config: { processing_method, sandbox_outcome}` - `processing_method: :inline | :background | :skip` - `:inline` - `:background` - `:skip` - `sandbox_outcome: :standard | :verified | :rejected | :review` - `:standard` - `:verified` - `:rejected` - `:review` - `device: { ip_address}` - `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` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` 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: Time` 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 ```ruby require "straddle" straddle = Straddle::Client.new( api_key: "My API Key", environment: "production" # defaults to "sandbox" ) customer_v1 = straddle.customers.review.refresh_review("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") puts(customer_v1) ``` #### 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 - `class CustomerReviewV1` - `data: { customer_details, identity_details}` - `customer_details: { id, created_at, email, 11 more}` - `id: String` Unique identifier for the customer. - `created_at: Time` 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: Time` Timestamp of the most recent update to the customer record. - `address: 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` Secondary address line (e.g., apartment, suite, unit, or building). - `compliance_profile: { dob, ssn} | { ein, legal_business_name, representatives, website}` PII required to trigger Patriot Act compliant KYC verification. - `class IndividualComplianceProfile` PII required to trigger Patriot Act compliant KYC verification. - `dob: Date` Masked date of birth in ****-**-** format. - `ssn: String` Masked Social Security Number in the format ***-**-*\***. - `class BusinessComplianceProfile` Business registration data required to trigger Patriot Act compliant KYB verification. - `ein: String` Masked Employer Identification Number in the format **-**\***** - `legal_business_name: String` The official registered name of the business. This name should be correlated with the `ein` value. - `representatives: Array[{ name, email, phone}]` A list of people related to the company. Only valid where customer type is 'business'. - `name: String` - `email: String` - `phone: String` - `website: String` Official business website URL. Optional but recommended for enhanced KYB. - `config: { processing_method, sandbox_outcome}` - `processing_method: :inline | :background | :skip` - `:inline` - `:background` - `:skip` - `sandbox_outcome: :standard | :verified | :rejected | :review` - `:standard` - `:verified` - `:rejected` - `:review` - `device: { ip_address}` - `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` Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format. - `identity_details: { breakdown, created_at, decision, 7 more}` - `breakdown: { address, business_evaluation, business_identification, 5 more}` Detailed breakdown of the customer verification results, including decisions, risk scores, correlation score, and more. - `address: IdentityVerificationBreakdownV1` - `codes: Array[String]` 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: Float` 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: Float` 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: Time` Timestamp of when the review was initiated. - `decision: :accept | :reject | :review` - `:accept` - `:reject` - `:review` - `review_id: String` Unique identifier for the review. - `updated_at: Time` Timestamp of the most recent update to the review. - `kyc: { validations, codes, decision}` - `validations: { address, city, dob, 7 more}` Boolean values indicating the result of each validation in the KYC process. - `address: bool` - `city: bool` - `dob: bool` - `email: bool` - `first_name: bool` - `last_name: bool` - `phone: bool` - `ssn: bool` - `state: bool` - `zip: bool` - `codes: Array[String]` List of specific result codes from the KYC screening process. - `decision: :accept | :reject | :review` - `:accept` - `:reject` - `:review` - `messages: Hash[Symbol, String]` Dictionary of all messages from the customer verification process. - `network_alerts: { alerts, codes, decision}` - `alerts: Array[String]` Any alerts or flags raised during the consortium alert screening. - `codes: Array[String]` List of specific result codes from the consortium alert screening. - `decision: :accept | :reject | :review` - `:accept` - `:reject` - `:review` - `reputation: { codes, decision, insights, risk_score}` - `codes: Array[String]` Specific codes related to the Straddle reputation screening results. - `decision: :accept | :reject | :review` - `:accept` - `:reject` - `:review` - `insights: { accounts_active_count, accounts_closed_count, accounts_closed_dates, 30 more}` - `accounts_active_count: Integer` - `accounts_closed_count: Integer` - `accounts_closed_dates: Array[Date]` - `accounts_count: Integer` - `accounts_fraud_count: Integer` - `accounts_fraud_labeled_dates: Array[Date]` - `accounts_fraud_loss_total_amount: Float` - `ach_fraud_transactions_count: Integer` - `ach_fraud_transactions_dates: Array[Date]` - `ach_fraud_transactions_total_amount: Float` - `ach_returned_transactions_count: Integer` - `ach_returned_transactions_dates: Array[Date]` - `ach_returned_transactions_total_amount: Float` - `applications_approved_count: Integer` - `applications_count: Integer` - `applications_dates: Array[Date]` - `applications_declined_count: Integer` - `applications_fraud_count: Integer` - `card_disputed_transactions_count: Integer` - `card_disputed_transactions_dates: Array[Date]` - `card_disputed_transactions_total_amount: Float` - `card_fraud_transactions_count: Integer` - `card_fraud_transactions_dates: Array[Date]` - `card_fraud_transactions_total_amount: Float` - `card_stopped_transactions_count: Integer` - `card_stopped_transactions_dates: Array[Date]` - `user_active_profile_count: Integer` - `user_address_count: Integer` - `user_closed_profile_count: Integer` - `user_dob_count: Integer` - `user_email_count: Integer` - `user_institution_count: Integer` - `user_mobile_count: Integer` - `risk_score: Float` - `watch_list: { codes, decision, matched, matches}` - `codes: Array[String]` Specific codes related to the Straddle watchlist screening results. - `decision: :accept | :reject | :review` - `:accept` - `:reject` - `:review` - `matched: Array[String]` Information about any matches found during screening. - `matches: Array[{ correlation, list_name, match_fields, urls}]` 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[String]` Data fields that matched. - `urls: Array[String]` 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: Time` 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 - `class IdentityVerificationBreakdownV1` - `codes: Array[String]` 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: Float` 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: Float` Predicts the inherent risk associated with the customer for a given module. A higher score indicates a greater likelihood of fraud.