Complete Integration Flow

End-to-end flow from menu sync to order completion:

┌─────────────────────────────────────────────────────────────────┐
│                        INTEGRATION FLOW                         │
└─────────────────────────────────────────────────────────────────┘

1. SETUP & AUTHENTICATION

   ├─► Generate JWT Token
   ├─► Configure HMAC Signature
   └─► Test Connection
   
2. MENU SYNCHRONIZATION

   ├─► POST /posnext/menus
   ├─► Parse Menu Data
   ├─► Store Products, Prices, Modifiers
   └─► Update UI

3. ORDER VALIDATION (Before Payment)

   ├─► Customer Adds Items to Cart
   ├─► POST /posnext/orders/validate
   ├─► Handle Response (200 or 202)
   └─► Display Validated Cart

4. PAYMENT PROCESSING

   ├─► Customer Confirms Order
   ├─► Process Payment
   └─► Wait for Payment Success

5. ORDER SUBMISSION (After Payment)

   ├─► POST /posnext/orders/submit
   ├─► Handle Response (200 or 202)
   ├─► Store Order Reference
   └─► Send Confirmation to Customer

6. ORDER TRACKING

   ├─► Poll Order Status
   ├─► Update Customer on Progress
   └─► Mark Complete

┌─────────────────────────────────────────────────────────────────┐
│                      ORDER COMPLETE                             │
└─────────────────────────────────────────────────────────────────┘

Quick Start

Follow these steps to get started.

Step 1: Get API Credentials

Contact PAR support to obtain:

  • Client ID - Your unique identifier
  • Client Secret - Used to generate JWT tokens
  • API Base URL - Environment-specific endpoint
  • Organization ID - Your PAR organization identifier
  • Location ID(s) - PAR location identifiers

Step 2: Set Up Authentication

Generate JWT token and add HMAC signature to requests:

Example: Generate HMAC Signature

const crypto = require('crypto');

function generateHMAC(payload, secret) {
  const hmac = crypto.createHmac('sha256', secret);
  hmac.update(JSON.stringify(payload));
  return hmac.digest('hex');
}

// Usage
const payload = {
  location_id: "loc-001",
  organization_id: "org-123"
};
const signature = generateHMAC(payload, 'your-client-secret');

Step 3: Sync Menu Data

Retrieve menu information from PAR:

Menu Response Structure:

{
  "location_id": "loc-001",
  "menus": [
    {
      "id": "menu-001",
      "name": "Lunch Menu",
      "products": [
        {
          "id": "prod-001",
          "name": "Classic Burger",
          "price": 12.99,
          "state": "available"
        }
      ]
    }
  ]
}

Step 4: Validate Orders

Before payment, validate the order:

Validation Response:

{
  "status": "validated",
  "location_id": "loc-001",
  "order_details": {
    "subtotal": 1299,
    "tax": 104,
    "total": 1403
  }
}

Step 5: Submit Orders

After payment succeeds, submit the order.