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

# Checkout Integration Flow Example

> Step-by-step guide for integrating ClearLine checkout flow into your POS system

## Overview

Checkout integration is a ClearLine app integrated into the POS system checkout flow. Customers receive marketing interactions via QR codes and templates shown immediately after completing a transaction. The interaction can be initiated manually by staff or automatically based on configured rules.

***

## Integration Flow

<Steps>
  <Step title="Add Products to Cart">
    Sales person adds products to the shopping cart in the POS system.
  </Step>

  <Step title="Apply Customer Coupon (Optional)">
    If the customer has a coupon, the sales person searches for it using one of these parameters:

    * Coupon code
    * Phone number
    * Email

    **API:** [Get Customer Coupons](/pos-integration/coupons/coupons-sync-from-cmc-to-pos#get-customer-coupons)
  </Step>

  <Step title="Apply Location Coupon (Optional)">
    If the customer doesn't have a previously received coupon, but their shopping cart matches a current promotion, the sales person can add any coupon active at the location.

    **API:** [Get Active Coupons by Location](/pos-integration/coupons/coupons-sync-from-cmc-to-pos#get-active-coupons-by-location)
  </Step>

  <Step title="Calculate Discount">
    POS automatically calculates the discount corresponding to the coupon applied to the shopping cart.
  </Step>

  <Step title="Complete Order">
    Sales person completes the order and customer pays.
  </Step>

  <Step title="Post-Purchase Processing">
    After payment is received, the POS system performs the following actions:

    ### 1. Send Transaction Data

    POS system sends post-purchase transaction data to ClearLine.

    **API:** [Post-Purchase Transaction to CMC](/pos-integration/post-purchase-transaction-to-cmc)

    ### 2. Validate Coupon (If Used)

    If a coupon was used with this order, call the coupon validation endpoint.

    **API:** [Validate Coupon via Transaction](/pos-integration/coupons/validate-coupon-via-transaction)

    ### 3. Get Receipt QR Codes (Optional)

    Retrieve QR codes to print on the receipt. You can configure what the QR code should be generated for in the account manager panel.

    **API:** [POS Receipt Promotion](/pos-integration/pos-receipt-promotion)

    ### 4. Check Flow Settings

    POS system checks if Manual or Automated flow is enabled.

    **API:** [Get POS System Settings](/pos-integration/pos-system-settings)

    <Warning>
      Call this endpoint only on first application start and save the settings in local storage.
    </Warning>

    <Tip>
      Listen to the`SettingsChanged` PubNub event to refresh settings when they change.
    </Tip>
  </Step>
</Steps>

***

## Flow Modes

<Tabs>
  <Tab title="Manual Flow">
    When Manual Flow is enabled: - POS system allows the sales person to continue manual interaction - Show marketing actions (e.g., display a pop-up window with offers) - Sales person controls when and how to engage the customer
  </Tab>

  <Tab title="Automated Flow">
    When Automated Flow is enabled: - **Prerequisite:** CFS Carousel must be opened and configured in advance - **Required:** Double screen setup with a separate CFS app - Marketing content displays automatically on the customer-facing screen
  </Tab>

  <Tab title="POS Rules">
    When POS Rules are configured: - System checks if the post-purchase transaction matches any configured rules - If matched, the POS rule is applied automatically - CFS template or marketing app QR code appears on the customer-facing screen

    <Warning>
      If POS Rules are enabled, the manual flow modal is **not shown**.
    </Warning>
  </Tab>
</Tabs>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Coupon Integration" icon="ticket" href="/pos-integration/coupons">
    Learn how to integrate coupon functionality
  </Card>

  {" "}

  <Card title="POS Settings" icon="gear" href="/api/pos-integration/pos-system-settings">
    Configure POS system settings
  </Card>

  {" "}

  <Card title="Receipt Promotions" icon="receipt" href="/api/pos-integration/pos-receipt-promotion">
    Add QR codes to receipts
  </Card>

  <Card title="Transaction API" icon="arrow-right-arrow-left" href="/api/pos-integration/post-purchase-transaction-to-cmc">
    Submit transaction data
  </Card>
</CardGroup>
