CDD Engine Web Service v2.14.0.0

<back to all web services

CompaniesHouseRequest

iNASA
Requires Authentication
The following routes are available for this service:
GET, POST/CompaniesHouse/{CompanyNumber}
GET, POST/CompaniesHouse
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CompaniesHouseAddress:
    address1: Optional[str] = None
    address2: Optional[str] = None
    address3: Optional[str] = None
    city: Optional[str] = None
    postcode: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CompaniesHouseIncorporationDate:
    day: Optional[int] = None
    month: Optional[int] = None
    year: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CompaniesHouseShareHolderData:
    title: Optional[str] = None
    first_name: Optional[str] = None
    middle_names: Optional[str] = None
    last_name: Optional[str] = None
    percentage_of_voting_shares_owned: Optional[float] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CompaniesHouseDirectorsData:
    title: Optional[str] = None
    first_name: Optional[str] = None
    middle_names: Optional[str] = None
    last_name: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CompaniesHouseData:
    registered_name: Optional[str] = None
    address: Optional[CompaniesHouseAddress] = None
    date_of_incorporation: Optional[CompaniesHouseIncorporationDate] = None
    share_holders: Optional[List[CompaniesHouseShareHolderData]] = None
    directors: Optional[List[CompaniesHouseDirectorsData]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CompaniesHouseResponse:
    result: Optional[CompaniesHouseData] = None
    """
    Contains the companies house lookup result when successful.
    """

    response_status: Optional[ResponseStatus] = None
    """
    Contains response status, details and errors.
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CompaniesHouseRequest:
    # @Required()
    company_number: Optional[str] = None
    """
    The registered company number.
    """


    csr: Optional[str] = None
    """
    The Csr of the application (if available).
    """

Python CompaniesHouseRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /CompaniesHouse/{CompanyNumber} HTTP/1.1 
Host: wpcdd-featuretest-ws.worldpay.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CompanyNumber: String,
	Csr: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Result: 
	{
		registeredName: String,
		address: 
		{
			address1: String,
			address2: String,
			address3: String,
			city: String,
			postcode: String
		},
		dateOfIncorporation: 
		{
			day: 0,
			month: 0,
			year: 0
		},
		shareHolders: 
		[
			{
				title: String,
				firstName: String,
				middleNames: String,
				lastName: String,
				percentageOfVotingSharesOwned: 0
			}
		],
		directors: 
		[
			{
				title: String,
				firstName: String,
				middleNames: String,
				lastName: String
			}
		]
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}