# Dependency on a non-existent service.

**URL:** <https://forum.shopware.com/t/dependency-on-a-non-existent-service/71875>\
**Category:** Programming (EN)\
**Created:** [5. Januar 2021 um 07:53 UTC](https://forum.shopware.com/t/dependency-on-a-non-existent-service/71875 "2021-01-05T07:53:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zan](https://avatars.discourse-cdn.com/v4/letter/z/48db29/32.png) [@zan](https://forum.shopware.com/u/zan)\
**Post date:** [5. Januar 2021 um 07:53 UTC](https://forum.shopware.com/t/dependency-on-a-non-existent-service/71875/1 "2021-01-05T07:53:58Z")

</div>

I have created a piugin named `SwagMasterAPI`. I have to get some products from different API. But when I try to add it to the service I am getting following error:

`The service "SwagMasterApi\Service\CarService" has a dependency on a non-existent service "MasterDataApi\Model\Api".`

Here are the files I have created.

carService.php

```
 use MasterApi\Model\Api; 

 class CarService {

 public function \_\_construct(Api $api) { $this-\>api = $api; } 

```

services.xml

&nbsp; &nbsp;

&nbsp;

Problem&nbsp;
