1. Home
  2. Docs
  3. B2Ccommerce
  4. Returns
Log a Case

B2C Commerce Cloud Returns

Zenkraft enables self-service returns for 80+ Carriers from B2C Commerce. You can collect data about returns e.g. reasons for return and analyse them using Salesforce Reports and Dashboards.

Install the Zenkraft Cartridge

The Zenkraft cartridge is available in the Salesforce Commerce Cloud official LINK Marketplace.

Basic Setup

If are are enabling returns for your customers using one carrier and one warehouse location, then fill in the fields in the Custom preference for Zenkraft Returns found under Merchant tools > Site Preferences > Custom Preferences > Zenkraft Returns.

Zenkraft Returns

Site Preference Description
Returns Shipping Account ID Number representing the Returns Shipping Account ID (ex: 394893489238983). If you don't have this then please contact your Zenkraft account manager and they will be able to assist.
Returns Carrier ID This is the carrier ID (ex: fedex, dhl) used when getting shipping information for returns. If you don't know what this is please contact your Zenkraft account manager and they will be able to assist.
Shipping Service Must match the service type, for example fedex_ground. You can find these values by looking at our API docs pages and searching for Service Types.
Returns Packaging Type The packaging type used by the carrier. Generally you can always use your_packaging, but if you have a specific packaging type that you want to use with your carrier you can set it here. You can find these values by looking at our API docs pages and searching for Packaging Types.
Recipient Address Street Street address representing where items will be returned to
Recipient Address City City representing where items will be returned to
Recipient Address State Code State Code representing where items will be returned to
Recipient Address Postal Code Postal Code representing where items will be returned to
Recipient Address Country Code Country Code representing where items will be returned to
Recipient Company Company name representing where items will be returned to
Recipient Name Attention to name representing where items will be returned to
Recipient Phone Number Phone number representing where items will be returned to
Recipient Email Address Email representing where items will be returned to
Shipping Label File Type For Returns Recommend using PDF, but you can request the shipping label in whichever format the carrier allows. You can find these values by looking at our API docs pages and searching for label_type
Return Reasons Configuration JSON object representing reasons for returns and sub-reasons. More details are found later on is this guide.
Returns Require Approval Set to true if all returns require approvals. More details are found later on is this guide.
Catalog categories requiring return approval Comma separated list of catalogue categories that ensure returns need approval. More details are found later on is this guide.
Customer groups requiring returns approval Comma separated list of customer groups that ensure returns need approval. More details are found later on is this guide.
Available days to submit return after order creation Set the number of days after order creation in which the customer is allowed to automatically request a return.
Sync Return with Zenkraft Sync returns information with your external platform such as Salesforce Order Management or Salesforce Core. More details are found later on is this guide.
Dimension Units Units to be used for dimensions. IN = Inches, CM = Centimeters
Weight Units Weight Units to be used. KG = kilograms, LB = pounds.
Set returns to be one to one related with order Set true to enable returns to be related to order. We recommend setting this option to true, this means that you can't create multiple returns for the same item.
Catalog categories for non returnable items List of comma separated with no white space catalog categories of products that cannot be returned.
Enable Zenkraft returns to require login Set true to enable Zenkraft returns to require the user to be logged in.

If you need to configure multiple carriers based on country then using the Advanced JSON mentioned further below in this guide is what you will need to configure.

Return reasons

Return reasons are defined as a JSON object, this is managed via the returnReasonsConfig in the Zenkraft Returns Custom Site Preference.

You have have two levels of Return Reasons. For example the top level could be Damaged and the second level could be Damaged during shipment or Product was defective.

You can set up different return reasons on a category level or just leave a default across all product categories.

An example is below:

