What is Salesforce Commerce Cloud?
Salesforce Commerce Cloud is an enterprise ecommerce platform. Merchants manage sites, catalogs, and orders in Business Manager, and extend an instance with cartridges.What Does the Integration Do?
The integration makes Commerce Cloud orders returnable in Redo. Redo reads orders and products from Commerce Cloud. Redo writes to Commerce Cloud only to create exchange orders and gift certificates. Redo calls the Salesforce Commerce API (SCAPI). Redo does not use OCAPI.What the Integration Does Not Do
- Redo does not post refunds, returns, or credit records to Commerce Cloud.
- Redo does not update inventory in Commerce Cloud.
- Redo does not change the original order through the API. The order sync job writes two custom attributes on the order,
redoSyncStatusandredoLastAttempt, to record the delivery to Redo.
Refunds
Redo does not refund through Commerce Cloud. Redo reads the payment instruments on the order and sends the refund to the payment processor that captured the payment. When an order has more than one payment, Redo refunds each processor up to the amount that the processor captured. Redo can send refunds to these processors:- Adyen
- PayPal
- Optty
- Global-e
Exchange Orders
When a return includes an exchange, Redo creates the exchange order in Commerce Cloud in this sequence:- Redo creates a basket through the Shopper Baskets API. The basket contains the exchange items, the shopper’s address, and a payment instrument with the payment method ID
REDO. - Redo sets the shipping method on the basket.
- Redo submits the basket as an order through the Shopper Orders API.
- Redo sets the order confirmation status to
confirmedand the export status toreadythrough the Orders API.
- Shipping method. The shipping method ID for exchange orders. Without this option, Redo uses the default shipping method of the site. If the default does not apply to the basket, Redo uses the first shipping method that applies.
- Original order number. A custom order attribute that receives the number of the original order.
- Shipment attributes. Fixed values that Redo writes to custom shipment attributes.
Store Credit
When a return gives store credit, Redo creates a gift certificate in Commerce Cloud for the store credit amount. The gift certificate contains the original order number and the name and email address of the shopper. Redo’s team can configure a custom Boolean attribute that Redo sets totrue on each gift certificate that Redo creates.
How to Set It Up
Redo’s team sets up this integration with you. The Redo dashboard does not have a self-service Connect button for Commerce Cloud. Contact your Redo representative to start.
Prerequisites
Account Manager Access
Account Manager Access
You need permission to create API clients in Account Manager. For exchanges, you also need permission to create SLAS clients.
Business Manager Access
Business Manager Access
You need administrator access to Business Manager to upload cartridges, import metadata, and create services and jobs.
Redo API Token and Store ID
Redo API Token and Store ID
Create an API client with the
orders_write scope in Settings > Developer in the Redo dashboard. Copy the API secret and the store ID. See Authentication.Redo Cartridges
Redo Cartridges
Redo’s team sends you the cartridge archives. Each archive contains the cartridge, its metadata, and a README file.
Configuration Steps
1
Collect the Instance Details
Redo needs these values for each instance:
2
Create the Admin API Client
Create an API client in Account Manager. Redo uses this client to read orders and products and to create gift certificates. See Authorization for Admin APIs in the Salesforce documentation.Redo requests tokens with the client credentials grant. Redo sends the client ID and the client secret in an HTTP Basic
Authorization header.Add these scopes to the API client:Redo also requests the tenant scope
SALESFORCE_COMMERCE_API:<realm ID>_<instance ID>. Redo’s team confirms the final scope list for your setup before you create the client. The API client must allow every scope in that list.3
Create the Shopper API Client (Exchanges Only)
Skip this step if you do not use exchanges.Create a private SLAS client. See Authorization for Shopper APIs in the Salesforce documentation. Redo requests a token with the client credentials grant and sends the site ID as the
channel_id.Add these scopes to the SLAS client:Then create a payment method with the ID
REDO in Business Manager and enable it for the site. Redo puts this payment method on each exchange order.4
Install the Order Sync Cartridge
The cartridge
int_redo_order_sync operates on SFRA and SiteGenesis. Do these steps in Business Manager:-
Upload
int_redo_order_syncto the active code version. Add the cartridge to the cartridge path of each site (Administration > Sites > Manage Sites > the site > Settings). -
Import the cartridge metadata (Administration > Site Development > Site Import & Export). The metadata adds the site preferences, the two order attributes, and the
RedoSyncCheckpointcustom object type. -
Configure the HTTP service
redo.http.orderSync(Administration > Operations > Services). Set the credential URL tohttps://api.getredo.com/v2.2. Set the credential password to your Redo API secret. -
Set the site preferences in the Redo Order Sync group:
-
Create a job that runs the
custom.RedoOrderSyncstep for the site (Administration > Operations > Jobs). The step is defined in thesteptypes.jsonfile of the cartridge. Schedule the job at a short interval. The interval controls how soon a new order appears in Redo.
redo.http.orderSync.<SiteID>, for example redo.http.orderSync.RefArch. Each credential contains the API secret of the Redo store that the site syncs to. Set the redoStoreId preference of each site to the same store. When a site has no credential of its own, the job uses the default credential of the service.The first job run records the current time and does not send earlier orders. Ask Redo’s team to import earlier orders.5
Send the Details to Redo
Send these items to Redo’s team through a secure channel:
- The instance details from the first step
- The client ID and the client secret of the Admin API client
- The client ID and the client secret of the SLAS client, if you use exchanges
- The payment processors that your sites use
6
Test the Integration
Place a test order on the site and let the order sync job run. Find the order in Redo, then submit a test return for the order. If you use exchanges or store credit, process the return and examine the exchange order or the gift certificate in Business Manager.
Storefront Cartridge for Redo Coverage
Returns do not need this cartridge. Install the cartridgeint_redo_storefront_embed only if you sell Redo coverage on the storefront. The cartridge loads the Redo storefront script on each page.
- Upload
int_redo_storefront_embedto the active code version and add it to the start of the site cartridge path. - Import the cartridge metadata.
- Set the site preferences
redoStorefrontEnabledandredoStorefrontWidgetIdin the Redo Storefront group. Ask Redo’s team for the widget ID. - Invalidate the page cache of the site.
app.template.htmlHead hook. If the htmlHead.isml template of the site does not call that hook, or the site uses SiteGenesis, add <isinclude template="redo/storefrontEmbed" /> to the head template. The README file in the cartridge archive gives the full procedure.
Custom Order Attributes
Many merchants keep order data in custom attributes (c_*). Redo can read custom attributes during order sync. Tell Redo’s team which attributes your orders use. Redo’s team adds the mapping to your integration. The Redo dashboard does not have a setting for this mapping.