{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/if/main/json-schema/if-exchange-list-response-schema.json", "title": "ExchangeListResponse", "x-generated": "2026-10-14", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/if-exchange-api-openapi.yml#/components/schemas/ExchangeListResponse", "required": [ "connect", "data", "metadata", "workflow" ], "type": "object", "properties": { "workflow": { "$ref": "#/$defs/ExchangeListWorkflowContainer" }, "data": { "$ref": "#/$defs/ExchangeListDataContainer" }, "connect": { "$ref": "#/$defs/ExchangeListConnectContainer" }, "metadata": { "$ref": "#/$defs/ExchangeListMetadataContainer" } }, "$defs": { "ConnectMethod": { "type": "string", "enum": [ "built-in", "plug-in" ] }, "ConnectionErrorResource": { "type": "object", "properties": { "category": { "$ref": "#/$defs/ErrorCategory" }, "origin": { "$ref": "#/$defs/ErrorOrigin" }, "code": { "type": "string" }, "message": { "type": "string" }, "attributes": { "type": "object", "additionalProperties": { "type": "string" } } } }, "ErrorCategory": { "type": "string", "enum": [ "functional", "technical" ] }, "ErrorOrigin": { "type": "string", "enum": [ "customer", "platform", "provider" ] }, "ExchangeFixedSideType": { "type": "string", "description": "which side is fixed as amount", "enum": [ "buy", "sell" ] }, "ExchangeListConnectContainer": { "type": "object" }, "ExchangeListDataContainer": { "type": "object", "properties": { "exchange": { "$ref": "#/$defs/ExchangeResourceQueryInput" }, "exchanges": { "type": "array", "items": { "$ref": "#/$defs/ExchangeResource" } } } }, "ExchangeListMetadataContainer": { "required": [ "page" ], "type": "object", "properties": { "page": { "$ref": "#/$defs/PageMetadata" } }, "description": "metadata container" }, "ExchangeListWorkflowContainer": { "type": "object", "description": "workflow container" }, "ExchangeResource": { "required": [ "buyAccountId", "buyAmount", "buyCurrency", "clientId", "creditAmount", "cutOffDateTime", "debitAmount", "exchangeDate", "fixedSide", "originalExchangeDate", "quoteId", "rate", "rollCount", "sellAccountId", "sellAmount", "sellCurrency", "serviceProviderBuyAmount", "serviceProviderRate", "serviceProviderSellAmount", "settlementDate", "status", "transactionNumber" ], "type": "object", "properties": { "id": { "type": "string", "description": "ID of exchange", "format": "uuid" }, "clientId": { "type": "string", "description": "ID of client", "format": "uuid" }, "quoteId": { "type": "string", "description": "ID of quote", "format": "uuid" }, "transactionNumber": { "type": "string", "description": "Transaction number of exchange" }, "fixedSide": { "$ref": "#/$defs/ExchangeFixedSideType" }, "rate": { "type": "number", "description": "Rate" }, "serviceProviderRate": { "type": "number", "description": "Service provider rate" }, "buyAccountId": { "type": "string", "description": "ID of buy account", "format": "uuid" }, "buyCurrency": { "maxLength": 3, "minLength": 3, "type": "string", "description": "ISO 4217 currency code" }, "buyAmount": { "type": "number", "description": "Buy amount of exchange" }, "serviceProviderBuyAmount": { "type": "number", "description": "Buy amount of service provider" }, "sellAccountId": { "type": "string", "description": "ID of sell account", "format": "uuid" }, "sellCurrency": { "maxLength": 3, "minLength": 3, "type": "string", "description": "ISO 4217 currency code" }, "sellAmount": { "type": "number", "description": "Sell amount of exchange" }, "serviceProviderSellAmount": { "type": "number", "description": "Sell amount of service provider" }, "feeAmount": { "type": "number", "description": "Fee amount" }, "feeCurrency": { "type": "string", "description": "Fee currency" }, "debitAmount": { "type": "number", "description": "amount to be debited from the account, equals to sell amount if fee amount is 0" }, "creditAmount": { "type": "number", "description": "amount to be credited to the account, equals to buy amount if fee amount is 0" }, "rollCount": { "type": "integer", "description": "Roll count of exchange", "format": "int32" }, "originalExchangeDate": { "type": "string", "description": "Original exchange date", "format": "date" }, "exchangeDate": { "type": "string", "description": "Calculated exchange date", "format": "date" }, "cutOffDateTime": { "type": "string", "description": "Exchange cut-off date time", "format": "date-time" }, "settlementDate": { "type": "string", "description": "Calculated exchange settlement date", "format": "date" }, "status": { "$ref": "#/$defs/ExchangeTransactionStatus" }, "cancellationFee": { "type": [ "number", "null" ], "description": "Cancellation fee" }, "owner": { "$ref": "#/$defs/Owner" }, "relatedTransaction": { "$ref": "#/$defs/RelatedTransaction" }, "connection": { "$ref": "#/$defs/ExchangeTransactionConnectionResource" } }, "description": "exchange transaction model", "readOnly": true }, "ExchangeResourceQueryInput": { "type": "object", "properties": { "clientId": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "owner": { "$ref": "#/$defs/Owner" }, "transactionNumber": { "type": "array", "items": { "type": "string" } }, "exchangeDateFrom": { "type": "string", "format": "date" }, "exchangeDateTo": { "type": "string", "format": "date" }, "sellCurrency": { "type": "array", "items": { "type": "string" } }, "buyCurrency": { "type": "array", "items": { "type": "string" } }, "sellAmountFrom": { "type": "number" }, "sellAmountTo": { "type": "number" }, "buyAmountFrom": { "type": "number" }, "buyAmountTo": { "type": "number" }, "serviceProviders": { "type": "array", "items": { "type": "string" } }, "serviceProviderId": { "type": "string" }, "serviceProviderReference": { "type": "string" }, "hasRelatedTransaction": { "type": "boolean" }, "relatedTransactionId": { "type": "string", "format": "uuid" }, "relatedTransactionNature": { "$ref": "#/$defs/TransactionNature" } } }, "ExchangeTransactionConnectionResource": { "type": "object", "properties": { "id": { "type": "string" }, "serviceProvider": { "type": "string" }, "reference": { "type": "string" }, "state": { "$ref": "#/$defs/ServiceProviderConnectionState" }, "status": { "$ref": "#/$defs/ThirdPartyExchangeTransactionStatus" }, "method": { "$ref": "#/$defs/ConnectMethod" }, "error": { "$ref": "#/$defs/ConnectionErrorResource" } }, "description": "Exchange Transaction Connection Resource Object", "readOnly": true }, "ExchangeTransactionStatus": { "type": "string", "description": "Status of Exchange", "enum": [ "pending", "completed", "cancelled", "failed" ] }, "Owner": { "type": "string", "enum": [ "organization", "client" ] }, "PageMetadata": { "required": [ "number", "size", "totalElements", "totalPages" ], "type": "object", "properties": { "size": { "minimum": 0, "type": "integer", "description": "number of elements in this page", "format": "int32" }, "number": { "minimum": 0, "type": "integer", "description": "index of page starting from 0", "format": "int32" }, "totalElements": { "minimum": 0, "type": "integer", "description": "total number of elements in all of the pages", "format": "int64", "readOnly": true }, "totalPages": { "minimum": 0, "type": "integer", "description": "number of total pages", "format": "int32", "readOnly": true } } }, "RelatedTransaction": { "type": "object", "properties": { "nature": { "$ref": "#/$defs/TransactionNature" }, "id": { "type": "string", "format": "uuid" } } }, "ServiceProviderConnectionState": { "type": "string", "enum": [ "pending", "creation-in-progress", "update-in-progress", "dependency-completed", "completed-up-to-date", "completed-outdated", "dependency-failed", "creation-failed" ] }, "ThirdPartyExchangeTransactionStatus": { "type": "string", "enum": [ "pending", "processing", "completed", "cancelled", "failed" ] }, "TransactionNature": { "type": "string", "enum": [ "actual", "virtual" ] } } }