{
    "reasons": [
        {
            "categories": [
                "zk-default"
            ],
            "id": "wrong-size",
            "display": "Wrong Size",
            "values": [
                {
                    "display": "Too Small",
                    "id": "to_small"
                },
                {
                    "display": "Too Large",
                    "id": "to_large"
                },
                {
                    "display": "Was not what I expected",
                    "id": "was_not_what_I_expected"
                }
            ]
        },
        {
            "categories": [
                "zk-default"
            ],
            "id": "damaged",
            "display": "Damaged",
            "values": [
                {
                    "display": "Damaged during shipment",
                    "id": "damaged_during_shipmenl"
                },
                {
                    "display": "Product was defective",
                    "id": "product_was_defective"
                }
            ]
        },
        {
            "categories": [
                "zk-default"
            ],
            "id": "incorrect",
            "display": "Incorrect Product",
            "values": [
                {
                    "display": "I ordered the wrong product",
                    "id": "i_ordered_the_wrong_product"
                },
                {
                    "display": "I was sent the wrong product",
                    "id": "i_was_sent_the wrong_product"
                },
                {
                    "display": "This is not what I wanted",
                    "id": "this_is_not_what_i_wanted"
                }
            ]
        },
        {
            "categories": [
                "mens-clothing-suits",
                "mens-clothing-ties"
            ],
            "id": "wrong-size",
            "display": "Wrong Size",
            "values": [
                {
                    "display": "Too Small",
                    "id": "to_small"
                },
                {
                    "display": "Too Large",
                    "id": "to_large"
                },
                {
                    "display": "Was not what I expected",
                    "id": "was_not_what_I_expected"
                }
            ]
        },
        {
            "categories": [
                "mens-clothing-suits",
                "mens-clothing-ties"
            ],
            "id": "damaged",
            "display": "Damaged",
            "values": [
                {
                    "display": "Damaged during shipment",
                    "id": "damaged_during_shipmenl"
                },
                {
                    "display": "Product was defective",
                    "id": "product_was_defective"
                }
            ]
        }
    ]
}

You can see that it's possible to assign the return reasons to specific product categories. To use the default category for all products you can just set the category to be zk-default.

Enable / disable product groups

The cartridge provides the functionality to disallow the return of products by group

This can be configured through the Site Preference found under Merchant tools > Site Preferences > Custom Preferences > Zenkraft Returns group.

Once in that group, scroll and find Catalog categories for non returnable items

Add the list of categories as a comma separated list. In order to be defined as non-returnable the products should have that same category assigned as primary category.

Auto Approving Returns

At a site level you can set whether your customers can request a return (that needs to be manually approved by your Customer Success team), or automatically allow them to create a return. This can be further constrained by product category type.

Some examples for this could be that extra heavy items that require special return services, might need to be approved by your Customer Success teams, before the user can create the label. If you do have a requirement for manually approving returns this usually works in conjunction with another system such as Salesforce Service Cloud/Order Management or another external service that can integrate with Salesforce Commerce Cloud.

The Custom preference for Zenkraft Returns can be found under Merchant tools > Site Preferences > Custom Preferences > Zenkraft Returns. Once in that group, scroll and find Returns Require Approval.

All Returns Require Approval

If you want to approve all returns then set this to Yes. This means that the shipping label will not be created automatically, and the shipping label will need to be set on the return line before the customer can download the label to print.

Returns Require Approval for specific categories

If you have set Returns Require Approval to No then you can force returns to require approval for these product categories inputted here. They need to be comma-separated.

Customer groups requiring returns approval

If you have set Returns Require Approval to No then you can force returns to require approval for these customer group categories inputted here. They need to be comma-separated.

Guest vs My Account Returns

Zenkraft cartridge can be configured to allow guest customers to create returns, or to force only registered customers to use that functionality.

The registered vs guest returns can be configured via a site preference in Zenkraft Returns group.

Navigate to Merchant tools > Site Preferences > Custom Preferences > Zenkraft Returns

Returns Data Architecture

The returns data in SFCC is stored in a custom object records.

The two custom objects that store the return data are:
- zenkraftReturn
- zenkraftReturnLines

Each of the objects is responsible for either storing the basic order return information, or the order lines of a return order, including the base64 labels of the returns.

