Caplin FXIntegrationAPI Documentation - Version 3.68.0

Message Builder Example - AllocationConfirmation

package com.caplin.examples.fxapi.generated.motif.fx.tradeconfirmation.TradeConfTypesDef; 

import java.math.BigInteger;

import com.caplin.generated.motif.fx.settlementinstructions.SettlementInstructionsPartsDef;
import com.caplin.generated.motif.fx.tradeconfirmation.TradeConfPartsDef;
import com.caplin.generated.motif.fx.tradeconfirmation.TradeConfTypesDef;

public class AllocationConfirmationExample {
    public static void main(String[] args) {
                    		
		TradeConfTypesDef.AllocationConfirmation allocationConfirmation =
		TradeConfTypesDef.AllocationConfirmation
			.newBuilder()
			.addNettedLegTradeConfirmationFields(
			TradeConfTypesDef.NettedLegTradeConfirmationFields
				.newBuilder()
				.addInputLegSwapPartnerTradeConfirmation(
				TradeConfPartsDef.SwapPartnerLegTradeConfirmationFields
					.newBuilder()
					.setSwapPartnerInputLegID("")
					.setSwapPartnerNettedLegID("")
					.build())
				.addInputLegTradeConfirmation(
				TradeConfPartsDef.LegTradeConfirmationFields
					.newBuilder()
					.addRemarks(
					TradeConfPartsDef.RemarksEntry
						.newBuilder()
						.setRemarkDateTime(Instant.now())
						.setRemarkSource("")
						.build())
					.setAccount("Garfields|GARF")
					.setAllInMidRate(BigDecimal.valueOf(1.091790))
					.setAllInRate("1.091790")
					.setAllInRateDPS(5)
					.setAmount(BigDecimal.valueOf(0))
					.setAmountEditable()
					.setAmountRisk()
					.setBuySell("")
					.setContraAmount("350")
					.setContraCostAmount("")
					.setContraCostCurrency(BigDecimal.valueOf(0.0))
					.setContraCostPercentage(BigDecimal.valueOf(1.5))
					.setCostAmount(BigDecimal.valueOf(12412891.31))
					.setCostCurrency("GBP")
					.setCostPercentage("13.56")
					.setEntityId("CUSTONE")
					.setFilledAmount(BigDecimal.valueOf(0))
					.setForwardPointsDecimalOffset(0)
					.setFwdMidPoints("0.005390")
					.setFwdPips("11.98")
					.setFwdPoints(BigDecimal.valueOf(0.001198))
					.setIsTimeOption("true")
					.setNostroAccountFields(
					SettlementInstructionsPartsDef.NostroAccount
						.newBuilder()
						.setNostroAccount("AE770090004000824676500")
						.setNostroBIC("ARABAEADABC")
						.setNostroName("GBP Nostro Account.")
						.build())
					.setProfit("1000")
					.setRemainingAmount(BigDecimal.valueOf(500))
					.setRiskDate("20160314")
					.setRiskTenor("1W")
					.setSettlementDate("")
					.setSettlementDateEditable()
					.setSettlementDateRisk()
					.setSettlementTradeFields(
					SettlementInstructionsPartsDef.SettlementTradeFields
						.newBuilder()
						.addPay(
						SettlementInstructionsPartsDef.SettlementFields
							.newBuilder()
							.setBankAccount("12345678")
							.setBankAddress1("12 Capitol")
							.setBankAddress2("The City")
							.setBankAddress3("London")
							.setBankName("Bank Of Caplin")
							.setBankSwift("CAP123")
							.setIndividualAccount("87654321")
							.setIndividualAddress1("98 Lane")
							.setIndividualAddress2("Manchester")
							.setIndividualName("Susan Sellers")
							.setIndividualSwift("SOLD987")
							.setIsDefaultSettlementInstruction(true)
							.setNettingStatus("NETTED")
							.setSettlementAmount("")
							.setSettlementCurrency("GBP")
							.setSettlementDetailsLine1("")
							.setSettlementDetailsLine2("")
							.setSettlementDetailsLine3("")
							.setSettlementDetailsLine4("")
							.setSettlementDirection("")
							.setSettlementDisplayName("[CCY] Account 1")
							.setSettlementId("")
							.setSettlementInstructionType("EXISTING")
							.setSettlementStatus("")
							.setSplitComponentId("")
							.build())
						.addPayNettingComponents(
						SettlementInstructionsPartsDef.NettingComponents
							.newBuilder()
							.setAmount(BigDecimal.valueOf(0))
							.setBuySell("")
							.setTradeID("00001561")
							.build())
						.addReceive(
						SettlementInstructionsPartsDef.SettlementFields
							.newBuilder()
							.build())
						.addReceiveNettingComponents(
						SettlementInstructionsPartsDef.NettingComponents
							.newBuilder()
							.build())
						.setAffirmedBy("")
						.setAffirmedDateTime("2018-03-16T07:25:16+00:00")
						.setCanAdHoc("")
						.setCanAffirm(true)
						.setCanAutoConfirm(true)
						.setCanCancel("")
						.setCanConfirm("")
						.setCanDispute(true)
						.setCanReplace(true)
						.setCanUnconfirm(true)
						.setConfirmedBy("")
						.setConfirmedDateTime(Instant.now())
						.setIsPayNetted(true)
						.setIsPayNettingRequired("")
						.setIsPaySplit(true)
						.setIsReceiveNetted("")
						.setIsReceiveNettingRequired("")
						.setIsReceiveSplit(true)
						.setNextActionDeadline("2018-03-16T07:25:16+00:00")
						.setNextActionDeadlineDisplayTimezone("America/New_York")
						.setSettlementStatus("")
						.build())
					.setStartDate("", true)
					.setStartDateRisk()
					.setStartTenor("1W")
					.setStartTenorRisk()
					.setTOBOUser("client@customer.co.za")
					.setTOBOUserEditable()
					.setTOBOUserRisk()
					.setTenor("1M")
					.setTenorEditable()
					.setTenorRisk()
					.build())
				.addInputNDFLegTradeConfirmation(
				TradeConfPartsDef.NDFLegTradeConfirmationFields
					.newBuilder()
					.setFixingAmount("")
					.setFixingCode("[CCY]1/1600/GBLO")
					.setFixingCurrency("USD")
					.setFixingDate("20150620")
					.setFixingDescription("WMR [CCY] 4pm London")
					.setReferenceAmount(BigDecimal.valueOf(0.0))
					.setReferenceCurrency("")
					.setSettlementAmount("")
					.build())
				.setIsReprice(true)
				.setNdfNettedLegTradeConfirmation(
				TradeConfPartsDef.NDFLegTradeConfirmationFields
					.newBuilder()
					.build())
				.setNettedLegTradeConfirmation(
				TradeConfPartsDef.LegTradeConfirmationFields
					.newBuilder()
					.build())
				.build())
			.setCommonFields(
			TradeConfPartsDef.CommonTradeConfirmationFields
				.newBuilder()
				.setAccount("Garfields|GARF")
				.setAccountEditable()
				.setAssetType("")
				.setBackOfficeID("")
				.setCanAllocate("")
				.setCanRoll(true)
				.setClient("")
				.setContraCostAmount(BigDecimal.valueOf(0.0))
				.setContraCostCurrency(BigDecimal.valueOf(0.0))
				.setContraCostPercentage("1.5")
				.setCostAmount(BigDecimal.valueOf(12412891.31))
				.setCostCurrency("GBP")
				.setCostCurrencyDPS(2)
				.setCostPercentage("13.56")
				.setCurrencyPair("")
				.setDealtCurrency("", true, true)
				.setDealtCurrencyEditable()
				.setDealtCurrencyRisk()
				.setDeliverableType("")
				.setDigitsBeforePips("2")
				.setEntityDescription("Customer 1")
				.setEntityId("CUSTONE")
				.setExecutionDateTime("20160322123621")
				.setForceReporting("")
				.setFullName("")
				.setIsAllocated(true)
				.setIsAmendable(true)
				.setIsCancellable("")
				.setIsReversible("")
				.setNumberOfPips(2)
				.setOrderID("")
				.setPriceSource("st1@caplin.com")
				.setPurpose("Commercial")
				.setSpotMidRate("1.08345")
				.setSpotRate(BigDecimal.valueOf(1.08341))
				.setSpotRateDPS(5)
				.setTOBOUser("client@customer.co.za")
				.setTOBOUserEditable()
				.setTOBOUserRisk()
				.setTradeDate("20160314")
				.setTradeID("00001561")
				.setTraderUsername("sales_trader@novobank.co.za")
				.setTradingType("")
				.setUTI("")
				.setVenue("FX Sales")
				.setWarningCode("001")
				.setWarningMessage("You do not have sufficient credit for EUR")
				.build())
			.setNetFields(
			TradeConfPartsDef.NetConfirmationFields
				.newBuilder()
				.setNetBuySell("")
				.setNetContraAmount("1123400")
				.setNetDealtAmount("1000000")
				.build())
			.setNettedAmount(BigDecimal.valueOf(0.0))
			.build();
            
    }
}