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
- Fetch Data: Pull inventory from Dutchie API
- Transform: Convert Dutchie format to ReUp format
- Match: Link products by SKU or fuzzy matching
- Compare: Detect changes from last sync
- Update: Write changes to database
- Notify: Push updates to connected clients
- 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
| Event | METRC Action |
|---|---|
| Receive inventory | Accept transfer |
| Adjust inventory | Package adjustment |
| Ship order | Create transfer |
| Audit correction | Adjustment 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 │
│ │ │ │
└─────────────────────────────────────────────────────────────────┘