DX STF Client API

<back to all web services

GetTransactionalPartyById

Transactional Party Requests

Transactional Party

Requires Authentication
The following routes are available for this service:
GET/api/transactionalParty/{Id}Get specific transactionalParty by transactionalParty Id
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
Object = TypeVar('Object')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DocumentIdentification:
    identifier: Optional[str] = None
    type: Optional[str] = None
    creation_date_and_time: datetime.datetime = datetime.datetime(1, 1, 1)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Identifier:
    authority: Optional[str] = None
    text: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ContactInformation:
    pass


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Partner:
    identifier: Optional[Identifier] = None
    contact_information: List[ContactInformation] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Header:
    document_identification: Optional[DocumentIdentification] = None
    sender: Optional[Partner] = None
    receiver: Optional[Partner] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AvpList:
    code: Optional[str] = None
    value: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Ecom_PartyIdentificationType:
    gln: Optional[str] = None
    name: Optional[str] = None
    additional_party_identification: List[AvpList] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CommunicationChannel:
    communication_channel_code: Optional[str] = None
    communication_channel_name: Optional[str] = None
    communication_value: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Contact:
    contact_type_code: Optional[str] = None
    person_name: Optional[str] = None
    department_name: Optional[str] = None
    job_title: Optional[str] = None
    responsibility: Optional[str] = None
    communication_channel: List[CommunicationChannel] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Address:
    street_address_one: Optional[str] = None
    street_address_two: Optional[str] = None
    street_address_three: Optional[str] = None
    city: Optional[str] = None
    postal_code: Optional[str] = None
    province_code: Optional[str] = None
    country_code: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FinancialRoutingNumber:
    number: Optional[str] = None
    number_type_code: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FinancialAccount:
    number: Optional[str] = None
    number_type_code: Optional[str] = None
    name: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FinancialInstitutionInformation:
    financial_institution_branch_name: Optional[str] = None
    financial_institution_name: Optional[str] = None
    financial_routing_number: Optional[FinancialRoutingNumber] = None
    financial_account: Optional[FinancialAccount] = None
    swift_code: Optional[str] = None
    exporters_code: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TransactionalParty(Ecom_PartyIdentificationType):
    contact: List[Contact] = field(default_factory=list)
    address: Optional[Address] = None
    communication_channel: List[AvpList] = field(default_factory=list)
    financial_institution_information: Optional[FinancialInstitutionInformation] = None
    duty_fee_tax_registration: Optional[str] = None
    entity_identification: Optional[str] = None


class DocumentAction(str, Enum):
    ADD = 'ADD'
    CHANGE_BY_REFRESH = 'CHANGE_BY_REFRESH'
    DELETE = 'DELETE'
    REJECTED = 'REJECTED'


class DocumentStatus(str, Enum):
    ADDITIONAL_TRANSMISSION = 'ADDITIONAL_TRANSMISSION'
    COPY = 'COPY'
    ORIGINAL = 'ORIGINAL'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TransactionalPartyMessageType(TransactionalParty):
    creation_date_time: datetime.datetime = datetime.datetime(1, 1, 1)
    last_update_date_time: Optional[datetime.datetime] = None
    document_action_code: Optional[DocumentAction] = None
    document_status_code: Optional[DocumentStatus] = None
    document_structure_version: Optional[str] = None
    revision_number: Optional[int] = None
    avp_list: List[AvpList] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TransactionalPartyMessage:
    header: Optional[Header] = None
    transactional_party: Optional[TransactionalPartyMessageType] = None


# @Api(Description="Transactional Party")
# @ApiResponse(Description="transactionalParty data", IsDefaultResponse=true, StatusCode=200)
# @ApiResponse(Description="No Content", ResponseType=typeof(IReturnVoid), StatusCode=204)
# @ApiResponse(Description="Specified argument was out of the range of valid values.", ResponseType=typeof(ArgumentOutOfRangeException), StatusCode=400)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetTransactionalPartyById(IGetDocumentById):
    """
    Transactional Party
    """

    # @ApiMember(Description="transactionalParty ID or Token", ExcludeInSchema=true, ParameterType="path")
    id: Optional[str] = None
    """
    transactionalParty ID or Token
    """

