The purpose of this integration is to allow users to create Salesforce Commerce Cloud (SFCC) content assets from content entries within Builder. This is an API-only integration and doesn't require a cartridge installation.
SFCC Content Assets Integration works via a webhook that listens for any content changes on the Builder side and creates, updates, or deletes the HTML equivalent as content assets in your SFCC library.
Set up a new API Client in the SFCC account manager, you’ll need admin access for this:
- go to the API Client screen.
- Click Add API Client
- Enter a display name to identify the API Client, for example, “Builder.io SFCC Sync”
- Enter a password. This will be your client secret.
- From the “Token Endpoint Auth Method” menu choose “client_secret_basic”
- Click ‘Add’
- Make a note of the API Client ID that is generated and the password to be used in next steps
- In SFCC Business Manager, go to Administration > Site Development > Open Commerce API Settings
- From the Select Type field, select ‘Data’
- From the Select Context field, select ‘Global’
- In the text field add the client ID from step 1 to the following json and paste it
{
"_v": "20.4",
"clients": [
{
"client_id": "Change this to match your API Client ID",
"resources": [
{
"resource_id": "/libraries/{library_id}/content/{content_id}",
"methods": [
"get",
"put",
"patch",
"delete"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/libraries/{library_id}/content/{content_id}/folders",
"methods": [
"get"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/libraries/{library_id}/folders/{folder_id}",
"methods": [
"get",
"put"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/libraries/{library_id}/folders/{folder_id}/content",
"methods": [
"get"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/libraries/{library_id}/folder_assignments/{content_id}/{folder_id}",
"methods": [
"get",
"put",
"delete"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/libraries/{library_id}/folders/{folder_id}/sub_folders",
"methods": [
"get"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
}
]
}
]
}
In the Builder UI, create a Section model so you can create your content assets under it.
You can start by clicking Models in the left side nav on the Dashboard.
Click +Create Model.
Select Section from the list.
Enter Content Asset as the name for your new Section model or any name that make sense to your use case and click Create.
Hit Show more options
Press Sync To SFCC
Press Save
You're all set now, try creating new entries on the model you created and upon publishing you should see it in your SFCC Content Assets Library