Collection White label Payment Initiation
Collection Open Keys - Payment Initiation Journey
POST Token
To start a journey, it is necessary to generate a token in which client_id and client_secret must be indicated , according to the model below.
Token generation URL
https://onboard.smartkeys.8429y94d.dev.fsapps.app/api/portal/onboard/v1/token
cURL for Token generation
curl --location 'https://onboard.smartkeys.8429y94d.dev.fsapps.app/api/portal/onboard/v1/token' \
--header 'Content-Type: application/json' \
--data '{
"client_id":"****7ec5-2567-4***-ace9-***",
"client_secret": "****8136-***a-42ce-***"
}'
Response:
{
"access_token": "eyJh******ciOiJ****I1NiIsInR5*****IgOiAiSldUIiwia2lkIiA6ICJJUV96OE****",
"expires_in": 3600,
"refresh_expires_in": 0,
"token_type": "Bearer",
"not-before-policy": 0,
"scope": "email profile"
}
The token returned in the “access_token“ field has a default validity of 1 hour and must be used to make subsequent calls. It must be included in the Authentication parameter of the request header, preceded by the word “Bearer”, example:
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJJUV96OE...'
Mandatory fields to fill in the request:
CPF - mandatory field
Transaction amount - required field
Paymentview - required field
Paymenttype - required field
Specificity for Paymentview and Paymenttype fields
Paymentview PIX Instantâneo - deposit-confirmation
Paymentview PIX Agendado - deposit-deposit-scheduling
Paymenttype via DICT - presents the data registered in the Application Panel, option Configure Journeys, field Receipt data
Paymenttype via MANU - it is necessary to pass the “creditor” and “creditorAccount” blocks, as shown in the sketch below.
How to start the digital journey, using the Data Sharing white label
Once you managed to generate the Token, according to the step by step of the previous step, just make a POST that will return the white label journey link
Mandatory fields to fill in the request:
CPF - mandatory field, in all contexts
CNPJ - required field for a data sharing context for legal entities
Known bugs:
400 - Failed to validate mandatory fields;
401 - Invalid Authentication Token
Alternative journey to start Payment Initiation white label
When starting the journey through the white label, by default, the user is directed to the bank selection screen. As part of this process, it is necessary to send the customer's CPF by parameters in the call to generate the white label link, but in cases where the application that starts the process does not yet have the customer's CPF, there is the possibility of showing the CPF field on this bank selection screen, as well as showing a list of preferred banks on this screen. For these cases, you can use the call below.
Callback Page (Return of the White Label Payment Initiation flow)
After executing the consent flow and payment approval, the user is directed to the callback page registered at the time of onboarding, this page can check the approved payment status and show a thank you/failure message.
How to check the approved payment status update
Changing the status of the initiated payment can be done in 2 ways, registering a Webhook in the application or consulting the status of this consent via API (Polling)
The status parameter can receive the values: "ACCEPTED", "AWAITING_APPROVAL" and "REJECTED"
The status parameter can receive the values: "ACCEPTED", "AWAITING_APPROVAL" and "REJECTED"