PHPackages                             potelo/inter-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. [API Development](/categories/api)
4. /
5. potelo/inter-php

ActiveLibrary[API Development](/categories/api)

potelo/inter-php
================

Banco Inter PHP Library

621[1 issues](https://github.com/Potelo/inter-php/issues)PHP

Since Apr 2Pushed 3y ago3 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Banco Inter PHP client
======================

[](#banco-inter-php-client)

The Banco Inter PHP client provides convenient access to the Banco Inter API from applications written in the PHP language.

### Other languages

[](#other-languages)

[![en](https://camo.githubusercontent.com/9687410941adb91c2f673c9d50ef38544f3e9a38a6b9f9367cac918a8d3e2a41/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c616e672d656e2d7265642e737667)](https://github.com/Potelo/inter-php/blob/main/README.md)[![pt-br](https://camo.githubusercontent.com/03443f2a7a42ea03f0747d7bb784c5e42ee3f2c09e27bab66436a5021cc05c0c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c616e672d70742d2d62722d677265656e2e737667)](https://github.com/Potelo/inter-php/blob/main/README.pt-br.md)

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

[](#requirements)

PHP 7.4.0 and later.

Composer
--------

[](#composer)

You can install the package via [Composer](http://getcomposer.org/). Run the following command:

```
composer require potelo/inter-php
```

Or simply add it to your composer.json dependences and run `composer update`:

```
"require": {
    "potelo/inter-php": "dev-main"
}
```

To use the client, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

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

Dependencies
------------

[](#dependencies)

The library require the following extensions in order to work properly:

- [`Guzzle`](https://github.com/guzzle/guzzle)
- [`json`](https://secure.php.net/manual/en/book.json.php)

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.

Usage
-----

[](#usage)

- [Getting Authorization](#getting-authorization)
- [Bank Slip](#bank-slip)
- [Immediate Charge](#immediate-charge)
- [Pix](#pix)

### Getting Authorization [doc](https://developers.bancointer.com.br/reference/token-1)

[](#getting-authorization-doc)

```
$privateKey = 'you-private-key-path.key';
$certificate = 'you-certificate-path.crt';
$clientId = 'you-client-id';
$clientSecret = 'your-client-secret';

$client = new \Potelo\InterPhp\InterClient($privateKey, $certificate, $clientId, $clientSecret);

$scopes = ['cob.read'];
$client->authorize($scopes);
```

You can get new token with new scopes using the same client instance:

```
$scopes = ['cob.read', 'cob.write', 'pix.read', 'pix.write'];
$client->authorize($scopes);
```

### `Bank Slip` Charge API

[](#bank-slip-charge-api)

#### `get` [doc](https://developers.bancointer.com.br/reference/consultarboleto)

[](#get-doc)

Get a Bank Slip.

```
$bankSlip = $client->bankSlipApi()->get('bank-slip-our-number');

print_r($bankSlip);
```

#### `getPdf` [doc](https://developers.bancointer.com.br/reference/descarregarpdfboleto)

[](#getpdf-doc)

Get a Bank Slip PDF.

```
$bankSlip = $client->bankSlipApi()->getPdf('bank-slip-our-number');

print_r($bankSlip);
```

#### `create` [doc](https://developers.bancointer.com.br/reference/incluirboleto-1)

[](#create-doc)

Create a Bank Slip.

```
$yorNumber = "your-number";
$dueDate = new \DateTime('2023-03-31');
$payer = new Payer("cpf number", "FISICA", "Payer Name", "Address", "Salvador", "BA", "41000000");
$bankSlip = $this->client->bankSlipApi()->create($yorNumber, 10.90, $dueDate, 0, $payer);

print_r($bankSlip);
```

#### `list` [doc](https://developers.bancointer.com.br/reference/pesquisarboletos-1)

[](#list-doc)

Get a list of Bank Slips in a period.

```
$after = new \DateTime('2023-03-31');
$before = new \DateTime('2023-03-31');
$bankSlips = $this->client->bankSlipApi()->list($after, $before);

print_r($bankSlips);
```

#### Other filters

[](#other-filters)

You can pass an array of filters to the `list` method.

```
$after = new \DateTime('2023-03-31');
$before = new \DateTime('2023-03-31');
$filters = [
    'filtrarDataPor' => 'VENCIMENTO',
];

$bankSlips = $this->client->bankSlipApi()->list($after, $before, $filters);

print_r($bankSlips);
```

#### `summary` [doc](https://developers.bancointer.com.br/reference/consultarsumario-1)

[](#summary-doc)

Get a summary of a list of Bank Slips.

```
$after = new \DateTime('2023-03-31');
$before = new \DateTime('2023-03-31');
$summary = $this->client->bankSlipApi()->summary($after, $before);

print_r($summary);
```

#### `cancel` [doc](https://developers.bancointer.com.br/reference/baixarboleto)

[](#cancel-doc)

Cancel a Bank Slip.

```
$cancelReason = "APEDIDODOCLIENTE";
$this->client->bankSlipApi()->cancel('bank-slip-our-number', $cancelReason);
```

### `Immediate Charge` Pix API

[](#immediate-charge-pix-api)

#### `get` [doc](https://developers.bancointer.com.br/reference/get_cob-txid-1)

[](#get-doc-1)

Get an Immediate Charge by transaction id.

```
$immediateCharge = $client->immediateChargeApi()->get('your-immediate-charge-txid');

print_r($immediateCharge);
```

#### `create` [doc](https://developers.bancointer.com.br/reference/post_cob-1)

[](#create-doc-1)

Create an Immediate Charge.

```
$amount = 12.50;
$pixKey = 'your-pix-key';
$expiry = 3600; // seconds

$data = [
    "devedor" => [
        "cpf" => "01234567891",
        "nome" => "John Doe"
    ],
    "loc" => [
        "tipoCob" => "cob"
    ],
    "solicitacaoPagador" => " ",
    "infoAdicionais" => [
        [
            "nome" => "Product",
            "valor" => "cool pajamas"
        ]
    ]
];

$immediateCharge = $client->immediateChargeApi()->create($pixKey, $amount, $expiry, $data);

print_r($immediateCharge);
```

#### `createAs` [doc](https://developers.bancointer.com.br/reference/put_cob-txid-1)

[](#createas-doc)

Create an Immediate Charge specifying a unique transaction id.

```
$txId = 'your-unique-transaction-id';
$amount = 12.44;
$pixKey = 'your-pix-key';
$secondsToExpiry = 3600;

$data = [
    "devedor" => [
        "cpf" => "01234567891",
        "nome" => "John Doe"
    ],
    "loc" => [
        "tipoCob" => "cob"
    ],
    "solicitacaoPagador" => " ",
    "infoAdicionais" => [
        [
            "nome" => "Product",
            "valor" => "cool pajamas"
        ]
    ]
];

$immediateCharge = $client->immediateChargeApi()->createAs($txId, $pixKey, $amount, $secondsToExpiry, $data);

print_r($immediateCharge);
```

#### `update` [doc](https://developers.bancointer.com.br/reference/patch_cob-txid-1)

[](#update-doc)

Update an Immediate Charge.

```
$data = [
    "valor" => 22.50
];
$immediateCharge = $client->immediateChargeApi()->update('immediate-charge-txid', $data);

print_r($immediateCharge);
```

#### `list` [doc](https://developers.bancointer.com.br/reference/get_cob-1)

[](#list-doc-1)

Get a list of Immediate Charges in a period.

```
$after = new \DateTime('2023-03-01T00:00:00-03:00');
$before = new \DateTime('2023-03-23T23:59:00-03:00');

$immediateCharges = $client->immediateChargeApi()->list($after, $before);

print_r($immediateCharges);
```

#### Other filters

[](#other-filters-1)

You can pass an array of filters to the `list` method.

```
$after = new \DateTime('2023-03-01T00:00:00-03:00');
$before = new \DateTime('2023-03-23T23:59:00-03:00');
$filters = [
    'cpf' => '01234567891',
];

$immediateCharges = $client->immediateChargeApi()->list($after, $before, $filters);

print_r($immediateCharges);
```

### `Pix` Pix API

[](#pix-pix-api)

#### `get` [doc](https://developers.bancointer.com.br/reference/get_pix-e2eid-1)

[](#get-doc-2)

Get a Pix by transaction id.

```
$pix = $client->pixApi()->get('pix-endToEndId');

print_r($pix);
```

#### `list` [doc](https://developers.bancointer.com.br/reference/get_pix-1)

[](#list-doc-2)

Get a list of Pix in a period.

```
$after = new \DateTime('2023-03-01T00:00:00-03:00');
$before = new \DateTime('2023-03-23T23:59:00-03:00');

$pixList = $client->immediateChargeApi()->list($after, $before);

print_r($pixList);
```

#### `returnPix` [doc](https://developers.bancointer.com.br/reference/put_pix-e2eid-devolucao-id-1)

[](#returnpix-doc)

Return a Pix.

```
$id = 'your-unique-id';
$amountToReturn = 12.44;
$pix = $client->pixApi()->returnPix('pix-endToEndId', $id, $amountToReturn);

print_r($pix);
```

#### `getReturnPix` [doc](https://developers.bancointer.com.br/reference/get_pix-e2eid-devolucao-id-1)

[](#getreturnpix-doc)

Get a Pix return.

```
$id = 'your-unique-id';
$pix = $client->pixApi()->getReturnPix('pix-endToEndId', $id);

print_r($pix);
```

API Documentation
-----------------

[](#api-documentation)

The Banco Inter API documentation can be found [here](https://developers.bancointer.com.br/).

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ffd057699c6f31586d7883c4f8a903048c26a1c3ccef618caf02738ddfd254ee?d=identicon)[potelo](/maintainers/potelo)

---

Top Contributors

[![marivaldojr](https://avatars.githubusercontent.com/u/2505142?v=4)](https://github.com/marivaldojr "marivaldojr (11 commits)")

---

Tags

banco-interinter-sdkphp

### Embed Badge

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

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

###  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)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

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

PHP wrapper for the Meilisearch API

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

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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