DX STF Client API

<back to all web services

AddSettlement

Settlement Requests

Settlement

Requires Authentication
The following routes are available for this service:
POST/api/settlementAdd new Settlement
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;
}

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

enum DocumentStatus
{
    ADDITIONAL_TRANSMISSION,
    COPY,
    ORIGINAL,
}

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 BaseDocument implements IConvertible
{
    String currencyCode = "";
    DateTime creationDateTime = DateTime(0);
    DocumentAction documentActionCode;
    DocumentStatus documentStatusCode;
    String documentStructureVersion = "";
    DateTime? lastUpdateDateTime;
    int? revisionNumber;
    List<AvpList> avpList = [];

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

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

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

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

class PaymentMethod implements IConvertible
{
    String automatedClearingHousePaymentFormat = "";
    String paymentMethodCode = "";
    String paymentMethodIdentification = "";

    PaymentMethod({this.automatedClearingHousePaymentFormat,this.paymentMethodCode,this.paymentMethodIdentification});
    PaymentMethod.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'automatedClearingHousePaymentFormat': automatedClearingHousePaymentFormat,
        'paymentMethodCode': paymentMethodCode,
        'paymentMethodIdentification': paymentMethodIdentification
    };

    getTypeName() => "PaymentMethod";
    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;
}

class DocumentReference implements IConvertible
{
    DateTime? creationDateTime;
    int? revisionNumber;
    int? lineItemNumber;
    String entityIdentification = "";

    DocumentReference({this.creationDateTime,this.revisionNumber,this.lineItemNumber,this.entityIdentification});
    DocumentReference.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        creationDateTime = JsonConverters.fromJson(json['creationDateTime'],'DateTime',context!);
        revisionNumber = json['revisionNumber'];
        lineItemNumber = json['lineItemNumber'];
        entityIdentification = json['entityIdentification'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'creationDateTime': JsonConverters.toJson(creationDateTime,'DateTime',context!),
        'revisionNumber': revisionNumber,
        'lineItemNumber': lineItemNumber,
        'entityIdentification': entityIdentification
    };

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

class TransactionalReference extends DocumentReference implements IConvertible
{
    String transactionalReferenceTypeCode = "";

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

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

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'transactionalReferenceTypeCode': transactionalReferenceTypeCode
    });

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

class SettlementAdjustment implements IConvertible
{
    double? adjustmentAmount;
    String financialAdjusmentReasonPartyRoleCode = "";
    String financialAdjustmentReasonCode = "";
    TransactionalReference transactionalReference;

    SettlementAdjustment({this.adjustmentAmount,this.financialAdjusmentReasonPartyRoleCode,this.financialAdjustmentReasonCode,this.transactionalReference});
    SettlementAdjustment.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        adjustmentAmount = JsonConverters.toDouble(json['adjustmentAmount']);
        financialAdjusmentReasonPartyRoleCode = json['financialAdjusmentReasonPartyRoleCode'];
        financialAdjustmentReasonCode = json['financialAdjustmentReasonCode'];
        transactionalReference = JsonConverters.fromJson(json['transactionalReference'],'TransactionalReference',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'adjustmentAmount': adjustmentAmount,
        'financialAdjusmentReasonPartyRoleCode': financialAdjusmentReasonPartyRoleCode,
        'financialAdjustmentReasonCode': financialAdjustmentReasonCode,
        'transactionalReference': JsonConverters.toJson(transactionalReference,'TransactionalReference',context!)
    };

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

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

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

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

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

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

class InvoiceDocumentReference extends DocumentReference implements IConvertible
{
    String invoiceTypeCode = "";
    ContentOwner contentOwner;

    InvoiceDocumentReference({this.invoiceTypeCode,this.contentOwner});
    InvoiceDocumentReference.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'invoiceTypeCode': invoiceTypeCode,
        'contentOwner': JsonConverters.toJson(contentOwner,'ContentOwner',context!)
    });

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

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

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

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

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

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

class SettlementParty extends Ecom_PartyIdentification implements IConvertible
{
    String partyRoleCode = "";

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

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

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'partyRoleCode': partyRoleCode
    });

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

class SettlementLineItem implements IConvertible
{
    double? amountPaid;
    int lineItemNumber = 0;
    double? originalAmount;
    List<SettlementAdjustment> settlementAdjustment = [];
    AvpList avpList;
    DocumentReference debitCreditAdvice;
    InvoiceDocumentReference invoice;
    DocumentReference requestForPayment;
    List<SettlementParty> settlementParty = [];

