> ## Documentation Index
> Fetch the complete documentation index at: https://dkkangoyazlmteknolojiticareta.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration Checklist

> Complete checklist for successful integration

## Pre-Integration

<AccordionGroup>
  <Accordion title="✅ Obtain Credentials">
    <Steps>
      <Step>Contact Dükkango to request API access</Step>
      <Step>Receive `app_secret_key`</Step>
      <Step>Receive `rest_secret_key` for your restaurant(s)</Step>
      <Step>Store credentials securely (environment variables)</Step>
    </Steps>

    **Test:**

    ```bash theme={null}
    curl -X POST https://www.xn--dkkango-n2a.com/api/integrations/auth/login \
      -H 'Content-Type: application/json' \
      -d '{"app_secret_key": "your-key", "rest_secret_key": "your-key"}'
    ```
  </Accordion>

  <Accordion title="✅ Setup Development Environment">
    * [ ] HTTPS-enabled server
    * [ ] Node.js/Python/PHP environment
    * [ ] Database for local order storage
    * [ ] Logging system
    * [ ] Error tracking (optional but recommended)
  </Accordion>

  <Accordion title="✅ Review Documentation">
    * [ ] Read [Quick Start](/quickstart)
    * [ ] Understand [Authentication](/authentication)
    * [ ] Study [Order Lifecycle](/guides/order-lifecycle)
    * [ ] Review all [API endpoints](/api-reference/overview)
  </Accordion>
</AccordionGroup>

## Authentication Implementation

<Steps>
  <Step title="Implement Login">
    ```javascript theme={null}
    async function login(appSecret, restSecret) {
      const response = await fetch(
        'https://www.xn--dkkango-n2a.com/api/integrations/auth/login',
        {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify({
            app_secret_key: appSecret,
            rest_secret_key: restSecret
          })
        }
      );
      
      const data = await response.json();
      return data.data;
    }
    ```

    * [ ] Login endpoint implemented
    * [ ] Credentials stored securely
    * [ ] Access token received successfully
  </Step>

  <Step title="Implement Token Storage">
    ```javascript theme={null}
    class TokenManager {
      storeToken(accessToken, expirationDate) {
        localStorage.setItem('access_token', accessToken);
        localStorage.setItem('token_expiry', expirationDate);
      }
      
      getToken() {
        return localStorage.getItem('access_token');
      }
    }
    ```

    * [ ] Token storage implemented
    * [ ] Expiration date tracked
  </Step>

  <Step title="Implement Token Refresh">
    ```javascript theme={null}
    async function ensureValidToken() {
      const expiry = new Date(localStorage.getItem('token_expiry'));
      const now = new Date();
      
      // Refresh if expired or expiring soon (1 hour buffer)
      if (now > expiry - 3600000) {
        const { access_token, expiration_date } = await login();
        storeToken(access_token, expiration_date);
      }
    }
    ```

    * [ ] Token refresh logic implemented
    * [ ] Proactive refresh (before expiration)
    * [ ] Handles 401 errors
  </Step>
</Steps>

## Restaurant Management

<AccordionGroup>
  <Accordion title="✅ Implement Restaurant Endpoints">
    * [ ] GET `/restaurants/get` - Fetch restaurant list
    * [ ] GET `/restaurants/status/get/{rest_id}` - Check status
    * [ ] PUT `/restaurants/status/open/{rest_id}` - Open restaurant
    * [ ] PUT `/restaurants/status/close/{rest_id}` - Close restaurant

    **Test each endpoint:**

    ```bash theme={null}
    # Get restaurants
    curl -X GET https://www.xn--dkkango-n2a.com/api/integrations/restaurants/get \
      -H 'Access-Token: your-token'

    # Check status
    curl -X GET https://www.xn--dkkango-n2a.com/api/integrations/restaurants/status/get/{rest_id} \
      -H 'Access-Token: your-token'

    # Open restaurant
    curl -X PUT https://www.xn--dkkango-n2a.com/api/integrations/restaurants/status/open/{rest_id} \
      -H 'Access-Token: your-token'

    # Close restaurant
    curl -X PUT https://www.xn--dkkango-n2a.com/api/integrations/restaurants/status/close/{rest_id} \
      -H 'Access-Token: your-token'
    ```
  </Accordion>

  <Accordion title="✅ UI Integration">
    * [ ] Display restaurant status in POS
    * [ ] Open/close buttons functional
    * [ ] Status syncs with API
    * [ ] Visual indicators (green=open, red=closed)
  </Accordion>
