Step by step
1
Choose who the partner acts for
Pix JD has two restrictions:
Use them in one of these two ways:
A partner restricted by ISPB alone is the partner of the whole direct participant. It reaches every indirect participant of that direct participant.Do not put the ISPB of an indirect participant in
participantId. Access Manager accepts it, but the partner is then refused on almost every route, and it is not confined to that indirect participant. Use indirectId.2
Give the partner its permissions and scope
Create the partner, or change it, in the Console or with the Identity API. The product slug is
plugin-br-pix-jd. Both restrictions accept several values.- Add at least one restriction for Pix JD. Without one, Access Manager refuses the partner with
400andIDE-1060. - Check the resources and actions. The most you can give is what the
plugin-br-pix-jd-editor-rolerole holds in your tenant. Above that, Access Manager refuses withIDE-1043.
400 and IDE-1056 a write wider than the partner’s scope. The Console marks the line Outside the scope:- A partner with an indirect participant in its scope can receive only these writes: create payments, create refunds, and create or change dynamic QR codes. Every other write acts on the whole direct participant: registering keys, claims, limits, static QR codes, Pix Automático, fraud markers, the actions on MED records, and registering or changing indirect participants.
- Writes that act on the whole tenant, such as the operator actions and the callbacks of the rail, are never given to a partner.
3
Create its Pix JD application
Create the partner’s application with the product
plugin-br-pix-jd. See Create the partner’s applications in the API guide, or in the Console. Send the client ID and the client secret to the partner through a secure channel.4
Name the participant on every request
Every request names who the partner acts for, in a field that Pix JD already has. The value must be inside the partner’s scope. A request that names nobody is refused.A partner of a direct participant names its ISPB:
To pay through one of its indirect participants, it sends its own ISPB in
payerIspb and the indirect participant in indirectId.A partner of an indirect participant names its indirectId:A body field that takes one participant takes one value. Do not send a list in it.
5
Confirm that it works
Use the partner’s credential. Read one of the partner’s own payments, naming its own ISPB. The answer is For a partner of an indirect participant, send
200:indirectId in place of ispb, with its own value.Send the same request with an ISPB outside the partner’s scope. The answer is 403 with PIX-0005. Send it with the ID of a payment of another participant. The answer is 404 with PIX-0147.Routes that no partner reaches
A partner with a Pix JD scope is refused with
403 on these routes:
- The directories that name no participant:
GET /v1/banks,GET /v1/banks/participants, andGET /v1/refunds/reasons. - The composite QR code updates:
PUT /v1/pix-automatico/composite/cobv/{id},PUT /v1/pix-automatico/composite/dynamic/{id}, andPUT /v1/pix-automatico/composite/recurrence/{id}.
If something fails
PIX-0005 does not say whether the permissions or the scope refused the request. This is on purpose: a partner cannot use a refusal to learn which participants exist outside its scope.
For every other code, see the Pix JD error list. For the refusals when you create or change a partner, see Error codes in the API guide.
