PHPackages                             piggy/piggy-php-sdk - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. piggy/piggy-php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

piggy/piggy-php-sdk
===================

php sdk piggy

3.12.3(1mo ago)027.5k↓42.9%51MITPHPPHP &gt;=7.2CI passing

Since Apr 7Pushed 1mo agoCompare

[ Source](https://github.com/leat-api/piggy-php-sdk)[ Packagist](https://packagist.org/packages/piggy/piggy-php-sdk)[ RSS](/packages/piggy-piggy-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (61)Used By (1)

Piggy PHP SDK
=============

[](#piggy-php-sdk)

With [Piggy's](https://www.piggy.eu/) all-in-one platform you can strengthen loyalty and automate every step. From reward programs, to branded giftcards and smart email marketing - Piggy takes care of it all.

You can use this package to connect your application / POS-system (Register) to a Piggy account. Please make sure to choose the right API Client for your needs.

Full documentation about our API can be found here

Versions
--------

[](#versions)

You should use v3 of this SDK. However this is *not* backward compatible with v1.\* of this SDK.

Requirements
------------

[](#requirements)

This SDK requires PHP 7.2 or higher. Currently our test suite runs against PHP 7.2, 7.3, 7.4, 8.0, 8.1

Setup
-----

[](#setup)

**Composer:**

```
composer require piggy/piggy-php-sdk

```

Quickstart
----------

[](#quickstart)

**Example with Register Client**

```
$apiKey = 'xxxx-xxxx-xxxx';
$client = new Piggy\Api\RegisterClient($apiKey);

try {
    $contact = $client->contacts->findOneBy('test@domain.com'); // Example call to find a Contact by e-mail address
} catch(Piggy\Api\Exceptions\MaintenanceModeException $e) {
    // Catch maintenance mode specific.
} catch(Piggy\Api\Exceptions\PiggyRequestException $e) {
    // If no Contact is found, you'd know that from this exception
} catch(\Exception $e) {
    // Handle any other exceptions
}

```

**Example with Static Functions using API Key**

```
$apiKey = 'xxxxxxxx';
$baseUrl = "https://api.piggy.eu";

ApiClient::configure($apiKey, $baseUrl);

try {
    // Example call to update a Contact by UUID
    Contact::update("1234ab-7890-asdf-1234-a1b2c3d4", ["attributes" => ["firstname" => "henk", "housenumber" => 10]]);
} catch(Piggy\Api\Exceptions\MaintenanceModeException $e) {
    // Catch maintenance mode specific.
} catch(GuzzleHttp\Exception\GuzzleException $e) {
    // If no Contact is found, you'd know that from this exception
} catch(\Exception $e) {
    // Handle any other exceptions
}

```

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance89

Actively maintained with recent releases

Popularity30

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~40 days

Recently: every ~106 days

Total

46

Last Release

56d ago

Major Versions

0.0.11 → 1.0.02021-07-05

1.1.6 → 2.0.x-dev2022-07-06

2.0.x-dev → v3.0.0-beta12022-07-06

3.11.3 → v4.x-dev2025-01-22

PHP version history (2 changes)0.0.1PHP &gt;=7.2

v4.x-devPHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/a2e4f22b375c8f49a7a69ac3c107ab4850f1de8aa7ca548f6adcd37e6ef22974?d=identicon)[piggy-loyalty](/maintainers/piggy-loyalty)

---

Top Contributors

[![LarsWoltersLeat](https://avatars.githubusercontent.com/u/205599195?v=4)](https://github.com/LarsWoltersLeat "LarsWoltersLeat (22 commits)")[![LarsWoltersPiggy](https://avatars.githubusercontent.com/u/178478750?v=4)](https://github.com/LarsWoltersPiggy "LarsWoltersPiggy (19 commits)")[![ElwinLeat](https://avatars.githubusercontent.com/u/107470895?v=4)](https://github.com/ElwinLeat "ElwinLeat (16 commits)")[![freerkminnema](https://avatars.githubusercontent.com/u/41089591?v=4)](https://github.com/freerkminnema "freerkminnema (11 commits)")[![EdingerMike](https://avatars.githubusercontent.com/u/12659917?v=4)](https://github.com/EdingerMike "EdingerMike (10 commits)")[![Thibaux](https://avatars.githubusercontent.com/u/38690826?v=4)](https://github.com/Thibaux "Thibaux (7 commits)")[![teunkoster](https://avatars.githubusercontent.com/u/1105804?v=4)](https://github.com/teunkoster "teunkoster (7 commits)")[![iDiegoNL](https://avatars.githubusercontent.com/u/10339564?v=4)](https://github.com/iDiegoNL "iDiegoNL (4 commits)")[![Nickgoslinga](https://avatars.githubusercontent.com/u/87081717?v=4)](https://github.com/Nickgoslinga "Nickgoslinga (2 commits)")[![sleenen](https://avatars.githubusercontent.com/u/5849223?v=4)](https://github.com/sleenen "sleenen (2 commits)")[![bas-franke](https://avatars.githubusercontent.com/u/22520391?v=4)](https://github.com/bas-franke "bas-franke (2 commits)")[![larswoltersdev](https://avatars.githubusercontent.com/u/32078923?v=4)](https://github.com/larswoltersdev "larswoltersdev (1 commits)")

---

Tags

email-marketingemail-marketing-automationemail-marketing-campaignsemail-sendergiftcardsloyaltyloyalty-programsloyalty-rewardsloyaltyprogrammarketingmarketing-automation

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/piggy-piggy-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/piggy-piggy-php-sdk/health.svg)](https://phpackages.com/packages/piggy-piggy-php-sdk)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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