diff --git a/precalc-api.json b/precalc-api.json index ed4ecb2..9ebe256 100644 --- a/precalc-api.json +++ b/precalc-api.json @@ -118,7 +118,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExternalPrecalcRequestDto" + "$ref": "#/components/schemas/RequestV1" } } }, @@ -182,30 +182,150 @@ }, "components": { "schemas": { - "ResponseContainerDto": { + "RequestV1": { "required": [ - "message", - "status" + "merchantId", + "fromCurrency", + "toCurrency" ], "type": "object", "properties": { - "response": { - "$ref": "#/components/schemas/ResponseDto" - }, - "status": { + "merchantId": { "type": "string", - "description": "Status of performed operation", - "enum": [ - "OK", - "ERROR" - ] + "description": "Merchant ID" }, - "message": { + "methodId": { "type": "string", - "description": "Error message when occurred, 'OK' otherwise" + "description": "Payment method type id" + }, + "fromCountry": { + "type": "string", + "description": "Source country (ISO Alpha2 code)" + }, + "fromCurrency": { + "type": "string", + "description": "Source currency (ISO code)" + }, + "fromAmount": { + "type": "number", + "description": "Source amount (one of fromAmount and toAmount must be specified)" + }, + "toCountry": { + "type": "string", + "description": "Destination country (ISO Alpa2 code)" + }, + "toCurrency": { + "type": "string", + "description": "Destination currency (ISO code)" + }, + "toAmount": { + "type": "number", + "description": "Destination amount (one of fromAmount and toAmount must be specified)" + }, + "externalId": { + "maxLength": 1000, + "minLength": 0, + "type": "string", + "description": "Merchant's marketing ID (this ID will be placed at utm_campaign further)" } }, - "description": "Response container" + "description": "Request for payment calculation (either 'fromAmount' or 'toAmount' must be specified)" + }, + "ExternalPrecalcRequestDto": { + "required": [ + "merchantId", + "fromCurrency", + "toCurrency", + "fromCountry", + "toCountry" + ], + "type": "object", + "properties": { + "merchantId": { + "type": "string", + "description": "Merchant ID" + }, + "methodId": { + "type": "string", + "description": "Payment method type id" + }, + "fromCountry": { + "type": "string", + "description": "Source country (ISO Alpha2 code)" + }, + "fromCurrency": { + "type": "string", + "description": "Source currency (ISO code)" + }, + "fromAmount": { + "type": "number", + "description": "Source amount (one of fromAmount and toAmount must be specified)" + }, + "toCountry": { + "type": "string", + "description": "Destination country (ISO Alpa2 code)" + }, + "toCurrency": { + "type": "string", + "description": "Destination currency (ISO code)" + }, + "toAmount": { + "type": "number", + "description": "Destination amount (one of fromAmount and toAmount must be specified)" + }, + "externalId": { + "maxLength": 1000, + "minLength": 0, + "type": "string", + "description": "Merchant's marketing ID (this ID will be placed at utm_campaign further)" + } + }, + "description": "Request for payment calculation (either 'fromAmount' or 'toAmount' must be specified)" + }, + "RequestV3": { + "required": [ + "merchantId", + "fromCurrency", + "toCurrency", + "fromCountry", + "toCountry" + ], + "type": "object", + "properties": { + "merchantId": { + "type": "string", + "description": "Merchant ID" + }, + "methodId": { + "type": "string", + "description": "Payment method type id" + }, + "fromCountry": { + "type": "string", + "description": "Source country (ISO Alpha2 code)" + }, + "fromCurrency": { + "type": "string", + "description": "Source currency (ISO code)" + }, + "fromAmount": { + "type": "number", + "description": "Source amount (one of fromAmount and toAmount must be specified)" + }, + "toCountry": { + "type": "string", + "description": "Destination country (ISO Alpa2 code)" + }, + "toCurrency": { + "type": "string", + "description": "Destination currency (ISO code)" + }, + "toAmount": { + "type": "number", + "description": "Destination amount (one of fromAmount and toAmount must be specified)" + } + }, + "description": "Request for payment calculation (either 'fromAmount' or 'toAmount' must be specified)" }, "ResponseDto": { "type": "object", @@ -257,6 +377,31 @@ }, "description": "Payment calculation result" }, + "ResponseContainerDto": { + "required": [ + "message", + "status" + ], + "type": "object", + "properties": { + "response": { + "$ref": "#/components/schemas/ResponseDto" + }, + "status": { + "type": "string", + "description": "Status of performed operation", + "enum": [ + "OK", + "ERROR" + ] + }, + "message": { + "type": "string", + "description": "Error message when occurred, 'OK' otherwise" + } + }, + "description": "Response container" + }, "ResponseDtoV3": { "type": "object", "properties": { @@ -314,98 +459,6 @@ } } }, - "ExternalPrecalcRequestDto": { - "required": [ - "merchantId", - "fromCurrency", - "toCurrency" - ], - "type": "object", - "properties": { - "merchantId": { - "type": "string", - "description": "Merchant ID" - }, - "methodId": { - "type": "string", - "description": "Payment method type id" - }, - "fromCountry": { - "type": "string", - "description": "Source country (ISO Alpha2 code)" - }, - "fromCurrency": { - "type": "string", - "description": "Source currency (ISO code)" - }, - "fromAmount": { - "type": "number", - "description": "Source amount (one of fromAmount and toAmount must be specified)" - }, - "toCountry": { - "type": "string", - "description": "Destination country (ISO Alpa2 code)" - }, - "toCurrency": { - "type": "string", - "description": "Destination currency (ISO code)" - }, - "toAmount": { - "type": "number", - "description": "Destination amount (one of fromAmount and toAmount must be specified)" - }, - "externalId": { - "maxLength": 1000, - "minLength": 0, - "type": "string", - "description": "Merchant's marketing ID (this ID will be placed at utm_campaign further)" - } - }, - "description": "Request for payment calculation (either 'fromAmount' or 'toAmount' must be specified)" - }, - "RequestV3": { - "required": [ - "merchantId", - "fromCurrency", - "toCurrency" - ], - "type": "object", - "properties": { - "merchantId": { - "type": "string", - "description": "Merchant ID" - }, - "methodId": { - "type": "string", - "description": "Payment method type id" - }, - "fromCountry": { - "type": "string", - "description": "Source country (ISO Alpha2 code)" - }, - "fromCurrency": { - "type": "string", - "description": "Source currency (ISO code)" - }, - "fromAmount": { - "type": "number", - "description": "Source amount (one of fromAmount and toAmount must be specified)" - }, - "toCountry": { - "type": "string", - "description": "Destination country (ISO Alpa2 code)" - }, - "toCurrency": { - "type": "string", - "description": "Destination currency (ISO code)" - }, - "toAmount": { - "type": "number", - "description": "Destination amount (one of fromAmount and toAmount must be specified)" - } - }, - "description": "Request for payment calculation (either 'fromAmount' or 'toAmount' must be specified)" - }, "CorridorDescriptorDto": { "type": "object", "properties": {