Open Commerce API (OCAPI) Client Permissions
Code sample to help you add the permissions under OCAPI Settings. The following is the list of all the tables with their corresponding resource_id
that you can access with your API client:
OCAPI Table Name | resource id | methods | read attribute | write attribute |
---|---|---|---|---|
CUSTOMER_GROUP | /sites/*/customer_group_search | post | (**) | (**) |
CUSTOM_OBJECT | /custom_objects_search/* | post | (**) | (**) |
CUSTOM_OBJECT_ATTRIBUTE_DEFINITION | /custom_object_definitions/*/attribute_definition_search | post | (**) | (**) |
CUSTOM_OBJECT_ATTRIBUTE_GROUP | /custom_object_definitions/*/attribute_group_search | post | (**) | (**) |
INVENTORY_LIST | /inventory_lists | get | (**) | |
INVENTORY_LIST_RECORD | /inventory_lists/*/product_inventory_records | get | (**) | |
STORE | /sites/*/stores | get | (**) | |
SHARED_PRODUCT_OPTION , SHARED_PRODUCT_OPTION_VALUE | /catalogs/*/shared_product_options | get | (**) |
The following code adds permissions to your API client to access all the tables mentioned above. However, you only need to add the resource_id
, methods
, and attributes
for the tables that you want to sync.
{
"_v": "23.0",
"clients": [
{
"client_id": "<OCAPI Client ID>",
"resources": [
{
"resource_id": "/sites/*/customer_group_search",
"methods": [
"post"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/custom_objects_search/*",
"methods": [
"post"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/custom_object_definitions/*/attribute_definition_search",
"methods": [
"post"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/custom_object_definitions/*/attribute_group_search",
"methods": [
"post"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/sites/*/stores",
"methods": [
"get"
],
"read_attributes": "(**)"
},
{
"resource_id": "/inventory_lists",
"methods": [
"get"
],
"read_attributes": "(**)"
},
{
"resource_id": "/inventory_lists/*/product_inventory_records",
"methods": [
"get"
],
"read_attributes": "(**)"
},
{
"resource_id": "/catalogs/*/shared_product_options",
"methods": [
"get"
],
"read_attributes": "(**)"
}
]
}
]
}