Skip to content
Last updated

Salesforce Commerce Cloud Integration

REVER x Salesforce Commerce Cloud

REVER integrates with Salesforce Commerce Cloud (SFCC, B2C Commerce) through OCAPI, SCAPI and SLAS. This guide lists everything you need to set up in your SFCC instance before REVER can start processing returns, exchanges and gift card refunds.

Once you finish these steps, send the resulting IDs and credentials to your REVER account manager through a secure channel.

1. SFCC IDs

REVER needs the following identifiers from your instance.

Realm ID

  1. Go to the Salesforce Commerce Cloud Control Center and click Realms.
  2. Copy the Realm ID.

Organization ID and Short Code

  1. Open Business Manager and go to Administration.
  2. Click Site Development > Salesforce Commerce API Settings.
  3. Copy the Short Code and the Organization ID.

Domain and Site ID

  1. In Business Manager, note down the Domain: the first part of your Business Manager URL, up to the first .com.
  2. Note down the Site ID, shown in the left-most section of the Business Manager toolbar.

2. Business Manager user

REVER needs a Business Manager user to access your instances.

Step 1: Create the user in Account Manager

  1. Log in to Account Manager.
  2. In the left sidebar, click Users.
  3. Click Add User and fill in the mandatory details:
    • Email Address: developer@itsrever.com
    • First Name: Developer
    • Last Name: ItsRever
  4. Under Organization, make sure your organization is selected.
  5. Click Save. An invitation email is sent automatically to developer@itsrever.com.

Step 2: Assign roles

  1. Scroll down to the Roles section on the user's page and click Add.
  2. Select the following roles:
    • Business Manager User (required to log in)
    • Business Manager Administrator
  3. Click Add to confirm.

Step 3: Configure the scope (instances)

  1. In the list of assigned roles, click the filter icon next to Business Manager User.
  2. Select your organization. You will see all your instances (Production, Staging, Development, Sandboxes).
  3. Check the instances REVER should have access to and click Add.
  4. Repeat for the Business Manager Administrator role, selecting the same instances.

3. OCAPI settings

Create the OCAPI API client

  1. Log in to Account Manager and open the API Client section.
  2. Click Add API Client and fill in:
    • A display name for the client.
    • A password, confirmed. Store this password securely: it is your client secret.
  3. In the Organizations section, click Add and select the appropriate organization(s).
  4. In the Roles section, do not add the Salesforce Commerce API role. This client is used for OCAPI calls only.
  5. Click Save.
  6. Copy the Client ID and store it securely.

See the official documentation for more details.

Configure OCAPI permissions

In Business Manager, go to Administration > Site Development > Open Commerce API Settings. You need to configure two API types: Shop and Data.

In both cases, replace HERE_GOES_THE_CLIENT_ID with the Client ID you created above.

Shop API

Select type Shop and context Global.

If the configuration is empty, paste the following JSON. If there is already content, add only the object inside clients as a new item at the end of the existing clients array.

