> ## 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.

# Settlements and reconciliation

> A settlement is what the MSB pays to LB Pay for remittances funded by credit. LB Pay reconciles every step internally. This section explains how you reconcile your own records.

## Settlements

> [!NOTE]
>
> There is one settlement batch per due date. Amount to pay today = the batch due today.

| Batch status | Meaning | What you do |
| - | - | - |
| `OPEN` | Collecting remittances. The amount can still grow. | Follow it. |
| `CLOSED` | Cut-off reached. Final amount. | Schedule the payment. |
| `DUE` | Due today. | Pay. |
| `OVERDUE` | Due date passed without payment. | Pay and contact LB Pay. |
| `COMPLETED` | Paid and reconciled. | Nothing. |

* Each batch shows due date, period covered, cut-off, number of remittances, total advanced, total advance cost, amount to pay and payment instructions.
* Each batch lists its items: one line per remittance, with the remittance ID, your external ID, the remittance creation date, the amount advanced, the advance cost and the total. The items add up to the batch amount.
* The counterpart is always LB Pay.
* You are notified when a batch opens, closes (final amount), is due today, becomes overdue and is completed.
* Term, currency and payment instructions: \[A DEFINIR em contrato].

## How to reconcile

| To check | Use |
| - | - |
| What was paid, how much and when | Remittances list (filter by period) and detail |
| What you owe and for which remittances | Settlement batches and their items |
| Balance movements | Wallet statements |
| FX spread and costs by period | Remittances list by period: each remittance shows its FX spread. Advance costs are in the settlement batch items. |

## Reconciliation keys

Every remittance carries the same keys everywhere: your external ID, the quote ID, the remittance ID, the settlement ID (credit), the transaction ID of the Pix and the inventory ID (`INVENTORY`).

| Where | External ID | Quote ID | Remittance ID | Settlement ID | Transaction ID | Inventory ID |
| - | - | - | - | - | - | - |
| Quote (after use) | ✓ | ✓ | ✓ | — | — | ✓ (`INVENTORY`) |
| Remittance | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ (`INVENTORY`) |
| Settlement item | ✓ | ✓ | ✓ | ✓ | ✓ | — |
| Wallet statement | ✓ | ✓ | ✓ | ✓ | — | — |
| Receipt | ✓ | ✓ | ✓ | — | ✓ | — |
| Inventory lot | ✓ | ✓ | — | — | — | ✓ |

Inventory → remittances: `GET /v1/remittances?inventoryId=` lists every remittance funded by the lot. The lot carries the `quoteId` that created it and its own `externalId`.

> [!NOTE]
>
> Your external ID is unique in your account and never changes. Use it as the main key in your system.

* Any remittance can be traced end to end by its remittance ID.
* Found a difference? Contact LB Pay support with the remittance or settlement ID. LB Pay investigates and resolves it.

> [!TIP]
>
> **What you do**
>
> * Open the batch due today and pay its amount, once a day.
> * Use your external ID as the main key to reconcile.
> * Report any difference to LB Pay support with the ID.


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