Skip to main content

PIX

Pix is the Brazilian instant payment. The payment method created by the Central Bank (BC) in which funds are transferred between accounts in a few seconds, any time or day. It is practical, fast and secure. Pix can be made from a checking account, savings account or prepaid payment account.

Pix is designed to be a very broad payment method. Any payment or transfer that is made nowadays using different means (TED - electronic transfer of funds, card, invoice/payment slips, etc.) can be made with Pix, simply by using a cell phone.

Plug performs the role of a payment intermediary, but does not perform the financial clearance, therefore it is necessary to have an account in a financial institution that is part of the instant payment system. Thus, we receive the data sent by the customer in the charges’ API and communicate with issuers and fintechs.

The PIX participants:

  • The payee, Plug's customer who must have an account at a partner financial institution to receive payments via PIX
  • The payment provider, a financial institution where the customer has an account, responsible for issuing a dynamic QR Code with the payee's bank details and the data of the product offered.
  • The payer, a buyer of any kind who must scan the dynamic QR Code in the application of the financial institution of his choice to make the payment.

PIX payment flow:

  • To create a transaction with Pix the customer simply informs the Pix payment method when creating a charge, its expiration date and data that identifies the buyer;
  • A charge is registered in the central bank's instant payment system and becomes available for payment and the QR Code data is returned in the format of an image, which can be scanned by the payer, and a code, which can be copied by the payer;
  • The Customer must present the data related to the charge (QRcode image or copy and paste code) to the payer who must make the payment within the expiration period defined in the bill by the payee;
  • The payer must pay the QR Code at the financial institution of his choice;
  • After confirmation of the payment, the payment provider will perform the transfer of funds via the new instant payment system to the payee's account.
  • Subsequently the payee customer will be notified that the payment has been made and the charges were successfully completed.

Supported providers for charges via PIX:

ProviderTypeDescription
BS2Bank BS2 Business
BBBanco do Brasil Individual
PAGARMEPagar.me
PLUG_SANDBOXSimulator used to authorize payments in an sandbox environment
tip

The PIX method of payment when created on Plug is registered with a pending status, being automatically updated to authorized status when we are notified by the financial institution of the payment confirmation, this time may vary from provider to provider, and cannot exceed the expiration time defined in the creation of the charge. If the payment confirmation is not recognized by the due date, Plug automatically cancels the charges, updating its status to failed.

caution

It is possible to perform a full refund for PIX payments, but there is no pre-authorization or capture of this type of charges.

Change of Status Notification

objetoeventodescrição
transactionpendingEvent sent when the charge is registered and payment data is available
transactionauthorizedEvent sent when the payment confirmation of the charges is recognized
transactionfailedEvent sent when the charges are denied by the financial institution before it has been authorized, without financial refund.
transactioncanceledEvent sent when the charges are cancelled after it has been authorized, creating a financial refund.

Example of billing via PIX

Perform a PIX charge using the buyer’s data through the Charges Service.

curl --location --request POST 'https://api.plugpagamentos.com/v1/charges' \
--header 'X-Client-Id: <YOUR_CLIENT_ID>' \
--header 'X-Api-Key: <YOUR_SECRET_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"merchantId": "7f8870a2-71c9-4ef0-a531-82000e00b7e1",
"amount": 150,
"currency": "BRL",
"statementDescriptor": "Pedido #231 loja joão",
"capture": true,
"paymentMethod": {
"paymentType": "pix",
"expiresIn": 3600
},
"paymentSource": {
"sourceType": "customer",
"customer": {
"name": "Jose Bonifacio Da Silveira",
"phoneNumber": "21 98889999099",
"email": "jose@gmail.com",
"document": {
"number": "72912053013",
"type": "cpf"
}
}
}
}'

< HTTP/2 201
{
"id": "148d5db0-f1c3-439f-902d-f1f268086e1d",
"clientId": "cc0b1e41-2936-45c5-947f-93995ffcdc00",
"createdAt": "2012-06-30 23:59:59 +0000",
"amount": 150,
"currency": "BRL",
"statementDescriptor": "Pedido #231 loja joão",
"capture": true,
"status": "pending",
"paymentMethod": {
"paymentType": "pix",
"expiresIn": 3600,
"qrCodeData": "00020101021126510014BR.GOV.BCB.PIX0129K89VdiUgWN1B3p0IHrgHkNHg9tX5F52040000530398654040.155802BR5913Customer test600062070503***630431C0",
"qrCodeImageUrl": "https://...."
},
"paymentSource": {
"sourceType": "customer",
"customerId": "1cdcf0c9-eb04-4e43-b9b2-b7a4acdead1f"
}
}