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

Update a customer

Any signed in user. Patches a customer’s name, phone, national id, notes, or credit fields. An empty patch is refused with 400 and an unknown customer with 404; money stays strings.

PUT/api/v1/customers/{customerId}
Authorization
AuthorizationBearer token (JWT) · headerrequired

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

Path parameters
customerIdstringrequired

The customer id.

Request body
requiredapplication/json
namestring | null
phonestring | null
national_idstring | null
notesstring | null
credit_limitnumber | null
Show properties
Any of:
number
number
null
null
is_credit_allowedboolean | null
Responses
200

Customer updated

idstringrequired
namestringrequired
phonestringrequired
national_idstringrequired
notesstringrequired
image_urlstringrequired
credit_limitstringrequired
current_balancestringrequired
is_credit_allowedbooleanrequired
created_atstringrequired
updated_atstringrequired
is_deletedbooleanrequired
400

No fields to update, or a field fails validation

detailstringrequired
401

Not authenticated

detailstringrequired
404

Customer not found

detailstringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X PUT 'http://localhost:8000/api/v1/customers/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "phone": "string",
  "national_id": "string",
  "notes": "string",
  "credit_limit": 0,
  "is_credit_allowed": true
}'
Response
{
  "id": "string",
  "name": "string",
  "phone": "string",
  "national_id": "string",
  "notes": "string",
  "image_url": "string",
  "credit_limit": "string",
  "current_balance": "string",
  "is_credit_allowed": true,
  "created_at": "string",
  "updated_at": "string",
  "is_deleted": true
}