payzu / pix
SDK oficial PHP da API PayZu Pix: depósitos, saques, transferências internas, infrações, relatórios e callbacks.
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
REST API for Pix operations on the PayZu platform, deposits, withdrawals, internal transfers, infractions, reports, and callback inspection. All amounts are in BRL (reais) unless explicitly noted. Authentication uses a Bearer token issued during onboarding.
SDKs oficiais
- Node.js:
npm install payzu-pix - Python:
pip install payzu-pix - PHP:
composer require payzu/pix - Ruby:
gem install payzu-pix - Java:
br.com.payzu:payzu-pix(Maven Central) - Go:
go get github.com/PayZuAI/payzu-sdks/go
Repo: https://github.com/PayZuAI/payzu-sdks
For more information, please visit https://suporte.payzu.com.br.
Installation & Usage
Requirements
PHP 8.1 and later.
Composer
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/PayZuAI/payzu-sdks.git"
}
],
"require": {
"PayZuAI/payzu-sdks": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php:
<?php require_once('/path/to/PayZuPix/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure Bearer authorization: BearerAuth $config = PayZu\Pix\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new PayZu\Pix\Api\AccountApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); try { $result = $apiInstance->getUser(); print_r($result); } catch (Exception $e) { echo 'Exception when calling AccountApi->getUser: ', $e->getMessage(), PHP_EOL; }
API Endpoints
All URIs are relative to https://api.payzu.processamento.com/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AccountApi | getUser | GET /user | Account Info |
| AccountApi | getUserBalance | GET /user/balance | Account Balance |
| CallbacksApi | createUserCallbackSecret | POST /user/callbacks/secret | Create callback secret |
| CallbacksApi | getUserCallbackById | GET /user/callbacks/{id} | Get Callback |
| CallbacksApi | getUserCallbacks | GET /user/callbacks | List Callbacks |
| CallbacksApi | resendUserCallbackSingle | POST /user/callbacks/resend/{transactionId} | Re-send callback (single) |
| CallbacksApi | resendUserCallbacks | POST /user/callbacks/resend | Re-send callbacks (bulk) |
| CallbacksApi | resendUserCallbacksWebhook | POST /user/callbacks/resend/webhook/{webhookId} | Resend callbacks by webhook |
| CallbacksApi | resendUserCallbacksWebhooks | POST /user/callbacks/resend/webhook | Resend webhook callbacks by filters |
| CallbacksApi | rotateUserCallbackSecret | PATCH /user/callbacks/secret/rotate | Rotate callback secret |
| InfractionsApi | getInfractions | GET /user/infractions | List Infractions |
| InfractionsApi | getInfractionsById | GET /user/infractions/{id} | Get Infraction |
| InfractionsApi | getInfractionsDefenseById | GET /user/infractions/{infractionId}/defenses/{defenseId} | Get Defense |
| InfractionsApi | getInfractionsDefenses | GET /user/infractions/{id}/defenses | List Defenses |
| InfractionsApi | postInfractionsDefense | POST /user/infractions/{id}/defenses | Create Defense |
| InternalTransferApi | getInternalTransfer | GET /internal-transfer | Get internal transfer |
| InternalTransferApi | postInternalTransfer | POST /internal-transfer | Create internal transfer |
| KeysAndDICTApi | getPixKey | GET /pix/key | Pix key lookup (DICT) |
| KeysAndDICTApi | getUserDict | GET /user/dict | Resolve DICT key |
| KeysAndDICTApi | postPixQrcodeRead | POST /pix/qrcode/read | Read QR Code |
| PixOperationsApi | getPix | GET /pix | Retrieve Charge |
| PixOperationsApi | getPixQrcode | GET /pix/qr-code/{transactionId} | Render Pix QR code (PNG) |
| PixOperationsApi | getProof | GET /proof/{id} | Get Transaction Receipt |
| PixOperationsApi | postPix | POST /pix | Create Charge (Pix deposit) |
| RefundsApi | postRefund | POST /refund/{transactionId} | Refund a Pix |
| ReportsApi | downloadUserReport | POST /user/report/{id}/download | Download report |
| ReportsApi | getUserBankStatement | GET /user/bank-statements/{id} | Get bank statement |
| ReportsApi | getUserBankStatements | GET /user/bank-statements | List bank statements |
| ReportsApi | getUserDepositPending | GET /user/deposit-pending | List pending deposits |
| ReportsApi | getUserDepositPendingById | GET /user/deposit-pending/{id} | Get pending deposit |
| ReportsApi | getUserReport | GET /user/report/{id} | Get report job status |
| ReportsApi | getUserSummary | GET /user/summary | Transaction summary |
| ReportsApi | getUserTransactionById | GET /user/transactions/{id} | List transaction details |
| ReportsApi | getUserTransactions | GET /user/transactions | List Transactions |
| ReportsApi | listUserReports | GET /user/report | List report jobs |
| ReportsApi | postUserReport | POST /user/report | Generate transactions report |
| WebhooksApi | deleteUserWebhook | DELETE /user/webhooks/{id} | Delete webhook |
| WebhooksApi | getUserWebhook | GET /user/webhooks/{id} | Get webhook |
| WebhooksApi | getUserWebhookSentDetail | GET /user/webhooks/{id}/sent/{callbackId} | Get sent callback detail |
| WebhooksApi | getUserWebhooks | GET /user/webhooks | List webhooks |
| WebhooksApi | getUserWebhooksSentQuantity | GET /user/webhooks/sent/quantity | Count sent callbacks |
| WebhooksApi | patchUserWebhook | PATCH /user/webhooks/{id} | Update webhook |
| WebhooksApi | postUserWebhook | POST /user/webhooks | Create webhook |
| WebhooksApi | postUserWebhookRotateSecret | POST /user/webhooks/{id}/rotate-secret | Rotate webhook secret |
| WithdrawalsApi | getWithdraw | GET /withdraw | Retrieve Withdrawal |
| WithdrawalsApi | getWithdrawProof | GET /withdraw/proof/{id} | Get Withdrawal Receipt |
| WithdrawalsApi | postWithdraw | POST /withdraw | Create Withdrawal (Pix key) |
| WithdrawalsApi | postWithdrawQrcode | POST /withdraw/qrcode | Create Withdrawal using QR Code |
Models
- ApiError
- ApiErrorDetailsInner
- BankStatement
- BankStatementListResponse
- BankStatementListResponsePagination
- CallbackDetail
- CallbackListResponse
- CallbackListResponsePagination
- CallbackSecretResponse
- Defense
- DefenseFilesInner
- DefenseHistoryEntry
- DefenseHistoryEntryFilesInner
- DepositPending
- DepositPendingListResponse
- DictConsultResponse
- DownloadUserReport200Response
- EnqueuedCallback
- EnqueuedCallbackEnqueued
- EnqueuedCallbackItem
- GetUser200Response
- GetUser200ResponseDailyWithdrawLimit
- GetUser200ResponseServiceFee
- GetUserBalance200Response
- GetUserTransactionById200Response
- GetUserTransactionById200ResponseAllOfCallbackLogInner
- GetUserTransactionById200ResponseAllOfInfractionInner
- GetUserTransactions200Response
- InfractionDetail
- InfractionDetailTransaction
- InfractionListResponse
- InfractionListResponsePagination
- ListUserReports200Response
- PixKeyInfo
- PostInternalTransferRequest
- PostPixQrcodeReadRequest
- PostPixRequest
- PostUserReportRequest
- PostWithdrawQrcodeRequest
- PostWithdrawRequest
- ProofResponse
- QRCodeReadResponse
- Refund
- RefundRequest
- ReportJob
- ReportJobAccepted
- ReportJobDetail
- ResendUserCallbackSingle200Response
- ResendUserCallbacks200Response
- ResendUserCallbacksRequest
- ResendWebhookCallbacksRequest
- RotateCallbackSecretResponse
- RotateSecretResponse
- SentWebhookDetail
- SentWebhookDetailResponse
- SentWebhooksQuantity
- Summary
- SummaryBlock
- SummaryBlockGroupedInner
- SummaryBlockStatuses
- SummaryStatus
- Transaction
- TransactionWithRefunds
- Webhook
- WebhookCreateRequest
- WebhookEventType
- WebhookListResponse
- WebhookUpdateRequest
- WebhookWithSecret
Authorization
Authentication schemes defined for the API:
BearerAuth
- Type: Bearer authentication
Tests
To run the tests, use:
composer install vendor/bin/phpunit
Author
About this package
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
1.8.0- Package version:
2.0.0 - Generator version:
7.22.0
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen