These variables describe a BYOC deployment. On Lerian Cloud, you do not set them.
In the tables below, the Default / Required column shows the default value. A bold qualifier (for example Required) marks variables you must set.
— means no default. 🔒 marks a secret. Inject it at deploy time from your secret store, and never commit it. This page lists variable names and behavior only. It prints no secret values.Server and port
The service listens on the address inSERVER_ADDRESS (default :8080). The liveness, readiness, and version probes bind this same port. See Server for the shared server knobs and Default network ports.
Connections without TLS
JD integration
Credentials, endpoints, retries, and time limits for JD’s OAuth-secured API and its Pix (JDPI) surface.
The two timeouts apply in both deployment modes. A value of
0 or less gives the default. Keep JDPI_TOTAL_TIMEOUT_MS below the timeout of your ingress. Then, on a client request, a JD that does not answer gets 504 PIX-1051 from the rail, not a timeout from the proxy.
Payment-order signing
The key that signs each outbound payment order. They are optional: you need them only when your JD environment requires signed orders. The API reads these variables. The worker does not.
Leave all three empty and the rail sends unsigned orders. Set only some of them, or a value that is not usable, and the rail refuses each payment to another institution with
409 PIX-0136 before it calls JD. For the key, the certificate, and JDPI Cabine, see Payment-order signing.
Dynamic QR code hosting
The rail hosts signed (JWS) dynamic-QR payloads and the JWK set that verifies them. It serves those documents under the host inQRCODE_PUBLIC_BASE_URL. The QR codes reference section gives the public route shapes, the host form without a scheme, and the 77-character payload-URL limit from BACEN. The variables below set the parts that this deployment controls.
Midaz ledger connection
The ledger service endpoints and the machine-to-machine credentials.There is no separate Access Manager address for Midaz. The rail mints its outbound Midaz token against the same Access Manager it validates inbound bearers with,
PLUGIN_AUTH_HOST. See BYOC configuration essentials.
The two
tenant_policy keys start empty. Until you write both of them, the rail refuses every posting, refund, and inbound credit with 409 PIX-0106. For the steps, see Setting up the rail.
Accounting routes
The rail books each Pix flow onto a pair of Midaz operation routes, one credit leg and one debit leg. There are eleven profiles. The route identifiers are not environment variables. They live in the systemplane keystenant_policy/routing.<profile>.operation_credit_route and tenant_policy/routing.<profile>.operation_debit_route. There is no environment fallback.
Each profile also has an optional transaction-route key, tenant_policy/routing.<profile>.transaction_route. The rail sends its value as the route of every posting of that profile. A Midaz ledger that validates routes refuses a posting without one. The rail then answers PIX-4011. When the key is empty, the posting carries no transaction route.
For the profiles, the exact key names, and how to write them, see Setting up the rail.
Jobs
The daily window for transaction limits is not an environment variable. It lives in the systemplane keys
tenant_policy/transaction_limits.daily_period_init and tenant_policy/transaction_limits.daily_period_end, in both deployment modes. Each key takes a clock hour from 0 to 23. The rail ignores the old TRANSACTION_LIMIT_DAILY_PERIOD_INIT and TRANSACTION_LIMIT_DAILY_PERIOD_END variables.Pix Automático
JD’s Pix Automático has two optional steps that stay off until your institution turns them on. The debit itself always runs.
Turn each one on only after your institution agrees with JD to use that step. The rail reads both at startup, so a change needs a restart.
Notifications
Optional end-customer notifications for Pix events. Leave the provider blocks unset to disable that channel.CRM
Courier ownership map
Some institutions share one ISPB between two core systems. JD Courier keeps an ownership map that tells which core holds each account. The rail asks that map in one case only. The payee of an outbound Pix names the paying participant’s own ISPB, and you declare that ISPB as shared.
Pix JD exchanges
COURIER_CLIENT_ID and COURIER_CLIENT_SECRET with Access Manager for a token, and sends that token on each call to JD Courier.
You declare a shared ISPB in the systemplane. The key tenant_policy/onus.shared_ispb_gate_enabled covers your default organization, and its default is false. An organization in the organization catalog uses its sharedIspbGate field. While the declaration is false, the rail does not ask the map.
When the declaration is true, these refusals apply to an outbound Pix to an account at your own ISPB:
The rail refuses before it reserves a balance, so a refusal moves no money.
Three systemplane keys set the time limits of the lookup. They apply in both deployment modes:
Claims on the Courier
See Connecting an engine. When the Courier is configured, the worker claims on the Courier the Pix Automático recurrences that the rail accepted as the payer’s institution. It sends up to 100 claims on each pass. When a claim fails, the worker sends it again on a later pass. The worker does not send again a claim that the Courier refuses with a conflict. The worker reads the Courier settings from the same place as the API. Before the Courier starts to receive your Pix, call the Courier ownership route (POST /v1/pix-automatico/courier-ownership). It claims the recurrences that already exist, and it declares the debit blocks and the schedules of the payments in progress. Call it again after the Courier starts to receive your Pix, to declare the legs that opened between the two calls. The route also claims again the recurrences that the Courier refused before.
heldElsewhere in the answer lists the keys that the Courier refused with a conflict. An operator resolves each one.
Indirect participants
Only relevant if this deployment settles Pix on behalf of other institutions.Runtime configuration (systemplane)
This rail mounts the systemplane admin API on its main port.SYSTEMPLANE_ENABLED turns it on.
When you enable it, the service exposes an authenticated plane to read and write runtime configuration. See Systemplane for the API, namespaces, and required permissions.
The rail reads several values only from that plane, in both deployment modes. A deployment that leaves them unset starts healthy and refuses money:
With
SYSTEMPLANE_ENABLED=false, the service does not mount the /system route group. Every configuration write then answers 404. A money path that cannot read its configuration answers the retryable 503 PIX-0051, not a provisioning refusal. The write permission is systemplane:write. Without it, the writes answer 403.Permission declaration
At startup, the service can publish its permission declaration to the Access Manager.
With
IDP_DECLARATION_ENABLED=true, the service does not start when one of the other three variables is empty, when IDP_HOST is not valid, or when PLUGIN_AUTH_ENABLED is not true. When the Access Manager refuses the publication or does not answer, the service still starts.
Upgrade from an earlier version
Do the steps for each version that you pass on the way to the version that you install. To 1.2.1. The rail no longer readsMULTI_TENANT_ALLOW_INSECURE_HTTP. In multi-tenant mode with an http:// Tenant Manager, set ALLOW_INSECURE_TLS=true on the API and on the worker before the upgrade. Otherwise the service does not start. If your deployment already sets ALLOW_INSECURE_TLS=true, Pix JD 1.2.1 and later also accept http:// addresses for the connections in Connections without TLS, in every environment.
To 1.2.0. On a self-hosted deployment, before the upgrade, make sure that the Pix roles in the Access Manager have the permission courier-ownership (action post), and give the application that COURIER_CLIENT_ID names the ownership:write permission in JD Courier. The Courier ownership route of this version needs courier-ownership, and it answers 403 without it. On a single-tenant deployment, also set the CRM_* variables, and with JD Courier the COURIER_* variables, on the worker. See Claims on the Courier.
To 1.1.1. No step is required. The three payment-order signing variables are new and optional. Set them only if JD requires signed payment orders for your institution. See Payment-order signing.
To 1.1.0. Before the upgrade, make sure that the Pix roles in the Access Manager have the permission entries-lookup (action get). The key lookup route of this version needs it, and it answers 403 without it.
To 1.0.0, from the earlier Pix plugin.
-
Before the upgrade, write
tenant_policy/midaz.asset_idandtenant_policy/midaz.external_id. Use the values fromMIDAZ_ASSET_IDandMIDAZ_EXTERNAL_ID. Without them, the upgraded rail refuses every posting with409 PIX-0106. -
Read
tenancy/jd_integration_bindingback. Make sure thatorganizationIdandledgerIdname the organization and the ledger that this deployment posts into. The rail reads them on every call. -
Before you upgrade, set
MIDAZ_FEE_MODE=legacyon the API and on the worker. The default isauto. Change the value toautoonly after both of these are true:- No pod of the earlier release serves any tenant.
- You reviewed your fee packages. A fee package with no transaction route can charge a fee on every Pix flow.
refundSententry to the organization catalog only after no pod of the earlier release serves the tenant. - With event streaming on, the service does not start while its outbox holds undelivered events in an earlier event format. Deliver those events with the build that wrote them before you upgrade.
-
After the upgrade, remove the four
MIDAZ_*identity variables from your environment.
Health and readiness
The rail exposesGET /health (liveness) and GET /readyz (readiness) on the main port, plus /metrics and /version. See Health and readiness for the response shape.
