openapi: 3.2.0 info: title: FX Trade execution API description: This API allows to execute Trades with existing quotes. version: 1.0.1 x-db-template-version: 1.0.0 servers: - description: Mock Environment - All possible response codes are randomly generated url: https://mock-api.danskebank.com/mock/sandbox/1.0.1/fx-trade-execution-api/v1/trade-service - description: PROD Environment url: https://api.danskebank.com/corporate/api/v1/trade-service - description: SANDBOX Environment url: https://sandbox-api.danskebank.com/sandbox-corporate/api/v1/trade-service security: - BearerAuth: [] tags: - name: Trade execution paths: /trade-execution/execute: post: tags: - Trade execution summary: Executes a trade description: Executes a trade based on provided parameters operationId: executeTrade requestBody: content: application/json: schema: $ref: '#/components/schemas/PremiumTradeRequest' examples: withMaturityDate: $ref: '#/components/examples/PremiumTradeRequest_MaturityDate' withTenor: $ref: '#/components/examples/PremiumTradeRequest_Tenor' required: true responses: '200': description: Trade executed successfully content: application/json: schema: $ref: '#/components/schemas/PremiumTradeResponse' examples: withMaturityDate: summary: Successful trade execution (maturityDate provided) value: tradeId: TRADE123456 executionId: EXEC123456 counterpart: EUR tradeTime: '2025-10-07T10:41:00Z' autoSettle: true bought: amount: 1000000 currency: EUR sold: amount: 1150000 currency: DKK spotPrice: 7.46372 forwardPrice: -0.0066376 allInPrice: 7.4570824 maturityDate: '2026-08-31' product: FX Swap comment: Urgent client request withTenor: $ref: '#/components/examples/PremiumTradeResponse_Tenor1W' '400': description: Invalid request parameters content: application/json: schema: $ref: '#/components/schemas/ApiError' examples: invalidCurrency: summary: Bad request due to invalid parameters value: status: 400 BAD_REQUEST exceptionType: InvalidParameterException details: The provided currency code is not valid. missingAmount: $ref: '#/components/examples/ApiError_MissingField' '401': description: Unauthorized access content: application/json: schema: $ref: '#/components/schemas/ApiError' examples: unauthorized: summary: Unauthorized access value: status: 401 UNAUTHORIZED exceptionType: AuthenticationException details: Authentication token is missing or invalid. expiredToken: $ref: '#/components/examples/ApiError_ExpiredToken' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ApiError' examples: example1: summary: Resource not found value: status: 404 NOT_FOUND exceptionType: ResourceNotFoundException details: The requested trade execution endpoint does not exist. '500': description: Error while executing trade content: application/json: schema: $ref: '#/components/schemas/ApiError' examples: example1: summary: Internal server error value: status: 500 INTERNAL_SERVER_ERROR exceptionType: PremiumTradeServiceException details: 'Error has occurred while querying ''QUOTE'' endpoint with error message: ''DI triggered but not allowed on DANSKEFX request''.' example2: summary: Internal server error 2 value: status: 500 INTERNAL_SERVER_ERROR exceptionType: TradeExecutionException details: An unexpected error occurred while processing the trade. components: schemas: ApiError: type: object properties: exceptionType: type: string description: Type of the exception encountered. example: InvalidParameterException status: type: string enum: - 100 CONTINUE - 101 SWITCHING_PROTOCOLS - 102 PROCESSING - 103 CHECKPOINT - 200 OK - 201 CREATED - 202 ACCEPTED - 203 NON_AUTHORITATIVE_INFORMATION - 204 NO_CONTENT - 205 RESET_CONTENT - 206 PARTIAL_CONTENT - 207 MULTI_STATUS - 208 ALREADY_REPORTED - 226 IM_USED - 300 MULTIPLE_CHOICES - 301 MOVED_PERMANENTLY - 302 FOUND - 302 MOVED_TEMPORARILY - 303 SEE_OTHER - 304 NOT_MODIFIED - 305 USE_PROXY - 307 TEMPORARY_REDIRECT - 308 PERMANENT_REDIRECT - 400 BAD_REQUEST - 401 UNAUTHORIZED - 402 PAYMENT_REQUIRED - 403 FORBIDDEN - 404 NOT_FOUND - 405 METHOD_NOT_ALLOWED - 406 NOT_ACCEPTABLE - 407 PROXY_AUTHENTICATION_REQUIRED - 408 REQUEST_TIMEOUT - 409 CONFLICT - 410 GONE - 411 LENGTH_REQUIRED - 412 PRECONDITION_FAILED - 413 PAYLOAD_TOO_LARGE - 413 REQUEST_ENTITY_TOO_LARGE - 414 URI_TOO_LONG - 414 REQUEST_URI_TOO_LONG - 415 UNSUPPORTED_MEDIA_TYPE - 416 REQUESTED_RANGE_NOT_SATISFIABLE - 417 EXPECTATION_FAILED - 418 I_AM_A_TEAPOT - 419 INSUFFICIENT_SPACE_ON_RESOURCE - 420 METHOD_FAILURE - 421 DESTINATION_LOCKED - 422 UNPROCESSABLE_ENTITY - 423 LOCKED - 424 FAILED_DEPENDENCY - 425 TOO_EARLY - 426 UPGRADE_REQUIRED - 428 PRECONDITION_REQUIRED - 429 TOO_MANY_REQUESTS - 431 REQUEST_HEADER_FIELDS_TOO_LARGE - 451 UNAVAILABLE_FOR_LEGAL_REASONS - 500 INTERNAL_SERVER_ERROR - 501 NOT_IMPLEMENTED - 502 BAD_GATEWAY - 503 SERVICE_UNAVAILABLE - 504 GATEWAY_TIMEOUT - 505 HTTP_VERSION_NOT_SUPPORTED - 506 VARIANT_ALSO_NEGOTIATES - 507 INSUFFICIENT_STORAGE - 508 LOOP_DETECTED - 509 BANDWIDTH_LIMIT_EXCEEDED - 510 NOT_EXTENDED - 511 NETWORK_AUTHENTICATION_REQUIRED description: HTTP status code indicating the result of the API call. example: 400 BAD_REQUEST details: type: string description: Detailed message explaining the error. example: The provided currency code is not valid. PremiumTradeResponse: type: object properties: tradeId: type: string description: Unique identifier for the executed trade. example: T250711A8787 executionId: type: string description: Identifier for the execution request. example: CRGHIT89765643787654INF15000Fx0000 counterpart: type: string description: Counterpart example: DEMOCP1 bought: $ref: '#/components/schemas/PremiumAmount' sold: $ref: '#/components/schemas/PremiumAmount' maturityDate: type: string format: date description: The maturity date of the trade. example: '2026-08-31' product: type: string description: Type of the FX Trade (Spot, Forward, Swap) example: Forward tradeTime: type: string format: date-time description: Timestamp indicating when the trade was executed. example: '2025-10-09T11:55:19.547Z' spotPrice: type: number format: double description: The spot price at which the trade was executed. example: 7.46372 forwardPrice: type: number format: double description: The forward price agreed upon for the trade. example: -0.0066376 allInPrice: type: number format: double description: Total price including fees. example: 7.4570824 autoSettle: type: boolean description: Indicates if the trade will be settled automatically. example: true comment: type: string description: Any additional comments regarding the trade (optional). example: Urgent client request PremiumAmount: type: object properties: currency: type: string description: The currency code in ISO 4217 format. example: EUR amount: type: number description: The amount involved in the trade, expressed in the specified currency. example: 100000.1 PremiumTradeRequest: required: - amount - amountSide - baseSide - buyCurrency - counterpart - sellCurrency type: object properties: counterpart: type: string description: Identifier for the counterpart involved in the trade. example: DEMOCP1 buyCurrency: type: string description: The currency to be purchased in the trade. example: DKK sellCurrency: type: string description: The currency to be sold in the trade. example: EUR amount: type: number description: Trade amount. example: 1000000 amountSide: type: string enum: - BUY - SELL description: Indicates whether the trade is a buy or sell action. example: BUY baseSide: type: string enum: - BUY - SELL description: Indicates the base side of the trade. example: SELL maturityDate: type: string description: The date when the trade matures. Required if tenor is not provided. example: '2026-08-31' tenor: type: string description: The tenor for the trade, required if maturityDate is not provided. example: 1W enum: - 'ON' - TOM - TN - SP - SN - 1W - 2W - 3W - 1M - 2M - 3M - 4M - 5M - 6M - 7M - 8M - 9M - 10M - 11M - 15M - 18M - 1Y - 2Y - 3Y - 4Y - 5Y comment: type: string description: Any additional comments regarding the trade (optional). example: Urgent client request description: Request for creating a premium trade. The 'comment' field is optional. Either 'maturityDate' or 'tenor' is required. If both are provided, 'maturityDate' will be used and 'tenor' will be ignored. examples: ApiError_MissingField: summary: Missing required field (amount) value: status: 400 BAD_REQUEST exceptionType: InvalidParameterException details: Field 'amount' is required. PremiumTradeResponse_Tenor1W: summary: Executed forward trade (1W tenor) value: tradeId: TRADE654321 executionId: EXEC654321 tradeTime: '2025-10-07T11:05:12Z' autoSettle: false bought: amount: 500000 currency: EUR sold: amount: 540500 currency: USD spotPrice: 1.081 forwardPrice: 1.0816 maturityDate: '2025-10-14' product: FX Forward PremiumTradeRequest_MaturityDate: summary: Spot/forward trade specifying maturityDate value: amount: 1000000 amountSide: BUY baseSide: SELL buyCurrency: DKK sellCurrency: EUR counterpart: LLBM1Q maturityDate: '2026-08-31' comment: Urgent client request PremiumTradeRequest_Tenor: summary: Forward trade using tenor instead of maturityDate value: amount: 500000 amountSide: SELL baseSide: BUY buyCurrency: EUR sellCurrency: USD counterpart: LLBM1Q tenor: 1W comment: Short-dated hedge ApiError_ExpiredToken: summary: Expired authentication token value: status: 401 UNAUTHORIZED exceptionType: AuthenticationException details: Token expired. securitySchemes: BearerAuth: description: 'JWT Authorization header using the Bearer scheme. Example: "Authorization: Bearer {token}"' type: http scheme: bearer bearerFormat: JWT