You can view the returns data in the Business Manager, by navigating through Merchant tools > Custom Objects > Custom Object Editor
and select the object that you want to view/edit (zenkraftReturn or zenkraftReturnLines)

Search for the return order that you need, and open the records

Depending on the object you will see data related to the order itself - which will include label information, related order lines, SFCC order number and data related to the creation and last update data such as tracking information.

Tracking Return Shipments

In order to get tracking updates for any return shipments created you need to set up the SFRAUpdateReturnCases job. Please navigate to Administration > Operations > Jobs and configure the job SFRAUpdateReturnCases job.

We recommend scheduling it to run every 12 or 24 hours.

The job will request tracking updates from the carriers, and will update the returnLine object with the status, and tracking stage whenever there is a change.

This tracking status will then be viewable by your customers within their Account and Returns History.

Triggering refunds/notifications for return packages

Thanks to the tracking job, in the previous step, you will know once your customer has posted the item back to you. You can then trigger your own events such as email notifications or even refunds.

If you look at the zenkraftJobs.js file, you will see in line 204 you have the hook, that you can utilise to make the callout to your payment gateway to trigger the refund or send email notifications.

    // Optional Hook to issue trigger your own notification/refund once the return package has been delivered
    if (trackInfo.tracking_stage === 'DELIVERED') {
        hooksHelper('app.zenkraft.returns', 'refund', [returnLineItem], function () {});
    }
        

Build JSON file

If you are looking to allow returns from multiple countries, you can utilise the ZenkraftAdvanced Custom preferences, to split out by country where the returns should go to and also which carrier the returns should use.

The configuration can be defined using JSON under the Advanced Configuration section. Go to Merchant tools > Site preferences > Custom preferences in the ZenkraftAdvanced group.

You will see the JSON under the Zenkraft Advanced JSON Object an example of which you will see below:

{
    "RETURN": {
        "US": {
            "advanced": false,
            "ACCOUNT_ID": "474557840",
            "CARRIER_ID": "ups",
            "SERVICE_TYPE": "ups_ground",
            "PACKAGING": "your_packaging",
            "CURRENCY_CODE": "USD",
            "DIM_UNITS": "IN",
            "WEIGHT_UNITS": "LB",
            "FILETYPE": "PDF",
            "ADDRESS": {
                "STREET": "10062 Treena Street",
                "CITY": "San Diego",
                "STATECODE": "CA",
                "POSTALCODE": "92131",
                "COUNTRYCODE": "GB",
                "COMPANY": "Zenkraft Default",
                "NAME": "Zenkraft Default",
                "PHONE": "1231231233",
                "EMAIL": "warehouse@example.com"
            }
        },
        "GB": {
            "advanced": false,
            "ACCOUNT_ID": "411111110",
            "CARRIER_ID": "fedex",
            "SERVICE_TYPE": "fedex_ground",
            "PACKAGING": "your_packaging",
            "CURRENCY_CODE": "GBP",
            "DIM_UNITS": "CM",
            "WEIGHT_UNITS": "KG",
            "FILETYPE": "PDF",
            "ADDRESS": {
                "STREET": "1 Market Street",
                "CITY": "London",
                "STATECODE": "",
                "POSTALCODE": "EC2V 7RS",
                "COUNTRYCODE": "GB",
                "COMPANY": "Zenkraft Default",
                "NAME": "Zenkraft Default",
                "PHONE": "1231231233",
                "EMAIL": "warehouse@example.com"
            }
        },
        "batteries": {
            "advanced": true,
            "rules": {
                "custom.color": "ED5",
                "custom.batteryType": "Lithium Ion",
                "custom.styleNumber": "P0150"
            },
            "ACCOUNT_ID": "474557840",
            "CARRIER_ID": "ups",
            "SERVICE_TYPE": "ups_ground",
            "SHIP_ACCOUNT": "132174644",
            "PACKAGING": "your_packaging",
            "CURRENCY_CODE": "US",
            "DIM_UNITS": "IN",
            "WEIGHT_UNITS": "LB",
            "FILETYPE": "PDF",
            "ADDRESS": {
                "STREET": "94 Jockey Hollow Street",
                "CITY": "Brooklyn",
                "STATECODE": "NY",
                "POSTALCODE": "11211",
                "COUNTRYCODE": "US",
                "COMPANY": "Zenkraft Default",
                "NAME": "Zenkraft Default",
                "PHONE": "1231231233",
                "EMAIL": "warehouse@example.com"
            }
        }
    }
}
        

