The SAP-prepared OAuth_for_Order.impex file automatically creates the OAuth 2.0 Configuration, for example, client ID, client secret, token URL, and so on, for Sales Order Replication from SAP Commerce Cloud to SAP S/4HANA Cloud.
Here's how to configure the OAuth 2.0 API authorization for the sales order replication:
- Go to SAP Note 2726058, and download the ImpEx file OAuth_for_Order.impex attached to it.
- In the ImpEx file, replace the values between the angle brackets, and remove the brackets.
Macros in ImpEx File
Field Value <OAuthClientID> clientid retrieved from service key in Unit 3 Configuring SAP Cloud Integration(section SAP Business Technology Platform (SAP BTP) Cockpit Settings) <OAuthUrl> tokenurl retrieved from service key in Unit 3 Configuring SAP Cloud Integration(section SAP Business Technology Platform (SAP BTP) Cockpit Settings) <OAuthClientSecret> clientsecret retrieved from service key in Unit 3 Configuring SAP Cloud Integration(section SAP Business Technology Platform (SAP BTP) Cockpit Settings) <EndpointUrl> Log on to your SAP Cloud Integration, navigate to Overview Manage Integration Content, and copy endpoint URLs (exclude version at the end of URL, for example, v=1) from the iFlow: Replicate-Orders-From-SAP-Commerce-Cloud-To-SAP-S4HANACE Version Log on to your SAP Cloud Integration, navigate to Overview Manage Integration Content, and copy version (at the end of URL, for example, v=1) from the endpoint URLs from the iFlow: Replicate-Orders-From-SAP-Commerce-Cloud-To-SAP-S4HANACE - Save the ImpEx file.
- To import the ImpEx file, access the SAP Commerce Cloud Hybris Administration Console (HAC) at <https://api.XXXXXXXXXX-XXXXXXXXX-XX-public.model-t.cc.commerce.ondemand.com/hac> or via the SAP Commerce Cloud Portal and log on as an administrator.
- Go to the Console tab, and choose ImpEx Import.
- Go to the Import script tab, locate the ImpEx file prepared in the previous steps, and check that the Legacy Mode has been enabled by default.
- Choose Import File.
A confirmation message (Import finished successfully) under the HAC tabs is displayed once the import is successfully processed.
Note
Rather than using the Import script tab to import the ImpEx file, you can use the Import Content tab (the first tab) instead. Using this tab, you would copy and paste the ImpEx codes/lines from the ImpEx file into the text area to execute the ImpEx scripts. - To verify the OAuth 2.0 configuration items are imported into SAP Commerce Cloud, login to the Backoffice and navigate to System → OAuth → OAuth Clients in the Administration Cockpit. You’ll find the new OAuth client created with the ID given in the OAuth_for_Order.impex file as the value of the first Macro $OAuthClientID.