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

List customers

Any signed in user. Returns a page of customers ordered by name together with the total. search matches a name or phone substring or a national id exactly, with page and page_size.

GET/api/v1/customers
Authorization
AuthorizationBearer token (JWT) · headerrequired

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

Query parameters
searchstring

Substring of a name or phone, or a whole national id. Empty returns every customer.

pageinteger

Page number, 1 based. Defaults to 1.

page_sizeinteger

Rows per page, capped at 200. Defaults to 20.

Responses
200

A page of customers

totalintegerrequired
min -9007199254740991 · max 9007199254740991
pageintegerrequired
min -9007199254740991 · max 9007199254740991
page_sizeintegerrequired
min -9007199254740991 · max 9007199254740991
itemsobject[]required
Show properties
Array of object
idstringrequired
namestringrequired
phonestringrequired
national_idstringrequired
notesstringrequired
image_urlstringrequired
credit_limitstringrequired
current_balancestringrequired
is_credit_allowedbooleanrequired
created_atstringrequired
updated_atstringrequired
is_deletedbooleanrequired
401

Not authenticated

detailstringrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET 'http://localhost:8000/api/v1/customers' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "total": -9007199254740991,
  "page": -9007199254740991,
  "page_size": -9007199254740991,
  "items": [
    {
      "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
    }
  ]
}