Get All Currencies
curl http://localhost:8080/api/Currency
Retrieves a list of all currencies in the system.
Response
Array of currency objects Unique identifier for the currency
Three-letter currency code (ISO 4217 format)
Full name of the currency
Example Response
[
{
"id" : 1 ,
"code" : "USD" ,
"fullName" : "United States Dollar" ,
"sign" : "$"
},
{
"id" : 2 ,
"code" : "EUR" ,
"fullName" : "Euro" ,
"sign" : "€"
},
{
"id" : 3 ,
"code" : "GBP" ,
"fullName" : "British Pound Sterling" ,
"sign" : "£"
}
]
Find Currencies
GET /api/Currency/{searchString}
curl http://localhost:8080/api/Currency/USD
Searches for currencies matching the provided search string. The search matches against currency codes and names.
Path Parameters
Search term to find currencies (1-24 characters, letters, spaces, and parentheses only)
Validation Rules
Length: 1-24 characters
Allowed characters: A-Z, a-z, spaces, parentheses
Pattern: [^A-Za-z() ] (special characters not allowed)
Response
Array of matching currency objects Unique identifier for the currency
Three-letter currency code
Full name of the currency
Example Response
[
{
"id" : 1 ,
"code" : "USD" ,
"fullName" : "United States Dollar" ,
"sign" : "$"
}
]
Error Response
{
"type" : "https://tools.ietf.org/html/rfc7231#section-6.5.1" ,
"title" : "One or more validation errors occurred." ,
"status" : 400 ,
"errors" : {
"message" : [ "Не корректные символы в строке" ]
}
}
Create Currency
curl -X POST http://localhost:8080/api/Currency \
-H "Content-Type: application/json" \
-d '{
"id": 0,
"code": "JPY",
"fullName": "Japanese Yen",
"sign": "¥"
}'
Creates a new currency in the system.
Request Body
Currency ID (typically 0 for new currencies, auto-generated by database)
Three to five letter currency code (uppercase letters only) Validation:
Length: 3-5 characters
Pattern: A-Z only
Automatically converted to uppercase
Full name of the currency Validation:
Length: 3-60 characters
Allowed: A-Z, a-z, А-Я, а-я, spaces, parentheses
Currency symbol Validation:
Length: 1-3 characters
No whitespace or newlines allowed
Example Request
{
"id" : 0 ,
"code" : "JPY" ,
"fullName" : "Japanese Yen" ,
"sign" : "¥"
}
Response
The created currency object Generated unique identifier
Currency code (uppercase)
Full name of the currency
Example Response
{
"id" : 4 ,
"code" : "JPY" ,
"fullName" : "Japanese Yen" ,
"sign" : "¥"
}
Error Responses
Empty or null field:
{
"type" : "https://tools.ietf.org/html/rfc7231#section-6.5.1" ,
"title" : "One or more validation errors occurred." ,
"status" : 400 ,
"errors" : {
"message" : [ "Не заполнен один или несколько параметров" ]
}
}
Invalid length:
{
"type" : "https://tools.ietf.org/html/rfc7231#section-6.5.1" ,
"title" : "One or more validation errors occurred." ,
"status" : 400 ,
"errors" : {
"message" : [ "Не корректное количество символов указано для поля USD валюты. Длина строки может быть от 3-х до 5 символов." ]
}
}
Invalid characters:
{
"type" : "https://tools.ietf.org/html/rfc7231#section-6.5.1" ,
"title" : "One or more validation errors occurred." ,
"status" : 400 ,
"errors" : {
"message" : [ "Не корректные символы в строке USD123." ]
}
}