# Salesforce APIs

This documentation provides an overview of the Salesforce APIs supported by Valorx Fusion, detailing how these APIs enable seamless integration and enhance functionality within the platform.

### CPQ APIs

The **CPQ APIs** provide essential functionality for managing quotes, products, and related data within Salesforce CPQ. These APIs facilitate tasks like reading, validating, calculating, and saving quotes, as well as adding and retrieving products.&#x20;

{% hint style="info" %}
These CPQ APIs will be available in the workflow only if your Salesforce org has the Salesforce CPQ package installed and the Quote and Quote Line objects are included in the data model. Only then will you be able to access and use the CPQ API tasks within the workflow.
{% endhint %}

Below is a summary of the core properties and functionalities of the CPQ APIs:

#### **1. Read Quote API**

**Description:**\
Retrieves detailed information about a specific quote, including its associated Quote Lines and related data.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FUyHTaOx8mgDSDp30nTL9%2FRead%20Quote%20API.png?alt=media&#x26;token=2d362f0c-6136-49e4-867f-618f68962e59" alt=""><figcaption><p>Read Quote API</p></figcaption></figure>

**Use Case:**

* Fetching the current state of a quote for review or updates.

**Inputs:**

* Quote Form Map

**Outputs:**

* Quote Model with Quote Lines

#### **2. Calculate Quote API**

**Description:**\
Performs pricing calculations for a quote, applying rules such as discounts, taxes, and promotions.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2F3zvlTqmTjoGs2swkz3bZ%2FCalculate%20Quote%20API.png?alt=media&#x26;token=8ee4e28e-23e0-4e61-bd3d-48a667cda954" alt=""><figcaption><p>Calculate Quote API</p></figcaption></figure>

**Use Case:**

* Ensuring accurate pricing before finalizing a quote.

**Inputs:**

* Quote Form Map
* Quote Line Grid Map

**Outputs:**

* Updated Quote Model with calculated prices

#### **3. Validate Quote API**

**Description:**\
Checks the quote for errors or discrepancies, ensuring it meets predefined business rules.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2Fp6yWdBtKkBZLc3G92Snh%2FValidate%20Quote%20API.png?alt=media&#x26;token=8ec1982c-e704-4bb3-8b4d-3d4ba9bf6ecd" alt=""><figcaption><p>Validate Quote API</p></figcaption></figure>

**Use Case:**

* Verifying quote accuracy before submission or approval.

**Inputs:**

* Quote Model

**Outputs:**

* Validation Results (Pass/Fail)
* List of Errors (if any)

#### **4. Save Quote API**

**Description:**\
Saves changes made to the quote and updates the Quote Model in Salesforce.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2F4ZZiIhf5PXCZXOqHwCjz%2FSave%20Quote%20API.png?alt=media&#x26;token=a428ebc7-8161-41b8-b46e-392d20975557" alt=""><figcaption><p>Save Quote API</p></figcaption></figure>

**Use Case:**

* Persisting updates to a quote after modifications.

**Inputs:**

* Updated Quote Model

**Outputs:**

* Confirmation of successful save

#### **5. Read Product API**

**Description:**\
Retrieves product information from the Salesforce Product Catalog.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FIlBOkgHmJAddxDbpPV5y%2FRead%20Product%20API.png?alt=media&#x26;token=2a6a3a84-8b9c-4757-86c6-dcdb37771fe2" alt=""><figcaption><p>Read Quote API</p></figcaption></figure>

**Use Case:**

* Fetching product details for inclusion in a quote.

**Inputs:**

* Product ID or Filter Criteria

**Outputs:**

* Product Details

#### **6. Add Product API**

**Description:**\
Adds a product to a specific quote, updating the Quote Line Model.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FT0zjT9jna07q4rtSBapz%2FAdd%20Product%20API.png?alt=media&#x26;token=f2c37bf3-aa8a-444c-91e5-45acd4cd77e9" alt=""><figcaption><p>Add Product API</p></figcaption></figure>

**Use Case:**

* Including additional products in an existing quote.

**Inputs:**

* Quote ID
* Product ID
* Quantity

**Outputs:**

* Updated Quote Model with the new product

***

#### Notes

* These APIs are designed to integrate seamlessly with Salesforce CPQ functionality.
* Proper authentication and API permissions are required for access.
* Responses are returned in standard Salesforce data formats (e.g., JSON or XML).

By leveraging these APIs, users can automate and streamline their quote and product management processes, improving efficiency and accuracy.
