Transaction Information

This endpoint allows to retrieve the complete information about one transaction

Reference Endpoint

  • GET /accounts/transactions/pix/{transactionId}

Transaction Response Object

The full transaction response object includes 3 important inner structures: transaction, payment and webhook:

  1. the payment object contains the request parameters for the transaction itself, such as the payment requestor and the informed recipient.
  2. the transaction inner object represents the full transaction record, and contains information about the transaction flow, the participants (payer and recipient), and the processing results.
  3. the webhook object contains information about the endpoint for sending the transaction state changes.

Here is a response object example:

{
    "statusCode": "Done",
    "data": {
        "transaction": {
            "id": "4494a26c-4f21-400a-bbe7-cbef6ea7c3c3",
            "externalResourceId": "016c2d96-fb56-407a-b142-88ef29bee379",
            "orderId": "in-1414870875-158709817091784",
            "orderDescription": "This is a test order.",
            "date": "2023-08-04T14:45:34.323Z",
            "stateRegisteredDate": "2023-08-04T14:45:34.332Z",
            "stateCompletedDate": "2023-08-04T14:45:39.150Z",
            "stateCancelledDate": null,
            "stateRefundDate": null,
            "stateReversedDate": null,
            "stateErrorDate": null,
            "stateErrorCause": null,
            "type": "Credit",
            "paymentType": "PIX",
            "category": "PartnerSales",
            "amount": "50.000000",
            "currency": "BRL",
            "state": "Completed",
            "charges": "0.000000",
            "chargesObject": {
                "costValue": "0",
                "rateValue": "0",
                "rate": "0.00"
            },
            "receiptUrl": "https://api.sandbox.pagfast.com/v1/system/e-receipt/4494a26c-4f21-400a-bbe7-cbef6ea7c3c3/receipt.pdf",
            "receiptDate": "2023-08-04T14:45:39.047Z",
            "receiptVoucher": "D6BE9C802C7846029269C485FE23060C",
            "receiptAmount": "50.000000",
            "metadata": {},
            "payer": {
                "name": "CRISTINA INACIO OLIVEIRA DA CONCEICAO",
                "taxNumber": "14435549603",
                "bankCode": "999",
                "bankName": null,
                "accountAgency": "99999",
                "accountNumber": "99999",
                "accountDigit": "9"
            },
            "customerName": "Test Customer",
            "accountName": "1",
            "accountNumber": "6212790001"
        },
        "payment": {
            "value": {
                "original": "50.000000"
            },
            "qrCode": "02393767956483436107br.gov.bcb.pix2564qrcode.sandbox.pagfast.com.br/QR/cob/224227163566832131468968987105612380081043125773316115079433Pagfast Cobranca e Servic6014Campina Grande80993926086756031824***98A2E1EE",
            "qrCodeLocation": "https://api.sandbox.pagfast.com/v1/system/qrcodeviewer/4494a26c-4f21-400a-bbe7-cbef6ea7c3c3",
            "payer": {
                "name": "CRISTINA INACIO OLIVEIRA DA CONCEICAO",
                "cpf": "14435549603",
                "cnpj": null
            }
        },
        "webhook": {
            "url": "https://postman-echo.com/post?test=1",
            "customHeaderName": "Authorization",
            "customHeaderValue": "eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiI2YTZjYjY2NC03NzI4LTR",
            "deliveryStatus": "Sent",
            "deliveryTime": "2023-08-04T14:45:39.227Z"
        }
    }
}

Next, we detail each of these objects, considering it's fields names, types, in which transaction states they appear and in which payment method too.

The Inner Payment Object

The Payment Object provides a comprehensive view of the data associated with a payment request. It encompasses essential details, including the transaction value, creation timestamp, and expiration date, as well as initial information about both the payer and recipient. Notably, the payer is the payment requestor in this context.

