Purpose

The currencies route contains all endpoints related to the management of currencies. For more information on how monetary values are handled check out this post

get all

This endpoint is used to retrieve all currencies.

Request:
GET /api/v1/currencies/all

Response:

[
    {
        "id": "ffc53ce5-0bd2-4464-94b3-9866e506fd91",
        "name": "euro",
        "minor_in_major": 100,
        "symbol": "€"
    }
]
PropertyDescriptionTypeFilterableSortable
idid of the currencyUUIDv4YesNo
namename of the currencystringYesNo
minor_in_majorfor example there are 100 cents in 1 Euro -> minor_in_major = 100numberYesNo
symbolsymbol of the currencystringYesNo

get by id

This endpoint is used to retrieve a single currency by its id. You need to specify the id of the currency you want to retrieve in the request path.

Request:
GET /api/v1/currencies/{currency_id}

Response:

{
    "id": "ffc53ce5-0bd2-4464-94b3-9866e506fd91",
    "name": "euro",
    "minor_in_major": 100,
    "symbol": "€"
}
PropertyDescriptionType
idid of the currencyUUIDv4
namename of the currencystring
minor_in_majorfor example there are 100 cents in 1 Euro -> minor_in_major = 100number
symbolsymbol of the currencystring

create currency

This endpoint is used to create new currencies.
Only superusers are allowed to use this endpoint. Regular users will receive a response with the status code 400.

Request:
POST /api/v1/currency

{
        "name": "euro",
        "minor_in_major": 100,
        "symbol": "€"
}
PropertyDescriptionType
namename of the currencystring
minor_in_majorfor example there are 100 cents in 1 Euro -> minor_in_major = 100number
symbolsymbol of the currencystring

modify currency

This endpoint is used to modify existing currencies.
You need to specify the id of the currency you want to modify in the request path.
Only superusers are allowed to use this endpoint. Regular users will receive a response with the status code 400.

Request:
PUT /api/v1/currency/{currency_id}

{
        "name": "euro",
        "minor_in_major": 100,
        "symbol": "€"
}
PropertyDescriptionType
namename of the currencystring
minor_in_majorfor example there are 100 cents in 1 Euro -> minor_in_major = 100number
symbolsymbol of the currencystring