/
State Machine

State Machine

In this branch, you will find information about the behavior of consents, driven by events. Events such as weather, signals, or operations can cause an object's state to change.

 

Possible consent statuses are

  • AWAITING_AUTHORISATION - Awaiting authorization

  • AUTHORIZED - Authorized

  • REJECTED - Rejected

  • CONSUMED - Consumed

 

 

 The order of events follows the flow of the state machine above, however, due to the processing/transition time of each event being very fast and due to issues relating to speed and latency in the response times of RESTful calls, it may be that the event consent:consumed arrives before the consent:finish event on the webhook endpoint. However, we advise you to follow the order described and check the event generation timestamp.

Event

Description

Event

Description

before:consent:create

We received a request for a consent creation.

after:consent:create

All the consent fields were validated, it´s following all the needed standards and it has been created.

consent:approved

The consent has been approved by user.

consent:rejected

The consent has been rejected by user.

consent:consumed

The consent has been consumed by the Financial Institution.

consent:polling

Polling to check the payment status at the Financial Institution.

consent:finish

The money has been transfered succesfully or there was any error reported by one of the Financial Institutions involved in the transaction. More information is provided inside the field data.

consent:expired

The consent has been expired. It was not approved or rejected after 5 minutes from creation OR after approving/rejecting it was not consumed in 70 minutes.

consent:revoke

Consent revoked by user (usualy after approval)

Status Details

Some of the status follow the official brazilian standards, and some of them are specific to our implementation. For more details about the default events see below:

Some definitions are important to handle the transition of consent states at different times of the flow:

AWAITING_AUTHORIZATION

Consent is always created with the status AWAITING_AUTHORISATION. It can be approved only before the 5 minute expiration time, assuming the AUTHORISED status. If not, it must assume the REJECTED status if it expires or is canceled by the user.

Remembering that the user can cancel the consent on the account holder’s side and in turn she must change the consent status to REJECTED.

AUTHORIZED

For the scenario where the status assumed AUTHORISED, the maximum time of the expirationDateTime of the consent must assume “now + 60 minutes”. This is the time to consume the authorized consent, changing its status to CONSUMED. It is not possible to extend this time and the creation of a new consent will be necessary for failure scenarios.

The expirationDateTime time is guaranteed with the 15 minutes of the access token, and it is possible to use three more refresh tokens up to a total of 60 minutes.

REJECTED

In case of expired consent, the Holder must return the REJECTED status.

In case of consent rejected by the user or by the Holder’s business rule, the status must be returned as REJECTED.

CONSUMED

The consent assumes CONSUMED status after processing the initiation of the payment, whether it is successful (HTTP 201) or even in cases of failure (HTTP 422) returned by the Holder. For the other HTTP codes, there is no change in the consent status, it will remain AUTHORISED, respecting the maximum consent expiration time (60 minutes).

PIX Payment Status

The official PIX state machine may be found at State machine Open Finance Brasil - v3.0.0-beta.2 - Payment .

Below is a description of the statuses related to the state machine relevant to the Pix payment types:

RCVD (Received)

The status indicates that the payment request was successfully received by the holder, but there are still validations to be made before it is submitted for settlement.

PATC (Partially Accepted Technical Correct)

The status indicates that the transaction needs confirmation from more authorizers before payment processing can proceed.

CANC (Cancelled)

The status indicates that the pending Pix transaction was successfully canceled by the user before it was confirmed (ACCP) or rejected (RJCT) by the holder.

ACCP (Accepted Customer Profile)

The status indicates that all necessary checks have already been carried out by the holder and that the transaction is ready to be sent for settlement (in the SPI if it is a Pix for another institution or internally if it is for another account at the same institution).

ACPD (Accepted Clearing Processed)

The status indicates that the holder has already submitted the transaction for settlement, but still does not have confirmation whether it was settled or rejected.

RJCT (Rejected)

The status indicates that the transaction was rejected by the holder or the SPI.

ACSC (Accepted Settlement Completed Debtor Account)

The status indicates that the transaction was carried out by the holder or by the SPI.

PDNG (Pending)

The status indicates that the holder has temporarily held the Pix transaction for review.

SCHD (Scheduled)

The status indicates that the Pix transaction was successfully scheduled at the holder.

Related pages