</AccordionGroup>

## Menu Management

<AccordionGroup>
  <Accordion title="✅ Implement Food Endpoints">
    * [ ] GET `/foods/get-foods` - Fetch menu (with rate limit handling)
    * [ ] PUT `/foods/status-active/{food_id}` - Activate item
    * [ ] PUT `/foods/status-passive/{food_id}` - Deactivate item

    **Test:**

    ```bash theme={null}
    # Get menu
    curl -X GET https://www.xn--dkkango-n2a.com/api/integrations/foods/get-foods \
      -H 'Access-Token: your-token'

    # Activate item
    curl -X PUT https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/1 \
      -H 'Access-Token: your-token'

    # Deactivate item
    curl -X PUT https://www.xn--dkkango-n2a.com/api/integrations/foods/status-passive/1 \
      -H 'Access-Token: your-token'
    ```
  </Accordion>

  <Accordion title="✅ Menu Caching">
    * [ ] Menu data cached locally
    * [ ] Cache duration: 30+ minutes
    * [ ] Manual refresh option for staff
    * [ ] Respects 30-second rate limit
  </Accordion>

  <Accordion title="✅ Modifier Handling">
    * [ ] Parse `add_substract` modifier groups
    * [ ] Display modifiers in POS
    * [ ] Calculate prices including modifiers
    * [ ] Match modifiers in incoming orders
  </Accordion>
</AccordionGroup>

## Order Management

<AccordionGroup>
  <Accordion title="✅ Order Polling">
    * [ ] GET `/orders/get-current` implemented
    * [ ] Polling interval: 30+ seconds
    * [ ] Rate limit (429) handled
    * [ ] Polls continuously while POS is running

    ```javascript theme={null}
    setInterval(async () => {
      try {
        const orders = await getOrders();
        for (const order of orders) {
          await processOrder(order);
        }
      } catch (error) {
        handleError(error);
      }
    }, 30000); // 30 seconds
    ```
  </Accordion>

  <Accordion title="✅ Order Acknowledgment">
    * [ ] PUT `/orders/success/{payment_key}` implemented
    * [ ] Called immediately after importing order
    * [ ] Uses `payment_key` (UUID), not `id` (integer)
    * [ ] Prevents duplicate orders
  </Accordion>

  <Accordion title="✅ Order Acceptance">
    * [ ] PUT `/orders/accept/{payment_key}` implemented
    * [ ] Includes `preparing_time` parameter
    * [ ] Staff can set preparation time
    * [ ] Updates order status to CONFIRMED
  </Accordion>

  <Accordion title="✅ Order Dispatch">
    * [ ] PUT `/orders/ontheway/{payment_key}` implemented
    * [ ] Only for restaurant couriers
    * [ ] Checks `courier_type` before calling
    * [ ] Updates order status to IN\_DELIVERY
  </Accordion>

  <Accordion title="✅ Order Completion">
    * [ ] PUT `/orders/complete/{payment_key}` implemented
    * [ ] Confirms delivery and payment
    * [ ] Works for all payment types
    * [ ] Updates order status to COMPLETE\_WITH\_PAYMENT
  </Accordion>

  <Accordion title="✅ Order Cancellation">
    * [ ] GET `/orders/cancel-reasons` implemented
    * [ ] PUT `/orders/cancel/{payment_key}` implemented
    * [ ] Staff can select cancellation reason
    * [ ] Includes `reason_id` (1-8)
    * [ ] Updates order status to CANCELED
  </Accordion>

  <Accordion title="✅ Order Variables">
    * [ ] GET `/orders/variables` implemented
    * [ ] Payment methods cached
    * [ ] Shipping methods cached
    * [ ] Used for display mapping
  </Accordion>
