Class: BankOfThailand::Resources::LicenseCheck

Inherits:
BankOfThailand::Resource show all
Defined in:
lib/bank_of_thailand/resources/statistics.rb

Overview

BOT License Check Public API

API for checking licenses or registrations for businesses under the supervision of the Bank of Thailand, such as P-Loan, Nano Finance, e-Money.

Constant Summary collapse

BASE_URL =

Base URL for this API (overrides the global base URL)

"https://gateway.api.bot.or.th/BotLicenseCheckAPI"

Instance Attribute Summary

Attributes inherited from BankOfThailand::Resource

#client

Instance Method Summary collapse

Methods inherited from BankOfThailand::Resource

#initialize

Constructor Details

This class inherits a constructor from BankOfThailand::Resource

Instance Method Details

#authorized_detail(id:) ⇒ Hash

Get authorized entity details

Examples:

Get entity details

client.license_check.authorized_detail(id: 12345)

Parameters:

  • id (Integer)

    ID of the authorized entity in the system (required)

Returns:

  • (Hash)

    Response containing entity details



65
66
67
# File 'lib/bank_of_thailand/resources/statistics.rb', line 65

def authorized_detail(id:)
  get_with_base_url("#{BASE_URL}/AuthorizedDetail", id: id)
end

#license(auth_id:, doc_id:) ⇒ Hash

Get license details

Examples:

Get license information

client.license_check.license(
  auth_id: "12345",
  doc_id: "DOC-001"
)

Parameters:

  • auth_id (String)

    ID of the authorized entity in the system (required)

  • doc_id (String)

    Document reference number (required)

Returns:

  • (Hash)

    Response containing license details



50
51
52
53
54
55
56
# File 'lib/bank_of_thailand/resources/statistics.rb', line 50

def license(auth_id:, doc_id:)
  get_with_base_url(
    "#{BASE_URL}/License",
    authId: auth_id,
    docId: doc_id
  )
end

#search_authorized(keyword:, page: nil, limit: nil) ⇒ Hash

Search for authorized entities

Examples:

Search for authorized entities

client.license_check.search_authorized(keyword: "finance")

Search with pagination

client.license_check.search_authorized(
  keyword: "finance",
  page: 1,
  limit: 10
)

Parameters:

  • keyword (String)

    Search keyword (required)

  • page (String, Integer, nil) (defaults to: nil)

    Page position (optional)

  • limit (Integer, nil) (defaults to: nil)

    Number of results (optional)

Returns:

  • (Hash)

    Response containing search results



31
32
33
34
35
36
37
# File 'lib/bank_of_thailand/resources/statistics.rb', line 31

def search_authorized(keyword:, page: nil, limit: nil)
  params = { keyword: keyword }
  params[:page] = page if page
  params[:limit] = limit if limit

  get_with_base_url("#{BASE_URL}/SearchAuthorized", params)
end