PHPackages                             lopes/asaas - 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. lopes/asaas

ActiveLibrary

lopes/asaas
===========

Asaas API

0231PHP

Since May 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/elvis-s-lopes/asaas-sdk)[ Packagist](https://packagist.org/packages/lopes/asaas)[ RSS](/packages/lopes-asaas/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Asaas sdk
=========

[](#asaas-sdk)

Exemplo de uso.

```
use Lopes\Asaas\Facade\Asaas

Asaas::payment()->find()
```

**SDK para uso em projetos Laravel da Smartgps**

Esse pacote permite chamadas na API da asaas de forma simplificada, encapsulando os processos de conexão e tratamento de dados. As função disponibilizadas estão de acordo com a nomenclatura da [API](https://asaasv3.docs.apiary.io/) disponibilizada pelo serviço.

*Essa documentção apresenta detalhes sobre a implementação, para detalhes de requisição e formatação de dados consulte a [documentação interativa de requisições](https://asaasv3.docs.apiary.io/) disponibilizada pelo Asaas.*

---

Recursos
--------

[](#recursos)

- Encapsulamento da requisição.
- Tratamento de erros de conexão.
- Tratamento de tipo de dados (não implementado).
- Conversão de documentos para envio através de multipart/form-data (não implementado).
- Testes unitários (incompletos, sem verificação de formato de resposta).

Dependências
------------

[](#dependências)

- PHP 7.1 ou maior.
- Illuminate/config 8.0 ou maior.
- GuzzleHttp/Guzzle 7.4 ou maior.

### Recomendações - Dev

[](#recomendações---dev)

- Manter a cobertura de testes unitários em 100% para refatoração segura.
- Usar da rota de testes disponibilizada pela API do Asaas ().

Instalação
----------

[](#instalação)

### Instalação com importação direta de repositório privado

[](#instalação-com-importação-direta-de-repositório-privado)

Para instalar o pacote é necessário informar, no composer.json, o repositório privado ou publico no qual o projeto foi disponibilizado.

```
"repositories": {
    "Lopes/asaas" : {
        "type" : "vcs",
        "url" : "https://github.com/elvis-s-lopes/asaas-sdk"
    }
}
```

Informe também a dependência na tag require.

```
"require": {
    "Lopes/asaas": "1.0^",
}
```

Como Usar
---------

[](#como-usar)

Para gerar o arquivo de configuração asaas.php automaticamente use o comando do artisan.

```
php artisan vendor:publish
```

Instancie a classe Asaas do pacote e chame cada função de forma encadeada. As funções estão definidas no final deste documento.

```
// Referencie o namespace do pacote
use Lopes\Asaas;

// Instancie uma novo objeto Asaas
$asaas = new Asaas();

//Faça as chamadas em funções encadeadas dependendo do serviço da API
$asaas->client()->create($data);
$assas->invoice()->find();
```

Funções disponíveis
-------------------

[](#funções-disponíveis)

- Para modelo de dados checar documentação da API

### Payments:

[](#payments)

```
//Rota POST /payments
$assas->payment()->create(array $paymentData);

//Rota GET /payments/id ou /payments quando id é null
$assas->payment()->find(string $paymentId = null)

//Rota GET /payments?customer=
$assas->payment()->findByCustomerId(string $customerId)

//Rota POST /payments/id
$assas->payment()->update(string $paymentId, array $paymentData)

//Rota DELETE /payments/id
$assas->payment()->remove(string $paymentId)

//Rota POST /payments/id/restore
$assas->payment()->restore(string $paymentId)

//Rota POST /payments/id/restore
$assas->payment()->reversePayment(string $paymentId)

//Rota GET /payments/id/identificationField
$assas->payment()->bankSlipCode(string $paymentId)

//Rota GET /payments/id/pixQrCode
$assas->payment()->pixQrCode(string $paymentId)

//Rota POST /payments/id/receiveInCash
$assas->payment()->confirmReceivedInCash(string $paymentId)

//Rota POST /payments/id/undoReceivedInCash
$assas->payment()->undoReceivedInCash(string $paymentId)
```

### Customer

[](#customer)

```
//Rota POST /customers
$asaas->customer()->create(array $customerData)

//Rota GET /customers/id ou /customers
$asaas->customer()->find(string $customerId = null)

//Rota GET /customers?name=
$asaas->customer()->findByName(string $customerName)

//Rota GET /customers?email=
$asaas->customer()->findByEmail(string $customerEmail)

//Rota GET /customers?cpfCnpj=
$asaas->customer()->findByCpfCnpj(string $customerCpfCnpj)

//Rota POST customers/id
$asaas->customer()->update(string $customerId, array $values)

//Rota DELTE /customers/id
$asaas->customer()->remove(string $customerId)

//Rota POST /customers/id/restore
$asaas->customer()->restore(string $customerId)
```

### Installments

[](#installments)

```
//Rota GET /installments/id ou /installments
$asaas->installments()->find(string $installmentId = null)

//Rota DELETE /installments/id
$asaas->installments()->remove(string $installmentId)

//Rota POST /installments/id/refund
$asaas->installments()->reversePayment(string $installmentId)
```

### Subscription

[](#subscription)

```
//Rota POST /subscriptions
$asaas->subscription()->create(array $subscriptionData)

//Rota GET /subscriptions/id ou subscriptions
$asaas->subscription()->find(string $subscriptionId = null)

//Rota GET /subscriptions?customer=
$asaas->subscription()->findByCustomerId(string $customerId)

//Rota GET /subscriptions/id/payments
$asaas->subscription()->payments(string $subscriptionId)

//Rota POST /subscriptions/id
$asaas->subscription()->update(string $subscriptionId, array $subscriptionData)

//Rota DELETE /subscriptions/id
$asaas->subscription()->remove(string $subscriptionId)

//Rota GET subscriptions/id/invoices
$asaas->subscription()->invoices(string $subscriptionId)

//Rota POST /subscriptions/id/invoiceSettings
$asaas->subscription()->setInvoiceSettings(string $subscriptionId, array $values)

//Rota GET subscriptions/id/invoiceSettings
$asaas->subscription()->invoiceSettings(string $subscriptionId)

//Rota DELETE /subscriptions/id/invoiceSettings
$asaas->subscription()->removeInvoiceSettings(string $subscriptionId)
```

### Payment Link

[](#payment-link)

```
//Rota POST /paymentLinks
$asaas->paymentLink()->create(array $paymentLinkData)

//Rota PUT /paymentLinks/id
$asaas->paymentLink()->update(string $paymentLinkId, array $paymentLinkData)

//Rota GET /paymentLinks/id ou /paymentLinks
$asaas->paymentLink()->find(string $paymentLinkId = null)

//Rota GET /paymentLinks?active=true
$asaas->paymentLink()->findActive()

//Rota DELETE /paymentLinks/id
$asaas->paymentLink()->remove(string $paymentLinkId)

//Rota POST /paymentLinks/id/restore
$asaas->paymentLink()->restore(string $paymentLinkId)

//Rota POST /paymentLinks/id/images
$asaas->paymentLink()->image(string $paymentLinkId)

//Rota GET /paymentLinks/id/images/imageId ou /paymentLinks/id/images
$asaas->paymentLink()->findImages(string $paymentLinkId, string $imageId = null)

//Rota DELETE paymentLinks/id/images
$asaas->paymentLink()->removeImage(string $imageId)

//Rota POST /paymentLinks/id/images/imageId/setAsMain
$asaas->paymentLink()->setMainImage(string $paymentLinkId, string $imageId)
```

### Notification

[](#notification)

```
//Rota GET /customers/id/notifications
$asaas->notification()->find(string $customerId)

//Rota POST /notifications/id
$asaas->notification()->update(string $notificationId, array $notificationConfig)
```

### Anticipation

[](#anticipation)

```
//Rota POST /anticipations
$asaas->anticipation()->create(array $anticipationData)

//Rota POST /anticipations/simulate
$asaas->anticipation()->simulate(array $simulateOptions)

//Rota GET /anticipations/id
$asaas->anticipation()->find(string $anticipationId)

//Rota GET /anticipations?payment=
$asaas->anticipation()->findByPaymentId(string $paymentId)

//Rota GET /anticipations?installment=
$asaas->anticipation()->findByInstallmentId(string $installmentId)

//Rota GET /anticipations?status=
$asaas->anticipation()->findByStatus(string $status)
```

### Payment Dunning

[](#payment-dunning)

```
//Rota POST /paymentDunnings
$asaas->paymentDunning()->create(array $paymentDunningData)

//Rota POST /paymentDunnings/simulate
$asaas->paymentDunning()->simulate(array $simulateOptions)

//Rota GET /paymentDunnings/id ou /paymentDunnings
$asaas->paymentDunning()->find(string $paymentDunningId = null)

//Rota GET /paymentDunnings?status=
$asaas->paymentDunning()->findByStatus(string $status)

//Rota GET /paymentDunnings?type=
$asaas->paymentDunning()->findByType(string $type)

//Rota GET /paymentDunnings?payment=
$asaas->paymentDunning()->findByPaymentId(string $paymentId)

//Rota GET /paymentDunnings/id/history
$asaas->paymentDunning()->eventHistory(string $paymentDunningId)

//Rota GET /paymentDunnings/id/partialPayments
$asaas->paymentDunning()->receivedPartialPayment(string $paymentDunningId)

//Rota GET /paymentDunnings/paymentsAvailableForDunning
$asaas->paymentDunning()->paymentsAvailableForDunning()

//Rota POST /paymentDunnings/id/documents
$asaas->paymentDunning()->resendDocuments(string $paymentDunningId, array $documentFiles)

//Rota POST /paymentDunnings/id/cancel
$asaas->paymentDunning()->cancel(string $paymentDunningId)
```

### Bill payment

[](#bill-payment)

```
//Rota POST /bill
$asaas->billPayments()->create(array $billData)

//Rota POST /bill/simulate
$asaas->billPayments()->simulate(array $simulateOptions)

//Rota GET /bill/id ou /bill
$asaas->billPayments()->find(string $billId = null)

//Rota POST /bill/id/cancel
$asaas->billPayments()->cancel(string $billId)
```

### Serasa

[](#serasa)

```
//Rota POST /creditBureauReport
$asaas->serasa()->check(array $customerData)

//Rota GET /creditBureauReport/id ou /creditBureauReport
$asaas->serasa()->find(string $checkId = null)
```

### Financial Transactions

[](#financial-transactions)

```
//Rota GET /financialTransactions
$asaas->financialTransaction()->find()
```

### Account

[](#account)

```
//Rota POST /accounts
$asaas->account()->create(array $accountData)

//Rota GET /accounts
$asaas->account()->relatedAccounts()

//Rota GET /finance/getCurrentBalance
$asaas->account()->balance()

//Rota POST /transfers
$asaas->account()-> transfer(array $transferOptions)

//Rota GET /transfers/id ou /transfers
$asaas->account()->findTransfer(string $transferId = null)

//Rota GET /transfers?dateCreated=
$asaas->account()->findTransferByDate(string $transferDate)

//Rota GET /transfers?type=
$asaas->account()->findTransferByType(string $transferType)

//Rota GET /myAccount
$asaas->account()->comercialData()

//Rota POST /myAccount/paymentCheckoutConfig
$asaas->account()->setPaymentCheckoutConfig(array $paymentCheckoutData)

//Rota GET /myAccount/paymentCheckoutConfig
$asaas->account()->findPaymentCheckoutConfig()
```

### Invoice

[](#invoice)

```
//Rota POST /invoices
$asaas->invoice()->create(array $invoiceData)

//Rota PUT /invoices/id
$asaas->invoice()->update(string $invoiceId, array $invoiceData)

//Rota GET /invoices/id ou /invoices
$asaas->invoice()->find(string $invoiceId = null)

//Rota GET /invoices?payment=
$asaas->invoice()->findByPaymentId(string $paymentId)

//Rota GET /invoices?installment=
$asaas->invoice()->findByInstallmentId(string $installmentId)

//Rota GET /invoices?status=
$asaas->invoice()->findByStatus(string $status)

//Rota POST /invoices/id/authorize
$asaas->invoice()->authorize(string $invoiceId)

//Rota POST /invoices/id/cancel
$asaas->invoice()->cancel(string $invoiceId)

//Rota GET /invoices/municipalServices?description=
$asaas->invoice()->municipalServices(string $description)
```

### Fiscal Information

[](#fiscal-information)

```
//Rota GET /ustomerFiscalInfo/municipalOptions
$asaas->fiscalInformation()->municipalServices()

//Rota POST /customerFiscalInfo
$asaas->fiscalInformation()->create(array $invoiceData)

//Rota POST /customerFiscalInfo
$asaas->fiscalInformation()->update(array $invoiceData)

//Rota GET /customerFiscalInfo
$asaas->fiscalInformation()->find()
```

### Webhook

[](#webhook)

```
//Rota POST /webhook
$asaas->webhook()->config(array $webhookConfig)

//Rota GET /webhook
$asaas->webhook()->findConfig()

//Rota POST /webhook/invoice
$asaas->webhook()->invoiceConfig(array $invoiceConfig)

//Rota GET /webhook/invoice
$asaas->webhook()->findInvoiceConfig()

//Rota POST /webhook/transfer
$asaas->webhook()->transferConfig(array $transferConfig)

//Rota GET /webhook/transfer
$asaas->webhook()->findTransferConfig()
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

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/c6727a15b0a7f57fd0851c42808c308d6012ce902b376d63023bb2018114b2cf?d=identicon)[elvis-s-lopes](/maintainers/elvis-s-lopes)

---

Top Contributors

[![elvis-s-lopes](https://avatars.githubusercontent.com/u/58557455?v=4)](https://github.com/elvis-s-lopes "elvis-s-lopes (3 commits)")

### Embed Badge

![Health badge](/badges/lopes-asaas/health.svg)

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

PHPackages © 2026

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