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

# Salesforce

> Connect Qwoty to Salesforce and automatically synchronize customers, contacts, opportunities, products, quotes, and orders.

## Overview

The Salesforce integration synchronizes your commercial data between Qwoty and Salesforce.

Once Salesforce is connected, the integration setup starts automatically. No manual workflow configuration is required.

> [!NOTE]
>
> Qwoty automatically prepares the synchronization flow after the Salesforce connection is authorized.

## Data synchronization

```mermaid theme={null}
flowchart LR
    subgraph QWOTY["Qwoty"]
        direction TB
        Q_CUSTOMER["Customer"]
        Q_CONTACT["Primary contact"]
        Q_QUOTE["Project (Quote)"]
        Q_LINE_ITEMS["Line items"]
        Q_PHASES["Phases"]
        Q_ORDER["Order<br/>on acceptance"]
        Q_PRODUCT["Product"]
    end

    subgraph SALESFORCE["Salesforce"]
        direction TB
        SF_ACCOUNT["Account"]
        SF_CONTACT["Contact"]
        SF_OPPORTUNITY["Opportunity"]
        SF_LINE_ITEM["OpportunityLineItem"]
        SF_SCHEDULE["OpportunityLineItemSchedule"]
        SF_ORDER["Order + OrderItem"]
        SF_PRODUCT["Product2 + PricebookEntry"]
    end

    Q_CUSTOMER --> SF_ACCOUNT
    Q_CONTACT --> SF_CONTACT
    Q_QUOTE -->|"PATCH"| SF_OPPORTUNITY
    Q_LINE_ITEMS -->|"CREATE"| SF_LINE_ITEM
    Q_PHASES -->|"CREATE"| SF_SCHEDULE
    Q_ORDER -->|"CREATE"| SF_ORDER
    Q_PRODUCT -->|"UPSERT"| SF_PRODUCT

    classDef qwoty fill:#EFF6FF,stroke:#005FFF,color:#0F172A,stroke-width:1.5px;
    classDef salesforce fill:#F8FAFC,stroke:#64748B,color:#0F172A,stroke-width:1.5px;

    class Q_CUSTOMER,Q_CONTACT,Q_QUOTE,Q_LINE_ITEMS,Q_PHASES,Q_ORDER,Q_PRODUCT qwoty;
    class SF_ACCOUNT,SF_CONTACT,SF_OPPORTUNITY,SF_LINE_ITEM,SF_SCHEDULE,SF_ORDER,SF_PRODUCT salesforce;

    style QWOTY fill:transparent,stroke:#CBD5E1,stroke-width:1px
    style SALESFORCE fill:transparent,stroke:#CBD5E1,stroke-width:1px
```

> [accordion] Customers and contacts
>
> A Qwoty **Customer** is synchronized with a Salesforce **Account**.
>
> The customer's **primary contact** is synchronized with a Salesforce
> **Contact**.

> [accordion] Projects and opportunities
>
> A Qwoty **Project (Quote)** is associated with a Salesforce **Opportunity**.
>
> When the project changes in Qwoty, the corresponding opportunity is
> updated using a `PATCH` operation.

> [accordion] Line items and phases
>
> Each Qwoty quote line item creates a Salesforce **OpportunityLineItem**.
>
> Each phase associated with a line item creates an
> **OpportunityLineItemSchedule**.

> [accordion] Orders
>
> When a quote is accepted, Qwoty creates the corresponding Salesforce **Order** and **OrderItem** records.

> [accordion] Products and pricing
>
> A Qwoty **Product** is synchronized with Salesforce **Product2** and **PricebookEntry** records.
>
> The synchronization uses an `UPSERT` operation:
>
> * Existing records are updated.
> * Missing records are created.

## Before you connect

Make sure that:

* You have access to your Qwoty workspace settings.
* You have **System Administrator** rights in the target Salesforce organization (required to install the Qwoty package and to complete the connection).
* Your Salesforce user has permission to access the objects used by the integration.
* Products that should be synchronized contain the required pricing information.

> [!WARNING]
>
> Missing Salesforce permissions may prevent some records from being created or updated.

## Connect Salesforce

**1. Open the integrations settings**

In Qwoty, open your workspace settings and navigate to **Integrations**.

**2. Select Salesforce**

Find Salesforce in the list of available CRM integrations and start the connection.

**3. Install the Qwoty package**

