DX STF Client API

<back to all web services

AddTransactionalParty

Transactional Party Requests

Transactional Party

Requires Authentication
The following routes are available for this service:
POST/api/transactionalPartyAdd new transactional party
import 'package:servicestack/servicestack.dart';

class TokenDto implements ICommandResponse, IConvertible
{
    String token = "";

    TokenDto({this.token});
    TokenDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        token = json['token'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'token': token
    };

    getTypeName() => "TokenDto";
    TypeContext? context = _ctx;
}

// @DataContract
class DocumentIdentification implements IConvertible
{
    // @DataMember(Name="identifier")
    String identifier = "";

    // @DataMember(Name="type")
    String type = "";

    // @DataMember(Name="creationDateAndTime")
    DateTime creationDateAndTime = DateTime(0);

    DocumentIdentification({this.identifier,this.type,this.creationDateAndTime});
    DocumentIdentification.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        identifier = json['identifier'];
        type = json['type'];
        creationDateAndTime = JsonConverters.fromJson(json['creationDateAndTime'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'identifier': identifier,
        'type': type,
        'creationDateAndTime': JsonConverters.toJson(creationDateAndTime,'DateTime',context!)
    };

    getTypeName() => "DocumentIdentification";
    TypeContext? context = _ctx;
}

// @DataContract
class Identifier implements IConvertible
{
    // @DataMember(Name="authority")
    String authority = "";

    // @DataMember(Name="text")
    String text = "";

    Identifier({this.authority,this.text});
    Identifier.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        authority = json['authority'];
        text = json['text'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'authority': authority,
        'text': text
    };

    getTypeName() => "Identifier";
    TypeContext? context = _ctx;
}

// @DataContract
class ContactInformation implements IConvertible
{
    ContactInformation();
    ContactInformation.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "ContactInformation";
    TypeContext? context = _ctx;
}

// @DataContract
class Partner implements IConvertible
{
    // @DataMember(Name="identifier")
    Identifier identifier;

    // @DataMember(Name="contactInformation")
    List<ContactInformation> contactInformation = [];

    Partner({this.identifier,this.contactInformation});
    Partner.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        identifier = JsonConverters.fromJson(json['identifier'],'Identifier',context!);
        contactInformation = JsonConverters.fromJson(json['contactInformation'],'List<ContactInformation>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'identifier': JsonConverters.toJson(identifier,'Identifier',context!),
        'contactInformation': JsonConverters.toJson(contactInformation,'List<ContactInformation>',context!)
    };

    getTypeName() => "Partner";
    TypeContext? context = _ctx;
}

// @DataContract
class Header implements IConvertible
{
    // @DataMember(Name="documentIdentification")
    DocumentIdentification documentIdentification;

    // @DataMember(Name="sender")
    Partner sender;

    // @DataMember(Name="receiver")
    Partner receiver;

    Header({this.documentIdentification,this.sender,this.receiver});
    Header.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        documentIdentification = JsonConverters.fromJson(json['documentIdentification'],'DocumentIdentification',context!);
        sender = JsonConverters.fromJson(json['sender'],'Partner',context!);
        receiver = JsonConverters.fromJson(json['receiver'],'Partner',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'documentIdentification': JsonConverters.toJson(documentIdentification,'DocumentIdentification',context!),
        'sender': JsonConverters.toJson(sender,'Partner',context!),
        'receiver': JsonConverters.toJson(receiver,'Partner',context!)
    };

    getTypeName() => "Header";
    TypeContext? context = _ctx;
}

class AvpList implements IConvertible
{
    String code = "";
    String value = "";

    AvpList({this.code,this.value});
    AvpList.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        code = json['code'];
        value = json['value'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'code': code,
        'value': value
    };

    getTypeName() => "AvpList";
    TypeContext? context = _ctx;
}

class Ecom_PartyIdentificationType implements IConvertible
{
    String gln = "";
    String name = "";
    List<AvpList> additionalPartyIdentification = [];

    Ecom_PartyIdentificationType({this.gln,this.name,this.additionalPartyIdentification});
    Ecom_PartyIdentificationType.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        gln = json['gln'];
        name = json['name'];
        additionalPartyIdentification = JsonConverters.fromJson(json['additionalPartyIdentification'],'List<AvpList>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'gln': gln,
        'name': name,
        'additionalPartyIdentification': JsonConverters.toJson(additionalPartyIdentification,'List<AvpList>',context!)
    };

    getTypeName() => "Ecom_PartyIdentificationType";
    TypeContext? context = _ctx;
}

class CommunicationChannel implements IConvertible
{
    String communicationChannelCode = "";
    String communicationChannelName = "";
    String communicationValue = "";

