PIX

Learn how to integrate your solution to process payments with PIX.

PIX

PIX is an official Brazilian payment method launched by the local Central Bank. It allows for immediate payment confirmation and is available 24/7. To complete a payment, the payer can use any Home Banking or Wallet App by copying and pasting a Transaction ID or scanning a QR code.

Request parameters

You need to include specific fields for this payment method to work correctly. Check the Purchase operation article for details on authentication, languages of the response, and basic purchase parameters such as amount and currency.

PropertyTypeMandatory?Description
PaymentMethodstringYesFind the value in the table Payment Method.
TargetCountryISOstringYesIndicate the destination country.
CustomerEmailstringYesCustomer’s email.
CustomerFirstNamestringYesCustomer’s first name.
CustomerLastNamestringYesCustomer’s last name.
CustomerDocumentTypestringYesCustomer’s document type.
Refer to the Document types table to see the possible values.
CustomerDocumentNumberstringYesCustomer’s Document Number.
CustomerPhoneNumberstringNoCustomer’s phone number.
CustomerAddressCountrystringNoCustomer’s Country.
CustomerAddressStatestringNoCustomer’s State.
CustomerAddressCitystringNoCustomer’s City.
CustomerAddressAddressDetailstringNoCustomer’s Address Detail.
CustomerAddressPostalCodestringNoCustomer’s Postal Code.
MetaDataInPaymentExpirationInMinutesnumericYesConfigure the expiration time for the payment using this field, specifying the duration in minutes.
MetadataInAddressStreetstringNoCustomer address street.
MetadataInAddressNumberstringNoCustomer address number, floor, apartment.
MetadataInAddressDistrictstringNoCustomer address district.

Request example

{
    "PaymentMethod": "PIX",
    "Order": "paymentID3022",
    "Amount": 20000,
    "Currency": "BRL",
    "Description": "Purchase Test",
    "MetaDataIn": {
        "PaymentExpirationInMinutes": "7200",
        "AddressStreet": "Avenida Anisio Fernandes Coelho",
        "AddressNumber": "661",
        "AddressDistrict": "PR"
    },
    "TargetCountryISO": "BR",
    "Customer": {
        "Address": {
            "AddressDetail": "Avenida Anisio Fernandes Coelho, 661 ",
            "PostalCode": "29060670",
            "City": "Vitoria",
            "State": "ES",
            "Country": "Brasil"
        },
        "FirstName": "Jhon",   
        "LastName": "Doe",
        "DocumentNumber": "47168892703",
        "DocumentType": "CPF.BR",
        "PhoneNumber": "3188060418",
        "Email": "john@mail.com"
    }
}

Response parameters

In the response, you will find the following parameters:

PropertyTypeDescription
ResponseMetadataOutPaymentCodestringPayment code generated by PIX.
ResponseMetadataOutPaymentBarCodestringThis code, which corresponds in Brazil to the copia e cola, allows payers to copy it in their bank app.
This parameter is handy to generate the QR code when creating your checkout.
ResponseMetadataOutPaymentBarCodeUrlstringURL of the payment page, this page has the QR code generated with the string returned in PaymentBarCode parameter.
You can also redirect the payer to this page to complete the payment.
ResponseMetadataOutPaymentExpirationDatedateDate when the payment will expire.
Format DD/MM/YYYY HH:MM:SS.

Payment page in PIX

PrintScreen

Response example

{
    "TransactionId": "128635201747174176",
    "Result": "COMPLETED",
    "Status": "PENDING",
    "ErrorCode": null,
    "ErrorDescription": null,
    "Created": "2024-12-20T20:46:20.199",
    "AuthorizationDate": "2024-12-20T20:46:20.674",
    "AuthorizationCode": "",
    "Amount": 1000,
    "Currency": "BRL",
    "Installments": 1,
    "TaxableAmount": null,
    "Tip": null,
    "Url": "https://api.stage.bamboopayment.com/Purchase/128635201747174176",
    "MetadataOut": {
        "PaymentCode": "b961a342fa172d22f22767134b0aebf1e86fa337038d4634f470ab894d71f9fc",
        "PaymentBarCode": "00020126910014BR.GOV.BCB.PIX2569api-pix-h.bancobs2.com.br/spi/v2/7cc95f1a-743e-4f4a-a3ad-e2ba14f5f6f8520400005303986540510.005802BR5908Wepayout6014Belo Horizonte61083038040362070503***63049F6B",
        "PaymentDigitableLine": "api-pix-h.bancobs2.com.br/spi/v2/7cc95f1a-743e-4f4a-a3ad-e2ba14f5f6f8",
        "PaymentBarCodeUrl": "https://pagar.sandbox.goboleto.com/?hash=b961a342fa172d22f22767134b0aebf1e86fa337038d4634f470ab894d71f9fc",
        "PaymentExpirationDate": "21/12/2024 20:09"
    },
    "Action": null,
    "PaymentMethod": {
        "Brand": "Pix",
        "CardOwner": null,
        "Bin": null,
        "IssuerBank": null,
        "Type": "BankTransfer",
        "Expiration": null,
        "Last4": null
    }
}
footer
Last modified December 20, 2024

© Bamboo | All rights reserved 2024