Linked journey (Smart Pix) — single-redirect data and payment consent
The linked journey creates the Open Finance data consent and the Sweeping recurring consent in a single API call, so the payer authenticates once at the account holder instead of going through two separate journeys.
Before this journey existed, offering Smart Pix with account visibility meant running a data-sharing
journey (to read accounts and balances) and a payment journey (to open the recurring consent) — two
redirects, two authorisations, two sets of identifiers to reconcile. Here a single
POST /api/v1/linked-journey/automatic-payments returns one redirectUrl, and after the payer
approves it you can read both the shared account data and the payment contract.
This journey is restricted to Sweeping — transfers between accounts owned by the same holder. For the product rules and the non-linked variant, see Smart Pix.
What a single call does
The API performs these steps server-side before responding:
- Creates the data consent at Data Link (
POST /api/v1/consents) with a fixed permission set defined by the server. - Reads the created consent back to obtain the Data Link
userId. - Creates the internal payment request.
- Creates the Sweeping recurring consent at the account holder, attaching the data consent to the request.
- Returns
redirectUrl(for the holder redirect) anddataConsentId.
Prerequisites
- Obtain an OAuth 2.0 access token as described in
Get your credentials. Every route in this journey requires
the role
epp-userorepp-sub-tenants. - Complete Onboarding so redirect domains are allow-listed for your sub-tenant.
- Call Get registered participants so the payer can
choose an institution — this is where the
organisationIdandauthorisationServerIdrequired by this journey come from.
Sweeping only
Stage 0 — Create the journey and redirect the payer
- Call Create optimized automatic payment
with
organisationId,authorisationServerId, and a nestedrecurringConsentcarryingrecurringConfiguration.sweeping. The payer CPF inrecurringConsent.loggedUser.document.identificationis required — it feeds the data consent. - From 201 Created, persist
data.id,data.dataConsentId, anddata.flowIdserver-side. - Send the payer to
data.redirectUrlto authenticate and approve both consents at the account holder. - After approval, the holder redirects the browser to the
redirectUriyou sent. That URL must be owned and operated by your application (allow-listed on the sub-tenant); Lina does not host it.
Stage 1 — Retrieve the consent and the payer accounts
- Call Get data consent with the
dataConsentIdyou stored, untildata.statusisAUTHORISED. Readdata.userIdfrom the response. - Call Get user accounts with that
userIdto list the payer accounts, balances, and details — use them to let the payer pick the account that will fund the transfers. - Call Get payment request with path
{automaticPaymentsRequestId}=data.iduntildata.consentStatusisAUTHORISED. Readdata.consentIdfrom that response — it is therecurringConsentIdyou need in Stage 2.
Stage 2 — Initiate and track transfers
- With the contract authorised, call
Create recurring payment using
recurringConsentId= thedata.consentIdyou read in Stage 1. No new redirect is needed. Persist the returned payment id. - Poll Get recurring payment for
data.status. Settlement is asynchronous: the payment is first acknowledged asRECEBIDO, moves throughEM_PROCESSAMENTO, and only then reachesPAGOor a terminal failure (REJEITADO,ERRO_NA_DETENTORA,ERRO). On failure, readrejectionReasonandisRetryAllowed. Where available, prefer Webhooks over tight polling. - Repeat this stage for every later transfer under the same contract — the payer is never redirected again.
The transfer rules themselves (limits, same-holder restriction, consent lifecycle) are the ones described in Smart Pix.
Error handling
Every error response uses the same contract: message (array of strings), type, errorCode,
traceId, and statusCode.
errorCode | When it happens | Status |
|---|---|---|
X003-3 | recurringConfiguration.sweeping missing or automatic sent, or recurringConsent.loggedUser.document.identification missing | 400 |
EPM-400 | Request body fails schema validation | 400 |
EPM-401 | Missing, invalid, or expired bearer token | 401 |
EPM-403 | Valid token without the epp-user or epp-sub-tenants role | 403 |
EPM-424 | The account holder institution could not complete the request | 424 |
EPM-500 | Unexpected failure creating the data consent, the payment request, or the recurring consent | 500 |
API reference
Use the Linked journey (Smart Pix) API group in the sidebar for full request and response schemas.