diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed2c35e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +index-local.html + diff --git a/build-local.sh b/build-local.sh new file mode 100755 index 0000000..97eeaa0 --- /dev/null +++ b/build-local.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +npx @redocly/cli build-docs precalc-api.json diff --git a/index.html b/index.html index 87082a1..1469419 100644 --- a/index.html +++ b/index.html @@ -22,17 +22,17 @@ diff --git a/precalc-api.json b/precalc-api.json index 0dc1e25..34862c0 100644 --- a/precalc-api.json +++ b/precalc-api.json @@ -1 +1 @@ -{"openapi":"3.0.1","info":{"title":"Profee Payment calculation API","description":"

Welcome to the Profee Payment calculation API documentation.

\n

\n This is a living document to be updated regularly with new functionality. To address questions\n to our developers please contact: support@profeelab.net\n

","license":{"name":"Profee","url":"http://profee.com"},"version":"v1.0"},"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"paths":{"/api/calc":{"post":{"tags":["Payments"],"summary":"Payment calculation","description":"Perform payment calculation","operationId":"calculate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResponseContainerDto"}}}}}}}},"components":{"schemas":{"RequestDto":{"required":["fromCurrency","merchantId","toCurrency"],"type":"object","properties":{"merchantId":{"type":"string","description":"Merchant ID"},"fromCurrency":{"type":"string","description":"Source currency (ISO code)"},"fromAmount":{"type":"number","description":"Source amount"},"toCurrency":{"type":"string","description":"Destination currency (ISO code)"},"toAmount":{"type":"number","description":"Destination amount"}},"description":"Request for payment calculation (either 'fromAmount' or 'toAmount' must be specified)"},"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"},"ResponseDto":{"type":"object","properties":{"precalcId":{"type":"string","description":"Calcution 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"}}}} \ No newline at end of file +{"openapi":"3.0.1","info":{"title":"Profee Payment calculation API","description":"

Welcome to the Profee Payment calculation API documentation.

\n

\n This is a living document to be updated regularly with new functionality. To address questions\n to our developers please contact: support@profeelab.net\n

","license":{"name":"Profee","url":"http://profee.com"},"version":"v2.0"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/api/v2/calc":{"post":{"tags":["V2 / Payments"],"summary":"Payment calculation","description":"Perform payment calculation","operationId":"calculate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestDto"}}},"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":{"$ref":"#/components/schemas/RequestDto"}}},"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":{"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"},"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"},"RequestDto":{"required":["fromCurrency","merchantId","toCurrency"],"type":"object","properties":{"merchantId":{"type":"string","description":"Merchant 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)"},"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"}}}}}} \ No newline at end of file diff --git a/redoc-static.html b/redoc-static.html new file mode 100644 index 0000000..5b245cb --- /dev/null +++ b/redoc-static.html @@ -0,0 +1,419 @@ + + + + + + Profee Payment calculation API + + + + + + + + + +

Profee Payment calculation API (v2.0)

Download OpenAPI specification:Download

License: Profee

Welcome to the Profee Payment calculation API documentation.

+

+ This is a living document to be updated regularly with new functionality. To address questions + to our developers please contact: support@profeelab.net +

V2 / Payments

Payment calculation

Perform payment calculation

+
Request Body schema: application/json
merchantId
required
string

Merchant ID

+
fromCountry
string

Source country (ISO Alpha2 code)

+
fromCurrency
required
string

Source currency (ISO code)

+
fromAmount
number

Source amount (one of fromAmount and toAmount must be specified)

+
toCountry
string

Destination country (ISO Alpa2 code)

+
toCurrency
required
string

Destination currency (ISO code)

+
toAmount
number

Destination amount (one of fromAmount and toAmount must be specified)

+
externalId
string [ 0 .. 1000 ] characters

Merchant's marketing ID (this ID will be placed at utm_campaign further)

+

Responses

Request samples

Content type
application/json
{
  • "merchantId": "string",
  • "fromCountry": "string",
  • "fromCurrency": "string",
  • "fromAmount": 0,
  • "toCountry": "string",
  • "toCurrency": "string",
  • "toAmount": 0,
  • "externalId": "string"
}

V1 / Payments

Payment calculation

Perform payment calculation

+
Request Body schema: application/json
merchantId
required
string

Merchant ID

+
fromCountry
string

Source country (ISO Alpha2 code)

+
fromCurrency
required
string

Source currency (ISO code)

+
fromAmount
number

Source amount (one of fromAmount and toAmount must be specified)

+
toCountry
string

Destination country (ISO Alpa2 code)

+
toCurrency
required
string

Destination currency (ISO code)

+
toAmount
number

Destination amount (one of fromAmount and toAmount must be specified)

+
externalId
string [ 0 .. 1000 ] characters

Merchant's marketing ID (this ID will be placed at utm_campaign further)

+

Responses

Request samples

Content type
application/json
{
  • "merchantId": "string",
  • "fromCountry": "string",
  • "fromCurrency": "string",
  • "fromAmount": 0,
  • "toCountry": "string",
  • "toCurrency": "string",
  • "toAmount": 0,
  • "externalId": "string"
}

V2 / Corridors

Calculation URLs

Returns all calculation URLs available

+
query Parameters
merchantId
required
string

Responses

+ + + +