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

Update the organisation settings

Admin only. Patches organisation, receipt, tax, or server fields and returns the saved row. An empty body is a no-op, but a bad base currency or a server with no address is refused.

PUT/api/v1/settings
Authorization
AuthorizationBearer token (JWT) · headerrequired

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

Request body
requiredapplication/json
namestring
min length 1 · max length 200
legal_namestring
max length 200
phonestring
max length 50
emailstring
max length 200
addressstring
max length 500
tinstring
max length 100
vat_numberstring
max length 100
nda_license_nostring
max length 100
premise_nostring
max length 100
receipt_headerstring
max length 500
receipt_footerstring
max length 500
return_policystring
max length 2000
show_vat_breakdownboolean
show_pharmacist_on_receiptboolean
default_low_stock_thresholdinteger
min 0 · max 100000
expiry_warning_daysstring
matches ^\s*\d+\s*(,\s*\d+\s*)*$
auto_print_receiptboolean
default_copiesinteger
min 1 · max 20
tax_enabledboolean
tax_ratenumber
min 0 · max 1
base_currencystring
matches ^[A-Z]{3}$
rate_staleness_daysinteger
min 1 · max 90
server_modestring
Allowed:hostedcustom
server_urlstring
max length 2000
Responses
200

The settings as saved

idstringrequired
namestringrequired
legal_namestringrequired
logo_keystringrequired
logo_urlstringrequired
phonestringrequired
emailstringrequired
addressstringrequired
tinstringrequired
vat_numberstringrequired
nda_license_nostringrequired
premise_nostringrequired
receipt_headerstringrequired
receipt_footerstringrequired
return_policystringrequired
show_vat_breakdownbooleanrequired
show_pharmacist_on_receiptbooleanrequired
default_low_stock_thresholdintegerrequired
min -9007199254740991 · max 9007199254740991
expiry_warning_daysstringrequired
auto_print_receiptbooleanrequired
default_copiesintegerrequired
min -9007199254740991 · max 9007199254740991
tax_enabledbooleanrequired
tax_ratenumberrequired
base_currencystringrequired
rate_staleness_daysintegerrequired
min -9007199254740991 · max 9007199254740991
server_modestringrequired
Allowed:hostedcustom
server_urlstringrequired
updated_bystring | nullrequired
updated_atstring | nullrequired
400

Invalid settings, unknown or inactive base currency, or a custom server without an address

detailstringrequired
401

Not authenticated

detailstringrequired
403

Caller is not an admin

detailstringrequired
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X PUT 'http://localhost:8000/api/v1/settings' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "legal_name": "string",
  "phone": "string",
  "email": "string",
  "address": "string",
  "tin": "string",
  "vat_number": "string",
  "nda_license_no": "string",
  "premise_no": "string",
  "receipt_header": "string",
  "receipt_footer": "string",
  "return_policy": "string",
  "show_vat_breakdown": true,
  "show_pharmacist_on_receipt": true,
  "default_low_stock_threshold": 0,
  "expiry_warning_days": "string",
  "auto_print_receipt": true,
  "default_copies": 1,
  "tax_enabled": true,
  "tax_rate": 0,
  "base_currency": "string",
  "rate_staleness_days": 1,
  "server_mode": "hosted",
  "server_url": "string"
}'
Response
{
  "id": "string",
  "name": "string",
  "legal_name": "string",
  "logo_key": "string",
  "logo_url": "string",
  "phone": "string",
  "email": "string",
  "address": "string",
  "tin": "string",
  "vat_number": "string",
  "nda_license_no": "string",
  "premise_no": "string",
  "receipt_header": "string",
  "receipt_footer": "string",
  "return_policy": "string",
  "show_vat_breakdown": true,
  "show_pharmacist_on_receipt": true,
  "default_low_stock_threshold": -9007199254740991,
  "expiry_warning_days": "string",
  "auto_print_receipt": true,
  "default_copies": -9007199254740991,
  "tax_enabled": true,
  "tax_rate": 0,
  "base_currency": "string",
  "rate_staleness_days": -9007199254740991,
  "server_mode": "hosted",
  "server_url": "string",
  "updated_by": "string",
  "updated_at": "string"
}