Documentation
¶
Overview ¶
Package regonapi provides interface for REGON API (Polish National Official Business Register). This is a thin wrapper for official SOAP webservice, BIR1 version 1.1.
Index ¶
- Variables
- type Client
- func (c *Client) LegalPersonDetails(regon string) (*LegalPerson, error)
- func (c *Client) LegalPersonLocalUnitPKDList(regon14 string) ([]LegalPersonLocalUnitPKD, error)
- func (c *Client) LegalPersonPKDList(regon string) ([]LegalPersonPKD, error)
- func (c *Client) Login() error
- func (c *Client) Logout() error
- func (c *Client) NaturalPersonDetails(regon string) (*NaturalPerson, error)
- func (c *Client) NaturalPersonPKDList(regon string) ([]NaturalPersonPKD, error)
- func (c *Client) SearchByKRS(krs string) ([]Entity, error)
- func (c *Client) SearchByNIP(nip string) ([]Entity, error)
- func (c *Client) SearchByREGON(regon string) ([]Entity, error)
- func (c *Client) SessionStatus() (string, error)
- type Entity
- type LegalPerson
- type LegalPersonLocalUnitPKD
- type LegalPersonPKD
- type NaturalPerson
- type NaturalPersonPKD
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidKey is returned by Login ErrInvalidKey = errors.New("invalid API key") // ErrSessionNotStarted is returned when session not started. Login to start // a new session. ErrSessionNotStarted = errors.New("session not started") // ErrNoDataFound is returned by search API when no data is found in the // REGON database ErrNoDataFound = errors.New("no data found for the specified search criteria") // ErrEmptyResult is returned when API call returns an empty body. Check // session status and if session has expired login again. ErrEmptyResult = errors.New("empty result") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for REGON API webservice
func NewClient ¶
NewClient returns new REGON API client. For an empty key client connects to test endpoint (with test key). Provide context to control the underlying HTTP requests.
func (*Client) LegalPersonDetails ¶
func (c *Client) LegalPersonDetails(regon string) (*LegalPerson, error)
LegalPersonDetails returns details of legal person (type P) or nil and error. Entity is identified by REGON.
func (*Client) LegalPersonLocalUnitPKDList ¶ added in v1.0.0
func (c *Client) LegalPersonLocalUnitPKDList(regon14 string) ([]LegalPersonLocalUnitPKD, error)
LegalPersonLocalUnitPKDList returns list of PKD for legal person or nil and error. Entity is identified by REGON14.
func (*Client) LegalPersonPKDList ¶
func (c *Client) LegalPersonPKDList(regon string) ([]LegalPersonPKD, error)
LegalPersonPKDList returns list of PKD for legal person or nil and error. Entity is identified by REGON.
func (*Client) NaturalPersonDetails ¶
func (c *Client) NaturalPersonDetails(regon string) (*NaturalPerson, error)
NaturalPersonDetails returns details of natural person running economic activity (type F) or nil and error. Entity is identified by REGON.
func (*Client) NaturalPersonPKDList ¶
func (c *Client) NaturalPersonPKDList(regon string) ([]NaturalPersonPKD, error)
NaturalPersonPKDList returns list of PKD for natural person or nil and error. Entity is identified by REGON.
func (*Client) SearchByKRS ¶
SearchByKRS searches the REGON database by KRS. Returns list of entities or nil and error. Input parameter 10 digits string.
func (*Client) SearchByNIP ¶
SearchByNIP searches the REGON database by NIP. Returns list of entities or nil and error. Input parameter 10 digits string.
func (*Client) SearchByREGON ¶
SearchByREGON searches the database by REGON. Returns list of entities or nil and error. Input parameter must be normalized: 9 or 14 digits.
func (*Client) SessionStatus ¶
SessionStatus returns current session status: 1 = session active, 0 = session no longer active
type Entity ¶
type Entity struct {
ErrorCode int `xml:"ErrorCode"`
REGON string `xml:"Regon"`
NIP string `xml:"Nip"`
StatusNIP string `xml:"StatusNip"` // "", Uchylony, Unieważniony
Name string `xml:"Nazwa"`
Province string `xml:"Wojewodztwo"`
District string `xml:"Powiat"`
Community string `xml:"Gmina"`
City string `xml:"Miejscowosc"`
PostalCode string `xml:"KodPocztowy"`
Street string `xml:"Ulica"`
PropertyNumber string `xml:"NrNieruchomosci"`
ApartmentNumber string `xml:"NrLokalu"`
// (P) legal entity (F) natural person running economic activity (LP) local
// unit of the legal entity (LF) local unit of a natural person
Type string `xml:"Typ"`
SilosID string `xml:"SilosID"`
ActivityEndDate string `xml:"DataZakonczeniaDzialalnosci"`
PostCity string `xml:"MiejscowoscPoczty"`
}
Entity record in the REGON database describes business entity
type LegalPerson ¶
type LegalPerson struct {
ErrorCode int `xml:"ErrorCode"`
REGON9 string `xml:"praw_regon9"`
NIP string `xml:"praw_nip"`
StatusNIP string `xml:"praw_statusNip"` // "", Uchylony, Unieważniony
Name string `xml:"praw_nazwa"`
ShortName string `xml:"praw_nazwaSkrocona"`
RegistrationNumberReg string `xml:"praw_numerWRejestrzeEwidencji"`
RegistrationDateReg string `xml:"praw_dataWpisuDoRejestruEwidencji"`
CreationDate string `xml:"praw_dataPowstania"`
StartDate string `xml:"praw_dataRozpoczeciaDzialalnosci"`
RegistrationDate string `xml:"praw_dataWpisuDoRegon"`
HoldDate string `xml:"praw_dataZawieszeniaDzialalnosci"`
RenevalDate string `xml:"praw_dataWznowieniaDzialalnosci"`
RemovalDate string `xml:"praw_dataSkresleniaZRegon"`
LastUpdateDate string `xml:"praw_dataZaistnieniaZmiany"`
EndDate string `xml:"praw_dataZakonczeniaDzialalnosci"`
Phone string `xml:"praw_numerTelefonu"`
ExtPhone string `xml:"praw_numerWewnetrznyTelefonu"`
Fax string `xml:"praw_numerFaksu"`
Email string `xml:"praw_adresEmail"`
WWW string `xml:"praw_adresStronyinternetowej"`
NumberOfLocalUnits int `xml:"praw_liczbaJednLokalnych"`
}
LegalPerson holds details of entities type (P)
type LegalPersonLocalUnitPKD ¶ added in v1.0.0
type LegalPersonLocalUnitPKD struct {
ErrorCode int `xml:"ErrorCode"`
Code string `xml:"lokpraw_pkdKod"`
Name string `xml:"lokpraw_pkdNazwa"`
Primary string `xml:"lokpraw_pkdPrzewazajace"`
}
LegalPersonLocalUnitPKD holds information of PKD (classification of business activity) for local unit of legal person (type LP). Local units are identified by REGON14 (14 digits).
type LegalPersonPKD ¶
type LegalPersonPKD struct {
ErrorCode int `xml:"ErrorCode"`
Code string `xml:"praw_pkdKod"`
Name string `xml:"praw_pkdNazwa"`
Primary string `xml:"praw_pkdPrzewazajace"`
}
LegalPersonPKD holds information of PKD (classification of business activity) for legal person
type NaturalPerson ¶
type NaturalPerson struct {
ErrorCode int `xml:"ErrorCode"`
REGON9 string `xml:"fiz_regon9"`
NIP string `xml:"fiz_nip"`
StatusNIP string `xml:"fiz_statusNip"` // "", Uchylony, Unieważniony
LastName string `xml:"fiz_nazwisko"`
FirstName1 string `xml:"fiz_imie1"`
FirstName2 string `xml:"fiz_imie2"`
REGONRegistrationDate string `xml:"fiz_dataWpisuDoREGON"`
LastUpdateDate string `xml:"fiz_dataZaistnieniaZmiany"`
RemovalDate string `xml:"fiz_dataSkresleniaPodmiotuZRegon"`
BasicLegalFormCode string `xml:"fiz_podstawowaFormaPrawna_Symbol"`
SpecificLegalFormCode string `xml:"fiz_szczegolnaFormaPrawna_Symbol"`
OwnershipFormCode string `xml:"fiz_formaWlasnosci_Symbol"`
BasicLegalFormName string `xml:"fiz_podstawowaFormaPrawna_Nazwa"`
SpecificLegalFormName string `xml:"fiz_szczegolnaFormaPrawna_Nazwa"`
OwnershipFormName string `xml:"fiz_formaWlasnosci_Nazwa"`
NumberOfLocalUnits int `xml:"fiz_liczbaJednLokalnych"`
}
NaturalPerson holds details of entities type (F)
type NaturalPersonPKD ¶
type NaturalPersonPKD struct {
ErrorCode int `xml:"ErrorCode"`
Code string `xml:"fiz_pkd_Kod"`
Name string `xml:"fiz_pkd_Nazwa"`
Primary string `xml:"fiz_pkd_Przewazajace"`
SilosID int `xml:"fiz_SilosID"`
SilosCode string `xml:"fiz_Silos_Symbol"`
RemovalDate string `xml:"fiz_dataSkresleniaDzialalnosciZRegon"`
}
NaturalPersonPKD holds information of PKD (classification of business activity) for natural person