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

ActiveLibrary[Payment Processing](/categories/payments)

abacatepay/php-sdk
==================

A robust PHP SDK for integrating AbacatePay payment solutions into your applications.

v1.0.0(1y ago)231.4k↓43.3%7[3 PRs](https://github.com/AbacatePay/abacatepay-php-sdk/pulls)PHP

Since Dec 8Pushed 6mo ago4 watchersCompare

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

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

AbacatePay SDK for PHP
======================

[](#abacatepay-sdk-for-php)

A robust PHP SDK for integrating AbacatePay payment solutions into your applications.

📋 Requirements
--------------

[](#-requirements)

- PHP 7.2.5 or higher
- Composer
- Valid AbacatePay account and API credentials
- SSL enabled for production environments

💻 Installation
--------------

[](#-installation)

Install the SDK via Composer:

```
composer require abacatepay/php-sdk
```

🔧 Configuration
---------------

[](#-configuration)

First, initialize the SDK with your API token:

```
use AbacatePay\Clients\Client;

Client::setToken($_ENV["ABACATEPAY_TOKEN"]);
```

> ⚠️ Never commit your API tokens to version control. Use environment variables instead.

🌟 Features
----------

[](#-features)

- Simple billing management
- Customer management
- Multiple payment methods support
- Webhook handling
- Secure payment processing
- Error handling and logging

📘 Usage Examples
----------------

[](#-usage-examples)

### Billing Management

[](#billing-management)

Initialize the Billing Client

```
use AbacatePay\Clients\BillingClient;

$billingClient = new BillingClient();
```

#### List All Billings

[](#list-all-billings)

```
$billings = $billingClient->list();
```

#### Create a New Billing

[](#create-a-new-billing)

```
use AbacatePay\Resources\Billing;
use AbacatePay\Resources\Billing\Product;
use AbacatePay\Resources\Billing\Metadata as BillingMetadata;
use AbacatePay\Enums\Billing\Methods;
use AbacatePay\Enums\Billing\Frequencies;
use AbacatePay\Resources\Customer;
use AbacatePay\Resources\Customer\Metadata as CustomerMetadata;

$billing = $billingClient->create(new Billing([
    'frequency' => Frequencies::ONE_TIME,
    'methods' => [Methods::PIX],
    'products' => [
        new Product([
            'external_id' => 'abc_123',
            'name' => 'Product A',
            'description' => 'Description of product A',
            'quantity' => 1,
            'price' => 100 // Price in cents
        ])
    ],
    'metadata' => new BillingMetadata([
        'return_url' => 'https://www.abacatepay.com',
        'completion_url' => 'https://www.abacatepay.com'
    ]),
    'customer' => new Customer([
        'metadata' => new CustomerMetadata([
            'name' => 'John Doe',
            'cellphone' => '01912341234',
            'email' => 'john@example.com',
            'tax_id' => '13827826837'
        ])
    ])
]));
```

It is also possible to use the ID of an existing customer:

```
// ...
    'customer' => new Customer([
        'id' => 'abc_123'
    ])
// ...
```

### Customer Management

[](#customer-management)

Initialize the Customer Client

```
use AbacatePay\Clients\CustomerClient;
use AbacatePay\Resources\Customer;

$customerClient = new CustomerClient();
```

#### List All Customers

[](#list-all-customers)

```
$customers = $customerClient->list();
```

#### Create a New Customer

[](#create-a-new-customer)

```
use AbacatePay\Resources\Customer;
use AbacatePay\Resources\Customer\Metadata;

$customer = $customerClient->create(new Customer([
    'metadata' => new Metadata([
        'name' => 'John Doe',
        'cellphone' => '01912341234',
        'email' => 'john@example.com',
        'tax_id' => '13827826837'
    ])
]));
```

⚡ Quick Tips
------------

[](#-quick-tips)

- Use environment variables for API tokens
- Enable error reporting in development
- Always validate customer input
- Handle exceptions appropriately
- Keep the SDK updated

🔍 Error Handling
----------------

[](#-error-handling)

```
use AbacatePay\Exceptions\ApiException;

try {
    $billing = $billingClient->create($billingData);
} catch (ApiException $e) {
    // Handle API-specific errors
    echo $e->getMessage();
} catch (\Exception $e) {
    // Handle general errors
    echo $e->getMessage();
}
```

📚 Documentation
---------------

[](#-documentation)

For detailed API documentation and integration guides:

- API Reference
- Integration Guide
- API Status

🛠️ Development
--------------

[](#️-development)

### Installing packages

[](#installing-packages)

```
composer install --dev

```

### Running Tests

[](#running-tests)

```
composer test
```

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please see our Contributing Guide for details.

1. Fork the repository
2. Create your feature branch (git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add amazing feature')
4. Push to the branch (git push origin feature/amazing-feature)
5. Open a Pull Request

🔒 Security
----------

[](#-security)

For security issues, please see our Security Policy.

📄 License
---------

[](#-license)

This project is licensed under the MIT License - see the LICENSE file for details.

💬 Support
---------

[](#-support)

- For SDK issues, open an issue
- For API questions, contact
- For urgent issues, contact our support team

Made with ❤️ by AbacatePay Community

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance54

Moderate activity, may be stable

Popularity31

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 63.6% 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

Unknown

Total

1

Last Release

527d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/31f57c1fb89747385c7563ca2ce94666f7f72534fa0d7ca4efc88023d82546f2?d=identicon)[jjr-dev](/maintainers/jjr-dev)

---

Top Contributors

[![jjr-dev](https://avatars.githubusercontent.com/u/71138607?v=4)](https://github.com/jjr-dev "jjr-dev (14 commits)")[![matheuscarddoso](https://avatars.githubusercontent.com/u/92444207?v=4)](https://github.com/matheuscarddoso "matheuscarddoso (7 commits)")[![rafaelqueiroz](https://avatars.githubusercontent.com/u/275919?v=4)](https://github.com/rafaelqueiroz "rafaelqueiroz (1 commits)")

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[chargebee/chargebee-php

ChargeBee API client implementation for PHP

768.0M9](/packages/chargebee-chargebee-php)[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42337.5k4](/packages/bitpay-sdk)[buckaroo/sdk

Buckaroo payment SDK

12189.1k9](/packages/buckaroo-sdk)[contica/facturador-electronico-cr

Un facturador de código libre para integrar facturación electrónica en Costa Rica a un proyecto PHP

2128.8k](/packages/contica-facturador-electronico-cr)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)

PHPackages © 2026

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