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 java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*


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

open class SettlementMessage
{
    open var header:Header? = null
    open var settlement:Settlement? = null
}

@DataContract
open class Header
{
    @DataMember(Name="documentIdentification")
    @SerializedName("documentIdentification")
    open var documentIdentification:DocumentIdentification? = null

    @DataMember(Name="sender")
    @SerializedName("sender")
    open var sender:Partner? = null

    @DataMember(Name="receiver")
    @SerializedName("receiver")
    open var receiver:Partner? = null
}

@DataContract
open class DocumentIdentification
{
    @DataMember(Name="identifier")
    @SerializedName("identifier")
    open var identifier:String? = null

    @DataMember(Name="type")
    @SerializedName("type")
    open var Type:String? = null

    @DataMember(Name="creationDateAndTime")
    @SerializedName("creationDateAndTime")
    open var creationDateAndTime:Date? = null
}

@DataContract
open class Partner
{
    @DataMember(Name="identifier")
    @SerializedName("identifier")
    open var identifier:Identifier? = null

    @DataMember(Name="contactInformation")
    @SerializedName("contactInformation")
    open var contactInformation:ArrayList<ContactInformation> = ArrayList<ContactInformation>()
}

@DataContract
open class Identifier
{
    @DataMember(Name="authority")
    @SerializedName("authority")
    open var authority:String? = null

    @DataMember(Name="text")
    @SerializedName("text")
    open var text:String? = null
}

@DataContract
open class ContactInformation
{
}

open class Settlement : BaseDocument()
{
    open var batchIdentification:String? = null
    open var paymentEffectiveDate:Date? = null
    open var settlementCurrency:String? = null
    open var settlementHandlingTypeCode:String? = null
    open var totalAmount:BigDecimal? = null
    open var paymentMethod:PaymentMethod? = null
    open var payee:TransactionalParty? = null
    open var payer:TransactionalParty? = null
    open var remitTo:TransactionalParty? = null
    open var settlementIdentification:String? = null
    open var settlementLineItem:ArrayList<SettlementLineItem> = ArrayList<SettlementLineItem>()
    open var extension:SettlementExtension? = null
}

open class BaseDocument
{
    open var currencyCode:String? = null
    open var creationDateTime:Date? = null
    open var documentActionCode:DocumentAction? = null
    open var documentStatusCode:DocumentStatus? = null
    open var documentStructureVersion:String? = null
    open var lastUpdateDateTime:Date? = null
    open var revisionNumber:Long? = null
    open var avpList:ArrayList<AvpList> = ArrayList<AvpList>()
}

enum class DocumentAction
{
    Add,
    ChangeByRefresh,
    Delete,
    Rejected,
}

enum class DocumentStatus
{
    AdditionalTransmission,
    Copy,
    Original,
}

open class AvpList
{
    open var code:String? = null
    open var value:String? = null
}

open class PaymentMethod
{
    open var automatedClearingHousePaymentFormat:String? = null
    open var paymentMethodCode:String? = null
    open var paymentMethodIdentification:String? = null
}

open class TransactionalParty : Ecom_PartyIdentificationType()
{
    open var contact:ArrayList<Contact> = ArrayList<Contact>()
    open var address:Address? = null
    open var communicationChannel:ArrayList<AvpList> = ArrayList<AvpList>()
    open var financialInstitutionInformation:FinancialInstitutionInformation? = null
    open var dutyFeeTaxRegistration:String? = null
    open var entityIdentification:String? = null
}

open class Ecom_PartyIdentificationType
{
    open var gln:String? = null
    open var name:String? = null
    open var additionalPartyIdentification:ArrayList<AvpList> = ArrayList<AvpList>()
}

open class Contact
{
    open var contactTypeCode:String? = null
    open var personName:String? = null
    open var departmentName:String? = null
    open var jobTitle:String? = null
    open var responsibility:String? = null
    open var communicationChannel:ArrayList<CommunicationChannel> = ArrayList<CommunicationChannel>()
}

