- First, go to the Account Manager page (https://account.demandware.com/dw/account/Home), generate dw_client_id (Client Id) and dw_api_pass (Api Password).
- Then, add permissions for API2Cart API, so that our API could retrieve data from the store. Go to your Admin panel: Administration > Open Commerce API Setting > Select type: Shop & Data > Select context: Global
- Then, specify client application-specific configurations:
- For Type Shop: Global permissions
{
"_v":"17.4",
"clients":[
{
"client_id":"YOUR_CLIENT_ID",
"allowed_origins": [
],
"resources":[
{
"resource_id":"/products/*/prices",
"methods":["get"],
"read_attributes":"(**)",
"write_attributes":"(**)",
"config":{
"product.prices.price_book_ids":"PRICE_BOOK_ID_1,PRICE_BOOK_ID_2,...,PRICE_BOOK_ID_N"
}
},
{
"resource_id":"/**",
"methods":[
"put",
"get",
"post",
"patch"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
}
]
}
]
}
- For Type Shop: Global permissions
Or per resource permissions
{
"_v": "17.4",
"clients": [
{
"client_id": "YOUR_CLIENT_ID",
"allowed_origins": [
],
"resources": [
{
"resource_id":"/baskets",
"methods":["post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*",
"methods":["get","patch","delete"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/billing_address",
"methods":["put"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/coupons",
"methods":["post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/coupons/*",
"methods":["delete"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/customer",
"methods":["put"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/gift_certificate_items",
"methods":["post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/items",
"methods":["post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/items/*",
"methods":["patch","delete"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/notes",
"methods":["post","get"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/payment_instruments",
"methods":["post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/payment_instruments/*",
"methods":["patch","delete"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/payment_methods",
"methods":["get"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/shipments",
"methods":["post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/shipments/*",
"methods":["patch"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/shipments/*/shipping_address",
"methods":["put"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/shipments/*/shipping_method",
"methods":["put"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/shipments/*/shipping_methods",
"methods":["get"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/baskets/*/submit",
"methods":["post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers",
"methods":["post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers/auth",
"methods":["post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers/password_reset",
"methods":["post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers/*",
"methods":["get","patch"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers/*/addresses",
"methods":["get","post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers/*/addresses/*",
"methods":["get","patch","delete"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers/*/baskets",
"methods":["get"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers/*/orders",
"methods":["get"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers/*/password",
"methods":["put"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers/*/payment_instruments",
"methods":["get","post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers/*/payment_instruments/*",
"methods":["get","delete"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/orders",
"methods":["post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/orders/*",
"methods":["get","patch"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/orders/*/notes",
"methods":["get","post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/orders/*/payment_methods",
"methods":["get"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/orders/*/payment_instruments",
"methods":["post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/order_search",
"methods":["post"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/products/*",
"methods":["get"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id": "/products/*/availability",
"methods": ["get"],
"read_attributes": "(**)",
"write_attributes": "(**)",
"cache_time": 0
},
{
"resource_id": "/products/*/prices",
"methods": ["get"],
"read_attributes": "(**)",
"write_attributes": "(**)",
"cache_time": 0
},
{
"resource_id":"/site",
"methods":["get"],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/categories/*",
"methods":["get"],
"read_attributes":"(**)",
"write_attributes":"(**)"
}
]
}
]
}
2. For Type Data: Global permissions
{
"_v":"17.4",
"clients":[
{
"client_id":"YOUR_CLIENT_ID",
"resources":[
{
"resource_id":"/**",
"methods":[
"put",
"get",
"post",
"patch"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
}
]
}
]
}
Or per resource permissions
{
"_v": "17.4",
"clients": [
{
"client_id": "YOUR_CLIENT_ID",
"resources": [
{
"resource_id": "/sites",
"methods": [
"get"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/sites/**",
"methods": [
"get"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/catalog_search",
"methods": [
"post"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/product_search",
"methods": [
"post"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/products/*",
"methods": [
"get",
"patch"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/products/*/variant_search",
"methods": [
"post"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/products/*/variations",
"methods": [
"get"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/products/*/variation_attributes",
"methods": [
"get"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/customer_lists/**",
"methods": [
"get",
"post"
],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/inventory_lists/*",
"methods": ["patch"],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id": "/inventory_lists/*/product_inventory_records/*",
"methods": ["patch", "put", "get"],
"read_attributes": "(**)",
"write_attributes": "(**)"
},
{
"resource_id":"/system_object_definitions/**",
"methods":["get", "put" , "patch", "post", "delete"],
"read_attributes":"(**)",
"write_attributes":"(**)"
}
]
}
]
}