    CommunicationChannel({this.communicationChannelCode,this.communicationChannelName,this.communicationValue});
    CommunicationChannel.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        communicationChannelCode = json['communicationChannelCode'];
        communicationChannelName = json['communicationChannelName'];
        communicationValue = json['communicationValue'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'communicationChannelCode': communicationChannelCode,
        'communicationChannelName': communicationChannelName,
        'communicationValue': communicationValue
    };

    getTypeName() => "CommunicationChannel";
    TypeContext? context = _ctx;
}

class Contact implements IConvertible
{
    String contactTypeCode = "";
    String personName = "";
    String departmentName = "";
    String jobTitle = "";
    String responsibility = "";
    List<CommunicationChannel> communicationChannel = [];

    Contact({this.contactTypeCode,this.personName,this.departmentName,this.jobTitle,this.responsibility,this.communicationChannel});
    Contact.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        contactTypeCode = json['contactTypeCode'];
        personName = json['personName'];
        departmentName = json['departmentName'];
        jobTitle = json['jobTitle'];
        responsibility = json['responsibility'];
        communicationChannel = JsonConverters.fromJson(json['communicationChannel'],'List<CommunicationChannel>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'contactTypeCode': contactTypeCode,
        'personName': personName,
        'departmentName': departmentName,
        'jobTitle': jobTitle,
        'responsibility': responsibility,
        'communicationChannel': JsonConverters.toJson(communicationChannel,'List<CommunicationChannel>',context!)
    };

    getTypeName() => "Contact";
    TypeContext? context = _ctx;
}

class Address implements IConvertible
{
    String streetAddressOne = "";
    String streetAddressTwo = "";
    String streetAddressThree = "";
    String city = "";
    String postalCode = "";
    String provinceCode = "";
    String countryCode = "";

    Address({this.streetAddressOne,this.streetAddressTwo,this.streetAddressThree,this.city,this.postalCode,this.provinceCode,this.countryCode});
    Address.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        streetAddressOne = json['streetAddressOne'];
        streetAddressTwo = json['streetAddressTwo'];
        streetAddressThree = json['streetAddressThree'];
        city = json['city'];
        postalCode = json['postalCode'];
        provinceCode = json['provinceCode'];
        countryCode = json['countryCode'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'streetAddressOne': streetAddressOne,
        'streetAddressTwo': streetAddressTwo,
        'streetAddressThree': streetAddressThree,
        'city': city,
        'postalCode': postalCode,
        'provinceCode': provinceCode,
        'countryCode': countryCode
    };

    getTypeName() => "Address";
    TypeContext? context = _ctx;
}

class FinancialRoutingNumber implements IConvertible
{
    String number = "";
    String numberTypeCode = "";

    FinancialRoutingNumber({this.number,this.numberTypeCode});
    FinancialRoutingNumber.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        number = json['number'];
        numberTypeCode = json['numberTypeCode'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'number': number,
        'numberTypeCode': numberTypeCode
    };

    getTypeName() => "FinancialRoutingNumber";
    TypeContext? context = _ctx;
}

class FinancialAccount implements IConvertible
{
    String number = "";
    String numberTypeCode = "";
    String name = "";

    FinancialAccount({this.number,this.numberTypeCode,this.name});
    FinancialAccount.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        number = json['number'];
        numberTypeCode = json['numberTypeCode'];
        name = json['name'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'number': number,
        'numberTypeCode': numberTypeCode,
        'name': name
    };

    getTypeName() => "FinancialAccount";
    TypeContext? context = _ctx;
}

class FinancialInstitutionInformation implements IConvertible
{
    String financialInstitutionBranchName = "";
    String financialInstitutionName = "";
    FinancialRoutingNumber financialRoutingNumber;
    FinancialAccount financialAccount;
    String swiftCode = "";
    String exportersCode = "";

    FinancialInstitutionInformation({this.financialInstitutionBranchName,this.financialInstitutionName,this.financialRoutingNumber,this.financialAccount,this.swiftCode,this.exportersCode});
    FinancialInstitutionInformation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        financialInstitutionBranchName = json['financialInstitutionBranchName'];
        financialInstitutionName = json['financialInstitutionName'];
        financialRoutingNumber = JsonConverters.fromJson(json['financialRoutingNumber'],'FinancialRoutingNumber',context!);
        financialAccount = JsonConverters.fromJson(json['financialAccount'],'FinancialAccount',context!);
        swiftCode = json['swiftCode'];
        exportersCode = json['exportersCode'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'financialInstitutionBranchName': financialInstitutionBranchName,
        'financialInstitutionName': financialInstitutionName,
        'financialRoutingNumber': JsonConverters.toJson(financialRoutingNumber,'FinancialRoutingNumber',context!),
        'financialAccount': JsonConverters.toJson(financialAccount,'FinancialAccount',context!),
        'swiftCode': swiftCode,
        'exportersCode': exportersCode
    };