</AccordionGroup>

## Data Handling

<AccordionGroup>
  <Accordion title="✅ Order Storage">
    * [ ] Orders saved to local database
    * [ ] All order fields stored correctly
    * [ ] Customer information stored
    * [ ] Order items with modifiers stored
    * [ ] Order history maintained
  </Accordion>

  <Accordion title="✅ Data Validation">
    * [ ] Validate order structure
    * [ ] Check required fields
    * [ ] Validate UUIDs
    * [ ] Verify payment methods
    * [ ] Confirm shipping methods
  </Accordion>

  <Accordion title="✅ Modifier Processing">
    * [ ] Parse nested modifier structure
    * [ ] Extract modifier group names
    * [ ] Extract ingredient names and prices
    * [ ] Calculate total with modifiers
    * [ ] Display modifiers to kitchen staff
  </Accordion>
</AccordionGroup>

## Error Handling

<AccordionGroup>
  <Accordion title="✅ Implement Error Handling">
    * [ ] Try-catch around all API calls
    * [ ] Parse error responses
    * [ ] Handle 401 (authentication)
    * [ ] Handle 403 (forbidden)
    * [ ] Handle 404 (not found)
    * [ ] Handle 422 (validation)
    * [ ] Handle 429 (rate limit)
    * [ ] Handle 500 (server error)
    * [ ] Network error handling
  </Accordion>

  <Accordion title="✅ Retry Logic">
    * [ ] Retry on 429 (after 30s wait)
    * [ ] Retry on 500 (with exponential backoff)
    * [ ] Maximum retry attempts (3)
    * [ ] Don't retry on 400/403/404
  </Accordion>

  <Accordion title="✅ Error Logging">
    * [ ] Log all errors with context
    * [ ] Include timestamps
    * [ ] Include request details
    * [ ] Store locally for debugging
    * [ ] Send to monitoring service (optional)
  </Accordion>
</AccordionGroup>

## User Interface

<AccordionGroup>
  <Accordion title="✅ Order Display">
    * [ ] New orders highlighted
    * [ ] Order details clearly displayed
    * [ ] Customer information visible
    * [ ] Delivery address shown
    * [ ] Order items with modifiers listed
    * [ ] Total amount displayed
    * [ ] Order status visible
  </Accordion>

  <Accordion title="✅ Actions">
    * [ ] Accept order button
    * [ ] Set preparation time input
    * [ ] Mark on the way button
    * [ ] Complete order button
    * [ ] Cancel order button (with reason selection)
    * [ ] View order details
  </Accordion>

  <Accordion title="✅ Notifications">
    * [ ] Sound alert for new orders
    * [ ] Visual notification
    * [ ] Desktop notification (optional)
    * [ ] Success/error messages
  </Accordion>
</AccordionGroup>

## Testing

<AccordionGroup>
  <Accordion title="✅ Endpoint Testing">
    * [ ] Test login with valid credentials
    * [ ] Test login with invalid credentials
    * [ ] Test token expiration
    * [ ] Test all restaurant endpoints
    * [ ] Test all food endpoints
    * [ ] Test all order endpoints
    * [ ] Test rate limiting
    * [ ] Test error responses
  </Accordion>

  <Accordion title="✅ Order Lifecycle Testing">
    * [ ] Test RECEIVED → CONFIRMED
    * [ ] Test CONFIRMED → IN\_DELIVERY
    * [ ] Test IN\_DELIVERY → COMPLETE
    * [ ] Test order cancellation
    * [ ] Test order repetition (before acknowledgment)
    * [ ] Test order acknowledgment
  </Accordion>

  <Accordion title="✅ Edge Cases">
    * [ ] Orders with no modifiers
    * [ ] Orders with multiple modifier groups
    * [ ] Scheduled orders
    * [ ] Cash vs card payments
    * [ ] Different courier types
    * [ ] Large orders (many items)
    * [ ] Network timeouts
    * [ ] Server errors
  </Accordion>
