Loading...
Area: Episerver Service API
Applies to versions: Not applicable
  Subscribe

Episerver Service API Developer Guide

Recommended reading 

The Episerver Service API is a service layer that allows system integrators to update and retrieve information from Episerver, ensuring a seamless integration with external systems, such as PIM, DAM and ERPs.

User scenarios

The Episerver Service API provides a programming interface for performing operations like:

Getting started

The Episerver Service API is installed as a NuGet package EPiServer.ServiceApi. The Service API is available for Episerver Commerce version 8.5 and higher. See Installation and configuration how to install and set up the integration.

How it works

The Service API integration service uses OWIN-based authentication and ASP.NET Identity, see Installation and configuration and Overview of Service API.

Requests and responses

Below is an example illustrating the usage of the REST API for managing CRUD operations.

GET carts by name and customer ID

/episerverapi/commerce/carts/{customerId}/{name}

  • Base path (base URL/host): episerverapi
  • Endpoint: commerce/carts/
  • Query string parameter(s): /{customerId}/{name}
get/episerverapi/commerce/carts/{customerId}/{cartName}/{marketId}

Example: Request GET method using C#/.NET

var client = new HttpClient()

  {

    BaseAddress = new Uri(ConfigurationManager.AppSettings["integrationUrl"])

  };

client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);                                       

var result = client.GetAsync("/episerverapi/commerce/carts/{customerId}/{name}").Result.Content.ReadAsStringAsync().Result

JSON response

Overview of request and response interactions between the application and the REST API.

RESTAPIoverview.png

Related topics

Do you find this information helpful? Please log in to provide feedback.

Last updated: Apr 14, 2021

Recommended reading