DX STF Client API

<back to all web services

GetCustomerMasterByIdentification

Customer Master Requests

Customer Master

Requires Authentication
The following routes are available for this service:
GET/api/customerMaster/{OwnerGln}/{CustomerMasterIdentification}Get specific customer by customerMasterIdentification 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 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


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerMasterAddress(Address):
    address_type: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerRecord:
    gln: Optional[str] = None
    code: Optional[str] = None
    name: Optional[str] = None
    buyer_assigned_vendor_no: Optional[str] = None
    supplier_assigned_vendor_no: Optional[str] = None
    duty_fee_tax_registration: Optional[str] = None
    entity_identification: Optional[str] = None
    contact: List[Contact] = field(default_factory=list)
    address: Optional[CustomerMasterAddress] = None
    avp_list: List[AvpList] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreditLimit:
    limit: Decimal = decimal.Decimal(0)
    balance: Decimal = decimal.Decimal(0)
    available: Decimal = decimal.Decimal(0)
    effective_date_time: Optional[datetime.datetime] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerMasterType(CustomerRecord):
    pay_by_customer: Optional[CustomerRecord] = None
    bill_to_customer: Optional[CustomerRecord] = None
    routing_code: Optional[str] = None
    store_type: Optional[str] = None
    currency_code: Optional[str] = None
    type: Optional[str] = None
    group: Optional[str] = None
    region: Optional[str] = None
    zone_rate: Optional[str] = None
    tax_rule: Optional[str] = None
    payment_term: Optional[str] = None
    shipment_site: Optional[str] = None
    shipment_site_name: Optional[str] = None
    shipment_site_gln: Optional[str] = None
    accounting_code: Optional[str] = None
    commercial_representative: Optional[str] = None
    commercial_territory: Optional[str] = None
    credit: Optional[CreditLimit] = None
    nod: List[str] = field(default_factory=list)
    ndd: List[str] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerMasterMessage:
    data_source: Optional[TransactionalParty] = None
    data_recipient: Optional[TransactionalParty] = None
    customer_master_identification: Optional[str] = None
    customer: List[CustomerMasterType] = field(default_factory=list)
    document_status_code: Optional[str] = None
    document_action_code: Optional[str] = None
    creation_date_time: datetime.datetime = datetime.datetime(1, 1, 1)
    last_update_date_time: datetime.datetime = datetime.datetime(1, 1, 1)


# @Api(Description="Customer Master")
# @ApiResponse(Description="Customer Master 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 GetCustomerMasterByIdentification:
    """
    Customer Master
    """

    # @ApiMember(Description="Owner GLN", ExcludeInSchema=true, ParameterType="path")
    owner_gln: Optional[str] = None
    """
    Owner GLN
    """


    # @ApiMember(Description="Customer Master Identification", ExcludeInSchema=true, ParameterType="path")
    customer_master_identification: Optional[str] = None
    """
    Customer Master Identification
    """

