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

List sales

Any signed in user. Returns a page of sales, newest first, with branch and receipt identity. A pharmacist sees only their sales, a manager or cashier only their branch, whatever is asked.

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

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

Query parameters
branch_idstring

Restrict to one branch. Ignored for a branch manager or cashier, who stay on their own.

user_idstring

Restrict to one cashier. Ignored for a pharmacist, who stays on their own sales.

payment_methodstring

cash, card, mobile_money, transfer, insurance, or credit.

customer_idstring

Restrict to one customer.

searchstring

Match the invoice number, the sale's customer, or the customer's name, phone, or id.

from_datestring

Earliest sale date, as YYYY-MM-DD.

to_datestring

Latest sale date, as YYYY-MM-DD, inclusive of that whole day.

pageinteger

One based page number. Defaults to 1.

page_sizeinteger

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

Responses
200

A page of sales

totalintegerrequired
min -9007199254740991 · max 9007199254740991
pageintegerrequired
min -9007199254740991 · max 9007199254740991
page_sizeintegerrequired
min -9007199254740991 · max 9007199254740991
itemsobject[]required
Show properties
Array of object
idstringrequired
branch_idstringrequired
user_idstringrequired
invoice_numberstringrequired
uuidstringrequired
icvintegerrequired
min -9007199254740991 · max 9007199254740991
client_mutation_idstringrequired
payload_hashstringrequired
device_idstring | nullrequired
sync_statusstringrequired
subtotal_amountstringrequired
vat_amountstringrequired
total_amountstringrequired
currency_codestringrequired
fx_rate_to_basestringrequired
base_currency_codestringrequired
base_total_amountstringrequired
vat_breakdownobject[]required
Show properties
Array of object
ratenumberrequired
taxable_amountnumberrequired
vat_amountnumberrequired
payment_methodstringrequired
payment_linesobject[] | nullrequired
Show properties
Any of:
object[]
Array of object
methodstringrequired
amountnumber
null
null
notesstringrequired
session_idstring | nullrequired
customer_idstring | nullrequired
customer_namestringrequired
coupon_idstring | nullrequired
global_discountstringrequired
coupon_discountstringrequired
zatca_statusstringrequired
zatca_xmlstring | nullrequired
zatca_hashstringrequired
is_deletedintegerrequired
min -9007199254740991 · max 9007199254740991
sold_atstringrequired
pharmacist_namestring | nullrequired
customer_display_namestringrequired
branch_namestring | nullrequired
branch_addressstring | nullrequired
branch_vat_numberstring | nullrequired
organization_namestringrequired
organization_legal_namestringrequired
organization_phonestringrequired
organization_emailstringrequired
organization_addressstringrequired
organization_tinstringrequired
organization_vat_numberstringrequired
receipt_headerstringrequired
receipt_footerstringrequired
return_policystringrequired
has_returnbooleanrequired
401

Not authenticated

detailstringrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET 'http://localhost:8000/api/v1/sales' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "total": -9007199254740991,
  "page": -9007199254740991,
  "page_size": -9007199254740991,
  "items": [
    {
      "id": "string",
      "branch_id": "string",
      "user_id": "string",
      "invoice_number": "string",
      "uuid": "string",
      "icv": -9007199254740991,
      "client_mutation_id": "string",
      "payload_hash": "string",
      "device_id": "string",
      "sync_status": "string",
      "subtotal_amount": "string",
      "vat_amount": "string",
      "total_amount": "string",
      "currency_code": "string",
      "fx_rate_to_base": "string",
      "base_currency_code": "string",
      "base_total_amount": "string",
      "vat_breakdown": [
        {
          "rate": 0,
          "taxable_amount": 0,
          "vat_amount": 0
        }
      ],
      "payment_method": "string",
      "payment_lines": [
        {
          "method": "string",
          "amount": 0
        }
      ],
      "notes": "string",
      "session_id": "string",
      "customer_id": "string",
      "customer_name": "string",
      "coupon_id": "string",
      "global_discount": "string",
      "coupon_discount": "string",
      "zatca_status": "string",
      "zatca_xml": "string",
      "zatca_hash": "string",
      "is_deleted": -9007199254740991,
      "sold_at": "string",
      "pharmacist_name": "string",
      "customer_display_name": "string",
      "branch_name": "string",
      "branch_address": "string",
      "branch_vat_number": "string",
      "organization_name": "string",
      "organization_legal_name": "string",
      "organization_phone": "string",
      "organization_email": "string",
      "organization_address": "string",
      "organization_tin": "string",
      "organization_vat_number": "string",
      "receipt_header": "string",
      "receipt_footer": "string",
      "return_policy": "string",
      "has_return": true
    }
  ]
}