Skip to main content

Data Flow

How data moves through the ReUp platform.

Inventory Data Flow

Dutchie → ReUp Sync

┌─────────────────────────────────────────────────────────────────┐
│ INVENTORY SYNC FLOW │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Dutchie POS │
│ │ │
│ │ 1. Webhook or Poll │
│ ▼ │
│ ┌────────────────┐ │
│ │ Sync Service │◄─── Schedule: Every 15 min (configurable) │
│ └───────┬────────┘ │
│ │ │
│ │ 2. Transform & Validate │
│ ▼ │
│ ┌────────────────┐ │
│ │ Product Match │◄─── Match by SKU/UPC/Name │
│ └───────┬────────┘ │
│ │ │
│ │ 3. Update Database │
│ ▼ │
│ ┌────────────────┐ │
│ │ Database │ │
│ └───────┬────────┘ │
│ │ │
│ │ 4. Publish Event │
│ ▼ │
│ ┌────────────────┐ │
│ │ Event Queue │──────► WebSocket to Frontend │
│ └────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘

Sync Steps

  1. Fetch Data: Pull inventory from Dutchie API
  2. Transform: Convert Dutchie format to ReUp format
  3. Match: Link products by SKU or fuzzy matching
  4. Compare: Detect changes from last sync
  5. Update: Write changes to database
  6. Notify: Push updates to connected clients
  7. Log: Record sync in audit trail

Order Data Flow

Order Lifecycle

┌─────────────────────────────────────────────────────────────────┐
│ ORDER LIFECYCLE │
├─────────────────────────────────────────────────────────────────┤
│ │
│ RETAILER WHOLESALER │
│ │ │ │
│ │ 1. Create Order │ │
│ ▼ │ │
│ ┌────────┐ │ │
│ │ DRAFT │ │ │
│ └───┬────┘ │ │
│ │ │ │
│ │ 2. Submit │ │
│ ▼ │ │
│ ┌─────────┐ notification ┌─────▼─────┐ │
│ │ PENDING │──────────────►│ REVIEW │ │
│ └─────────┘ └─────┬─────┘ │
│ │ │
│ │ 3. Accept/Reject │
│ ▼ │
│ ┌────────────┐ │
│ │ ACCEPTED │ │
│ └─────┬──────┘ │
│ │ │
│ │ 4. Prepare │
│ ▼ │
│ ┌────────────┐ │
│ │ PREPARING │ │
│ └─────┬──────┘ │
│ │ │
│ │ 5. Ship │
│ ▼ │
│ ┌─────────┐ tracking ┌────────────┐ │
│ │ TRACK │◄─────────────│ SHIPPED │ │
│ └─────────┘ └─────┬──────┘ │
│ │ │
│ │ 6. Deliver │
│ ▼ │
│ ┌─────────┐ confirmation ┌────────────┐ │
│ │ CONFIRM │◄─────────────│ DELIVERED │ │
│ └─────────┘ └────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘

Compliance Data Flow

METRC Reporting

ReUp Action → Generate Manifest → Submit to METRC → Store Response
│ │
│ ▼
│ Error Handling
│ │
│ Retry Queue

Audit Trail

Reportable Events

EventMETRC Action
Receive inventoryAccept transfer
Adjust inventoryPackage adjustment
Ship orderCreate transfer
Audit correctionAdjustment with reason

Authentication Flow

┌─────────────────────────────────────────────────────────────────┐
│ AUTHENTICATION FLOW │
├─────────────────────────────────────────────────────────────────┤
│ │
│ User Server │
│ │ │ │
│ │ 1. Login (email/password) │ │
│ ├───────────────────────────►│ │
│ │ │ │
│ │ 2. MFA Required │ │
│ │◄───────────────────────────┤ │
│ │ │ │
│ │ 3. MFA Code │ │
│ ├───────────────────────────►│ │
│ │ │ │
│ │ 4. Access + Refresh │ │
│ │◄───────────────────────────┤ │
│ │ │ │
│ │ 5. API Request + Token │ │
│ ├───────────────────────────►│──► Validate Token │
│ │ │ │
│ │ 6. Response │ │
│ │◄───────────────────────────┤ │
│ │ │ │
│ │ 7. Token Expired │ │
│ │◄───────────────────────────┤ │
│ │ │ │
│ │ 8. Refresh Token │ │
│ ├───────────────────────────►│──► Issue New Access Token │
│ │ │ │
└─────────────────────────────────────────────────────────────────┘