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

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

kayon-ariel/pix-php
===================

Library to generate Static PIX codes in PHP

v1.0.2(1y ago)20942↑22.2%1MITPHPPHP &gt;=8.2

Since Oct 9Pushed 1y ago2 watchersCompare

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

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

PixPhp
======

[](#pixphp)

A PHP library to generate static PIX codes, facilitating online payments with PIX copy and paste.

[![PHP Version](https://camo.githubusercontent.com/57a4b2b97b530830a27833fee0e4f091c19a05a2936c2e4a1b319d1349ad1f35/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d627269676874677265656e)](https://camo.githubusercontent.com/57a4b2b97b530830a27833fee0e4f091c19a05a2936c2e4a1b319d1349ad1f35/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d627269676874677265656e) [![License](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565) [![Packagist Downloads](https://camo.githubusercontent.com/62ef97c701b353bf9c862ebf646db7d896df6140233797070c39d759233917a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6b61796f6e2d617269656c2f7069782d7068702e7376673f6c6162656c3d5061636b6167697374253230646f776e6c6f616473)](https://packagist.org/packages/kayon-ariel/pix-php)

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
- [Accepted Key Types](#accepted-key-types)
- [Example Usage](#example-usage)

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

[](#installation)

You can install the library via Composer. Run the following command:

```
composer require kayon-ariel/pix-php
```

Usage
-----

[](#usage)

### Step 1: Include the Autoloader

[](#step-1-include-the-autoloader)

Once installed, include the Composer autoloader in your PHP script:

```
require 'vendor/autoload.php';
```

### Step 2: Import the Namespace

[](#step-2-import-the-namespace)

Import the PixPhp namespace at the beginning of your PHP file:

```
use PixPhp\StaticPix;
```

### Step 3: Generate a PIX Code

[](#step-3-generate-a-pix-code)

You can generate a PIX code using the generatePix method. Here's a basic example:

```
// Generate a PIX code
$pixCode = StaticPix::generatePix('your-pix-key', 'Transaction-ID', 100.00, 'Payment description');

// Display the generated PIX code
echo $pixCode;
```

Accepted Key Types
------------------

[](#accepted-key-types)

In the `PixPhp` library, the following types of keys are accepted for generating PIX codes:

1. **CPF (Cadastro de Pessoas Físicas)**

    - **Format:** `123.456.789-09`
    - **Description:** A Brazilian individual taxpayer identification number. The library accepts CPF numbers with or without formatting.
2. **CNPJ (Cadastro Nacional da Pessoa Jurídica)**

    - **Format:** `12.345.678/0001-95`
    - **Description:** A Brazilian business taxpayer identification number. The library accepts CNPJ numbers with or without formatting.
3. **Email**

    - **Format:** `example@test.com`
    - **Description:** A valid email address. The library accepts well-formed email addresses as PIX keys.
4. **Phone**

    - **Format:** `+55 11 91234-5678`
    - **Description:** A Brazilian phone number including the country code. The library accepts phone numbers with various formatting styles, including spaces and dashes, while retaining the `+55` prefix.
5. **Random Key**

    - **Format:** `617ef6be-e18e-427f-919b-6e43bae33400`
    - **Description:** The Pix random key is a 32-character alphanumeric code, randomly generated by the Central Bank to be linked to a single account.

Example Usage
-------------

[](#example-usage)

You can pass any of the accepted key types to the `generatePix` method:

```
// Using CPF
$pixCodeCpf = StaticPix::generatePix("123.456.789-09", "ID123", 100.00);

// Using CNPJ
$pixCodeCnpj = StaticPix::generatePix("12.345.678/0001-95", "ID456", 250.50);

// Using Email
$pixCodeEmail = StaticPix::generatePix("example@test.com", "ID789", 50.00);

// Using Phone
$pixCodePhone = StaticPix::generatePix("+55 11 91234-5678", "ID101", 75.00);

// Using Random Key
$pixCodeRandom = StaticPix::generatePix("617ef6be-e18e-427f-919b-6e43bae33400", "ID102", 30.00);
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

586d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/90801274?v=4)[Kayon Ariel](/maintainers/kayon-ariel)[@kayon-ariel](https://github.com/kayon-ariel)

---

Top Contributors

[![kayon-ariel](https://avatars.githubusercontent.com/u/90801274?v=4)](https://github.com/kayon-ariel "kayon-ariel (7 commits)")

---

Tags

bacenbackendinstant-paymentspaymentsphppix

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kayon-ariel-pix-php/health.svg)

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

###  Alternatives

[lvzhao1995/amap-sdk

高德地图SDK

1211.7k](/packages/lvzhao1995-amap-sdk)[moura137/laravel-elephantio

ElephantIO Service Provider for the Laravel PHP Framework

107.0k](/packages/moura137-laravel-elephantio)

PHPackages © 2026

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