open class CommunicationChannel
{
    open var communicationChannelCode:String? = null
    open var communicationChannelName:String? = null
    open var communicationValue:String? = null
}

open class Address
{
    open var streetAddressOne:String? = null
    open var streetAddressTwo:String? = null
    open var streetAddressThree:String? = null
    open var city:String? = null
    open var postalCode:String? = null
    open var provinceCode:String? = null
    open var countryCode:String? = null
}

open class FinancialInstitutionInformation
{
    open var financialInstitutionBranchName:String? = null
    open var financialInstitutionName:String? = null
    open var financialRoutingNumber:FinancialRoutingNumber? = null
    open var financialAccount:FinancialAccount? = null
    open var swiftCode:String? = null
    open var exportersCode:String? = null
}

open class FinancialRoutingNumber
{
    open var number:String? = null
    open var numberTypeCode:String? = null
}

open class FinancialAccount
{
    open var number:String? = null
    open var numberTypeCode:String? = null
    open var name:String? = null
}

open class SettlementLineItem
{
    open var amountPaid:BigDecimal? = null
    open var lineItemNumber:Long? = null
    open var originalAmount:BigDecimal? = null
    open var settlementAdjustment:ArrayList<SettlementAdjustment> = ArrayList<SettlementAdjustment>()
    open var avpList:AvpList? = null
    open var debitCreditAdvice:DocumentReference? = null
    open var invoice:InvoiceDocumentReference? = null
    open var requestForPayment:DocumentReference? = null
    open var settlementParty:ArrayList<SettlementParty> = ArrayList<SettlementParty>()
}

open class SettlementAdjustment
{
    open var adjustmentAmount:BigDecimal? = null
    open var financialAdjusmentReasonPartyRoleCode:String? = null
    open var financialAdjustmentReasonCode:String? = null
    open var transactionalReference:TransactionalReference? = null
}

open class TransactionalReference : DocumentReference()
{
    open var transactionalReferenceTypeCode:String? = null
}

open class DocumentReference
{
    open var creationDateTime:Date? = null
    open var revisionNumber:Long? = null
    open var lineItemNumber:Long? = null
    open var entityIdentification:String? = null
}

open class InvoiceDocumentReference : DocumentReference()
{
    open var invoiceTypeCode:String? = null
    open var contentOwner:ContentOwner? = null
}

open class ContentOwner
{
    open var gln:String? = null
    open var additionalPartyIdentification:ArrayList<AvpList> = ArrayList<AvpList>()
}

open class SettlementParty : Ecom_PartyIdentification()
{
    open var partyRoleCode:String? = null
}

open class Ecom_PartyIdentification
{
    open var additionalPartyIdentification:ArrayList<AvpList> = ArrayList<AvpList>()
    open var gln:String? = null
}

open class SettlementExtension
{
    open var settlementExtensionLineItem:ArrayList<SettlementExtensionLineItem> = ArrayList<SettlementExtensionLineItem>()
    open var adjustmentAndDiscountSummary:ArrayList<AdjustmentAndDiscountSummary> = ArrayList<AdjustmentAndDiscountSummary>()
    open var totalAmountSplit:TotalAmountSplit? = null
}

open class SettlementExtensionLineItem
{
    open var number:Int? = null
    open var documentType:String? = null
    open var documentNumber:String? = null
    open var itemText:String? = null
}

open class AdjustmentAndDiscountSummary
{
    open var amountTotal:BigDecimal? = null
    open var amountNett:BigDecimal? = null
    open var amountVat:BigDecimal? = null
    open var reasonMessage:String? = null
}

open class TotalAmountSplit
{
    open var amountTotal:BigDecimal? = null
    open var amountNett:BigDecimal? = null
    open var amountVat:BigDecimal? = null
}

open class TokenDto : ICommandResponse
{
    open var token:UUID? = null
}

Kotlin AddSettlement 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.

POST /api/settlement HTTP/1.1 
Host: stf-api-uat.data-xchange.co.za 
Accept: text/jsv
Content-Type: text/jsv
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/jsv
Content-Length: length

{
	
}