Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

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/currency
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Request body
requiredapplication/json
codestringrequired
matches ^[A-Z]{3}$
namestringrequired
min length 1 · max length 80
symbolstring
max length 8
exponentinteger
min 0 · max 4 · default: 2
Responses
201

Currency registered

codestringrequired
namestringrequired
symbolstringrequired
exponentintegerrequired
min -9007199254740991 · max 9007199254740991
is_activebooleanrequired
400

Code is not three letters, name is empty or too long, or exponent is outside 0 to 4

detailstringrequired
403

Caller is not an admin

detailstringrequired
409

A currency with that code already exists

detailstringrequired
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST 'http://localhost:8000/api/v1/currency' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "code": "string",
  "name": "string",
  "symbol": "string",
  "exponent": 2
}'
Response
{
  "code": "string",
  "name": "string",
  "symbol": "string",
  "exponent": -9007199254740991,
  "is_active": true
}