PHPackages                             sumup/sumup-php - 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. [Payment Processing](/categories/payments)
4. /
5. sumup/sumup-php

ActiveLibrary[Payment Processing](/categories/payments)

sumup/sumup-php
===============

SumUp PHP SDK

0.1.0(2mo ago)5590↑150%1[2 PRs](https://github.com/sumup/sumup-php/pulls)Apache-2.0PHPPHP ^8.2CI passing

Since Jan 31Pushed 1mo agoCompare

[ Source](https://github.com/sumup/sumup-php)[ Packagist](https://packagist.org/packages/sumup/sumup-php)[ Docs](https://developer.sumup.com)[ RSS](/packages/sumup-sumup-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (11)Used By (0)

SumUp PHP SDK
=============

[](#sumup-php-sdk)

[![Stars](https://camo.githubusercontent.com/b20a0c7df6a4c4ba57231819f052bdaf8deedc6e353d4ab8d52614c244c72558/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f73756d75702f73756d75702d7068703f7374796c653d736f6369616c)](https://github.com/sumup/sumup-php)[![Latest Stable Version](https://camo.githubusercontent.com/fa2fb1cc95108a1a55cba9766cf84f97d64e70ec800a39fd82795ed4a52415cc/68747470733a2f2f706f7365722e707567782e6f72672f73756d75702f73756d75702d7068702f762f737461626c652e737667)](https://packagist.org/packages/sumup/sumup-php)[![Total Downloads](https://camo.githubusercontent.com/b85f2b623f15bea153b4249d1562921a4d0ac5af2d51bfa1f03118683996f764/68747470733a2f2f706f7365722e707567782e6f72672f73756d75702f73756d75702d7068702f646f776e6c6f6164732e737667)](https://packagist.org/packages/sumup/sumup-php)[![License](https://camo.githubusercontent.com/caf71226eb43bc96275b593bd9c989bba9c7d83ddd5cb48cd3e1361ed1545acf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73756d75702f73756d75702d706870)](./LICENSE)[![Contributor Covenant](https://camo.githubusercontent.com/b9aeaca087579cf993753d79790e77a39229cdd72876bae3f8139d9e4f407999/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e7472696275746f72253230436f76656e616e742d76322e3125323061646f707465642d6666363962342e737667)](https://github.com/sumup/sumup-php/tree/main/CODE_OF_CONDUCT.md)

Overview
--------

[](#overview)

This repository contains the open source PHP SDK that allows you to integrate quickly with the SumUp's [API](https://developer.sumup.com/rest-api) endpoints.

Installation
------------

[](#installation)

The SumUp PHP SDK can be installed with [Composer](https://getcomposer.org/). Run the following command:

```
composer require sumup/sumup-php
```

Basic Usage
-----------

[](#basic-usage)

Before using the SDK, set the `SUMUP_API_KEY` environment variable with your API key. The SDK will automatically use this key for authentication.

```
export SUMUP_API_KEY='your-api-key-here'
```

Then create checkouts and use other API endpoints:

```
try {
    // SDK automatically uses SUMUP_API_KEY environment variable
    $sumup = new \SumUp\SumUp();

    $request = new \SumUp\Types\CheckoutCreateRequest([
        'amount' => 10.00,
        'currency' => 'EUR', // or CheckoutCreateRequestCurrency::EUR
        'checkout_reference' => 'your-checkout-ref',
        'merchant_code' => 'YOUR-MERCHANT-CODE',
    ]);

    $checkout = $sumup->checkouts()->create($request);

    $checkoutId = $checkout->id;
    // Pass the $checkoutId to the front-end to be processed
} catch (\SumUp\Exception\ApiException $e) {
    echo 'Expected API error (status ' . $e->getStatusCode() . '): ' . $e->getMessage();
    // Body is decoded according to the OpenAPI error schema for that endpoint/status.
    var_dump($e->getResponseBody());
} catch (\SumUp\Exception\UnexpectedApiException $e) {
    echo 'Unexpected API error (status ' . $e->getStatusCode() . '): ' . $e->getMessage();
    // Body did not match an OpenAPI-described error shape.
    // Use the normalized envelope for stable logging/handling.
    var_dump($e->getErrorEnvelope()->toArray());
} catch (\SumUp\Exception\SDKException $e) {
    echo 'SumUp SDK error (status ' . $e->getStatusCode() . '): ' . $e->getMessage();
    // Covers connection/configuration and other non-API failures.
}
```

Service methods also accept associative arrays as request payloads. For typed usage, prefer DTOs from `\SumUp\Types\...` with `new TypeName([...])`.

### Providing API Key Programmatically

[](#providing-api-key-programmatically)

If you prefer to provide the API key directly in your code instead of using the environment variable:

```
$sumup = new \SumUp\SumUp('your-api-key-here');
```

### TLS Certificates

[](#tls-certificates)

The SDK ships with the latest Mozilla CA bundle to prevent `SSL certificate problem: unable to get local issuer certificate` errors on Windows and other environments that do not expose a system-wide trust store. You can override the bundled file by passing the `ca_bundle_path` configuration key:

```
$sumup = new \SumUp\SumUp([
    'ca_bundle_path' => __DIR__ . '/storage/certs/company-ca.pem',
]);
```

If not provided, the bundled `resources/ca-bundle.crt` file is used automatically by the cURL HTTP client.

### Custom HTTP Client

[](#custom-http-client)

The SDK allows you to use a custom HTTP client for making requests. By default, the SDK uses cURL, but you can provide your own implementation:

```
// Create your custom HTTP client that implements HttpClientInterface
$customClient = new YourCustomHttpClient();

// Pass it to the SDK (uses SUMUP_API_KEY environment variable)
$sumup = new \SumUp\SumUp([
    'client' => $customClient,
]);

// Or provide API key explicitly
$sumup = new \SumUp\SumUp([
    'api_key' => 'your-api-key-here',
    'client' => $customClient,
]);
```

This is useful for adding logging, retry logic, or using a different HTTP library. See `examples/custom-http-client.php` for a complete example. If you prefer Guzzle, check `examples/guzzle-http-client.php` (requires `guzzlehttp/guzzle`).

### Guzzle HTTP Client (Optional)

[](#guzzle-http-client-optional)

If you want to use Guzzle, the SDK ships with a built-in client that does not add a hard dependency. Install Guzzle and pass the client into the SDK:

```
composer require guzzlehttp/guzzle
```

```
$guzzleClient = new \SumUp\HttpClient\GuzzleClient('https://api.sumup.com');
$sumup = new \SumUp\SumUp([
    'api_key' => 'your-api-key-here',
    'client' => $guzzleClient,
]);
```

### Request Options

[](#request-options)

Service methods accept typed request options via `\SumUp\HttpClient\RequestOptions`:

```
$options = new \SumUp\HttpClient\RequestOptions(
    timeout: 30,
    connectTimeout: 10,
    retries: 2,
    retryBackoffMs: 200
);

$checkout = $sumup->checkouts()->get('checkout-id', $options);
```

Examples
--------

[](#examples)

The repository includes runnable examples:

- `examples/simple.php` - basic SDK initialization and merchant fetch. Run with: `php examples/simple.php`
- `examples/checkout.php` - create and process a checkout. Run with: `php examples/checkout.php`
- `examples/custom-http-client.php` - wrap/customize HTTP behavior. Run with: `php examples/custom-http-client.php`
- `examples/guzzle-http-client.php` - use the built-in Guzzle client. Run with: `php examples/guzzle-http-client.php`

For checkout-related examples, set:

```
export SUMUP_API_KEY='your-api-key-here'
export SUMUP_MERCHANT_CODE='your-merchant-code'
```

API Reference
-------------

[](#api-reference)

For a full list of available services and methods, explore the service files under `src/*/*.php` (for example `src/Checkouts/Checkouts.php`) or check the inline documentation in the code.

License
-------

[](#license)

For information about the license see the [license](https://github.com/sumup/sumup-php/blob/master/LICENSE.md) file.

Contact Us
----------

[](#contact-us)

If you have found a bug or you lack some functionality please [open an issue](https://github.com/sumup/sumup-php/issues/new). If you have other issues when integrating with SumUp's API you can send an email to .

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance87

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.8% 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 ~22 days

Total

2

Last Release

84d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/589d21db2c2c967e27550fa21e8b238e7fc0ce1bb6debaf171eade7047514d2d?d=identicon)[matoous](/maintainers/matoous)

---

Top Contributors

[![matoous](https://avatars.githubusercontent.com/u/15747583?v=4)](https://github.com/matoous "matoous (70 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (26 commits)")[![appscisumup](https://avatars.githubusercontent.com/u/30830081?v=4)](https://github.com/appscisumup "appscisumup (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

paymentsphpsdksumupsdkpaymentscheckoutsumup

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[sumup/sumup-ecom-php-sdk

SumUp PHP SDK

51277.1k1](/packages/sumup-sumup-ecom-php-sdk)[tatter/stripe

Stripe SDK integration for CodeIgniter 4

115.3k](/packages/tatter-stripe)

PHPackages © 2026

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