> For the complete documentation index, see [llms.txt](https://legacy-docs.usesmileid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy-docs.usesmileid.com/integration-options/server-to-server/ruby/products/kyb-business-verification.md).

# KYB - Business Verification

Required Class: **ID Api Class**

## Running Business Verification on Ruby

1. Get your Smile ID `Partner ID`
2. Get your API Key (take note of the environment you are running the job in)
3. Get the business information from your users
4. Submit the Job to Smile ID
5. Interpret your results

### Get your Partner ID

You can find your Partner ID in the menu list when logged into [the portal](https://portal.usesmileid.com/partner/dashboard).

![](/files/5bAEvct4lkb2MvYp3h3I)

### Get your API Key

Your api key is in the developer section of [the portal.](https://portal.usesmileid.com/api-key)

* Click on the **Generate New API Key** button
* Copy your api key (ensure you are in the right environment)

![Generate a new API Key](/files/5de0FSBPKuA9KoRJZ0Gj)

![Copy your API Key](/files/GUr0iFqBeWmWdAmCfph2)

### Get the Business Information from your Users

To submit a Business Verification job, you need either the business registration Number or the tax number of your user's business. Depending on the ID type you are attempting to query, the required information varies. For the comprehensive list of required information for each ID Type, check the [Supported ID Types](/supported-id-types/for-businesses-kyb/id-number-regex.md) section of the docs.

### Submit the Job to Smile ID

You can copy the sample code below and edit with your partner and job details.

```ruby
require 'smile-identity-core'

# Initialize
partner_id = '<Your partner ID>'; # login to the Smile ID portal to view your partner id
api_key = '<Your API key>'; # copy your API key from the Smile ID portal
sid_server = '<0 or 1>'; # Use '0' for the sandbox server, use '1' for production server

connection = SmileIdentityCore::IDApi.new(partner_id, api_key, sid_server)

# Create required tracking parameters
partner_params = {
    job_id: '<put your unique job ID here>',
    user_id: '<put your unique ID for the user here>',
    job_type: SmileIdentityCore::JobType::BUSINESS_VERIFICATION
};

# Create ID info
# Create ID info
id_info = {
  # The country where ID document was issued
  country: 'NG',
  # The ID document type
  # Available types BUSINESS_REGISTRATION and TAX_INFORMATION
  id_type: '<id type>',
  # The business registration or tax number
  id_number: '0000000',
  # The business incorporation type bn - business name, co - private/public limited, it - incorporated trustees
  # Only required for BUSINESS_REGISTRATION in Nigeria
  business_type: 'co',
  # Postal address of business. Only Required for BUSINESS_REGISTRATION in Kenya
  postal_address: '<postal address>',
  # Postal code of business. Only Required for BUSINESS_REGISTRATION in Kenya
  postal_code: '<postal code>'
}

# Set the options for the job
options = {};

# Submit the job
response = connection.submit_job(partner_params, id_info, options)
```

**Example Response Body**

Your response will return a JSON String containing the below:

```json
{
  "signature": "---",
  "timestamp": "2022-10-17T10:46:49.392Z",
  "SmileJobID": "0000001927",
  "PartnerParams": {
    "user_id": "kyb_test_user_008",
    "job_id": "001",
    "job_type": 7
  },
  "ResultText": "Business Verified",
  "ResultCode": "1012",
  "Actions": {
    "Return_Business_Info": "Returned",
    "Verify_Business": "Verified"
  },
  "company_information": {
    "company_type": "PRIVATE_COMPANY_LIMITED_BY_SHARES",
    "country": "Nigeria",
    "address": "10, Workbox, Ojora Close, Victoria Island, Lagos",
    "registration_number": "0000000",
    "search_number": "0000000",
    "authorized_shared_capital": "10000000",
    "industry": "Technology Solutions Company",
    "tax_id": "N/A",
    "registration_date": "2016-01-28T16:06:22.003+00:00",
    "phone": "08000000000",
    "legal_name": "SMILE IDENTITY NIGERIA LIMITED",
    "state": "LAGOS",
    "email": "smile@usesmileid.com",
    "status": "ACTIVE"
  },
  "fiduciaries": [
    {
      "name": "Company X",
      "fiduciary_type": "SECRETARY_COMPANY",
      "address": "10, Workbox, Ojora Close, Victoria Island, Lagos",
      "registration_number": "000000",
      "status": "N/A"
    }
  ],
  "beneficial_owners": [
    {
      "shareholdings": "100000",
      "address": "10, Workbox, Ojora Close, Victoria Island, Lagos",
      "gender": "Male",
      "nationality": "Nigerian",
      "registration_number": "N/A",
      "name": "Joe Bloggs",
      "shareholder_type": "Individual",
      "phone_number": "0123456789"
    },
    {
      "shareholdings": "700000",
      "address": "1234 Main Street Anytown Anystate 00000 USA",
      "gender": "Not Applicable",
      "nationality": "N/A",
      "registration_number": "000000",
      "name": "XYZ Widget Corporation",
      "shareholder_type": "Corporate",
      "phone_number": "0123456789"
    }
  ],
  "proprietors": [],
  "documents": {
    "search_certificate": ""
  },
  "directors": [
    {
      "shareholdings": "100000",
      "id_number": "A000000",
      "address": "10, Workbox, Ojora Close, Victoria Island, Lagos",
      "occupation": "CEO",
      "gender": "MALE",
      "nationality": "Nigerian",
      "date_of_birth": "2000-09-20",
      "name": "Joe Doe Leo",
      "id_type": "Passport",
      "phone_number": "0123456789"
    },
    {
      "shareholdings": "100000",
      "id_number": "A000000",
      "address": "1234 Main Street Anytown Anystate 00000 USA",
      "occupation": "COO",
      "gender": "FEMALE",
      "nationality": "American",
      "date_of_birth": "2000-01-01",
      "name": "Jane Doe",
      "id_type": "Passport",
      "phone_number": "0123456789"
    }
  ],
  "success": true
}
```

### Interpret your Results

You can read more about result codes and responses in the [Business Verification](/products/for-businesses-kyb/business-verification.md) section of the docs.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://legacy-docs.usesmileid.com/integration-options/server-to-server/ruby/products/kyb-business-verification.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
