次のドキュメントには、B2C Commerce System API (B2C Commerce システム API) 実装テンプレートで使用される Data API と Shopper API へのアクセスを提供するように B2C Commerce インスタンスを設定する方法に関する指針が記載されています。
API クライアント ID 設定
Salesforce Commerce API に何らかの操作を行うには、API クライアント ID が必要です。API クライアント ID は、Account Manager から付与されるログイン情報で、ID 値と秘密の両方で構成されます。Salesforce Commerce API を使用するには、ID と秘密の両方が保護されていて、ユーザー名とパスワードの組み合わせとして扱われる必要があります。
Account Manager で、次の設定を使用して新しい API クライアントを作成します。
-
ロール: 対象インスタンスへのアクセス権を持つ Salesforce Commmerce API ロール
-
OpenID Connect allowed scopes (OpenID Connect で許可される範囲):
sfcc.orders sfcc.orders.rw sfcc.products sfcc.products.rw sfcc.shopper-baskets-orders sfcc.shopper-baskets-orders.rw sfcc.shopper-myaccount sfcc.shopper-myaccount.rw sfcc.shopper-myaccount.addresses sfcc.shopper-myaccount.addresses.rw sfcc.shopper-customers.register sfcc.customerlists.rw
-
Token Endpoint Auth Method (トークンエンドポイント認証方法): client_secret_post
-
Access Token Format (アクセストークン形式): JWT
詳細は、Commerce Cloud Infocenter の「Add an API Client ID (API クライアント ID の追加)」を参照してください。
Open Commerce API 設定
OCAPI は、実装テンプレートで使用されるその他の API セットです。これらの設定は、Business Manager の [管理] -> [サイトの開発] -> [Open Commerce API 設定] ページで定義します。Shop API と Data API の 2 つの API グループを設定する必要があります。Shop API へのアクセス権はグローバル (組織) レベルで設定する必要がありますが、Data API はグローバルまたは個々のサイトレベルで設定できます。
Shop API
Shop API の次のリソースおよびメソッドへのアクセス権が必要です。
| リソース | メソッド |
|---|---|
/customers |
POST |
/customers/* |
GET/PATCH |
/customers/*/addresses |
GET/POST |
/customers//addresses/ |
GET/PATCH/DELETE |
/customers/*/baskets |
GET |
/customers/*/orders |
GET |
/orders/* |
GET/PATCH |
/order_search |
POST |
/product_lists |
GET |
/product_lists/* |
GET/PATCH |
/product_lists/*/items |
GET/POST |
/product_lists//items/ |
PATCH/DELETE |
/product_search |
GET |
/product_search/availability |
GET |
/product_search/images |
GET |
/product_search/prices |
GET |
/product_search/variations |
GET |
/products/* |
GET |
/products/*/images |
GET |
/products/*/availability |
GET |
/products/*/prices |
GET |
/products/*/variations |
GET |
Data API
Data API の次のリソースおよびメソッドへのアクセス権が必要です。
| リソース | メソッド |
|---|---|
/products/* |
GET/PUT/PATCH |
/products//variation_attributes/ |
GET/PUT |
/products//variation_attributes//values/* |
GET/PUT |
/products//variations/ |
GET/PUT |
/product_search |
POST |
/inventory_lists//product_inventory_records/ |
GET/PATCH/PUT |
/catalogs//categories//products/* |
GET/PATCH/PUT |
/sites//orders/* |
PUT/PATCH |