    SettlementLineItem({this.amountPaid,this.lineItemNumber,this.originalAmount,this.settlementAdjustment,this.avpList,this.debitCreditAdvice,this.invoice,this.requestForPayment,this.settlementParty});
    SettlementLineItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        amountPaid = JsonConverters.toDouble(json['amountPaid']);
        lineItemNumber = json['lineItemNumber'];
        originalAmount = JsonConverters.toDouble(json['originalAmount']);
        settlementAdjustment = JsonConverters.fromJson(json['settlementAdjustment'],'List<SettlementAdjustment>',context!);
        avpList = JsonConverters.fromJson(json['avpList'],'AvpList',context!);
        debitCreditAdvice = JsonConverters.fromJson(json['debitCreditAdvice'],'DocumentReference',context!);
        invoice = JsonConverters.fromJson(json['invoice'],'InvoiceDocumentReference',context!);
        requestForPayment = JsonConverters.fromJson(json['requestForPayment'],'DocumentReference',context!);
        settlementParty = JsonConverters.fromJson(json['settlementParty'],'List<SettlementParty>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'amountPaid': amountPaid,
        'lineItemNumber': lineItemNumber,
        'originalAmount': originalAmount,
        'settlementAdjustment': JsonConverters.toJson(settlementAdjustment,'List<SettlementAdjustment>',context!),
        'avpList': JsonConverters.toJson(avpList,'AvpList',context!),
        'debitCreditAdvice': JsonConverters.toJson(debitCreditAdvice,'DocumentReference',context!),
        'invoice': JsonConverters.toJson(invoice,'InvoiceDocumentReference',context!),
        'requestForPayment': JsonConverters.toJson(requestForPayment,'DocumentReference',context!),
        'settlementParty': JsonConverters.toJson(settlementParty,'List<SettlementParty>',context!)
    };

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

class SettlementExtensionLineItem implements IConvertible
{
    int number = 0;
    String documentType = "";
    String documentNumber = "";
    String itemText = "";

