> ## Documentation Index
> Fetch the complete documentation index at: https://developers.javalibridge.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Order of execution

> After the withdrawal is created, LB Pay always follows the same order. Screening comes first. The Pix is sent last.

**1. Screening**

Sanctions and AML checks. May place the remittance `ON_HOLD`, always before FX.

**2. FX**

FX contracted for this remittance.

**3. Funding**

`PREFUNDED`: USD debited from the MSB’s balance in the US. `CREDIT`: BRL advanced.

**4. Key holder check**

LB Pay confirms the Pix key holder is the beneficiary.

**5. Pix**

BRL credited to the beneficiary.

## If funding fails after FX

LB Pay keeps retrying. The remittance stays `PROCESSING` and the funding sub-status shows `RETRYING`. Each failed attempt is notified with `remittance.funding_failed`.

## The Pix key is checked twice

| When | What is checked | If it fails |
| - | - | - |
| At the withdrawal | The key exists. Prevents FX for a key that does not exist. | Withdrawal rejected with `PIX_KEY_NOT_FOUND`. No FX. |
| Just before the Pix | The key holder’s document matches the beneficiary. | Pix not sent. The remittance goes to `FUNDS_HELD_BRL`. |

> [!TIP]
>
> **What you do**
>
> * Do not resend while the remittance is `PROCESSING`.
> * For `PREFUNDED`, check that the USD balance in the US is available.
> * Follow the notifications for the final status.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.