Field NameTypeTransaction StatePayment MethodDescription
payment.payer.namestringAll StatesPIX and OpenFinanceThe requestor's name, as provided by the integrator
payment.payer.cpfstringAll StatesPIX and OpenFinanceThe requestor's document number if it is an individual
payment.payer.cnpjstringAll StatesPIX and OpenFinanceThe requestor's document number if it is a company
payment.receiver.namestringAll StatesPIX and OpenFinanceThe recipient's name, as provided by the integrator
payment.receiver.cpfstringAll StatesPIX and OpenFinanceThe recipient's document number if it is an individual
payment.receiver.cnpjstringAll StatesPIX and OpenFinanceThe recipient's document number if it is a company
payment.keystringAll StatesPIXThe PIX key value, essentially an account address that uniquely identifies the recipient. Only available if the payment method is PIX
payment.keyTypestringAll StatesPIXThe valid PIX key types, which include: CPF (Individual Taxpayer Registry), CNPJ (National Registry of Legal Entities), Phone Number, E-mail, or EVP (Randomly Generated Identifier)
payment.qrCodestringAll StatesPIXA code tailored for PIX Copy and Paste feature on bank apps, facilitating the seamless execution of the payment.
payment.qrCodeLocationstringAllStatesPIXThe URL for a graphical QR Code to be scanned using PIX bank applications, enabling the payment's initiation

Supressed Participant

For Cash In transactions the recipient is always PagFast, and this object is supressed.
For Cash Out, where the transaction payer is always PagFast, this object is also supressed.

The Inner Transaction Object

As mentioned before, the transaction object represents the current state of a transaction, regarding it's lifecycle, while they are being processed, as follows:

Field Name

Type

Transaction State

Payment Method

Description

transaction.id

string

All States

PIX and OpenFinance

An Unique Identifier (UID)

transaction.externalId

string

All States

PIX and OpenFinance

An external ID provided by the Acquiring Bank

transaction.orderId

string

All States

PIX and OpenFinance

An optional ID provided by the integrator in the transaction request, for counter-validation, if needed

transaction.orderDescription

string

All States

PIX and OpenFinance

An optional description provided by the integrator in the transaction request, for counter-validation, if needed

transaction.type

string

All States

PIX and OpenFinance

The transaction type containing one of: Credit or Debit

transaction.category

string

All States

PIX

The transaction category as one of: PartnerSales, PartnerWithdrawals, or PartnerRecipientPayments (which refers to a third-party payments supported by the platform via Admin Portal)

transaction.paymentType

string

All States

PIX and OpenFinance

The requestor's document number if it is a company

transaction.state

string

All States

PIX and OpenFinance

The transaction state, that describes the current transaction stage on its lifecycle. Contains one of: Registered, Canceled, Completed, Reversed or Error

transaction.date

string

All States

PIX and OpenFinance

The transaction request creation date

transaction.stateRegisteredDate

string

All States

PIX and OpenFinance

The date for the intermediary state when the transaction is registered with the bank

transaction.stateCancelledDate

string

Canceled

PIX and OpenFinance

The date of a transaction canceling if the transaction state is Canceled. Empty otherwise

transaction.stateCompletedDate

string

Completed, Refund

PIX and OpenFinance

The date of a transaction completion if the transaction state is Completed. Empty otherwise

transaction.stateRefundDate

string

Refunded

PIX and OpenFinance

The date of a transaction refund if the transaction state is Refunded. Empty otherwise

transaction.stateReversedDate

string

Reversed

PIX and OpenFinance

The date of a transaction rollback if the transaction state is Reversed. Empty otherwise.

  • *Note**: Rollback state only applies to transactions in intermediate states, not transactions in final state.

transaction.stateErrorDate

string

Error

PIX and OpenFinance

The date of a transaction error if the transaction state is Error. Empty otherwise

transaction.stateErrorCause

string

Error

PIX and OpenFinance

A key for an error description if the state is Error. Empty otherwise

transaction.amount

string

All States

PIX and OpenFinance

The transaction request value. A number in float format with 6 decimal digits, such as 15.000000

transaction.receiptAmount

string

All States

PIX and OpenFinance

The effective paid value. This information is used for counter-validation purposes by PagFast. If the value is different from the origin amount value, the transaction is rejected.

transaction.currency

string

All States

PIX and OpenFinance

Currency on ISO 4217 format, such as BRL for Brazilian Reais

transaction.charges

string

All Stages

PIX and OpenFinance

The full charges value applicable to the transaction. It depends on the billing plan, but it is the sum of a fixed value plus a percentage of the transaction value.

transaction.chargesObject.costValue

string

All Stages

PIX and OpenFinance

The value relative to the fixed parcel of the billing plan.

