Create currency
Handler: CreateNewCurrency. Requires RBAC PermCreate on currencies record type. Returns created models.Currency. NOTE: duplicate name (DB unique on name) currently returns 500, not 409.
Authorization
bearerAuth In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
models.CreateCurrencyInput. Handler does not enforce JSON required fields; DB/GORM constraints apply (name unique).
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/currencies" \ -H "Content-Type: application/json" \ -d '{}'{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"code": "string",
"numeric_code": "string",
"name": "string",
"description": "string",
"symbol": "string",
"decimal_places": 0,
"precision": 0,
"rounding": "up",
"is_fiat": true,
"is_base": true,
"format": "string",
"display_priority": 0,
"icon_url": "string",
"active": true,
"metadata": {},
"created_at": "2019-08-24T14:15:22Z",
"created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
"modified_at": "2019-08-24T14:15:22Z",
"modified_by": "e8d4374d-93a1-4e98-a6c6-fdcf00c5059f"
}{
"status": 400,
"message": "Invalid input"
}{
"status": 401,
"message": "Unauthorized"
}{
"status": 403,
"message": "Forbidden"
}{
"status": 500,
"message": "server_error"
}Handler: DeleteCurrencyByID. Requires RBAC PermDelete. Physically removes the row (hard delete, not a deactivation). Success: apireply.Ok200 -> StdResponse { status, message }. To take a currency out of use while keeping it, set active=false via PUT instead.
Handler: UpdateCurrencyByID. Requires RBAC PermUpdate. Full replace via models.UpdateCurrencyInput fields present in JSON (commonutil.Populate). Returns updated models.Currency.