# README
Currency Exchange API
Simple REST API with currencies and exchange rates as resources and exchange of the currency as the main functionality
Created according to the technical specifications presented in this course
Run Locally
[!IMPORTANT]
Go should be installed to run this project
Clone the project
git clone [email protected]:krios2146/currency-exchange-api-go.git
Go to the project directory
cd currency-exchange-api-go
Run with go
go run cmd/main.go
API Reference
[!NOTE]
Postman workspace for this project with reuqests examples
Currencies
Get all currencies
GET /currencies
Get currency by code
GET /currency/{code}
Parameter | Type | Description |
---|---|---|
code | string | Required. Currency code in the ISO-4217 format |
Add new currency
POST /currencies
Content-Type: x-www-form-urlencoded
Request | Type | Description |
---|---|---|
code | string | Required. Currency code in the ISO-4217 format |
name | string | Required. Currency name |
sign | string | Required. Currency sign |
Exchange Rates
Get all exchange rates
GET /exchangeRates
Get exchange rate for currencies
GET /exchangeRate/{codes}
Parameter | Type | Description |
---|---|---|
codes | string | Required. Currency codes in the ISO-4217 format. E.g. for USDEUR parameter API will response with USD => EUR exchange rate |
Add new exchange rate
POST /exchangeRates
Content-Type: x-www-form-urlencoded
Request | Type | Description |
---|---|---|
baseCurrencyCode | string | Required. Base currency code in the ISO-4217 format |
targetCurrencyCode | string | Required. Target currency code in the ISO-4217 format |
rate | float | Required. Exchange rate |
Update exchange rate for currencies
PATCH /exchangeRate/{codes}
Content-Type: x-www-form-urlencoded
Parameter/Request | Type | Description |
---|---|---|
codes | string | Required. Currency codes in the ISO-4217 format. E.g. for USDEUR parameter API will update USD => EUR exchange rate |
rate | float | Required. New exchange rate for currency pair |
Currency exchange
GET /exchange
Query | Type | Description |
---|---|---|
from | string | Required. Currency code in the ISO-4217 |
to | string | Required. Currency code in the ISO-4217 |
amount | float | Required. Amount to exchange |
# Packages
No description provided by the author