transaction.chargesObject.rateValue

string

All Stages

PIX and OpenFinance

The value relative to the percentage of the transaction value, specified in the billing plan.

transaction.chargesObject.rate

string

All Stages

PIX and OpenFinance

The percentage of the transaction value to which the charges apply, as specified in the billing plan

📅

About dates format

All dates are strings in the ISO 8601 format (YYYY-MM-DDTHH:mm:ss.SSSZ), as for 2023-07-04T02:33:50.690Z.

The payer and recipient nested objects (transaction.payer and transaction.recipient)

The transaction object also presents two nested objects: payer and recipient, and includes information about the effective transaction participants. The full objects will only be filled if the transaction reaches a state where processed information can be included.

These fields also appear in the payment object but with different semantics. There, these are the transaction request information, meanwhile in the transaction they mean the final participants. This distinction proves significant in PIX Cash In scenarios, where the payment requestor and payment executor may vary.

For instance, envision John, an individual who generate a PIX QRCode, and then requests Mary to execute the payment on his behalf. This is a completely legal payment. So, while John would figure in the payment.payer object (seen before), Mary would be described in the transaction.payer object, with the following attributes.

Field NameTypeTransaction StatePayment MethodDescription
transaction.payer.bankCodestringCompletedPIX and OpenFinanceThe payer bank code as defined by the Central Bank authority in Brazil
transaction.payer.bankIspbstringCompletedPIX and OpenFinanceA payer six-digit code used to uniquely identify payment institutions in Brazil (if available)
transaction.payer.bankNamestringCompletedPIX and OpenFinanceThe payer institution name (if available)
transaction.payer.accountAgencystringCompletedPIX and OpenFinanceThe payer bank account agency (if available)
transaction.payer.accountNumberstringCompletedPIX and OpenFinanceThe payer bank account number (if available)
transaction.payer.accountTypestringCompletedPIX and OpenFinanceA text with one of the following: CheckingAccount, SavingsAccount or SalaryAccount (if available)
transaction.payer.namestringCompletedPIX and OpenFinanceThe account owner name
transaction.payer.taxNumberstringCompletedPIX and OpenFinanceThe account owner document number
transaction.recipient.bankCodestringCompletedPIX and OpenFinanceThe recipient bank code as defined by the Central Bank authority in Brazil
transaction.recipient.bankIspbstringCompletedPIX and OpenFinanceThe recipient six-digit code used to uniquely identify payment institutions in Brazil (if available)
transaction.recipient.bankNamestringCompletedPIX and OpenFinanceThe recipient institution name (if available)
transaction.recipient.accountAgencystringCompletedPIX and OpenFinanceThe recipient bank agency (if available)
transaction.recipient.accountNumberstringCompletedPIX and OpenFinanceThe recipient bank account number (if available)
transaction.recipient.accountTypestringCompletedPIX and OpenFinanceA text with one of the following: CheckingAccount, SavingsAccount or SalaryAccount (if available)
transaction.recipient.namestringCompletedPIX and OpenFinanceThe account owner name
transaction.recipient.taxNumberstringCompletedPIX and OpenFinanceThe account owner document number

Information about Participants

Some of these fields were marked as (if available). That means they will only be filled if the Acquiring Bank provides them.

The Inner Webhook Object

Finally, as mentinoned earlier, the webhook inner object presents payment information regarding the transactions state transitions.

Field NameTypeTransaction StatePayment MethodDescription
webhook.customHeaderNamestringAll StatesPIX and OpenFinanceA text containing the credential header as provided by the integrator for counter-validation, for example: "Authorization"
webhook.customHeaderValuestringAll StatesPIX and OpenFinanceA text containing a value provided by the integrator for counter-validation, such as "Bearer b880eec8ba284c6ebb62b5af4015fe2f"
webhook.deliveryStatusstringAll StatesPIX and OpenFinanceA text describing the current status of the last message delivery, one of: Pending, Failed, or Success. While Success event messages are the outcome for integrators, the other statuses are critical for PagFast, and are used for delivery retries
webhook.deliveryTimestringAll StatesPIX and OpenFinanceThe delivery timestamp, presented in the same date format presented before
webhook.urlstringAll StatesPIX and OpenFinanceThe webhook URL invoked