3 min read

Ocapi

Poq.Sfcc.Ocapi namespace provides Contracts, Clients and Extensions that allow quick usage of SFCC OCAPI Shop API with support of customizations.

Contracts

Contracts can be found in namespace Poq.Sfcc.Ocapi.Contract. The contracts provided cover most of the relevant OCAPI Shop Rest API. Customizations in Sfcc are handled by extending provided Contract classes and using descendants with provided Clients. Detail reference and usage of all available classes and fields could be found in OCAPI documentation

Clients

Each Client covers a Resources available in OCAPI Shop API and can be used to call OCAPI Shop API. Interfaces for client are available in namespace Poq.Sfcc.Ocapi.Interfaces

List of Available Clients

  • BasketClient

  • CategoryClient

  • CustomerClient

  • OrderClient

  • ProductResourceClient

  • ProductSearchClient

  • PromotionsClient

  • SessionsClient

  • StoresClient

  • SearchSuggestionClient

    All clients implement strict interfaces that could be found in Poq.Sfcc.Ocapi.Interfaces

Supporting Different locales

Client services use the default locale that has been defined in configuration for all requests that are sent to OCAPI.

new ProductsSearchClient(s.GetRequiredService<IHttpClientFactory>(), new SfccConfiguration()
{
BaseUrl = "your_sfcc_instance_base",
ClientId = "your_client_id",
Locale = "locale_to_use_with_all_requests_to_ocapi"
});

ClientExtensions

Client Extensions build on top of available clients implementations adding handy features to speed up development with OCAPI.

Coverage

The following endpoints available in Sfcc OCAPI API are covered in Sfcc SDK Clients.

Shop Baskets (Shop API 24.5)

Categories resource Categories resource (Shop API 24.5)

Customer resource Customers resource (Shop API 24.5)

Orders resource Orders resource (Shop API 24.5)

Products resource Products resource (Shop API 24.5)

ProductSearch resource ProductSearch resource (Shop API 24.5)

Sessions resource Sessions resource (Shop API 24.5)

Promotions resource Promotions resource (Shop API 24.5)

Get promotions by filter criteria /promotions (GET)

Stores resource Stores resource (Shop API 24.5)

SearchSuggestion resource (Shop API 24.5)