Prerequisites for Creating a Connection

You must satisfy the following prerequisites to create a connection with the SAP Commerce Cloud (Hybris) Adapter:

Create an OAuth Client

  1. Log in to your SAP Commerce Cloud Backoffice and go to System > OAuth > OAuth Clients.

  2. Click the add (+) icon. The Create New OAuth Client Details dialog box is displayed.

  3. Set the OAuth client ID and client secret, and click NEXT.

    Note:

    You use the client ID and client secret later when configuring security for your SAP Commerce Cloud (Hybris) Adapter connection. See Configure Connection Security.
  4. Enter the following details in the respective fields, and click NEXT.

    Element Description
    Authorities ROLE_TRUSTED_CLIENT
    Client Grant Types refresh_token, client_credentials, password
    OAuth resource IDs hybris
    If you need to access Customer Groups services, you must only enter the details described in the following table.

    Note:

    • If you need to access the Customer Groups services, authorization for ROLE_CUSTOMERMANAGERGROUP is required.
    • Customer Groups is a secured service and is secured with ROLE_CUSTOMERMANAGERGROUP. To access the Customer Groups services, you must be a member of the Customer Manager Group. Therefore, you must assign the Customer Manager Group to the integration user. See Create and Assign a User to the Customer Manager Group.
    • Configure Resource Owner Password Credentials (ROPC) security for the SAP Commerce Cloud (Hybris) Adapter connection to access the customer group services.
    Element Description
    Authorities ROLE_CUSTOMERMANAGERGROUP
    Client Grant Types password
    OAuth resource IDs hybris


  5. Enter basic and extended in the Scopes field, and click NEXT.

  6. In the Access Token validity time field, enter the required time (in seconds) that depends on the frequency of integration execution (for example, 28800). In the Refresh Token validity time field, enter a value greater than Access Token validity time (for example, 32400).
  7. Click DONE.

Create and Assign a User to the Customer Manager Group

Perform the following steps to create and assign a user to the Customer Manager Group.

  1. Log in to your SAP Commerce Cloud Backoffice and go to User > Employees.
  2. Click the add (+) icon. The Create New Employee dialog box is displayed.

  3. Enter the ID in the following format:
    firstname.lastname@domain.com

    For example: c.smith@example.com

  4. Enter the additional required details in the respective fields, and click NEXT.

  5. Under MEMBERSHIPS, search for customermanagergroup, assign the user to the Customer Manager Group, and click DONE.

  6. Once the user is created and assigned to Customer Manager Group, click Employees under User on the home page.
  7. Click the respective customer ID, and click the PASSWORD tab.

  8. Enter a new password for the customer user, re-enter the password for confirmation, and click SAVE.

Common Customization Scenarios

You must perform specific annotations to ensure that SAP Commerce Cloud reflects customizations in the SAP Commerce Cloud (Hybris) Adapter.

Three main types of customizations are possible in the Omni Commerce Connect (OCC) services of SAP Commerce Cloud. To make customizations available in the SAP Commerce Cloud (Hybris) Adapter, follow these guidelines:

Add New Custom Fields in the Standard Operation/API

Ensure that the custom fields are annotated with @ApiParam so that the fields can be discovered in the Swagger metadata document.



Add a New Custom API/Operation Under a Standard Object

Ensure that the operation (method) is annotated with @ApiOperation and @ApiBaseSiteIdParam so that the operation can be discovered in the Swagger metadata document.



Add a New Custom Object

Ensure that the new object (controller class) is annotated with @Api(tags = “<<Object Name>>”) so that the object can be discovered in the Swagger metadata document. You can follow the above-mentioned information to add the operations and fields.



Note:

Replace <<Object Name>> with the actual name of the object that you need to add.

Upload an Image

You can upload an image for a product in SAP Commerce Cloud using customizations in the Omni Commerce Connect (OCC) services of SAP Commerce Cloud.

Perform the following steps to upload an image for a product:
  1. Add a new object in the OCC services of SAP Commerce Cloud. See Add a New Custom Object.
    Image added to be uploaded.

  2. Once the custom object is created, open the Swagger file. The custom object (that is, the media and service (endpoint)), is displayed in the Swagger file.
    Media Controller is displayed. Below POST is displayed. To the right is the path for the image named uploadImage.

    You can send an image in Base64 format to Oracle Integration using a SOAP Adapter connection.
  3. Configure the SOAP Adapter as a trigger connection and the SAP Commerce Cloud Adapter as an invoke connection in an integration in Oracle Integration.
  4. In the mapper, perform the mapping. The image is decoded to the attachment reference type using functions in the mapper. The same image is uploaded for the product based on the product ID passed in the request payload.
To verify the uploaded image in Backoffice:
  1. Log in to your SAP Commerce Cloud Backoffice application.
  2. Navigate to Catalog > Product.
  3. Select the respective product and click the MULTIMEDIA tab.

  4. Click the uploaded image. The image is displayed.