---
search:
  tags:
    - Sync
    - GET
seo:
  description: >-
    Any signed in user. Returns the catalogue a till mirrors, with max_rev as
    the… Reference for the GET /api/v1/sync/snapshot endpoint in the PharmaFlow
    API.
sidebar:
  label: Snapshot the catalogue
  badge: GET
title: Snapshot the catalogue
type: openapi-operation
---
Any signed in user. Returns the catalogue a till mirrors, with max_rev as the pull cursor. An admin gets every branch and user, a branch caller only its own, and no password hash.

`GET /api/v1/sync/snapshot`

**Responses**

- `200` — The catalogue snapshot
- `401` — Not authenticated

Response example, 200:

```json
{
  "max_rev": -9007199254740991,
  "branches": [
    {
      "id": "string",
      "code": "string",
      "name": "string",
      "city": "string",
      "vat_number": "string",
      "address": "string",
      "image_url": "string",
      "is_active": -9007199254740991,
      "is_deleted": -9007199254740991,
      "created_at": "string",
      "updated_at": "string"
    }
  ],
  "medicines": [
    {
      "id": "string",
      "name": "string",
      "generic_name": "string",
      "barcode": "string",
      "category": "string",
      "form": "string",
      "strength": "string",
      "unit": "string",
      "selling_price": 0,
      "stock_quantity": 0,
      "low_stock_threshold": 0,
      "requires_prescription": -9007199254740991,
      "is_controlled": -9007199254740991,
      "control_schedule": "string",
      "vat_category": "string",
      "requires_cold_chain": -9007199254740991,
      "sfda_registration_no": "string",
      "max_public_price": 0,
      "image_key": "string",
      "image_url": "string",
      "is_active": -9007199254740991,
      "is_deleted": -9007199254740991,
      "created_at": "string",
      "updated_at": "string"
    }
  ],
  "suppliers": [
    {
      "id": "string",
      "name": "string",
      "tax_number": "string",
      "contact_person": "string",
      "phone": "string",
      "email": "string",
      "address": "string",
      "image_url": "string",
      "supplier_type": "string",
      "lead_time_days": 0,
      "reliability_score": 0,
      "is_active": -9007199254740991,
      "is_deleted": -9007199254740991,
      "created_at": "string",
      "updated_at": "string"
    }
  ],
  "coupons": [
    {
      "id": "string",
      "code": "string",
      "type": "string",
      "discount_type": "string",
      "discount_value": 0,
      "description": "string",
      "applies_to": "string",
      "applies_to_id": "string",
      "valid_from": "string",
      "valid_until": "string",
      "max_uses": 0,
      "image_url": "string",
      "usage_count": 0,
      "is_active": -9007199254740991,
      "is_deleted": -9007199254740991,
      "created_by": "string",
      "created_at": "string",
      "updated_at": "string"
    }
  ],
  "customers": [
    {
      "id": "string",
      "name": "string",
      "phone": "string",
      "national_id": "string",
      "notes": "string",
      "image_url": "string",
      "created_at": "string",
      "updated_at": "string",
      "is_credit_allowed": -9007199254740991,
      "credit_limit": 0,
      "current_balance": 0,
      "is_deleted": -9007199254740991
    }
  ],
  "users": [
    {
      "id": "string",
      "branch_id": "string",
      "email": "string",
      "full_name": "string",
      "phone": "string",
      "role": "string",
      "is_active": -9007199254740991,
      "is_deleted": -9007199254740991,
      "last_login_at": "string",
      "created_at": "string",
      "updated_at": "string"
    }
  ],
  "batches": [
    {
      "id": "string",
      "medicine_id": "string",
      "branch_id": "string",
      "supplier_id": "string",
      "batch_number": "string",
      "expiry_date": "string",
      "manufacturing_date": "string",
      "qty_received": 0,
      "qty_remaining": 0,
      "unit_cost": 0,
      "status": "string",
      "sfda_status": "string",
      "is_deleted": -9007199254740991,
      "created_at": "string"
    }
  ],
  "categories": [
    {
      "slug": "string",
      "name": "string",
      "created_at": "string"
    }
  ]
}
```