    getTypeName() => "FinancialInstitutionInformation";
    TypeContext? context = _ctx;
}

class TransactionalParty extends Ecom_PartyIdentificationType implements IConvertible
{
    List<Contact> contact = [];
    Address address;
    List<AvpList> communicationChannel = [];
    FinancialInstitutionInformation financialInstitutionInformation;
    String dutyFeeTaxRegistration = "";
    String entityIdentification = "";

    TransactionalParty({this.contact,this.address,this.communicationChannel,this.financialInstitutionInformation,this.dutyFeeTaxRegistration,this.entityIdentification});
    TransactionalParty.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        contact = JsonConverters.fromJson(json['contact'],'List<Contact>',context!);
        address = JsonConverters.fromJson(json['address'],'Address',context!);
        communicationChannel = JsonConverters.fromJson(json['communicationChannel'],'List<AvpList>',context!);
        financialInstitutionInformation = JsonConverters.fromJson(json['financialInstitutionInformation'],'FinancialInstitutionInformation',context!);
        dutyFeeTaxRegistration = json['dutyFeeTaxRegistration'];
        entityIdentification = json['entityIdentification'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'contact': JsonConverters.toJson(contact,'List<Contact>',context!),
        'address': JsonConverters.toJson(address,'Address',context!),
        'communicationChannel': JsonConverters.toJson(communicationChannel,'List<AvpList>',context!),
        'financialInstitutionInformation': JsonConverters.toJson(financialInstitutionInformation,'FinancialInstitutionInformation',context!),
        'dutyFeeTaxRegistration': dutyFeeTaxRegistration,
        'entityIdentification': entityIdentification
    });

    getTypeName() => "TransactionalParty";
    TypeContext? context = _ctx;
}

enum DocumentAction
{
    ADD,
    CHANGE_BY_REFRESH,
    DELETE,
    REJECTED,
}

enum DocumentStatus
{
    ADDITIONAL_TRANSMISSION,
    COPY,
    ORIGINAL,
}

class TransactionalPartyMessageType extends TransactionalParty implements IConvertible
{
    DateTime creationDateTime = DateTime(0);
    DateTime? lastUpdateDateTime;
    DocumentAction documentActionCode;
    DocumentStatus documentStatusCode;
    String documentStructureVersion = "";
    int? revisionNumber;
    List<AvpList> avpList = [];

    TransactionalPartyMessageType({this.creationDateTime,this.lastUpdateDateTime,this.documentActionCode,this.documentStatusCode,this.documentStructureVersion,this.revisionNumber,this.avpList});
    TransactionalPartyMessageType.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        creationDateTime = JsonConverters.fromJson(json['creationDateTime'],'DateTime',context!);
        lastUpdateDateTime = JsonConverters.fromJson(json['lastUpdateDateTime'],'DateTime',context!);
        documentActionCode = JsonConverters.fromJson(json['documentActionCode'],'DocumentAction',context!);
        documentStatusCode = JsonConverters.fromJson(json['documentStatusCode'],'DocumentStatus',context!);
        documentStructureVersion = json['documentStructureVersion'];
        revisionNumber = json['revisionNumber'];
        avpList = JsonConverters.fromJson(json['avpList'],'List<AvpList>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'creationDateTime': JsonConverters.toJson(creationDateTime,'DateTime',context!),
        'lastUpdateDateTime': JsonConverters.toJson(lastUpdateDateTime,'DateTime',context!),
        'documentActionCode': JsonConverters.toJson(documentActionCode,'DocumentAction',context!),
        'documentStatusCode': JsonConverters.toJson(documentStatusCode,'DocumentStatus',context!),
        'documentStructureVersion': documentStructureVersion,
        'revisionNumber': revisionNumber,
        'avpList': JsonConverters.toJson(avpList,'List<AvpList>',context!)
    });

    getTypeName() => "TransactionalPartyMessageType";
    TypeContext? context = _ctx;
}

class TransactionalPartyMessage implements IConvertible
{
    Header header;
    TransactionalPartyMessageType transactionalParty;