Python GetCustomerMasterByIdentification 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 /api/customerMaster/{OwnerGln}/{CustomerMasterIdentification} HTTP/1.1 
Host: stf-api-uat.data-xchange.co.za 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	dataSource: 
	{
		contact: 
		[
			{
				contactTypeCode: String,
				personName: String,
				departmentName: String,
				jobTitle: String,
				responsibility: String,
				communicationChannel: 
				[
					{
						communicationChannelCode: String,
						communicationChannelName: String,
						communicationValue: String
					}
				]
			}
		],
		address: 
		{
			streetAddressOne: String,
			streetAddressTwo: String,
			streetAddressThree: String,
			city: String,
			postalCode: String,
			provinceCode: String,
			countryCode: String
		},
		communicationChannel: 
		[
			{
				code: String,
				value: String
			}
		],
		financialInstitutionInformation: 
		{
			financialInstitutionBranchName: String,
			financialInstitutionName: String,
			financialRoutingNumber: 
			{
				number: String,
				numberTypeCode: String
			},
			financialAccount: 
			{
				number: String,
				numberTypeCode: String,
				name: String
			},
			swiftCode: String,
			exportersCode: String
		},
		dutyFeeTaxRegistration: String,
		entityIdentification: String,
		gln: String,
		name: String,
		additionalPartyIdentification: 
		[
			{
				code: String,
				value: String
			}
		]
	},
	dataRecipient: 
	{
		contact: 
		[
			{
				contactTypeCode: String,
				personName: String,
				departmentName: String,
				jobTitle: String,
				responsibility: String,
				communicationChannel: 
				[
					{
						communicationChannelCode: String,
						communicationChannelName: String,
						communicationValue: String
					}
				]
			}
		],
		address: 
		{
			streetAddressOne: String,
			streetAddressTwo: String,
			streetAddressThree: String,
			city: String,
			postalCode: String,
			provinceCode: String,
			countryCode: String
		},
		communicationChannel: 
		[
			{
				code: String,
				value: String
			}
		],
		financialInstitutionInformation: 
		{
			financialInstitutionBranchName: String,
			financialInstitutionName: String,
			financialRoutingNumber: 
			{
				number: String,
				numberTypeCode: String
			},
			financialAccount: 
			{
				number: String,
				numberTypeCode: String,
				name: String
			},
			swiftCode: String,
			exportersCode: String
		},
		dutyFeeTaxRegistration: String,
		entityIdentification: String,
		gln: String,
		name: String,
		additionalPartyIdentification: 
		[
			{
				code: String,
				value: String
			}
		]
	},
	customerMasterIdentification: String,
	customer: 
	[
		{
			payByCustomer: 
			{
				gln: String,
				code: String,
				name: String,
				buyerAssignedVendorNo: String,
				supplierAssignedVendorNo: String,
				dutyFeeTaxRegistration: String,
				entityIdentification: String,
				contact: 
				[
					{
						contactTypeCode: String,
						personName: String,
						departmentName: String,
						jobTitle: String,
						responsibility: String,
						communicationChannel: 
						[
							{
								communicationChannelCode: String,
								communicationChannelName: String,
								communicationValue: String
							}
						]
					}
				],
				address: 
				{
					addressType: String,
					streetAddressOne: String,
					streetAddressTwo: String,
					streetAddressThree: String,
					city: String,
					postalCode: String,
					provinceCode: String,
					countryCode: String
				},
				avpList: 
				[
					{
						code: String,
						value: String
					}
				]
			},
			billToCustomer: 
			{
				gln: String,
				code: String,
				name: String,
				buyerAssignedVendorNo: String,
				supplierAssignedVendorNo: String,
				dutyFeeTaxRegistration: String,
				entityIdentification: String,
				contact: 
				[
					{
						contactTypeCode: String,
						personName: String,
						departmentName: String,
						jobTitle: String,
						responsibility: String,
						communicationChannel: 
						[
							{
								communicationChannelCode: String,
								communicationChannelName: String,
								communicationValue: String
							}
						]
					}
				],
				address: 
				{
					addressType: String,
					streetAddressOne: String,
					streetAddressTwo: String,
					streetAddressThree: String,
					city: String,
					postalCode: String,
					provinceCode: String,
					countryCode: String
				},
				avpList: 
				[
					{
						code: String,
						value: String
					}
				]
			},
			routingCode: String,
			storeType: String,
			currencyCode: String,
			type: String,
			group: String,
			region: String,
			zoneRate: String,
			taxRule: String,
			paymentTerm: String,
			shipmentSite: String,
			shipmentSiteName: String,
			shipmentSiteGln: String,
			accountingCode: String,
			commercialRepresentative: String,
			commercialTerritory: String,
			credit: 
			{
				limit: 0,
				balance: 0,
				available: 0,
				effectiveDateTime: 0001-01-01
			},
			nod: 
			[
				String
			],
			ndd: 
			[
				String
			],
			gln: String,
			code: String,
			name: String,
			buyerAssignedVendorNo: String,
			supplierAssignedVendorNo: String,
			dutyFeeTaxRegistration: String,
			entityIdentification: String,
			contact: 
			[
				{
					contactTypeCode: String,
					personName: String,
					departmentName: String,
					jobTitle: String,
					responsibility: String,
					communicationChannel: 
					[
						{
							communicationChannelCode: String,
							communicationChannelName: String,
							communicationValue: String
						}
					]
				}
			],
			address: 
			{
				addressType: String,
				streetAddressOne: String,
				streetAddressTwo: String,
				streetAddressThree: String,
				city: String,
				postalCode: String,
				provinceCode: String,
				countryCode: String
			},
			avpList: 
			[
				{
					code: String,
					value: String
				}
			]
		}
	],
	documentStatusCode: String,
	documentActionCode: String
}