Python GetTransactionalPartyById DTOs

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

HTTP + XML

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

GET /api/transactionalParty/{Id} HTTP/1.1 
Host: stf-api-uat.data-xchange.co.za 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<TransactionalPartyMessage xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DX.STF.Models.Dto.GS1">
  <Header>
    <documentIdentification>
      <creationDateAndTime>0001-01-01T00:00:00</creationDateAndTime>
      <identifier>String</identifier>
      <type>String</type>
    </documentIdentification>
    <receiver>
      <contactInformation>
        <ContactInformation />
      </contactInformation>
      <identifier>
        <authority>String</authority>
        <text>String</text>
      </identifier>
    </receiver>
    <sender>
      <contactInformation>
        <ContactInformation />
      </contactInformation>
      <identifier>
        <authority>String</authority>
        <text>String</text>
      </identifier>
    </sender>
  </Header>
  <TransactionalParty>
    <AdditionalPartyIdentification>
      <AvpList>
        <Code>String</Code>
        <Value>String</Value>
      </AvpList>
    </AdditionalPartyIdentification>
    <Gln>String</Gln>
    <Name>String</Name>
    <Address>
      <City>String</City>
      <CountryCode>String</CountryCode>
      <PostalCode>String</PostalCode>
      <ProvinceCode>String</ProvinceCode>
      <StreetAddressOne>String</StreetAddressOne>
      <StreetAddressThree>String</StreetAddressThree>
      <StreetAddressTwo>String</StreetAddressTwo>
    </Address>
    <CommunicationChannel>
      <AvpList>
        <Code>String</Code>
        <Value>String</Value>
      </AvpList>
    </CommunicationChannel>
    <Contact>
      <Contact>
        <CommunicationChannel>
          <CommunicationChannel>
            <CommunicationChannelCode>String</CommunicationChannelCode>
            <CommunicationChannelName>String</CommunicationChannelName>
            <CommunicationValue>String</CommunicationValue>
          </CommunicationChannel>
        </CommunicationChannel>
        <ContactTypeCode>String</ContactTypeCode>
        <DepartmentName>String</DepartmentName>
        <JobTitle>String</JobTitle>
        <PersonName>String</PersonName>
        <Responsibility>String</Responsibility>
      </Contact>
    </Contact>
    <DutyFeeTaxRegistration>String</DutyFeeTaxRegistration>
    <EntityIdentification>String</EntityIdentification>
    <FinancialInstitutionInformation>
      <ExportersCode>String</ExportersCode>
      <FinancialAccount>
        <Name>String</Name>
        <Number>String</Number>
        <NumberTypeCode>String</NumberTypeCode>
      </FinancialAccount>
      <FinancialInstitutionBranchName>String</FinancialInstitutionBranchName>
      <FinancialInstitutionName>String</FinancialInstitutionName>
      <FinancialRoutingNumber>
        <Number>String</Number>
        <NumberTypeCode>String</NumberTypeCode>
      </FinancialRoutingNumber>
      <SwiftCode>String</SwiftCode>
    </FinancialInstitutionInformation>
    <AvpList>
      <AvpList>
        <Code>String</Code>
        <Value>String</Value>
      </AvpList>
    </AvpList>
    <CreationDateTime>0001-01-01T00:00:00</CreationDateTime>
    <DocumentActionCode>ADD</DocumentActionCode>
    <DocumentStatusCode>ADDITIONAL_TRANSMISSION</DocumentStatusCode>
    <DocumentStructureVersion>String</DocumentStructureVersion>
    <LastUpdateDateTime>0001-01-01T00:00:00</LastUpdateDateTime>
    <RevisionNumber>0</RevisionNumber>
  </TransactionalParty>
</TransactionalPartyMessage>