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

Update a currency

Admin only. Patches the name, symbol, exponent, or active flag. Deactivation is refused for the base currency and for one an active branch still trades in.

PATCH/api/v1/currency/{code}
Authorization
AuthorizationBearer token (JWT) · headerrequired

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

Path parameters
codestringrequired

Three letter code, matched case insensitively.

Request body
requiredapplication/json
namestring
min length 1 · max length 80
symbolstring
max length 8
exponentinteger
min 0 · max 4
is_activeboolean
Responses
200

Currency updated

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

No field to update, or the deactivation is refused because the currency is the base currency or still in use by an active branch

detailstringrequired
403

Caller is not an admin

detailstringrequired
404

No currency with that code

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