Create a currency
Admin only. Registers a currency so a branch can trade in it without a deploy. The code is any three letters, not an ISO membership test, because operators trade in local codes.
POST
/api/v1/currencyAuthorization
AuthorizationBearer token (JWT) · headerrequiredJWT from POST /api/v1/auth/login sent as Authorization Bearer.
Request body
requiredapplication/jsoncodestringrequiredmatches ^[A-Z]{3}$
namestringrequiredmin length 1 · max length 80
symbolstringmax length 8
exponentintegermin 0 · max 4 · default: 2
Responses
201
Currency registered
codestringrequirednamestringrequiredsymbolstringrequiredexponentintegerrequiredmin -9007199254740991 · max 9007199254740991
is_activebooleanrequired400
Code is not three letters, name is empty or too long, or exponent is outside 0 to 4
detailstringrequired403
Caller is not an admin
detailstringrequired409
A currency with that code already exists
detailstringrequired