2023-10-09 12:58:13 +03:00
{
"openapi" : "3.0.1" ,
"info" : {
"title" : "Profee Payment calculation API" ,
"description" : "<h1>Welcome to the Profee Payment calculation API documentation.</h1>\n<p>\n This is a living document to be updated regularly with new functionality. To address questions\n to our developers please contact: <a href=\"mailto:support@profeelab.net\">support@profeelab.net</a>\n</p>" ,
"license" : {
"name" : "Profee" ,
"url" : "http://profee.com"
} ,
"version" : "v2.0"
} ,
"servers" : [
{
"url" : "http://localhost" ,
"description" : "Generated server url"
}
] ,
"paths" : {
2024-01-26 14:34:11 +03:00
"/api/v3/calc" : {
"post" : {
"tags" : [
"V3 / Payments"
] ,
"summary" : "Payment calculation" ,
"description" : "Perform payment calculation for promo and standard courses" ,
"operationId" : "calculate" ,
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
2024-02-01 15:30:53 +03:00
"$ref" : "#/components/schemas/RequestV3"
2024-01-26 14:34:11 +03:00
}
}
} ,
"required" : true
} ,
"responses" : {
"500" : {
"description" : "Internal Server Error"
} ,
"400" : {
"description" : "Bad Request" ,
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/ResponseContainerDto"
}
}
}
} ,
"200" : {
"description" : "OK" ,
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/PrecalcResponseDtoV3"
}
}
}
}
}
}
} ,
2023-10-09 12:58:13 +03:00
"/api/v2/calc" : {
"post" : {
"tags" : [
"V2 / Payments"
] ,
"summary" : "Payment calculation" ,
"description" : "Perform payment calculation" ,
"operationId" : "calculate" ,
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
2024-01-26 14:34:11 +03:00
"$ref" : "#/components/schemas/ExternalPrecalcRequestDto"
2023-10-09 12:58:13 +03:00
}
}
} ,
"required" : true
} ,
"responses" : {
"500" : {
"description" : "Internal Server Error"
} ,
"400" : {
"description" : "Bad Request" ,
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/ResponseContainerDto"
}
}
}
} ,
"200" : {
"description" : "OK" ,
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/ResponseContainerDto"
}
}
}
}
}
}
} ,
"/api/calc" : {
"post" : {
"tags" : [
"V1 / Payments"
] ,
"summary" : "Payment calculation" ,
"description" : "Perform payment calculation" ,
"operationId" : "calculate_1" ,
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
2024-02-02 15:28:51 +03:00
"$ref" : "#/components/schemas/RequestV1"
2023-10-09 12:58:13 +03:00
}
}
} ,
"required" : true
} ,
"responses" : {
"500" : {
"description" : "Internal Server Error"
} ,
"200" : {
"description" : "OK" ,
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/ResponseContainerDto"
}
}
}
}
}
}
} ,
"/api/v2/corridors" : {
"get" : {
"tags" : [
"V2 / Corridors"
] ,
"summary" : "Calculation URLs" ,
"description" : "Returns all calculation URLs available" ,
"operationId" : "getAllCorridorsAvailable" ,
"parameters" : [
{
"name" : "merchantId" ,
"in" : "query" ,
"required" : true ,
"schema" : {
"type" : "string"
}
}
] ,
"responses" : {
"500" : {
"description" : "Internal Server Error"
} ,
"200" : {
"description" : "OK" ,
"content" : {
"*/*" : {
"schema" : {
"type" : "array" ,
"items" : {
"$ref" : "#/components/schemas/CorridorDescriptorDto"
}
}
}
}
}
}
}
}
} ,
"components" : {
"schemas" : {
2024-02-02 15:28:51 +03:00
"RequestV1" : {
2023-10-09 12:58:13 +03:00
"required" : [
2024-02-02 15:28:51 +03:00
"merchantId" ,
"fromCurrency" ,
"toCurrency"
2023-10-09 12:58:13 +03:00
] ,
"type" : "object" ,
"properties" : {
2024-02-02 15:28:51 +03:00
"merchantId" : {
"type" : "string" ,
"description" : "Merchant ID"
2023-10-09 12:58:13 +03:00
} ,
2024-02-02 15:28:51 +03:00
"methodId" : {
2023-10-09 12:58:13 +03:00
"type" : "string" ,
2024-02-02 15:28:51 +03:00
"description" : "Payment method type id"
2023-10-09 12:58:13 +03:00
} ,
2024-02-02 15:28:51 +03:00
"fromCountry" : {
2023-10-09 12:58:13 +03:00
"type" : "string" ,
2024-02-02 15:28:51 +03:00
"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)"
2023-10-09 12:58:13 +03:00
}
} ,
2024-02-02 15:28:51 +03:00
"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)"
2023-10-09 12:58:13 +03:00
} ,
"ResponseDto" : {
"type" : "object" ,
"properties" : {
"precalcId" : {
"type" : "string" ,
"description" : "Calculation ID"
} ,
"fromCurrency" : {
"type" : "string" ,
"description" : "Source currency"
} ,
"fromAmount" : {
"type" : "number" ,
"description" : "Source amount"
} ,
"toCurrency" : {
"type" : "string" ,
"description" : "Destination currency"
} ,
"toAmount" : {
"type" : "number" ,
"description" : "Destination amount"
} ,
"feeCurrency" : {
"type" : "string" ,
"description" : "Fee currency"
} ,
"feeAmount" : {
"type" : "number" ,
"description" : "Fee amount"
} ,
"rateFromCurrency" : {
"type" : "string" ,
"description" : "Rate source currency"
} ,
"rateToCurrency" : {
"type" : "string" ,
"description" : "Rate destination currency"
} ,
"rateAmount" : {
"type" : "number" ,
"description" : "Currency rate amount"
} ,
"nextStepUrl" : {
"type" : "string" ,
"description" : "Link for further step to proceed"
}
} ,
"description" : "Payment calculation result"
} ,
2024-02-02 15:28:51 +03:00
"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"
} ,
2024-01-30 14:24:52 +03:00
"ResponseDtoV3" : {
"type" : "object" ,
"properties" : {
"precalcId" : {
"type" : "string" ,
"description" : "Calculation ID"
} ,
"fromCurrency" : {
"type" : "string" ,
"description" : "Source currency"
} ,
"fromAmount" : {
"type" : "number" ,
"description" : "Source amount"
} ,
"toCurrency" : {
"type" : "string" ,
"description" : "Destination currency"
} ,
"toAmount" : {
"type" : "number" ,
"description" : "Destination amount"
} ,
"feeCurrency" : {
"type" : "string" ,
"description" : "Fee currency"
} ,
"feeAmount" : {
"type" : "number" ,
"description" : "Fee amount"
} ,
"rateFromCurrency" : {
"type" : "string" ,
"description" : "Rate source currency"
} ,
"rateToCurrency" : {
"type" : "string" ,
"description" : "Rate destination currency"
} ,
"rateAmount" : {
"type" : "number" ,
"description" : "Currency rate amount"
}
} ,
"description" : "Payment calculation result V3"
} ,
2024-01-26 14:34:11 +03:00
"PrecalcResponseDtoV3" : {
"type" : "object" ,
"properties" : {
"promotion" : {
2024-01-30 14:24:52 +03:00
"$ref" : "#/components/schemas/ResponseDtoV3"
2024-01-26 14:34:11 +03:00
} ,
"standard" : {
2024-01-30 14:24:52 +03:00
"$ref" : "#/components/schemas/ResponseDtoV3"
2024-01-26 14:34:11 +03:00
}
}
} ,
2023-10-09 12:58:13 +03:00
"CorridorDescriptorDto" : {
"type" : "object" ,
"properties" : {
"fromCountry" : {
"type" : "string"
} ,
"toCountry" : {
"type" : "string"
} ,
"currencies" : {
"type" : "array" ,
"items" : {
"$ref" : "#/components/schemas/CurrencyPairDto"
}
}
}
} ,
"CurrencyPairDto" : {
"type" : "object" ,
"properties" : {
"fromCurrencyCode" : {
"type" : "string"
} ,
"toCurrencyCode" : {
"type" : "string"
}
}
}
}
}
}