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

# Synchronize contacts

> Step-by-step technical guide to synchronize contacts across accounting systems using Maesn Unified API.

## 5 steps to implement contact syncronization

<Steps>
  <Step title="Authorize access" titleSize="h3">
    Your user must first authorize your application to access their accounting platform (e.g., Xero, Lexware Office, Sevdesk) via an authorization flow (e.g., OAuth, API key) through [maesn Connect](/guides/maesn-connect).
  </Step>

  <Step title="Retrieve contacts" titleSize="h3">
    Fetch the relevant contacts from your user's accounting platform using either the GET [/contacts](/api-reference/accounting-endpoints/contacts/get-contacts) or the GET [/customers](/api-reference/accounting-endpoints/customers/get-customers) and [/suppliers](/api-reference/accounting-endpoints/suppliers/get-suppliers) endpoint.
  </Step>

  <Step title="Reconcile contacts" titleSize="h3">
    Match the contacts imported from your user's accounting platform with any existing contacts in your application, using relevant fields like `vatId`, `email` and `companyName`. Update contacts with newer information from the accounting platform if available and resolve conflicting information.
  </Step>

  <Step title="Create contacts" titleSize="h3">
    Use the POST [/customers](/api-reference/accounting-endpoints/customers/create-customer) or [/suppliers](/api-reference/accounting-endpoints/suppliers/create-supplier) endpoint to create contacts that exist in your application, but not in your user's accounting platform. Use PUT [/customers](/api-reference/accounting-endpoints/customers/update-customer), PATCH [/customers}](/api-reference/accounting-endpoints/customers/patch-customer), PUT [/suppliers](/api-reference/accounting-endpoints/suppliers/update-supplier) or PATCH [/suppliers](/api-reference/accounting-endpoints/suppliers/patch-supplier) to update contacts in your user's accounting platform if your application has more recent information on a contact.
  </Step>

  <Step title="Keep your data fresh" titleSize="h3">
    After fetching contact data initially, you should make sure to keep your user's contact data up to date by regularly retrieving data through the GET endpoints. The `lastModified` query parameter can be utilized on all our GET endpoints to save you the hassle of creating deltas to detect change. See our [guide to keeping data fresh](/guides/keep-data-fresh) for more information!
  </Step>
</Steps>

<Tip>You can utilize Webhooks to make this process more efficient.</Tip>
