Portal

<back to all web services

BrowseSupplierByVatNumberOrDuns

The following routes are available for this service:
GET/supplier/search
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 ResponseBase:
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ModifyRequestBase(IConcurrencyStamp):
    concurrency_stamp: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SupplierBase(ModifyRequestBase):
    vat_number: Optional[str] = None
    eu_tax_number: Optional[str] = None
    group_tax_number: Optional[str] = None
    business_type: int = 0
    country_id: int = 0
    name: Optional[str] = None
    short_name: Optional[str] = None
    registration_number: Optional[str] = None
    established_date: datetime.datetime = datetime.datetime(1, 1, 1)
    registration_date: datetime.datetime = datetime.datetime(1, 1, 1)
    duns: Optional[str] = None
    operating_license_number: Optional[str] = None
    is_accounting: bool = False
    is_small_tax_payer: bool = False
    email: Optional[str] = None
    phone_number: Optional[str] = None
    website: Optional[str] = None


class SupplierStatus(IntEnum):
    REGISTERED = 0
    AWAITING_VEOLIA_CONFIRMATION = 1
    ACTIVE = 2
    REJECTED = 3
    LOCKED = 4
    DELETED = 5


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SupplierDetails(SupplierBase):
    id: int = 0
    owner_id: int = 0
    country_name: Optional[str] = None
    country_code: Optional[str] = None
    status: Optional[SupplierStatus] = None
    meta: Optional[Dict[str, str]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BrowseSupplierResponse(ResponseBase):
    supplier: Optional[SupplierDetails] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BrowseSupplierByVatNumberOrDuns(IGet):
    vat_number: Optional[str] = None
    country: Optional[str] = None
    duns_number: Optional[str] = None

Python BrowseSupplierByVatNumberOrDuns 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.

GET /supplier/search HTTP/1.1 
Host: szallitoiportal-be.veolia.hu 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Supplier: 
	{
		Id: 0,
		OwnerId: 0,
		CountryName: String,
		CountryCode: String,
		Status: 0,
		Meta: 
		{
			String: String
		},
		VatNumber: String,
		EUTaxNumber: String,
		GroupTaxNumber: String,
		BusinessType: 0,
		CountryId: 0,
		Name: String,
		ShortName: String,
		RegistrationNumber: String,
		EstablishedDate: 0001-01-01,
		RegistrationDate: 0001-01-01,
		Duns: String,
		OperatingLicenseNumber: String,
		IsAccounting: False,
		IsSmallTaxPayer: False,
		Email: String,
		PhoneNumber: String,
		Website: String,
		ConcurrencyStamp: String
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}