    SettlementExtensionLineItem({this.number,this.documentType,this.documentNumber,this.itemText});
    SettlementExtensionLineItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class AdjustmentAndDiscountSummary implements IConvertible
{
    double amountTotal = 0;
    double amountNett = 0;
    double amountVat = 0;
    String reasonMessage = "";

    AdjustmentAndDiscountSummary({this.amountTotal,this.amountNett,this.amountVat,this.reasonMessage});
    AdjustmentAndDiscountSummary.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        amountTotal = JsonConverters.toDouble(json['amountTotal']);
        amountNett = JsonConverters.toDouble(json['amountNett']);
        amountVat = JsonConverters.toDouble(json['amountVat']);
        reasonMessage = json['reasonMessage'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'amountTotal': amountTotal,
        'amountNett': amountNett,
        'amountVat': amountVat,
        'reasonMessage': reasonMessage
    };

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

class TotalAmountSplit implements IConvertible
{
    double amountTotal = 0;
    double amountNett = 0;
    double amountVat = 0;

    TotalAmountSplit({this.amountTotal,this.amountNett,this.amountVat});
    TotalAmountSplit.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        amountTotal = JsonConverters.toDouble(json['amountTotal']);
        amountNett = JsonConverters.toDouble(json['amountNett']);
        amountVat = JsonConverters.toDouble(json['amountVat']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'amountTotal': amountTotal,
        'amountNett': amountNett,
        'amountVat': amountVat
    };

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

class SettlementExtension implements IConvertible
{
    List<SettlementExtensionLineItem> settlementExtensionLineItem = [];
    List<AdjustmentAndDiscountSummary> adjustmentAndDiscountSummary = [];
    TotalAmountSplit totalAmountSplit;

    SettlementExtension({this.settlementExtensionLineItem,this.adjustmentAndDiscountSummary,this.totalAmountSplit});
    SettlementExtension.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        settlementExtensionLineItem = JsonConverters.fromJson(json['settlementExtensionLineItem'],'List<SettlementExtensionLineItem>',context!);
        adjustmentAndDiscountSummary = JsonConverters.fromJson(json['adjustmentAndDiscountSummary'],'List<AdjustmentAndDiscountSummary>',context!);
        totalAmountSplit = JsonConverters.fromJson(json['totalAmountSplit'],'TotalAmountSplit',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'settlementExtensionLineItem': JsonConverters.toJson(settlementExtensionLineItem,'List<SettlementExtensionLineItem>',context!),
        'adjustmentAndDiscountSummary': JsonConverters.toJson(adjustmentAndDiscountSummary,'List<AdjustmentAndDiscountSummary>',context!),
        'totalAmountSplit': JsonConverters.toJson(totalAmountSplit,'TotalAmountSplit',context!)
    };

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

class Settlement extends BaseDocument implements IConvertible
{
    String batchIdentification = "";
    DateTime paymentEffectiveDate = DateTime(0);
    String settlementCurrency = "";
    String settlementHandlingTypeCode = "";
    double? totalAmount;
    PaymentMethod paymentMethod;
    TransactionalParty payee;
    TransactionalParty payer;
    TransactionalParty remitTo;
    String settlementIdentification = "";
    List<SettlementLineItem> settlementLineItem = [];
    SettlementExtension Extension;

    Settlement({this.batchIdentification,this.paymentEffectiveDate,this.settlementCurrency,this.settlementHandlingTypeCode,this.totalAmount,this.paymentMethod,this.payee,this.payer,this.remitTo,this.settlementIdentification,this.settlementLineItem,this.Extension});
    Settlement.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        batchIdentification = json['batchIdentification'];
        paymentEffectiveDate = JsonConverters.fromJson(json['paymentEffectiveDate'],'DateTime',context!);
        settlementCurrency = json['settlementCurrency'];
        settlementHandlingTypeCode = json['settlementHandlingTypeCode'];
        totalAmount = JsonConverters.toDouble(json['totalAmount']);
        paymentMethod = JsonConverters.fromJson(json['paymentMethod'],'PaymentMethod',context!);
        payee = JsonConverters.fromJson(json['payee'],'TransactionalParty',context!);
        payer = JsonConverters.fromJson(json['payer'],'TransactionalParty',context!);
        remitTo = JsonConverters.fromJson(json['remitTo'],'TransactionalParty',context!);
        settlementIdentification = json['settlementIdentification'];
        settlementLineItem = JsonConverters.fromJson(json['settlementLineItem'],'List<SettlementLineItem>',context!);
        Extension = JsonConverters.fromJson(json['extension'],'SettlementExtension',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'batchIdentification': batchIdentification,
        'paymentEffectiveDate': JsonConverters.toJson(paymentEffectiveDate,'DateTime',context!),
        'settlementCurrency': settlementCurrency,
        'settlementHandlingTypeCode': settlementHandlingTypeCode,
        'totalAmount': totalAmount,
        'paymentMethod': JsonConverters.toJson(paymentMethod,'PaymentMethod',context!),
        'payee': JsonConverters.toJson(payee,'TransactionalParty',context!),
        'payer': JsonConverters.toJson(payer,'TransactionalParty',context!),
        'remitTo': JsonConverters.toJson(remitTo,'TransactionalParty',context!),
        'settlementIdentification': settlementIdentification,
        'settlementLineItem': JsonConverters.toJson(settlementLineItem,'List<SettlementLineItem>',context!),
        'extension': JsonConverters.toJson(Extension,'SettlementExtension',context!)
    });

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

class SettlementMessage implements IConvertible
{
    Header header;
    Settlement settlement;

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

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

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

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

/**
* Settlement
*/
// @Api(Description="Settlement")
// @ApiResponse(Description="Add Settlement request received", IsDefaultResponse=true, StatusCode=200)
// @ApiResponse(Description="Settlement not accepted, Confirm Sender GLN", ResponseType=typeof(UnauthorizedAccessException), StatusCode=403)
class AddSettlement implements IPost, IConvertible
{
    /**
    * Settlement model containing all of the Settlement data
    */
    // @ApiMember(Description="Settlement model containing all of the Settlement data", ParameterType="model")
    SettlementMessage settlement;

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

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

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

    getTypeName() => "AddSettlement";
    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()),
    'DocumentAction': TypeInfo(TypeOf.Enum, enumValues:DocumentAction.values),
    'DocumentStatus': TypeInfo(TypeOf.Enum, enumValues:DocumentStatus.values),
    'AvpList': TypeInfo(TypeOf.Class, create:() => AvpList()),
    'BaseDocument': TypeInfo(TypeOf.Class, create:() => BaseDocument()),
    'List<AvpList>': TypeInfo(TypeOf.Class, create:() => <AvpList>[]),
    'PaymentMethod': TypeInfo(TypeOf.Class, create:() => PaymentMethod()),
    'Ecom_PartyIdentificationType': TypeInfo(TypeOf.Class, create:() => Ecom_PartyIdentificationType()),
    '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>[]),
    'DocumentReference': TypeInfo(TypeOf.Class, create:() => DocumentReference()),
    'TransactionalReference': TypeInfo(TypeOf.Class, create:() => TransactionalReference()),
    'SettlementAdjustment': TypeInfo(TypeOf.Class, create:() => SettlementAdjustment()),
    'ContentOwner': TypeInfo(TypeOf.Class, create:() => ContentOwner()),
    'InvoiceDocumentReference': TypeInfo(TypeOf.Class, create:() => InvoiceDocumentReference()),
    'Ecom_PartyIdentification': TypeInfo(TypeOf.Class, create:() => Ecom_PartyIdentification()),
    'SettlementParty': TypeInfo(TypeOf.Class, create:() => SettlementParty()),
    'SettlementLineItem': TypeInfo(TypeOf.Class, create:() => SettlementLineItem()),
    'List<SettlementAdjustment>': TypeInfo(TypeOf.Class, create:() => <SettlementAdjustment>[]),
    'List<SettlementParty>': TypeInfo(TypeOf.Class, create:() => <SettlementParty>[]),
    'SettlementExtensionLineItem': TypeInfo(TypeOf.Class, create:() => SettlementExtensionLineItem()),
    'AdjustmentAndDiscountSummary': TypeInfo(TypeOf.Class, create:() => AdjustmentAndDiscountSummary()),
    'TotalAmountSplit': TypeInfo(TypeOf.Class, create:() => TotalAmountSplit()),
    'SettlementExtension': TypeInfo(TypeOf.Class, create:() => SettlementExtension()),
    'List<SettlementExtensionLineItem>': TypeInfo(TypeOf.Class, create:() => <SettlementExtensionLineItem>[]),
    'List<AdjustmentAndDiscountSummary>': TypeInfo(TypeOf.Class, create:() => <AdjustmentAndDiscountSummary>[]),
    'Settlement': TypeInfo(TypeOf.Class, create:() => Settlement()),
    'List<SettlementLineItem>': TypeInfo(TypeOf.Class, create:() => <SettlementLineItem>[]),
    'SettlementMessage': TypeInfo(TypeOf.Class, create:() => SettlementMessage()),
    'AddSettlement': TypeInfo(TypeOf.Class, create:() => AddSettlement()),
});

Dart AddSettlement DTOs

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

HTTP + OTHER

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

POST /api/settlement HTTP/1.1 
Host: stf-api-uat.data-xchange.co.za 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"settlement":{"header":{"documentIdentification":{"identifier":"String","type":"String"},"sender":{"identifier":{"authority":"String","text":"String"},"contactInformation":[{}]},"receiver":{"identifier":{"authority":"String","text":"String"},"contactInformation":[{}]}},"settlement":{"batchIdentification":"String","settlementCurrency":"String","settlementHandlingTypeCode":"String","totalAmount":0,"paymentMethod":{"automatedClearingHousePaymentFormat":"String","paymentMethodCode":"String","paymentMethodIdentification":"String"},"payee":{"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"}]},"payer":{"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"}]},"remitTo":{"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"}]},"settlementIdentification":"String","settlementLineItem":[{"amountPaid":0,"lineItemNumber":0,"originalAmount":0,"settlementAdjustment":[{"adjustmentAmount":0,"financialAdjusmentReasonPartyRoleCode":"String","financialAdjustmentReasonCode":"String","transactionalReference":{"transactionalReferenceTypeCode":"String","creationDateTime":"0001-01-01","revisionNumber":0,"lineItemNumber":0,"entityIdentification":"String"}}],"avpList":{"code":"String","value":"String"},"debitCreditAdvice":{"creationDateTime":"0001-01-01","revisionNumber":0,"lineItemNumber":0,"entityIdentification":"String"},"invoice":{"invoiceTypeCode":"String","contentOwner":{"gln":"String","additionalPartyIdentification":[{"code":"String","value":"String"}]},"creationDateTime":"0001-01-01","revisionNumber":0,"lineItemNumber":0,"entityIdentification":"String"},"requestForPayment":{"creationDateTime":"0001-01-01","revisionNumber":0,"lineItemNumber":0,"entityIdentification":"String"},"settlementParty":[{"partyRoleCode":"String","additionalPartyIdentification":[{"code":"String","value":"String"}],"gln":"String"}]}],"extension":{"settlementExtensionLineItem":[{"number":0,"documentType":"String","documentNumber":"String","itemText":"String"}],"adjustmentAndDiscountSummary":[{"amountTotal":0,"amountNett":0,"amountVat":0,"reasonMessage":"String"}],"totalAmountSplit":{"amountTotal":0,"amountNett":0,"amountVat":0}},"currencyCode":"String","documentActionCode":"ADD","documentStatusCode":"ADDITIONAL_TRANSMISSION","documentStructureVersion":"String","lastUpdateDateTime":"0001-01-01","revisionNumber":0,"avpList":[{"code":"String","value":"String"}]}}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{}