{
  "_v": "24_1",
  "clients": [
    {
      "client_id": "HERE_GOES_THE_CLIENT_ID",
      "resources": [
        {
          "resource_id": "/order_search",
          "methods": ["post"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "/customers/*",
          "methods": ["post"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "/baskets",
          "methods": ["post"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "/baskets/*",
          "methods": ["delete"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "/baskets/*/price_adjustments",
          "methods": ["post"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "/orders/*",
          "methods": ["get", "patch"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "/orders",
          "methods": ["post"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "/orders/*/notes",
          "methods": ["post"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "/products/*",
          "methods": ["get"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "/products/*/*",
          "methods": ["get"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "/stores/*",
          "methods": ["get"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "/site",
          "methods": ["get"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "/products/*/variations",
          "methods": ["get"],
          "cache_time": 0,
          "config": {
            "_comment": "Add a comma-separated list of the price book ids currently active in the organization",
            "product.prices.price_book_ids": "*"
          }
        }
      ]
    }
  ]
}

Data API

Select type Data and context Global.

If the configuration is empty, paste the following JSON. If there is already content, add only the object inside clients as a new item at the end of the existing clients array.

{
  "_v": "24_1",
  "clients": [
    {
      "client_id": "HERE_GOES_THE_CLIENT_ID",
      "resources": [
        {
          "resource_id": "/locale_info/locales",
          "methods": ["get"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        }
      ]
    }
  ]
}

Click Save to apply the changes.

See the official documentation for more details.

Important

  • Keep the client ID and password secure: they give access to your Salesforce Commerce Cloud data through the API.
  • This OCAPI client cannot be used for SCAPI (Salesforce Commerce API) calls. Create a separate client for SCAPI, as described below.

4. SCAPI settings

  1. Log in to Account Manager and click API Client in the left navigation menu.
  2. Click Add API Client.
  3. Enter a descriptive Display Name (for example, "REVER SCAPI Client").
  4. Set a secure Password and confirm it. Store this password securely: it is your client secret.
  5. In Organizations, click Add, select your organization(s) and confirm.
  6. In Roles, click Add and select the Salesforce Commerce API role.
  7. Click the filter icon next to the role, select your organization and the instances this client can access, then click Add.
  8. In the Default Scopes field, paste the following scopes:
mail
roles
tenantFilter
profile
sfcc.products
sfcc.pricing
sfcc.gift-certificates
sfcc.gift-certificates.rw
sfcc.cdn-zones
sfcc.cdn-zones.rw
sfcc.inventory.impex-graphs
sfcc.inventory.impex-inventory.rw
sfcc.inventory.impex-inventory
sfcc.inventory.availability
sfcc.inventory.availability.rw
sfcc.inventory.reservations
sfcc.inventory.reservations.rw
sfcc.promotions
sfcc.promotions.rw
openId
sfcc.shopper-baskets-orders.rw
sfcc.shopper-categories
sfcc.shopper-customers.login
sfcc.shopper-customers.register
sfcc.shopper-gift-certificates
sfcc.shopper-myaccount.rw
sfcc.shopper-product-search
sfcc.shopper-productlists
sfcc.shopper-products
sfcc.shopper-promotions
sfcc.shopper-custom-objects
sfcc.shopper-stores
sfcc.catalogs
sfcc.orders
sfcc.orders.rw
sfcc.ts_ext_on_behalf_of
c_rever_giftcertificates
  1. Review the client name, organizations and roles, then click Save.
  2. Copy the Client ID shown in the confirmation message.

5. SLAS client ID and secret

This client is used to manage order exchanges through SCAPI.

  1. Open the SLAS Admin UI. Replace {{short-code}} with the short code of your B2C Commerce instances:

    https://{{short-code}}.api.commercecloud.salesforce.com/shopper/auth-admin/v1/ui/
  2. Open the Clients tab and click Add Client.

  3. Choose the corresponding tenant and site from the dropdowns.

  4. Set the App Type to Private.

  5. Set the following shopper scopes:

sfcc.shopper-myaccount.baskets sfcc.shopper-discovery-search sfcc.shopper-myaccount.paymentinstruments sfcc.shopper-customers.login sfcc.shopper-myaccount.orders sfcc.shopper-productlists sfcc.shopper-custom-objects sfcc.shopper-promotions sfcc.session_bridge sfcc.shopper-myaccount.paymentinstruments.rw sfcc.shopper-myaccount.productlists sfcc.shopper-categories sfcc.shopper-myaccount sfcc.shopper-myaccount.addresses sfcc.shopper-products sfcc.shopper-myaccount.rw sfcc.pwdless_login sfcc.shopper-context.rw sfcc.shopper-baskets-orders sfcc.shopper-customers.register sfcc.shopper-myaccount.addresses.rw sfcc.shopper-myaccount.productlists.rw sfcc.shopper-baskets-orders.rw sfcc.shopper-custom-objects.countries sfcc.shopper-gift-certificates sfcc.shopper-product-search sfcc.ts_ext_on_behalf_of
  1. Click Save, then copy the Client ID and Client Secret (the secret is shown at the top of the page) and store them securely.

6. REVER payment method

This setup is required to process exchanges. When REVER creates a new order for an exchange, it marks the order as paid with the REVER payment method so it can be identified as an exchange.

Payment processor

  1. Go to Merchant Tools > Ordering > Payment Processor.
  2. Click New.
  3. Set the ID to REVER.
  4. Add a description, for example "Processor for REVER exchanges".

Payment method

  1. Go to Merchant Tools > Ordering > Payment Methods.
  2. Click New.
  3. Set both the ID and the Name to REVER.
  4. In the Details section, select REVER as the Payment Processor.

7. Assign price books to the site

For REVER to read prices correctly, your price books must be assigned to the site.

  1. Select your site, then go to Merchant Tools > Products and Catalogs > Price Books.
  2. Click the price book you want to assign.
  3. Open the Site Assignments tab.
  4. Select the site(s) to assign it to. A price book can be assigned to several sites, and a site can have several price books as long as they share the same currency.
  5. Click Apply.

8. REVER gift cards cartridge

When a return is resolved as store credit, your Commerce Cloud instance issues a gift certificate (gift card) as the refund method. The REVER cartridge lets REVER retrieve that gift certificate so the return can be completed.

The cartridge exposes a REST endpoint that looks up a gift certificate by its merchant ID and returns its redeemable code:

  1. REVER calls the endpoint with a gift certificate identifier.
  2. The cartridge validates the input and queries Commerce Cloud's native gift certificate manager.
  3. It returns the gift certificate code so REVER can associate it with the completed return.

Installation

  1. REVER provides you with a .zip file containing the cartridge.
  2. Install the cartridge following your usual deployment process.

9. REVER custom attributes

So that REVER can track orders, fulfillment statuses and return statuses without a direct integration with your OMS, implement the following custom attributes on the SFCC order object.

rever_fulfillments

Captures the fulfillment and delivery status of each line item (or group of items), identified by the product variant_id.

  • If you don't support multiple fulfillments per order, fulfillment_id can default to the order_id.
  • Either sent_at or delivered_at is required. Both are recommended when available.
[
  {
    "fulfillment_id": "123",
    "sent_at": "2021-01-01",
    "delivered_at": "2021-01-01",
    "line_items": [
      {
        "variant_id": "123",
        "quantity": 10
      }
    ]
  }
]

rever_returns

Tracks the return status of line items returned with REVER, with the variant and the REVER process ID as reference.

[
  {
    "reverProcessID": "retpEXAMPLE",
    "platformProcessID": "ORD-YYYY-MM-DD-001",
    "orderID": "WEB123456",
    "shopperEmail": "shopper@example.com",
    "startedAt": "2025-01-01T10:00:00Z",
    "status": "Pending",
    "returnLineItems": [
      {
        "lineItemId": "111122223333",
        "productId": "PRODUCT_EXAMPLE_01",
        "returnReason": "DEFECTIVE_ITEM",
        "quantity": 1,
        "compensationMethod": "ORIGINAL"
      }
    ],
    "reviews": [
      {
        "lineItemID": "rli_item_01",
        "rejectReason": null,
        "status": "APPROVED",
        "reviewDate": "2025-01-02T09:00:00Z",
        "user": "returns_agent_01"
      },
      {
        "lineItemId": "rli_item_01",
        "rejectReason": "ITEM_WORN",
        "status": "REJECTED",
        "reviewDate": "2025-01-02T09:00:00Z",
        "user": "returns_agent_01"
      }
    ],
    "compensation": {
      "refunds": [
        {
          "amount": "1000",
          "currency": "EUR",
          "refunded_at": null,
          "type": "Original"
        }
      ],
      "exchangeOrder": {
        "orderID": "WEB123457",
        "orderedItems": [
          {
            "quantity": 1,
            "productId": "PRODUCT_EXAMPLE_01",
            "currency": "EUR"
          }
        ]
      }
    },
    "logistics": [
      {
        "trackingNumber": "TRACK123456",
        "trackingUrl": "https://tracking.example.com/track?number=TRACK123456",
        "carrier": "ExampleCarrier",
        "method": "drop_off"
      }
    ],
    "returnCosts": [
      {
        "type": "ORIGINAL_SHIPPING_COST",
        "total": 500,
        "currency": "EUR"
      },
      {
        "type": "RETURN_COST",
        "total": 400,
        "currency": "EUR"
      }
    ]
  }
]

rever_dont_send

Boolean. REVER sets it to indicate that a new exchange order is not ready to be sent yet, pending review of the original return.

Troubleshooting

IssueSolution
After extending REVER to a new site, the returns portal does not loadMake sure the new site is included in the SCAPI and SLAS client scopes
Prices don't show correctly in the full catalogMake sure your price books are assigned to the relevant site ID
Canceling products in SFCC makes the portal fail to loadSet products offline instead of canceling them

Support

For integration support, contact developer@itsrever.com.