---
schema_version: "1"
id: 209bac9b90f918247d9b253051edf004f71885bd2758d9bac801ad452c3ed2fe
title: Exchanges Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_ConnectAPI_Exchanges_static_methods.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_Exchanges_static_methods.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 8713a6862bcccafbdf48eba315377f3bcd0ac50514e70f136330fadb79fa4d46
description: Preview and submit cart to exchange orders.These methods are for Exchanges. All methods are static.Retrieves a preview of an exchange order, taking into account the order summary balance and the difference between the return order and the cart that represents the exchange order.Creates an exchange order summary, based on the return order and the cart used for exchanges. The new exchange order summary is attached to the original order summary (created before any exchanges occurred). You can also provide optional payment information and optional information about order summary sequences, which affect the newly created exchange order summary.
---
# Exchanges Class

Preview and submit cart to exchange orders.

## Namespace

[ConnectApi](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_connect_api.htm "The ConnectApi namespace (also called Connect in Apex) provides classes for accessing the same data available in Connect REST API. Use Connect in Apex to create custom experiences in Salesforce.")

## Exchanges Methods

These methods are for Exchanges. All methods are static.

- **[previewCartToExchangeOrder(previewCartToExchangeOrderInput)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_Exchanges_static_methods.htm#apex_ConnectAPI_Exchanges_previewCartToExchangeOrder_1)**  
    Retrieves a preview of an exchange order, taking into account the order summary balance and the difference between the return order and the cart that represents the exchange order.
- **[submitCartToExchangeOrder(submitCartToExchangeOrderInput)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_Exchanges_static_methods.htm#apex_ConnectAPI_Exchanges_submitCartToExchangeOrder_1)**  
    Creates an exchange order summary, based on the return order and the cart used for exchanges. The new exchange order summary is attached to the original order summary (created before any exchanges occurred). You can also provide optional payment information and optional information about order summary sequences, which affect the newly created exchange order summary.

### previewCartToExchangeOrder(previewCartToExchangeOrderInput)

Retrieves a preview of an exchange order, taking into account the order summary balance and the difference between the return order and the cart that represents the exchange order.

#### API Version

60.0

#### Requires Chatter

No

#### Signature

public static ConnectApi.PreviewCartToExchangeOrderOutputRepresentation previewCartToExchangeOrder(ConnectApi.PreviewCartToExchangeOrderInputRepresentation previewCartToExchangeOrderInput)

#### Parameters

previewCartToExchangeOrderInput

Type: [ConnectApi.PreviewCartToExchangeOrderInputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_preview_cart_to_exchange_order.htm "Information required to preview a cart to exchange order.")

Information required to preview a cart to exchange order.

#### Return Value

Type: [ConnectApi.PreviewCartToExchangeOrderOutputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_preview_cart_to_exchange_order_output.htm "Expected change order financial values for the preview cart to exchange order action.")

### submitCartToExchangeOrder(submitCartToExchangeOrderInput)

Creates an exchange order summary, based on the return order and the cart used for exchanges. The new exchange order summary is attached to the original order summary (created before any exchanges occurred). You can also provide optional payment information and optional information about order summary sequences, which affect the newly created exchange order summary.

#### API Version

60.0

#### Requires Chatter

No

#### Signature

public static ConnectApi.SubmitCartToExchangeOrderOutputRepresentation submitCartToExchangeOrder(ConnectApi.SubmitCartToExchangeOrderInputRepresentation submitCartToExchangeOrderInput)

#### Parameters

submitCartToExchangeOrderInput

Type: [ConnectApi.SubmitCartToExchangeOrderInputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_submit_cart_to_exchange_order.htm "Information required for a submit cart to exchange order action.")

Information required to submit a cart to exchange order.

#### Return Value

Type: [ConnectApi.SubmitCartToExchangeOrderOutputRepresentation](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_submit_cart_to_exchange_order_output.htm "Exhange order summary resulting from a submit cart to exchange order action.")