> For the complete documentation index, see [llms.txt](https://docs.bullcredtech.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bullcredtech.com/api-reference/apis-en/guias/consigned-balance.md).

# Assignable Margin

The **payroll-deductible margin** is the maximum amount a customer can commit to installments of payroll-deductible credit, calculated based on their salary and existing payroll deductions. The **available loan amount** is how much the customer can still take out as new credit, considering the last approved credit analysis and the contracts already disbursed after that approval.

***

## What is it and why does it matter?

{% hint style="info" %}
**For non-technical people**

Imagine that an employee can commit at most 35% of their salary to payroll-deducted loan installments. If they earn R$ 5,000 and already have R$ 1,000 in installments, their available margin is R$ 750. The system checks this information automatically before approving any proposal.
{% endhint %}

The margin inquiry happens automatically during the **credit analysis**. The result is used to:

* Decide whether the proposal can be approved
* Calculate the available credit offers (amount and number of installments)
* Enable promotional conditions that require a minimum balance
* Define the **maximum approved limit** that will be used as the basis for the available amount for future contracts

***

## How the Available Amount Is Calculated

The available loan amount is calculated dynamically: it takes part of the **maximum approved limit** in the last credit analysis of the CPF and deducts the amounts of contracts disbursed after that approval.

### Example

```
Maximum limit approved in the last analysis:   R$ 5,000.00
  − Contract disbursed on 21/04:         R$ 1,500.00
  − Contract disbursed on 22/04:         R$   800.00
  ──────────────────────────────────────────────────────
  Available loan amount:         R$ 2,700.00
```

{% hint style="warning" %}
**Consolidated calculation**

The calculation considers all of the customer's disbursed contracts, regardless of origin. This ensures that the approved limit is not used more than once in simultaneous contracts across different channels.
{% endhint %}

The amount is **always non-negative**: if disbursements exceed the approved limit, the result is `R$ 0.00`.

***

## Flow — From Analysis to Available Amount

```mermaid
flowchart TD
    START(["Credit Analysis\nPOST /{id}/credit-analysis"]) --> CONSULT["Margin inquiry\nautomatically performed"]
    CONSULT --> MIN_CHECK{{"Sufficient\navailable margin?"}}
    MIN_CHECK -->|No| REJECTED[/"Rejected\nNO_AVAILABLE_MARGIN"/]
    MIN_CHECK -->|Yes| APPROVED["✅ Proposal approved\nmaximum limit recorded"]

    APPROVED --> DISBURSE["Contract disbursed"]

    DISBURSE --> QUERY(["GET /customers/{cpf}/available-loan-amount"])
    QUERY --> RESULT["available_loan_amount\n(approved limit − later disbursements)"]

    style REJECTED fill:#FFB6C1,color:#000
    style APPROVED fill:#90EE90,color:#000
    style RESULT fill:#90EE90,color:#000
```

***

## Business Rules

### Minimum margin for approval

Proposals with available margin below the configured minimum are rejected with the code `NO_AVAILABLE_MARGIN`.

### Limit at the time of approval

When a proposal is approved, the maximum limit approved at that moment is recorded as a reference (`approval_snapshot.pod_limit_max`, or `promotional_pod_limit_max` , when there is a promotional condition). This is the base value used by the available amount calculation — later disbursements reduce the available amount, but do not change the recorded limit.

### Multiple employment relationships

When the customer has more than one employment relationship (e.g., two jobs), the system automatically selects the most advantageous one, prioritizing active relationships with the highest available margin.

### Eligibility for promotions

Some promotions require a minimum margin balance. If the available balance is lower than required, the promotion is not applied automatically.

***

## Scheduled Maintenance Window

Margin inquiry depends on the availability of external systems. There is a scheduled maintenance window between the **20th and 23rd of each month**, during which new inquiries are unavailable. Proposals started during this period remain pending automatic reprocessing.

See the [Dataprev Calendar](/api-reference/apis-en/guias/dataprev-maintenance.md) for exact dates.

***

## Response Scenarios

### Available amount

**Response `200 OK`:**

```json
{
  "cpf": "12345678909",
  "available_loan_amount": 2700.00,
  "approved_at": "2026-04-20T14:30:00.000Z"
}
```

The field `approved_at` indicates when the credit analysis used as the basis was approved. The `available_loan_amount` already deducts the contracts disbursed since then.

***

### No approved analysis

If the CPF has not yet gone through an approved credit analysis:

**Response `204 No Content`** — empty body.

***

## Field interpretation

| Field                   | Type     | Description                                                                      |
| ----------------------- | -------- | -------------------------------------------------------------------------------- |
| `cpf`                   | string   | Customer CPF queried                                                             |
| `available_loan_amount` | decimal  | Amount available for a new loan. Never negative.                                 |
| `approved_at`           | ISO 8601 | Date and time of the credit approval considered as the basis for the calculation |

{% hint style="success" %}
**Where to use this query**

The endpoint [`GET /customers/{cpf}/available-loan-amount`](/api-reference/apis-en/api-reference-client/get-customers-available-loan-amount.md) is ideal for showing the customer **before** before starting a proposal how much they still have available to contract. For a consolidated view (available amount + customer contracts), use [`GET /customers/{cpf}/summary`](/api-reference/apis-en/api-reference-client/get-customers-summary.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bullcredtech.com/api-reference/apis-en/guias/consigned-balance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
