Sha256: e36b67b0ff1ba38c871d73c104239f0f9b7277267662b763bd97084305b39193

Contents?: true

Size: 1.86 KB

Versions: 1

Compression:

Stored size: 1.86 KB

Contents

# creditsafe-ruby

*Build status: [![Circle CI](https://circleci.com/gh/gocardless/creditsafe-ruby.svg?style=svg&circle-token=3f6e9b24fcc6a57abac110c59395b36032f156a5)](https://circleci.com/gh/gocardless/creditsafe-ruby)*

A ruby library for interacting with the
[creditsafe](http://www.creditsafeuk.com/) API.

Currently, it only partially implements the API to support finding companies by
registration number and retrieving company online reports.

# Installation

Install the gem from RubyGems.org by adding the following to your `Gemfile`:

```ruby
gem 'creditsafe', '~> 0.3.1'
```

Just run `bundle install` to install the gem and its dependencies.

# Usage

Initialise the client with your `username` and `password`.

```ruby
client = Creditsafe::Client.new(username: "foo", password: "bar")
```

### Company Search

To perform a search for a company, you need to provide a country code and a company registration number.

```ruby
client.find_company(country_code: "GB", registration_number: "07495895")
=> {
    name: "GOCARDLESS LTD",
    type: "Ltd",
    status: "Active",
    registration_number: "07495895",
    address: {
        simple_value: "338-346, GOSWELL, LONDON",
        postal_code: "EC1V7LQ"
    },
    available_report_types: { available_report_type: "Full" },
    available_languages: { available_language: "EN" },
    @date_of_latest_accounts: "2014-01-31T00:00:00Z",
    @online_reports: "true",
    @monitoring: "false",
    @country: "GB",
    @id: "GB003/0/07495895"
   }
```

### Company Report

To download all the information available in an online company report, you will
need the company's creditsafe identifier (obtainable using
[find_company](#find_company) above.

```ruby
client.company_report(creditsafe_id: "GB003/0/07495895")
=> {
    ...
   }
```


---

GoCardless ♥ open source. If you do too, come [join us](https://gocardless.com/jobs#software-engineer).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
creditsafe-0.3.1 README.md