# Lib error While api integration of amazon seller

**URL:** <https://discourse.cakephp.org/t/lib-error-while-api-integration-of-amazon-seller/10882>\
**Category:** Need Help\
**Created:** [January 6, 2023, 10:17am UTC](https://discourse.cakephp.org/t/lib-error-while-api-integration-of-amazon-seller/10882 "2023-01-06T10:17:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![harendra](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@harendra](https://discourse.cakephp.org/u/harendra)\
**Post date:** [January 6, 2023, 10:17am UTC](https://discourse.cakephp.org/t/lib-error-while-api-integration-of-amazon-seller/10882/1 "2023-01-06T10:17:20Z")

</div>

## **Fatal error** : Declaration of Cake\Cache\CacheEngine::get($key, $default = null) must be compatible with Psr\SimpleCache\CacheInterface::get(string $key, mixed $default = null): mixed in **E:\xampp\htdocs\kunhar\vendor\cakephp\cakephp\src\Cache\CacheEngine.php** on line **236**

How I resolve this

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [January 6, 2023, 11:01am UTC](https://discourse.cakephp.org/t/lib-error-while-api-integration-of-amazon-seller/10882/2 "2023-01-06T11:01:59Z")

</div>

What CakePHP version are you running? How can we reproduce that error?  
What code did you execute so this error appears?

---

<div class="post-metadata">

**Author:** ![harendra](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@harendra](https://discourse.cakephp.org/u/harendra)\
**Post date:** [January 6, 2023, 11:08am UTC](https://discourse.cakephp.org/t/lib-error-while-api-integration-of-amazon-seller/10882/3 "2023-01-06T11:08:35Z")

</div>

I am using cake 4.0

namespace App\Controller\Admin;

use App\Controller\Admin\AppController;  
use Cake\Routing\Router;  
use Cake\Event\EventInterface;  
use Cake\ORM\TableRegistry;  
use Cake\ORM\Locator\LocatorAwareTrait;  
use Cake\Datasource\ConnectionManager;

//require\_once(WWW\_ROOT . ‘amazon\_seller’ . DS . ‘vendor’ . DS . ‘autoload.php’);  
require\_once(ROOT . DS . ‘vendor’ . DS . ‘amazon\_seller’ . DS . ‘vendor’ . DS . ‘autoload.php’);  
use SellingPartnerApi\Api\SellersV1Api as SellersV1Api;  
use SellingPartnerApi\Configuration;  
use SellingPartnerApi\Endpoint;

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [January 6, 2023, 11:58am UTC](https://discourse.cakephp.org/t/lib-error-while-api-integration-of-amazon-seller/10882/4 "2023-01-06T11:58:35Z")

</div>

First of all: If you recently created a new CakePHP Project you should be on CakePHP 4.4, not CakePHP 4.0

Second: You don’t need to “re-require” the `autoload.php` from your API library because CakePHP already loads the autoloader in the index.php  
See [app/index.php at 4.x · cakephp/app · GitHub](https://github.com/cakephp/app/blob/4.x/webroot/index.php#L31)  
So every library you installed via e.g. `composer require jlevers/selling-partner-api` is automatically available in your cakephp project.

So all you need for external libraries to work is to add the apropriate `use` statements in your class and you should be fine.

---

<div class="post-metadata">

**Author:** ![harendra](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@harendra](https://discourse.cakephp.org/u/harendra)\
**Post date:** [January 7, 2023, 7:14am UTC](https://discourse.cakephp.org/t/lib-error-while-api-integration-of-amazon-seller/10882/5 "2023-01-07T07:14:13Z")

</div>

Thanks for the suggestion it is work good in cake 4.4