The installation dialog offers two links: **Install on a production org** or
**Install on a sandbox**. Open the one matching your Salesforce organization and
install the Qwoty package there. The package must be installed before connecting.

**4. Authorize Qwoty**

Back in Qwoty, click **Connect my Salesforce org**, then sign in to Salesforce
and approve the requested access.

**5. Complete the connection**

Return to Qwoty after authorization.

The integration setup starts automatically. You do not need to configure or
activate a separate synchronization workflow.

Once the setup is complete, Qwoty can begin synchronizing supported records
with Salesforce.

## Synchronization behavior

> [accordion] Record creation
>
> Records that do not already exist in Salesforce are created when the corresponding synchronization event occurs.
>
> This applies to supported objects that use `CREATE` or `UPSERT`.

> [accordion] Record updates
>
> Existing Salesforce opportunities are updated when their associated Qwoty projects change.
>
> Products and pricing records may also be updated through the `UPSERT`
> operation.

> [accordion] Quote acceptance
>
> An order is created in Salesforce when the associated quote is accepted in Qwoty.
>
> The synchronization creates both the Salesforce **Order** and its related
> **OrderItem** records.

> [accordion] Relationships
>
> Qwoty preserves the logical relationships between synchronized records.
>
> For example:
>
> * A primary contact is linked to its customer account.
> * An opportunity line item is linked to its opportunity.
> * A line-item schedule is linked to its opportunity line item.
> * An order item is linked to its order.

## Object mapping

| Qwoty object | Salesforce object | Operation |
| - | - | - |
| Customer | Account | Synchronize |
| Primary contact | Contact | Synchronize |
| Project (Quote) | Opportunity | `PATCH` |
| Line item | OpportunityLineItem | `CREATE` |
| Phase | OpportunityLineItemSchedule | `CREATE` |
| Accepted order | Order | `CREATE` |
| Accepted order line | OrderItem | `CREATE` |
| Product | Product2 | `UPSERT` |
| Product price | PricebookEntry | `UPSERT` |

## Salesforce permissions

The Salesforce user authorizing the connection must be able to access the objects required by the integration.

> [accordion] CRM records
>
> The integration requires access to:
>
> * Account
> * Contact
> * Opportunity
> * OpportunityLineItem
> * OpportunityLineItemSchedule

> [accordion] Orders
>
> To synchronize accepted quotes, the integration requires access to:
>
> * Order
> * OrderItem

> [accordion] Products and price books
>
> To synchronize products and pricing, the integration requires access to:
>
> * Product2
> * PricebookEntry

## Disconnect Salesforce

To stop future synchronization, open the Salesforce integration from your Qwoty workspace settings and disconnect it.

> [!WARNING]
>
> Disconnecting Salesforce stops future synchronization. It does not automatically delete records that were previously created in Salesforce.

## Troubleshooting

> [accordion] The Salesforce connection cannot be authorized
>
> Verify that:
>
> * You are signing in to the correct Salesforce organization.
> * Your Salesforce user is active.
> * Your user is allowed to authorize connected applications.
> * Your browser is not blocking the authorization window.

> [accordion] An opportunity is not updated
>
> Confirm that the Qwoty project is correctly associated with a Salesforce opportunity.
>
> Also verify that the Salesforce user used for the connection has permission
> to update the Opportunity object and the relevant fields.

> [accordion] Line items are not created
>
> Check that:
>
> * The corresponding opportunity exists.
> * The product is available in Salesforce.
> * A valid PricebookEntry exists.
> * The connected Salesforce user can create OpportunityLineItem records.

> [accordion] Phases are not synchronized
>
> Verify that the related opportunity line item was created successfully.
>
> A phase can only be synchronized after its parent
> OpportunityLineItem is available.

> [accordion] An accepted quote does not create an order
>
> Confirm that:
>
> * The quote has reached the accepted state.
> * The related Salesforce account and opportunity are available.
> * Orders are enabled in the Salesforce organization.
> * The connected user can create Order and OrderItem records.

> [accordion] A product is not synchronized
>
> Verify that the product contains the required information and that the connected user can create or update Product2 and PricebookEntry records.

## Need help?

If the integration remains unavailable after checking the connection and permissions, contact Qwoty support with:

* The affected Qwoty record.
* The corresponding Salesforce record, when available.
* The approximate time of the synchronization attempt.
* A description of the expected result.


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