The currencies module serves currencies, exchange rates with conversion and a central bank sync, and payment terms. The currency router lives in src/cluster_erp/server/routes/currencies.py and is mounted by this module. All 20 endpoints sit under /api/v1/currencies. For business meaning see the Currencies module page.
Group facts¶
| Item | Value | Source |
|---|---|---|
| Base path | /api/v1/currencies |
src/cluster_erp/core/module_base.py:37-38, src/cluster_erp/modules/currencies/module.py:78 |
| Routers | 3 router objects in 3 files; listed in the section Endpoint summary | src/cluster_erp/modules/currencies/module.py:64 |
| Endpoints | 20, counted from the route decorators and add_api_route calls of the routers that register_routes mounts |
src/cluster_erp/modules/currencies/exchange_rates/routes.py, src/cluster_erp/modules/currencies/payment_terms/routes.py, src/cluster_erp/server/routes/currencies.py |
| Authentication | Bearer header or session cookie, resolved by get_current_user; see Authentication and headers |
src/cluster_erp/modules/auth/guards.py:85-167 |
| Permission guard | 20 of 20 routes declare require_permission |
src/cluster_erp/modules/auth/guards.py:205-240 |
| App entitlement gate | require_app("currencies") on every mounted router |
src/cluster_erp/modules/currencies/module.py:82 |
| Error format | JSON body {"error": {...}}; see Errors |
src/cluster_erp/server/error_handler.py:33-46 |
Endpoint summary¶
One row per sub-module folder. The router prefix is added to the base path.
| Sub-module | Routers | Endpoints | Router source |
|---|---|---|---|
currencies |
router |
7 | src/cluster_erp/server/routes/currencies.py:18 |
exchange_rates |
router (/exchange-rates) |
8 | src/cluster_erp/modules/currencies/exchange_rates/routes.py:29 |
payment_terms |
router (/payment-terms) |
5 | src/cluster_erp/modules/currencies/payment_terms/routes.py:21 |
Currencies endpoints¶
Currency records, an update from the internet, and a seed action. The router has no prefix, so its paths sit directly under the module base path.
| Method | Path | Handler | Permission | Request | Query | Response | Status | Source |
|---|---|---|---|---|---|---|---|---|
GET |
/api/v1/currencies/ |
list_currencies |
currency.read |
none | active_only, search |
list[CurrencyRead] |
200 (default) | src/cluster_erp/server/routes/currencies.py:21 |
POST |
/api/v1/currencies/update-from-internet |
update_currencies_from_internet |
currency.create |
none | none | dict |
200 (default) | src/cluster_erp/server/routes/currencies.py:33 |
POST |
/api/v1/currencies/ |
create_currency |
currency.create |
CurrencyCreate |
none | CurrencyRead |
201 |
src/cluster_erp/server/routes/currencies.py:43 |
GET |
/api/v1/currencies/{currency_id} |
get_currency |
currency.read |
none | none | CurrencyRead |
200 (default) | src/cluster_erp/server/routes/currencies.py:54 |
PUT |
/api/v1/currencies/{currency_id} |
update_currency |
currency.update |
CurrencyUpdate |
none | CurrencyRead |
200 (default) | src/cluster_erp/server/routes/currencies.py:67 |
DELETE |
/api/v1/currencies/{currency_id} |
delete_currency |
currency.delete |
none | none | none | 204 |
src/cluster_erp/server/routes/currencies.py:81 |
POST |
/api/v1/currencies/seed |
seed_currencies |
currency.seed |
none | none | dict |
200 (default) | src/cluster_erp/server/routes/currencies.py:92 |
Exchange rates endpoints¶
Exchange rate records, a conversion read, and a central bank sync.
| Method | Path | Handler | Permission | Request | Query | Response | Status | Source |
|---|---|---|---|---|---|---|---|---|
GET |
/api/v1/currencies/exchange-rates/ |
list_exchange_rates |
exchange_rate.read |
none | base_currency, target_currency, date_from, date_to, search, limit |
list[ExchangeRateRead] |
200 (default) | src/cluster_erp/modules/currencies/exchange_rates/routes.py:32 |
POST |
/api/v1/currencies/exchange-rates/ |
create_exchange_rate |
exchange_rate.create |
ExchangeRateCreate |
none | ExchangeRateRead |
201 |
src/cluster_erp/modules/currencies/exchange_rates/routes.py:55 |
GET |
/api/v1/currencies/exchange-rates/convert |
convert_currency |
exchange_rate.read |
none | from_currency, to_currency, amount, rate_date |
ConvertResult |
200 (default) | src/cluster_erp/modules/currencies/exchange_rates/routes.py:66 |
GET |
/api/v1/currencies/exchange-rates/{rate_id} |
get_exchange_rate |
exchange_rate.read |
none | none | ExchangeRateRead |
200 (default) | src/cluster_erp/modules/currencies/exchange_rates/routes.py:82 |
PUT |
/api/v1/currencies/exchange-rates/{rate_id} |
update_exchange_rate |
exchange_rate.update |
ExchangeRateUpdate |
none | ExchangeRateRead |
200 (default) | src/cluster_erp/modules/currencies/exchange_rates/routes.py:95 |
DELETE |
/api/v1/currencies/exchange-rates/{rate_id} |
delete_exchange_rate |
exchange_rate.delete |
none | none | none | 204 |
src/cluster_erp/modules/currencies/exchange_rates/routes.py:109 |
POST |
/api/v1/currencies/exchange-rates/bulk-delete |
bulk_delete_exchange_rates |
exchange_rate.delete |
BulkDeleteRequest |
none | BulkDeleteResponse |
200 (default) | src/cluster_erp/modules/currencies/exchange_rates/routes.py:120 |
POST |
/api/v1/currencies/exchange-rates/sync-tcmb |
sync_tcmb |
exchange_rate.sync |
none | none | dict |
200 (default) | src/cluster_erp/modules/currencies/exchange_rates/routes.py:131 |
Payment terms endpoints¶
Payment term records.
| Method | Path | Handler | Permission | Request | Query | Response | Status | Source |
|---|---|---|---|---|---|---|---|---|
GET |
/api/v1/currencies/payment-terms/ |
list_payment_terms |
payment_term.read |
none | active_only, search |
dict |
200 (default) | src/cluster_erp/modules/currencies/payment_terms/routes.py:24 |
GET |
/api/v1/currencies/payment-terms/{term_id} |
get_payment_term |
payment_term.read |
none | none | PaymentTermRead |
200 (default) | src/cluster_erp/modules/currencies/payment_terms/routes.py:39 |
POST |
/api/v1/currencies/payment-terms/ |
create_payment_term |
payment_term.create |
PaymentTermCreate |
none | PaymentTermRead |
201 |
src/cluster_erp/modules/currencies/payment_terms/routes.py:54 |
PUT |
/api/v1/currencies/payment-terms/{term_id} |
update_payment_term |
payment_term.update |
PaymentTermUpdate |
none | PaymentTermRead |
200 (default) | src/cluster_erp/modules/currencies/payment_terms/routes.py:66 |
DELETE |
/api/v1/currencies/payment-terms/{term_id} |
delete_payment_term |
payment_term.delete |
none | none | none | 204 |
src/cluster_erp/modules/currencies/payment_terms/routes.py:79 |
Error codes¶
The table lists the error codes that code under src/cluster_erp/modules/currencies/ raises, found by a syntax-tree scan for AppError(...), the factories in src/cluster_erp/core/errors.py (not_found, conflict, protected, permission_denied, privilege_escalation, check_version), and HTTPException(...). A status of 400 is the AppError default (src/cluster_erp/core/errors.py:23). Guard errors (401, 403), the entitlement codes, and validation errors (422) apply to every route and are listed on Errors.
The currency router in src/cluster_erp/server/routes/currencies.py is included in the scan.
| Code | HTTP status | Raised in | First site |
|---|---|---|---|
CONCURRENCY_VERSION_CONFLICT |
409 |
payment_terms |
src/cluster_erp/modules/currencies/payment_terms/services.py:480 |
RESOURCE_CONFLICT |
409 |
payment_terms |
src/cluster_erp/modules/currencies/payment_terms/services.py:455 |
RESOURCE_NOT_FOUND |
404 |
`,exchange_rates,payment_terms` |
src/cluster_erp/modules/currencies/exchange_rates/routes.py:78 |
Events emitted¶
The table lists the contract classes that code under src/cluster_erp/modules/currencies/ passes directly to EventBus.emit, found by a syntax-tree scan. Events built in a variable first are not counted. The contracts are described in Contracts reference.
None found by the scan.
Related pages¶
Verified against commit 92f8051 on 2026-11-13.