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

Read a sale

Any signed in user. Returns one sale with its items and the same money and identity fields. Reading another pharmacist’s sale or a manager another branch’s gets 404, disclosing nothing.

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

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

Path parameters
saleIdstringrequired

The sale id.

Responses
200

The sale and its items

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
itemsobject[]required
Show properties
Array of object
idstringrequired
sale_idstringrequired
medicine_idstringrequired
batch_idstringrequired
quantityintegerrequired
min -9007199254740991 · max 9007199254740991
unit_pricestringrequired
vat_ratestringrequired
vat_amountstringrequired
cost_at_salestringrequired
medicine_namestring | nullrequired
401

Not authenticated

detailstringrequired
404

Sale not found

detailstringrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET 'http://localhost:8000/api/v1/sales/string' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "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",
  "items": [
    {
      "id": "string",
      "sale_id": "string",
      "medicine_id": "string",
      "batch_id": "string",
      "quantity": -9007199254740991,
      "unit_price": "string",
      "vat_rate": "string",
      "vat_amount": "string",
      "cost_at_sale": "string",
      "medicine_name": "string"
    }
  ]
}