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

# Building with Syncs

In the Sync model, **Chift builds the integration and triggers the flows**. You do not read or write the end-user's data yourself. You delegate the synchronization to Chift. Chift defines the sync with you. Chift then runs it on an event or a schedule. You write no integration code.

New to the terms *connector*, *consumer*, and *connection*? Read [How it works](/home) first.

<Frame caption="A sync setup page: your end-user connects each app, then completes the mappings.">
  <img src="https://mintcdn.com/chift/An6huKcWb3M9OkHt/assets/docs/syncs/overview-sync.png?fit=max&auto=format&n=An6huKcWb3M9OkHt&q=85&s=aaac16c2f43e272e9510df1e7ab01c21" alt="Sync model" width="1276" height="698" data-path="assets/docs/syncs/overview-sync.png" />
</Frame>

## How a sync works

A **sync** is a synchronization between two of Chift's APIs. Chift builds and maintains it. A sync contains one or more **flows**. An event or a timer triggers each flow, for example every night at 4 AM. Each flow runs a process for every consumer linked to the sync, such as *get invoices and inject them into accounting*.

A sync can include **mappings**. A mapping is a correspondence your end-user fills during onboarding. For example, the end-user matches tax rates between their POS and their accounting software.

## Requirements

* Your software exposes an API.
* You want to connect your software to one of Chift's [Unified APIs](/unified-apis/overview).

Chift defines the scope with you, builds the sync and its flows, and sets the trigger to match your requirements. Chift also maintains the sync after it goes live.

## Who does what

* **You** expose the sync to your end-users. How much you build depends on the [expose model](/syncs/expose-to-end-users/overview). In the **embedded** model, you create the consumer, create the sync activation link, and redirect your end-user to it. In the **pre-OAuth2** and **marketplace** models, you redirect your end-user to a static URL and Chift handles the rest. You can also read the sync status and trigger runs from your backend.
* **Your end-user** connects their own software on a Chift-hosted page. The end-user then confirms the mappings the flow needs. The other side of the sync is your software, fixed for all your end-users.
* **Chift** builds the flows, stores and refreshes the credentials, and runs each flow on its trigger for every linked consumer.

## What you store

* In the **embedded** model, store the **`consumerid`** on your end-user record and pass it to every sync call for that end-user. You also need the **`syncid`** of the sync Chift built for you. Get it from [Get syncs](/api-reference/endpoints/syncs/get-syncs).
* In the **pre-OAuth2** and **marketplace** models, Chift creates and manages the consumers. You do not need to store or pass a `consumerid`.

## The build path

<Steps>
  <Step title="Scope the sync with Chift">
    Chift builds the sync and its flows with you. Chift also defines the triggers. [Contact us](https://www.chift.eu/contact) to scope a sync for your use case.
  </Step>

  <Step title="Set up in the Platform">
    Activate the connectors you need and create an API key in the Platform. See [Activate a connector](/platform/getting-started/activate-connector) and [Create an API key](/platform/getting-started/create-api-key).
  </Step>

  <Step title="Choose how to expose the sync">
    Pick the expose model that matches how much you want to build. This choice decides whether you write any code at all. See [How to expose syncs to end-users](/syncs/expose-to-end-users/overview).
  </Step>

  <Step title="Activate the sync for an end-user">
    In the **embedded** model, authenticate, create a consumer, create the sync activation link, and redirect your end-user to it. See [Activating a sync](/syncs/expose-to-end-users/embedded/how-to-activate). In the other models, redirect your end-user to the static URL.
  </Step>

  <Step title="Confirm and monitor">
    Confirm the setup is complete. Then monitor the executions. See [Monitor sync executions](/syncs/monitor-executions).
  </Step>
</Steps>

## Ready-to-use syncs

Chift maintains pre-built syncs you can use as a starting point. Each page describes the default scope and the mappings your end-user fills.

<CardGroup cols={2}>
  <Card title="Invoices sync" icon="file-invoice" href="/syncs/ready-to-use-syncs/invoices">
    Invoices from invoicing software to accounting software.
  </Card>

  <Card title="E-commerce sync" icon="cart-shopping" href="/syncs/ready-to-use-syncs/ecommerce">
    E-commerce orders and payments to accounting software.
  </Card>

  <Card title="POS sync" icon="cash-register" href="/syncs/ready-to-use-syncs/pos">
    POS orders and payments to accounting software.
  </Card>

  <Card title="PMS sync" icon="hotel" href="/syncs/ready-to-use-syncs/pms">
    PMS orders and payments to accounting software.
  </Card>

  <Card title="Payment sync" icon="credit-card" href="/syncs/ready-to-use-syncs/payment">
    Payments, refunds, and payouts to accounting software.
  </Card>
</CardGroup>

Chift can also build a custom sync. [Contact us](https://www.chift.eu/contact) to scope one for your use case.

## Sync endpoints

Syncs use the same consumer and connection routes as the Unified APIs. On top of those, the endpoints below are specific to syncs.

| Purpose | Endpoint |
| - | - |
| List the syncs on your account | [Get syncs](/api-reference/endpoints/syncs/get-syncs) |
| Create the activation link for a consumer | [Retrieve the url of a sync for a specific consumer](/api-reference/endpoints/consumers/retrieve-the-url-of-a-sync-for-a-specific-consumer) |
| Read the sync status of a consumer | [Get sync information for one consumer](/api-reference/endpoints/consumers/get-sync-information-for-one-consumer) |
| Enable a flow for a consumer | [Enable a flow for a specific consumer](/api-reference/endpoints/syncs/enable-a-flow-for-a-specific-consumer) |
| Update the flow settings of a consumer | [Update flow settings for a specific consumer](/api-reference/endpoints/syncs/update-flow-settings-for-a-specific-consumer) |
| List the executions of a flow | [Get executions information for one consumer/flow/sync](/api-reference/endpoints/consumers/get-executions-information-for-one-consumerflowsync) |
| Read one execution | [Get execution details](/api-reference/endpoints/syncs/get-execution-details) |
| Trigger a run | [Send a custom event for a specific flow](/api-reference/endpoints/syncs/send-a-custom-event-for-a-specific-flow-deprecated) |

You can also trigger a run from the Platform. See [Manual execution of a sync](/platform/advanced/syncs/trigger-an-execution).

## In this section

<CardGroup cols={2}>
  <Card title="Expose syncs to end-users" icon="share-nodes" href="/syncs/expose-to-end-users/overview">
    The three models: embedded, pre-OAuth2, and marketplace. Start here.
  </Card>

  <Card title="Activating a sync" icon="link" href="/syncs/expose-to-end-users/embedded/how-to-activate">
    The embedded flow, from creating a consumer to the Chift-hosted sync page.
  </Card>

  <Card title="Activation links & redirects" icon="arrow-right-arrow-left" href="/syncs/expose-to-end-users/embedded/activation-and-redirects">
    The sync activation link, connector pre-selection, and the redirect afterwards.
  </Card>

  <Card title="Monitor sync executions" icon="heart-pulse" href="/syncs/monitor-executions">
    Confirm setup, list executions, read statuses, and trigger a run.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.