    TransactionalPartyMessage({this.header,this.transactionalParty});
    TransactionalPartyMessage.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        header = JsonConverters.fromJson(json['header'],'Header',context!);
        transactionalParty = JsonConverters.fromJson(json['transactionalParty'],'TransactionalPartyMessageType',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'header': JsonConverters.toJson(header,'Header',context!),
        'transactionalParty': JsonConverters.toJson(transactionalParty,'TransactionalPartyMessageType',context!)
    };

    getTypeName() => "TransactionalPartyMessage";
    TypeContext? context = _ctx;
}

/**
* Transactional Party
*/
// @Api(Description="Transactional Party")
// @ApiResponse(Description="Add Transactional Party request received", IsDefaultResponse=true, StatusCode=202)
// @ApiResponse(Description="Transactional Party not accepted, Confirm Sender GLN", ResponseType=typeof(UnauthorizedAccessException), StatusCode=403)
class AddTransactionalParty implements IConvertible
{
    /**
    * Transactional Party model containing all of the transactional party data
    */
    // @ApiMember(Description="Transactional Party model containing all of the transactional party data", ParameterType="model")
    TransactionalPartyMessage transactionalParty;

    AddTransactionalParty({this.transactionalParty});
    AddTransactionalParty.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        transactionalParty = JsonConverters.fromJson(json['transactionalParty'],'TransactionalPartyMessage',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'transactionalParty': JsonConverters.toJson(transactionalParty,'TransactionalPartyMessage',context!)
    };

    getTypeName() => "AddTransactionalParty";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'stf_api_uat.data_xchange.co.za', types: <String, TypeInfo> {
    'TokenDto': TypeInfo(TypeOf.Class, create:() => TokenDto()),
    'DocumentIdentification': TypeInfo(TypeOf.Class, create:() => DocumentIdentification()),
    'Identifier': TypeInfo(TypeOf.Class, create:() => Identifier()),
    'ContactInformation': TypeInfo(TypeOf.Class, create:() => ContactInformation()),
    'Partner': TypeInfo(TypeOf.Class, create:() => Partner()),
    'List<ContactInformation>': TypeInfo(TypeOf.Class, create:() => <ContactInformation>[]),
    'Header': TypeInfo(TypeOf.Class, create:() => Header()),
    'AvpList': TypeInfo(TypeOf.Class, create:() => AvpList()),
    'Ecom_PartyIdentificationType': TypeInfo(TypeOf.Class, create:() => Ecom_PartyIdentificationType()),
    'List<AvpList>': TypeInfo(TypeOf.Class, create:() => <AvpList>[]),
    'CommunicationChannel': TypeInfo(TypeOf.Class, create:() => CommunicationChannel()),
    'Contact': TypeInfo(TypeOf.Class, create:() => Contact()),
    'List<CommunicationChannel>': TypeInfo(TypeOf.Class, create:() => <CommunicationChannel>[]),
    'Address': TypeInfo(TypeOf.Class, create:() => Address()),
    'FinancialRoutingNumber': TypeInfo(TypeOf.Class, create:() => FinancialRoutingNumber()),
    'FinancialAccount': TypeInfo(TypeOf.Class, create:() => FinancialAccount()),
    'FinancialInstitutionInformation': TypeInfo(TypeOf.Class, create:() => FinancialInstitutionInformation()),
    'TransactionalParty': TypeInfo(TypeOf.Class, create:() => TransactionalParty()),
    'List<Contact>': TypeInfo(TypeOf.Class, create:() => <Contact>[]),
    'DocumentAction': TypeInfo(TypeOf.Enum, enumValues:DocumentAction.values),
    'DocumentStatus': TypeInfo(TypeOf.Enum, enumValues:DocumentStatus.values),
    'TransactionalPartyMessageType': TypeInfo(TypeOf.Class, create:() => TransactionalPartyMessageType()),
    'TransactionalPartyMessage': TypeInfo(TypeOf.Class, create:() => TransactionalPartyMessage()),
    'AddTransactionalParty': TypeInfo(TypeOf.Class, create:() => AddTransactionalParty()),
});

Dart AddTransactionalParty DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /api/transactionalParty HTTP/1.1 
Host: stf-api-uat.data-xchange.co.za 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"transactionalParty":{"header":{"documentIdentification":{"identifier":"String","type":"String"},"sender":{"identifier":{"authority":"String","text":"String"},"contactInformation":[{}]},"receiver":{"identifier":{"authority":"String","text":"String"},"contactInformation":[{}]}},"transactionalParty":{"lastUpdateDateTime":"0001-01-01","documentActionCode":"ADD","documentStatusCode":"ADDITIONAL_TRANSMISSION","documentStructureVersion":"String","revisionNumber":0,"avpList":[{"code":"String","value":"String"}],"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"}]}}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{}