Ruby wrapper for the Checkbiz API, built on rest-easy.
Provides typed access to Swedish person, company, and credit information services.
gem "checkbiz", path: "../checkbiz" # local
gem "checkbiz", git: "https://github.com/accodeing/checkbiz" # gitCheckbiz.configure do
authentication RestEasy::Auth::PSK.new(
api_key: ENV["CHECKBIZ_API_KEY"],
header_prefix: "Basic"
)
endEvery endpoint is a resource class with a .call method. Pass query parameters as keyword arguments and the package name via package:.
# Company information
company = Checkbiz::CompanyInformation.call(
organization_number: "5564866286",
package: "foretagadress"
)
company.name # => PersonNameBlock struct
company.basic # => CompanyBasicBlock struct
company.meta.response_code # => "Ok"
# Person information
person = Checkbiz::PersonInformation.call(
ssn: "194907299289",
package: "personadress"
)
person.basic # => PersonBasicBlock struct
person.ssn_status # => "Active"
# Search
results = Checkbiz::CompanySearch.call(
who: "Accodeing",
max_nr_records: 10,
package: "sokforetag"
)
results.basic_result # => CompanySearchBasicBlock struct
# Account info (no package required)
info = Checkbiz::PackageInformation.call
info.products # => Array of PackageInformationProductBlockresponseCode and responseMessage are extracted into meta on every response:
result = Checkbiz::CompanyInformation.call(organization_number: "5564866286", package: "foretagadress")
result.meta.response_code # => "Ok"
result.meta.response_message # => nilSome endpoints have a v2 variant with additional fields:
Checkbiz::CompanyCreditTemplate.call_v2(
organization_number: "5564866286",
package: "bas"
)Checkbiz::CustomList.call(package: "bas") # GET
Checkbiz::CustomList.add(items, package: "bas") # POST
Checkbiz::CustomList.remove(items, package: "bas") # PUTPackageInformation- list authorized products and packagesPackageCalls- usage statistics
CompanyInformation- company details by org numberCompanyInformationList- batch lookupCompanyCreditTemplate/call_v2- credit reportsCompanyBeneficialOwner- beneficial ownershipCompanyAnnualReports- list annual reportsCompanyAnnualReport- fetch single report by ref numberCompanyArticlesOfAssociation- articles of association (PDF)CompanyCertificatesOfRegistration- registration certificate (PDF)CompanyWorksite- worksite info by CFAR numberCompanySearch- basic company searchCompanySearchAdvanced- advanced company searchCompanyAutocomplete- autocomplete suggestionsCompanyEvent- company events by date range
PersonInformation- person details by SSNPersonInformationList- batch lookupPersonCreditTemplate/call_v2- credit reportsPersonBeneficialOwner- beneficial ownershipPersonSearch- basic person searchPersonSearchAdvanced- advanced person searchPersonEvent- person events by date rangePersonVerify- identity verification
LookupIdNo- lookup by ID numberLookupCompanyNo- lookup by company numberLookupPhoneNo- lookup by phone numberAddressInformation- address lookupNix- NIX registry check
Bolagsverket- Swedish Companies Registration Office dataSignatory- signatory informationSpar- SPAR registryPtsInfo- PTS phone dataGeomatics- geographic dataStatistics- income and economic statisticsDataFactoryPersonSearch- extended person searchSubscriber/SubscriberList- subscriber infoSearchNo/ExtendedSearchNo- Norwegian registry searchSafenodePersonCreditReport/SafenodePersonRemarkControl- Safenode person reportsSafenodeCompanyCreditReport/SafenodeCompanyRemarkControl- Safenode company reportsUrl/UrlSearch- report URL generationCustomList- custom list management (GET/POST/PUT)Heartbeat- API health check
bundle install
bundle exec rspecTests use VCR cassettes recorded against the staging API. To re-record, delete spec/vcr_cassettes/ and run the suite with a valid API key configured in spec/spec_helper.rb.
MIT