diff --git a/jsonapi_extras.services.yml b/jsonapi_extras.services.yml
index 571f48a..6139cf3 100644
--- a/jsonapi_extras.services.yml
+++ b/jsonapi_extras.services.yml
@@ -42,4 +42,8 @@ services:
 
   jsonapi_extras.entity.to_jsonapi:
     class: Drupal\jsonapi_extras\EntityToJsonApi
-    arguments: ['@http_kernel']
+    arguments:
+      - '@http_kernel'
+      - '@jsonapi.resource_type.repository'
+      - '@session'
+      - '@request_stack'
diff --git a/src/EntityToJsonApi.php b/src/EntityToJsonApi.php
index bfa09a0..f885e29 100644
--- a/src/EntityToJsonApi.php
+++ b/src/EntityToJsonApi.php
@@ -5,8 +5,11 @@ namespace Drupal\jsonapi_extras;
 use Drupal\Component\Serialization\Json;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Url;
+use Drupal\jsonapi\ResourceType\ResourceTypeRepositoryInterface;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Session\SessionInterface;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * Simplifies the process of generating a JSON:API version of an entity.
@@ -22,14 +25,44 @@ class EntityToJsonApi {
    */
   protected $httpKernel;
 
+  /**
+   * The JSON:API Resource Type Repository.
+   *
+   * @var \Drupal\jsonapi\ResourceType\ResourceTypeRepositoryInterface
+   */
+  protected $resourceTypeRepository;
+
+  /**
+   * A Session object.
+   *
+   * @var \Symfony\Component\HttpFoundation\Session\SessionInterface
+   */
+  protected $session;
+
   /**
    * EntityToJsonApi constructor.
    *
    * @param \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel
    *   The HTTP kernel.
+   * @param \Drupal\jsonapi\ResourceType\ResourceTypeRepositoryInterface $resource_type_repository
+   *   The resource type repository.
+   * @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session
+   *   The session object.
+   * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
+   *   The stack of requests.
    */
-  public function __construct(HttpKernelInterface $http_kernel) {
+  public function __construct(
+    HttpKernelInterface $http_kernel,
+    ResourceTypeRepositoryInterface $resource_type_repository,
+    SessionInterface $session,
+    RequestStack $request_stack
+  ) {
     $this->httpKernel = $http_kernel;
+    $this->resourceTypeRepository = $resource_type_repository;
+    $request = $request_stack->getCurrentRequest();
+    $this->session = $request->hasPreviousSession()
+      ? $request->getSession()
+      : $session;
   }
 
   /**
@@ -42,15 +75,25 @@ class EntityToJsonApi {
    *
    * @return string
    *   The raw JSON string of the requested resource.
+   *
+   * @throws \Exception
    */
   public function serialize(EntityInterface $entity, array $includes = []) {
-    $route_name = sprintf('jsonapi.%s--%s.individual', $entity->getEntityTypeId(), $entity->bundle());
-    $jsonapi_url = Url::fromRoute($route_name, ['entity' => $entity->uuid()])->toString(TRUE)->getGeneratedUrl();
+    $resource_type_name = $this->resourceTypeRepository
+      ->get($entity->getEntityTypeId(), $entity->bundle())
+      ->getTypeName();
+    $route_name = sprintf('jsonapi.%s.individual', $resource_type_name);
+    $jsonapi_url = Url::fromRoute($route_name, ['entity' => $entity->uuid()])
+      ->toString(TRUE)
+      ->getGeneratedUrl();
     $query = [];
     if ($includes) {
       $query = ['include' => implode(',', $includes)];
     }
     $request = Request::create($jsonapi_url, 'GET', $query);
+    if ($this->session) {
+      $request->setSession($this->session);
+    }
     $response = $this->httpKernel->handle($request, HttpKernelInterface::SUB_REQUEST);
     return $response->getContent();
   }
@@ -65,6 +108,8 @@ class EntityToJsonApi {
    *
    * @return array
    *   The JSON structure of the requested resource.
+   *
+   * @throws \Exception
    */
   public function normalize(EntityInterface $entity, array $includes = []) {
     return Json::decode($this->serialize($entity, $includes));
