PHPackages                             heureka/hcapi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. heureka/hcapi

ActiveLibrary[API Development](/categories/api)

heureka/hcapi
=============

Heureka shopping cart API

v1.0.1(7y ago)254.5k↓41.4%3[1 PRs](https://github.com/heureka/hcapi/pulls)MITPHPPHP &gt;=5.4.0

Since Jun 28Pushed 7y ago19 watchersCompare

[ Source](https://github.com/heureka/hcapi)[ Packagist](https://packagist.org/packages/heureka/hcapi)[ RSS](/packages/heureka-hcapi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

**Heureka cart API**
--------------------

[](#heureka-cart-api)

Hcapi is a tool created for easier connection between shopping adviser Heureka.cz and shops which users of these services and shopping cart want.

**Usage**
---------

[](#usage)

**Install by composer:**

```
composer require heureka/hcapi

```

**Implementation**
------------------

[](#implementation)

In this section you will find the manual for hcapi implementation to your project.

Connection via Callables
------------------------

[](#connection-via-callables)

First way how to connect your shop by HCAPI is using Callable callback.

In your code must create functions (for all services), which receive data from Heureka (array), process them and return required data (array). Structure of required data you can find [there](http://sluzby.heureka.cz/napoveda/kosik-api/).

Example of function for **Payment/Status**:

```
//PaymentStatus.php

public function setPaymentStatus($receiveData)
    {
        //set payment status for order

        return [
            'status' => false,
        ];
    }

```

In second step you must connect these functions with your routing. You must use specific service for every from API methods. For example **Payment/Status**:

```
//Router.php

if ($_SERVER['REQUEST_URI'] === 'https://www.example.com/api/1/payment/status') {
            $service = new PaymentStatus();
            return $service->processData(
                [
                    'Hcapi\Example\CallableExample\PaymentStatus',
                    'setPaymentStatus',
                ],
                $receiveData);
        }

```

Services are located in /src/Services/ More examples are located in /example/InterfaceExample/

Implementation via Interfaces
-----------------------------

[](#implementation-via-interfaces)

Second way how to connect your shop by HCAPI is via Interfaces. In folder /scr/Interfaces/ is located interface IShopImplementation.php. You must implement this interface for all classes which work with data from Heureka.

Example:

```
class OrderCancel implements IShopImplementation
{
    /**
     * @param array $receiveData
     *
     * @return array
     */
    public function getResponse($receiveData)
    {
        //Do something with receive data

        return [
            'status' => true,
        ];
    }

}

```

In second step you must connect this functions to your routing. You must use specific service for every from API methods. For example **Order/Cancel**:

```
if ($_SERVER['REQUEST_URI'] === 'https://www.example.com/api/1/order/cancel') {
    $service = new OrderCancel();
    $orderCancel = new \Hcapi\Example\InterfaceExample\OrderCancel();

    return $service->processData($orderCancel, $receiveData);
}

```

More examples are located in /example/CallableExample/

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~871 days

Total

2

Last Release

2740d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2efa5abba18c993be6ab763c4d879e50af01c9bd12a56c13e670ac45e8256300?d=identicon)[heureka](/maintainers/heureka)

---

Top Contributors

[![oldrichtaufer](https://avatars.githubusercontent.com/u/14940325?v=4)](https://github.com/oldrichtaufer "oldrichtaufer (3 commits)")[![hubipe](https://avatars.githubusercontent.com/u/617880?v=4)](https://github.com/hubipe "hubipe (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/heureka-hcapi/health.svg)

```
[![Health](https://phpackages.com/badges/heureka-hcapi/health.svg)](https://phpackages.com/packages/heureka-hcapi)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