</AccordionGroup>

## Security

<AccordionGroup>
  <Accordion title="✅ Credential Security">
    * [ ] Credentials in environment variables
    * [ ] Credentials not in source code
    * [ ] Credentials not logged
    * [ ] Credentials encrypted at rest
  </Accordion>

  <Accordion title="✅ Token Security">
    * [ ] Tokens stored securely
    * [ ] Tokens not logged
    * [ ] Tokens transmitted over HTTPS only
    * [ ] Token refresh implemented
  </Accordion>

  <Accordion title="✅ HTTPS">
    * [ ] All requests use HTTPS
    * [ ] SSL certificates validated
    * [ ] No HTTP fallback
  </Accordion>
</AccordionGroup>

## Production Deployment

<AccordionGroup>
  <Accordion title="✅ Pre-Deployment">
    * [ ] All tests passing
    * [ ] Error handling tested
    * [ ] Logging configured
    * [ ] Monitoring set up
    * [ ] Backup procedures in place
  </Accordion>

  <Accordion title="✅ Configuration">
    * [ ] Production API base URL configured
    * [ ] Production credentials set
    * [ ] Polling intervals optimized
    * [ ] Cache durations configured
    * [ ] Timeout values set
  </Accordion>

  <Accordion title="✅ Monitoring">
    * [ ] API call success rate monitored
    * [ ] Error rates tracked
    * [ ] Response times monitored
    * [ ] Rate limit hits tracked
    * [ ] Alerts configured for issues
  </Accordion>

  <Accordion title="✅ Documentation">
    * [ ] Internal documentation written
    * [ ] Staff training completed
    * [ ] Troubleshooting guide created
    * [ ] Emergency procedures documented
  </Accordion>
</AccordionGroup>

## Post-Deployment

<AccordionGroup>
  <Accordion title="✅ Verification">
    * [ ] Test order flow end-to-end
    * [ ] Verify orders appear correctly
    * [ ] Confirm status updates work
    * [ ] Test restaurant open/close
    * [ ] Test menu item activation/deactivation
    * [ ] Monitor for errors
  </Accordion>

  <Accordion title="✅ Ongoing Maintenance">
    * [ ] Monitor integration health daily
    * [ ] Review error logs regularly
    * [ ] Update credentials periodically
    * [ ] Keep documentation updated
    * [ ] Train new staff as needed
  </Accordion>
</AccordionGroup>

## Quick Reference

### Critical IDs

* Use `payment_key` (UUID) for order operations
* Use `food_id` (integer) for menu operations
* Use `rest_id` (UUID) for restaurant operations

### Critical Intervals

* Poll orders: **30+ seconds**
* Cache menu: **30+ minutes**
* Token refresh: **Before 24 hours**

### Critical Remember

* Always acknowledge orders immediately
* Always use HTTPS
* Always handle rate limits
* Never log credentials
* Never use integer `id` for order operations

## Need Help?

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/api-reference/overview">
    Complete endpoint documentation
  </Card>

  <Card title="Order Lifecycle" icon="route" href="/guides/order-lifecycle">
    Understand order flow
  </Card>

  <Card title="Best Practices" icon="star" href="/guides/best-practices">
    Production-ready patterns
  </Card>

  <Card title="Contact Support" icon="envelope" href="mailto:support@dkkango.com">
    Get help from our team
  </Card>
</CardGroup>

***

<Note>
  **Congratulations!** Once you've completed this checklist, your integration is ready for production. 🎉
</Note>
