ALLOW, REVIEW or DENY. Each check is off by default. You turn it on for your tenant.
The four checks
Each check is a flow. A flow has its own switch, route and credentials.
The
out flow does not screen internal transfers, and the intra_out flow does not screen Pix over SPI. A devolução that you send is not screened.
Sent Pix
With the
out flow on, Pix JD holds the amount on the payer’s account, then asks the partner, and only then sends the order to JD. With the intra_out flow on, an internal transfer also waits for the partner: nothing reaches the payee before the answer. The partner has at most the syncBudgetMs of the route, which is 1500 ms or less.
A
REVIEW refuses the Pix like a DENY.
Pix JD also answers 422 with PIX-0163 in these cases:
- The partner gives no valid decision, and the
postureof the route isCLOSED. - The configuration of the flow is broken, under any posture. Examples are a missing route, a missing credential bundle, an empty
ANTIFRAUD_SECRETS_BACKEND, anhmac-v1secret with fewer than 32 characters, and an address that Pix JD does not call.
OPEN, Pix JD sends the Pix without screening. The check shows origin FALLBACK and the cause. When the secret manager does not answer, the posture of the route applies too.
A refused Pix leaves a transaction with fraudCheck and the status ERROR. It does not count against the period limit. When the ledger does not confirm the release of the hold, the transaction stays PENDING until the worker proves the release. Read it with Retrieve transaction status.
A resend under the same X-Idempotency key answers 409 with PIX-0133, and the partner is not asked again. When Pix JD cannot read the switch or the route of the flow, the call answers a server error and nothing is held.
The transaction of a screened Pix carries fraudCheck: read it with Retrieve transaction status. It holds the decision, its origin (PROVIDER or FALLBACK), the cause, the analysisId, the score and the reasons. The score and the reasons are the partner’s. The text of a reason can name a third party. The transaction.* events carry fraudCheck too. See Pix Direct via JD events.
Received Pix
With the
in flow on, Pix JD asks the partner when JD validates the account of a received Pix, in the synchronous validation and in the asynchronous one. The partner has at most the syncBudgetMs of the route, which is 1000 ms or less.
Pix JD asks the partner last. A Pix that the account checks or your Tracer refuse does not reach the partner. These Pix never reach it either: a devolução, a credit to a customer of an indirect participant, and a Pix from a Bacen payer.
A broken configuration refuses the Pix with
DS04, under any posture. The causes are the same as for a sent Pix. A validation with no endToEndId is refused with DS04 too. When the secret manager does not answer, the posture of the route applies. When Pix JD cannot read the switch or the route, the validation fails with an error and gives no verdict.
Pix JD stores the answer of the partner by endToEndId. When the credit lands, its transaction carries it as fraudCheck. The event cashin.denied announces each received Pix that account validation refused, and carries the answer too. See Pix Direct via JD events.
With the intra_in flow on, Pix JD asks the partner before it books a credit that the other core of your institution relays through JD Courier. A refusal answers 422 with PIX-0163, and Pix JD books nothing.
The outcome of each Pix
When the route of a flow has a
feedbackEndpoint, Pix JD reports how each screened Pix ended. This works for all four flows. A worker sends the report. It sends it for up to 24 hours after the Pix ended.
- For
outandintra_out, the key ispix-out:<transactionId>. - For
inandintra_in, the key ispix-cashin:<endToEndId>.
evaluationKey (the key), analysisId, decisionOrigin (PROVIDER or FALLBACK), outcome and occurredAt. outcome is SETTLED or REJECTED. A received Pix that Pix JD refused is REJECTED, unless its credit landed later: the credit then reports its own outcome under the same key.
The Idempotency-Key is the key, a colon and the outcome. The partner must apply each outcome once. Pix JD sends a report again after a 5xx, 408, 429 or network failure. It never sends again a report that the partner refuses with another 4xx.
Turn a check on
Write the settings in the Pix JD runtime configuration, namespace
tenant_policy, with the Systemplane admin API. The Plugin PIX JD Editor group writes them. For each flow:
The route holds these fields:
endpoint, feedbackEndpoint or tokenUrl only when it is https on a public address, unless its host is in ANTIFRAUD_ALLOWED_PRIVATE_HOSTS. When you write a route that does not meet this rule, Pix JD refuses it. See the environment variables.
In BYOC, Pix JD reads a credential bundle from the secret manager that ANTIFRAUD_SECRETS_BACKEND names. The path is tenants/{env}/single-tenant/plugin-br-pix-jd/external/antifraud-<flow>/credentials. {env} is the value of ENVIRONMENT_NAME, or of ENV_NAME when ENVIRONMENT_NAME is not set: development, staging or production. <flow> is out, intra-out, intra-in or in. The bundle accepts these keys:
secret: the client secret, or the HMAC secret forhmac-v1. It is required for every auth mode. Anhmac-v1secret has at least 32 characters.certPemandkeyPem: an optional client certificate pair. Send both or neither.header.<Name>: an optional header that Pix JD sends on each call.
What the partner receives
With a flow on, Pix JD sends the partner the data it holds of the parties: the name, the CPF or CNPJ, the person type, the ISPB, the branch and the account. The payee of a received Pix carries no name. It also sends the amount, the
endToEndId, the initiation type, the QR code txId when there is one, and the payee’s Pix key. A sent Pix, and a Pix from the other core, also carry the description. A sent Pix also carries the account type and the metadata of the order. A manually typed order goes to the partner without an endToEndId.
What the partner implements
For the full contract the partner implements, see Antifraud partner contract. Pix JD sends each evaluation as a
POST of a JSON body to the endpoint of the route. The headers are:
A sent Pix body has
transferId, endToEndId, flow (EXTERNAL or INTRA), initiationType, transactionType, amount, currency (BRL), description, txId, payer, payee, createdAt and metadata. A received Pix body has endToEndId, flow, initiationType, amount, currency, payer and payee, plus txId on a Pix from another institution and description on a Pix from the other core. A field with no value is left out. Each party has name, taxId, personType, ispb, branch, account, accountType and key. The payer of a sent Pix, the payee of an internal transfer and the payee of a received Pix carry accountId.
Pix JD signs each call with the auth.mode of the route:
hmac-v1:X-Webhook-Timestamphas the Unix time in seconds.X-Webhook-Signatureisv1,sha256=followed by the hex HMAC-SHA256 ofv1:<timestamp>.<raw body>with thesecret.lerian-m2mandoauth2-client-credentials: Pix JD gets a token fromauth.tokenUrlwith theclientIdand thesecret. It sends the token as a bearer token.
200 with a JSON body:
A
202 counts as REVIEW, and it needs an analysisId, unless the body says DENY. Any status other than 200 or 202, or a REVIEW with no valid analysisId, is not a decision. Pix JD then applies the posture of the route.