The JSON allows you to configure the return to address, shipping account, and packaging type based on country. In the example above you can see we have options for returning to the US and GB.

You can also define an advanced rule for the returns

"advanced": true

which looks at the rules defined

"rules": {
    "custom.color": "ED5",
    "custom.batteryType": "Lithium Ion",
    "custom.styleNumber": "P0150"
},

and if any of the products fall within the rules, then this address, shipping account, and packaging type is utilised.

If there is no match between the advanced rules and the current basket, the cartridge will try to match the configuration object based on the country code of the order and use that definition for the return process.

Sync Returns with Order Management

The cartridge can be configured to push data back to Salesforce Service Cloud / Salesforce OMS.

This can be enabled from the Site Preferences > Zenkraft Returns group, by setting the Sync Return with Zenkraft preference to Yes.

You need to authenticate the Zenkraft API to connect to your Salesforce Service Cloud/Order Management instance.
To do this please follow this URL: API Authentication

If you have any issues then please contact your Zenkraft technical representative to help with the setup of the authentication into your Salesforce instance.

Once you have authenticated your Salesforce instance and you have turned the setting above to Yes, then whenever a return is created within Commerce Cloud, the information about the return and return lines will be populated within your Salesforce instance. The names of the objects in your Salesforce instance will be Returns and Return Lines as you can see from teh screenshots below.

Return:
Return line:

To avoid errors please make sure that the reason and sub reason values are the same on Salesforce objects as they are on your Return Reasons on Salesforce Commerce Cloud. Otherwise the returns will not be created successfully.

Run tests

To test the return labels, place an order and set the Shipping Status on the order to Shipped via Business Manager. Then open the order on the storefront via the Track Order page or the customer Order History. The Print Return Label link will show on the individual shipment for the order.

There are two types of returns available that is set via Business Manager. Automatically Approved or Requires Approval. If a product requires approval, the user will be notified that their approval has been requested. Once the return has been approved then the user is able to download and print the label.

If a product is automatically approved then the return label will be available for download and for printing by the user.

If the custom preference Returns Require Approval is set to no, then the user will automatically be taken to the next page to download and print a return label. Once they get the label, they are also shown a map and list of nearby locations that will accept the returned item for drop-off.

If the custom preference Returns Require Approval is set to yes, then the user will be informed that their return request has been sent to be approved.

Screenshots - Approval Not Required

Step 1: Select Items Screen

All product line items from the selected order are listed in a table, so the customer can choose the items he wants to return

Step 2: Select Reasons for the return

Customer can selected from predefined list of return reasons. The list is configured in a Site Preference in the B2C Business manager

Step 3: Print Label and Nearest Locations

Once the customer has selected and submitted the reason for the return, the Zenkraft cartridge will generate a return label document (PDF or PNG) and display a link to download it, as well as a gmaps integration to display the nearest drop-off locations.

Screenshots - Approval Required

Similar to the Approval not required flow, the customer will be asked to select the items that he wants to return, and the reason for returning the item(s). However, the return label will not be generated until the return is approved.

Step 1: Select Items Screen

All product line items from the selected order are listed in a table, so the customer can choose the items he wants to return

Step 2: Select Reasons for the return

Customer can selected from predefined list of return reasons. The list is configured in a Site Preference in the B2C Business manager

Step 3: Return Request sent for Approval

The return request is sent to the Zenkraft module, and waiting for an approval

Step 4: Return Approved

Once the return has been approved the customer will be able to see the success screen with the link for the return label and the list of the drop-off locations

Please contact us for any more information and for next steps.